(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69344,78433],{29156:(e,t,s)=>{"use strict";function a(e){if(!e)return!1;let t=e.split("?")[0]||e;return"/dashboard"===t||t.startsWith("/dashboard/")}function n(e){if(!e)return!1;let t=e.split("?")[0]||e;return"/admin"===t||t.startsWith("/admin/")}s.d(t,{M:()=>a,P:()=>n})},69344:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(95155),n=s(12115),r=s(30571),i=s(30313),l=s(75560),u=s(2581);let o={PENDING:"Pending",SUBMITTED:"Submitted",CHECKED:"Checked",LATE:"Late",MISSING:"Missing"},d={PENDING:"bg-slate-100 text-slate-700",SUBMITTED:"bg-sky-50 text-sky-800",CHECKED:"bg-emerald-50 text-emerald-800",LATE:"bg-amber-50 text-amber-800",MISSING:"bg-rose-50 text-rose-800"};function c(){let[e,t]=(0,n.useState)([]),[s,c]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=!1;return(0,l.aA)().then(s=>{e||t(s)}).catch(t=>{e||(0,u.Qg)(t instanceof Error?t.message:"Failed to load homework")}).finally(()=>{e||c(!1)}),()=>{e=!0}},[]),(0,a.jsx)(r.o,{title:"Homework",description:"Assignments for your class, with your evaluation status.",children:s?(0,a.jsx)("div",{className:"space-y-3 animate-pulse",children:Array.from({length:3}).map((e,t)=>(0,a.jsx)("div",{className:"h-28 rounded-lg bg-slate-100"},t))}):0===e.length?(0,a.jsx)(i.i0,{title:"No homework yet",description:"When teachers assign work to your class, it will appear here."}):(0,a.jsx)("ul",{className:"space-y-3",children:e.map(e=>(0,a.jsx)("li",{children:(0,a.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-white p-4 shadow-sm sm:p-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-semibold text-slate-900",children:e.title}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[e.subject?.name||"General",e.assignedDate?` \xb7 Assigned ${e.assignedDate}`:"",e.dueDate?` \xb7 Due ${e.dueDate}`:"",null!=e.maxMarks?` \xb7 Max ${e.maxMarks}`:""]})]}),(0,a.jsxs)("span",{className:`rounded-md px-2 py-0.5 text-xs font-semibold ${d[e.myEvaluation.status]||d.PENDING}`,children:[o[e.myEvaluation.status]||e.myEvaluation.status,null!=e.myEvaluation.marks?` \xb7 ${e.myEvaluation.marks}`:""]})]}),e.description?(0,a.jsx)("p",{className:"mt-3 whitespace-pre-wrap text-sm text-slate-600",children:e.description}):null,e.myEvaluation.remarks?(0,a.jsxs)("p",{className:"mt-2 text-sm text-slate-800",children:["Teacher remark: ",e.myEvaluation.remarks]}):null]})},e.id))})})}},71988:(e,t,s)=>{Promise.resolve().then(s.bind(s,69344))},73321:(e,t,s)=>{"use strict";var a=s(74645);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},99462:(e,t,s)=>{"use strict";s.d(t,{Fb:()=>h,b:()=>i,sK:()=>x});var a=s(73321),n=s(12115);let r="academy-route-change";function i(){window.dispatchEvent(new Event(r))}let l=new Set,u=!1;function o(){u||(u=!0,setTimeout(()=>{u=!1,l.forEach(e=>{try{e()}catch{}})},0))}function d(e){l.add(e);let t=()=>o();return window.addEventListener("popstate",t),window.addEventListener(r,t),()=>{l.delete(e),window.removeEventListener("popstate",t),window.removeEventListener(r,t)}}function c(){return window.location.pathname||"/"}function m(){return window.location.search||""}function h(){return(0,n.useSyncExternalStore)(d,m,()=>"")}function x(){let e=(0,a.usePathname)()||"/",t=(0,n.useSyncExternalStore)(d,c,()=>e);return((0,n.useEffect)(()=>{o()},[]),t&&t!==e)?t:e}}},e=>{e.O(0,[35760,92619,59185,98500,62007,76541,30313,16645,28441,93794,77358],()=>e(e.s=71988)),_N_E=e.O()}]);