Files
dtic-DIIAA/servicios/sysacad/.next/static/chunks/app/estudiante/plan-de-estudio/page-b7750d56d4974ff8.js
T

1 line
4.1 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5892],{6387:function(e,r,t){Promise.resolve().then(t.bind(t,1656)),Promise.resolve().then(t.bind(t,8001))},1656:function(e,r,t){"use strict";t.d(r,{default:function(){return m}});var a=t(7437),s=t(2265),n=t(3464),i=t(3330),o=t(5740);let c=async(e,r,t)=>{try{return(await n.Z.post("".concat(i.Q,"/api/v1/legacy105"),{especialidad:e,plan:r,tipo:1,facultad:t},{headers:{Authorization:"".concat((0,o.B)())}})).data.registros}catch(e){throw Error(e.response.data.statussalida)}},d=async(e,r,t)=>{try{return(await n.Z.post("".concat(i.Q,"/api/v1/legacy104"),{especialidad:e,plan:r,tipo:1,facultad:t},{headers:{Authorization:"".concat((0,o.B)())}})).data.registros}catch(e){throw Error(e.response.data.statussalida)}};var l=t(802),u=t(9317),h=t(3014);let p={"1c":"Primer Cuatrimestre","1/2c":"Primer y Segundo Cuatrimestre","2c":"Segundo Cuatrimestre",anual:"Anual"};var m=()=>{let[e]=(0,l.Z)("materias",[]),{user:r}=(0,h.a)(),[t,n]=(0,s.useState)([]),[i,o]=(0,s.useState)(!1);(0,s.useMemo)(()=>t,[t]);let m=async e=>{o(!0);let[r,t]=await Promise.all([c(e.currentUser.especialidad,e.currentUser.plan,e.currentUser.facultad),d(e.currentUser.especialidad,e.currentUser.plan,e.currentUser.facultad)]);n(r.map(e=>{for(let r=0;r<t.length;r++)if(t[r].codigo===e.materia)return{...e,condicion:t[r].condicion};return{...e}})),o(!1)};return((0,s.useEffect)(()=>{i||t.length||!r||m(r)},[i,t,m,r]),i)?(0,a.jsx)(u.Z,{mensaje:"Cargando informaci\xf3n"}):(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white px-5 pt-6 pb-2.5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:pb-1",children:[(0,a.jsx)("div",{className:"flex justify-between pb-4",children:(0,a.jsx)("div",{className:"w-100 relative"})}),(0,a.jsxs)("div",{className:"max-w-full overflow-x-auto",children:[(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-gray-2 text-left dark:bg-meta-4",children:[(0,a.jsx)("th",{className:"py-4 px-4 font-medium text-center text-black dark:text-white",children:"A\xf1o"}),(0,a.jsx)("th",{className:"py-4 px-4 font-medium text-black dark:text-white",children:"Materia"}),(0,a.jsx)("th",{className:"py-4 px-4 font-medium text-black dark:text-white",children:"Dictado"})]})}),(0,a.jsx)("tbody",{children:t.map((e,r)=>{var t,s;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"text-sm text-center border-b border-[#eee] dark:border-strokedark",children:e.año}),(0,a.jsx)("td",{className:"border-b border-[#eee] py-5 px-4 pl-5 dark:border-strokedark",children:(0,a.jsx)("h5",{className:"font-medium text-black dark:text-white",children:e.nombre})}),(0,a.jsx)("td",{className:"text-sm border-b border-[#eee] py-5 px-4 dark:border-strokedark",children:null!==(s=p[null===(t=e.cuatrimestre)||void 0===t?void 0:t.toLowerCase()])&&void 0!==s?s:e.cuatrimestre})]},r)})})]}),(0,a.jsxs)("div",{className:"flex justify-between px-6 pt-5 pb-5 border-t border-stroke",children:[(0,a.jsx)("div",{className:"flex"}),(0,a.jsx)("p",{className:"font-medium"})]})]})]})}},4474:function(e,r,t){"use strict";t.d(r,{o:function(){return s}});class a extends Error{}function s(e,r){let t;if("string"!=typeof e)throw new a("Invalid token specified: must be a string");r||(r={});let s=!0===r.header?0:1,n=e.split(".")[s];if("string"!=typeof n)throw new a(`Invalid token specified: missing part #${s+1}`);try{t=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=r,decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(n)}catch(e){throw new a(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new a(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}a.prototype.name="InvalidTokenError"}},function(e){e.O(0,[3587,9070,4609,5947,8316,798,1320,8001,2971,2117,1744],function(){return e(e.s=6387)}),_N_E=e.O()}]);