"use strict";exports.id=67374,exports.ids=[67374],exports.modules={14647:(a,b,c)=>{c.d(b,{B:()=>e,J:()=>f});var d=c(48249);function e({disabled:a}){return(0,d.jsx)("button",{type:"button",disabled:a,onClick:()=>window.print(),className:"inline-flex min-h-[40px] items-center justify-center rounded-md bg-primary-700 px-4 py-2 text-sm font-medium text-white hover:bg-primary-800 disabled:opacity-50 print:hidden",children:"Print / Save PDF"})}function f({letterhead:a,title:b,subtitle:c,meta:f,children:g,actions:h}){return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 print:hidden",children:[h,(0,d.jsx)(e,{})]}),(0,d.jsxs)("div",{id:"sms-print-report",className:"overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm print:border-0 print:shadow-none",children:[(0,d.jsxs)("div",{className:"border-b border-slate-200 bg-slate-50 px-5 py-5 text-center sm:px-8",children:[(0,d.jsx)("p",{className:"text-xl font-bold tracking-tight text-slate-900 sm:text-2xl",children:a?.academyName||"School"}),a?.tagline?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:a.tagline}):null,(0,d.jsx)("p",{className:"mt-3 text-base font-semibold uppercase tracking-wide text-slate-800",children:b}),c?(0,d.jsx)("p",{className:"mt-1 text-sm text-slate-600",children:c}):null,f?(0,d.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:f}):null]}),(0,d.jsx)("div",{className:"px-4 py-5 sm:px-8 sm:py-6",children:g}),(0,d.jsx)("div",{className:"border-t border-slate-100 px-5 py-4 text-xs text-slate-400 sm:px-8",children:"Generated for school records \xb7 Use Print / Save PDF for a paper copy"})]}),(0,d.jsx)("style",{children:`
        @media print {
          body * { visibility: hidden !important; }
          #sms-print-report, #sms-print-report * { visibility: visible !important; }
          #sms-print-report {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            border: none !important;
            box-shadow: none !important;
          }
        }
      `})]})}},67374:(a,b,c)=>{c.r(b),c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(84466),g=c(82697),h=c(91415),i=c(14647),j=c(81152),k=c(91115);function l(a){return Number(a||0).toLocaleString(void 0,{maximumFractionDigits:2})}function m(){let[a,b]=(0,e.useState)([]),[c,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(""),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(!1),v=(0,e.useCallback)(async()=>{if(n){s(!0);try{q(await (0,j.Zg)(n))}catch(a){(0,k.Qg)(a instanceof Error?a.message:"Failed to load student summary"),q(null)}finally{s(!1)}}},[n]);return(0,d.jsxs)("div",{className:"space-y-4 sm:space-y-6",children:[(0,d.jsx)(f.wc,{title:"Student summary",description:"One-page overview: attendance, fees, and exam marks for a student."}),(0,d.jsx)(h.f,{}),(0,d.jsxs)(g.r7,{children:[(0,d.jsx)(g.yB,{label:"Search",className:"min-w-0 flex-1 sm:min-w-[12rem]",children:(0,d.jsx)(g.Ew,{value:c,onChange:m,placeholder:"Name, email, or code",ariaLabel:"Search students"})}),(0,d.jsx)(g.yB,{label:"Student",className:"min-w-0 flex-1 sm:min-w-[14rem]",children:(0,d.jsxs)(g.Kd,{value:n,onChange:a=>o(a.target.value),children:[(0,d.jsx)("option",{value:"",children:t?"Loading students…":"Select student"}),a.map(a=>(0,d.jsxs)("option",{value:a.userId,children:[a.user?.fullName||a.userId,a.schoolClass?` \xb7 ${a.schoolClass.displayName}`:""]},a.userId))]})}),(0,d.jsx)(g.bE,{children:(0,d.jsx)(g.kL,{type:"button",onClick:()=>void v(),disabled:!n||r,children:r?"Generating…":"Generate"})})]}),r?(0,d.jsx)(g.nI,{rows:4}):p?(0,d.jsxs)(i.J,{letterhead:p.letterhead,title:"Student summary report",subtitle:p.student.fullName,meta:`${p.schoolClass.displayName}${p.academicYear?` \xb7 ${p.academicYear.name}`:""} \xb7 ${new Date(p.generatedAt).toLocaleString()}`,children:[(0,d.jsxs)("div",{className:"mb-5 grid grid-cols-1 gap-2 text-sm sm:grid-cols-2",children:[(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Code:"})," ",p.student.studentCode||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Roll:"})," ",p.student.rollNumber||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Email:"})," ",p.student.email]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Phone:"})," ",p.student.phone||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Father:"})," ",p.student.fatherName||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Mother:"})," ",p.student.motherName||"—"]})]}),(0,d.jsxs)("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Attendance"}),(0,d.jsxs)("p",{className:"text-lg font-semibold tabular-nums",children:[p.attendance?.attendancePercent??"—","%"]}),(0,d.jsxs)("p",{className:"text-xs text-slate-500",children:["P ",p.attendance?.present??0," \xb7 A ",p.attendance?.absent??0," \xb7 L"," ",p.attendance?.late??0]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Fees due"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:l(p.fees?.totalDue??0)}),(0,d.jsxs)("p",{className:"text-xs text-slate-500",children:["Paid ",l(p.fees?.totalPaid??0)]})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Assigned fees"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:l(p.fees?.totalAssigned??0)})]}),(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 bg-slate-50 p-3",children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Exams on file"}),(0,d.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:p.exams.length})]})]}),p.exams.length?(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-slate-900",children:"Exam marks"}),p.exams.map(a=>(0,d.jsxs)("div",{className:"rounded-lg border border-slate-100 p-3",children:[(0,d.jsx)("p",{className:"mb-2 font-medium text-slate-900",children:a.examName}),(0,d.jsx)("ul",{className:"space-y-1 text-sm text-slate-600",children:a.subjects.map((b,c)=>(0,d.jsxs)("li",{className:"flex justify-between gap-3",children:[(0,d.jsx)("span",{children:b.subjectName}),(0,d.jsxs)("span",{className:"tabular-nums",children:[b.marksObtained??"—",b.gradeLabel?` \xb7 ${b.gradeLabel}`:""]})]},`${a.examId}-${c}`))})]},a.examId))]}):(0,d.jsx)("p",{className:"text-sm text-slate-500",children:"No exam marks recorded yet."})]}):n?(0,d.jsx)(g.i0,{title:"No report yet",description:"Click Generate to build the student summary.",action:(0,d.jsx)(g.kL,{type:"button",onClick:()=>void v(),children:"Generate report"})}):(0,d.jsx)(g.i0,{title:"Select a student",description:"Search and pick a student, then generate the summary report."})]})}},91415:(a,b,c)=>{c.d(b,{f:()=>j});var d=c(48249),e=c(60932),f=c(40433),g=c(14113),h=c(17060);let i=[{href:f.bw.SMS_ADMIN.REPORTS_ATTENDANCE,label:"Attendance",match:a=>a===f.bw.SMS_ADMIN.REPORTS||a===f.bw.SMS_ADMIN.REPORTS_ATTENDANCE},{href:f.bw.SMS_ADMIN.REPORTS_PROGRESS_CARD,label:"Progress card",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_PROGRESS_CARD)},{href:f.bw.SMS_ADMIN.REPORTS_MARK_SHEET,label:"Mark sheet",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_MARK_SHEET)},{href:f.bw.SMS_ADMIN.REPORTS_MERIT_LIST,label:"Merit list",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_MERIT_LIST)},{href:f.bw.SMS_ADMIN.REPORTS_STUDENT,label:"Student",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_STUDENT)},{href:f.bw.SMS_ADMIN.REPORTS_CLASS,label:"Class",match:a=>a.startsWith(f.bw.SMS_ADMIN.REPORTS_CLASS)},{href:f.bw.SMS_ADMIN.REPORTS_FEES,label:"Fees statement",match:a=>a.startsWith(f.bw.SMS_ADMIN.FEES_STATEMENT)}];function j(){let a=(0,h.sK)()??"";return(0,d.jsx)("nav",{className:"flex gap-1 overflow-x-auto rounded-lg border border-slate-200 bg-slate-50/80 p-1 scrollbar-none print:hidden","aria-label":"School reports sections",children:i.map(b=>{let c=b.match(a);return(0,d.jsx)(e.u,{href:b.href,className:(0,g.xW)("inline-flex shrink-0 items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-200 ease-out motion-reduce:transition-none",c?"bg-white text-primary-800 shadow-sm ring-1 ring-slate-200/80":"text-slate-600 hover:bg-white hover:text-slate-900 hover:shadow-sm"),"aria-current":c?"page":void 0,children:b.label},b.href)})})}}};