PageSourceSearch

https://analytics.whiteknight.academy/assets/SuggestedHomeworkTab-C6sq6fau.js

js whiteknight.academy collected 2026-09-24 14:09:50 UTC 21,201 bytes, 3 lines download raw bytes

1var U=Object.defineProperty;var o=(s,n)=>U(s,"name",{value:n,configurable:!0});import{j as e,D as H}from"./emailRef-2_pXTFTA.js";import{r as m,h as q}from"./react-vendor-DAHDpbpd.js";import{r as R}from"./recommendationService-C8mozOlt.js";import{P as W}from"./puzzleConstants-BJ6IzKi3.js";import{A as G}from"./Avatar-9XXbe2yj.js";import{a as Q,a0 as Z,av as D,Q as A,e as P,b as E,g as V,R as F,v as X,bQ as Y,r as J}from"./icons-vendor-BkJfVEt0.js";import{g as K,X as ee,i as te,T as $}from"./campaign-icons-DGRZg7ro.js";import{T as se}from"./forms-QCnacu7Q.js";import"./index-BHnHaHtD.js";import"./supabase-vendor-Ba-0_w4O.js";import"./puzzleHomeworkService-C7p4uB-Y.js";import"./coachStudentName-Btxy_lQs.js";import"./avatarUtils-SfZ6QPAx.js";function ae(s){const[n,c]=m.useState([]),[i,r]=m.useState(["proposed","coach_reviewed"]),[h,u]=m.useState(!1),[j,g]=m.useState(null),[N,y]=m.useState({}),w=m.useRef(0),k=m.useCallback(async()=>{if(!s){c([]);return}const l=++w.current;u(!0),g(null);try{const x=await R.listMyRecommendations(s,i);l===w.current&&c(x)}catch(x){l===w.current&&(g(x instanceof Error?x.message:String(x)),c([]))}finally{l===w.current&&u(!1)}},[s,i]);m.useEffect(()=>{k()},[k]);const b=o((l,x)=>{y(t=>{const p={...t};return x?p[l]=x:delete p[l],p})},"markBusy"),z=m.useCallback(async(l,x)=>{b(l,"save");try{await R.saveEdits(l,x),c(t=>t.map(p=>p.id===l?{...p,editedPayload:x,effectivePayload:x,status:"coach_reviewed",reviewedAt:new Date().toISOString()}:p))}finally{b(l,null)}},[]),f=m.useCallback(async l=>{b(l,"dismiss");try{await R.dismiss(l),c(x=>x.filter(t=>t.id!==l))}finally{b(l,null)}},[]),v=m.useCallback(async l=>{const x=n.find(t=>t.id===l);if(!x)return{ok:!1,reason:"not_found"};if(!s)return{ok:!1,reason:"no_coach"};b(l,"send");try{const t=await R.sendRecommendation(s,x);return t.ok&&c(p=>p.filter(a=>a.id!==l)),t}finally{b(l,null)}},[s,n]),_=m.useCallback(async l=>{const x=n.find(t=>t.studentId===l);x&&b(x.id,"regenerate");try{const t=await R.regenerate(l);return t.ok&&await k(),t}finally{x&&b(x.id,null)}},[n,k]);return{items:n,statuses:i,setStatuses:r,loading:h,error:j,busyById:N,refresh:k,saveEdits:z,dismiss:f,send:v,regenerate:_}}o(ae,"useHomeworkRecommendations");const I={proposed:{label:"New",cls:"bg-amber-500/15 text-[var(--wk-amber-text)] border-amber-500/30"},coach_reviewed:{label:"Reviewed",cls:"bg-amber-500/10 text-[var(--wk-amber-text)] border-amber-500/30"}},T={tactics:{label:"Tactics focus",cls:"bg-rose-500/10 text-[var(--wk-red-text)] border-rose-500/30"},openings:{label:"Openings focus",cls:"bg-sky-500/10 text-[var(--wk-sky-text)] border-sky-500/30"},balanced:{label:"Balanced",cls:"bg-emerald-500/10 text-[var(--wk-emerald-text)] border-emerald-500/30"}},re=o(s=>{const n=new Date(s).getTime();if(Number.isNaN(n))return"";const c=(Date.now()-n)/1e3;return c<60?"just now":c<3600?`${Math.round(c/60)}m ago`:c<86400?`${Math.round(c/3600)}h ago`:`${Math.round(c/86400)}d ago`},"formatRelative"),ne=o(s=>W[s]??s,"themeLabel"),ie=o(({rec:s,expanded:n,busyAction:c,onToggleExpand:i,onSend:r,onRegenerate:h,onDismiss:u,children:j})=>{const g=s.effectivePayload,N=I[s.status]??I.proposed,y=T[g.study_emphasis]??T.balanced,w=g.weekly_focus_themes.slice(0,3),k=g.ai_note_markdown.split(`
2`).find(b=>b.trim().length>0)??"";return e.jsxs("div",{className:`relative rounded-2xl border transition-all ${n?"border-[var(--wk-accent)]/50 bg-[var(--wk-surface)] shadow-2xl":"border-[var(--wk-border)] bg-[var(--wk-surface)] hover:border-[var(--wk-border-strong)]"}`,children:[e.jsxs("div",{className:"flex flex-col gap-3 p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx(G,{name:s.studentDisplayName,url:s.studentAvatarUrl,id:s.studentId,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:`${H.widgetTitle} truncate text-[var(--wk-text)]`,children:s.studentDisplayName??"Student"}),e.jsx("span",{className:`shrink-0 rounded-full border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${N.cls}`,children:N.label}),s.status==="coach_reviewed"&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/30 bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-[var(--wk-amber-text)]",children:[e.jsx(Q,{size:10})," edited"]})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-[var(--wk-text-4)]",children:["Generated ",re(s.generatedAt)," ·"," ",e.jsx("span",{className:"text-[var(--wk-text-3)]",children:s.aiModel})]})]}),e.jsx("button",{onClick:i,className:"ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-[var(--wk-border)] bg-[var(--wk-glass)] text-[var(--wk-text-3)] transition hover:border-[var(--wk-border-strong)] hover:text-[var(--wk-text)]","aria-label":n?"Collapse":"Expand",children:n?e.jsx(Z,{size:14}):e.jsx(K,{size:14})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px]",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-[var(--wk-border)] bg-[var(--wk-glass)] px-2 py-1 font-semibold text-[var(--wk-text-2)]",children:[e.jsx(D,{size:11,className:"text-[var(--wk-red-text)]"}),g.puzzle_ids.length," puzzles"]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-[var(--wk-border)] bg-[var(--wk-glass)] px-2 py-1 font-semibold text-[var(--wk-text-2)]",children:[e.jsx(A,{size:11,className:"text-[var(--wk-sky-text)]"}),g.openings.length," openings"]}),e.jsx("span",{className:`inline-flex items-center rounded-md border px-2 py-1 text-[10px] font-bold uppercase tracking-wider ${y.cls}`,children:y.label}),w.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 truncate rounded-md border border-amber-500/30 bg-amber-500/[0.08] px-2 py-1 font-medium text-[var(--wk-amber-text)]",children:[e.jsx(P,{size:10}),w.map(ne).join(" · ")]})]}),!n&&k&&e.jsx("p",{className:"line-clamp-2 text-xs leading-relaxed text-[var(--wk-text-2)]",children:k}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[e.jsxs("button",{onClick:i,className:"inline-flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-semibold text-[var(--wk-amber-text)] transition hover:border-amber-500/50 hover:bg-amber-500/15",children:[e.jsx(P,{size:12}),n?"Close":"Review & edit"]}),e.jsxs("button",{onClick:r,disabled:!!c,className:"inline-flex items-center gap-1.5 rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-semibold text-[var(--wk-emerald-text)] transition hover:border-emerald-500/50 hover:bg-emerald-500/15 disabled:cursor-not-allowed disabled:opacity-50",children:[c==="send"?e.jsx(E,{size:12,className:"animate-spin"}):e.jsx(V,{size:12}),"Send as-is"]}),e.jsxs("button",{onClick:h,disabled:!!c,className:"inline-flex items-center gap-1.5 rounded-lg border border-[var(--wk-border)] bg-[var(--wk-glass)] px-3 py-1.5 text-xs font-semibold text-[var(--wk-text-2)] transition hover:border-[var(--wk-border-strong)] hover:text-[var(--wk-text)] disabled:cursor-not-allowed disabled:opacity-50",children:[c==="regenerate"?e.jsx(E,{size:12,className:"animate-spin"}):e.jsx(F,{size:12}),"Regenerate"]}),e.jsxs("button",{onClick:u,disabled:!!c,className:"ml-auto inline-flex items-center gap-1.5 rounded-lg border border-transparent px-3 py-1.5 text-xs font-medium text-[var(--wk-text-4)] transition hover:border-[var(--wk-border)] hover:text-[var(--wk-text-2)] disabled:cursor-not-allowed disabled:opacity-50",children:[c==="dism
2iss"?e.jsx(E,{size:12,className:"animate-spin"}):e.jsx(ee,{size:12}),"Dismiss"]})]})]}),n&&j]})},"RecommendationCard"),L=220,le=o(({rec:s,busyAction:n,onSave:c})=>{const i=s.effectivePayload,[r,h]=m.useState(i.ai_note_markdown),[u,j]=m.useState(i.puzzle_ids),[g,N]=m.useState(i.openings),[y,w]=m.useState(!1),[k,b]=m.useState(!1);m.useEffect(()=>{h(s.effectivePayload.ai_note_markdown),j(s.effectivePayload.puzzle_ids),N(s.effectivePayload.openings),w(!1),b(!1)},[s.id,s.updatedAt,s.effectivePayload]);const z=r!==i.ai_note_markdown||u.length!==i.puzzle_ids.length||u.some((t,p)=>t!==i.puzzle_ids[p])||g.length!==i.openings.length||g.some((t,p)=>t.catalogue_id!==i.openings[p]?.catalogue_id),f=o(t=>{j(p=>p.filter(a=>a!==t))},"removePuzzle"),v=o(t=>{N(p=>p.filter(a=>a.catalogue_id!==t))},"removeOpening"),_=o(async()=>{const t={...i,ai_note_markdown:r,puzzle_ids:u,openings:g};await c(t)},"handleSave"),l=r.length>L||r.split(`
3`).length>4,x=o(t=>t==="gap"?e.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider text-[var(--wk-amber-text)]",children:"Gap"}):e.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-[var(--wk-border)] bg-[var(--wk-glass)] px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider text-[var(--wk-text-3)]",children:"Popular"}),"showOpeningSourceBadge");return e.jsxs("div",{className:"border-t border-[var(--wk-divider)] bg-[var(--wk-bg-raised)] px-4 py-4 sm:px-5 rounded-b-2xl",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-12",children:[e.jsxs("div",{className:"lg:col-span-7",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{size:12,className:"text-[var(--wk-amber-text)]"}),e.jsx("h4",{className:"text-[11px] font-bold uppercase tracking-wider text-[var(--wk-text-3)]",children:"Coach note (editable)"})]}),!y&&e.jsxs("button",{onClick:o(()=>w(!0),"onClick"),className:"inline-flex items-center gap-1 rounded-md border border-[var(--wk-border)] bg-[var(--wk-glass)] px-2 py-1 text-[11px] font-semibold text-[var(--wk-text-2)] transition hover:border-[var(--wk-border-strong)] hover:text-[var(--wk-text)]",children:[e.jsx(te,{size:10}),"Edit note"]})]}),y?e.jsxs(e.Fragment,{children:[e.jsx(se,{value:r,onChange:o(t=>h(t.target.value),"onChange"),rows:6,className:"min-h-[140px] text-sm leading-relaxed",placeholder:"The AI-written coaching note. Edit before sending; this text appears in the homework email and in-app notification."}),e.jsxs("p",{className:"mt-1.5 text-[11px] text-[var(--wk-text-4)]",children:[r.length," characters",r.length>L&&e.jsx("span",{className:"text-[var(--wk-amber-text)]",children:" · long notes get skimmed — aim for 2 short sentences"})," ","· The AI's original suggestion is kept in the audit trail."]})]}):e.jsxs("div",{className:"rounded-xl border border-[var(--wk-border)] bg-[var(--wk-surface)] p-3",children:[e.jsx("p",{className:`whitespace-pre-line font-body text-sm leading-relaxed text-[var(--wk-text-2)] ${l&&!k?"line-clamp-4":""}`,children:r||e.jsx("span",{className:"italic text-[var(--wk-text-4)]",children:"No note yet."})}),l&&e.jsx("button",{onClick:o(()=>b(t=>!t),"onClick"),className:"mt-1.5 text-[11px] font-semibold text-[var(--wk-accent-text)] transition hover:underline",children:k?"Show less":"Read more"})]})]}),e.jsxs("div",{className:"lg:col-span-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(A,{size:12,className:"text-[var(--wk-sky-text)]"}),e.jsxs("h4",{className:"text-[11px] font-bold uppercase tracking-wider text-[var(--wk-text-3)]",children:["Openings (",g.length,")"]})]}),e.jsxs("div",{className:"space-y-1.5",children:[g.length===0&&e.jsx("p",{className:"text-xs italic text-[var(--wk-text-4)]",children:"No openings selected."}),g.map(t=>e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-[var(--wk-border)] bg-[var(--wk-surface)] px-2.5 py-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] font-bold text-[var(--wk-sky-text)]",children:t.eco}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-[var(--wk-text-2)]",children:[t.name,t.variation?e.jsxs("span",{className:"text-[var(--wk-text-4)]",children:[" · ",t.variation]}):null]}),x(t.role),e.jsx("button",{onClick:o(()=>v(t.catalogue_id),"onClick"),className:"text-[11px] text-[var(--wk-text-4)] transition hover:text-[var(--wk-red-text)]","aria-label":`Remove ${t.name}`,children:"×"})]},t.catalogue_id))]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(D,{size:12,className:"text-[var(--wk-red-text)]"}),e.jsxs("h4",{className:"text-[11px] font-bold uppercase tracking-wider text-[var(--wk-text-3)]",children:["Puzzle pack (",u.length,"/",i.target_puzzle_count,")"]})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--wk-border)] bg-[var(--wk-surface)] p-3",children:[e.jsx("p",{className:"mb-2 text-[11px] leading-relaxed text-[var(--wk-text-3)]",children:u.length===0?"Pack is empty — no puzzles will be sent.":`${u.length} Lichess puzzles selected by the recommender (rating-banded + theme-we
3ighted from this student's signals).`}),u.length>0&&u.length<=12&&e.jsx("ul",{className:"grid grid-cols-3 gap-1 font-mono text-[10px]",children:u.slice(0,12).map(t=>e.jsxs("li",{className:"flex items-center justify-between rounded border border-[var(--wk-border)] bg-[var(--wk-glass)] px-1.5 py-0.5 text-[var(--wk-text-3)]",children:[e.jsx("span",{className:"truncate",children:t}),e.jsx("button",{onClick:o(()=>f(t),"onClick"),className:"ml-1 text-[var(--wk-text-4)] hover:text-[var(--wk-red-text)]","aria-label":`Remove puzzle ${t}`,children:"×"})]},t))}),u.length>12&&e.jsx("p",{className:"text-[11px] text-[var(--wk-text-4)]",children:"Full per-puzzle swap UI ships in Phase D. Drop the whole pack and Regenerate to get a fresh selection now."})]})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--wk-border)] bg-[var(--wk-surface)] p-3 text-[11px] leading-relaxed text-[var(--wk-text-3)]",children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-[var(--wk-text-2)]",children:[e.jsx(X,{size:10})," Why these recommendations"]}),e.jsx(de,{inputSnapshot:s.inputSnapshot})]})]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3 border-t border-[var(--wk-divider)] pt-3",children:[z?e.jsx("span",{className:"text-[11px] font-medium text-[var(--wk-amber-text)]",children:"Unsaved changes — Send will use the AI's original until you save."}):e.jsx("span",{className:"text-[11px] text-[var(--wk-text-4)]",children:"No changes."}),e.jsxs("button",{onClick:_,disabled:!z||n==="save",className:"inline-flex items-center gap-1.5 rounded-lg bg-[var(--wk-accent)] px-4 py-2 text-xs font-semibold text-white shadow-sm transition hover:bg-violet-500 disabled:cursor-not-allowed disabled:opacity-40",children:[n==="save"?e.jsx(E,{size:12,className:"animate-spin"}):e.jsx(Y,{size:12}),"Save edits"]})]})]})},"RecommendationReviewDrawer"),de=o(({inputSnapshot:s})=>{const n=s,c=n.themes_weak??[],i=n.weak_openings??[];return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{children:["Rating ~",e.jsx("span",{className:"font-semibold text-[var(--wk-text)]",children:n.rating_estimate??"?"})," · ","data tier ",e.jsx("span",{className:"font-semibold text-[var(--wk-text)]",children:n.data_quality??"unknown"})," · ",n.total_games??0," games · ",n.total_puzzle_attempts??0," puzzle attempts",n.is_child?" · child age band":""]}),c.length>0&&e.jsxs("div",{children:["Weak themes:"," ",c.slice(0,3).map((r,h)=>e.jsxs("span",{children:[h>0?", ":"",e.jsx("span",{className:"text-[var(--wk-text-2)]",children:r.theme})," ",e.jsxs("span",{className:"text-[var(--wk-text-4)]",children:["(",r.accuracy_pct,"%, n=",r.attempts,")"]})]},r.theme))]}),i.length>0&&e.jsxs("div",{children:["Weak openings:"," ",i.slice(0,3).map((r,h)=>e.jsxs("span",{children:[h>0?", ":"",e.jsxs("span",{className:"text-[var(--wk-text-2)]",children:[r.color," ",r.eco]})," ",e.jsxs("span",{className:"text-[var(--wk-text-4)]",children:["(",r.win_pct,"%, n=",r.games,")"]})]},`${r.color}-${r.eco}`))]})]})},"SnapshotSummary"),Ne=o(({coachId:s})=>{const[n,c]=q(),i=n.get("student"),{items:r,loading:h,error:u,busyById:j,refresh:g,saveEdits:N,dismiss:y,send:w,regenerate:k}=ae(s),[b,z]=m.useState(null),[f,v]=m.useState(null);m.useEffect(()=>{if(!i||r.length===0)return;const a=r.find(d=>d.studentId===i);a&&z(a.id)},[i,r]);const _=o(()=>{c(a=>{const d=new URLSearchParams(a);return d.delete("student"),d})},"clearTargetedStudent");m.useEffect(()=>{if(!f)return;const a=window.setTimeout(()=>v(null),4e3);return()=>window.clearTimeout(a)},[f]);const l=o(async a=>{const d=await w(a);if(d.ok){const S=d.packCount??1,C=d.openingCount??0,M=S>1?`${S} puzzle packs of 10`:`${S} puzzle pack`,O=C>0?` and ${C} opening${C===1?"":"s"}`:"",B=d.openingFailures&&d.openingFailures.length>0?` (${d.openingFailures.length} opening${d.openingFailures.length===1?"":"s"} failed: ${d.openingFailures.join("; ")})`:"";v({kind:d.openingFailures&&d.openingFailures.length>0?"err":"ok",text:`Sent ${M}${O}.${B}`}),b===a&&z(null)}else v({kind:"err",text:`Send failed: ${d.reason??"unknown"}`})},"handleSend"),x=o(async a=>{try{await y(a),v({kind:"ok",text:"Dismissed."}),b===a&&z(null)}catch(d){v({kind:"err",text:`Dismiss failed: ${d instanceof Error?d.message:String(d)}`})}},"handleDismiss"),t=o(async a=>{v(null);const d=await k(a);d.ok?v({kind:"ok",text:"Regenerated — fresh recommendation loaded."}):v({kind:"err",text:`Regenerate failed: ${d.reason??"unknown"}`})},"handleRegenerate"),p=m.useMemo(()=>i?[...r].sort((a,d)=>{const S=a.studentId===i?-1:0,C=d.studentId===i?-1:0;return S-C}):r,[r,i]);return e.jsxs("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto premium-scrollbar pr-1",children:[i&&e.jsxs("div",{className:"mb-3 flex flex-shrink-0 items-center justify-between rounded-xl border border-amber-400/25 bg-amber-500/10 px-3 py-2 backdrop-blur-md",children:[e.jsx("p",{className:"font-body text-xs text-[var(--wk-amber-text)]",children:"Showing the latest AI suggestion for the selected student."}),e.jsx("button",{onClick:_,className:"rounded-md border border-[var(--wk-border)] bg-[var(--wk-glass)] px-2 py-0.5 font-body text-[10px] font-semibold text-[var(--wk-text-2)] transition hover:border-[var(--wk-border-strong)] hover:text-[var(--wk-text)]",children:"Show all"})]}),e.jsxs("div",{className:"mb-3 flex flex-shrink-0 flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-amber-500/20 bg-amber-500/[0.06] px-3 py-1.5",children:[e.jsx(P,{size:12,className:"text-[var(--wk-amber-text)]"}),e.jsxs("span",{className:"text-[11px] font-semibold text-[var(--wk-amber-text)]",children:[r.length," active suggestion",r.length===1?"":"s"]})]}),e.jsxs("button",{onClick:o(()=>{g()},"onClick"),disabled:h,className:"inline-flex items-center gap-1.5 rounded-lg border border-[var(--wk-border)] bg-[var(--wk-glass)] px-3 py-1.5 text-xs font-semibold text-[var(--wk-text-2)] transition hover:border-[var(--wk-border-strong)] hover:text-[var(--wk-text)] disabled:opacity-50",children:[e.jsx(F,{size:12,className:h?"animate-spin":""}),"Refresh"]})]}),f&&e.jsxs("div",{className:`mb-3 flex flex-shrink-0 items-start gap-2 rounded-lg border px-3 py-2 text-xs ${f.kind==="ok"?"border-emerald-500/30 bg-emerald-500/10 text-[var(--wk-emerald-text)]":"border-red-500/30 bg-red-500/10 text-[var(--wk-red-text)]"}`,role:"status",children:[f.kind==="err"&&e.jsx($,{size:12,className:"mt-0.5 shrink-0"}),e.jsx("span",{children:f.text})]}),u&&!h&&e.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-[var(--wk-red-text)]",children:[e.jsx($,{size:12,className:"mt-0.5 shrink-0"}),e.jsx("span",{children:u})]}),h&&r.length===0&&e.jsx("div",{className:"flex items-center justify-center py-12 text-[var(--wk-text-3)]",children:e.jsx(E,{size:18,className:"animate-spin"})}),!h&&r.length===0&&e.jsxs("div",{className:"rounded-2xl border border-dashed border-[var(--wk-border)] bg-[var(--wk-glass)] p-8 text-center",children:[e.jsx(J,{size:28,className:"mx-auto text-[var(--wk-text-4)]"}),e.jsx("h3",{className:"mt-3 text-sm font-semibold text-[var(--wk-text-2)]",children:"No active suggestions yet"}),e.jsxs("p",{className:"mx-auto mt-1 max-w-md text-xs leading-relaxed text-[var(--wk-text-4)]",children:['The recommender runs every Sunday at 06:00 UTC and creates one weekly homework package per active student. You can also use the "View AI suggestion" button on any student row in ',e.jsx("span",{className:"text-[var(--wk-text-2)]",children:"My Students"})," to generate one on-demand."]})]}),e.jsx("div",{className:"space-y-3 pb-6",children:p.map(a=>e.jsx(ie,{rec:a,expanded:b===a.id,busyAction:j[a.id],onToggleExpand:o(()=>z(d=>d===a.id?null:a.id),"onToggleExpand"),onSend:o(()=>{l(a.id)},"onSend"),onRegenerate:o(()=>{t(a.studentId)},"onRegenerate"),onDismiss:o(()=>{x(a.id)},"onDismiss"),children:b===a.id&&e.jsx(le,{rec:a,busyAction:j[a.id],onSave:o(async d=>{try{await N(a.id,d),v({kind:"ok",text:"Edits saved."})}catch(S){v({kind:"err",text:`Save failed: ${S instanceof Error?S.message:String(S)}`})}},"onSave")})},a.id))})]})},"SuggestedHomeworkTab");export{Ne as default};

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.