import{a as e,r as t,t as n}from"./i18n-CjHYiQIU.js";import{r,t as i}from"./riddles-BL25uVdU.js";var a=e();function o({completedIds:e,onSelect:o,onBack:c}){let{language:l,strings:u}=n(),d=u.w4.difficultyScreen,f=u.w4.common.difficulty;return(0,a.jsxs)(`main`,{className:`screen thorn-screen thorn-difficulty-screen rework-panel-screen`,children:[(0,a.jsxs)(`header`,{className:`screen-heading`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`eyebrow`,children:d.eyebrow}),(0,a.jsx)(`h1`,{children:d.title})]}),(0,a.jsx)(`button`,{onClick:c,children:u.w4.common.back})]}),(0,a.jsx)(`div`,{className:`difficulty-grid`,children:[`easy`,...r.filter(e=>e!==`easy`),`all`].map(n=>{let r=i(n,l),c=r.filter(t=>e.includes(t.id)).length,u=r.length?Math.round(r.reduce((e,t)=>e+t.answer.length,0)/r.length):0,p=n===`all`?0:Math.min(...r.map(e=>e.answer.length)),m=n===`all`?0:Math.max(...r.map(e=>e.answer.length));return(0,a.jsxs)(`button`,{className:`difficulty-card`,onClick:()=>o(n),children:[(0,a.jsx)(`strong`,{children:n===`all`?d.allDifficulties:f[n]}),(0,a.jsx)(`span`,{children:n===`all`?t(d.availableAllLengths,{count:r.length}):t(d.availableLetters,{count:r.length,min:p,max:m})}),(0,a.jsx)(`span`,{className:`difficulty-ornament`,"aria-hidden":`true`,children:d.ornament}),(0,a.jsx)(`small`,{children:t(d.progress,{solved:c,waiting:r.length-c,average:u})}),(0,a.jsx)(s,{value:c,total:r.length})]},n)})})]})}function s({value:e,total:t}){return(0,a.jsx)(`div`,{className:`progress`,children:(0,a.jsx)(`span`,{style:{width:`${t?e/t*100:0}%`}})})}export{o as DifficultyScreen};