"use strict";exports.id=57396,exports.ids=[57396],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;
          }
        }
      `})]})}},57396:(a,b,c)=>{c.r(b),c.d(b,{default:()=>l});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(){let[a,b]=(0,e.useState)([]),[c,l]=(0,e.useState)([]),[m,n]=(0,e.useState)([]),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),y=(0,e.useCallback)(async()=>{if(q&&o&&s){x(!0);try{v(await (0,j.uE)({examId:q,schoolClassId:o,userId:s}))}catch(a){(0,k.Qg)(a instanceof Error?a.message:"Failed to load progress card"),v(null)}finally{x(!1)}}},[q,o,s]);return(0,d.jsxs)("div",{className:"space-y-4 sm:space-y-6",children:[(0,d.jsx)(f.wc,{title:"Progress card",description:"Individual student report card for one exam — printable for parents."}),(0,d.jsx)(h.f,{}),(0,d.jsxs)(g.r7,{children:[(0,d.jsx)(g.yB,{label:"Exam",className:"min-w-0 flex-1 sm:min-w-[11rem]",children:(0,d.jsxs)(g.Kd,{value:q,onChange:a=>r(a.target.value),children:[(0,d.jsx)("option",{value:"",children:"Select exam"}),c.map(a=>(0,d.jsx)("option",{value:a.id,children:a.name},a.id))]})}),(0,d.jsx)(g.yB,{label:"Class",className:"min-w-0 flex-1 sm:min-w-[11rem]",children:(0,d.jsxs)(g.Kd,{value:o,onChange:a=>p(a.target.value),children:[(0,d.jsx)("option",{value:"",children:"Select class"}),a.map(a=>(0,d.jsx)("option",{value:a.id,children:a.displayName},a.id))]})}),(0,d.jsx)(g.yB,{label:"Student",className:"min-w-0 flex-1 sm:min-w-[12rem]",children:(0,d.jsxs)(g.Kd,{value:s,onChange:a=>t(a.target.value),children:[(0,d.jsx)("option",{value:"",children:"Select student"}),m.map(a=>(0,d.jsxs)("option",{value:a.userId,children:[a.fullName,a.rollNumber?` \xb7 Roll ${a.rollNumber}`:""]},a.userId))]})}),(0,d.jsx)(g.bE,{children:(0,d.jsx)(g.kL,{type:"button",onClick:()=>void y(),disabled:!q||!o||!s||w,children:w?"Loading…":"Generate"})})]}),u?(0,d.jsxs)(i.J,{letterhead:u.letterhead,title:"Progress card / Report card",subtitle:`${u.exam.name} \xb7 ${u.schoolClass.displayName}`,meta:`Generated ${new Date(u.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:"Student:"})," ",(0,d.jsx)("strong",{children:u.student.fullName})]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Roll:"})," ",u.student.rollNumber||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Student code:"})," ",u.student.studentCode||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Admission no:"})," ",u.student.admissionNumber||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Father:"})," ",u.student.fatherName||"—"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"text-slate-500",children:"Mother:"})," ",u.student.motherName||"—"]})]}),(0,d.jsx)(g.T7,{children:(0,d.jsxs)(g.cR,{minWidth:"36rem",children:[(0,d.jsx)(g.K_,{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{className:`${g.aB} font-medium`,children:"Subject"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Full"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Pass"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Obtained"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"%"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Grade"}),(0,d.jsx)("th",{className:`${g.aB} font-medium text-center`,children:"Status"})]})}),(0,d.jsx)("tbody",{children:u.subjects.length?u.subjects.map(a=>(0,d.jsxs)("tr",{className:"border-t border-slate-100",children:[(0,d.jsx)("td",{className:`${g.Cl} font-medium text-slate-900`,children:a.subjectName}),(0,d.jsx)("td",{className:`${g.Cl} text-center tabular-nums`,children:a.fullMarks}),(0,d.jsx)("td",{className:`${g.Cl} text-center tabular-nums`,children:a.passMarks}),(0,d.jsx)("td",{className:`${g.Cl} text-center tabular-nums`,children:a.marksObtained??"—"}),(0,d.jsx)("td",{className:`${g.Cl} text-center tabular-nums`,children:a.percent??"—"}),(0,d.jsx)("td",{className:`${g.Cl} text-center`,children:a.gradeLabel||"—"}),(0,d.jsx)("td",{className:`${g.Cl} text-center text-xs font-semibold`,children:null==a.passed?"—":a.passed?"PASS":"FAIL"})]},a.subjectId)):(0,d.jsx)(g.tU,{colSpan:7,children:"No subjects scheduled"})})]})}),(0,d.jsxs)("div",{className:"mt-5 grid grid-cols-2 gap-3 rounded-lg border border-slate-100 bg-slate-50 p-4 text-sm sm:grid-cols-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Total"}),(0,d.jsxs)("p",{className:"font-semibold tabular-nums",children:[u.totals.obtained,"/",u.totals.fullMarks]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Percentage"}),(0,d.jsxs)("p",{className:"font-semibold tabular-nums",children:[u.totals.percent??"—","%"]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Grade / Rank"}),(0,d.jsxs)("p",{className:"font-semibold",children:[u.totals.overallGrade||"—",null!=u.rank?` \xb7 #${u.rank}`:"",u.classSize?` of ${u.classSize}`:""]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs uppercase text-slate-500",children:"Result"}),(0,d.jsx)("p",{className:"font-semibold",children:u.totals.result})]})]})]}):null]})}},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)})})}}};