1/*! For license information please see 9175.de6a6f41.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[9175],{268:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},606:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},3278:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},15243:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},36493:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},38284:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},39360:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},43654:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},73142:(e,t,s)=>{s.d(t,{A:()=>r});const r=(0,s(7101).A)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},75854:(e,t,s)=>{s.d(t,{x0:()=>a,xn:()=>o});const r=(e,t,s,r,n)=>({id:e,name:t,type:s,hours:r,description:n}),n=(e,t,s,n,a,i,l)=>({id:e,name:t,order:s,totalHours:n+a+i,topics:[...n?[r(`${e}-theory`,`${t}: classroom theory`,"theory",n,l)]:[],...a?[r(`${e}-skills`,`${t}: supervised skills lab`,"practical",a,`Instructor demonstration, student practice, and competency evaluation for ${t.toLowerCase()}.`)]:[],...i?[r(`${e}-clinical`,`${t}: clinical application`,"clinical",i,`Supervised clinical integration of ${t.toLowerCase()} knowledge, skills, and professional behavior.`)]:[]]}),a={courseId:"cna-traditional-108-hour",courseName:"CNA Traditional \u2014 108-Hour Program",programId:"cna-traditional",classDays:20,description:"Washington nursing assistant training with integrated classroom theory, skills laboratory, and supervised clinical practice.",requiredHours:{theory:35,skillsLab:33,clinical:40,total:108},modules:[n("na-role-regulations","Nursing Assistant Role & Regulations",1,4,1,0,"Scope of practice, delegation, ethics, professionalism, documentation, and Washington credentialing requirements."),n("resident-rights-independence","Resident Rights & Independence",2,4,2,4,"Privacy, dignity, choice, cultural respect, abuse prevention, mandatory reporting, and promotion of independence."),n("communication-interpersonal","Communication & Interpersonal Skills",3,4,2,4,"Person-centered communication, care-team reporting, conflict resolution, and communication with residents experiencing sensory or cognitive changes."),n("infection-control","Infection Prevention & Control",4,4,4,4,"Standard precautions, hand hygiene, PPE, transmission prevention, exposure response, and environmental safety."),n("safety-emergency","Safety & Emergency Procedures",5,4,4,4,"Resident identification, fall prevention, fire and disaster response, choking, recognizing emergencies, and reporting changes in condition."),n("basic-nursing-skills","Basic Nursing Skills",6,6,8,10,"Vital signs, observation, measurement, specimen collection, intake and output, positioning, skin care, and reporting abnormal findings."),n("restorative-services","Basic Restorative Services",7,3,4,5,"Mobility, transfers, range of motion, assistive devices, positioning, and supporting each resident\u2019s highest practicable function."),n("personal-care","Personal Care Skills",8,4,6,6,"Bathing, grooming, oral care, dressing, toileting, nutrition, hydration, feeding, comfort, and dignity."),n("life-transitions","Life Transitions & End-of-Life Care",9,2,2,3,"Aging, loss, grief, dementia-related needs, comfort care, postmortem c
2are, and support for residents and families.")]},i={courseId:"hca-cna-bridge-40-hour",courseName:"HCA\u2013CNA Bridge \u2014 40-Hour Program",programId:"hca-cna-bridge",classDays:5,description:"Washington alternative nursing assistant training for students who hold an active home care aide-certified credential.",requiredHours:{theory:17,skillsLab:13,clinical:6,enrichment:4,total:40},modules:[n("bridge-role-rights","Nursing Assistant Role, Regulations & Resident Rights",1,4,1,0,"The nursing assistant role, facility-based practice, resident rights, and promotion of independence."),n("bridge-communication-infection-safety","Communication, Infection Control & Safety",2,5,3,1,"Facility communication, infection prevention, emergency response, and safe care procedures."),n("bridge-nursing-restorative","Basic Nursing & Restorative Skills",3,5,6,3,"Nursing observations, measurements, reporting, mobility, transfers, positioning, and restorative care."),n("bridge-personal-life-transitions","Personal Care & Life Transitions",4,3,3,2,"Facility-based personal care, nutrition, elimination, dementia-related needs, loss, grief, and end-of-life care."),{id:"bridge-program-enrichment",name:"Program Orientation & Exam Preparation",order:5,totalHours:4,topics:[r("bridge-enrichment","Facility orientation, integrated review, and competency exam preparation","enrichment",4,"Huduma program hours provided in addition to the 36-hour regulatory minimum.")]}]},l={"cna-traditional":a,"hca-cna-bridge":i},o=e=>l[e]||a},79175:(e,t,s)=>{s.r(t),s.d(t,{default:()=>w});var r=s(9950),n=s(73814),a=s(23849),i=s(56600),l=s(75854),o=s(15243),c=s(73142),d=s(606),m=s(12434),x=s(65253),u=s(38284),h=s(7101);const g=(0,h.A)("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);var p=s(268),b=s(36493),f=s(3278),y=s(43654),j=s(39360);const N=(0,h.A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var v=s(44414);const w=()=>{const[e]=(0,n.ok)(),t=(0,n.Zp)(),s=e.get("token"),[h,w]=(0,r.useState)(null),[k,A]=(0,r.useState)(!0),[S,C]=(0,r.useState)(null),[R,I]=(0,r.useState)(!1),[P,T]=(0,r.useState)(!1),[H,M]=(0,r.useState)(!1),[L,q]=(0,r.useState)("attendance"),[D,F]=(0,r.useState)([]),[$,E]=(0,r.useState)([]),[_,z]=(0,r.useState)(""),[B,G]=(0,r.useState)([]),[U,O]=(0,r.useState)(""),[J,W]=(0,r.useState)({}),V=(0,r.useMemo)(()=>function(){const e=[];for(const t of l.x0.modules){if(t.topics)for(const s of t.topics)e.push({id:s.id,name:s.name,module:t.name,moduleId:t.id,hours:s.hours||0,type:s.type});if(t.lessons)for(const s of t.lessons)if(s.topics)for(const r of s.topics)e.push({id:r.id,name:r.name,module:t.name,moduleId:t.id,lesson:s.name,hours:r.hours||0,type:r.type})}return e}(),[]),Y=(0,r.useMemo)(()=>{const e={};for(const t of V)e[t.moduleId]||(e[t.moduleId]={name:t.module,topics:[]}),e[t.moduleId].topics.push(t);return e},[V]);(0,r.useEffect)(()=>{(async()=>{if(!s)return C("No report token provided. Please use the link from your email."),void A(!1);try{var e;const t=await(0,a.x7)((0,a.H9)(i.db,"teacherReportTokens",s));if(!t.exists())return C("Invalid or expired link. Please contact the admin for a new link."),void A(!1);const r=t.data();if(null!==(e=r.expiresAt)&&void 0!==e&&e.toDate&&r.expiresAt.toDate()<new Date)return C("This link has expired. Please request a new one from admin."),void A(!1);const n=r.date||(new Date).toISOString().split("T")[0],l=(0,a.P)((0,a.rJ)(i.db,"teacherReports"),(0,a._M)("teacherId","==",r.teacherId),(0,a._M)("date","==",n));(await(0,a.GG)(l)).empty||I(!0),w({id:r.teacherId,name:r.teacherName,email:r.teacherEmail,date:n});const o=(0,a.P)((0,a.rJ)(i.db,"students"),(0,a._M)("status","==","active"),(0,a.My)("fullName")),c=await(0,a.GG)(o);F(c.docs.map(e=>({id:e.id,fullName:e.data().fullName,email:e.data().email})))}catch(t){console.error("Token validation error:",t),C("Something went wrong. Please try again.")}finally{A(!1)}})()},[s]);const Z=D.filter(e=>{var t;return!_||(null===(t=e.fullName)||void 0===t?void 0:t.toLowerCase().includes(_.toLowerCase()))}),K=V.filter(e=>B.includes(e.id)),Q=K.reduce((e,t)=>
2e+t.hours,0),X=D.filter(e=>$.includes(e.id)),ee=e=>e?new Date(e+"T12:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"";return k?(0,v.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,v.jsxs)("div",{className:"text-center",children:[(0,v.jsx)("div",{className:"w-10 h-10 border-[3px] border-blue-600 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,v.jsx)("p",{className:"text-gray-500 text-sm",children:"Verifying your link..."})]})}):S?(0,v.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center px-4",children:(0,v.jsxs)("div",{className:"text-center max-w-md",children:[(0,v.jsx)(o.A,{className:"h-16 w-16 text-red-300 mx-auto mb-4"}),(0,v.jsx)("h1",{className:"text-xl font-bold text-gray-900 mb-2",children:"Unable to Load Report"}),(0,v.jsx)("p",{className:"text-gray-500 mb-6",children:S}),(0,v.jsx)(n.N_,{to:"/",className:"text-blue-600 font-medium hover:underline text-sm",children:"Go to Homepage"})]})}):R&&!H?(0,v.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center px-4",children:(0,v.jsxs)("div",{className:"text-center max-w-md",children:[(0,v.jsx)(c.A,{className:"h-16 w-16 text-green-400 mx-auto mb-4"}),(0,v.jsx)("h1",{className:"text-xl font-bold text-gray-900 mb-2",children:"Report Already Submitted"}),(0,v.jsxs)("p",{className:"text-gray-500 mb-2",children:["You've already submitted your report for ",(0,v.jsx)("strong",{children:ee(null===h||void 0===h?void 0:h.date)}),"."]}),(0,v.jsx)("p",{className:"text-gray-400 text-sm",children:"Contact admin if you need to submit a correction."})]})}):H?(0,v.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center px-4",children:(0,v.jsxs)("div",{className:"text-center max-w-lg w-full",children:[(0,v.jsx)("div",{className:"w-16 h-16 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-5",children:(0,v.jsx)(c.A,{className:"h-9 w-9 text-green-500"})}),(0,v.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Report Submitted!"}),(0,v.jsxs)("p",{className:"text-gray-500 mb-6",children:["Thank you, ",(0,v.jsx)("strong",{children:h.name}),". Here's your summary for ",ee(h.date),"."]}),(0,v.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-6",children:[(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 text-center",children:[(0,v.jsxs)("p",{className:"text-2xl font-bold text-blue-600",children:[$.length,"/",D.length]}),(0,v.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Students Attended"})]}),(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 text-center",children:[(0,v.jsx)("p",{className:"text-2xl font-bold text-green-600",children:B.length}),(0,v.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Topics Covered (",Q.toFixed(1),"h)"]})]})]}),(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 text-left text-sm mb-4",children:[(0,v.jsxs)("p",{className:"font-semibold text-gray-700 mb-2 flex items-center",children:[(0,v.jsx)(d.A,{className:"h-4 w-4 mr-1.5 text-blue-500"})," Students Present"]}),(0,v.jsx)("div",{className:"flex flex-wrap gap-1.5",children:X.map(e=>(0,v.jsx)("span",{className:"bg-blue-50 text-blue-700 text-xs font-medium px-2.5 py-1 rounded-full",children:e.fullName},e.id))})]}),(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 text-left text-sm",children:[(0,v.jsxs)("p",{className:"font-semibold text-gray-700 mb-2 flex items-center",children:[(0,v.jsx)(m.A,{className:"h-4 w-4 mr-1.5 text-green-500"})," Topics Covered"]}),K.map(e=>(0,v.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-gray-50 last:border-0",children:[(0,v.jsx)("span",{className:"text-gray-600",children:e.name}),(0,v.jsxs)("span",{className:"text-xs text-gray-400",children:[e.hours,"h"]})]},e.id))]})]})}):(0,v.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,v.jsx)("header",{className:"bg-white border-b border-gray-200 sticky top-0 z-30",children:(0,v.jsx)("div",{className:"max-w-2xl mx-auto px-4 py-3 sm:py-4",children:(0,v.jsxs)("div",{className:"flex items-center justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,v.jsx)("div",{className:"w-8 h-8 rounded-lg bg-blue-600 flex items-center justify-center",children:(0,v.jsx)(x.A,{className:"h-4 w-4 text-white"})}),(0,v.jsx)("span",{className:"text-lg font-bold text-gray-900",children:"CNA Training"})]}),(0,v.jsxs)("div",{className:"text-right",children:[(0,v.jsx)("p",{className:"text-xs text-gray-400",children:"Daily Report"}),(0,v.jsx)("p",{className:"text-sm font-semibold text-gray-700",children:h.name})]})]})})}),(0,v.jsxs)("main",{className:"max-w-2xl mx-auto px-4 py-6 sm:py-8",children:[(0,v.jsxs)("div",{className:"bg-gradient-to-r from-blue-600 to-blue-700 rounded-xl p-5 sm:p-6 text-white mb-6 shadow-sm",children:[(0,v.jsx)("p",{className:"text-blue-200 text-sm font-medium mb-1",children:"Teaching Report For"}),(0,v.jsx)("p",{className:"text-xl sm:text-2xl font-bold",children:ee(h.date)})]}),(0,v.jsxs)("div",{className:"flex items-center mb-6",children:[(0,v.jsxs)("div",{className:"flex items-center "+("attendance"===L?"text-blue-600":"text-green-600"),children:[(0,v.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold "+("attendance"===L?"bg-blue-600 text-white":"bg-green-100 text-green-600"),children:"attendance"===L?"1":(0,v.jsx)(c.A,{className:"h-4 w-4"})}),(0,v.jsx)("span",{className:"ml-2 text-sm font-semibold",children:"Attendance"})]}),(0,v.jsx)("div",{className:"flex-1 h-px bg-gray-200 mx-3"}),(0,v.jsxs)("div",{className:"flex items-center "+("topics"===L?"text-blue-600":"text-gray-400"),children:[(0,v.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold "+("topics"===L?"bg-blue-600 text-white":"bg-gray-100 text-gray-400"),children:"2"}),(0,v.jsx)("span",{className:"ml-2 text-sm font-semibold",children:"Topics & Submit"})]})]}),"attendance"===L&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 shadow-sm",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,v.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,v.jsx)(d.A,{className:"h-5 w-5 text-blue-600"}),(0,v.jsx)("h2",{className:"text-base font-bold text-gray-900",children:"Student Attendance"})]}),(0,v.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,v.jsxs)("span",{className:"text-sm font-semibold text-blue-600",children:[$.length,"/",D.length]}),(0,v.jsx)("button",{onClick:()=>{const e=Z.map(e=>e.id),t=e.every(e=>$.includes(e));E(t?t=>t.filter(t=>!e.includes(t)):t=>[...new Set([...t,...e])])},className:"text-xs font-medium text-blue-600 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 px-2.5 py-1 rounded-lg transition-colors",children:Z.every(e=>$.includes(e.id))?"Deselect All":"Select All"})]})]}),(0,v.jsxs)("div",{className:"relative",children:[(0,v.jsx)(u.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,v.jsx)("input",{type:"text",placeholder:"Search students...",value:_,onCh
2ange:e=>z(e.target.value),className:"w-full pl-9 pr-4 py-2.5 rounded-lg border border-gray-200 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent placeholder-gray-400"})]})]}),(0,v.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden shadow-sm mb-6 divide-y divide-gray-50",children:0===Z.length?(0,v.jsxs)("div",{className:"p-8 text-center text-gray-400",children:[(0,v.jsx)(d.A,{className:"h-8 w-8 mx-auto mb-2"}),(0,v.jsx)("p",{className:"text-sm",children:_?"No students match your search":"No active students found"})]}):Z.map(e=>{var t;const s=$.includes(e.id);return(0,v.jsxs)("button",{onClick:()=>{return t=e.id,void E(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},className:"flex items-center w-full px-4 py-3 text-left hover:bg-gray-50 transition-colors "+(s?"bg-blue-50/40":""),children:[(0,v.jsx)("div",{className:"w-5 h-5 rounded-md border-2 flex items-center justify-center mr-3 flex-shrink-0 transition-colors "+(s?"bg-blue-600 border-blue-600":"border-gray-300"),children:s&&(0,v.jsx)(c.A,{className:"h-3.5 w-3.5 text-white"})}),(0,v.jsxs)("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[(0,v.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 text-xs font-bold "+(s?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-500"),children:null===(t=e.fullName)||void 0===t?void 0:t.split(" ").map(e=>e[0]).join("").substring(0,2).toUpperCase()}),(0,v.jsx)("p",{className:"text-sm truncate "+(s?"font-semibold text-gray-900":"text-gray-700"),children:e.fullName})]}),s&&(0,v.jsx)(g,{className:"h-4 w-4 text-blue-600 flex-shrink-0"})]},e.id)})}),(0,v.jsxs)("button",{onClick:()=>q("topics"),className:"w-full flex items-center justify-center px-6 py-3.5 bg-blue-600 text-white font-semibold rounded-xl hover:bg-blue-700 transition-colors shadow-sm text-base",children:["Continue to Topics ",(0,v.jsx)(p.A,{className:"h-4 w-4 ml-2"})]}),(0,v.jsx)("p",{className:"text-center text-xs text-gray-400 mt-2",children:0===$.length?"You can continue without selecting students":`${$.length} student${1!==$.length?"s":""} marked present`})]}),"topics"===L&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-4 mb-4 flex items-center justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,v.jsx)(g,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,v.jsxs)("div",{children:[(0,v.jsxs)("p",{className:"text-sm font-semibold text-green-900",children:[$.length," student",1!==$.length?"s":""," present"]}),(0,v.jsxs)("p",{className:"text-xs text-green-600",children:["out of ",D.length," active students"]})]})]}),(0,v.jsxs)("button",{onClick:()=>q("attendance"),className:"text-xs font-medium text-green-700 hover:text-green-800 bg-green-100 hover:bg-green-200 px-2.5 py-1 rounded-lg transition-colors flex items-center",children:[(0,v.jsx)(b.A,{className:"h-3 w-3 mr-1"})," Edit"]})]}),B.length>0&&(0,v.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4 mb-4 flex items-center justify-between",children:(0,v.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,v.jsx)(m.A,{className:"h-5 w-5 text-blue-600 flex-shrink-0"}),(0,v.jsxs)("div",{children:[(0,v.jsxs)("p",{className:"text-sm font-semibold text-blue-900",children:[B.length," topic",1!==B.length?"s":""," selected"]}),(0,v.jsxs)("p",{className:"text-xs text-blue-600",children:[Q.toFixed(1)," total hours"]})]})]})}),(0,v.jsx)("div",{className:"space-y-3 mb-6",children:Object.entries(Y).map(e=>{let[t,s]=e;const r=s.topics.filter(e=>B.includes(e.id)).length,n=J[t];return(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden shadow-sm",children:[(0,v.jsxs)("button",{onClick:()=>(e=>W(t=>({...t,[e]:!t[e]})))(t),className:"flex items-center justify-between w-full px-4 py-3.5 hover:bg-gray-50 transition-colors text-left",children:[(0,v.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,v.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 "+(r>0?"bg-blue-100 text-blue-600":"bg-gray-100 text-gray-400"),children:(0,v.jsx)(m.A,{className:"h-4 w-4"})}),(0,v.jsxs)("div",{className:"min-w-0",children:[(0,v.jsx)("p",{className:"text-sm font-semibold text-gray-900 truncate",children:s.name}),(0,v.jsxs)("p",{className:"text-xs text-gray-400",children:[s.topics.length," topic",1!==s.topics.length?"s":""]})]})]}),(0,v.jsxs)("div",{className:"flex items-center space-x-2 flex-shrink-0",children:[r>0&&(0,v.jsx)("span",{className:"bg-blue-600 text-white text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center",children:r}),n?(0,v.jsx)(f.A,{className:"h-4 w-4 text-gray-400"}):(0,v.jsx)(y.A,{className:"h-4 w-4 text-gray-400"})]})]}),n&&(0,v.jsx)("div",{className:"border-t border-gray-100 divide-y divide-gray-50",children:s.topics.map(e=>{const t=B.includes(e.id);return(0,v.jsxs)("button",{onClick:()=>{return t=e.id,G(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},className:"flex items-center w-full px-4 py-3 text-left hover:bg-gray-50 transition-colors "+(t?"bg-blue-50/50":""),children:[(0,v.jsx)("div",{className:"w-5 h-5 rounded-md border-2 flex items-center justify-center mr-3 flex-shrink-0 transition-colors "+(t?"bg-blue-600 border-blue-600":"border-gray-300"),children:t&&(0,v.jsx)(c.A,{className:"h-3.5 w-3.5 text-white"})}),(0,v.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,v.jsx)("p",{className:"text-sm "+(t?"font-semibold text-gray-900":"text-gray-700"),children:e.name}),e.lesson&&(0,v.jsx)("p",{className:"text-xs text-gray-400 truncate",children:e.lesson})]}),(0,v.jsxs)("div",{className:"flex items-center space-x-2 flex-shrink-0 ml-2",children:[(0,v.jsxs)("span",{className:"text-xs text-gray-400 flex items-center",children:[(0,v.jsx)(j.A,{className:"h-3 w-3 mr-0.5"}),e.hours,"h"]}),(0,v.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded "+("practical"===e.type?"bg-green-50 text-green-600":"assessment"===e.type?"bg-amber-50 text-amber-600":"bg-gray-50 text-gray-500"),children:e.type})]})]},e.id)})})]},t)})}),(0,v.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm",children:[(0,v.jsx)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Notes (optional)"}),(0,v.jsx)("textarea",{value:U,onChange:e=>O(e.target.value),placeholder:"Any observations, student progress notes, or issues to report...",rows:3,className:"w-full rounded-lg border border-gray-200 px-3 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none placeholder-gray-400"})]}),(0,v.jsx)("button",{onClick:async()=>
2{if(0!==B.length){T(!0);try{await(0,a.gS)((0,a.rJ)(i.db,"teacherReports"),{teacherId:h.id,teacherName:h.name,teacherEmail:h.email,date:h.date,attendees:X.map(e=>({studentId:e.id,studentName:e.fullName})),attendeeCount:$.length,totalStudents:D.length,topics:K.map(e=>({id:e.id,name:e.name,module:e.module,hours:e.hours,type:e.type})),totalHours:Q,topicCount:B.length,notes:U.trim(),token:s,submittedAt:(0,a.O5)()}),M(!0),setTimeout(()=>t("/"),4e3)}catch(e){console.error("Submit error:",e),C("Failed to submit. Please try again.")}finally{T(!1)}}},disabled:0===B.length||P,className:"w-full flex items-center justify-center px-6 py-3.5 bg-blue-600 text-white font-semibold rounded-xl hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed shadow-sm text-base",children:P?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2"})," Submitting..."]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(N,{className:"h-4 w-4 mr-2"})," Submit Report"]})}),0===B.length&&(0,v.jsx)("p",{className:"text-center text-xs text-gray-400 mt-2",children:"Select at least one topic to submit"}),(0,v.jsxs)("button",{onClick:()=>q("attendance"),className:"w-full flex items-center justify-center mt-3 text-sm text-gray-500 hover:text-blue-600 transition-colors font-medium py-2",children:[(0,v.jsx)(b.A,{className:"h-4 w-4 mr-1"})," Back to Attendance"]})]})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.