(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2366],{8236:function(e,r,t){Promise.resolve().then(t.bind(t,8877)),Promise.resolve().then(t.t.bind(t,5878,23)),Promise.resolve().then(t.t.bind(t,2972,23))},575:function(e,r,t){"use strict";t.d(r,{V:function(){return n}});let n=(0,t(2265).createContext)({user:null,setUser:()=>{}})},3014:function(e,r,t){"use strict";t.d(r,{a:function(){return l}});var n=t(2265),s=t(575);let u=()=>{let[e,r]=(0,n.useState)(null);return{value:e,setItem:(e,t)=>{localStorage.setItem(e,t),r(t)},getItem:e=>{let t=localStorage.getItem(e);return r(t),t},removeItem:e=>{localStorage.removeItem(e),r(null)}}},a=()=>{let{user:e,setUser:r}=(0,n.useContext)(s.V),{setItem:t}=u();return{user:e,addUser:e=>{r(e),t("user",JSON.stringify(e))},removeUser:()=>{r(null),t("user","")},setUser:r}},l=()=>{let{user:e,addUser:r,removeUser:t,setUser:s}=a(),{getItem:l,setItem:o}=u(),[i,c]=(0,n.useState)(null),[d,f]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=l("user");e&&!i&&(r(JSON.parse(e)),c(JSON.parse(e)))},[r,l,i]),{user:i,login:e=>{f(!1),r(e),f(!0)},loging:d,logout:()=>{s(null),c(null),t()},setUser:s,getUser:()=>{let e=l("user");return e&&!i?(r(JSON.parse(e)),c(JSON.parse(e)),JSON.parse(e)):null},updateUser:e=>{o("user",JSON.stringify(e)),c(e)}}}},8877:function(e,r,t){"use strict";t.d(r,{default:function(){return l}});var n=t(7437);t(7960),t(2336),t(7337);var s=t(575),u=t(3014),a=t(9376);function l(e){let{children:r}=e,{user:t,setUser:l}=(0,u.a)();return t&&(0,a.redirect)("/estudiante/menu-principal"),(0,n.jsx)(s.V.Provider,{value:{user:t,setUser:l},children:(0,n.jsx)("html",{suppressHydrationWarning:!0,lang:"en",children:(0,n.jsx)("body",{children:(0,n.jsx)("div",{className:"rounded-sm border border-stroke bg-whiten shadow-default dark:border-strokedark dark:bg-boxdark",children:(0,n.jsx)("div",{className:"h-screen overflow-auto",children:(0,n.jsx)("div",{className:"relative flex-1 flex-col h-screen",children:(0,n.jsx)("main",{children:(0,n.jsx)("div",{className:"mx-auto max-w-screen-2xl",children:r})})})})})})})})}},9376:function(e,r,t){"use strict";var n=t(5475);t.o(n,"redirect")&&t.d(r,{redirect:function(){return n.redirect}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})},2336:function(){},7960:function(){},7337:function(){}},function(e){e.O(0,[3587,9070,4609,2971,2117,1744],function(){return e(e.s=8236)}),_N_E=e.O()}]);