1/*! For license information please see 3086.a2d6a35c.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkstudent_management_app=self.webpackChunkstudent_management_app||[]).push([[3086],{13061:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},38284:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},47288:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},73086:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var s=a(9950),l=a(95578),r=a(47288),i=a(38284),n=a(12434),c=a(13061),d=a(56600),o=a(67714),u=a(44414);const x=[{id:"cna-core",name:"Shared CNA curriculum \u2014 both programs"}],m=e=>Array.isArray(e)?e.join("\n"):e||"";function h(){const{showToast:e}
2=(0,o.d)(),[t,a]=(0,s.useState)({sources:[],units:[]}),[h,g]=(0,s.useState)({title:"",edition:"",programId:"cna-core",file:null}),[j,f]=(0,s.useState)(null),[v,N]=(0,s.useState)(""),[y,w]=(0,s.useState)(!1),C=async()=>a(await(0,d.Ij)("getCurriculumAdmin"));(0,s.useEffect)(()=>{C().catch(t=>e(t.message||"Unable to load curriculum.","error"))},[]);const k=(0,s.useMemo)(()=>t.units.filter(e=>`${e.title} ${e.summary} ${(e.keywords||[]).join(" ")}`.toLowerCase().includes(v.toLowerCase())),[t.units,v]);return(0,u.jsxs)("div",{className:"mx-auto max-w-7xl px-4 py-7 sm:px-6 lg:py-9",children:[(0,u.jsxs)("header",{className:"border-b border-slate-200 pb-6",children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-[.18em] text-slate-500",children:"Shared CNA source library"}),(0,u.jsx)("h1",{className:"mt-3 text-3xl font-extrabold text-slate-950",children:"Curriculum Content Bank"}),(0,u.jsx)("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-slate-600",children:"Upload the single official curriculum book shared by HCA\u2013CNA Bridge and CNA Traditional, then review and publish its extracted teaching units."})]}),(0,u.jsxs)("div",{className:"mt-5 grid grid-cols-3 gap-px border border-slate-200 bg-slate-200",children:[(0,u.jsx)(p,{label:"Source books",value:t.sources.length}),(0,u.jsx)(p,{label:"Extracted units",value:t.units.length}),(0,u.jsx)(p,{label:"Published",value:t.units.filter(e=>"published"===e.status).length})]}),(0,u.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),h.file&&h.title.trim()){w(!0);try{const t=`curriculum-source/${Date.now()}_${h.file.name.replace(/[^A-Za-z0-9._-]/g,"_")}`,a=h.file.name.toLowerCase().split(".").pop(),s="docx"===a?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"txt"===a?"text/plain":"application/pdf";await(0,d.D)((0,d.KR)(d.IG,t),h.file,{contentType:s});const l=await(0,d.Ij)("importCurriculumPdf",{title:h.title,edition:h.edition,storagePath:t,sourceFileName:h.file.name});e(`${l.unitCount} curriculum units extracted from the ${l.sourceFormat.toUpperCase()} source${l.pageCount?` (${l.pageCount} pages)`:""}. Review before publishing.`,"success"),g({...h,title:"",edition:"",file:null}),await C()}catch(a){e(a.message||"Unable to process curriculum PDF.","error")}finally{w(!1)}}},className:"mt-6 border border-slate-200 bg-white",children:[(0,u.jsxs)("div",{className:"border-b border-slate-100 px-5 py-4",children:[(0,u.jsx)("h2",{className:"font-semibold text-slate-950",children:"Upload curriculum book"}),(0,u.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:"DOCX, TXT, and text-based PDFs are divided into chapters automatically. Scanned PDFs must contain OCR text."})]}),(0,u.jsxs)("div",{className:"grid gap-4 p-5 md:grid-cols-4",children:[(0,u.jsxs)("label",{className:"text-xs font-semibold text-slate-600",children:["Program",(0,u.jsx)("select",{value:h.programId,onChange:e=>g({...h,programId:e.target.value}),className:"mt-1.5 h-11 w-full border border-slate-300 bg-white px-3 text-sm font-normal",children:x.map(e=>(0,u.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,u.jsxs)("label",{className:"text-xs font-semibold text-slate-600",children:["Book or curriculum title",(0,u.jsx)("input",{value:h.title,onChange:e=>g({...h,title:e.target.value}),className:"mt-1.5 h-11 w-full border border-slate-300 px-3 text-sm font-normal"})]}),(0,u.jsxs)("label",{className:"text-xs font-semibold text-slate-600",children:["Edition",(0,u.jsx)("input",{value:h.edition,onChange:e=>g({...h,edition:e.target.value}),className:"mt-1.5 h-11 w-full border border-slate-300 px-3 text-sm font-normal"})]}),(0,u.jsxs)("label",{className:"flex h-[68px] cursor-pointer items-center justify-center gap-2 self-end border border-dashed border-slate-400 bg-slate-50 px-3 text-sm font-semibold text-slate-700",children:[(0,u.jsx)(l.A,{className:"h-4 w-4"}),h.file?h.file.name:"Choose DOCX, TXT, or PDF",(0,u.jsx)("input",{type:"file",accept:".pdf,.docx,.txt,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain",className:"sr-only",onChange:e=>{var t;return g({...h,file:(null===(t=e.target.files)||void 0===t?void 0:t[0])||null})}})]}),(0,u.jsxs)("button",{disabled:y||!h.file||!h.title.trim(),className:"inline-flex h-11 items-center justify-center gap-2 bg-slate-900 px-5 text-sm font-semibold text-white disabled:opacity-40 md:col-span-4",children:[y&&(0,u.jsx)(r.A,{className:"h-4 w-4 animate-spin"}),"Extract curriculum content"]})]})]}),(0,u.jsxs)("section",{className:"mt-7",children:[(0,u.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,u.jsxs)("div",{children:[(0,u.jsx)("h2",{className:"text-xl font-bold text-slate-950",children:"Review and publish units"}),(0,u.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:"Nothing reaches tutors until an administrator publishes it."})]}),(0,u.jsxs)("label",{className:"relative",children:[(0,u.jsx)(i.A,{className:"absolute left-3 top-3 h-4 w-4 text-slate-400"}
2),(0,u.jsx)("input",{value:v,onChange:e=>N(e.target.value),placeholder:"Search content",className:"h-10 border border-slate-300 pl-9 pr-3 text-sm"})]})]}),(0,u.jsxs)("div",{className:"mt-4 divide-y divide-slate-100 border border-slate-200 bg-white",children:[k.map(e=>{var t;return(0,u.jsxs)("button",{onClick:()=>f({...e,objectives:m(e.objectives),topics:m(e.topics),studyGuide:m(e.studyGuide),teachingIdeas:m(e.teachingIdeas),remediationGuidance:m(e.remediationGuidance),keywords:m(e.keywords)}),className:"flex w-full items-center gap-4 px-5 py-4 text-left hover:bg-slate-50",children:[(0,u.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center border border-slate-200 bg-slate-50",children:(0,u.jsx)(n.A,{className:"h-4 w-4"})}),(0,u.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,u.jsx)("span",{className:"block truncate text-sm font-semibold text-slate-900",children:e.title}),(0,u.jsxs)("span",{className:"mt-1 block truncate text-xs text-slate-500",children:[e.chapterNumber?`Chapter ${e.chapterNumber} \xb7 `:"",null===(t=x.find(t=>t.id===e.programId))||void 0===t?void 0:t.name," \xb7"," ",e.dayNumber?`Day ${e.dayNumber}`:"Day not assigned"]})]}),(0,u.jsx)("span",{className:"px-2 py-1 text-[10px] font-bold uppercase "+("published"===e.status?"bg-emerald-50 text-emerald-700":"bg-amber-50 text-amber-700"),children:e.status})]},e.id)}),!k.length&&(0,u.jsx)("p",{className:"p-12 text-center text-sm text-slate-500",children:"No curriculum units found."})]})]}),j&&(0,u.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-slate-950/60 p-3 sm:p-6",children:(0,u.jsxs)("div",{className:"mx-auto max-w-3xl bg-white",children:[(0,u.jsxs)("div",{className:"flex items-center justify-between border-b p-5",children:[(0,u.jsxs)("div",{children:[(0,u.jsx)("h2",{className:"font-bold text-slate-950",children:"Review curriculum unit"}),(0,u.jsx)("p",{className:"text-xs text-slate-500",children:"Edit the tutor-facing teaching guide, then publish."})]}),(0,u.jsx)("button",{onClick:()=>f(null),className:"text-sm text-slate-600",children:"Close"})]}),(0,u.jsxs)("div",{className:"space-y-4 p-5",children:[(0,u.jsx)(b,{label:"Unit title",children:(0,u.jsx)("input",{value:j.title,onChange:e=>f({...j,title:e.target.value})})}),(0,u.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,u.jsx)(b,{label:"Class day",children:(0,u.jsx)("input",{type:"number",min:"1",value:j.dayNumber||"",onChange:e=>f({...j,dayNumber:e.target.value})})}),(0,u.jsx)(b,{label:"Publishing status",children:(0,u.jsxs)("select",{value:j.status,onChange:e=>f({...j,status:e.target.value}),children:[(0,u.jsx)("option",{value:"draft",children:"Draft"}),(0,u.jsx)("option",{value:"published",children:"Published"})]})})]}),(0,u.jsx)(b,{label:"Tutor summary",children:(0,u.jsx)("textarea",{rows:"5",value:j.summary,onChange:e=>f({...j,summary:e.target.value})})}),(0,u.jsx)(b,{label:"Learning objectives (one per line)",children:(0,u.jsx)("textarea",{rows:"5",value:j.objectives,onChange:e=>f({...j,objectives:e.target.value})})}),(0,u.jsx)(b,{label:"Encyclopedia topics (one per line)",children:(0,u.jsx)("textarea",{rows:"6",value:j.topics,onChange:e=>f({...j,topics:e.target.value})})}),(0,u.jsx)(b,{label:"Student study guide (one per line)",children:(0,u.jsx)("textarea",{rows:"5",value:j.studyGuide,onChange:e=>f({...j,studyGuide:e.target.value})})}),(0,u.jsx)(b,{label:"Teaching activities and student support ideas (one per line)",children:(0,u.jsx)("textarea",{rows:"5",value:j.teachingIdeas,onChange:e=>f({...j,teachingIdeas:e.target.value})})}),(0,u.jsx)(b,{label:"Targeted remediation guidance (one per line)",children:(0,u.jsx)("textarea",{rows:"4",value:j.remediationGuidance,onChange:e=>f({...j,remediationGuidance:e.target.value})})}),(0,u.jsx)(b,{label:"Search keywords (one per line)",children:(0,u.jsx)("textarea",{rows:"3",value:j.keywords,onChange:e=>f({...j,keywords:e.target.value})})}),(0,u.jsxs)("div",{className:"border border-slate-200 bg-slate-50 p-4",children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500",children:"Extracted source preview"}),(0,u.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-sm leading-6 text-slate-700",children:j.contentPreview})]})]}),(0,u.jsx)("div",{className:"flex justify-end border-t p-4",children:(0,u.jsxs)("button",{disabled:y,onClick:async()=>{w(!0);try{await(0,d.Ij)("saveCurriculumUnit",{...j,unitId:j.id}),e("Curriculum unit saved.","success"),f(null),await C()}catch(t){e(t.message||"Unable to save curriculum unit.","error")}finally{w(!1)}},className:"inline-flex items-center gap-2 bg-slate-900 px-5 py-2.5 text-sm font-semibold text-white",children:[(0,u.jsx)(c.A,{className:"h-4 w-4"}),"Save unit"]})})]})})]})}function p(e){let{label:t,value:a}=e;return(0,u.jsxs)("div",{className:"bg-white p-4",children:[(0,u.jsx)("p",{className:"text-2xl font-bold text-slate-950",children:a}),(0,u.jsx)("p",{className:"mt-1 text-xs text-slate-500",children:t})]})}function b(e){let{label:t,children:a}=e;return(0,u.jsxs)("label",{className:"block text-xs font-semibold text-slate-600",children:[t,s.cloneElement(a,{className:"mt-1.5 w-full border border-slate-300 px-3 py-2.5 text-sm font-normal text-slate-900"})]})}},95578:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(7101).A)("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]])}}]);
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.