1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/saveGameResult-DEDGhF6x.js","assets/index-CgRBJ9tn.js","assets/index-CJZWJQqj.css"])))=>i.map(i=>d[i]); 2import{r as i,t as R,R as F,u as G,a as P,v as Q,w as v,j as e,k as W,l as E,x as I,y as T,D as z,F as K,C as L,m as h,H as O,X as U,J as B,K as H,N as Y,_ as $,b as J}from"./index-CgRBJ9tn.js";import{e as V}from"./distractorExplanations-DNpz82Pm.js";import{u as X,D as Z}from"./useReadAloudHold-M23k3vMw.js";const ee=[{word:"abundant",type:"synonym",answer:"plentiful",options:["scarce","plentiful","empty","tiny"]},{word:"transparent",type:"antonym",answer:"opaque",options:["clear","sheer","opaque","see-through"]},{word:"reluctant",type:"synonym",answer:"hesitant",options:["eager","hesitant","bold","certain"]},{word:"abandon",type:"antonym",answer:"keep",options:["leave","desert","keep","quit"]},{word:"fragile",type:"synonym",answer:"delicate",options:["sturdy","delicate","heavy","solid"]},{word:"commence",type:"antonym",answer:"finish",options:["begin","start","finish","launch"]},{word:"essential",type:"synonym",answer:"necessary",options:["optional","necessary","useless","rare"]},{word:"expand",type:"antonym",answer:"shrink",options:["grow","widen","shrink","stretch"]},{word:"persistent",type:"synonym",answer:"determined",options:["quitting","determined","lazy","careless"]},{word:"ancient",type:"antonym",answer:"modern",options:["old","historic","modern","antique"]},{word:"scarce",type:"antonym",answer:"plentiful",options:["rare","sparse","plentiful","thin"]},{word:"triumphant",type:"synonym",answer:"victorious",options:["defeated","victorious","sorrowful","hopeless"]}],te=[{word:"happy",type:"synonym",answer:"glad",options:["sad","glad","angry","tired"]},{word:"big",type:"antonym",answer:"small",options:["large","huge","small","tall"]},{word:"fast",type:"synonym",answer:"quick",options:["slow","quick","tired","lazy"]},{word:"cold",type:"antonym",answer:"hot",options:["cool","warm","hot","freezing"]},{word:"sad",type:"synonym",answer:"unhappy",options:["joyful","unhappy","excited","calm"]},{word:"old",type:"antonym",answer:"new",options:["ancient","aged","new","worn"]},{word:"loud",type:"synonym",answer:"noisy",options:["quiet","noisy","soft","silent"]},{word:"dark",type:"antonym",answer:"light",options:["dim","black","light","shadowy"]},{word:"smart",type:"synonym",answer:"clever",options:["dumb","clever","slow","weak"]},{word:"hard",type:"antonym",answer:"soft",options:["tough","difficult","soft","strong"]}];function oe(){const{scheduleAdvance:N,handleSpeakingChange:k}=X(),[l,w]=i.useState(0),[o,x]=i.useState(0),[r,c]=i.useState(null),[f,m]=i.useState(null),[_,g]=i.useState(!1),p=R(),y=F.useRef(!1),b=G(),{data:S=[]}=P({queryKey:["students"],queryFn:()=>J.entities.Student.list("-created_date"),initialData:[]}),n=S[0],d=Q(n==null?void 0:n.grade),u=(n==null?void 0:n.grade)>=4?ee:te,s=u[l],A=v({mutationFn:t=>$(()=>import("./saveGameResult-DEDGhF6x.js"),__vite__mapDeps([0,1,2])).then(a=>a.saveGameResult(t)),onSuccess:()=>b.invalidateQueries({queryKey:["scores"]})}),C=v({mutationFn:async()=>{},onSuccess:()=>b.invalidateQueries({queryKey:["students"]})}),q=t=>{const a=t===s.answer;if(p.recordAnswer(a),a){const M=Math.round(10*d.getDifficultyMultiplier());x(o+M),c("correct"),d.recordAttempt(!0,1e3)}else c("incorrect"),m({chosen:t,explanation:V({chosen:t,correct:s.answer,variant:s.word,context:s.type})}),d.recordAttempt(!1,1e3);N(()=>{l===u.length-1?j():(w(l+1),p.markQuestionShown(),c(null),m(null))},a?1500:4500)},j=async()=>{if(y.current)return;y.current=!0;const t=o+(r==="correct"?10:0),a=t>=80?3:t>=60?2:1;n&&(await A.mutateAsync({student_id:n.id,game_type:"synonyms_antonyms",score:t,stars:a,grade_level:n.grade,time_taken:0}),await C.mutateAsync({id:n.id,data:{total_stars:(n.total_stars||0)+a,games_completed:(n.games_completed||0)+1}})),g(!0)},D=()=>{y.current=!1,w(0),x(0),c(null),m(null),g(!1)};return e.jsx("div",{className:"min-h-screen p-4 md:p-8",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx(W,{to:E("AllGames"),onClick:t=>{var a;((a=window.history.state)==null?void 0:a.idx)>0&&(t.preventDefault(),window.history.back())},children:e.jsxs(I,{variant:"outline",size:"lg",children:[e.jsx(T,{className:"w-5 h-5 mr-2"}),"Back"]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(z,{difficulty:d.difficulty}),e.jsxs("div",{className:"flex items-center gap-4 bg-white rounded-full px-6 py-3 shadow-lg",children:[e.jsx(K,{className:"w-6 h-6 text-yellow-500"}),e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:o})]})]})]}),e.jsxs(L,{className:"p-8 bg-white/90 backdrop-blur-sm border-4 border-white shadow-xl",children:[e.jsx("h1",{className:"text-4xl font-black text-center text-transparent bg-clip-text bg-gradient-to-r from-purple-600 to-pink-400 mb-2",children:"Synonyms & Antonyms"}),e.jsxs("p",{className:"text-center text-xl text-gray-700 mb-8",children:[l+1,"/",u.length]}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("p",{className:"text-5xl font-bold text-gray-800 mb
2-4",children:s.word}),e.jsxs("p",{className:"text-xl",children:["Find the ",e.jsx("span",{className:`font-bold ${s.type==="synonym"?"text-green-600":"text-red-600"}`,children:s.type==="synonym"?"SYNONYM (same meaning)":"ANTONYM (opposite meaning)"})]})]}),r==="correct"&&e.jsxs(h.div,{initial:{scale:0},animate:{scale:1},className:"flex items-center justify-center gap-2 mb-6 text-green-600",children:[e.jsx(O,{className:"w-8 h-8"}),e.jsxs("span",{className:"text-2xl font-bold",children:["Correct! ",s.answer," is the ",s.type,"!"]})]}),r==="incorrect"&&e.jsxs(h.div,{initial:{scale:0},animate:{scale:1},className:"flex items-center justify-center gap-2 mb-6 text-red-600",children:[e.jsx(U,{className:"w-8 h-8"}),e.jsxs("span",{className:"text-2xl font-bold",children:["The ",s.type," was: ",s.answer]})]}),r==="incorrect"&&f&&e.jsx(Z,{items:[f],question:`Which word goes with "${s.word}"?`,className:"mb-6",onSpeakingChange:k}),!r&&e.jsx("div",{className:"grid grid-cols-2 gap-4",children:s.options.map(t=>e.jsx(h.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:()=>q(t),className:"p-5 rounded-2xl text-xl font-bold bg-gradient-to-br from-purple-400 to-pink-500 text-white shadow-lg",children:t},t))})]}),e.jsxs(B,{children:[e.jsx(H,{watch:p,onWrapUp:()=>j()}),_&&e.jsx(Y,{stars:o>=80?3:o>=60?2:1,score:o,onPlayAgain:D})]})]})})}export{oe 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.