1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7296],{76577:function(e,t,s){s.d(t,{D:function(){return L}});var n=s(85893),r=s(67294),l=s(5152),a=s.n(l),i=s(34917);function o(e,t){let s=e[t];if(s&&"object"==typeof s&&"value"in s&&"healthy"in s){let e=s.value,t=s.healthy;return{value:"number"==typeof e?e:null,healthy:"boolean"==typeof t?t:null}}return{value:null,healthy:null}}let d={healthy:"bg-emerald-400",warn:"bg-amber-400",bad:"bg-red-400",unknown:"bg-slate-600"},c=e=>{let{tone:t}=e;return(0,n.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(d[t])})},u={HIGH:"bg-emerald-500/15 text-emerald-300 ring-emerald-500/30",MEDIUM:"bg-amber-500/15 text-amber-300 ring-amber-500/30",LOW:"bg-red-500/15 text-red-300 ring-red-500/30"},x=e=>String(e),p=()=>(0,n.jsxs)("div",{className:"border-t border-slate-800 pt-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"How to read this"}),(0,n.jsxs)("div",{className:"mt-2 space-y-2 text-xs text-slate-400",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[(0,n.jsx)("span",{className:"font-medium text-slate-500",children:"Capture health"}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(c,{tone:"healthy"})," In optimal band"]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(c,{tone:"warn"})," Outside optimal band"]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(c,{tone:"bad"})," Failed hard gate"]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(c,{tone:"unknown"})," Not measured"]})]}),(0,n.jsxs)("div",{className:"text-slate-500",children:["Optimal bands (score a perfect 1.0): VAD SNR"," ",(0,n.jsxs)("span",{className:"font-mono text-slate-300",children:[x(16),"â",x(19)," dB"]}),", silence ratio"," ",(0,n.jsxs)("span",{className:"font-mono text-slate-300",children:[x(.33),"â",x(.45)]}),". Values outside a band degrade the score smoothly, and are not hard failures."]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[(0,n.jsx)("span",{className:"font-medium text-slate-500",children:"Confidence level"}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-emerald-500/15 px-2 py-0.5 font-medium text-emerald-300 ring-1 ring-inset ring-emerald-500/30",children:"HIGH"}),"score ⥠",x(.65)]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-amber-500/15 px-2 py-0.5 font-medium text-amber-300 ring-1 ring-inset ring-amber-500/30",children:"MEDIUM"}),x(.33),"â",x(.65)]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-red-500/15 px-2 py-0.5 font-medium text-red-300 ring-1 ring-inset ring-red-500/30",children:"LOW"}),"⤠",x(.33),", or dead-audio gate"]})]})]})]}),m=e=>{var t,s,r,l;let{trace:a}=e,d=a.stages.find(e=>"capture"===e.id),x=o(null!==(t=null==d?void 0:d.outputs)&&void 0!==t?t:{},"vadSnr"),m=o(null!==(s=null==d?void 0:d.outputs)&&void 0!==s?s:{},"silenceRatio"),f=null==d?void 0:d.outputs.usableAudioDetected,h="boolean"==typeof f?f:null,{wpm:v,alignmentScore:g,confidence:b}=a.recomputed;return(0,n.jsxs)("div",{className:"space-y-4 rounded-xl border border-slate-800 bg-slate-900 p-4",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-slate-400",children:"Metrics"}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,n.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-800/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"Reading speed (WPM)"}),null!==v.wpm?(0,n.jsx)("div",{className:"mt-1 font-mono text-2xl tabular-nums text-slate-100",children:v.wpm.toFixed(1)}):(0,n.jsxs)("div",{className:"mt-1 text-sm text-amber-300",title:null!==(r=v.reason)&&void 0!==r?r:void 0,children:["Unavailable",v.reason&&(0,n.jsx)("div",{className:"text-xs text-slate-500",children:(0,i.q)(v.reason).message})]})]}),(0,n.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-800/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"Alignment score"}),(0,n.jsx)("div",{className:"mt-1 font-mono text-2xl tabular-nums text-slate-100",children:null!==g?"".concat((100*g).toFixed(0),"%"):"â"})]}),(0,n.jsxs)("div",{className:"rounded-lg border border-slate-800 bg-slate-800/50 p-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"Confidence"}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-2xl tabular-nums text-slate-100",children:b.score.toFixed(3)}),(0,n.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ".concat(null!==(l=u[b.level])&&void 0!==l?l:"bg-slate-500/15 text-slate-300 ring-slate-500/30"),children:b.level})]})]})]}),d&&(0,n.jsxs)("div",{className:"border-t border-slate-800 pt-3",children:[(0,n.jsx)("p",{className:"text-xs text-slate-500",children:d.explainer}),(0,n.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-800 px-3 py-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm text-slate-200",children:"VAD SNR"}),(0,n.jsx)("div",{className:"text-xs text-slate-500",children:"Signal-to-noise ratio measured client-side (dB)"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-sm text-slate-100",children:null!==x.value?x.value.toFixed(1):"â"}),(0,n.jsx)(c,{tone:null===x.healthy?"unknown":x.healthy?"healthy":"warn"})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-800 px-3 py-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm text-slate-200",children:"Silence ratio"}),(0,n.jsx)("div",{className:"text-xs text-slate-500",children:"Fraction of the clip that is silence"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-sm text-slate-100",children:null!==m.value?m.value.toFixed(2):"â"}),(0,n.jsx)(c,{tone:null===m.healthy?"unknown":m.healthy?"healthy":"warn"})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-800 px-3 py-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm text-slate-200",children:"Usable audio"}),(0,n.jsx)("div",{className:"text-xs text-slate-500",children:"Hard gate â forces confidence to 0 when false"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono text-sm text-slate-100",children:null===h?"â":h?"Yes":"No"}),(0,n.jsx)(c,{tone:null===h?"unknown":h?"healthy":"bad"})]})]})]})]}),(0,n.jsx)(p,{})]})},f=e=>{var t;let{word:s,override:r,isActive:l,onSeek:a}
1=e,i=null!==s.start,o=(null==r?void 0:r.wasOverridden)?"ring-2 ring-sky-400":"",d=(null==r?void 0:r.wasOverridden)?"Teacher override â original outcome: ".concat(null!==(t=r.originalType)&&void 0!==t?t:"unknown"):void 0,c="EQUAL"===s.type?"bg-green-500/15 text-green-300 ring-green-500/25":"REPLACE"===s.type?"bg-amber-500/15 text-amber-200 ring-amber-500/25":"bg-red-500/15 text-red-300 ring-red-500/25",u=(0,n.jsxs)("span",{className:"".concat("inline-flex flex-col items-center rounded-md px-2.5 py-1 text-base font-semibold leading-tight ring-1 ring-inset"," ").concat(c," ").concat(o," ").concat(l?"ring-2 ring-offset-1 ring-offset-slate-900 ring-indigo-400":"").trim(),title:d,children:[(0,n.jsx)("span",{className:"DELETE"===s.type?"line-through":void 0,children:s.referenceWord}),"REPLACE"===s.type&&s.heardWord&&(0,n.jsxs)("span",{className:"text-xs font-medium text-amber-400",children:["(",s.heardWord,")"]})]});return i?(0,n.jsx)("button",{type:"button",onClick:()=>a(s.start),className:"cursor-pointer align-top hover:opacity-75",children:u}):u},h=e=>{let{insertion:t,isActive:s,onSeek:r}=e;return(0,n.jsx)("button",{type:"button",onClick:()=>r(t.start),title:"Heard, not in passage",className:"inline-flex items-center rounded-md bg-violet-500/15 px-2.5 py-1 text-base font-semibold text-violet-300 ring-1 ring-inset ring-violet-500/25 hover:bg-violet-500/25 ".concat(s?"ring-2 ring-offset-1 ring-offset-slate-900 ring-indigo-400":""),children:t.heardWord})},v=e=>{let{words:t,insertions:s,wordEvidence:l,currentTime:a,onSeek:i}=e,o=(0,r.useMemo)(()=>{let e=new Map;for(let t of l)null!==t.position&&e.set(t.position,t);return e},[l]),d=(0,r.useMemo)(()=>(function(e,t){let s=[...t].sort((e,t)=>e.start-t.start),n=[],r=0;for(let t of e){if(null!==t.start){let e=s[r];for(;void 0!==e&&e.start<t.start;)n.push({kind:"insertion",insertion:e,key:"ins-".concat(r,"-").concat(e.start)}),e=s[++r]}n.push({kind:"word",word:t})}let l=s[r];for(;void 0!==l;)n.push({kind:"insertion",insertion:l,key:"ins-".concat(r,"-").concat(l.start)}),l=s[++r];return n})(t,s),[t,s]),c=e=>null!==e.start&&null!==e.end&&a>=e.start&&a<=e.end,u=e=>a>=e.start&&a<=e.end;return(0,n.jsxs)("div",{className:"h-full rounded-xl border border-slate-800 bg-slate-900 p-4",children:[(0,n.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h2",{className:"text-base font-semibold text-slate-100",children:"Alignment"}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-green-500/15 px-2.5 py-0.5 text-xs font-semibold text-green-300 ring-1 ring-inset ring-green-500/25",children:"Correct"}),(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-amber-500/15 px-2.5 py-0.5 text-xs font-semibold text-amber-200 ring-1 ring-inset ring-amber-500/25",children:"Misread"}),(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-red-500/15 px-2.5 py-0.5 text-xs font-semibold text-red-300 ring-1 ring-inset ring-red-500/25",children:"Omitted"}),(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-violet-500/15 px-2.5 py-0.5 text-xs font-semibold text-violet-300 ring-1 ring-inset ring-violet-500/25",children:"Inserted"})]})]}),0===d.length?(0,n.jsx)("p",{className:"text-sm text-slate-400",children:"No aligned words for this recording."}):(0,n.jsx)("div",{className:"flex flex-wrap items-start gap-2 leading-loose",children:d.map(e=>"word"===e.kind?(0,n.jsx)(f,{word:e.word,override:o.get(e.word.position),isActive:c(e.word),onSeek:i},"word-".concat(e.word.position)):(0,n.jsx)(h,{insertion:e.insertion,isActive:u(e.insertion),onSeek:i},e.key))})]})},g={client:{label:"Client-side",where:"Student browser",className:"bg-sky-500/15 text-sky-300 ring-sky-500/30"},server:{label:"Server-side",where:"GCP Cloud Function",className:"bg-purple-500/15 text-purple-300 ring-purple-500/30"}},b=e=>{let{execution:t,withWhere:s=!1}=e,r=g[t];return(0,n.jsxs)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset ".concat(r.className),title:r.where,children:[r.label,s&&(0,n.jsxs)("span",{className:"ml-1 font-normal opacity-75",children:["\xb7 ",r.where]})]})},j={gcs:{glyph:"â",label:"Cloud Storage"},mysql:{glyph:"â",label:"MySQL (PlanetScale)"}},N={read:{label:"reads",className:"bg-blue-500/15 text-blue-300 ring-blue-500/30"},write:{label:"writes",className:"bg-emerald-500/15 text-emerald-300 ring-emerald-500/30"}},y=e=>{let{dataStores:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"Data stores"}),(0,n.jsx)("ul",{className:"mt-1 space-y-1.5",children:t.map(e=>{let t=j[e.store],s=N[e.access];return(0,n.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-slate-800 bg-slate-800/50 px-2.5 py-1.5",children:[(0,n.jsx)("span",{title:t.label,className:"shrink-0 text-base leading-none text-slate-400",children:t.glyph}),(0,n.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide ring-1 ring-inset ".concat(s.className),children:s.label}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-slate-300",title:e.label,children:e.label})]},"".concat(e.store,"-").concat(e.access,"-").concat(e.label))})})]})},w={library:{glyph:"{ }",label:"Library"},technique:{glyph:"â",label:"Technique"},code:{glyph:"</>",label:"Code"},doc:{glyph:"\uD83D\uDCC4",label:"Doc"}},S=e=>{let{references:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"References"}),(0,n.jsx)("ul",{className:"mt-1 space-y-1",children:t.map(e=>{let t=w[e.kind];return(0,n.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("span",{title:t.label,className:"w-8 shrink-0 text-center font-mono text-[10px] text-slate-500",children:t.glyph}),(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 hover:underline",children:e.label})]},"".concat(e.kind,"-").concat(e.url))})})]})},E=e=>{let{title:t,record:s,excludeKeys:r=[]}=e,l=new Set(r),a=Object.entries(s).filter(e=>{let[t]=e;return!l.has(t)});return 0===a.length?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:t}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:"None"})]}):(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:t}),(0,n.jsx)("table",{className:"mt-1 w-full text-sm",children:(0,n.jsx)("tbody",{className:"divide-y divide-slate-800",children:a.map(e=>{let[t,s]=e,r=null!==s&&"object"==typeof s;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"w-1/3 py-1 pr-3 align-top font-mono text-xs text-slate-500",children:t}),(0,n.jsx)("td",{className:"py-1 align-top text-slate-200",children:r?(0,n.jsx)("pre",{className:"max-w-full overflow-x-auto whitespace-pre-wrap rounded bg-slate-950 p-2 text-xs text-slate-300 ring-1 ring-inset ring-slate-800",children:JSON.stringify(s,null,2)}):null==s?"â":"boolean"==typeof s?s?"Yes":"No":"number"==typeof s?Number.isFinite(s)?String(s):"â":"string"==typeof s?s.length>0?s:"â":""})]},t)})})})]})},P=e=>{let{stage:t}=e,[s,l]=(0,r.useState)(!1),[a,i]=(0,r.useState)(!1);return(0,n.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex w-full items-center justify-between px-4 py-3 text-left hover:bg-slate-800/40",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-slate-100",children:t.name}),!s&&(0,n.jsx)("div",{className:"mt-0.5 truncate text-xs text-slate-400",children:t.explainer})]}),(0,n.jsxs)("span",{className:"ml-3 flex shrink-0 items-center gap-3",children:[(0,n.jsx)(b,{execution:t.execution}),(0,n.jsx)("span",{className:"text-slate-500",children:s?"â²":"â¼"})]})]}),s&&(0,n.jsxs)("div",{className:"space-y-4 border-t border-slate-800 px-4 py-4",children:[(0,n.jsx)("p",{className:"text-sm text-slate-300",children:t.explainer}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-slate-500",children:"Runs on"}),(0,n.jsx)(b,{execution:t.execution,withWhere:!0})]}),t.dataStores.length>0&&(0,n.jsx)(y,{dataStores:t.dataStores}),t.references&&t.references.length>0&&(0,n.jsx)(S,{references:t.references}),(0,n.jsx)(E,{title:"Inputs",record:t.inputs}),(0,n.jsx)(E,{title:"Outputs",record:t.outputs,excludeKeys:"whisper"===t.id?["rawWhisperResponse"]:void 0}),"whisper"===t.id&&(0,n.jsxs)("div",{className:"border-t border-slate-800 pt-3",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"text-xs font-medium text-indigo-400 hover:text-indigo-300",children:[a?"Hide":"Show"," raw whisper response
1(JSON)"]}),a&&(0,n.jsx)("pre",{className:"mt-2 max-h-96 overflow-auto rounded bg-slate-950 p-3 text-xs text-slate-300 ring-1 ring-inset ring-slate-800",children:JSON.stringify(t.outputs.rawWhisperResponse,null,2)})]})]})]})},k=e=>{let{stages:t}=e;return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-slate-400",children:"Pipeline trace"}),t.map(e=>(0,n.jsx)(P,{stage:e},e.id))]})},T={wpm:"WPM",wpmNullReason:"WPM null reason",alignmentScore:"Alignment score","confidence.score":"Confidence score","confidence.level":"Confidence level"};function C(e){return null==e?"â":String(e)}let O=e=>{let{drift:t}=e;return 0===t.length?null:(0,n.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4",children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-amber-400",children:"â ï¸"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-amber-200",children:"Drift detected"}),(0,n.jsx)("p",{className:"mt-1 text-xs text-amber-300/80",children:"The scoring code has changed since this recording was processed â the values recomputed just now differ from what's stored on the recording."}),(0,n.jsxs)("table",{className:"mt-3 w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-left text-xs font-medium uppercase tracking-wide text-amber-400/80",children:[(0,n.jsx)("th",{className:"pb-1 pr-3",children:"Field"}),(0,n.jsx)("th",{className:"pb-1 pr-3",children:"Stored"}),(0,n.jsx)("th",{className:"pb-1",children:"Recomputed"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-amber-500/20",children:t.map(e=>{var t;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"py-1 pr-3 font-medium text-amber-100",children:null!==(t=T[e.field])&&void 0!==t?t:e.field}),(0,n.jsx)("td",{className:"py-1 pr-3 font-mono text-amber-100",children:C(e.stored)}),(0,n.jsx)("td",{className:"py-1 font-mono text-amber-100",children:C(e.recomputed)})]},e.field)})})]})]})]})})},R="https://github.com/litlab-ai/monorepo/blob/main",M=[{title:"Alignment writes WordEvidence rows",body:"Each reference wordâs outcome (EQUAL / REPLACE / DELETE) is persisted as one WordEvidence row: value (1 = correct, 0 = incorrect), type, source (READING / SPELLING), position, and confidence. A teacher override rewrites the row (wasOverridden, originalType); rows flagged isExcluded are ignored downstream.",store:{label:"WordEvidence (MySQL)",glyph:"â"},code:{label:"whisperWordEvidence.ts",url:"".concat(R,"/apps/web/src/server/utils/whisperWordEvidence.ts")}},{title:"Completion triggers a recompute",body:"When the recordingâs AI analysis reaches COMPLETED â or a teacher verifies it â scope progress is recomputed for that student + scope in real time. A nightly job is the backstop.",code:{label:"recomputeScopeProgressOnComplete.ts",url:"".concat(R,"/src/services/recordingProcessingService/recomputeScopeProgressOnComplete.ts")}},{title:"Rows aggregate into StudentScopeProgress",body:"The scopeâs skill words + high-frequency words are matched against the studentâs non-excluded WordEvidence. Counts (total, correct, unique) are partitioned into verified (teacher-reviewed) vs unverified (AI-only), then upserted as one StudentScopeProgress row per (student, scope).",store:{label:"StudentScopeProgress (MySQL)",glyph:"â"},code:{label:"scopeProgress.ts",url:"".concat(R,"/apps/web/src/server/utils/scopeProgress.ts")}},{title:"Skill map renders",body:"The teacher dashboard reads StudentScopeProgress to draw the phonics + high-frequency-word skill maps. Results are cached in Redis and invalidated on each recompute so the teacher sees updates immediately.",store:{label:"Skill map (Redis cache â dashboard)",glyph:"â"}}],I=e=>{let{open:t,onClose:s}=e;return((0,r.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,s]),t)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":"How WordEvidence becomes a skill map",children:[(0,n.jsx)("button",{type:"button","aria-label":"Close",onClick:s,className:"absolute inset-0 bg-black/50"}),(0,n.jsxs)("div",{className:"relative z-10 flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-xl border border-slate-800 bg-slate-900 shadow-xl shadow-black/40",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between border-b border-slate-800 px-5 py-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-slate-100",children:"From WordEvidence to Skill Maps"}),(0,n.jsx)("p",{className:"mt-0.5 text-sm text-slate-400",children:"How the rows below roll up into the teacher dashboard."})]}),(0,n.jsx)("button",{type:"button",onClick:s,className:"ml-4 rounded-md p-1 text-slate-500 hover:bg-slate-800 hover:text-slate-300","aria-label":"Close",children:(0,n.jsx)("span",{className:"text-xl leading-none",children:"\xd7"})})]}),(0,n.jsxs)("div",{className:"overflow-y-auto px-5 py-4",children:[(0,n.jsx)("ol",{className:"space-y-4",children:M.map((e,t)=>(0,n.jsxs)("li",{className:"flex gap-3",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-indigo-500/15 text-sm font-semibold text-indigo-300 ring-1 ring-inset ring-indigo-500/30",children:t+1}),t<M.length-1&&(0,n.jsx)("span",{className:"mt-1 w-px flex-1 bg-slate-700"})]}),(0,n.jsxs)("div",{className:"pb-1",children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-slate-100",children:e.title}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:e.body}),(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.store&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-slate-800 bg-slate-800/50 px-2 py-1 text-xs font-medium text-slate-300",children:[(0,n.jsx)("span",{className:"text-slate-400",children:e.store.glyph}),e.store.label]}),e.code&&(0,n.jsxs)("a",{href:e.code.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-indigo-300 hover:bg-indigo-500/10 hover:text-indigo-200",children:[(0,n.jsx)("span",{className:"font-mono text-[10px] text-slate-500",children:"</>"}),e.code.label]})]})]})]},e.title))}),(0,n.jsxs)("div",{className:"mt-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-200",children:[(0,n.jsx)("span",{className:"font-semibold",children:"Verified vs. unverified:"})," AI-only recordings still count toward the map as ",(0,n.jsx)("em",{children:"unverified"})," signal; a teacher review promotes them to verified. High-frequency words are counted from verified recordings only."]})]})]})]}):null},A=a()(()=>s.e(9587).then(s.bind(s,69587)).then(e=>e.WaveformLane),{loadableGenerated:{webpack:()=>[69587]},ssr:!1});function _(e){return null==e?"â":"boolean"==typeof e?e?"Yes":"No":String(e)}let F=e=>{var t,s;let{storedAnalysis:r}=e;return r?(0,n.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-4",children:[(0,n.jsx)("h2",{className:"mb-2 text-sm font-semibold text-slate-300",children:"Stored values"}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-slate-500",children:"WPM"}),(0,n.jsx)("div",{className:"font-mono text-sm text-slate-100",children:null!==r.wpm?r.wpm.toFixed(1):"â"}),null===r.wpm&&r.wpmNullReason&&(0,n.jsx)("div",{className:"text-xs text-slate-500",children:(0,i.q)(r.wpmNullReason).message})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-slate-500",children:"Alignment score"}),(0,n.jsx)("div",{className:"font-mono text-sm text-slate-100",children:null!==r.alignmentScore?"".concat((100*r.alignmentScore).toFixed(0),"%"):"â"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-slate-500",children:"Confidence score"}),(0,n.jsx)("div",{className:"font-mono text-sm text-slate-100",children:r.confidence?r.confidence.score.toFixed(3):"â"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wide text-slate-500",children:"Confidence level"}),(0,n.jsx)("div",{className:"font-mono text-sm text-slate-100",children:null!==(s=null===(t=r.confidence)||void 0===t?void 0:t.level)&&void 0!==s?s:"â"})]})]})]}):(0,n.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-4 text-sm text-slate-400",children:"No stored analysis values on this recording."})},D=e=>{let{rows:t}=e;return 0===t.length?(0,n.jsx)("div",{className:"rounded-lg border border-slate-800 bg-slate-800/40 p-4 text-center text-sm text-slate-400",children:"No word evidence recorded for this recording."}):(0,n.jsx)("div",{className:"overflow-hidden rounded-lg border border-slate-800",children:(0,n.jsx)("div",{className:"max-h-96 overflow-auto",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-slate-800 text-sm",children:[(0,n.jsx)("thead",{className:"bg-slate-800/60",children:(0,n.jsx)("tr",{children:["Pos","Word","Type","Value","Confidence","Excluded","Overridden"].map(e=>(0,n.jsx)("th",{className:"px-3 py-2 text-left font-medium text-slate-400",children:e},e))})}),(0,n.jsx)("tbody",{className:"divide-y divide-slate-800 bg-slate-900",children:t.map(e=>{var t;return(0,n.jsxs)("tr",{className:"hover:bg-slate-800/40",children:[(0,n.jsx)("td",{className:"px-3 py-1.5 text-slate-500",children:_(e.position)}),(0,n.jsx)("td",{className:"px-3 py-1.5 font-medium text-slate-100",children:e.word}),(0,n.jsx)("td",{className:"px-3 py-1.5 text-slate-300",children:_(e.type)}),(0,n.jsx)("td",{className:"px-3 py-1.5 text-slate-300",children:e.value}),(0,n.jsx)("td",{className:"px-3 py-1.5 text-slate-300",children:_(e.confidenceLevel)}),(0,n.jsxs)("td",{className:"px-3 py-1.5 text-slate-300",children:[_(e.isExcluded),e.isExcluded&&e.exclusionReason&&(0,n.jsxs)("span",{className:"ml-1 text-xs text-slate-500",children:["(",e.exclusionReason,")"]})]}),(0,n.jsx)("td",{className:"px-3 py-1.5 text-slate-300",title:null!==(t=e.originalType)&&void 0!==t?t:void 0,children:_(e.wasOverrid
1den)})]},e.id)})})]})})})},L=e=>{let{trace:t,kind:s,wordEvidence:l,storedAnalysis:a,audio:i,currentTime:o,onSeek:d}=e,c=(0,r.useRef)(null),[u,x]=(0,r.useState)(0),[p,f]=(0,r.useState)(!1),[h,g]=(0,r.useState)(null),b=(0,r.useCallback)(e=>{if(d){d(e);return}if("full"===s){g({time:e});return}let t=c.current;t&&(t.currentTime=e,t.play().catch(()=>{}))},[d,s]),j=(0,n.jsx)("audio",{ref:c,controls:!0,src:i.src,className:"w-full",onTimeUpdate:e=>x(e.currentTarget.currentTime)});return"full"===s&&t?(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsx)(O,{drift:t.drift}),(0,n.jsx)(A,{audioSrc:i.src,words:t.words,insertions:t.insertions,onSeek:b,onTimeUpdate:x,seekRequest:h}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-12",children:[(0,n.jsx)("div",{className:"lg:col-span-7",children:(0,n.jsx)(v,{words:t.words,insertions:t.insertions,wordEvidence:l,currentTime:null!=o?o:u,onSeek:b})}),(0,n.jsx)("div",{className:"lg:col-span-5",children:(0,n.jsx)(m,{trace:t})})]}),(0,n.jsx)(k,{stages:t.stages}),(0,n.jsxs)("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-4",children:[(0,n.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{className:"text-base font-semibold text-slate-100",children:["WordEvidence records",l.length>0?" (".concat(l.length,")"):""]}),(0,n.jsx)("p",{className:"mt-0.5 text-sm text-slate-400",children:"The per-word rows this recording persisted â the pipeline's durable outcome."})]}),(0,n.jsx)("button",{type:"button",onClick:()=>f(!0),className:"shrink-0 rounded-md bg-indigo-500/15 px-3 py-1.5 text-sm font-medium text-indigo-300 ring-1 ring-inset ring-indigo-500/30 hover:bg-indigo-500/25",children:"How this becomes a skill map â"})]}),(0,n.jsx)(D,{rows:l})]}),(0,n.jsx)(I,{open:p,onClose:()=>f(!1)})]}):(0,n.jsxs)("div",{className:"space-y-4",children:["trace_unavailable"===s&&(0,n.jsx)("div",{className:"rounded-md border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-300",children:"This recording has stored whisper output, but the inspector trace could not be rebuilt from it (unexpected stored JSON shape). Showing stored values and word evidence only."}),(0,n.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-900 p-4",children:j}),(0,n.jsx)(F,{storedAnalysis:a}),(0,n.jsx)(D,{rows:l}),(0,n.jsx)("p",{className:"trace_unavailable"===s?"text-sm font-medium text-red-300":"text-sm text-slate-500",children:"No raw ASR output available for this recording (pre-whisper pipeline)."})]})}},77491:function(e,t,s){var n=s(85893),r=s(25159);t.Z=e=>{let{subheading:t,heading:s,children:l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Z,{}),(0,n.jsxs)("div",{className:"z-1 relative flex items-center bg-yellow-300 px-5 pb-[20px] pt-[50px] text-blue-950",children:[(0,n.jsxs)("div",{className:"flex-1",children:[t&&(0,n.jsx)("div",{className:"font-bold uppercase text-gray-600",children:t}),(0,n.jsx)("div",{className:"text-5xl",children:s})]}),(0,n.jsx)("div",{children:l})]})]})}},34917:function(e,t,s){s.d(t,{q:function(){return l}});let n={message:"We couldn't measure a reading speed for this recording.",csvStatus:"unavailable"},r={NO_AUDIO_WORDS:{message:"We couldn't match this recording to the story.",csvStatus:"unavailable_no_alignment"},NO_REFERENCE_TEXT:{message:"This story had no text to measure a reading speed against.",csvStatus:"unavailable_no_reference"},TOO_FEW_MATCHED_WORDS:{message:"This reading was too short to measure a speed.",csvStatus:"unavailable_too_short"},NON_POSITIVE_DURATION:{message:"We couldn't measure the timing on this recording.",csvStatus:"unavailable_timing"},IMPLAUSIBLE_RATE:{message:"Reading speed couldn't be measured reliably here.",csvStatus:"unavailable_implausible"}},l=e=>e&&e in r?r[e]:n},52195:function(e,t,s){let n,r;s.d(t,{J:function(){return W}});var l=s(67294),a=s(94047),i=s(20609),o=s(88449),d=s(47822),c=s(53050),u=s(66305),x=s(79494),p=s(10937),m=s(97634),f=s(69230),h=s(69272),v=s(21890),g=s(62625),b=s(62989),j=s(56071),N=s(58200),y=s(59920),w=s(16768),S=s(12332),E=s(61829),P=((n=P||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),k=((r=k||{})[r.TogglePopover=0]="TogglePopover",r[r.ClosePopover=1]="ClosePopover",r[r.SetButton=2]="SetButton",r[r.SetButtonId=3]="SetButtonId",r[r.SetPanel=4]="SetPanel",r[r.SetPanelId=5]="SetPanelId",r);let T={0:e=>{let t={...e,popoverState:(0,y.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>
1e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},C=(0,l.createContext)(null);function O(e){let t=(0,l.useContext)(C);if(null===t){let t=Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,O),t}return t}C.displayName="PopoverContext";let R=(0,l.createContext)(null);function M(e){let t=(0,l.useContext)(R);if(null===t){let t=Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,M),t}return t}R.displayName="PopoverAPIContext";let I=(0,l.createContext)(null);function A(){return(0,l.useContext)(I)}I.displayName="PopoverGroupContext";let _=(0,l.createContext)(null);function F(e,t){return(0,y.E)(t.type,T,e,t)}_.displayName="PopoverPanelContext";let D=S.AN.RenderStrategy|S.AN.Static,L=S.AN.RenderStrategy|S.AN.Static,W=Object.assign((0,S.yV)(function(e,t){var s;let{__demoMode:n=!1,...r}=e,d=(0,l.useRef)(null),c=(0,h.T)(t,(0,h.h)(e=>{d.current=e})),m=(0,l.useRef)([]),v=(0,l.useReducer)(F,{__demoMode:n,popoverState:n?0:1,buttons:m,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,l.createRef)(),afterPanelSentinel:(0,l.createRef)()}),[{popoverState:g,button:j,buttonId:w,panel:E,panelId:P,beforePanelSentinel:k,afterPanelSentinel:T},O]=v,M=(0,p.i)(null!=(s=d.current)?s:j),I=(0,l.useMemo)(()=>{if(!j||!E)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(j))^Number(null==e?void 0:e.contains(E)))return!0;let e=(0,N.GO)(),t=e.indexOf(j),s=(t+e.length-1)%e.length,n=(t+1)%e.length,r=e[s],l=e[n];return!E.contains(r)&&!E.contains(l)},[j,E]),D=(0,u.E)(w),L=(0,u.E)(P),W=(0,l.useMemo)(()=>({buttonId:D,panelId:L,close:()=>O({type:1})}),[D,L,O]),H=A(),z=null==H?void 0:H.registerPopover,B=(0,i.z)(()=>{var e;return null!=(e=null==H?void 0:H.isFocusWithinPopoverGroup())?e:(null==M?void 0:M.activeElement)&&((null==j?void 0:j.contains(M.activeElement))||(null==E?void 0:E.contains(M.activeElement)))});(0,l.useEffect)(()=>null==z?void 0:z(W),[z,W]);let[G,V]=(0,a.k)(),q=(0,f.v)({mainTreeNodeRef:null==H?void 0:H.mainTreeNodeRef,portals:G,defaultContainers:[j,E]});(0,o.O)(null==M?void 0:M.defaultView,"focus",e=>{var t,s,n,r;e.target!==window&&e.target instanceof HTMLElement&&0===g&&(B()||j&&E&&(q.contains(e.target)||null!=(s=null==(t=k.current)?void 0:t.contains)&&s.call(t,e.target)||null!=(r=null==(n=T.current)?void 0:n.contains)&&r.call(n,e.target)||O({type:1})))},!0),(0,x.O)(q.resolveContainers,(e,t)=>{O({type:1}),(0,N.sP)(t,N.tJ.Loose)||(e.preventDefault(),null==j||j.focus())},0===g);let Y=(0,i.z)(e=>{O({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:j:j;null==t||t.focus()}),U=(0,l.useMemo)(()=>({close:Y,isPortalled:I}),[Y,I]),J=(0,l.useMemo)(()=>({open:0===g,close:Y}),[g,Y]);return l.createElement(_.Provider,{value:null},l.createElement(C.Provider,{value:v},l.createElement(R.Provider,{value:U},l.createElement(b.up,{value:(0,y.E)(g,{0:b.ZM.Open,1:b.ZM.Closed})},l.createElement(V,null,(0,S.sY)({ourProps:{ref:c},theirProps:r,slot:J,defaultTag:"div",name:"Popover"}),l.createElement(q.MainTreeNode,null))))))}),{Button:(0,S.yV)(function(e,t){let s=(0,d.M)(),{id:n=`headlessui-popover-button-${s}`,...r}=e,[a,o]=O("Popover.Button"),{isPortalled:c}=M("Popover.Button"),u=(0,l.useRef)(null),x=`headlessui-focus-sentinel-${(0,d.M)()}`,f=A(),b=null==f?void 0:f.closeOthers,w=null!==(0,l.useContext)(_);(0,l.useEffect)(()=>{if(!w)return o({type:3,buttonId:n}),()=>{o({type:3,buttonId:null})}},[w,n,o]);let[P]=(0,l.useState)(()=>Symbol()),k=(0,h.T)(u,t,w?null:e=>{if(e)a.buttons.current.push(P);else{let e=a.buttons.current.indexOf(P);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&o({type:2,button:e})}),T=(0,h.T)(u,t),C=(0,p.i)(u),R=(0,i.z)(e=>{var t,s,n;if(w){if(1===a.popoverState)return;switch(e.key){case E.R.Space:case E.R.Enter:e.preventDefault(),null==(s=(t=e.target).click)||s.call(t),o({type:1}),null==(n=a.button)||n.focus()}}else switch(e.key){case E.R.Space:case E.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==b||b(a.buttonId)),o({type:0});break;case E.R.Escape:if(0!==a.popoverState)return null==b?void 0:b(a.buttonId);if(!u.current||null!=C&&C.activeElement&&!u.current.contains(C.activeElement))return;e.preventDefault(),e.stopPropagation(),o({type:1})}}),I=(0,i.z)(e=>{w||e.key===E.R.Space&&e.preventDefault()}),F=(0,i.z)(t=>{var s,n;(0,j.P)(t.currentTarget)||e.disabled||(w?(o({type:1}),null==(s=a.button)||s.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==b||b(a.buttonId)),o({type:0}),null==(n=a.button)||n.focus()))}),D=(0,i.z)(e=>{e.preventDefault(),e.stopPropagation()}),L=0===a.popoverState,W=(0,l.useMemo)(()=>({open:L}),[L]),H=(0,m.f)(e,u),z=w?{ref:T,type:H,onKeyDown:R,onClick:F}:{ref:k,id:a.buttonId,type:H,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:R,onKeyUp:I,onClick:F,onMouseDown:D},B=(0,v.l)(),G=(0,i.z)(()=>{let e=a.panel;e&&(0,y.E)(B.current,{[v.N.Forwards]:()=>(0,N.jA)(e,N.TO.First),[v.N.Backwards]:()=>(0,N.jA)(e,N.TO.Last)})===N.fE.Error&&(0,N.jA)((0,N.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,y.E)(B.current,{[v.N.Forwards]:N.TO.Next,[v.N.Backwards]:N.TO.Previous}),{relativeTo:a.button})});return l.createElement(l.Fragment,null,(0,S.sY)({ourProps:z,theirProps:r,slot:W,defaultTag:"button",name:"Popover.Button"}),L&&!w&&c&&l.createElement(g._,{id:x,features:g.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:G}))}),Overlay:(0,S.yV)(function(e,t){let s=(0,d.M)(),{id:n=`headlessui-popover-overlay-${s}`,...r}=e,[{popoverState:a},o]=O("Popover.Overlay"),c=(0,h.T)(t),u=(0,b.oJ)(),x=null!==u?(u&b.ZM.Open)===b.ZM.Open:0===a,p=(0,i.z)(e=>{if((0,j.P)(e.currentTarget))return e.preventDefault();o({type:1})}),m=(0,l.useMemo)(()=>({open:0===a}
1),[a]);return(0,S.sY)({ourProps:{ref:c,id:n,"aria-hidden":!0,onClick:p},theirProps:r,slot:m,defaultTag:"div",features:D,visible:x,name:"Popover.Overlay"})}),Panel:(0,S.yV)(function(e,t){let s=(0,d.M)(),{id:n=`headlessui-popover-panel-${s}`,focus:r=!1,...a}=e,[o,u]=O("Popover.Panel"),{close:x,isPortalled:m}=M("Popover.Panel"),f=`headlessui-focus-sentinel-before-${(0,d.M)()}`,j=`headlessui-focus-sentinel-after-${(0,d.M)()}`,w=(0,l.useRef)(null),P=(0,h.T)(w,t,e=>{u({type:4,panel:e})}),k=(0,p.i)(w),T=(0,S.Y2)();(0,c.e)(()=>(u({type:5,panelId:n}),()=>{u({type:5,panelId:null})}),[n,u]);let C=(0,b.oJ)(),R=null!==C?(C&b.ZM.Open)===b.ZM.Open:0===o.popoverState,I=(0,i.z)(e=>{var t;if(e.key===E.R.Escape){if(0!==o.popoverState||!w.current||null!=k&&k.activeElement&&!w.current.contains(k.activeElement))return;e.preventDefault(),e.stopPropagation(),u({type:1}),null==(t=o.button)||t.focus()}});(0,l.useEffect)(()=>{var t;e.static||1===o.popoverState&&(null==(t=e.unmount)||t)&&u({type:4,panel:null})},[o.popoverState,e.unmount,e.static,u]),(0,l.useEffect)(()=>{if(o.__demoMode||!r||0!==o.popoverState||!w.current)return;let e=null==k?void 0:k.activeElement;w.current.contains(e)||(0,N.jA)(w.current,N.TO.First)},[o.__demoMode,r,w,o.popoverState]);let A=(0,l.useMemo)(()=>({open:0===o.popoverState,close:x}),[o,x]),F={ref:P,id:n,onKeyDown:I,onBlur:r&&0===o.popoverState?e=>{var t,s,n,r,l;let a=e.relatedTarget;a&&w.current&&(null!=(t=w.current)&&t.contains(a)||(u({type:1}),(null!=(n=null==(s=o.beforePanelSentinel.current)?void 0:s.contains)&&n.call(s,a)||null!=(l=null==(r=o.afterPanelSentinel.current)?void 0:r.contains)&&l.call(r,a))&&a.focus({preventScroll:!0})))}:void 0,tabIndex:-1},D=(0,v.l)(),W=(0,i.z)(()=>{let e=w.current;e&&(0,y.E)(D.current,{[v.N.Forwards]:()=>{var t;(0,N.jA)(e,N.TO.First)===N.fE.Error&&(null==(t=o.afterPanelSentinel.current)||t.focus())},[v.N.Backwards]:()=>{var e;null==(e=o.button)||e.focus({preventScroll:!0})}})}),H=(0,i.z)(()=>{let e=w.current;e&&(0,y.E)(D.current,{[v.N.Forwards]:()=>{var e;if(!o.button)return;let t=(0,N.GO)(),s=t.indexOf(o.button),n=t.slice(0,s+1),r=[...t.slice(s+1),...n];for(let t of r.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=o.panel)&&e.contains(t)){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}(0,N.jA)(r,N.TO.First,{sorted:!1})},[v.N.Backwards]:()=>{var t;(0,N.jA)(e,N.TO.Previous)===N.fE.Error&&(null==(t=o.button)||t.focus())}})});return l.createElement(_.Provider,{value:n},R&&m&&l.createElement(g._,{id:f,ref:o.beforePanelSentinel,features:g.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:W}),(0,S.sY)({mergeRefs:T,ourProps:F,theirProps:a,slot:A,defaultTag:"div",features:L,visible:R,name:"Popover.Panel"}),R&&m&&l.createElement(g._,{id:j,ref:o.afterPanelSentinel,features:g.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:H}))}),Group:(0,S.yV)(function(e,t){let s=(0,l.useRef)(null),n=(0,h.T)(s,t),[r,a]=(0,l.useState)([]),o=(0,f.H)(),d=(0,i.z)(e=>{a(t=>{let s=t.indexOf(e);if(-1!==s){let e=t.slice();return e.splice(s,1),e}return t})}),c=(0,i.z)(e=>(a(t=>[...t,e]),()=>d(e))),u=(0,i.z)(()=>{var e;let t=(0,w.r)(s);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=s.current)&&e.contains(n))||r.some(e=>{var s,r;return(null==(s=t.getElementById(e.buttonId.current))?void 0:s.contains(n))||(null==(r=t.getElementById(e.panelId.current))?void 0:r.contains(n))})}),x=(0,i.z)(e=>{for(let t of r)t.buttonId.current!==e&&t.close()}),p=(0,l.useMemo)(()=>({registerPopover:c,unregisterPopover:d,isFocusWithinPopoverGroup:u,closeOthers:x,mainTreeNodeRef:o.mainTreeNodeRef}),[c,d,u,x,o.mainTreeNodeRef]),m=(0,l.useMemo)(()=>({}),[]);return l.createElement(I.Provider,{value:p},(0,S.sY)({ourProps:{ref:n},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),l.createElement(o.MainTreeNode,null))})})},94047:function(e,t,s){s.d(t,{h:function(){return b},k:function(){return g}});var n=s(67294),r=s(73935),l=s(20609),a=s(53050),i=s(40387),o=s(10937),d=s(29514),c=s(69272),u=s(29235),x=s(85286),p=s(12332);let m=n.Fragment,f=n.Fragment,h=(0,n.createContext)(null),v=(0,n.createContext)(null);function g(){let e=(0,n.useContext)(v),t=(0,n.useRef)([]),s=(0,l.z)(s=>(t.current.push(s),e&&e.register(s),()=>r(s))),r=(0,l.z)(s=>{let n=t.current.indexOf(s);-1!==n&&t.current.splice(n,1),e&&e.unregister(s)}),a=(0,n.useMemo)(()=>({register:s,unregister:r,portals:t}),[s,r,t]);return[t,(0,n.useMemo)(()=>function({children:e}){return n.createElement(v.Provider,{value:a},e)},[a])]}let b=Object.assign((0,p.yV)(function(e,t){let s=(0,n.useRef)(null),l=(0,c.T)((0,c.h)(e=>{s.current=e}),t),f=(0,o.i)(s),g=function(e){let t=(0,u.n)(),s=(0,n.useContext)(h),r=(0,o.i)(e),[l,a]=(0,n.use
1State)(()=>{if(!t&&null!==s||x.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let n=r.createElement("div");return n.setAttribute("id","headlessui-portal-root"),r.body.appendChild(n)});return(0,n.useEffect)(()=>{null!==l&&(null!=r&&r.body.contains(l)||null==r||r.body.appendChild(l))},[l,r]),(0,n.useEffect)(()=>{t||null!==s&&a(s.current)},[s,a,t]),l}(s),[b]=(0,n.useState)(()=>{var e;return x.O.isServer?null:null!=(e=null==f?void 0:f.createElement("div"))?e:null}),j=(0,n.useContext)(v),N=(0,d.H)();return(0,a.e)(()=>{!g||!b||g.contains(b)||(b.setAttribute("data-headlessui-portal",""),g.appendChild(b))},[g,b]),(0,a.e)(()=>{if(b&&j)return j.register(b)},[j,b]),(0,i.L)(()=>{var e;g&&b&&(b instanceof Node&&g.contains(b)&&g.removeChild(b),g.childNodes.length<=0&&(null==(e=g.parentElement)||e.removeChild(g)))}),N&&g&&b?(0,r.createPortal)((0,p.sY)({ourProps:{ref:l},theirProps:e,defaultTag:m,name:"Portal"}),b):null}),{Group:(0,p.yV)(function(e,t){let{target:s,...r}=e,l={ref:(0,c.T)(t)};return n.createElement(h.Provider,{value:s},(0,p.sY)({ourProps:l,theirProps:r,defaultTag:f,name:"Popover.Group"}))})})},88449:function(e,t,s){s.d(t,{O:function(){return l}});var n=s(67294),r=s(66305);function l(e,t,s,l){let a=(0,r.E)(s);(0,n.useEffect)(()=>{function s(e){a.current(e)}return(e=null!=e?e:window).addEventListener(t,s,l),()=>e.removeEventListener(t,s,l)},[e,t,l])}},40387:function(e,t,s){s.d(t,{L:function(){return a}});var n=s(67294),r=s(42606),l=s(20609);function a(e){let t=(0,l.z)(e),s=(0,n.useRef)(!1);(0,n.useEffect)(()=>(s.current=!1,()=>{s.current=!0,(0,r.Y)(()=>{s.current&&t()})}),[t])}},69230:function(e,t,s){s.d(t,{H:function(){return o},v:function(){return i}});var n=s(67294),r=s(62625),l=s(20609),a=s(10937);function i({defaultContainers:e=[],portals:t,mainTreeNodeRef:s}={}){var i;let o=(0,n.useRef)(null!=(i=null==s?void 0:s.current)?i:null),d=(0,a.i)(o),c=(0,l.z)(()=>{var s,n,r;let l=[];for(let t of e)null!==t&&(t instanceof HTMLElement?l.push(t):"current"in t&&t.current instanceof HTMLElement&&l.push(t.current));if(null!=t&&t.current)for(let e of t.current)l.push(e);for(let e of null!=(s=null==d?void 0:d.querySelectorAll("html > *, body > *"))?s:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(e.contains(o.current)||e.contains(null==(r=null==(n=o.current)?void 0:n.getRootNode())?void 0:r.host)||l.some(t=>e.contains(t))||l.push(e));return l});
1return{resolveContainers:c,contains:(0,l.z)(e=>c().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,n.useMemo)(()=>function(){return null!=s?null:n.createElement(r._,{features:r.A.Hidden,ref:o})},[o,s])}}function o(){let e=(0,n.useRef)(null);return{mainTreeNodeRef:e,MainTreeNode:(0,n.useMemo)(()=>function(){return n.createElement(r._,{features:r.A.Hidden,ref:e})},[e])}}},21890:function(e,t,s){let n;s.d(t,{N:function(){return a},l:function(){return i}});var r=s(67294),l=s(62935),a=((n=a||{})[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n);function i(){let e=(0,r.useRef)(0);return(0,l.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}},29235:function(e,t,s){s.d(t,{O:function(){return a},n:function(){return l}});var n=s(67294);let r=(0,n.createContext)(!1);function l(){return(0,n.useContext)(r)}function a(e){return n.createElement(r.Provider,{value:e.force},e.children)}}}]);
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.