PageSourceSearch

https://edupark.ai/static/js/7605.d12e54c8.chunk.js

js edupark.ai collected 2026-10-05 12:16:19 UTC 15,627 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkedupark_client||=[]).push([[7605],{54827(e,t,s){var n=s(58878),a=s(71813),r=s(42191),l=s(90782);const i=(e,t)=>{if(t)return"text-text-subtle cursor-not-allowed";return{default:"text-text-muted hover:bg-surface-sunken",red:"text-error-600 hover:bg-error-50",blue:"text-primary-600 hover:bg-primary-50",green:"text-success-600 hover:bg-success-50"}[e||"default"]};s.d(t,["r",0,e=>{let{trigger:t,items:s,align:d="right",triggerAriaLabel:o}=e;const{t:c}=(0,a.B)(),[u,x]=(0,n.useState)(!1),m=(0,n.useRef)(null);(0,n.useEffect)(()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&x(!1)};return u&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);return(0,l.jsxs)("div",{className:"relative",ref:m,children:[(0,l.jsx)("button",{type:"button",onClick:()=>x(!u),className:"p-2 text-text-muted hover:text-text hover:bg-surface-sunken rounded transition-colors min-w-[44px] min-h-[44px] flex items-center justify-center","aria-label":null!==o&&void 0!==o?o:c("More actions"),children:t||(0,l.jsx)("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,l.jsx)("path",{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"})})}),u&&(0,l.jsx)("div",{className:"absolute z-50 mt-2 w-56 bg-surface-raised rounded-lg shadow-lg border border-border py-1 "+("right"===d?"right-0":"left-0"),children:s.map((e,t)=>{const s=(0,l.jsxs)("button",{type:"button",onClick:()=>(e=>{e.disabled||(e.onClick(),x(!1))})(e),disabled:e.disabled,className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${i(e.color,e.disabled)}`,children:[e.icon&&(0,l.jsx)("span",{className:"flex-shrink-0",children:e.icon}),(0,l.jsx)("span",{className:"text-left",children:e.label})]}),n=e.disabled&&e.title&&"tooltip"===e.disabledReasonDisplay;return(0,l.jsxs)("div",{title:n?void 0:e.title,children:[n?(0,l.jsx)(r.m,{content:e.title,portal:!0,placement:"top",className:"w-full",children:(0,l.jsx)("span",{className:"block w-full",tabIndex:0,"aria-label":`${e.label}: ${e.title}`,children:s})}):s,e.disabled&&e.title&&"tooltip"!==e.disabledReasonDisplay&&(0,l.jsx)("p",{className:"px-4 pb-2 -mt-1.5 text-xs text-text-muted",children:e.title})]},t)})})]})}])},15348(e,t,s){s(58878);var n=s(71813),a=s(90782);const r=e=>{let{score:t}=e;const{t:s}=(0,n.B)(),r=s("With extra time: {{score}}",{score:t});return(0,a.jsxs)("span",{className:"block text-xs font-normal text-text-subtle",title:r,children:[(0,a.jsxs)("span",{className:"block","aria-hidden":"true",children:[(0,a.jsx)("span",{className:"block whitespace-nowrap",children:s("Extra time")}),(0,a.jsx)("span",{className:"block tabular-nums",children:t})]}),(0,a.jsx)("span",{className:"sr-only",children:r})]})};s.d(t,["A",0,r])},52696(e,t,s){s(58878);
1var n=s(71813),a=s(56480),r=s(21235),l=s(90782);const i=e=>{let{flags:t}=e;const{t:s}=(0,n.B)();if(!t||0===t.length)return null;const i=t.map(e=>(0,r.Z)(e.kind,s)).join(", "),d=1===t.length?s("Integrity flag"):s("Integrity flags ({{count}})",{count:t.length});return(0,l.jsx)("span",{title:s("Integrity flags: {{kinds}}",{kinds:i}),className:"whitespace-nowrap",children:(0,l.jsx)(a.E,{variant:"warning",size:"xs",className:"whitespace-nowrap",children:d})})};s.d(t,["A",0,i])},23852(e,t,s){var n=s(58878),a=s(71813),r=s(65852),l=s(1060),i=s(60654),d=s(65140),o=s(25444),c=s(61311),u=s(69403),x=s(59895),m=s(49350),p=s(12037),h=s(4329),g=s(74027),b=s(67122),f=s(2884),j=s(97607),N=s(62136),v=s(96452),y=s(589),w=s(94731),I=s(98639),k=s(27242),S=s(39984),C=s(90782);const A={NO_GUARDIAN_EMAIL:"no parent email",NOT_A_MEMBER:"not an active member",SEND_FAILED:"send failed"};const E=e=>{let{orgId:t,students:s,onClose:E}=e;const{t:F}=(0,a.B)(),{seededAt:z}=(0,j.C)(t),D=(0,n.useMemo)(()=>s.map(e=>e.userId),[s]),{data:M,loading:L,error:U,refetch:R}=(0,l.IT)(y.t_O,{variables:{orgId:t,studentUserIds:D},skip:!t,...(0,I.X)("session")}),[O,{loading:B}]=(0,r.n)(y.bW3,{update:e=>{(0,w.C)(e),(0,w.ve)(e)}}),[$,T]=(0,n.useState)(""),[_,W]=(0,n.useState)(!0),G=$.trim(),Z=!G&&!_,[P,J]=(0,n.useState)(null),[Y,q]=(0,n.use
1State)(null),[X,H]=(0,n.useState)(new Set),[K,Q]=(0,n.useState)(null),[V,ee]=(0,n.useState)([]),[te,se]=(0,n.useState)(null),ne=(0,n.useRef)(!1),ae=(0,n.useMemo)(()=>{const e=new Map;for(const t of s)e.set(t.userId,t.displayName);return e},[s]),{guardianIdSet:re,lastSentByStudent:le,guardianRowsByStudent:ie}=(0,n.useMemo)(()=>{const e=new Set,t=new Map,s=new Map;for(const a of(null===M||void 0===M?void 0:M.getStudentGuardiansForOrg)||[]){var n;e.add(a.studentUserId);const r=s.get(a.studentUserId)||[];if(r.push({guardianName:null!==(n=a.guardianName)&&void 0!==n?n:null,guardianEmail:a.guardianEmail}),s.set(a.studentUserId,r),a.lastReportSentAt){const e=t.get(a.studentUserId);(!e||new Date(a.lastReportSentAt)>new Date(e))&&t.set(a.studentUserId,a.lastReportSentAt)}}return{guardianIdSet:e,lastSentByStudent:t,guardianRowsByStudent:s}},[M]),de=!L&&!U,oe=!(null===M||void 0===M||!M.getStudentGuardiansForOrg),ce=(0,n.useMemo)(()=>s.filter(e=>re.has(e.userId)),[s,re]),ue=(0,n.useMemo)(()=>s.filter(e=>!re.has(e.userId)),[s,re]),xe=ce.length,me=s.length,pe=(0,n.useMemo)(()=>ce.filter(e=>!X.has(e.userId)),[ce,X]),he=pe.length,[ge,be]=(0,n.useState)(""),fe=s.length>5,je=fe?ge.trim().toLowerCase():"",Ne=e=>!je||e.displayName.toLowerCase().includes(je)||(e.email||"").toLowerCase().includes(je),ve=ce.filter(Ne),ye=ue.filter(Ne);if(P){const e=P.skipped.map(e=>({name:ae.get(e.studentUserId)||"Unknown student",reason:A[e.reason]||e.reason.toLowerCase()}));return(0,C.jsx)(m.a,{isOpen:!0,onClose:E,title:F("Emails sent"),size:"md",footer:(0,C.jsx)("div",{className:"flex justify-end",children:(0,C.jsx)(h.$,{variant:"primary",size:"md",onClick:E,children:"Done"})}),children:(0,C.jsxs)("div",{className:"space-y-4",children:[Y&&(0,C.jsx)(g.l,{tone:"warning",icon:d.A,title:"Some reports didn't send",description:Y}),(0,C.jsxs)("div",{className:"flex items-center gap-3 rounded-2xl bg-success-50 px-4 py-3",children:[(0,C.jsx)(i.A,{size:20,className:"flex-shrink-0 text-success-600"}),(0,C.jsx)("p",{className:"text-sm font-medium text-success-800",children:1===P.sentCount?F("{{count}} student's parents emailed",{count:P.sentCount}):F("{{count}} students' parents emailed",{count:P.sentCount})})]}),e.length>0&&(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wide text-text-subtle",children:["Skipped (",e.length,")"]}),(0,C.jsx)("ul",{className:"space-y-1",children:e.map((e,t)=>(0,C.jsxs)("li",{className:"flex items-center justify-between rounded-xl bg-surface-sunken px-3 py-2 text-sm",children:[(0,C.jsx)("span",{className:"text-text",children:e.name}),(0,C.jsx)("span",{className:"text-text-subtle",children:e.reason})]},t))})]})]})})}const we=!de||0===he||B||Z;return(0,C.jsxs)(C.Fragment,{children:[K&&(0,C.jsx)(f.A,{orgId:t,studentUserId:K.userId,studentName:K.displayName,existingGuardians:V,onClose:()=>Q(null)}),(0,C.jsx)(m.a,{isOpen:!0,pauseFocusTrap:!!K,onClose:()=>{B||E()},title:F("Email parents"),description:F("Write a note, attach the progress report, or both. Each student's email goes to every parent/guardian on record."),size:"md",footer:(0,C.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,C.jsx)(h.$,{variant:"outline",size:"md",onClick:E,disabled:B,children:"Cancel"}),(0,C.jsx)(h.$,{variant:"primary",size:"md",onClick:async()=>{if(!de||0===he||B||ne.current||Z)return;ne.current=!0,q(null);const e=function(e,t){const s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}(pe.map(e=>e.userId),500);let s=0;const n=[];try{for(const r of e){var a;const{data:e}=await O({variables:{orgId:t,studentUserIds:r,note:G||null,includeReport:_}}),l=null===e||void 0===e?void 0:e.sendParentCommunication;s+=null!==(a=null===l||void 0===l?void 0:l.sentCount)&&void 0!==a?a:0;for(const t of(null===l||void 0===l?void 0:l.skipped)||[])n.push({studentUserId:t.studentUserId,reason:t.reason})}J({sentCount:s,skipped:n})}catch(r){J({sentCount:s,skipped:n}),(0,k.CT)(r)||q((null===r||void 0===r?void 0:r.message)||"Some progress reports could not be sent. Please try again.")}finally{ne.current=!1}},isLoading:B,disabled:we,leftIcon:(0,C.jsx)(o.A,{size:16}),children:B?"Sending...":he>0?`Send ${he}`:"Send"})]}),children:(0,C.jsxs)("div",{className:"space-y-4",children:[(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("textarea",{value:$,onChange:e=>T(e.target.value),maxLength:S.IJZ,disabled:B,rows:4,"aria-label":F("Write a note to the parents (optional if the report is included)"),placeholder:F("Write a note to the parents (optional if the report is included)"),className:"w-full resize-none rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text placeholder:text-text-subtle focus:outline-none focus:ring-2 focus:ring-brand disabled:opacity-60"}),$.length>=.9*S.IJZ&&(0,C.jsx)("p",{className:"text-xs text-warning-700 font-medium",role:"status",children:F("{{count}} / {{max}} characters",{count:$.length,max:S.IJZ})}),(0,C.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-border bg-surface-raised px-3 py-2.5",children:[(0,C.jsx)("span",{className:"text-sm text-text",children:F("Include progress report link")}),(0,C.jsx)("button",{type:"button",role:"switch","aria-checked":_,"aria-label":F("Include progress report link"),disabled:B,onClick:()=>W(e=>!e),className:"relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-60 "+(_?"bg-brand border-transparent":"bg-border-strong border-border-strong"),children:(0,C.jsx)("span",{className:"inline-block h-5 w-5 transform rounded-full bg-surface-raised shadow-elevation-sm transition-transform "+(_?"translate-x-5":"translate-x-0.5")})})]}),Z&&(0,C.jsx)("p",{className:"text-xs text-text-subtle",children:F("Add a note or include the progress report.")})]}),U?(0,C.jsx)(g.l,{tone:"warning",icon:d.A,title:"Couldn't load parent contacts",description:U.message||"We couldn't check which students have a parent email. Please close and try again."}):oe?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 rounded-2xl bg-brand-subtle px-4 py-3",children:[(0,C.jsx)(x.A,{size:20,className:"flex-shrink-0 text-brand"}),(0,C.jsxs)("p",{className:"text-sm text-text",children:[(0,C.jsx)("strong",{children:xe})," of ",(0,C.jsx)("strong",{children:me})," ",1===me?"student has":"students have"," a parent email."]})]}),fe&&(0,C.jsx)(p.L,{value:ge,onChange:be,placeholder:F("Search students by name or email\u2026"),ariaLabel:"Search students"}),je&&0===ve.length&&0===ye.length&&(0,C.jsxs)("div",{className:"py-6 text-center",children:[(0,C.jsx)(u.A,{size:20,className:"mx-auto mb-2 text-text-subtle"}),(0,C.jsx)("p",{className:"text-sm text-text-subtle",children:"No students match your search"}),(0,C.jsx)("button",{type:"button",onClick:()=>be(""),className:"mt-2 text-sm font-medium text-brand hover:text-brand-hover",children:"Clear search"})]}),ve.length>0&&(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wide text-text-subtle",children:["Recipients (",he," of ",xe,")"]}),he<xe&&(0,C.jsx)("button",{type:"button",onClick:()=>H(new Set),disabled:B,className:"text-xs font-medium text-brand hover:underline disabled:opacity-50",children:"Select all"})]}),(0,C.jsx)("ul",{className:"space-y-1",children:ve.map(e=>{const t=function(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:(0,v.Yq)(t,{month:"short",day:"numeric",year:"numeric"})}
1(le.get(e.userId)),s=!X.has(e.userId);return(0,C.jsx)("li",{children:(0,C.jsxs)("label",{className:"flex items-center gap-3 rounded-xl bg-surface-sunken px-3 py-2 text-sm "+(B?"cursor-default":"cursor-pointer"),children:[(0,C.jsx)("input",{type:"checkbox",checked:s,onChange:()=>{return t=e.userId,void H(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s});var t},disabled:B,className:"h-4 w-4 rounded border-border-strong accent-brand focus:ring-2 focus:ring-brand disabled:cursor-default"}),(0,C.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,C.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,C.jsx)("span",{className:"block min-w-0 truncate "+(s?"text-text":"text-text-muted line-through"),children:e.displayName}),(0,C.jsx)(N.A,{seededAt:z,email:e.email})]}),e.email&&e.email!==e.displayName&&(0,C.jsx)("span",{className:"block truncate text-xs "+(s?"text-text-subtle":"text-text-muted"),children:e.email})]}),(0,C.jsx)("span",{className:"flex-shrink-0 text-text-subtle",children:t?`Last sent ${t}`:"Not sent yet"})]})},e.userId)})})]}),ye.length>0&&(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wide text-text-subtle",children:["No parent email (",ue.length,")"]}),(0,C.jsx)("ul",{className:"space-y-1",children:ye.map(e=>(0,C.jsxs)("li",{className:"flex items-center justify-between gap-3 rounded-xl bg-surface-sunken px-3 py-2 text-sm",children:[(0,C.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,C.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,C.jsx)("span",{className:"block min-w-0 truncate text-text-muted",children:e.displayName}),(0,C.jsx)(N.A,{seededAt:z,email:e.email})]}),e.email&&e.email!==e.displayName&&(0,C.jsx)("span",{className:"block truncate text-xs text-text-subtle",children:e.email})]}),(0,C.jsx)(h.$,{variant:"ghost",size:"sm",className:"flex-shrink-0",onClick:()=>(async e=>{se(e.userId);let t=ie.get(e.userId)||[];try{const{data:s}=await R();t=((null===s||void 0===s?void 0:s.getStudentGuardiansForOrg)||[]).filter(t=>t.studentUserId===e.userId).map(e=>{var t;return{guardianName:null!==(t=e.guardianName)&&void 0!==t?t:null,guardianEmail:e.guardianEmail}})}catch{}finally{se(null)}ee(t),Q(e)})(e),disabled:B||te===e.userId,isLoading:te===e.userId,leftIcon:(0,C.jsx)(c.A,{size:14}),children:"Add email"})]},e.userId))}),(0,C.jsx)("p",{className:"text-xs text-text-subtle",children:"Add a parent email to include a student in this send."})]}),0===xe&&!je&&(0,C.jsx)("p",{className:"text-sm text-text-muted",children:"None of the selected students have a parent email yet. Add one above to include them."})]}):(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)(b.l1,{className:"h-5 w-3/4"}),(0,C.jsx)(b.l1,{className:"h-14 w-full"})]})]})})]})};s.d(t,["A",0,E])},81028(e,t,s){s.d(t,{O:()=>i});s(58878);var n=s(90782);const a=["#FDE1D3","#D3F5E4","#D6E4FD","#FCE7F3","#E6D9F7","#FEF3C7","#D1F0F5","#F5E1D3"];function r(e){return a[function(e){let t=0;for(let s=0;s<e.length;s++)t=(t<<5)-t+e.charCodeAt(s),t|=0;return Math.abs(t)}(e)%a.length]}const l={xs:"w-6 h-6 text-[10px]",sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-lg"};function i(e){let{name:t,size:s="sm",className:a=""}=e;const i=null===t||void 0===t?void 0:t.trim(),d=i?i[0].toUpperCase():"?",o=i?r(i):"#E5E7EB";return(0,n.jsx)("div",{className:`rounded-full flex items-center justify-center font-medium text-text shrink-0 ${l[s]} ${a}`,style:{backgroundColor:o},"aria-hidden":"true",children:d})}},21235(e,t,s){function n(e,t){switch(e){case"FOCUS_LOSS":return t("left the exam screen");case"RESPONSE_TIME":return t("unusually fast correct answers");case"ABILITY_DISCONTINUITY":return t("results far above prior practice");default:return e}}s.d(t,{Z:()=>n})}}]);

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.