@mblinkov/whats-missing 20.0.54 → 20.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdaptiveGameShell.d.ts +6 -0
- package/dist/Game.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/themes.d.ts +1 -1
- package/dist/whats-missing.cjs.js +3 -3
- package/dist/whats-missing.es.js +816 -489
- package/package.json +42 -42
package/dist/Game.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { default as Game } from './
|
|
1
|
+
export { default as Game } from './AdaptiveGameShell';
|
|
2
|
+
export { default as AdaptiveGameShell } from './AdaptiveGameShell';
|
|
3
|
+
export { default as RawGame } from './Game';
|
|
2
4
|
export { themes } from './themes';
|
|
3
5
|
export type { Theme } from './themes';
|
package/dist/themes.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("react"),oi=`
|
|
2
2
|
@keyframes spin {
|
|
3
3
|
from { transform: rotate(0deg); }
|
|
4
4
|
to { transform: rotate(360deg); }
|
|
5
5
|
}
|
|
6
|
-
`;if(typeof document<"u"&&!document.getElementById("spin-keyframes")){const
|
|
6
|
+
`;if(typeof document<"u"&&!document.getElementById("spin-keyframes")){const d=document.createElement("style");d.id="spin-keyframes",d.innerHTML=oi,document.head.appendChild(d)}const wi={animation:"spin 1.4s linear infinite"},o={gmCenterScreen:{position:"relative",zIndex:1,minHeight:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"#1f2937",padding:"24px 16px",boxSizing:"border-box",transform:"translateY(20px)"},gmHeadline1:{fontWeight:700,fontSize:"clamp(28px, 4vw, 40px)",lineHeight:"110%"},gmHeadline3:{fontWeight:600,fontSize:"18px",lineHeight:"130%"},gmBodyM:{fontWeight:400,fontSize:"16px",lineHeight:"140%"},gmBodyS:{fontWeight:400,fontSize:"14px",lineHeight:"140%",color:"#6b7280"},gmButton:{fontFamily:'"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',fontWeight:600,fontSize:"16px",padding:"10px 16px",borderRadius:"12px",border:"1px solid #e5e7eb",background:"#ec4c44",color:"#ffffff",cursor:"pointer",boxShadow:"0 6px 18px rgba(236, 76, 68, .18)",transition:"transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"},gmButtonActive:{background:"#333",color:"#fff"},gmGameLayout:{position:"relative",width:"100%",maxWidth:"none",minHeight:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",color:"#1f2937",padding:"16px 8px",margin:"0 auto"},gmGrid:{width:"100%",maxWidth:"none",margin:"0 auto",display:"grid",gridTemplateColumns:"repeat(3, 210px)",gridAutoRows:"210px",gap:"20px",justifyContent:"center"},gmInput:{padding:"6px 10px",borderRadius:"6px",border:"1px solid #ccc",fontSize:"16px",fontFamily:'"Geist", system-ui',width:"160px"},gmTable:{marginTop:"20px",marginBottom:"32px",borderCollapse:"collapse",width:"100%",maxWidth:"520px",tableLayout:"fixed",textAlign:"center"},gmTableCell:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},gmLogoFixed:{position:"absolute",top:"28px",left:"16px",width:"120px",zIndex:10,pointerEvents:"none",background:"transparent",transform:"none",willChange:"auto"},gmLogoImg:{height:"clamp(28px, 5vw, 40px)",width:"auto",background:"transparent",objectFit:"contain",imageRendering:"auto",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitFontSmoothing:"antialiased"},gmHourglass:{fontSize:"42px",...wi}},di=window.origin+"/cloud/speakid/games/whatsmissing/",M=(d,a)=>d.map(([g,s,...p])=>({src:`${di}${a}/${s.replace(/\s/g,"%20")}.png`,name:s,aliases:p?.length?p:void 0})),ri=[["apple","apple"],["banana","banana"],["bread","bread"],["burger","burger"],["cake","cake"],["carrot","carrot"],["cheese","cheese"],["chicken","chicken"],["chocolate","chocolate"],["corn","corn"],["donut","donut"],["fish","fish"],["fries","fries"],["grapes","grapes"],["ice_cream","ice cream"],["milk","milk"],["orange","orange"],["pear","pear"],["pizza","pizza"],["rice","rice"],["sandwich","sandwich"],["soup","soup"],["strawberry","strawberry"],["tomato","tomato"],["watermelon","watermelon"]],hi=[["bear","bear"],["cat","cat"],["crocodile","crocodile","alligator"],["dolphin","dolphin"],["elephant","elephant"],["fox","fox"],["giraffe","giraffe"],["horse","horse"],["kangaroo","kangaroo"],["lion","lion"],["monkey","monkey"],["owl","owl"],["panda","panda"],["penguin","penguin"],["squirrel","squirrel"],["tiger","tiger"],["tortoise","tortoise","turtle"],["wolf","wolf"],["zebra","zebra"]],si=[["ball","ball"],["balloon","balloon"],["blocks","blocks"],["car","car"],["doll","doll"],["drum","drum"],["guitar","guitar"],["jump_rope","jump rope"],["kite","kite"],["paints","paints"],["plane","plane"],["puzzle","puzzle"],["rocket","rocket"],["scooter","scooter"],["skateboard","skateboard"],["slide","slide"],["teddy_bear","teddy bear"],["yo-yo","yo-yo"],["crayons","crayons"]],ai=[["t-shirt","T-shirt"],["dress","dress"],["hat","hat"],["shoes","shoes"],["socks","socks"],["coat","coat"],["skirt","skirt"],["trousers","trousers"],["jacket","jacket"],["scarf","scarf"],["gloves","gloves"],["shorts","shorts"],["cap","cap"],["boots","boots"],["pyjamas","pyjamas"]],gi=[["car","car"],["bus","bus"],["bike","bike"],["train","train"],["plane","plane"],["boat","boat"],["ship","ship"],["helicopter","helicopter"],["lorry","lorry","truck"],["taxi","taxi"],["rocket","rocket"],["van","van"],["motorbike","motorbike"],["tram","tram"],["submarine","submarine"]],pi=[["sun","sun"],["cloud","cloud"],["rain","rain"],["tree","tree"],["flower","flower"],["grass","grass"],["star","star"],["moon","moon"],["mountain","mountain"],["river","river"],["rainbow","rainbow"],["snowman","snowman"],["snow","snow"],["butterfly","butterfly"],["bird","bird"]],li=[["bed","bed"],["table","table"],["chair","chair"],["door","door"],["window","window"],["lamp","lamp"],["sofa","sofa"],["clock","clock"],["key","key"],["phone","phone"],["tv","TV"],["cup","cup"],["plate","plate"],["mirror","mirror"],["book","book"]],ci=[["book","book"],["pen","pen"],["pencil","pencil"],["bag","bag"],["ruler","ruler"],["rubber","rubber","eraser"],["desk","desk"],["board","board"],["crayon","crayon"],["glue","glue"],["scissors","scissors"],["notebook","notebook"],["pencil_case","pencil case"],["paintbrush","paintbrush"],["backpack","backpack"]],F={food:M(ri,"food"),animals:M(hi,"animals"),toys:M(si,"toys"),clothes:M(ai,"clothes"),transport:M(gi,"transport"),nature:M(pi,"nature"),home:M(li,"home"),school:M(ci,"school")},xi=["animals","food","toys","clothes","transport","nature","home","school"],Hi={animals:"🐶 Animals",food:"🍎 Food",toys:"🧸 Toys",clothes:"👕 Clothes",transport:"🚗 Transport",nature:"🌳 Nature",home:"🏠 Home",school:"📚 School"},Wi=()=>{const d=document.createElement("style");d.id="whats-missing-reset",d.textContent=`
|
|
7
7
|
#whats-missing-root, #whats-missing-root * {
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
height: 100% !important;
|
|
30
30
|
overflow: hidden !important;
|
|
31
31
|
}
|
|
32
|
-
`;const g=document.getElementById("whats-missing-reset");g&&g.remove(),document.head.appendChild(r)};class hi{constructor(g){this.seed=g}next(){return this.seed=(this.seed*1664525+1013904223)%Math.pow(2,32),this.seed/Math.pow(2,32)}nextInt(g){return Math.floor(this.next()*g)}}const si=(r,g)=>{const a=Array.from({length:r.length+1},()=>Array(g.length+1).fill(0));for(let s=0;s<=r.length;s++)a[s][0]=s;for(let s=0;s<=g.length;s++)a[0][s]=s;for(let s=1;s<=r.length;s++)for(let y=1;y<=g.length;y++)a[s][y]=r[s-1]===g[y-1]?a[s-1][y-1]:Math.min(a[s-1][y-1],a[s][y-1],a[s-1][y])+1;return a[r.length][g.length]},gi=r=>new Promise(g=>{const a=new Image;a.onload=()=>g(a),a.onerror=()=>g(a),a.src=r}),hn=async(r,g)=>{const a=new Map,s=r.map(async y=>{const j=await gi(y);a.set(y,j)});return await Promise.allSettled(s),a};function ai({gameCubeSize:r,screenHeight:g,screenWidth:a,seed:s}){const y=d.useRef(null);d.useEffect(()=>(ri(),()=>{document.documentElement.style.overflow="",document.body.style.overflow="";const i=document.getElementById("whats-missing-reset");i&&i.remove(),v.current&&v.current.abort()}),[]);const[j,sn]=d.useState(null),[R,gn]=d.useState([]),[G,Pn]=d.useState(4),[C,an]=d.useState(!1),[F,pn]=d.useState(1),[P,kn]=d.useState(null),[I,U]=d.useState("ready"),[ln,xn]=d.useState(10),[V,Z]=d.useState(10),[_,cn]=d.useState(20),[Tn,K]=d.useState(0),[Y,J]=d.useState(!1),[$,Hn]=d.useState(""),[L,Q]=d.useState(!1),[X,Wn]=d.useState(!1),[mn,A]=d.useState(null),[zn,nn]=d.useState([]),[Rn,un]=d.useState([]),[n,Mn]=d.useState(!1),[Ln,q]=d.useState(1),[fn,N]=d.useState(null),[S,Bn]=d.useState(!1),[p,Cn]=d.useState(!1),[l,An]=d.useState(!1),[x,En]=d.useState(!1),[c,Dn]=d.useState(!1),[H,Gn]=d.useState(!1),[W,Fn]=d.useState(!1),[m,Un]=d.useState(!1),[u,Yn]=d.useState(!1),[en,$n]=d.useState(!1),[k,qn]=d.useState(!1),tn=d.useRef(new Set),O=d.useRef(new Map),v=d.useRef(null),B=d.useRef(null);d.useEffect(()=>{s!==void 0?B.current=new hi(s):B.current=null},[s]);const Nn=()=>B.current?B.current.next():Math.random(),yn=i=>B.current?B.current.nextInt(i):Math.floor(Math.random()*i);d.useEffect(()=>{const i=()=>{const t=a??window.innerWidth,w=g??window.innerHeight,h=t<768||t===926&&w===428||t===932&&w===430,f=w<700,T=t/w>1.8,b=t===768&&w===1024,dn=t===1024&&w===768,E=t===820&&w===1180,z=t===1180&&w===820,M=t===540&&w===720,jn=t===720&&w===540,In=t===1024&&w===1366,vn=t===1366&&w===1024,Jn=t>=1200&&w>=600&&!h;Bn(Jn),Cn(b),An(dn),En(E),Dn(z),Gn(M),Fn(jn),Un(In),Yn(vn),qn(T);const Qn=h&&t>w||h||w<700||T||t===1366&&w===766||t===1366&&w===768||t===1280&&w===720||t===1440&&w===900||b||dn||E||z||M||jn||In||vn||S;if($n(Qn),Mn(h),h)N(r&&r>=320?r:null),q(1);else if(f)N(r&&r>=400?r:null),q(1);else if(T){const on=r?Math.max(400,Math.min(1200,r)):Math.min(1e3,Math.min(t,w)*.9);N(on),q(.85)}else{const on=r?Math.max(400,Math.min(1200,r)):Math.min(1e3,Math.min(t,w)*.9);N(on),q(1)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[a,g,r]);const wn=i=>[...i].sort(()=>Nn()-.5).slice(0,6),On=i=>{v.current&&v.current.abort(),v.current=new AbortController;const w=D[i].map(h=>h.src);hn(w,v.current.signal).then(h=>{w.forEach(f=>{tn.current.add(f),h.has(f)&&O.current.set(f,h.get(f))})}).catch(()=>{})},bn=()=>{if(!j)return;const i=wn(D[j]);gn(i),an(!0),J(!1),pn(1),K(0),nn([]),un([]);const t=i.map(w=>w.src);hn(t,v.current?.signal).then(w=>{t.forEach(h=>{tn.current.add(h),w.has(h)&&O.current.set(h,w.get(h))})}).catch(()=>{}),Sn(i,[],!0)},Sn=(i=R,t=Rn,w=!1)=>{const h=wn(i.length?i:D[j]);let f=yn(h.length),T=h[f].name,b=0;for(;t.includes(T)&&b<20;)f=yn(h.length),T=h[f].name,b++;if(gn(h),kn(f),un([...t,T]),Q(!1),Hn(""),cn(20),A(null),j&&!w){const E=wn(D[j].filter(z=>!t.includes(z.name))).map(z=>z.src);hn(E,v.current?.signal).then(z=>{E.forEach(M=>{tn.current.add(M),z.has(M)&&O.current.set(M,z.get(M))})}).catch(()=>{})}w?(U("ready"),xn(10),Z(10)):(U("memorize"),Z(10))};d.useEffect(()=>{if(!(!C||Y||L)){if(I==="ready")if(ln<=0)U("memorize");else{const i=setTimeout(()=>xn(t=>t-1),1e3);return()=>clearTimeout(i)}if(I==="memorize")if(V<=0)U("guess");else{const i=setTimeout(()=>Z(t=>t-1),1e3);return()=>clearTimeout(i)}if(I==="guess"){if(_<=0){Q(!0),A("wrong");const t=R[P].name,w=R[P].aliases,h=[t,...w||[]].join(", ");nn(f=>[...f,{round:F,answer:$,correct:h,result:"wrong"}]);return}const i=setTimeout(()=>cn(t=>t-1),1e3);return()=>clearTimeout(i)}}},[I,ln,V,_,C,Y,L,R,P,F,$]);const Vn=()=>{if(P===null||X)return;const i=R[P].name,t=R[P].aliases,w=$.toLowerCase().trim();let h="wrong";const f=[i,...t||[]].map(b=>b.toLowerCase()),T=[i,...t||[]].join(", ");f.includes(w)?(K(b=>b+1),A("correct"),h="correct"):f.some(b=>si(w,b)===1)?(K(b=>b+.5),A("almost"),h="almost"):(A("wrong"),h="wrong"),nn(b=>[...b,{round:F,answer:w,correct:T,result:h}]),Wn(!0),setTimeout(()=>{Wn(!1),Q(!0)},600)},Zn=()=>F<G?(pn(i=>i+1),Sn()):J(!0),_n=()=>{v.current&&v.current.abort(),an(!1),J(!1),sn(null)},Kn=d.useMemo(()=>{const i=a??window.innerWidth,t=g??window.innerHeight,w=!n&&i>=1200&&i<=1400;return n&&i>t||t<700&&!w?null:e.jsx("div",{style:{...o.gmLogoFixed,position:"absolute",top:16,left:16,zIndex:30},children:e.jsxs("picture",{children:[e.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),e.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:o.gmLogoImg,loading:"lazy"})]})})},[n,a,g]);return e.jsx("div",{ref:y,style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",transition:"background 0.3s ease",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:e.jsx("div",{style:{width:n?"100%":fn||r||1e3,height:n?"100%":fn||r||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:n?0:"20px",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",boxShadow:n?"none":"0 0 40px rgba(0,0,0,0.1)",margin:n?"0 auto":"unset",position:"relative",transform:`scale(${Ln})`},children:e.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxs("div",{id:"whats-missing-root",children:[!n&&Kn,!j&&!C&&e.jsxs("div",{style:o.gmCenterScreen,children:[e.jsx("h1",{style:o.gmHeadline1,children:"WHAT'S MISSING?"}),e.jsx("p",{style:o.gmBodyM,children:"Select a theme:"}),e.jsx("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px":"16px"},children:["animals","food","toys"].map(i=>e.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"70px":"auto"},onClick:()=>{sn(i),On(i)},children:i==="animals"?"🐶 Animals":i==="food"?"🍎 Food":"🧸 Toys"},i))}),e.jsxs("div",{style:{marginTop:24},children:[e.jsx("p",{style:o.gmBodyS,children:"Choose number of rounds:"}),e.jsx("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:8},children:[3,4,5].map(i=>e.jsx("button",{style:{...o.gmButton,...G===i?o.gmButtonActive:{},padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"40px":"auto"},onClick:()=>Pn(i),children:i},i))})]})]}),j&&!C&&e.jsxs("div",{style:o.gmCenterScreen,children:[e.jsxs("h1",{style:o.gmHeadline1,children:["Theme selected: ",j]}),e.jsxs("p",{style:o.gmBodyM,children:["Rounds: ",G]}),e.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:bn,children:"▶ Start game"})]}),Y&&e.jsxs("div",{style:o.gmCenterScreen,children:[e.jsx("h1",{style:{...o.gmHeadline1,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"0px":o.gmHeadline1.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"2px":o.gmHeadline1.marginBottom},children:"Results"}),e.jsxs("h2",{style:{...o.gmHeadline3,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"0px":o.gmHeadline3.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"2px":o.gmHeadline3.marginBottom},children:["Your score: ",Tn," / ",G]}),e.jsx("p",{style:{...o.gmBodyM,color:"#10b981",marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"0px":"12px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"2px":o.gmBodyM.marginBottom},children:"Yahoo! You did it! 🍬✨"}),e.jsxs("table",{style:{...o.gmTable,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"0px":"20px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||p||l||x||c||H||W||m||u?"4px":"32px"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Round"}),e.jsx("th",{children:"Your Answer"}),e.jsx("th",{children:"Correct"}),e.jsx("th",{children:"Result"})]})}),e.jsx("tbody",{children:zn.map((i,t)=>e.jsxs("tr",{children:[e.jsx("td",{style:o.gmTableCell,children:i.round}),e.jsx("td",{style:o.gmTableCell,children:i.answer||"—"}),e.jsx("td",{style:o.gmTableCell,children:i.correct}),e.jsx("td",{style:o.gmTableCell,children:i.result==="correct"?"✔ Correct":i.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},t))})]}),e.jsxs("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"2px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S?"12px":"24px"},children:[e.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:bn,children:"🔁 Play again"}),e.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:_n,children:"⬅️ Choose theme"})]})]}),C&&!Y&&e.jsxs("div",{style:o.gmGameLayout,children:[e.jsxs("div",{style:{minHeight:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"45px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"50px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"60px":"160px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"15px":"40px"},children:[I==="ready"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{style:{...o.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),e.jsx("div",{style:o.gmHourglass,children:"⏳"})]}),I==="memorize"&&e.jsxs("p",{style:{...o.gmBodyM,color:"#10b981"},children:["MEMORIZE (",V,")"]}),I==="guess"&&!L&&e.jsxs("p",{style:o.gmBodyM,children:["⏳ Time left: ",_,"s"]})]}),I!=="ready"&&e.jsx("div",{style:{...o.gmGrid,...k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?{width:"100%"}:{},gridTemplateColumns:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667?"repeat(3, 1fr)":n?"repeat(2, 1fr)":window.innerHeight<700?"repeat(3, 1fr)":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"repeat(3, 130px)":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"repeat(3, 150px)":"repeat(3, 210px)",gridAutoRows:n&&window.innerWidth>window.innerHeight?"120px":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"100px":n?"150px":window.innerHeight<700?"140px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"240px":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"130px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"150px":"210px",gap:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"12px":n||window.innerHeight<700?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"24px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"12px":"20px",justifyItems:"center",maxWidth:n&&window.innerWidth>window.innerHeight?"90%":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"95%":"100%",padding:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"20px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"10px":"16px"},children:R.map((i,t)=>{const w=P===t&&I==="guess"&&!L;return e.jsx("div",{style:{width:"100%",height:"100%",borderRadius:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px":"12px",overflow:"hidden",boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 1px 4px rgba(0,0,0,0.1)":"0 4px 12px rgba(0,0,0,0.15)",transition:"all 0.3s ease",cursor:"pointer",...mn==="correct"&&P===t?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #10b981":"0 0 20px #10b981",transform:"scale(1.03)"}:{},...mn==="wrong"&&P===t?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #ef4444":"0 0 20px #ef4444",transform:"scale(1.03)"}:{}},children:!w&&(()=>{const h=O.current.get(i.src),f=h?.complete&&h.src?h.src:i.src;return e.jsx("img",{src:f,alt:i.name,fetchPriority:"high",loading:"eager",decoding:"async",style:{width:"100%",height:"100%",objectFit:"cover"}},`${i.src}-${h?.complete?"loaded":"pending"}`)})()},t)})}),e.jsxs("div",{style:{marginTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"1px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"4px":"16px",height:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"40px":k||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"50px":"80px"},children:[I==="guess"&&!L&&e.jsx("div",{style:{display:"flex",flexDirection:en?"row":"column",gap:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"3px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"6px":"12px",alignItems:"center",justifyContent:"center",width:"100%",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"270px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"400px":"300px"},children:e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"text",placeholder:"Type the missing word",value:$,onChange:i=>Hn(i.target.value),style:{...o.gmInput,width:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"170px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"250px":"auto",padding:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"5px 6px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 12px":"12px 16px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428?"10px":window.innerWidth===896&&window.innerHeight===414?"11px":window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px",flex:en?"1":"none"}}),e.jsx("button",{style:{...o.gmButton,marginLeft:en?"8px":"0",padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px",minWidth:n&&window.innerWidth<=375&&window.innerHeight<=667?"45px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"55px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"80px":"100px",flexShrink:0},onClick:Vn,disabled:X,children:X?"...":"Check"})]})}),L&&e.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||S||p||l||x||c||H||W||m||u||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"},onClick:Zn,children:"Next round"})]})]})]})})})})}exports.Game=ai;exports.themes=D;
|
|
32
|
+
`;const a=document.getElementById("whats-missing-reset");a&&a.remove(),document.head.appendChild(d)};class mi{constructor(a){this.seed=a}next(){return this.seed=(this.seed*1664525+1013904223)%Math.pow(2,32),this.seed/Math.pow(2,32)}nextInt(a){return Math.floor(this.next()*a)}}const ui=(d,a)=>{const g=Array.from({length:d.length+1},()=>Array(a.length+1).fill(0));for(let s=0;s<=d.length;s++)g[s][0]=s;for(let s=0;s<=a.length;s++)g[0][s]=s;for(let s=1;s<=d.length;s++)for(let p=1;p<=a.length;p++)g[s][p]=d[s-1]===a[p-1]?g[s-1][p-1]:Math.min(g[s-1][p-1],g[s][p-1],g[s-1][p])+1;return g[d.length][a.length]},fi=d=>new Promise(a=>{const g=new Image;g.onload=()=>a(g),g.onerror=()=>a(g),g.src=d}),gn=async(d,a)=>{const g=new Map,s=d.map(async p=>{const j=await fi(p);g.set(p,j)});return await Promise.allSettled(s),g};function In({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const p=t.useRef(null);t.useEffect(()=>(Wi(),()=>{document.documentElement.style.overflow="",document.body.style.overflow="";const e=document.getElementById("whats-missing-reset");e&&e.remove(),I.current&&I.current.abort()}),[]);const[j,$]=t.useState(null),[b,A]=t.useState([]),[D,Pn]=t.useState(4),[pn,Q]=t.useState(1),[L,ln]=t.useState(!1),[_,cn]=t.useState(1),[T,zn]=t.useState(null),[v,O]=t.useState("ready"),[xn,Hn]=t.useState(10),[X,nn]=t.useState(10),[en,Wn]=t.useState(20),[Rn,tn]=t.useState(0),[U,on]=t.useState(!1),[Y,mn]=t.useState(""),[C,wn]=t.useState(!1),[dn,un]=t.useState(!1),[fn,G]=t.useState(null),[Mn,rn]=t.useState([]),[Ln,yn]=t.useState([]),[n,Cn]=t.useState(!1),[Bn,V]=t.useState(1),[bn,q]=t.useState(null),[k,En]=t.useState(!1),[l,An]=t.useState(!1),[c,Dn]=t.useState(!1),[x,Gn]=t.useState(!1),[H,Fn]=t.useState(!1),[W,$n]=t.useState(!1),[m,_n]=t.useState(!1),[u,On]=t.useState(!1),[f,Un]=t.useState(!1),[P,Yn]=t.useState(!1),hn=t.useRef(new Set),N=t.useRef(new Map),I=t.useRef(null),B=t.useRef(null);t.useEffect(()=>{s!==void 0?B.current=new mi(s):B.current=null},[s]);const Vn=()=>B.current?B.current.next():Math.random(),Sn=e=>B.current?B.current.nextInt(e):Math.floor(Math.random()*e);t.useEffect(()=>{const e=()=>{const w=g??window.innerWidth,r=a??window.innerHeight,h=w<768||w===926&&r===428||w===932&&r===430,y=r<700,z=w/r>1.8,S=w===768&&r===1024,vn=w===1024&&r===768,Z=w===820&&r===1180,R=w===1180&&r===820,E=w===540&&r===720,Qn=w===720&&r===540,Xn=w===1024&&r===1366,ni=w===1366&&r===1024,ii=w>=1200&&r>=600&&!h;if(En(ii),An(S),Dn(vn),Gn(Z),Fn(R),$n(E),_n(Qn),On(Xn),Un(ni),Yn(z),Cn(h),h)q(d&&d>=320?d:null),V(1);else if(y)q(d&&d>=400?d:null),V(1);else if(z){const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(.85)}else{const an=d?Math.max(400,Math.min(1200,d)):Math.min(1e3,Math.min(w,r)*.9);q(an),V(1)}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[g,a,d]);const sn=e=>[...e].sort(()=>Vn()-.5).slice(0,6),qn=e=>{I.current&&I.current.abort(),I.current=new AbortController;const r=F[e].map(h=>h.src);gn(r,I.current.signal).then(h=>{r.forEach(y=>{hn.current.add(y),h.has(y)&&N.current.set(y,h.get(y))})}).catch(()=>{})},jn=()=>{if(!j)return;const e=sn(F[j]);A(e),ln(!0),on(!1),cn(1),tn(0),rn([]),yn([]);const w=e.map(r=>r.src);gn(w,I.current?.signal).then(r=>{w.forEach(h=>{hn.current.add(h),r.has(h)&&N.current.set(h,r.get(h))})}).catch(()=>{}),kn(e,[],!0)},kn=(e=b,w=Ln,r=!1)=>{const h=sn(e.length?e:F[j]);let y=Sn(h.length),z=h[y].name,S=0;for(;w.includes(z)&&S<20;)y=Sn(h.length),z=h[y].name,S++;if(A(h),zn(y),yn([...w,z]),wn(!1),mn(""),Wn(20),G(null),j&&!r){const Z=sn(F[j].filter(R=>!w.includes(R.name))).map(R=>R.src);gn(Z,I.current?.signal).then(R=>{Z.forEach(E=>{hn.current.add(E),R.has(E)&&N.current.set(E,R.get(E))})}).catch(()=>{})}r?(O("ready"),Hn(10),nn(10)):(O("memorize"),nn(10))};t.useEffect(()=>{if(!(!L||U||C)){if(v==="ready")if(xn<=0)O("memorize");else{const e=setTimeout(()=>Hn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="memorize")if(X<=0)O("guess");else{const e=setTimeout(()=>nn(w=>w-1),1e3);return()=>clearTimeout(e)}if(v==="guess"){if(en<=0){wn(!0),G("wrong");const w=b[T].name,r=b[T].aliases,h=[w,...r||[]].join(", ");rn(y=>[...y,{round:_,answer:Y,correct:h,result:"wrong"}]);return}const e=setTimeout(()=>Wn(w=>w-1),1e3);return()=>clearTimeout(e)}}},[v,xn,X,en,L,U,C,b,T,_,Y]);const Nn=()=>{if(T===null||dn)return;const e=b[T].name,w=b[T].aliases,r=Y.toLowerCase().trim();let h="wrong";const y=[e,...w||[]].map(S=>S.toLowerCase()),z=[e,...w||[]].join(", ");y.includes(r)?(tn(S=>S+1),G("correct"),h="correct"):y.some(S=>ui(r,S)===1)?(tn(S=>S+.5),G("almost"),h="almost"):(G("wrong"),h="wrong"),rn(S=>[...S,{round:_,answer:r,correct:z,result:h}]),un(!0),setTimeout(()=>{un(!1),wn(!0)},600)},Zn=()=>_<D?(cn(e=>e+1),kn()):on(!0),Kn=()=>{I.current&&I.current.abort(),ln(!1),on(!1),$(null),Q(2)},Jn=t.useMemo(()=>i.jsx("div",{style:{...o.gmLogoFixed,position:"absolute",top:28,left:16,zIndex:30},children:i.jsxs("picture",{children:[i.jsx("source",{srcSet:window.origin+"/cloud/speakid/games/whatsmissing/logo.svg",type:"image/svg+xml"}),i.jsx("img",{src:window.origin+"/cloud/speakid/games/whatsmissing/logo.png",alt:"SPEAKID Logo",style:o.gmLogoImg,loading:"lazy"})]})}),[]);return i.jsxs("div",{ref:p,style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",transition:"background 0.3s ease",overflow:"hidden",position:"absolute",top:0,left:0,right:0,bottom:0},children:[Jn,i.jsx("div",{style:{width:n?"100%":bn||d||1e3,height:n?"100%":bn||d||1e3,display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:0,background:"transparent",boxShadow:"none",margin:"0 auto",position:"relative",transform:`scale(${Bn})`},children:i.jsx("div",{style:{transform:"translateZ(0)",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:i.jsxs("div",{id:"whats-missing-root",style:{position:"relative",width:"100%",height:"100%"},children:[!j&&!L&&pn===1&&i.jsxs("div",{style:{...o.gmCenterScreen,transform:"none"},children:[i.jsx("h1",{style:o.gmHeadline1,children:"WHAT'S MISSING?"}),i.jsxs("div",{style:{marginTop:24},children:[i.jsx("p",{style:o.gmBodyS,children:"Choose number of rounds:"}),i.jsx("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:8},children:[3,4,5].map(e=>i.jsx("button",{style:{...o.gmButton,...D===e?o.gmButtonActive:{},padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"14px 28px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"13px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"48px":"64px"},onClick:()=>Pn(e),children:e},e))})]}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"10px 20px":"14px 30px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"15px":"18px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"132px":"160px"},onClick:()=>Q(2),children:"Play"})]}),!j&&!L&&pn===2&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("p",{style:o.gmBodyM,children:"Select a theme:"}),i.jsxs("p",{style:o.gmBodyS,children:["Rounds: ",D]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:n?"repeat(2, 1fr)":"repeat(4, 1fr)",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px":"12px",maxWidth:n?280:420,margin:"0 auto"},children:xi.map(e=>i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 12px":"10px 16px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"14px"},onClick:()=>{$(e),qn(e)},children:Hi[e]},e))}),i.jsx("button",{style:{...o.gmButton,marginTop:24,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:()=>Q(1),children:"Back"})]}),j&&!L&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsxs("h1",{style:o.gmHeadline1,children:["Theme selected: ",j]}),i.jsxs("p",{style:o.gmBodyM,children:["Rounds: ",D]}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"8px 16px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"14px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"120px":"auto"},onClick:jn,children:"▶ Start game"})]}),U&&i.jsxs("div",{style:o.gmCenterScreen,children:[i.jsx("h1",{style:{...o.gmHeadline1,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline1.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline1.marginBottom},children:"Results"}),i.jsxs("h2",{style:{...o.gmHeadline3,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":o.gmHeadline3.marginTop,marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmHeadline3.marginBottom},children:["Your score: ",Rn," / ",D]}),i.jsx("p",{style:{...o.gmBodyM,color:"#10b981",marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"12px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"2px":o.gmBodyM.marginBottom},children:"Yahoo! You did it! 🍬✨"}),i.jsxs("table",{style:{...o.gmTable,marginTop:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"0px":"20px",marginBottom:n&&window.innerWidth>window.innerHeight||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430||l||c||x||H||W||m||u||f?"4px":"32px"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Round"}),i.jsx("th",{children:"Your Answer"}),i.jsx("th",{children:"Correct"}),i.jsx("th",{children:"Result"})]})}),i.jsx("tbody",{children:Mn.map((e,w)=>i.jsxs("tr",{children:[i.jsx("td",{style:o.gmTableCell,children:e.round}),i.jsx("td",{style:o.gmTableCell,children:e.answer||"—"}),i.jsx("td",{style:o.gmTableCell,children:e.correct}),i.jsx("td",{style:o.gmTableCell,children:e.result==="correct"?"✔ Correct":e.result==="almost"?"◐ Almost (0.5)":"✘ Wrong"})]},w))})]}),i.jsxs("div",{style:{display:"flex",gap:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px":"12px",marginTop:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"2px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k?"12px":"24px"},children:[i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:jn,children:"🔁 Play again"}),i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"6px 10px":"12px 24px",fontSize:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"12px":"16px",minWidth:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||window.innerWidth===932&&window.innerHeight===430?"80px":"auto"},onClick:Kn,children:"⬅️ Choose theme"})]})]}),L&&!U&&i.jsxs("div",{style:o.gmGameLayout,children:[i.jsxs("div",{style:{minHeight:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"45px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"50px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"60px":"160px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428||P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"15px":"40px"},children:[v==="ready"&&i.jsxs(i.Fragment,{children:[i.jsx("h1",{style:{...o.gmHeadline1,color:"#ec4c44"},children:"GET READY"}),i.jsx("div",{style:o.gmHourglass,children:"⏳"})]}),v==="memorize"&&i.jsxs("p",{style:{...o.gmBodyM,color:"#10b981"},children:["MEMORIZE (",X,")"]}),v==="guess"&&!C&&i.jsxs("p",{style:o.gmBodyM,children:["⏳ Time left: ",en,"s"]})]}),v!=="ready"&&i.jsx("div",{style:{...o.gmGrid,...P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?{width:"100%"}:{},gridTemplateColumns:n&&window.innerWidth>window.innerHeight||n&&window.innerWidth<=375&&window.innerHeight<=667?"repeat(3, 1fr)":n?"repeat(2, 1fr)":window.innerHeight<700?"repeat(3, 1fr)":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"repeat(3, 130px)":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"repeat(3, 150px)":"repeat(3, 210px)",gridAutoRows:n&&window.innerWidth>window.innerHeight?"120px":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"100px":n?"150px":window.innerHeight<700?"140px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"240px":typeof window<"u"&&window.innerWidth===1280&&window.innerHeight===720?"130px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"150px":"210px",gap:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"12px":n||window.innerHeight<700?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"24px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"12px":"20px",justifyItems:"center",maxWidth:n&&window.innerWidth>window.innerHeight?"90%":n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"95%":"100%",padding:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"8px":typeof window<"u"&&window.devicePixelRatio>=1.25&&window.devicePixelRatio<=1.5?"20px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8?"10px":"16px"},children:b.map((e,w)=>{const r=T===w&&v==="guess"&&!C;return i.jsx("div",{style:{width:"100%",height:"100%",borderRadius:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px":"12px",overflow:"hidden",backgroundColor:"#ffffff",boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 1px 4px rgba(0,0,0,0.1)":"0 4px 12px rgba(0,0,0,0.15)",transition:"all 0.3s ease",cursor:"pointer",...fn==="correct"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #10b981":"0 0 20px #10b981",transform:"scale(1.03)"}:{},...fn==="wrong"&&T===w?{boxShadow:n&&window.innerWidth<=375&&window.innerHeight<=667||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"0 0 15px #ef4444":"0 0 20px #ef4444",transform:"scale(1.03)"}:{}},children:!r&&(()=>{const h=N.current.get(e.src),y=h?.complete&&h.src?h.src:e.src;return i.jsx("img",{src:y,alt:e.name,fetchPriority:"high",loading:"eager",decoding:"async",style:{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center"}},`${e.src}-${h?.complete?"loaded":"pending"}`)})()},w)})}),i.jsxs("div",{style:{marginTop:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"1px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"4px":"16px",height:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"40px":P||typeof window<"u"&&window.innerWidth/window.innerHeight>1.8||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"50px":"80px"},children:[v==="guess"&&!C&&i.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",minWidth:0,gap:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"3px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f?"8px":n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"6px":"12px",width:"100%",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"270px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"400px":"300px"},children:i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",placeholder:"Type the missing word",value:Y,onChange:e=>mn(e.target.value),style:{...o.gmInput,flex:"1 1 0",minWidth:0,width:"auto",maxWidth:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"170px":(window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700,"250px"),padding:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"5px 6px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 12px":"12px 16px",boxSizing:"border-box",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667||n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428?"10px":window.innerWidth===896&&window.innerHeight===414?"11px":window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"}}),i.jsx("button",{style:{...o.gmButton,marginLeft:0,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px",minWidth:n&&window.innerWidth<=375&&window.innerHeight<=667?"45px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"55px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"80px":"100px",flexShrink:0},onClick:Nn,disabled:dn,children:dn?"...":"Check"})]})}),C&&i.jsx("button",{style:{...o.gmButton,padding:n&&window.innerWidth<=375&&window.innerHeight<=667?"5px 8px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"6px 10px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"10px 16px":"12px 24px",fontSize:n&&window.innerWidth<=375&&window.innerHeight<=667?"10px":n&&window.innerWidth>window.innerHeight&&window.innerHeight<=428||window.innerWidth===896&&window.innerHeight===414||window.innerWidth===844&&window.innerHeight===390||window.innerWidth===926&&window.innerHeight===428?"11px":window.innerWidth===1366&&window.innerHeight===766||window.innerWidth===1366&&window.innerHeight===768||window.innerWidth===1280&&window.innerHeight===720||window.innerWidth===1440&&window.innerHeight===900||k||l||c||x||H||W||m||u||f||n&&window.innerWidth>window.innerHeight||window.innerHeight<700?"14px":"16px"},onClick:Zn,children:"Next round"})]})]})]})})})]})}const K=1280,J=720;function yi(d,a){const g=Math.min(d,a);return d<=768?Math.max(280,d-20):Math.max(400,Math.min(1200,g-40))}function Tn({gameCubeSize:d,screenHeight:a,screenWidth:g,seed:s}){const[p,j]=t.useState(()=>({width:typeof window<"u"?window.innerWidth:K,height:typeof window<"u"?window.innerHeight:J}));t.useEffect(()=>{const b=()=>{j({width:window.innerWidth,height:window.innerHeight})};b(),window.addEventListener("resize",b),window.addEventListener("orientationchange",b);const A=new ResizeObserver(b);return A.observe(document.documentElement),()=>{window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),A.disconnect()}},[]);const $=t.useMemo(()=>Math.min(p.width/K,p.height/J),[p.width,p.height]);return i.jsx("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:i.jsx("div",{style:{position:"absolute",left:"50%",top:"50%",width:`${K}px`,height:`${J}px`,transform:`translate(-50%, -50%) scale(${$})`,transformOrigin:"center center"},children:i.jsx("div",{style:{width:`${K}px`,height:`${J}px`,position:"relative",overflow:"hidden"},children:i.jsx(In,{gameCubeSize:d??yi(p.width,p.height),screenWidth:g??p.width,screenHeight:a??p.height,seed:s})})})})}exports.AdaptiveGameShell=Tn;exports.Game=Tn;exports.RawGame=In;exports.themes=F;
|