@ihabdevteam/core 0.131.0 → 0.132.0

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/components.cjs.js +177 -177
  3. package/dist/components.esm.css +2 -2
  4. package/dist/hooks.cjs.js +1 -1
  5. package/dist/i18n.cjs.js +1 -1
  6. package/dist/ihabdevteam-core.cjs.js +182 -182
  7. package/dist/ihabdevteam-core.d.ts +55 -6
  8. package/dist/packages/core/src/components/Accordion.js +4 -1
  9. package/dist/packages/core/src/components/Badge.d.ts +5 -0
  10. package/dist/packages/core/src/components/Badge.js +3 -3
  11. package/dist/packages/core/src/components/BarChart.d.ts +1 -1
  12. package/dist/packages/core/src/components/BarChart.js +24 -13
  13. package/dist/packages/core/src/components/Calendar.js +4 -0
  14. package/dist/packages/core/src/components/ChartSection.css +16 -0
  15. package/dist/packages/core/src/components/ChartSection.d.ts +8 -1
  16. package/dist/packages/core/src/components/ChartSection.js +2 -2
  17. package/dist/packages/core/src/components/PageTitle.css +6 -0
  18. package/dist/packages/core/src/components/PageTitle.d.ts +9 -1
  19. package/dist/packages/core/src/components/PageTitle.js +2 -2
  20. package/dist/packages/core/src/components/Popup/Popup.d.ts +8 -0
  21. package/dist/packages/core/src/components/Popup/Popup.js +4 -2
  22. package/dist/packages/core/src/components/RingChart.d.ts +3 -1
  23. package/dist/packages/core/src/components/RingChart.js +2 -2
  24. package/dist/packages/core/src/components/SideNav.js +27 -10
  25. package/dist/packages/core/src/components/Table.d.ts +17 -1
  26. package/dist/packages/core/src/components/Table.js +15 -9
  27. package/dist/packages/core/src/components/TextField.js +34 -5
  28. package/dist/packages/core/src/components/barChartTypes.d.ts +2 -0
  29. package/dist/packages/core/src/components/useComboboxSuggestions.d.ts +1 -0
  30. package/dist/packages/core/src/components/useComboboxSuggestions.js +12 -6
  31. package/dist/packages/core/src/version.d.ts +1 -1
  32. package/dist/packages/core/src/version.js +1 -1
  33. package/dist/utils.cjs.js +1 -1
  34. package/package.json +1 -1
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var s=require("react"),ce=require("react-i18next"),Ou=require("i18next"),lu=typeof document<"u"?document.currentScript:null;function vt({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:l=1.4}={}){const r=S=>Math.max(t,Math.min(n,Number(S))),[a,i]=s.useState(()=>{try{const S=localStorage.getItem(e),g=S?Number(S):1;return Number.isFinite(g)?r(g):r(1)}catch{return 1}});s.useEffect(()=>{try{localStorage.setItem(e,String(a))}catch{}},[e,a]);const f=S=>{i(typeof S=="function"?g=>r(S(g)):r(S))},h=()=>f(S=>+(S+o).toFixed(6)),C=()=>f(S=>+(S-o).toFixed(6)),c=a<n-Number.EPSILON,d=a>t+Number.EPSILON,m=Math.round(u*a),y=Math.round(m*l);return{scale:a,setScale:f,increase:h,decrease:C,canIncrease:c,canDecrease:d,fontSize:m,lineHeight:y}}const Nu=s.createContext(null);function xt(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Pt(e){const u=s.useContext(Nu),t=l=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(l).matches,[n,o]=s.useState(t(e));return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const l=window.matchMedia(e),r=i=>o(i.matches),a=l;return a.addEventListener?a.addEventListener("change",r):a.addListener&&a.addListener(r),o(l.matches),()=>{a.removeEventListener?a.removeEventListener("change",r):a.removeListener&&a.removeListener(r)}},[e]),u&&typeof u.mobile=="boolean"&&xt(e)?u.mobile:n}function Tu(e){const u=s.useRef(e);return s.useEffect(()=>{u.current=e}),u}function ju(e,u){const t=Tu(u);s.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const ru=" \xB7 ",Iu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(ru)?e.split(ru).pop()??e:e})(),Ru=s.createContext(!1);function Ft(e){const u=s.useContext(Ru);s.useEffect(()=>{if(u||typeof e!="string"||!e)return;const t=document.title;return document.title=Iu?`${e}${ru}${Iu}`:e,()=>{document.title=t}},[e,u])}function Vt(){const{t:e}=ce.useTranslation();return s.useCallback(u=>{if(!u)return"";const t=new Date(u).getTime();if(Number.isNaN(t))return"";const n=Math.floor((Date.now()-t)/864e5);return n<=0?e("myHomework.relativeDay.today","\uC624\uB298"):n===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n})},[e])}const Ht=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",u=typeof Ou?.t=="function"?Ou.t("common.unknownError",{defaultValue:e}):void 0;return typeof u=="string"&&u?u:e};function $t(e,u){if(u===void 0&&(u=Ht()),e instanceof Error)return e.message||u;if(typeof e=="string")return e||u;if(e&&typeof e=="object"){const t=e;for(const n of[t.message,t.error_description,t.error])if(typeof n=="string"&&n)return n}return u}function Gt(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState({current:"",next:"",confirm:""}),[o,l]=s.useState(null),[r,a]=s.useState(!1),i=s.useRef(null);s.useEffect(()=>()=>{i.current!==null&&clearTimeout(i.current)},[]);const f=s.useCallback(()=>{n({current:"",next:"",confirm:""}),l(null)},[]),h=s.useCallback(async()=>{if(!t.current){l({type:"error",text:u("account.security.password.currentRequired","\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(!t.next){l({type:"error",text:u("account.security.password.newRequired","\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(t.next!==t.confirm){l({type:"error",text:u("account.security.password.mismatch","\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")});return}a(!0);let C;try{C=e?await e(t.current,t.next):null}catch(c){C=$t(c)}finally{a(!1)}if(C){l({type:"error",text:C});return}l({type:"success",text:u("account.security.password.changed","\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.")}),n({current:"",next:"",confirm:""}),i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>l(null),1500)},[t,e,u]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:l,pwLoading:r,handleChangePw:h,reset:f}}const q=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ee=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Q=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function P(e){if(!e)return null;const u=e.charCodeAt(0)-44032;return u<0||u>=11172?null:{cho:Math.floor(u/588),jung:Math.floor(u%588/28),jong:u%28}}function Yt(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>P(n)),e.set(u,t)),t}}function Ce(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function Ut(e,u){if(!e||!u||e===u||e.length!==u.length)return"random";let t=0,n=null;for(let o=0;o<e.length;o++){const l=P(e[o]),r=P(u[o]);if(!l||!r)return"random";if(l.cho===r.cho&&l.jung===r.jung&&l.jong===r.jong)continue;t++;const a=l.cho!==r.cho,i=l.jung!==r.jung,f=l.jong!==r.jong;(a?1:0)+(i?1:0)+(f?1:0)>1?n="multi":a?n="cho":i?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const Be={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]};Object.fromEntries(Object.entries(Be).map(([e,u])=>[u.join(""),Q[Number(e)]]));function Kt(e,u){if(!e||!u)return!1;for(const t of e){const n=P(t);if(n){if(q[n.cho]===u)return!0;if(n.jong>0){if(Q[n.jong]===u)return!0;const o=Be[n.jong];if(o&&o.includes(u))return!0}}}return!1}function Ve(e){if(!e)return 0;let u=0;for(const t of e)P(t)&&u++;return u}function Wt(e){if(!e)return!1;let u=!1;for(const t of e){const n=P(t);if(n&&(u=!0,n.jong>0))return!1}return u}function qt(e,u){if(e.jong<=0)return!1;if(u.includes(Q[e.jong]))return!0;const t=Be[e.jong];return!!t&&t.some(n=>u.includes(n))}function zt(e,u,t){if(!e)return!1;const n=[...e],o=l=>{const r=P(n[l]);if(!r||u.cho&&!u.cho.includes(q[r.cho])||u.jung&&!u.jung.includes(ee[r.jung]))return!1;if(u.jongNone){if(r.jong>0)return!1}else if(u.jong&&!qt(r,u.jong))return!1;return!0};if(t==="head")return o(0);if(t==="tail")return o(n.length-1);if(t==="mid"){for(let l=1;l<n.length-1;l++)if(o(l))return!0;return!1}for(let l=0;l<n.length;l++)if(o(l))return!0;return!1}const Jt={cho:q.length,jung:ee.length,jong:Q.length};function Xt(e,u,t,n,o=1/0){if(!e||t<1)return[];const l=[...e].map(C=>P(C));if(l.some(C=>!C))return[];const r=l,a=r.length;if(t>a)return[];const i=Jt[u],f=new Set,h=[];(function C(c,d){if(d.length===t){h.push([...d]);return}for(let m=c;m<a;m++)d.push(m),C(m+1,d),d.pop()})(0,[]);for(const C of h)if((function c(d,m){if(f.size>=o)return;if(d===C.length){const g=m.map(E=>Ce(E.cho,E.jung,E.jong)).join("");g!==e&&n.has(g)&&f.add(g);return}const y=C[d],S=r[y][u];for(let g=0;g<i;g++){if(g===S)continue;const E=m.slice();if(E[y]={...m[y],[u]:g},c(d+1,E),f.size>=o)return}})(0,r),f.size>=o)break;return[...f]}function Zt(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=P(e[n]),l=P(u[n]);if(!o||!l)return-1;o.cho!==l.cho&&t++,o.jung!==l.jung&&t++,o.jong!==l.jong&&t++}return t}const Lu="word_pair_index_v2",Mu="word_pair_index_sig_v2";let we=null;function Qt(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Lu),u=localStorage.getItem(Mu);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function be(){if(we)return we;const e=Qt();return e?(we=e.index,e.sig,we):null}function en(){we=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Lu),localStorage.removeItem(Mu))}catch{}}const ku="word_image_existence_map_v1";let Se=null;function vu(){if(Se)return Se;try{const e=typeof localStorage<"u"?localStorage.getItem(ku):null;Se=e?JSON.parse(e):{}}catch{Se={}}return Se}function un(e,u){return`${e}_${u??1}`}function tn(e,u){const t=vu(),n=un(e,u);return n in t?t[n]:void 0}function xu(){const e=vu(),u=Object.values(e);return u.length===0?null:{total:u.length,exists:u.filter(Boolean).length}}function nn(){Se={};try{typeof localStorage<"u"&&localStorage.removeItem(ku)}catch{}}const Pu=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function Fu(e){return e.reduce((u,t)=>{try{const n=localStorage.getItem(t);return u+(n?new Blob([n]).size:0)}catch{return u}},0)}function on(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function ln(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState({}),[o,l]=s.useState(null),[r,a]=s.useState(null),[i,f]=s.useState(null),h=s.useCallback(()=>{const c={};Pu.forEach(d=>{c[d.id]=Fu([...d.keys])}),n(c),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(d=>{f({usage:d.usage??0,quota:d.quota??0})}).catch(()=>{})},[]);s.useEffect(()=>{h()},[h]);const C=s.useCallback(async c=>{l(c);try{c==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):c==="pairIndex"?en():c==="imageCache"&&nn(),h(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{l(null)}},[h,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:r,setConfirmCacheId:a,storageEstimate:i,refreshCacheSizes:h,handleClearCache:C}}function rn(e){const[u,t]=s.useState(null),[n,o]=s.useState(null),l=s.useCallback(()=>{const r=be();if(r){const i=Object.values(r),f=i.filter(h=>h.cho.length+h.jung.length+h.jong.length>0).length;t({matched:f,total:i.length})}else t(null);const a=xu();o(a?{exists:a.exists,total:a.total}:null)},[]);return s.useEffect(()=>{l();const r=setTimeout(l,1e3);return()=>clearTimeout(r)},[e?.length,l]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:l}}function Vu(e,u=[]){const[t,n]=s.useState(u),[o,l]=s.useState(null),[r,a]=s.useState(!1),[i,f]=s.useState(e),h=s.useRef(r);s.useEffect(()=>{h.current=r});const C=s.useRef(null);s.useEffect(()=>{if(h.current)return;const g=C.current;g!==null&&g.length===u.length&&g.every((E,w)=>E===u[w])||(C.current=u,n(u))},[u]);const c=s.useCallback(g=>{l(g),a(!1),f({...g})},[]),d=s.useCallback(()=>a(!0),[]),m=s.useCallback(()=>a(!1),[]),y=s.useCallback((g,E)=>{n(g),l(E),a(!1)},[]),S=s.useCallback(g=>{n(E=>E.filter(w=>w!==g)),l(null)},[]);return{list:t,setList:n,selected:o,setSelected:l,isEditing:r,setIsEditing:a,editForm:i,setEditForm:f,openDetail:c,startEditing:d,cancelEditing:m,commitEdit:y,remove:S}}const Ae=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},an={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function sn(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:l,setIsEditing:r,editForm:a,setEditForm:i,openDetail:f,commitEdit:h}=Vu(an,e),{year:C,month:c,day:d}=Ae(),[m,y]=s.useState({year:C,month:c,day:d,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:m,setVisitForm:y,setVisit:S=>g=>y(E=>({...E,[S]:g})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:l,setIsEditingVisit:r,editVisitForm:a,setEditVisitForm:i,openVisitDetail:f,handleVisitSave:S=>{t(A=>[m,...A]);const{year:g,month:E,day:w}=Ae();y({year:g,month:E,day:w,hour:"09",minute:"00",memo:""}),S?.()},handleVisitEditSave:()=>{h(S=>S.map(g=>g===n?a:g),a)},addVisit:S=>{t(g=>[S,...g])},removeVisit:S=>{t(g=>g.filter(E=>E!==S))},revertVisitEdit:(S,g)=>{t(E=>E.map(w=>w===g?S:w)),o(E=>E===g?S:E)}}}const Hu=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,He=e=>[...e].sort((u,t)=>{const n=Hu(u),o=Hu(t);return n<o?-1:n>o?1:0}),cn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Cn(e,u=[]){const t=s.useMemo(()=>He(u),[u]),{list:n,setList:o,selected:l,setSelected:r,isEditing:a,setIsEditing:i,editForm:f,setEditForm:h,openDetail:C,commitEdit:c,remove:d}=Vu(cn,t),[m,y]=s.useState([]),{year:S,month:g,day:E}=Ae(),[w,A]=s.useState({year:S,month:g,day:E,hour:"09",minute:"00",memo:""}),_=I=>M=>A(F=>({...F,[I]:M})),b=I=>{o(se=>He([...se,w]));const{year:M,month:F,day:J}=Ae();A({year:M,month:F,day:J,hour:"09",minute:"00",memo:""}),I?.()},L=()=>{c(I=>He(I.map(M=>M===l?f:M)),f)},T=s.useCallback(I=>{d(I)},[d]),v=s.useCallback(I=>{e({year:I.year,month:I.month,day:I.day,hour:I.hour,minute:I.minute,memo:I.memo}),d(I)},[e,d]),R=s.useCallback(I=>{o(M=>M.filter(F=>F!==I)),y(M=>[I,...M]),r(null)},[o,r]),V=s.useCallback(I=>{o(M=>He([...M,I]))},[o]),$=s.useCallback(I=>{o(M=>M.filter(F=>F!==I))},[o]),Y=s.useCallback((I,M)=>{o(F=>F.map(J=>J===M?I:J)),r(F=>F===M?I:F)},[o,r]);return{scheduleList:n,noShowList:m,addSchedule:V,removeSchedule:$,revertScheduleEdit:Y,scheduleForm:w,setScheduleForm:A,setSchedule:_,selectedSchedule:l,setSelectedSchedule:r,isEditingSchedule:a,setIsEditingSchedule:i,editScheduleForm:f,setEditScheduleForm:h,openScheduleDetail:C,handleScheduleSave:b,handleScheduleEditSave:L,handleScheduleDelete:T,handleScheduleToVisit:v,handleScheduleNoVisit:R}}const $e=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function dn(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState(""),[o,l]=s.useState("25"),[r,a]=s.useState("all"),[i,f]=s.useState(1),h=s.useMemo(()=>e.filter(({item:y,status:S})=>!(t&&!y.memo.includes(t)||r!=="all"&&S!==r)),[e,t,r]),C=Math.max(1,Math.ceil(h.length/Number(o))),c=Math.min(i,C),d=s.useMemo(()=>h.slice((c-1)*Number(o),c*Number(o)),[h,c,o]),m=s.useMemo(()=>$e.map(y=>({...y,label:u("common.pageSizeLabel",{n:y.value,defaultValue:y.label})})),[u]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:l,vapPageSizeOptions:m,vapStatus:r,setVapStatus:a,vapPage:c,setVapPage:f,vapFiltered:h,vapTotal:C,vapPageItems:d}}function fn(e,u,t){const{t:n}=ce.useTranslation(),[o,l]=s.useState(()=>{const m=t?.initialPageSize;return m&&$e.some(y=>y.value===m)?m:"25"}),[r,a]=s.useState(1),[i,f]=s.useState(u);i!==u&&(f(u),r!==1&&a(1));const h=s.useMemo(()=>$e.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),C=s.useCallback(m=>{l(m),a(1)},[]),c=Math.max(1,Math.ceil(e.length/Number(o))),d=Math.min(r,c);return{pageRows:s.useMemo(()=>e.slice((d-1)*Number(o),d*Number(o)),[e,d,o]),pageSizeProps:{options:h,value:o,onChange:C},paginationProps:{page:d,total:c,onChange:a},setPage:a}}function gn(){const[e,u]=s.useState(null),t=s.useCallback(o=>{u(l=>l?.key===o?{key:o,asc:!l.asc}:{key:o,asc:!0})},[]),n=s.useCallback((o,l)=>({label:o,sortDir:e?.key===l?e.asc?"asc":"desc":null,onClick:()=>t(l)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}const $u=e=>e==="\uC88C"||e==="\uC6B0"?e:null;function hn(){const[e,u]=s.useState(!1),[t,n]=s.useState("\uC88C"),[o,l]=s.useState({\uC88C:null,\uC6B0:null}),[r,a]=s.useState({\uC88C:[],\uC6B0:[]}),[i,f]=s.useState(!1),[h,C]=s.useState("\uC88C"),c=s.useCallback(m=>{const y=$u(m.direction);y&&(l(S=>({...S,[y]:m})),a(S=>({...S,[y]:[m,...S[y]]})),u(!1))},[]),d=s.useCallback(m=>{const y=$u(m.direction);y&&(l(S=>({...S,[y]:m})),f(!1))},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:l,deviceHistory:r,setDeviceHistory:a,showDeviceList:i,setShowDeviceList:f,listForSide:h,setListForSide:C,handleDeviceSubmit:c,handleSelectFromList:d}}const mn="__ihab_core_word_pool__";function Ge(){return globalThis[mn]??null}function x(e,u=Math.random){const t=e.slice();for(let n=t.length-1;n>0;n--){const o=Math.floor(u()*(n+1));[t[n],t[o]]=[t[o],t[n]]}return t}function le(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?x(e,t):x(e,t).slice(0,u)}const au={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}},pn=q.indexOf("\u3147"),Gu={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==pn},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0}},Sn={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"},En={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function Yu(e){return Sn[e]??e}const su={cho:q,jung:ee,jong:Q},K=e=>Array.isArray(e)?e.length>0:!!e;function iu(e,u){if(e.length!==u.length)return!1;for(let t=0;t<e.length;t++){const n=e[t],o=u[t];if(!(!n||!o)&&(n.cho!==o.cho&&q[n.cho]==="\u3147"!=(q[o.cho]==="\u3147")||n.jong!==o.jong&&n.jong===0!=(o.jong===0)))return!0}return!1}function yn(e,u,t){const n=t.pronOf(e),o=t.decompOf,l=t.sameStructureOnly&&o?o(n):null,r=[];for(const a of u)a!==e&&(t.okSet&&!t.okSet.has(a)||t.pronOf(a)!==n&&(l&&o&&iu(l,o(t.pronOf(a)))||r.push(a)));return r}function Uu(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return yn(e,o,t)}function Bn(e,u,t,n,o,l,r){const a=["cho","jung","jong"].filter(c=>K(e[c])),i={};for(const c of a){const d=e[c];i[c]=new Set(Array.isArray(d)?d:[d])}const f=o==="pron",h=new Map;for(const c of u){const d=t(l(c));if(d.some(g=>!g))continue;let m=d;if(!f&&(m=t(c),m.length!==d.length||m.some(g=>!g)))continue;const y=d.length,S=h.get(y);S?S.push({w:c,dPron:d,dPos:m}):h.set(y,[{w:c,dPron:d,dPos:m}])}const C=new Map;for(const[c,d]of h){const m=new Map,y=(S,g)=>{const E=S.dPos[g];return E!=null&&a.every(w=>i[w].has(su[w][E[w]]))};for(const S of d){let g;if(r==="head")g=y(S,0)?0:-1;else if(r==="tail")g=y(S,c-1)?c-1:-1;else if(r==="mid"){g=-1;for(let w=1;w<c-1;w++)if(y(S,w)){g=w;break}}else g=S.dPos.findIndex(w=>w!=null&&a.every(A=>i[A].has(su[A][w[A]])));if(g<0)continue;const E=m.get(g);E?E.push(S):m.set(g,[S])}for(const[S,g]of m){const E=new Set(a.map(_=>S+":"+_)),w=_=>{let b="";for(let L=0;L<c;L++){const T=_[L];for(const v of["cho","jung","jong"])b+=(E.has(L+":"+v)?"*":T[v])+"."}return b},A=new Map;for(const _ of d){const b=w(_.dPron),L=A.get(b);L?L.push(_):A.set(b,[_])}for(const _ of g){const b=A.get(w(_.dPron))??[],L=[];for(const T of b){if(T.w===_.w)continue;let v=!0;for(const R of a){const V=_.dPron[S][R],$=T.dPron[S][R];if($===V){v=!1;break}if(f&&i[R].has(su[R][$])){v=!1;break}}v&&(n&&iu(_.dPron,T.dPron)||L.push(T.w))}C.set(_.w,L)}}}return C}const wn=e=>e==null?[]:Array.isArray(e)?e:[e];function bn(e){if([...e].length!==1)return"";const u=P(e);if(!u)return"";const t=Yu(Q[u.jong]),n=t===""?0:Q.indexOf(t);return Ce(u.cho,u.jung,n<0?0:n)}function Ku(e,u){return u.get(e)||bn(e)||e}function cu(e){return e?K(e.cho)?"cho":K(e.jung)?"jung":K(e.jong)?"jong":null:null}function Ee(e,u){const t=(n,o)=>!K(n)||wn(n).includes(o);return t(u.cho,q[e.cho])&&t(u.jung,ee[e.jung])&&t(u.jong,Q[e.jong])}function _e(e,u,t){const n=[...e];if(t!=="pron")return n.map(l=>P(l));const o=[...u.get(e)||e];return o.length!==n.length?n.map(l=>P(l)):o.map(l=>P(l))}function De(e,u,t,n,o){const l=u==="cho"?q:u==="jung"?ee:Q,r=e[u],a=[],i=C=>u==="jung"?_n(Ku(C,o)):Ku(C,o),f=new Map([[i(t),-1]]),h=x(l.map((C,c)=>c).filter(C=>C!==r&&(u!=="cho"||l[C]!=="\u3147")&&(u!=="jong"||C!==0)));for(const C of h){if(a.length>=n)break;const c=u==="cho"?Ce(C,e.jung,e.jong):u==="jung"?Ce(e.cho,C,e.jong):Ce(e.cho,e.jung,C),d=i(c),m=f.get(d);if(m!==void 0){u==="jung"&&m>=0&&o.has(c)&&!o.has(a[m])&&(a[m]=c);continue}f.set(d,a.length),a.push(c)}return a}const An={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function _n(e){if([...e].length!==1)return e;const u=P(e);if(!u)return e;const t=An[ee[u.jung]];return t?Ce(u.cho,ee.indexOf(t),u.jong):e}function Dn(e,u,t,n,o,l=null){const r=[...e];if(r.length!==2)return null;const a=r.map(C=>P(C));if(a.some(C=>!C))return null;const i=_e(e,t,n);if(i.some(C=>!C))return null;const f=cu(u);let h=f&&u?i.map((C,c)=>Ee(C,u)?c:-1).filter(C=>C>=0):[0,1];if(l!=null&&(h=h.filter(C=>C!==l)),!h.length)return null;for(const C of x(h)){const c=r[C];if(!o.has(c))continue;const d=De(a[C],f??"cho",c,40,t),m=[];for(const y of d)if(y!==c&&o.has(y)&&!m.includes(y)&&m.push(y),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[c,...m]}}return null}function On(e,u,t,n,o,l=null){const r=[...e];if(r.length!==3)return null;const a=r.map(C=>P(C));if(a.some(C=>!C))return null;const i=_e(e,t,n);if(i.some(C=>!C))return null;const f=cu(u),h=f&&u?i.map((C,c)=>Ee(C,u)?c:-1).filter(C=>C>=0):[0,1,2];if(!h.length)return null;for(const C of x(h))for(const c of x([0,1,2].filter(d=>d!==C&&(l==null||d===l)))){const d=[0,1,2].filter(E=>E!==c),m=d.map(E=>r[E]).join("");if(!o.has(m))continue;const y=d.indexOf(C),S=De(a[C],f??"cho",r[C],40,t),g=[];for(const E of S){const w=d.map(_=>r[_]);w[y]=E;const A=w.join("");if(A!==m&&o.has(A)&&!g.includes(A)&&g.push(A),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[m,...g]}}return null}function Nn(e,u,t,n,o,l=null){const r=[...e],a=r.length;if(a<2)return null;const i=[];for(let h=1;h<=a-1;h++)i.push({remain:r.slice(0,h).join(""),dropped:r.slice(h).join(""),droppedEnd:1}),i.push({remain:r.slice(a-h).join(""),dropped:r.slice(0,a-h).join(""),droppedEnd:0});const f=cu(u);for(const{remain:h,dropped:C,droppedEnd:c}of x(i)){if(l!=null&&c!==l||h===e||!o.has(h)||!o.has(C))continue;const d=[...h],m=d.map(g=>P(g));if(m.some(g=>!g))continue;const y=_e(h,t,n);if(y.some(g=>!g))continue;const S=f&&u?y.map((g,E)=>Ee(g,u)?E:-1).filter(g=>g>=0):d.map((g,E)=>E);if(S.length)for(const g of x(S)){const E=De(m[g],f??"cho",d[g],40,t),w=[];for(const A of E){const _=[...d];_[g]=A;const b=_.join("");if(b!==h&&o.has(b)&&!w.includes(b)&&w.push(b),w.length>=2)break}if(w.length>=2)return{question:e,distractors:[h,...w]}}}return null}function Tn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const r=P(t.get(e)||e);if(!r||r.jong===0)return null;const a=Ce(r.cho,r.jung,0),i=De({cho:r.cho,jung:r.jung,jong:0},"cho",a,2,t);return i.length<2?null:{question:e,distractors:[a,...i]}}const Cu=q.indexOf("\u3147");function jn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const r=P(t.get(e)||e);if(!r||r.jong!==0||r.cho===Cu)return null;const a=Ce(Cu,r.jung,0),i=De({cho:Cu,jung:r.jung,jong:0},"jung",a,2,t);return i.length<2?null:{question:e,distractors:[a,...i]}}function In(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let l=0;l<o;l++){let r=o+"|"+l+"|";for(let i=0;i<o;i++)r+=i===l?"*":n[i];const a=u.get(r);a?a.push(t):u.set(r,[t])}}return u}function Rn(e,u,t,n,o,l=null,r=null,a=2){const i=[...e],f=i.length;if(f<2||f>3)return null;const h=i.map(E=>P(E));if(h.some(E=>!E))return null;const C=_e(e,t,n);if(C.some(E=>!E))return null;const c=E=>t.get(E)??E,d=c(e),m=!!u&&(K(u.cho)||K(u.jung)||K(u.jong)),y=!!r&&(K(r.cho)||K(r.jung)||K(r.jong)),S=E=>{let w=f+"|"+E+"|";for(let A=0;A<f;A++)w+=A===E?"*":i[A];return w};let g;if(l!=null){if(l>=f||m&&!Ee(C[l],u))return null;g=[l]}else m?g=C.map((E,w)=>Ee(E,u)?w:-1).filter(E=>E>=0):g=Array.from({length:f},(E,w)=>w);for(const E of x(g)){const w=o.get(S(E))??[],A=[],_=[];for(const R of w){if(R===e)continue;const V=[...R].map(M=>P(M)),$=h[E],Y=V[E];if(!$||!Y)continue;let I=0;if($.cho!==Y.cho&&I++,$.jung!==Y.jung&&I++,$.jong!==Y.jong&&I++,!(I<a||c(R)===d))if(y){const M=_e(R,t,n)[E];M&&Ee(M,r)?A.push(R):_.push(R)}else A.push(R)}if(!A.length)continue;const b=x(A)[0],L=[],T=new Set([d,c(b)]),v=y?_:A.filter(R=>R!==b);for(const R of x(v)){const V=c(R);if(!T.has(V)&&(T.add(V),L.push(R),L.length>=2))break}if(!y&&L.length<2)for(const R of x(w)){if(R===e||R===b)continue;const V=c(R);if(!T.has(V)&&(T.add(V),L.push(R),L.length>=2))break}if(!(L.length<2))return{question:e,distractors:[b,...L]}}return null}let Ye=null,Wu=null,qu=null;function Ln(){const e=Ge();if(e&&e.entries.length>0){const u=be();if(Ye&&Wu===e&&qu===u)return Ye;const t=new Set,n=[];for(const o of e.entries)!o.word||t.has(o.word)||(t.add(o.word),n.push({w:o.word,s:o.syllables,p:u?.[o.word]?[...u[o.word].cho??[],...u[o.word].jung??[],...u[o.word].jong??[]]:[],pron:o.pronunciation||o.word,grade:o.grade}));return Ye=n,Wu=e,qu=u,Ye}return[]}const ue=new Proxy([],{get(e,u){const t=Ln(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Ue(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function te(e,u){if(u>=e.length)return x(e);if(u===0)return[];const t=e.slice();for(let n=0;n<u;n++){const o=n+Math.floor(Math.random()*(t.length-n)),l=t[n];t[n]=t[o],t[o]=l}return t.slice(0,u)}let du=null,zu=null;function fe(){const e=Ge();if(du&&zu===e)return du;const u=new Map;for(const t of ue)t.w&&u.set(t.w,t.pron);return du=u,zu=e,u}function X(e){return fe().get(e)||e}function fu(e,u,t=new Set){const n=[];for(const o of x(e)){if(n.length>=u)break;const l=X(o);t.has(l)||(t.add(l),n.push(o))}return n}let Mn=0;function z(e){return`${e}-rt-${++Mn}`}function Oe(e){const u=xu();if(!u||u.total===0){const n=new Set;for(const o of e)n.add(o);return n}const t=new Set;for(const n of e)tn(n)===!0&&t.add(n);return t}const Ke=new Map;let Ju=null,Xu=null;function Ne(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function Zu(e){const u=Ne(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${Ne(t.cho)}/${Ne(t.jung)}/${Ne(t.jong)}/${t.jongNone?"N":""}/${n}`:"",l=Ne(e.grade);return`${e.difficulty??""}|${u}|${o}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${l}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Z(e){const u=Ge(),t=be();(u!==Ju||t!==Xu)&&(Ke.clear(),Ju=u,Xu=t);const n=Zu(e);return Ke.has(n)||Ke.set(n,vn(e)),Ke.get(n)}function kn(e){if(!e)return null;const u=r=>r==null?null:Array.isArray(r)?r.length?r:null:[r],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,l=o?null:u(e.jong);return t||n||l||o?o&&!t&&!n&&!l?r=>Wt(r):r=>zt(r,{cho:t,jung:n,jong:l,jongNone:o}):null}async function vn(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:l=!1}=e,r=e.grade&&e.grade.length>0?new Set(e.grade):null,a=e.sameStructureOnly??!0,i=e.phonemeView==="pron"?"pron":"char",f=Math.max(1,e.contrastCount??1),h=u==="cho"||u==="jung"||u==="jong",C=h&&f>=2,c=u==="count",d=t?new Set(Array.isArray(t)?t:[t]):null,m=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,y=n?[kn(n),m?B=>m.has(Ve(B)):null].filter(B=>B!=null):[],S=u==="random"||u===null,g=S||c,E=S||C||c;let w=ue.filter(B=>!B.w||r&&(!B.grade||!r.has(B.grade))?!1:E?!0:Array.isArray(B.p)&&B.p.length>0);d&&(w=w.filter(B=>{for(const D of d)if(Kt(B.w,D))return!0;return!1})),y.length>0&&(w=w.filter(B=>{const D=i==="pron"?X(B.w):B.w;return y.every(G=>G(D))})),o&&(w=w.filter(B=>B.w[0]===o));let A;if(l){const B=new Set;for(const D of w)if(B.add(D.w),Array.isArray(D.p))for(const G of D.p)B.add(G);if(g)for(const D of ue)D.w&&B.add(D.w);A=Oe(B)}else{const B=new Set;for(const D of w)if(B.add(D.w),Array.isArray(D.p))for(const G of D.p)B.add(G);if(g)for(const D of ue)D.w&&B.add(D.w);A=B}let _=null;if(C){const B=new Set;for(const D of ue)D.w&&B.add(D.w);_=l?Oe(B):B}const b=w.filter(B=>A.has(B.w)),L=600,T=Array.from(A),v=T.length>L?te(T,L):T,R=c&&n!=null&&(K(n.cho)||K(n.jung)||K(n.jong)),V=2500,$=new Map;if(c&&!R&&f>=2){for(const B of T){const D=Ve(B),G=$.get(D);G?G.push(B):$.set(D,[B])}for(const[B,D]of $)D.length>V&&$.set(B,te(D,V))}const Y=Yt(),I=R?Bn(n,T,Y,a,i,X):null,M=500,F=1500,J=e.fullCount?b:u==="random"?b.length>M?te(b,M):b:b.length>F?te(b,F):b,se=be(),ie=[];for(const B of J){let D;const G=X(B.w);if(C)D=Xt(B.w,u,f,_,24).filter(H=>X(H)!==G);else if(c)R?D=(I.get(B.w)??[]).filter(H=>X(H)!==G):f<=1?D=Uu(B.w,se,{okSet:A,pronOf:X,decompOf:Y,sameStructureOnly:!1}):D=($.get(Ve(B.w))??[]).filter(H=>{if(H===B.w||X(H)===G)return!1;const O=Zt(B.w,H);return f>=5?O>=5:O===f});else if(S)D=v.filter(H=>H!==B.w&&H.length===B.w.length&&X(H)!==G);else{const H=u;D=Uu(B.w,se,{kind:H,okSet:A,pronOf:X,decompOf:Y,sameStructureOnly:!1}),D.length===0&&(D=(v.length>30?te(v,30):v).filter(O=>O!==B.w&&Ut(B.w,O)===u&&X(O)!==G))}if(a&&D.length>0&&(h||c&&!R)){const H=Y(X(B.w));D=D.filter(O=>!iu(H,Y(X(O))))}D.length!==0&&ie.push({word:B,usable:D})}return ie}async function Qu(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,l=(await Z(u)).filter(a=>a.usable.length>=o),r=[];for(const a of x(l)){if(r.length>=n)break;const i=fu(a.usable,o);if(i.length<o)continue;const f=x([a.word.w,...i]);r.push({id:z(e+"-item"),index:r.length+1,word:a.word.w,syllables:a.word.s,choices:f,answerIndex:f.indexOf(a.word.w)})}return r}async function xn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u)return[];const l=[],r=x([...o]);for(const a of r){if(l.length>=t)break;const i=a.word.w,f=[...a.word.pron||i],h=Ue(f);if(!h)continue;const C=o.filter(m=>m.word.w!==i&&m.word.s===a.word.s&&!(m.word.pron||m.word.w).includes(h)&&m.word.pron!==a.word.pron);if(C.length<n)continue;const c=fu(C.map(m=>m.word.w),n);if(c.length<n)continue;const d=x([i,...c]);l.push({id:z("HPI-item"),index:l.length+1,targetSyllable:h,word:i,choices:d,answerIndex:d.indexOf(i)})}return l}async function Pn(e){const{count:u=10}=e,t=(await Z(e)).filter(n=>n.usable.length>=1);return Array.from({length:u},(n,o)=>{const l=Ue(t);if(!l)return null;const r=o%2===0;let a;if(r)a=[l.word.w,l.word.w];else{const i=Ue(l.usable);a=Math.random()<.5?[l.word.w,i]:[i,l.word.w]}return{id:z("SOD-item"),index:o+1,word:l.word.w,pair:a,same:r}}).filter(n=>!!n)}async function Fn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u+1)return[];const l=o.map(c=>c.word.w),r=new Map(o.map(c=>[c.word.w,c.word.pron])),a=c=>(r.get(c)||c)[0]??"",i={};for(const c of o){const d=a(c.word.w);d&&(i[d]||(i[d]=[]),i[d].push(c.word.w))}const f=Object.entries(i).filter(([,c])=>c.length>=2).map(([c])=>c);if(f.length===0)return[];const h=[],C=x([...f]);for(let c=0;h.length<t&&c<t*4;c++){const d=C[c%C.length],m=i[d];if(m.length<2)continue;const y=x([...m]),S=y[0],g=y[1];if(!S||!g||S===g||(r.get(S)||S)===(r.get(g)||g))continue;const E=r.get(g)||g,w=l.filter(b=>a(b)!==d&&b!==S&&b!==g&&b.length===g.length&&(r.get(b)||b)!==E);if(w.length<n)continue;const A=fu(w,n);if(A.length<n)continue;const _=x([g,...A]);h.push({id:z("SWS-item"),index:h.length+1,sourceWord:S,targetSyllable:d,word:g,choices:_,answerIndex:_.indexOf(g)})}return h}function et(e,u,t){return te(e,u).map((n,o)=>{const l=Ue(n.usable)??"",r=[...n.word.w],a=[...l],i=r.findIndex((h,C)=>h!==a[C]),f=x(n.usable.filter(h=>h&&h!==l)).slice(0,2);return{id:z(t),index:o+1,word:n.word.w,original:n.word.w,changed:l,changedFrom:i>=0?r[i]:"",changedTo:i>=0?a[i]:"",distractors:f}})}async function ut(e,u,t){const{count:n=10}=u,o=fe(),l=ue.filter(d=>d.w&&d.s===e),r=u.excludeNoImage?Oe(l.map(d=>d.w)):null,a=r?l.filter(d=>r.has(d.w)):l,i=new Set(a.map(d=>d.w)),f=In(i),h=u.phonemeView??"char",C=u.composition??null,c=[];for(const d of x(a)){if(c.length>=n)break;const m=Rn(d.w,C,o,h,f,null,null);if(!m)continue;const y=m.distractors[0],S=[...d.w],g=[...y],E=S.findIndex((w,A)=>w!==g[A]);c.push({id:z(t),index:c.length+1,word:d.w,original:d.w,changed:y,changedFrom:E>=0?S[E]:"",changedTo:E>=0?g[E]:"",distractors:m.distractors.slice(1)})}return c}async function Vn(e){return ut(2,e,"CS2-item")}async function Hn(e){return ut(3,e,"CS3-item")}async function $n(e){const u=(await Z({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return et(u,e.count??10,"CP1-item")}async function Gn(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await Z({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return et(t,e.count??10,"CP2-item")}async function Yn(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===2);return te(t,u).map((n,o)=>({id:z("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Un(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===3);return te(t,u).map((n,o)=>({id:z("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Kn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s===2),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=Dn(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=[...a.word.w],c=C[0]===f?C[1]:C[0];r.push({id:z("D2-item"),index:r.length+1,original:a.word.w,word:a.word.w,dropped:c,missingResult:f,distractors:h})}return r}async function Wn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s===3),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=On(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=[...a.word.w];let c="";for(let d=0;d<C.length;d++)if(C.filter((m,y)=>y!==d).join("")===f){c=C[d];break}r.push({id:z("D3-item"),index:r.length+1,original:a.word.w,word:a.word.w,dropped:c,missingResult:f,distractors:h})}return r}async function qn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s>=2),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=Nn(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=a.word.w,c=C.startsWith(f)?C.slice(f.length):C.endsWith(f)?C.slice(0,C.length-f.length):"";r.push({id:z("DPC-item"),index:r.length+1,original:C,word:C,dropped:c,missingResult:f,distractors:h})}return r}async function zn(e){const{count:u=10}=e,t=(await Z({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const l=te(t,3);return{id:z("LRO-item"),index:o+1,sequence:l,choices:x(l)}})}function We(e,u,t){const n=ue.filter(r=>r.w&&r.s===e),o=u?Oe(n.map(r=>r.w)):null,l=[];for(const r of n)if(!(o&&!o.has(r.w))){if(t){const a=P(r.w);if(!a||!t(a))continue}l.push(r)}return l}function Jn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong===0);return te(u,e.count??10).map((t,n)=>{const o=P(t.w);return{id:z("M2P-item"),index:n+1,parts:[q[o.cho],ee[o.jung]],answer:t.w,word:t.w}})}function Xn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong>0&&!Be[t.jong]);return te(u,e.count??10).map((t,n)=>{const o=P(t.w);return{id:z("M3P-item"),index:n+1,parts:[q[o.cho],ee[o.jung],Q[o.jong]],answer:t.w,word:t.w}})}function Zn(e){const u=Gu.DROP_FINAL_CONSONANT_FROM_1SYLL,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const r=Tn(l.w,null,n);if(!r)continue;const[a,...i]=r.distractors;o.push({id:z("DFC-item"),index:o.length+1,original:l.w,word:l.w,result:a,distractors:i})}return o}function Qn(e){const u=Gu.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const r=jn(l.w,null,n);if(!r)continue;const a=P(n.get(l.w)||l.w);if(!a)continue;const[i,...f]=r.distractors;o.push({id:z("RCP-item"),index:o.length+1,base:l.w,word:l.w,missingConsonant:q[a.cho],remaining:i,distractors:f})}return o}const qe=new Map;let tt=null,nt=null;async function ot(e,u={}){const t=Ge(),n=be();(t!==tt||n!==nt)&&(qe.clear(),tt=t,nt=n);const o=`${e}:${Zu(u)}`;if(qe.has(o))return qe.get(o);const l=await uo(e,u);return qe.set(o,l),l}const eo={SAME_SOUND_PICK:e=>Qu("SSP",e),HEAR_AND_PICK_SAME:e=>Qu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>xn(e),SAME_OR_DIFF:e=>Pn(e),STARTS_WITH_SAME_SOUND:e=>Fn(e),LISTEN_AND_REMEMBER_ORDER:e=>zn(e),MERGE_2_SYLLABLES:e=>Yn(e),MERGE_3_SYLLABLES:e=>Un(e),MERGE_2_PHONEMES:e=>Jn(e),MERGE_3_PHONEMES:e=>Xn(e),DROP_1_FROM_2SYLL:e=>Kn(e),DROP_1_FROM_3SYLL:e=>Wn(e),DROP_PART_FROM_COMPOUND:e=>qn(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Zn(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Qn(e),CHANGE_1_SYLL_IN_2SYLL:e=>Vn(e),CHANGE_1_SYLL_IN_3SYLL:e=>Hn(e),CHANGE_1_PHONEME_IN_1SYLL:e=>$n(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Gn(e)};async function uo(e,u={}){const t=eo[e];return t?await t(u):[]}async function to(e){const u=[null,"count"],t=Object.keys(au);let n=0;for(const o of u)for(const l of t){const r=au[l];ot(l,{difficulty:r.difficulty?o:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++n%6===0&&await new Promise(a=>setTimeout(a,0))}}async function no(e){return(await Z({...e,fullCount:!0})).length}async function oo(e={}){const u=[];for(const a of ue)a.w&&u.push(a.w);const t=e.excludeNoImage?Oe(u):u,n=new Set,o=new Set,l=new Set,r=new Set;for(const a of t){r.add(Ve(a));for(const i of a){const f=P(i);if(f&&(q[f.cho]!=="\u3147"&&n.add(q[f.cho]),o.add(ee[f.jung]),f.jong>0)){l.add(Q[f.jong]);const h=Be[f.jong];h&&h.forEach(C=>l.add(C))}}}return{cho:n,jung:o,jong:l,syllable:r}}const ge="\uC804\uCCB4";function lt(){const{t:e}=ce.useTranslation();return s.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function rt(e,u,t){return{label:u.difficulty,items:[1,2,3,4].map(n=>e("wordSearch.filter.grade",{n})),multiple:!0,allOption:!0,allLabel:t?.allLabel,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function at(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function st(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function lo(e,u){return{label:u.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),u.syllable5plus],multiple:!0,allOption:!0}}function ro(e,u){const t=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return u?.includeStructure&&t.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:t,multiple:!0,labelAction:u?.labelAction,labelInfo:u?.labelInfo}}function ao(e,u){const{label:t,headValue:n,midValue:o,tailValue:l,includeMid:r=!0,headDisabled:a,midDisabled:i,tailDisabled:f,allOptionDisabled:h,groupLabel:C,labelAction:c}=u;return{label:t,...C?{groupLabel:C}:{},...c?{labelAction:c}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...h?{allOptionDisabled:h}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:a},...r?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:i}]:[],{value:l,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:f}]}}function so(e,u,t){if(u===ge){const{[t]:l,...r}=e;return r}const n=e[t]??[],o=n.includes(u)?n.filter(l=>l!==u):[...n,u];if(o.length===0){const{[t]:l,...r}=e;return r}return{...e,[t]:o}}Object.fromEntries(Object.entries(En).map(([e,{nucleus:u}])=>[e,u]));const io={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},co={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},Co={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:co,typeMap:io};function fo(e,u,t=Co){const n=u[t.difficulty];if(n?.length&&!n.some(a=>e.grade===a.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const a=e.syllables??0;if(!o.some(i=>i===t.syllable5plus?a>=5:a===parseInt(i)))return!1}const l=u[t.partOfSpeech];if(l?.length&&!l.flatMap(a=>t.posMap[a]??[a]).some(a=>(e.pos??"").includes(a)))return!1;const r=u[t.wordType];return!(r?.length&&!r.some(a=>e.wordType===t.typeMap[a]))}const go={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},ho={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},mo={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function it(e,u){if("place"in u)return go[u.place](e);const t=ho[u.vowel](e);return u.glide?`${t} \xB7 ${mo[u.glide](e)}`:t}const po=(e,{defaultValue:u})=>u,ct=(e,u)=>({jamos:e,phonetic:u,tooltip:it(po,u)}),re=(e,u)=>u.map(t=>ct([t],{place:e})),W=(e,u,t)=>ct([...e],t?{vowel:u,glide:t}:{vowel:u}),gu={cho:[re("labial",["\u3142","\u3143","\u314D","\u3141"]),re("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),re("alveolar",["\u3145","\u3146"]),re("palatal",["\u3148","\u3149","\u314A"]),re("velar",["\u3131","\u3132","\u314B"]),re("glottal",["\u314E"])],jung:[[W("\u3163","frontHigh"),W("\u315F","frontHigh","w"),W("\u3162","frontHigh","velar")],[W("\u3161","backHighUnrounded")],[W("\u315C","backHighRounded"),W("\u3160","backHighRounded","j")],[W("\u3154\u3150","frontMid"),W("\u3156\u3152","frontMid","j"),W("\u3159\u315A\u315E","frontMid","w")],[W("\u3153","backMidUnrounded"),W("\u3155","backMidUnrounded","j"),W("\u315D","backMidUnrounded","w")],[W("\u3157","backMidRounded"),W("\u315B","backMidRounded","j")],[W("\u314F","low"),W("\u3151","low","j"),W("\u3158","low","w")]],jong:[re("labial",["\u3142","\u3141"]),re("alveolar",["\u3137","\u3134","\u3139"]),re("velar",["\u3131","\u3147"])]},So=[...q],Eo=[...ee],yo=Q.filter(e=>e!==""),ae=e=>e===ne?[]:Array.from(e),ne="__NO_CODA__",Ct=[1,2,3,4],oe=5,Bo=12,dt="SYL_",hu=e=>`${dt}${e}`,wo=e=>Number(e.slice(dt.length));function mu(e){return e>=oe?Array.from({length:Bo-oe+1},(u,t)=>oe+t):[e]}const ft={cho:So,jung:Eo,jong:yo},pu=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),Su={cho:pu(gu.cho),jung:pu(gu.jung),jong:pu(gu.jong)},gt={};Su.jung.flat().forEach(({v:e})=>{for(const u of ae(e))gt[u]=e});const bo=new Set(Su.cho.flat().map(e=>e.v));function ht(e,u){return e==="cho"?bo.has(u)?u:null:e==="jung"?gt[u]??u:Yu(u)}function mt(e,u,t){if(e==="jung"){const n=ae(u);return t&&n.includes(t)?t:n[0]??u}return u}function pt(e,u,t){const n=(o,l)=>l?o==="jong"&&l===ne?ne:u==="pron"?ht(o,l):mt(o,l,o==="jung"?t:null):null;return{...e,cho:n("cho",e.cho),jung:n("jung",e.jung),jong:n("jong",e.jong)}}const Eu={cho:null,jung:null,jong:null,syllable:null},Ao="wt_filter",St=e=>`wt_filter_${e}`;function Et(e){try{const u=localStorage.getItem(St(e))??localStorage.getItem(Ao);if(u)return JSON.parse(u)}catch{}return null}function yt(e){const u=e?.phonemeView;return u==="pron"?"pron":u==="direct"?"direct":"char"}function _o(e){const u=e;return u?.composition?{cho:u.composition.cho??null,jung:u.composition.jung??null,jong:u.composition.jong??null,syllable:u.composition.syllable??null}:u?.choseong?{...Eu,cho:u.choseong}:Eu}function Do(e,u,t){const{t:n,i18n:o}=ce.useTranslation(),[l]=s.useState(()=>t?.resetOnMount?null:Et(e)),[r,a]=s.useState(yt(l)),[i,f]=s.useState(()=>_o(l)),h=s.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:ne,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?ne:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);s.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||f(p=>p.cho||p.jung||p.syllable!=null||p.jong?p:h())},[]);const C=s.useMemo(()=>K(i.cho)||K(i.jung)||K(i.jong)?"count":"random",[i.cho,i.jung,i.jong]),c=s.useRef(r==="char"?i.jung:null);s.useEffect(()=>{r==="char"&&(c.current=i.jung)},[r,i.jung]);const[d,m]=s.useState(t?.resetOnMount?!!t?.defaultImageOnly:l?.excludeNoImage??!0),[y,S]=s.useState(t?.resetOnMount?!1:l?.sameStructureOnly??!0),[g,E]=s.useState(Array.isArray(l?.gradeFilter)?l.gradeFilter:[]),[w,A]=s.useState(Array.isArray(l?.posFilter)?l.posFilter:[]),[_,b]=s.useState(Array.isArray(l?.wordTypeFilter)?l.wordTypeFilter:[]),L=s.useRef(t?.resetKey);s.useEffect(()=>{L.current!==t?.resetKey&&(L.current=t?.resetKey,f(h()),m(!1),S(!1),E([]),A([]),b([]))},[t?.resetKey]);const T=lt(),[v,R]=s.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[V,$]=s.useState(!1),[Y,I]=s.useState(null),M=1,F=Math.max(1,[i.cho,i.jung,i.jong].filter(Boolean).length),[J,se]=s.useState(e);s.useEffect(()=>{if(J!==e){if(!t?.resetOnMount){const p=Et(e);f(p?.composition??h()),m(p?.excludeNoImage??!0),S(p?.sameStructureOnly??!0),a(yt(p)),E(Array.isArray(p?.gradeFilter)?p.gradeFilter:[]),A(Array.isArray(p?.posFilter)?p.posFilter:[]),b(Array.isArray(p?.wordTypeFilter)?p.wordTypeFilter:[])}se(e)}},[e,J,t?.resetOnMount]),s.useEffect(()=>{if(!t?.resetOnMount&&J===e)try{localStorage.setItem(St(e),JSON.stringify({contrastCount:F,composition:i,excludeNoImage:d,sameStructureOnly:y,phonemeView:r,gradeFilter:g,posFilter:w,wordTypeFilter:_}))}catch{}},[t?.resetOnMount,e,J,F,i,d,y,r,g,w,_]);const[ie,B]=s.useState(0);ju("wordpool:update",()=>B(p=>p+1));const D=s.useRef(o.language);s.useEffect(()=>{D.current!==o.language&&(D.current=o.language,B(p=>p+1))},[o.language]),s.useEffect(()=>{if(!u.choseong)return;let p=!1;return oo({difficulty:C,excludeNoImage:d}).then(j=>{p||(R(j),j.cho.size+j.jung.size+j.jong.size>0&&$(!0))}).catch(()=>{p||R({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{p=!0}},[u.choseong,C,d,ie]),s.useEffect(()=>{let p=!1;const j=i,N=j.cho?ae(j.cho):null,k=j.jung?ae(j.jung):null,U=j.jong===ne,he=U?null:j.jong?ae(j.jong):null,me=j.syllable!=null?mu(j.syllable):null,Pe=!!(N||k||he||U||me);return no({difficulty:u.difficulty?C:null,contrastCount:u.difficulty?F:1,composition:u.choseong&&Pe?{cho:N,jung:k,jong:he,jongNone:U,syllable:me}:null,excludeNoImage:d,sameStructureOnly:y,phonemeView:r==="pron"?"pron":"char",grade:g.length>0?g:null}).then(Fe=>{p||I(Fe)}).catch(()=>{p||I(null)}),()=>{p=!0}},[u.choseong,u.difficulty,C,F,i,r,d,y,ie,g]),s.useEffect(()=>{V&&f(p=>{const j={...p};let N=!1;return["cho","jung","jong"].forEach(k=>{const U=p[k];!U||U===ne||ae(U).some(he=>v[k].has(he))||(j[k]=null,N=!0)}),p.syllable!=null&&u.fixedSyllable==null&&(p.syllable>=oe?[...v.syllable].some(k=>k>=oe)||(j.syllable=null,N=!0):(!v.syllable.has(p.syllable)||p.syllable<M)&&(j.syllable=null,N=!0)),N?j:p})},[v,V,M,u.fixedSyllable]);const G=s.useMemo(()=>{const p=j=>{const N=new Set;for(const k of ft[j])v[j].has(k)&&N.add(k);return N};return{cho:p("cho"),jung:p("jung"),jong:p("jong")}},[v]),H=s.useMemo(()=>({exact:new Set(Ct.filter(p=>v.syllable.has(p))),min:[...v.syllable].some(p=>p>=oe)}),[v]),O=s.useMemo(()=>({composition:n("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:n("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:n("wordPairs.onset","\uCD08\uC131"),vowel:n("wordPairs.vowel","\uBAA8\uC74C"),coda:n("wordPairs.coda","\uC885\uC131"),phonemeGroup:n("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:n("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:n("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:n("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:n("training.filter.random","\uBB34\uC791\uC704"),exclude:n("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:n("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:n("common.none","\uC5C6\uC74C"),noImage:n("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:n("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:n("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:n("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:n("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:n("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[n]),Au=s.useMemo(()=>({[O.trainOnset]:"cho",[O.trainVowel]:"jung",[O.trainCoda]:"jong"}),[O]),xe=s.useCallback((p,j)=>({title:j,items:p}),[]),tu=s.useMemo(()=>[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[n]),Dt=s.useMemo(()=>{const p=[];if(u.choseong){const j={value:ne,displayLabel:O.codaExclude},N=u.fixedNoCoda===!0,k=(U,he)=>{const me=N&&U==="jong",Pe={label:he,groupLabel:O.phonemeGroup,allOption:!u.requireSyllable,allLabel:O.noLimit,allOptionDisabled:me};if(r==="pron"){const pe=Su[U].map(Lt=>Lt.map(({v:nu,phonetic:Mt})=>{const ou=ae(nu),_u=it(n,Mt),Du=me||!ou.some(kt=>v[U].has(kt));return ou.length>1?{value:nu,labels:ou,tooltip:_u,disabled:Du}:{value:nu,tooltip:_u,disabled:Du}}));return U==="jong"&&!u.requireCoda&&pe.unshift([j]),{...Pe,groups:pe}}const Fe=ft[U].map(pe=>!me&&G[U].has(pe)?pe:{value:pe,disabled:!0});return{...Pe,items:U==="jong"&&!u.requireCoda?[j,...Fe]:Fe}};p.push(k("cho",O.trainOnset)),p.push(k("jung",O.trainVowel)),p.push(k("jong",O.trainCoda))}if(p.push({...rt(n,T,{labelInfo:xe([n("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:O.gradeLabel}),u.partOfSpeech&&p.push(at(T)),u.wordType&&p.push(st(T)),u.choseong||u.fixedSyllable!=null){const j=u.fixedSyllable;p.push({label:O.syllableCount,items:[...Ct.map(N=>({value:hu(N),displayLabel:n("wordPairs.syllableN",{n:N,defaultValue:"{{n}}\uC74C\uC808"}),disabled:j!=null?N!==j:!H.exact.has(N)||N<M})),{value:hu(oe),displayLabel:n("wordPairs.syllableNPlus",{n:oe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:j!=null?oe!==j:!H.min}],allOption:!0,allOptionDisabled:j!=null})}return u.choseong?p.push({label:O.exclude,displayLabel:O.selectLabel,multiple:!0,items:[O.excludeImage,O.sameStructure],labelInfo:xe(tu)}):p.push({label:O.exclude,displayLabel:O.selectLabel,multiple:!0,items:[O.excludeImage],labelInfo:xe([tu[0]])}),p},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,M,G,v,r,H,O,n,xe,tu,T]),Ot={...(u.choseong||u.fixedSyllable!=null)&&i.syllable!=null?{[O.syllableCount]:hu(i.syllable)}:{},...u.choseong&&i.cho?{[O.trainOnset]:i.cho}:{},...u.choseong&&i.jung?{[O.trainVowel]:i.jung}:{},...u.choseong&&i.jong?{[O.trainCoda]:i.jong}:{},[O.exclude]:[...d?[O.excludeImage]:[],...y?[O.sameStructure]:[]],[O.gradeLabel]:g.map(p=>n("wordSearch.filter.grade",{n:Number(p),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[T.partOfSpeech]:w}:{},...u.wordType?{[T.wordType]:_}:{}},Nt=s.useCallback((p,j)=>{if(j===O.exclude)p===O.excludeImage?m(N=>!N):p===O.sameStructure&&S(N=>!N);else if(j===O.syllableCount)f(N=>{if(!p||p===ge)return{...N,syllable:null};const k=wo(p);return{...N,syllable:N.syllable===k?null:k}});else if(j===O.gradeLabel){if(!p||p===ge){E([]);return}const N=p.replace(/\D/g,"");E(k=>k.includes(N)?k.filter(U=>U!==N):[...k,N])}else if(j===T.partOfSpeech){if(!p||p===ge){A([]);return}A(N=>N.includes(p)?N.filter(k=>k!==p):[...N,p])}else if(j===T.wordType){if(!p||p===ge){b([]);return}b(N=>N.includes(p)?N.filter(k=>k!==p):[...N,p])}else{const N=Au[j];if(!N)return;f(k=>u.requireSyllable?p&&p!==ge?{...k,[N]:p}:k:!p||p===ge||k[N]===p?{...k,[N]:null}:{...k,[N]:p})}},[O,Au,T,u.requireSyllable]),Tt=s.useCallback(p=>!u.partOfSpeech&&!u.wordType?!0:fo(p,{...u.partOfSpeech?{[T.partOfSpeech]:w}:{},...u.wordType?{[T.wordType]:_}:{}},T),[u.partOfSpeech,u.wordType,w,_,T]),jt=s.useCallback(p=>{p!==r&&(p!=="direct"&&r!=="direct"&&f(j=>pt(j,p,c.current)),a(p))},[r]),It=s.useCallback(()=>({composition:i,contrastCount:F,excludeNoImage:d,sameStructureOnly:y,phonemeView:r,gradeFilter:g,posFilter:w,wordTypeFilter:_}),[i,F,d,y,r,g,w,_]),Rt=s.useCallback(p=>{f(p.composition),m(p.excludeNoImage),S(p.sameStructureOnly??!0),a(p.phonemeView),E(Array.isArray(p.gradeFilter)?p.gradeFilter:[]),Array.isArray(p.posFilter)&&A(p.posFilter),Array.isArray(p.wordTypeFilter)&&b(p.wordTypeFilter)},[]);return{difficulty:C,contrastCount:F,composition:i,choseong:i.cho,excludeNoImage:d,sameStructureOnly:y,gradeFilter:g,posFilter:w,wordTypeFilter:_,matchesWordAttributes:Tt,poolVersion:ie,filterSections:Dt,filterSelected:Ot,handleFilterSelect:Nt,phonemeView:r,setPhonemeView:jt,phonemeGroupLabel:O.phonemeGroup,wordCount:Y,getFilterSnapshot:It,restoreFilterSnapshot:Rt}}function Oo(e){const u=a=>a?ae(a):null,t=u(e.cho),n=u(e.jung),o=e.jong===ne,l=o?null:u(e.jong),r=e.syllable!=null?mu(e.syllable):null;return!t&&!n&&!l&&!o&&!r?null:{cho:t,jung:n,jong:l,jongNone:o,syllable:r}}function No(e,u,t,n,o,l,r=!0,a="char",i=[]){const[f,h]=s.useState({}),[C,c]=s.useState(!1),{cho:d=null,jung:m=null,jong:y=null,syllable:S=null}=n??{},g=i.length>0?i.slice().sort().join(","):"";return s.useEffect(()=>{l>0&&to(o).catch(()=>{})},[l,o]),s.useEffect(()=>{let E=!1;return c(!0),(async()=>{const w=Oo({cho:d,jung:m,jong:y,syllable:S}),A=`${d??""}_${m??""}_${y??""}_${S??""}_${g}`,_={};await Promise.all(e.map(async b=>{const L=au[b.key];try{const T=await ot(b.key,{difficulty:L.difficulty?u:null,contrastCount:L.difficulty?t:1,composition:L.choseong?w:null,count:5,excludeNoImage:o,sameStructureOnly:r,phonemeView:a,grade:i.length>0?i:null});T&&T.length>0?_[b.key]={id:`wt-${b.key}-${u}-${A}-${Date.now()}`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:T,itemCount:T.length}:_[b.key]={id:`wt-${b.key}-empty`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:[],itemCount:0,__empty:!0}}catch{_[b.key]=null}})),E||(h(_),c(!1))})(),()=>{E=!0}},[u,t,d,m,y,S,o,r,a,l,g]),{perTypeData:f,generating:C}}function To(){return ze(new Date)}function ze(e){if(e==null||e==="")return"";const u=e instanceof Date?e:new Date(e);return isNaN(u.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(u)}const Te=[],je=[],Ie=[],Re=[],Je={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Xe={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},jo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let yu=null,Bt=null,de=null;function Io({counts:e,forceRefresh:u}={}){const t=Object.assign({},jo,e||{}),n=To(),o=ze(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),l=JSON.stringify(t);if(!u&&Bt===n&&yu===l&&de)return Object.assign(Je,de.today),Object.assign(Xe,de.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Je,yesterday:Xe};const r={LISTEN_IN_NOISE:le(Te,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:le(je,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:le(Ie,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:le(Re,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let a=null;return de&&yu===l&&de.yesterday&&de.yesterday.date===o&&(a=de.yesterday.selection),a||(a={LISTEN_IN_NOISE:le(Te,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:le(je,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:le(Ie,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:le(Re,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Je,r),Object.assign(Xe,a),Bt=n,yu=l,de={today:r,yesterday:{date:o,countsKey:l,selection:a}},{today:Je,yesterday:Xe}}let wt=!1,Le=null;async function Ro(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:lu&&lu.tagName.toUpperCase()==="SCRIPT"&&lu.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",u=await fetch(`${e}data/allTrainingData.json`);return u.ok?await u.json():null}catch{return null}}async function Lo(){if(!wt)return Le||(Le=(async()=>{const e=await Ro();if(!e){Le=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const u of Object.keys(e||{})){const t=e[u]||[];for(const n of t){const o=n,l=String(o.training_type||u),r=String(o.category_main_code||o.category_main||o.category_0||""),a=String(o.category_sub_code||o.category_sub||o.category_1||""),i=Object.assign({},o,{training_type:l,category_0:r,category_1:a});l==="LISTEN_IN_NOISE"?Te.push(i):l==="SHORT_STORY"?je.push(i):l==="LONG_STORY"?Ie.push(i):l==="ORDERING_SENTENCE"&&Re.push(i)}}}catch{Le=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{Io()}catch{}wt=!0})(),Le)}async function Mo(e=3e3){const u=Lo();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function ko(e){let u=2166136261;for(let t=0;t<e.length;t++)u^=e.charCodeAt(t),u=Math.imul(u,16777619);return u>>>0}function vo(e){let u=e>>>0;return()=>{u|=0,u=u+1831565813|0;let t=Math.imul(u^u>>>15,1|u);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const Ze=le;function Bu(e,u){const t=u?vo(ko(u)):Math.random;return{LISTEN_IN_NOISE:Ze(Te,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:Ze(je,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:Ze(Ie,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:Ze(Re,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function bt(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const xo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function At(e=!1,u=xo,t){const n=ze(Date.now()),o=ze(Date.now()-864e5),l=`${t??""}|${n}`,r=`${t??""}|${o}`;return Te.length>0||je.length>0||Ie.length>0||Re.length>0?{today:Bu(u,l),yesterday:Bu(u,r)}:{today:Bu(u,l),yesterday:null}}function Po(e){const u=s.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=s.useRef(null),[n,o]=s.useState(!1),[l,r]=s.useState(!1),[a,i]=s.useState(0),[f,h]=s.useState(!1);s.useEffect(()=>{let c=!1,d,m=0;const y=40,S=()=>{d!==void 0&&(clearInterval(d),d=void 0)};let g=!1;try{const A=new URLSearchParams(window.location.search),_=A.get("forceRefresh")||A.get("force");g=_==="1"||_==="true"}catch{}const E=A=>{u.current=A.today,t.current=A.yesterday,o(!0),h(!0),i(_=>_+1),c=!0,S()},w=async()=>{if(c)return;if(!g){const _=At(!1,void 0,e);if(bt(_.today)){E(_);return}}try{await Mo(3e3)}catch{}if(c)return;const A=At(g,void 0,e);if(bt(A.today)){E(A);return}++m>=y&&(o(!0),h(!1),c=!0,S())};return w(),d=setInterval(w,250),()=>{c=!0,S()}},[e]);const C=s.useCallback(c=>{const d=l?t.current:u.current,m=l?u.current:t.current;return d?.[c]?.length?d[c]:m?.[c]?.length?m[c]:void 0},[l,a]);return{loaded:n,hasData:f,showYesterday:l,setShowYesterday:r,getTrainingPerType:C}}const ye=[];let Qe=!1;function _t(e){if(e.key!=="Escape"||e.defaultPrevented)return;const u=ye[ye.length-1];u&&(e.stopPropagation(),u())}function Fo(e){return ye.push(e),!Qe&&typeof document<"u"&&(document.addEventListener("keydown",_t),Qe=!0),()=>{const u=ye.lastIndexOf(e);u>=0&&ye.splice(u,1),ye.length===0&&Qe&&typeof document<"u"&&(document.removeEventListener("keydown",_t),Qe=!1)}}function Vo(e,u=!0){const t=Tu(e);s.useEffect(()=>{if(u)return Fo(()=>{t.current?.()})},[u,t])}const wu=(e,u)=>`${e}:${u??1}`,bu=new Map;function Ho(e,u){const[t,n]=s.useState(0),o=e.map(l=>wu(l.word,l.homonum)).join("|");return s.useEffect(()=>{const l=(o?o.split("|"):[]).filter(i=>!bu.has(i));if(l.length===0)return;let r=!1;const a=Array.from(new Set(l.map(i=>i.slice(0,i.lastIndexOf(":")))));return u(a).then(i=>{if(!(r||i.length===0)){for(const f of i)f.Meaning&&bu.set(wu(f.Word,f.Homonum??void 0),f.Meaning);n(f=>f+1)}}).catch(()=>{}),()=>{r=!0}},[o,u]),s.useMemo(()=>{const l=o?o.split("|"):[],r=new Map;for(const a of l){const i=bu.get(a);i!=null&&r.set(a,i)}return r},[o,t])}function $o(){const[e,u]=s.useState(null),t=s.useCallback(l=>u(l.getBoundingClientRect()),[]),n=s.useCallback(()=>u(null),[]),o=s.useCallback(l=>{const r=l.getBoundingClientRect();u(a=>a?null:r)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function Go(e){const[u,t]=s.useState(null),[n,o]=s.useState(null),l=s.useRef(null);s.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const r=s.useCallback((i,f)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t(i),o(f)},e)},[e]),a=s.useCallback(()=>{l.current&&clearTimeout(l.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:r,close:a}}function Yo(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),l=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:s.useMemo(()=>e.slice((l-1)*n,l*n),[e,l,n]),totalPages:o,curPage:l}}function Uo(e="warning"){const[u,t]=s.useState(""),[n,o]=s.useState(e),[l,r]=s.useState(0),a=s.useCallback((C,c)=>{o(c),t(C),r(d=>d+1)},[]),i=s.useCallback(C=>a(C,"warning"),[a]),f=s.useCallback(C=>a(C,"normal"),[a]),h=s.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:l,showToast:a,showWarning:i,showNormal:f,clearToast:h}}const Ko=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],Wo={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function qo(e){return Ko.map(u=>{const t=Wo[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const Me={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},ke=Me.blue,eu=Me.green,ve=Me.amber,uu=Me.purple,zo=Me.pink,Jo=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:ke,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:ke,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:ke,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:ke,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:ke,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:eu,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:eu,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:eu,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:eu,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:ve,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:ve,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:ve,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:ve,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:ve,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:uu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:uu,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:uu,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:uu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:zo,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xo(){const{t:e}=ce.useTranslation();return s.useMemo(()=>{const u=Object.fromEntries(qo(e).map(n=>[n.key,n.label])),t={...u};return Jo.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const Zo="0.131.0";function Qo({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,l]=s.useState(!1),[r,a]=s.useState({}),i=s.useRef(null),f=s.useRef(null),h=s.useCallback(()=>{i.current&&a(e(i.current.getBoundingClientRect()))},[e]);s.useEffect(()=>{if(!o)return;h();const d=g=>{const E=g.target;n&&E.closest?.(n)||i.current?.contains(E)||f.current?.contains(E)||l(!1)};document.addEventListener("mousedown",d);const m=g=>{f.current?.contains(g.target)||(u==="reposition"?h():u==="close"&&l(!1))};u!=="ignore"&&window.addEventListener("scroll",m,!0);const y=()=>{t==="reposition"?h():t==="close"&&l(!1)};t!=="ignore"&&window.addEventListener("resize",y);const S=g=>{g.key==="Escape"&&l(!1)};return document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",d),u!=="ignore"&&window.removeEventListener("scroll",m,!0),t!=="ignore"&&window.removeEventListener("resize",y),document.removeEventListener("keydown",S)}},[o,h,u,t,n]);const C=s.useCallback(()=>l(d=>!d),[]),c=s.useCallback(()=>l(!1),[]);return{open:o,setOpen:l,toggle:C,close:c,style:r,triggerRef:i,menuRef:f}}function el(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:l=1100,feedbackMs:r=1500}={}){const[a,i]=s.useState([]),[f,h]=s.useState(0),[C,c]=s.useState("idle"),[d,m]=s.useState(null),[y,S]=s.useState([]),[g,E]=s.useState(null),[w,A]=s.useState(0),_=s.useRef(0),b=s.useCallback(B=>{_.current=typeof B=="function"?B(_.current):B,A(_.current)},[]),L=s.useRef(n),T=s.useRef(o);s.useEffect(()=>{L.current=n,T.current=o},[n,o]);const v=s.useRef([]),R=()=>{v.current.forEach(clearTimeout),v.current=[]},V=(B,D)=>{v.current.push(setTimeout(D,B))};s.useEffect(()=>()=>R(),[]);const $=a[f]?.id??null,Y=s.useCallback(()=>{R(),c("playing"),S([]),E(null),b(0);let B=0;e.forEach((D,G)=>{V(B,()=>{h(G),m(D.id),L.current?.(D)}),V(B+1e3,()=>{m(null),S(H=>[...H,D.id])}),B+=1300}),V(B,()=>{c("done"),T.current?.({score:0,total:e.length})})},[e,b]),I=s.useCallback((B,D)=>{if(D>=B.length){c("done"),T.current?.({score:_.current,total:B.length});return}h(D),E(null),c("playing"),m(B[D].id),L.current?.(B[D]),V(l,()=>{m(null),c("waiting")})},[l]),M=s.useCallback(()=>{R();const B=x(e);i(B),b(0),S([]),I(B,0)},[e,I,b]),F=s.useCallback(()=>{u==="playback"?(i(e),Y()):M()},[u,e,Y,M]),J=s.useCallback(()=>{R(),c("idle"),m(null),S([]),E(null),h(0),b(0),i([])},[b]);s.useEffect(()=>{t?F():J()},[u,e.length,t]);const se=s.useCallback(B=>{C!=="waiting"||u==="playback"||(E(B),B===a[f]?.id&&b(D=>D+1),u==="exam"?(c("playing"),V(400,()=>I(a,f+1))):(c("feedback"),V(r,()=>I(a,f+1))))},[C,u,a,f,I,r,b]),ie=u==="playback"?e.length:a.length;return{bind:{activeSpeakerId:d,playedIds:y,selectedId:g,answerId:$,showFeedback:C==="feedback",clickable:C==="waiting",onSelectSpeaker:se},index:f,total:ie,score:w,phase:C,done:C==="done",start:F,reset:J}}exports.CACHE_GROUPS=Pu,exports.CORE_VERSION=Zo,exports.DocumentTitleSuppressContext=Ru,exports.EMPTY_COMPOSITION=Eu,exports.MediaQueryOverrideContext=Nu,exports.NO_CODA=ne,exports.SYLLABLE_MIN=oe,exports.VAP_PAGE_SIZE_OPTIONS=$e,exports.buildGradeSection=rt,exports.buildPartOfSpeechSection=at,exports.buildPositionSection=ao,exports.buildSelectSection=ro,exports.buildSyllableSection=lo,exports.buildWordTypeSection=st,exports.charToPronValue=ht,exports.convertComposition=pt,exports.fmtBytes=on,exports.lsBytes=Fu,exports.meaningKey=wu,exports.pronToCharValue=mt,exports.syllableToFilter=mu,exports.today=Ae,exports.toggleAttributeFilter=so,exports.useAnchoredMenu=Qo,exports.useCacheManagement=ln,exports.useDailyTrainingSelection=Po,exports.useDelayedHoverAnchor=Go,exports.useDeviceManagement=hn,exports.useDocumentTitle=Ft,exports.useEscToClose=Vo,exports.useFontScale=vt,exports.useHoverAnchor=$o,exports.useMediaQuery=Pt,exports.usePagedList=Yo,exports.usePasswordChange=Gt,exports.useRelativeDay=Vt,exports.useSoundCompassExam=el,exports.useTablePaging=fn,exports.useTableSort=gn,exports.useToastState=Uo,exports.useTrainingTypeLabels=Xo,exports.useVisitAllPanel=dn,exports.useVisitHistory=sn,exports.useVisitSchedule=Cn,exports.useWindowEvent=ju,exports.useWordAttributeFilterKeys=lt,exports.useWordDataStats=rn,exports.useWordMeanings=Ho,exports.useWordTrainingDataGeneration=No,exports.useWordTrainingFilter=Do,exports.valueToJamos=ae;
1
+ "use strict";var s=require("react"),ce=require("react-i18next"),Ou=require("i18next"),lu=typeof document<"u"?document.currentScript:null;function vt({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:l=1.4}={}){const r=S=>Math.max(t,Math.min(n,Number(S))),[a,i]=s.useState(()=>{try{const S=localStorage.getItem(e),g=S?Number(S):1;return Number.isFinite(g)?r(g):r(1)}catch{return 1}});s.useEffect(()=>{try{localStorage.setItem(e,String(a))}catch{}},[e,a]);const f=S=>{i(typeof S=="function"?g=>r(S(g)):r(S))},h=()=>f(S=>+(S+o).toFixed(6)),C=()=>f(S=>+(S-o).toFixed(6)),c=a<n-Number.EPSILON,d=a>t+Number.EPSILON,m=Math.round(u*a),y=Math.round(m*l);return{scale:a,setScale:f,increase:h,decrease:C,canIncrease:c,canDecrease:d,fontSize:m,lineHeight:y}}const Nu=s.createContext(null);function xt(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Pt(e){const u=s.useContext(Nu),t=l=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(l).matches,[n,o]=s.useState(t(e));return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const l=window.matchMedia(e),r=i=>o(i.matches),a=l;return a.addEventListener?a.addEventListener("change",r):a.addListener&&a.addListener(r),o(l.matches),()=>{a.removeEventListener?a.removeEventListener("change",r):a.removeListener&&a.removeListener(r)}},[e]),u&&typeof u.mobile=="boolean"&&xt(e)?u.mobile:n}function Tu(e){const u=s.useRef(e);return s.useEffect(()=>{u.current=e}),u}function ju(e,u){const t=Tu(u);s.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const ru=" \xB7 ",Iu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(ru)?e.split(ru).pop()??e:e})(),Ru=s.createContext(!1);function Ft(e){const u=s.useContext(Ru);s.useEffect(()=>{if(u||typeof e!="string"||!e)return;const t=document.title;return document.title=Iu?`${e}${ru}${Iu}`:e,()=>{document.title=t}},[e,u])}function Vt(){const{t:e}=ce.useTranslation();return s.useCallback(u=>{if(!u)return"";const t=new Date(u).getTime();if(Number.isNaN(t))return"";const n=Math.floor((Date.now()-t)/864e5);return n<=0?e("myHomework.relativeDay.today","\uC624\uB298"):n===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n})},[e])}const Ht=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",u=typeof Ou?.t=="function"?Ou.t("common.unknownError",{defaultValue:e}):void 0;return typeof u=="string"&&u?u:e};function $t(e,u){if(u===void 0&&(u=Ht()),e instanceof Error)return e.message||u;if(typeof e=="string")return e||u;if(e&&typeof e=="object"){const t=e;for(const n of[t.message,t.error_description,t.error])if(typeof n=="string"&&n)return n}return u}function Gt(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState({current:"",next:"",confirm:""}),[o,l]=s.useState(null),[r,a]=s.useState(!1),i=s.useRef(null);s.useEffect(()=>()=>{i.current!==null&&clearTimeout(i.current)},[]);const f=s.useCallback(()=>{n({current:"",next:"",confirm:""}),l(null)},[]),h=s.useCallback(async()=>{if(!t.current){l({type:"error",text:u("account.security.password.currentRequired","\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(!t.next){l({type:"error",text:u("account.security.password.newRequired","\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(t.next!==t.confirm){l({type:"error",text:u("account.security.password.mismatch","\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")});return}a(!0);let C;try{C=e?await e(t.current,t.next):null}catch(c){C=$t(c)}finally{a(!1)}if(C){l({type:"error",text:C});return}l({type:"success",text:u("account.security.password.changed","\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.")}),n({current:"",next:"",confirm:""}),i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>l(null),1500)},[t,e,u]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:l,pwLoading:r,handleChangePw:h,reset:f}}const q=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ee=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Q=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function P(e){if(!e)return null;const u=e.charCodeAt(0)-44032;return u<0||u>=11172?null:{cho:Math.floor(u/588),jung:Math.floor(u%588/28),jong:u%28}}function Yt(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>P(n)),e.set(u,t)),t}}function Ce(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function Ut(e,u){if(!e||!u||e===u||e.length!==u.length)return"random";let t=0,n=null;for(let o=0;o<e.length;o++){const l=P(e[o]),r=P(u[o]);if(!l||!r)return"random";if(l.cho===r.cho&&l.jung===r.jung&&l.jong===r.jong)continue;t++;const a=l.cho!==r.cho,i=l.jung!==r.jung,f=l.jong!==r.jong;(a?1:0)+(i?1:0)+(f?1:0)>1?n="multi":a?n="cho":i?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const Be={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]};Object.fromEntries(Object.entries(Be).map(([e,u])=>[u.join(""),Q[Number(e)]]));function Kt(e,u){if(!e||!u)return!1;for(const t of e){const n=P(t);if(n){if(q[n.cho]===u)return!0;if(n.jong>0){if(Q[n.jong]===u)return!0;const o=Be[n.jong];if(o&&o.includes(u))return!0}}}return!1}function Ve(e){if(!e)return 0;let u=0;for(const t of e)P(t)&&u++;return u}function Wt(e){if(!e)return!1;let u=!1;for(const t of e){const n=P(t);if(n&&(u=!0,n.jong>0))return!1}return u}function qt(e,u){if(e.jong<=0)return!1;if(u.includes(Q[e.jong]))return!0;const t=Be[e.jong];return!!t&&t.some(n=>u.includes(n))}function zt(e,u,t){if(!e)return!1;const n=[...e],o=l=>{const r=P(n[l]);if(!r||u.cho&&!u.cho.includes(q[r.cho])||u.jung&&!u.jung.includes(ee[r.jung]))return!1;if(u.jongNone){if(r.jong>0)return!1}else if(u.jong&&!qt(r,u.jong))return!1;return!0};if(t==="head")return o(0);if(t==="tail")return o(n.length-1);if(t==="mid"){for(let l=1;l<n.length-1;l++)if(o(l))return!0;return!1}for(let l=0;l<n.length;l++)if(o(l))return!0;return!1}const Jt={cho:q.length,jung:ee.length,jong:Q.length};function Xt(e,u,t,n,o=1/0){if(!e||t<1)return[];const l=[...e].map(C=>P(C));if(l.some(C=>!C))return[];const r=l,a=r.length;if(t>a)return[];const i=Jt[u],f=new Set,h=[];(function C(c,d){if(d.length===t){h.push([...d]);return}for(let m=c;m<a;m++)d.push(m),C(m+1,d),d.pop()})(0,[]);for(const C of h)if((function c(d,m){if(f.size>=o)return;if(d===C.length){const g=m.map(E=>Ce(E.cho,E.jung,E.jong)).join("");g!==e&&n.has(g)&&f.add(g);return}const y=C[d],S=r[y][u];for(let g=0;g<i;g++){if(g===S)continue;const E=m.slice();if(E[y]={...m[y],[u]:g},c(d+1,E),f.size>=o)return}})(0,r),f.size>=o)break;return[...f]}function Zt(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=P(e[n]),l=P(u[n]);if(!o||!l)return-1;o.cho!==l.cho&&t++,o.jung!==l.jung&&t++,o.jong!==l.jong&&t++}return t}const Lu="word_pair_index_v2",Mu="word_pair_index_sig_v2";let we=null;function Qt(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Lu),u=localStorage.getItem(Mu);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function be(){if(we)return we;const e=Qt();return e?(we=e.index,e.sig,we):null}function en(){we=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Lu),localStorage.removeItem(Mu))}catch{}}const ku="word_image_existence_map_v1";let Se=null;function vu(){if(Se)return Se;try{const e=typeof localStorage<"u"?localStorage.getItem(ku):null;Se=e?JSON.parse(e):{}}catch{Se={}}return Se}function un(e,u){return`${e}_${u??1}`}function tn(e,u){const t=vu(),n=un(e,u);return n in t?t[n]:void 0}function xu(){const e=vu(),u=Object.values(e);return u.length===0?null:{total:u.length,exists:u.filter(Boolean).length}}function nn(){Se={};try{typeof localStorage<"u"&&localStorage.removeItem(ku)}catch{}}const Pu=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function Fu(e){return e.reduce((u,t)=>{try{const n=localStorage.getItem(t);return u+(n?new Blob([n]).size:0)}catch{return u}},0)}function on(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function ln(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState({}),[o,l]=s.useState(null),[r,a]=s.useState(null),[i,f]=s.useState(null),h=s.useCallback(()=>{const c={};Pu.forEach(d=>{c[d.id]=Fu([...d.keys])}),n(c),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(d=>{f({usage:d.usage??0,quota:d.quota??0})}).catch(()=>{})},[]);s.useEffect(()=>{h()},[h]);const C=s.useCallback(async c=>{l(c);try{c==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):c==="pairIndex"?en():c==="imageCache"&&nn(),h(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{l(null)}},[h,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:r,setConfirmCacheId:a,storageEstimate:i,refreshCacheSizes:h,handleClearCache:C}}function rn(e){const[u,t]=s.useState(null),[n,o]=s.useState(null),l=s.useCallback(()=>{const r=be();if(r){const i=Object.values(r),f=i.filter(h=>h.cho.length+h.jung.length+h.jong.length>0).length;t({matched:f,total:i.length})}else t(null);const a=xu();o(a?{exists:a.exists,total:a.total}:null)},[]);return s.useEffect(()=>{l();const r=setTimeout(l,1e3);return()=>clearTimeout(r)},[e?.length,l]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:l}}function Vu(e,u=[]){const[t,n]=s.useState(u),[o,l]=s.useState(null),[r,a]=s.useState(!1),[i,f]=s.useState(e),h=s.useRef(r);s.useEffect(()=>{h.current=r});const C=s.useRef(null);s.useEffect(()=>{if(h.current)return;const g=C.current;g!==null&&g.length===u.length&&g.every((E,w)=>E===u[w])||(C.current=u,n(u))},[u]);const c=s.useCallback(g=>{l(g),a(!1),f({...g})},[]),d=s.useCallback(()=>a(!0),[]),m=s.useCallback(()=>a(!1),[]),y=s.useCallback((g,E)=>{n(g),l(E),a(!1)},[]),S=s.useCallback(g=>{n(E=>E.filter(w=>w!==g)),l(null)},[]);return{list:t,setList:n,selected:o,setSelected:l,isEditing:r,setIsEditing:a,editForm:i,setEditForm:f,openDetail:c,startEditing:d,cancelEditing:m,commitEdit:y,remove:S}}const Ae=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},an={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function sn(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:l,setIsEditing:r,editForm:a,setEditForm:i,openDetail:f,commitEdit:h}=Vu(an,e),{year:C,month:c,day:d}=Ae(),[m,y]=s.useState({year:C,month:c,day:d,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:m,setVisitForm:y,setVisit:S=>g=>y(E=>({...E,[S]:g})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:l,setIsEditingVisit:r,editVisitForm:a,setEditVisitForm:i,openVisitDetail:f,handleVisitSave:S=>{t(A=>[m,...A]);const{year:g,month:E,day:w}=Ae();y({year:g,month:E,day:w,hour:"09",minute:"00",memo:""}),S?.()},handleVisitEditSave:()=>{h(S=>S.map(g=>g===n?a:g),a)},addVisit:S=>{t(g=>[S,...g])},removeVisit:S=>{t(g=>g.filter(E=>E!==S))},revertVisitEdit:(S,g)=>{t(E=>E.map(w=>w===g?S:w)),o(E=>E===g?S:E)}}}const Hu=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,He=e=>[...e].sort((u,t)=>{const n=Hu(u),o=Hu(t);return n<o?-1:n>o?1:0}),cn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Cn(e,u=[]){const t=s.useMemo(()=>He(u),[u]),{list:n,setList:o,selected:l,setSelected:r,isEditing:a,setIsEditing:i,editForm:f,setEditForm:h,openDetail:C,commitEdit:c,remove:d}=Vu(cn,t),[m,y]=s.useState([]),{year:S,month:g,day:E}=Ae(),[w,A]=s.useState({year:S,month:g,day:E,hour:"09",minute:"00",memo:""}),_=I=>M=>A(F=>({...F,[I]:M})),b=I=>{o(se=>He([...se,w]));const{year:M,month:F,day:J}=Ae();A({year:M,month:F,day:J,hour:"09",minute:"00",memo:""}),I?.()},L=()=>{c(I=>He(I.map(M=>M===l?f:M)),f)},T=s.useCallback(I=>{d(I)},[d]),v=s.useCallback(I=>{e({year:I.year,month:I.month,day:I.day,hour:I.hour,minute:I.minute,memo:I.memo}),d(I)},[e,d]),R=s.useCallback(I=>{o(M=>M.filter(F=>F!==I)),y(M=>[I,...M]),r(null)},[o,r]),V=s.useCallback(I=>{o(M=>He([...M,I]))},[o]),$=s.useCallback(I=>{o(M=>M.filter(F=>F!==I))},[o]),Y=s.useCallback((I,M)=>{o(F=>F.map(J=>J===M?I:J)),r(F=>F===M?I:F)},[o,r]);return{scheduleList:n,noShowList:m,addSchedule:V,removeSchedule:$,revertScheduleEdit:Y,scheduleForm:w,setScheduleForm:A,setSchedule:_,selectedSchedule:l,setSelectedSchedule:r,isEditingSchedule:a,setIsEditingSchedule:i,editScheduleForm:f,setEditScheduleForm:h,openScheduleDetail:C,handleScheduleSave:b,handleScheduleEditSave:L,handleScheduleDelete:T,handleScheduleToVisit:v,handleScheduleNoVisit:R}}const $e=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function dn(e){const{t:u}=ce.useTranslation(),[t,n]=s.useState(""),[o,l]=s.useState("25"),[r,a]=s.useState("all"),[i,f]=s.useState(1),h=s.useMemo(()=>e.filter(({item:y,status:S})=>!(t&&!y.memo.includes(t)||r!=="all"&&S!==r)),[e,t,r]),C=Math.max(1,Math.ceil(h.length/Number(o))),c=Math.min(i,C),d=s.useMemo(()=>h.slice((c-1)*Number(o),c*Number(o)),[h,c,o]),m=s.useMemo(()=>$e.map(y=>({...y,label:u("common.pageSizeLabel",{n:y.value,defaultValue:y.label})})),[u]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:l,vapPageSizeOptions:m,vapStatus:r,setVapStatus:a,vapPage:c,setVapPage:f,vapFiltered:h,vapTotal:C,vapPageItems:d}}function fn(e,u,t){const{t:n}=ce.useTranslation(),[o,l]=s.useState(()=>{const m=t?.initialPageSize;return m&&$e.some(y=>y.value===m)?m:"25"}),[r,a]=s.useState(1),[i,f]=s.useState(u);i!==u&&(f(u),r!==1&&a(1));const h=s.useMemo(()=>$e.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),C=s.useCallback(m=>{l(m),a(1)},[]),c=Math.max(1,Math.ceil(e.length/Number(o))),d=Math.min(r,c);return{pageRows:s.useMemo(()=>e.slice((d-1)*Number(o),d*Number(o)),[e,d,o]),pageSizeProps:{options:h,value:o,onChange:C},paginationProps:{page:d,total:c,onChange:a},setPage:a}}function gn(){const[e,u]=s.useState(null),t=s.useCallback(o=>{u(l=>l?.key===o?{key:o,asc:!l.asc}:{key:o,asc:!0})},[]),n=s.useCallback((o,l)=>({label:o,sortDir:e?.key===l?e.asc?"asc":"desc":null,onClick:()=>t(l)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}const $u=e=>e==="\uC88C"||e==="\uC6B0"?e:null;function hn(){const[e,u]=s.useState(!1),[t,n]=s.useState("\uC88C"),[o,l]=s.useState({\uC88C:null,\uC6B0:null}),[r,a]=s.useState({\uC88C:[],\uC6B0:[]}),[i,f]=s.useState(!1),[h,C]=s.useState("\uC88C"),c=s.useCallback(m=>{const y=$u(m.direction);y&&(l(S=>({...S,[y]:m})),a(S=>({...S,[y]:[m,...S[y]]})),u(!1))},[]),d=s.useCallback(m=>{const y=$u(m.direction);y&&(l(S=>({...S,[y]:m})),f(!1))},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:l,deviceHistory:r,setDeviceHistory:a,showDeviceList:i,setShowDeviceList:f,listForSide:h,setListForSide:C,handleDeviceSubmit:c,handleSelectFromList:d}}const mn="__ihab_core_word_pool__";function Ge(){return globalThis[mn]??null}function x(e,u=Math.random){const t=e.slice();for(let n=t.length-1;n>0;n--){const o=Math.floor(u()*(n+1));[t[n],t[o]]=[t[o],t[n]]}return t}function le(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?x(e,t):x(e,t).slice(0,u)}const au={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}},pn=q.indexOf("\u3147"),Gu={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==pn},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0}},Sn={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"},En={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function Yu(e){return Sn[e]??e}const su={cho:q,jung:ee,jong:Q},K=e=>Array.isArray(e)?e.length>0:!!e;function iu(e,u){if(e.length!==u.length)return!1;for(let t=0;t<e.length;t++){const n=e[t],o=u[t];if(!(!n||!o)&&(n.cho!==o.cho&&q[n.cho]==="\u3147"!=(q[o.cho]==="\u3147")||n.jong!==o.jong&&n.jong===0!=(o.jong===0)))return!0}return!1}function yn(e,u,t){const n=t.pronOf(e),o=t.decompOf,l=t.sameStructureOnly&&o?o(n):null,r=[];for(const a of u)a!==e&&(t.okSet&&!t.okSet.has(a)||t.pronOf(a)!==n&&(l&&o&&iu(l,o(t.pronOf(a)))||r.push(a)));return r}function Uu(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return yn(e,o,t)}function Bn(e,u,t,n,o,l,r){const a=["cho","jung","jong"].filter(c=>K(e[c])),i={};for(const c of a){const d=e[c];i[c]=new Set(Array.isArray(d)?d:[d])}const f=o==="pron",h=new Map;for(const c of u){const d=t(l(c));if(d.some(g=>!g))continue;let m=d;if(!f&&(m=t(c),m.length!==d.length||m.some(g=>!g)))continue;const y=d.length,S=h.get(y);S?S.push({w:c,dPron:d,dPos:m}):h.set(y,[{w:c,dPron:d,dPos:m}])}const C=new Map;for(const[c,d]of h){const m=new Map,y=(S,g)=>{const E=S.dPos[g];return E!=null&&a.every(w=>i[w].has(su[w][E[w]]))};for(const S of d){let g;if(r==="head")g=y(S,0)?0:-1;else if(r==="tail")g=y(S,c-1)?c-1:-1;else if(r==="mid"){g=-1;for(let w=1;w<c-1;w++)if(y(S,w)){g=w;break}}else g=S.dPos.findIndex(w=>w!=null&&a.every(A=>i[A].has(su[A][w[A]])));if(g<0)continue;const E=m.get(g);E?E.push(S):m.set(g,[S])}for(const[S,g]of m){const E=new Set(a.map(_=>S+":"+_)),w=_=>{let b="";for(let L=0;L<c;L++){const T=_[L];for(const v of["cho","jung","jong"])b+=(E.has(L+":"+v)?"*":T[v])+"."}return b},A=new Map;for(const _ of d){const b=w(_.dPron),L=A.get(b);L?L.push(_):A.set(b,[_])}for(const _ of g){const b=A.get(w(_.dPron))??[],L=[];for(const T of b){if(T.w===_.w)continue;let v=!0;for(const R of a){const V=_.dPron[S][R],$=T.dPron[S][R];if($===V){v=!1;break}if(f&&i[R].has(su[R][$])){v=!1;break}}v&&(n&&iu(_.dPron,T.dPron)||L.push(T.w))}C.set(_.w,L)}}}return C}const wn=e=>e==null?[]:Array.isArray(e)?e:[e];function bn(e){if([...e].length!==1)return"";const u=P(e);if(!u)return"";const t=Yu(Q[u.jong]),n=t===""?0:Q.indexOf(t);return Ce(u.cho,u.jung,n<0?0:n)}function Ku(e,u){return u.get(e)||bn(e)||e}function cu(e){return e?K(e.cho)?"cho":K(e.jung)?"jung":K(e.jong)?"jong":null:null}function Ee(e,u){const t=(n,o)=>!K(n)||wn(n).includes(o);return t(u.cho,q[e.cho])&&t(u.jung,ee[e.jung])&&t(u.jong,Q[e.jong])}function _e(e,u,t){const n=[...e];if(t!=="pron")return n.map(l=>P(l));const o=[...u.get(e)||e];return o.length!==n.length?n.map(l=>P(l)):o.map(l=>P(l))}function De(e,u,t,n,o){const l=u==="cho"?q:u==="jung"?ee:Q,r=e[u],a=[],i=C=>u==="jung"?_n(Ku(C,o)):Ku(C,o),f=new Map([[i(t),-1]]),h=x(l.map((C,c)=>c).filter(C=>C!==r&&(u!=="cho"||l[C]!=="\u3147")&&(u!=="jong"||C!==0)));for(const C of h){if(a.length>=n)break;const c=u==="cho"?Ce(C,e.jung,e.jong):u==="jung"?Ce(e.cho,C,e.jong):Ce(e.cho,e.jung,C),d=i(c),m=f.get(d);if(m!==void 0){u==="jung"&&m>=0&&o.has(c)&&!o.has(a[m])&&(a[m]=c);continue}f.set(d,a.length),a.push(c)}return a}const An={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function _n(e){if([...e].length!==1)return e;const u=P(e);if(!u)return e;const t=An[ee[u.jung]];return t?Ce(u.cho,ee.indexOf(t),u.jong):e}function Dn(e,u,t,n,o,l=null){const r=[...e];if(r.length!==2)return null;const a=r.map(C=>P(C));if(a.some(C=>!C))return null;const i=_e(e,t,n);if(i.some(C=>!C))return null;const f=cu(u);let h=f&&u?i.map((C,c)=>Ee(C,u)?c:-1).filter(C=>C>=0):[0,1];if(l!=null&&(h=h.filter(C=>C!==l)),!h.length)return null;for(const C of x(h)){const c=r[C];if(!o.has(c))continue;const d=De(a[C],f??"cho",c,40,t),m=[];for(const y of d)if(y!==c&&o.has(y)&&!m.includes(y)&&m.push(y),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[c,...m]}}return null}function On(e,u,t,n,o,l=null){const r=[...e];if(r.length!==3)return null;const a=r.map(C=>P(C));if(a.some(C=>!C))return null;const i=_e(e,t,n);if(i.some(C=>!C))return null;const f=cu(u),h=f&&u?i.map((C,c)=>Ee(C,u)?c:-1).filter(C=>C>=0):[0,1,2];if(!h.length)return null;for(const C of x(h))for(const c of x([0,1,2].filter(d=>d!==C&&(l==null||d===l)))){const d=[0,1,2].filter(E=>E!==c),m=d.map(E=>r[E]).join("");if(!o.has(m))continue;const y=d.indexOf(C),S=De(a[C],f??"cho",r[C],40,t),g=[];for(const E of S){const w=d.map(_=>r[_]);w[y]=E;const A=w.join("");if(A!==m&&o.has(A)&&!g.includes(A)&&g.push(A),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[m,...g]}}return null}function Nn(e,u,t,n,o,l=null){const r=[...e],a=r.length;if(a<2)return null;const i=[];for(let h=1;h<=a-1;h++)i.push({remain:r.slice(0,h).join(""),dropped:r.slice(h).join(""),droppedEnd:1}),i.push({remain:r.slice(a-h).join(""),dropped:r.slice(0,a-h).join(""),droppedEnd:0});const f=cu(u);for(const{remain:h,dropped:C,droppedEnd:c}of x(i)){if(l!=null&&c!==l||h===e||!o.has(h)||!o.has(C))continue;const d=[...h],m=d.map(g=>P(g));if(m.some(g=>!g))continue;const y=_e(h,t,n);if(y.some(g=>!g))continue;const S=f&&u?y.map((g,E)=>Ee(g,u)?E:-1).filter(g=>g>=0):d.map((g,E)=>E);if(S.length)for(const g of x(S)){const E=De(m[g],f??"cho",d[g],40,t),w=[];for(const A of E){const _=[...d];_[g]=A;const b=_.join("");if(b!==h&&o.has(b)&&!w.includes(b)&&w.push(b),w.length>=2)break}if(w.length>=2)return{question:e,distractors:[h,...w]}}}return null}function Tn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const r=P(t.get(e)||e);if(!r||r.jong===0)return null;const a=Ce(r.cho,r.jung,0),i=De({cho:r.cho,jung:r.jung,jong:0},"cho",a,2,t);return i.length<2?null:{question:e,distractors:[a,...i]}}const Cu=q.indexOf("\u3147");function jn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const r=P(t.get(e)||e);if(!r||r.jong!==0||r.cho===Cu)return null;const a=Ce(Cu,r.jung,0),i=De({cho:Cu,jung:r.jung,jong:0},"jung",a,2,t);return i.length<2?null:{question:e,distractors:[a,...i]}}function In(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let l=0;l<o;l++){let r=o+"|"+l+"|";for(let i=0;i<o;i++)r+=i===l?"*":n[i];const a=u.get(r);a?a.push(t):u.set(r,[t])}}return u}function Rn(e,u,t,n,o,l=null,r=null,a=2){const i=[...e],f=i.length;if(f<2||f>3)return null;const h=i.map(E=>P(E));if(h.some(E=>!E))return null;const C=_e(e,t,n);if(C.some(E=>!E))return null;const c=E=>t.get(E)??E,d=c(e),m=!!u&&(K(u.cho)||K(u.jung)||K(u.jong)),y=!!r&&(K(r.cho)||K(r.jung)||K(r.jong)),S=E=>{let w=f+"|"+E+"|";for(let A=0;A<f;A++)w+=A===E?"*":i[A];return w};let g;if(l!=null){if(l>=f||m&&!Ee(C[l],u))return null;g=[l]}else m?g=C.map((E,w)=>Ee(E,u)?w:-1).filter(E=>E>=0):g=Array.from({length:f},(E,w)=>w);for(const E of x(g)){const w=o.get(S(E))??[],A=[],_=[];for(const R of w){if(R===e)continue;const V=[...R].map(M=>P(M)),$=h[E],Y=V[E];if(!$||!Y)continue;let I=0;if($.cho!==Y.cho&&I++,$.jung!==Y.jung&&I++,$.jong!==Y.jong&&I++,!(I<a||c(R)===d))if(y){const M=_e(R,t,n)[E];M&&Ee(M,r)?A.push(R):_.push(R)}else A.push(R)}if(!A.length)continue;const b=x(A)[0],L=[],T=new Set([d,c(b)]),v=y?_:A.filter(R=>R!==b);for(const R of x(v)){const V=c(R);if(!T.has(V)&&(T.add(V),L.push(R),L.length>=2))break}if(!y&&L.length<2)for(const R of x(w)){if(R===e||R===b)continue;const V=c(R);if(!T.has(V)&&(T.add(V),L.push(R),L.length>=2))break}if(!(L.length<2))return{question:e,distractors:[b,...L]}}return null}let Ye=null,Wu=null,qu=null;function Ln(){const e=Ge();if(e&&e.entries.length>0){const u=be();if(Ye&&Wu===e&&qu===u)return Ye;const t=new Set,n=[];for(const o of e.entries)!o.word||t.has(o.word)||(t.add(o.word),n.push({w:o.word,s:o.syllables,p:u?.[o.word]?[...u[o.word].cho??[],...u[o.word].jung??[],...u[o.word].jong??[]]:[],pron:o.pronunciation||o.word,grade:o.grade}));return Ye=n,Wu=e,qu=u,Ye}return[]}const ue=new Proxy([],{get(e,u){const t=Ln(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Ue(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function te(e,u){if(u>=e.length)return x(e);if(u===0)return[];const t=e.slice();for(let n=0;n<u;n++){const o=n+Math.floor(Math.random()*(t.length-n)),l=t[n];t[n]=t[o],t[o]=l}return t.slice(0,u)}let du=null,zu=null;function fe(){const e=Ge();if(du&&zu===e)return du;const u=new Map;for(const t of ue)t.w&&u.set(t.w,t.pron);return du=u,zu=e,u}function X(e){return fe().get(e)||e}function fu(e,u,t=new Set){const n=[];for(const o of x(e)){if(n.length>=u)break;const l=X(o);t.has(l)||(t.add(l),n.push(o))}return n}let Mn=0;function z(e){return`${e}-rt-${++Mn}`}function Oe(e){const u=xu();if(!u||u.total===0){const n=new Set;for(const o of e)n.add(o);return n}const t=new Set;for(const n of e)tn(n)===!0&&t.add(n);return t}const Ke=new Map;let Ju=null,Xu=null;function Ne(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function Zu(e){const u=Ne(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${Ne(t.cho)}/${Ne(t.jung)}/${Ne(t.jong)}/${t.jongNone?"N":""}/${n}`:"",l=Ne(e.grade);return`${e.difficulty??""}|${u}|${o}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${l}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Z(e){const u=Ge(),t=be();(u!==Ju||t!==Xu)&&(Ke.clear(),Ju=u,Xu=t);const n=Zu(e);return Ke.has(n)||Ke.set(n,vn(e)),Ke.get(n)}function kn(e){if(!e)return null;const u=r=>r==null?null:Array.isArray(r)?r.length?r:null:[r],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,l=o?null:u(e.jong);return t||n||l||o?o&&!t&&!n&&!l?r=>Wt(r):r=>zt(r,{cho:t,jung:n,jong:l,jongNone:o}):null}async function vn(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:l=!1}=e,r=e.grade&&e.grade.length>0?new Set(e.grade):null,a=e.sameStructureOnly??!0,i=e.phonemeView==="pron"?"pron":"char",f=Math.max(1,e.contrastCount??1),h=u==="cho"||u==="jung"||u==="jong",C=h&&f>=2,c=u==="count",d=t?new Set(Array.isArray(t)?t:[t]):null,m=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,y=n?[kn(n),m?B=>m.has(Ve(B)):null].filter(B=>B!=null):[],S=u==="random"||u===null,g=S||c,E=S||C||c;let w=ue.filter(B=>!B.w||r&&(!B.grade||!r.has(B.grade))?!1:E?!0:Array.isArray(B.p)&&B.p.length>0);d&&(w=w.filter(B=>{for(const D of d)if(Kt(B.w,D))return!0;return!1})),y.length>0&&(w=w.filter(B=>{const D=i==="pron"?X(B.w):B.w;return y.every(G=>G(D))})),o&&(w=w.filter(B=>B.w[0]===o));let A;if(l){const B=new Set;for(const D of w)if(B.add(D.w),Array.isArray(D.p))for(const G of D.p)B.add(G);if(g)for(const D of ue)D.w&&B.add(D.w);A=Oe(B)}else{const B=new Set;for(const D of w)if(B.add(D.w),Array.isArray(D.p))for(const G of D.p)B.add(G);if(g)for(const D of ue)D.w&&B.add(D.w);A=B}let _=null;if(C){const B=new Set;for(const D of ue)D.w&&B.add(D.w);_=l?Oe(B):B}const b=w.filter(B=>A.has(B.w)),L=600,T=Array.from(A),v=T.length>L?te(T,L):T,R=c&&n!=null&&(K(n.cho)||K(n.jung)||K(n.jong)),V=2500,$=new Map;if(c&&!R&&f>=2){for(const B of T){const D=Ve(B),G=$.get(D);G?G.push(B):$.set(D,[B])}for(const[B,D]of $)D.length>V&&$.set(B,te(D,V))}const Y=Yt(),I=R?Bn(n,T,Y,a,i,X):null,M=500,F=1500,J=e.fullCount?b:u==="random"?b.length>M?te(b,M):b:b.length>F?te(b,F):b,se=be(),ie=[];for(const B of J){let D;const G=X(B.w);if(C)D=Xt(B.w,u,f,_,24).filter(H=>X(H)!==G);else if(c)R?D=(I.get(B.w)??[]).filter(H=>X(H)!==G):f<=1?D=Uu(B.w,se,{okSet:A,pronOf:X,decompOf:Y,sameStructureOnly:!1}):D=($.get(Ve(B.w))??[]).filter(H=>{if(H===B.w||X(H)===G)return!1;const O=Zt(B.w,H);return f>=5?O>=5:O===f});else if(S)D=v.filter(H=>H!==B.w&&H.length===B.w.length&&X(H)!==G);else{const H=u;D=Uu(B.w,se,{kind:H,okSet:A,pronOf:X,decompOf:Y,sameStructureOnly:!1}),D.length===0&&(D=(v.length>30?te(v,30):v).filter(O=>O!==B.w&&Ut(B.w,O)===u&&X(O)!==G))}if(a&&D.length>0&&(h||c&&!R)){const H=Y(X(B.w));D=D.filter(O=>!iu(H,Y(X(O))))}D.length!==0&&ie.push({word:B,usable:D})}return ie}async function Qu(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,l=(await Z(u)).filter(a=>a.usable.length>=o),r=[];for(const a of x(l)){if(r.length>=n)break;const i=fu(a.usable,o);if(i.length<o)continue;const f=x([a.word.w,...i]);r.push({id:z(e+"-item"),index:r.length+1,word:a.word.w,syllables:a.word.s,choices:f,answerIndex:f.indexOf(a.word.w)})}return r}async function xn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u)return[];const l=[],r=x([...o]);for(const a of r){if(l.length>=t)break;const i=a.word.w,f=[...a.word.pron||i],h=Ue(f);if(!h)continue;const C=o.filter(m=>m.word.w!==i&&m.word.s===a.word.s&&!(m.word.pron||m.word.w).includes(h)&&m.word.pron!==a.word.pron);if(C.length<n)continue;const c=fu(C.map(m=>m.word.w),n);if(c.length<n)continue;const d=x([i,...c]);l.push({id:z("HPI-item"),index:l.length+1,targetSyllable:h,word:i,choices:d,answerIndex:d.indexOf(i)})}return l}async function Pn(e){const{count:u=10}=e,t=(await Z(e)).filter(n=>n.usable.length>=1);return Array.from({length:u},(n,o)=>{const l=Ue(t);if(!l)return null;const r=o%2===0;let a;if(r)a=[l.word.w,l.word.w];else{const i=Ue(l.usable);a=Math.random()<.5?[l.word.w,i]:[i,l.word.w]}return{id:z("SOD-item"),index:o+1,word:l.word.w,pair:a,same:r}}).filter(n=>!!n)}async function Fn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u+1)return[];const l=o.map(c=>c.word.w),r=new Map(o.map(c=>[c.word.w,c.word.pron])),a=c=>(r.get(c)||c)[0]??"",i={};for(const c of o){const d=a(c.word.w);d&&(i[d]||(i[d]=[]),i[d].push(c.word.w))}const f=Object.entries(i).filter(([,c])=>c.length>=2).map(([c])=>c);if(f.length===0)return[];const h=[],C=x([...f]);for(let c=0;h.length<t&&c<t*4;c++){const d=C[c%C.length],m=i[d];if(m.length<2)continue;const y=x([...m]),S=y[0],g=y[1];if(!S||!g||S===g||(r.get(S)||S)===(r.get(g)||g))continue;const E=r.get(g)||g,w=l.filter(b=>a(b)!==d&&b!==S&&b!==g&&b.length===g.length&&(r.get(b)||b)!==E);if(w.length<n)continue;const A=fu(w,n);if(A.length<n)continue;const _=x([g,...A]);h.push({id:z("SWS-item"),index:h.length+1,sourceWord:S,targetSyllable:d,word:g,choices:_,answerIndex:_.indexOf(g)})}return h}function et(e,u,t){return te(e,u).map((n,o)=>{const l=Ue(n.usable)??"",r=[...n.word.w],a=[...l],i=r.findIndex((h,C)=>h!==a[C]),f=x(n.usable.filter(h=>h&&h!==l)).slice(0,2);return{id:z(t),index:o+1,word:n.word.w,original:n.word.w,changed:l,changedFrom:i>=0?r[i]:"",changedTo:i>=0?a[i]:"",distractors:f}})}async function ut(e,u,t){const{count:n=10}=u,o=fe(),l=ue.filter(d=>d.w&&d.s===e),r=u.excludeNoImage?Oe(l.map(d=>d.w)):null,a=r?l.filter(d=>r.has(d.w)):l,i=new Set(a.map(d=>d.w)),f=In(i),h=u.phonemeView??"char",C=u.composition??null,c=[];for(const d of x(a)){if(c.length>=n)break;const m=Rn(d.w,C,o,h,f,null,null);if(!m)continue;const y=m.distractors[0],S=[...d.w],g=[...y],E=S.findIndex((w,A)=>w!==g[A]);c.push({id:z(t),index:c.length+1,word:d.w,original:d.w,changed:y,changedFrom:E>=0?S[E]:"",changedTo:E>=0?g[E]:"",distractors:m.distractors.slice(1)})}return c}async function Vn(e){return ut(2,e,"CS2-item")}async function Hn(e){return ut(3,e,"CS3-item")}async function $n(e){const u=(await Z({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return et(u,e.count??10,"CP1-item")}async function Gn(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await Z({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return et(t,e.count??10,"CP2-item")}async function Yn(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===2);return te(t,u).map((n,o)=>({id:z("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Un(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===3);return te(t,u).map((n,o)=>({id:z("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Kn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s===2),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=Dn(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=[...a.word.w],c=C[0]===f?C[1]:C[0];r.push({id:z("D2-item"),index:r.length+1,original:a.word.w,word:a.word.w,dropped:c,missingResult:f,distractors:h})}return r}async function Wn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s===3),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=On(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=[...a.word.w];let c="";for(let d=0;d<C.length;d++)if(C.filter((m,y)=>y!==d).join("")===f){c=C[d];break}r.push({id:z("D3-item"),index:r.length+1,original:a.word.w,word:a.word.w,dropped:c,missingResult:f,distractors:h})}return r}async function qn(e){const{count:u=10}=e,t=(await Z({...e})).filter(a=>a.word.s>=2),n=fe(),o=new Set(ue.map(a=>a.w)),l=e.phonemeView??"char",r=[];for(const a of x(t)){if(r.length>=u)break;const i=Nn(a.word.w,e.composition??null,n,l,o);if(!i)continue;const[f,...h]=i.distractors,C=a.word.w,c=C.startsWith(f)?C.slice(f.length):C.endsWith(f)?C.slice(0,C.length-f.length):"";r.push({id:z("DPC-item"),index:r.length+1,original:C,word:C,dropped:c,missingResult:f,distractors:h})}return r}async function zn(e){const{count:u=10}=e,t=(await Z({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const l=te(t,3);return{id:z("LRO-item"),index:o+1,sequence:l,choices:x(l)}})}function We(e,u,t){const n=ue.filter(r=>r.w&&r.s===e),o=u?Oe(n.map(r=>r.w)):null,l=[];for(const r of n)if(!(o&&!o.has(r.w))){if(t){const a=P(r.w);if(!a||!t(a))continue}l.push(r)}return l}function Jn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong===0);return te(u,e.count??10).map((t,n)=>{const o=P(t.w);return{id:z("M2P-item"),index:n+1,parts:[q[o.cho],ee[o.jung]],answer:t.w,word:t.w}})}function Xn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong>0&&!Be[t.jong]);return te(u,e.count??10).map((t,n)=>{const o=P(t.w);return{id:z("M3P-item"),index:n+1,parts:[q[o.cho],ee[o.jung],Q[o.jong]],answer:t.w,word:t.w}})}function Zn(e){const u=Gu.DROP_FINAL_CONSONANT_FROM_1SYLL,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const r=Tn(l.w,null,n);if(!r)continue;const[a,...i]=r.distractors;o.push({id:z("DFC-item"),index:o.length+1,original:l.w,word:l.w,result:a,distractors:i})}return o}function Qn(e){const u=Gu.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const r=jn(l.w,null,n);if(!r)continue;const a=P(n.get(l.w)||l.w);if(!a)continue;const[i,...f]=r.distractors;o.push({id:z("RCP-item"),index:o.length+1,base:l.w,word:l.w,missingConsonant:q[a.cho],remaining:i,distractors:f})}return o}const qe=new Map;let tt=null,nt=null;async function ot(e,u={}){const t=Ge(),n=be();(t!==tt||n!==nt)&&(qe.clear(),tt=t,nt=n);const o=`${e}:${Zu(u)}`;if(qe.has(o))return qe.get(o);const l=await uo(e,u);return qe.set(o,l),l}const eo={SAME_SOUND_PICK:e=>Qu("SSP",e),HEAR_AND_PICK_SAME:e=>Qu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>xn(e),SAME_OR_DIFF:e=>Pn(e),STARTS_WITH_SAME_SOUND:e=>Fn(e),LISTEN_AND_REMEMBER_ORDER:e=>zn(e),MERGE_2_SYLLABLES:e=>Yn(e),MERGE_3_SYLLABLES:e=>Un(e),MERGE_2_PHONEMES:e=>Jn(e),MERGE_3_PHONEMES:e=>Xn(e),DROP_1_FROM_2SYLL:e=>Kn(e),DROP_1_FROM_3SYLL:e=>Wn(e),DROP_PART_FROM_COMPOUND:e=>qn(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Zn(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Qn(e),CHANGE_1_SYLL_IN_2SYLL:e=>Vn(e),CHANGE_1_SYLL_IN_3SYLL:e=>Hn(e),CHANGE_1_PHONEME_IN_1SYLL:e=>$n(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Gn(e)};async function uo(e,u={}){const t=eo[e];return t?await t(u):[]}async function to(e){const u=[null,"count"],t=Object.keys(au);let n=0;for(const o of u)for(const l of t){const r=au[l];ot(l,{difficulty:r.difficulty?o:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++n%6===0&&await new Promise(a=>setTimeout(a,0))}}async function no(e){return(await Z({...e,fullCount:!0})).length}async function oo(e={}){const u=[];for(const a of ue)a.w&&u.push(a.w);const t=e.excludeNoImage?Oe(u):u,n=new Set,o=new Set,l=new Set,r=new Set;for(const a of t){r.add(Ve(a));for(const i of a){const f=P(i);if(f&&(q[f.cho]!=="\u3147"&&n.add(q[f.cho]),o.add(ee[f.jung]),f.jong>0)){l.add(Q[f.jong]);const h=Be[f.jong];h&&h.forEach(C=>l.add(C))}}}return{cho:n,jung:o,jong:l,syllable:r}}const ge="\uC804\uCCB4";function lt(){const{t:e}=ce.useTranslation();return s.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function rt(e,u,t){return{label:u.difficulty,items:[1,2,3,4].map(n=>e("wordSearch.filter.grade",{n})),multiple:!0,allOption:!0,allLabel:t?.allLabel,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function at(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function st(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function lo(e,u){return{label:u.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),u.syllable5plus],multiple:!0,allOption:!0}}function ro(e,u){const t=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return u?.includeStructure&&t.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:t,multiple:!0,labelAction:u?.labelAction,labelInfo:u?.labelInfo}}function ao(e,u){const{label:t,headValue:n,midValue:o,tailValue:l,includeMid:r=!0,headDisabled:a,midDisabled:i,tailDisabled:f,allOptionDisabled:h,groupLabel:C,labelAction:c}=u;return{label:t,...C?{groupLabel:C}:{},...c?{labelAction:c}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...h?{allOptionDisabled:h}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:a},...r?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:i}]:[],{value:l,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:f}]}}function so(e,u,t){if(u===ge){const{[t]:l,...r}=e;return r}const n=e[t]??[],o=n.includes(u)?n.filter(l=>l!==u):[...n,u];if(o.length===0){const{[t]:l,...r}=e;return r}return{...e,[t]:o}}Object.fromEntries(Object.entries(En).map(([e,{nucleus:u}])=>[e,u]));const io={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},co={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},Co={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:co,typeMap:io};function fo(e,u,t=Co){const n=u[t.difficulty];if(n?.length&&!n.some(a=>e.grade===a.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const a=e.syllables??0;if(!o.some(i=>i===t.syllable5plus?a>=5:a===parseInt(i)))return!1}const l=u[t.partOfSpeech];if(l?.length&&!l.flatMap(a=>t.posMap[a]??[a]).some(a=>(e.pos??"").includes(a)))return!1;const r=u[t.wordType];return!(r?.length&&!r.some(a=>e.wordType===t.typeMap[a]))}const go={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},ho={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},mo={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function it(e,u){if("place"in u)return go[u.place](e);const t=ho[u.vowel](e);return u.glide?`${t} \xB7 ${mo[u.glide](e)}`:t}const po=(e,{defaultValue:u})=>u,ct=(e,u)=>({jamos:e,phonetic:u,tooltip:it(po,u)}),re=(e,u)=>u.map(t=>ct([t],{place:e})),W=(e,u,t)=>ct([...e],t?{vowel:u,glide:t}:{vowel:u}),gu={cho:[re("labial",["\u3142","\u3143","\u314D","\u3141"]),re("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),re("alveolar",["\u3145","\u3146"]),re("palatal",["\u3148","\u3149","\u314A"]),re("velar",["\u3131","\u3132","\u314B"]),re("glottal",["\u314E"])],jung:[[W("\u3163","frontHigh"),W("\u315F","frontHigh","w"),W("\u3162","frontHigh","velar")],[W("\u3161","backHighUnrounded")],[W("\u315C","backHighRounded"),W("\u3160","backHighRounded","j")],[W("\u3154\u3150","frontMid"),W("\u3156\u3152","frontMid","j"),W("\u3159\u315A\u315E","frontMid","w")],[W("\u3153","backMidUnrounded"),W("\u3155","backMidUnrounded","j"),W("\u315D","backMidUnrounded","w")],[W("\u3157","backMidRounded"),W("\u315B","backMidRounded","j")],[W("\u314F","low"),W("\u3151","low","j"),W("\u3158","low","w")]],jong:[re("labial",["\u3142","\u3141"]),re("alveolar",["\u3137","\u3134","\u3139"]),re("velar",["\u3131","\u3147"])]},So=[...q],Eo=[...ee],yo=Q.filter(e=>e!==""),ae=e=>e===ne?[]:Array.from(e),ne="__NO_CODA__",Ct=[1,2,3,4],oe=5,Bo=12,dt="SYL_",hu=e=>`${dt}${e}`,wo=e=>Number(e.slice(dt.length));function mu(e){return e>=oe?Array.from({length:Bo-oe+1},(u,t)=>oe+t):[e]}const ft={cho:So,jung:Eo,jong:yo},pu=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),Su={cho:pu(gu.cho),jung:pu(gu.jung),jong:pu(gu.jong)},gt={};Su.jung.flat().forEach(({v:e})=>{for(const u of ae(e))gt[u]=e});const bo=new Set(Su.cho.flat().map(e=>e.v));function ht(e,u){return e==="cho"?bo.has(u)?u:null:e==="jung"?gt[u]??u:Yu(u)}function mt(e,u,t){if(e==="jung"){const n=ae(u);return t&&n.includes(t)?t:n[0]??u}return u}function pt(e,u,t){const n=(o,l)=>l?o==="jong"&&l===ne?ne:u==="pron"?ht(o,l):mt(o,l,o==="jung"?t:null):null;return{...e,cho:n("cho",e.cho),jung:n("jung",e.jung),jong:n("jong",e.jong)}}const Eu={cho:null,jung:null,jong:null,syllable:null},Ao="wt_filter",St=e=>`wt_filter_${e}`;function Et(e){try{const u=localStorage.getItem(St(e))??localStorage.getItem(Ao);if(u)return JSON.parse(u)}catch{}return null}function yt(e){const u=e?.phonemeView;return u==="pron"?"pron":u==="direct"?"direct":"char"}function _o(e){const u=e;return u?.composition?{cho:u.composition.cho??null,jung:u.composition.jung??null,jong:u.composition.jong??null,syllable:u.composition.syllable??null}:u?.choseong?{...Eu,cho:u.choseong}:Eu}function Do(e,u,t){const{t:n,i18n:o}=ce.useTranslation(),[l]=s.useState(()=>t?.resetOnMount?null:Et(e)),[r,a]=s.useState(yt(l)),[i,f]=s.useState(()=>_o(l)),h=s.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:ne,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?ne:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);s.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||f(p=>p.cho||p.jung||p.syllable!=null||p.jong?p:h())},[]);const C=s.useMemo(()=>K(i.cho)||K(i.jung)||K(i.jong)?"count":"random",[i.cho,i.jung,i.jong]),c=s.useRef(r==="char"?i.jung:null);s.useEffect(()=>{r==="char"&&(c.current=i.jung)},[r,i.jung]);const[d,m]=s.useState(t?.resetOnMount?!!t?.defaultImageOnly:l?.excludeNoImage??!0),[y,S]=s.useState(t?.resetOnMount?!1:l?.sameStructureOnly??!0),[g,E]=s.useState(Array.isArray(l?.gradeFilter)?l.gradeFilter:[]),[w,A]=s.useState(Array.isArray(l?.posFilter)?l.posFilter:[]),[_,b]=s.useState(Array.isArray(l?.wordTypeFilter)?l.wordTypeFilter:[]),L=s.useRef(t?.resetKey);s.useEffect(()=>{L.current!==t?.resetKey&&(L.current=t?.resetKey,f(h()),m(!1),S(!1),E([]),A([]),b([]))},[t?.resetKey]);const T=lt(),[v,R]=s.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[V,$]=s.useState(!1),[Y,I]=s.useState(null),M=1,F=Math.max(1,[i.cho,i.jung,i.jong].filter(Boolean).length),[J,se]=s.useState(e);s.useEffect(()=>{if(J!==e){if(!t?.resetOnMount){const p=Et(e);f(p?.composition??h()),m(p?.excludeNoImage??!0),S(p?.sameStructureOnly??!0),a(yt(p)),E(Array.isArray(p?.gradeFilter)?p.gradeFilter:[]),A(Array.isArray(p?.posFilter)?p.posFilter:[]),b(Array.isArray(p?.wordTypeFilter)?p.wordTypeFilter:[])}se(e)}},[e,J,t?.resetOnMount]),s.useEffect(()=>{if(!t?.resetOnMount&&J===e)try{localStorage.setItem(St(e),JSON.stringify({contrastCount:F,composition:i,excludeNoImage:d,sameStructureOnly:y,phonemeView:r,gradeFilter:g,posFilter:w,wordTypeFilter:_}))}catch{}},[t?.resetOnMount,e,J,F,i,d,y,r,g,w,_]);const[ie,B]=s.useState(0);ju("wordpool:update",()=>B(p=>p+1));const D=s.useRef(o.language);s.useEffect(()=>{D.current!==o.language&&(D.current=o.language,B(p=>p+1))},[o.language]),s.useEffect(()=>{if(!u.choseong)return;let p=!1;return oo({difficulty:C,excludeNoImage:d}).then(j=>{p||(R(j),j.cho.size+j.jung.size+j.jong.size>0&&$(!0))}).catch(()=>{p||R({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{p=!0}},[u.choseong,C,d,ie]),s.useEffect(()=>{let p=!1;const j=i,N=j.cho?ae(j.cho):null,k=j.jung?ae(j.jung):null,U=j.jong===ne,he=U?null:j.jong?ae(j.jong):null,me=j.syllable!=null?mu(j.syllable):null,Pe=!!(N||k||he||U||me);return no({difficulty:u.difficulty?C:null,contrastCount:u.difficulty?F:1,composition:u.choseong&&Pe?{cho:N,jung:k,jong:he,jongNone:U,syllable:me}:null,excludeNoImage:d,sameStructureOnly:y,phonemeView:r==="pron"?"pron":"char",grade:g.length>0?g:null}).then(Fe=>{p||I(Fe)}).catch(()=>{p||I(null)}),()=>{p=!0}},[u.choseong,u.difficulty,C,F,i,r,d,y,ie,g]),s.useEffect(()=>{V&&f(p=>{const j={...p};let N=!1;return["cho","jung","jong"].forEach(k=>{const U=p[k];!U||U===ne||ae(U).some(he=>v[k].has(he))||(j[k]=null,N=!0)}),p.syllable!=null&&u.fixedSyllable==null&&(p.syllable>=oe?[...v.syllable].some(k=>k>=oe)||(j.syllable=null,N=!0):(!v.syllable.has(p.syllable)||p.syllable<M)&&(j.syllable=null,N=!0)),N?j:p})},[v,V,M,u.fixedSyllable]);const G=s.useMemo(()=>{const p=j=>{const N=new Set;for(const k of ft[j])v[j].has(k)&&N.add(k);return N};return{cho:p("cho"),jung:p("jung"),jong:p("jong")}},[v]),H=s.useMemo(()=>({exact:new Set(Ct.filter(p=>v.syllable.has(p))),min:[...v.syllable].some(p=>p>=oe)}),[v]),O=s.useMemo(()=>({composition:n("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:n("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:n("wordPairs.onset","\uCD08\uC131"),vowel:n("wordPairs.vowel","\uBAA8\uC74C"),coda:n("wordPairs.coda","\uC885\uC131"),phonemeGroup:n("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:n("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:n("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:n("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:n("training.filter.random","\uBB34\uC791\uC704"),exclude:n("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:n("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:n("common.none","\uC5C6\uC74C"),noImage:n("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:n("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:n("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:n("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:n("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:n("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[n]),Au=s.useMemo(()=>({[O.trainOnset]:"cho",[O.trainVowel]:"jung",[O.trainCoda]:"jong"}),[O]),xe=s.useCallback((p,j)=>({title:j,items:p}),[]),tu=s.useMemo(()=>[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[n]),Dt=s.useMemo(()=>{const p=[];if(u.choseong){const j={value:ne,displayLabel:O.codaExclude},N=u.fixedNoCoda===!0,k=(U,he)=>{const me=N&&U==="jong",Pe={label:he,groupLabel:O.phonemeGroup,allOption:!u.requireSyllable,allLabel:O.noLimit,allOptionDisabled:me};if(r==="pron"){const pe=Su[U].map(Lt=>Lt.map(({v:nu,phonetic:Mt})=>{const ou=ae(nu),_u=it(n,Mt),Du=me||!ou.some(kt=>v[U].has(kt));return ou.length>1?{value:nu,labels:ou,tooltip:_u,disabled:Du}:{value:nu,tooltip:_u,disabled:Du}}));return U==="jong"&&!u.requireCoda&&pe.unshift([j]),{...Pe,groups:pe}}const Fe=ft[U].map(pe=>!me&&G[U].has(pe)?pe:{value:pe,disabled:!0});return{...Pe,items:U==="jong"&&!u.requireCoda?[j,...Fe]:Fe}};p.push(k("cho",O.trainOnset)),p.push(k("jung",O.trainVowel)),p.push(k("jong",O.trainCoda))}if(p.push({...rt(n,T,{labelInfo:xe([n("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:O.gradeLabel}),u.partOfSpeech&&p.push(at(T)),u.wordType&&p.push(st(T)),u.choseong||u.fixedSyllable!=null){const j=u.fixedSyllable;p.push({label:O.syllableCount,items:[...Ct.map(N=>({value:hu(N),displayLabel:n("wordPairs.syllableN",{n:N,defaultValue:"{{n}}\uC74C\uC808"}),disabled:j!=null?N!==j:!H.exact.has(N)||N<M})),{value:hu(oe),displayLabel:n("wordPairs.syllableNPlus",{n:oe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:j!=null?oe!==j:!H.min}],allOption:!0,allOptionDisabled:j!=null})}return u.choseong?p.push({label:O.exclude,displayLabel:O.selectLabel,multiple:!0,items:[O.excludeImage,O.sameStructure],labelInfo:xe(tu)}):p.push({label:O.exclude,displayLabel:O.selectLabel,multiple:!0,items:[O.excludeImage],labelInfo:xe([tu[0]])}),p},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,M,G,v,r,H,O,n,xe,tu,T]),Ot={...(u.choseong||u.fixedSyllable!=null)&&i.syllable!=null?{[O.syllableCount]:hu(i.syllable)}:{},...u.choseong&&i.cho?{[O.trainOnset]:i.cho}:{},...u.choseong&&i.jung?{[O.trainVowel]:i.jung}:{},...u.choseong&&i.jong?{[O.trainCoda]:i.jong}:{},[O.exclude]:[...d?[O.excludeImage]:[],...y?[O.sameStructure]:[]],[O.gradeLabel]:g.map(p=>n("wordSearch.filter.grade",{n:Number(p),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[T.partOfSpeech]:w}:{},...u.wordType?{[T.wordType]:_}:{}},Nt=s.useCallback((p,j)=>{if(j===O.exclude)p===O.excludeImage?m(N=>!N):p===O.sameStructure&&S(N=>!N);else if(j===O.syllableCount)f(N=>{if(!p||p===ge)return{...N,syllable:null};const k=wo(p);return{...N,syllable:N.syllable===k?null:k}});else if(j===O.gradeLabel){if(!p||p===ge){E([]);return}const N=p.replace(/\D/g,"");E(k=>k.includes(N)?k.filter(U=>U!==N):[...k,N])}else if(j===T.partOfSpeech){if(!p||p===ge){A([]);return}A(N=>N.includes(p)?N.filter(k=>k!==p):[...N,p])}else if(j===T.wordType){if(!p||p===ge){b([]);return}b(N=>N.includes(p)?N.filter(k=>k!==p):[...N,p])}else{const N=Au[j];if(!N)return;f(k=>u.requireSyllable?p&&p!==ge?{...k,[N]:p}:k:!p||p===ge||k[N]===p?{...k,[N]:null}:{...k,[N]:p})}},[O,Au,T,u.requireSyllable]),Tt=s.useCallback(p=>!u.partOfSpeech&&!u.wordType?!0:fo(p,{...u.partOfSpeech?{[T.partOfSpeech]:w}:{},...u.wordType?{[T.wordType]:_}:{}},T),[u.partOfSpeech,u.wordType,w,_,T]),jt=s.useCallback(p=>{p!==r&&(p!=="direct"&&r!=="direct"&&f(j=>pt(j,p,c.current)),a(p))},[r]),It=s.useCallback(()=>({composition:i,contrastCount:F,excludeNoImage:d,sameStructureOnly:y,phonemeView:r,gradeFilter:g,posFilter:w,wordTypeFilter:_}),[i,F,d,y,r,g,w,_]),Rt=s.useCallback(p=>{f(p.composition),m(p.excludeNoImage),S(p.sameStructureOnly??!0),a(p.phonemeView),E(Array.isArray(p.gradeFilter)?p.gradeFilter:[]),Array.isArray(p.posFilter)&&A(p.posFilter),Array.isArray(p.wordTypeFilter)&&b(p.wordTypeFilter)},[]);return{difficulty:C,contrastCount:F,composition:i,choseong:i.cho,excludeNoImage:d,sameStructureOnly:y,gradeFilter:g,posFilter:w,wordTypeFilter:_,matchesWordAttributes:Tt,poolVersion:ie,filterSections:Dt,filterSelected:Ot,handleFilterSelect:Nt,phonemeView:r,setPhonemeView:jt,phonemeGroupLabel:O.phonemeGroup,wordCount:Y,getFilterSnapshot:It,restoreFilterSnapshot:Rt}}function Oo(e){const u=a=>a?ae(a):null,t=u(e.cho),n=u(e.jung),o=e.jong===ne,l=o?null:u(e.jong),r=e.syllable!=null?mu(e.syllable):null;return!t&&!n&&!l&&!o&&!r?null:{cho:t,jung:n,jong:l,jongNone:o,syllable:r}}function No(e,u,t,n,o,l,r=!0,a="char",i=[]){const[f,h]=s.useState({}),[C,c]=s.useState(!1),{cho:d=null,jung:m=null,jong:y=null,syllable:S=null}=n??{},g=i.length>0?i.slice().sort().join(","):"";return s.useEffect(()=>{l>0&&to(o).catch(()=>{})},[l,o]),s.useEffect(()=>{let E=!1;return c(!0),(async()=>{const w=Oo({cho:d,jung:m,jong:y,syllable:S}),A=`${d??""}_${m??""}_${y??""}_${S??""}_${g}`,_={};await Promise.all(e.map(async b=>{const L=au[b.key];try{const T=await ot(b.key,{difficulty:L.difficulty?u:null,contrastCount:L.difficulty?t:1,composition:L.choseong?w:null,count:5,excludeNoImage:o,sameStructureOnly:r,phonemeView:a,grade:i.length>0?i:null});T&&T.length>0?_[b.key]={id:`wt-${b.key}-${u}-${A}-${Date.now()}`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:T,itemCount:T.length}:_[b.key]={id:`wt-${b.key}-empty`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:[],itemCount:0,__empty:!0}}catch{_[b.key]=null}})),E||(h(_),c(!1))})(),()=>{E=!0}},[u,t,d,m,y,S,o,r,a,l,g]),{perTypeData:f,generating:C}}function To(){return ze(new Date)}function ze(e){if(e==null||e==="")return"";const u=e instanceof Date?e:new Date(e);return isNaN(u.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(u)}const Te=[],je=[],Ie=[],Re=[],Je={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Xe={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},jo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let yu=null,Bt=null,de=null;function Io({counts:e,forceRefresh:u}={}){const t=Object.assign({},jo,e||{}),n=To(),o=ze(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),l=JSON.stringify(t);if(!u&&Bt===n&&yu===l&&de)return Object.assign(Je,de.today),Object.assign(Xe,de.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Je,yesterday:Xe};const r={LISTEN_IN_NOISE:le(Te,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:le(je,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:le(Ie,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:le(Re,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let a=null;return de&&yu===l&&de.yesterday&&de.yesterday.date===o&&(a=de.yesterday.selection),a||(a={LISTEN_IN_NOISE:le(Te,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:le(je,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:le(Ie,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:le(Re,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Je,r),Object.assign(Xe,a),Bt=n,yu=l,de={today:r,yesterday:{date:o,countsKey:l,selection:a}},{today:Je,yesterday:Xe}}let wt=!1,Le=null;async function Ro(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:lu&&lu.tagName.toUpperCase()==="SCRIPT"&&lu.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",u=await fetch(`${e}data/allTrainingData.json`);return u.ok?await u.json():null}catch{return null}}async function Lo(){if(!wt)return Le||(Le=(async()=>{const e=await Ro();if(!e){Le=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const u of Object.keys(e||{})){const t=e[u]||[];for(const n of t){const o=n,l=String(o.training_type||u),r=String(o.category_main_code||o.category_main||o.category_0||""),a=String(o.category_sub_code||o.category_sub||o.category_1||""),i=Object.assign({},o,{training_type:l,category_0:r,category_1:a});l==="LISTEN_IN_NOISE"?Te.push(i):l==="SHORT_STORY"?je.push(i):l==="LONG_STORY"?Ie.push(i):l==="ORDERING_SENTENCE"&&Re.push(i)}}}catch{Le=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{Io()}catch{}wt=!0})(),Le)}async function Mo(e=3e3){const u=Lo();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function ko(e){let u=2166136261;for(let t=0;t<e.length;t++)u^=e.charCodeAt(t),u=Math.imul(u,16777619);return u>>>0}function vo(e){let u=e>>>0;return()=>{u|=0,u=u+1831565813|0;let t=Math.imul(u^u>>>15,1|u);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const Ze=le;function Bu(e,u){const t=u?vo(ko(u)):Math.random;return{LISTEN_IN_NOISE:Ze(Te,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:Ze(je,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:Ze(Ie,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:Ze(Re,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function bt(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const xo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function At(e=!1,u=xo,t){const n=ze(Date.now()),o=ze(Date.now()-864e5),l=`${t??""}|${n}`,r=`${t??""}|${o}`;return Te.length>0||je.length>0||Ie.length>0||Re.length>0?{today:Bu(u,l),yesterday:Bu(u,r)}:{today:Bu(u,l),yesterday:null}}function Po(e){const u=s.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=s.useRef(null),[n,o]=s.useState(!1),[l,r]=s.useState(!1),[a,i]=s.useState(0),[f,h]=s.useState(!1);s.useEffect(()=>{let c=!1,d,m=0;const y=40,S=()=>{d!==void 0&&(clearInterval(d),d=void 0)};let g=!1;try{const A=new URLSearchParams(window.location.search),_=A.get("forceRefresh")||A.get("force");g=_==="1"||_==="true"}catch{}const E=A=>{u.current=A.today,t.current=A.yesterday,o(!0),h(!0),i(_=>_+1),c=!0,S()},w=async()=>{if(c)return;if(!g){const _=At(!1,void 0,e);if(bt(_.today)){E(_);return}}try{await Mo(3e3)}catch{}if(c)return;const A=At(g,void 0,e);if(bt(A.today)){E(A);return}++m>=y&&(o(!0),h(!1),c=!0,S())};return w(),d=setInterval(w,250),()=>{c=!0,S()}},[e]);const C=s.useCallback(c=>{const d=l?t.current:u.current,m=l?u.current:t.current;return d?.[c]?.length?d[c]:m?.[c]?.length?m[c]:void 0},[l,a]);return{loaded:n,hasData:f,showYesterday:l,setShowYesterday:r,getTrainingPerType:C}}const ye=[];let Qe=!1;function _t(e){if(e.key!=="Escape"||e.defaultPrevented)return;const u=ye[ye.length-1];u&&(e.stopPropagation(),u())}function Fo(e){return ye.push(e),!Qe&&typeof document<"u"&&(document.addEventListener("keydown",_t),Qe=!0),()=>{const u=ye.lastIndexOf(e);u>=0&&ye.splice(u,1),ye.length===0&&Qe&&typeof document<"u"&&(document.removeEventListener("keydown",_t),Qe=!1)}}function Vo(e,u=!0){const t=Tu(e);s.useEffect(()=>{if(u)return Fo(()=>{t.current?.()})},[u,t])}const wu=(e,u)=>`${e}:${u??1}`,bu=new Map;function Ho(e,u){const[t,n]=s.useState(0),o=e.map(l=>wu(l.word,l.homonum)).join("|");return s.useEffect(()=>{const l=(o?o.split("|"):[]).filter(i=>!bu.has(i));if(l.length===0)return;let r=!1;const a=Array.from(new Set(l.map(i=>i.slice(0,i.lastIndexOf(":")))));return u(a).then(i=>{if(!(r||i.length===0)){for(const f of i)f.Meaning&&bu.set(wu(f.Word,f.Homonum??void 0),f.Meaning);n(f=>f+1)}}).catch(()=>{}),()=>{r=!0}},[o,u]),s.useMemo(()=>{const l=o?o.split("|"):[],r=new Map;for(const a of l){const i=bu.get(a);i!=null&&r.set(a,i)}return r},[o,t])}function $o(){const[e,u]=s.useState(null),t=s.useCallback(l=>u(l.getBoundingClientRect()),[]),n=s.useCallback(()=>u(null),[]),o=s.useCallback(l=>{const r=l.getBoundingClientRect();u(a=>a?null:r)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function Go(e){const[u,t]=s.useState(null),[n,o]=s.useState(null),l=s.useRef(null);s.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const r=s.useCallback((i,f)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t(i),o(f)},e)},[e]),a=s.useCallback(()=>{l.current&&clearTimeout(l.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:r,close:a}}function Yo(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),l=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:s.useMemo(()=>e.slice((l-1)*n,l*n),[e,l,n]),totalPages:o,curPage:l}}function Uo(e="warning"){const[u,t]=s.useState(""),[n,o]=s.useState(e),[l,r]=s.useState(0),a=s.useCallback((C,c)=>{o(c),t(C),r(d=>d+1)},[]),i=s.useCallback(C=>a(C,"warning"),[a]),f=s.useCallback(C=>a(C,"normal"),[a]),h=s.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:l,showToast:a,showWarning:i,showNormal:f,clearToast:h}}const Ko=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],Wo={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function qo(e){return Ko.map(u=>{const t=Wo[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const Me={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},ke=Me.blue,eu=Me.green,ve=Me.amber,uu=Me.purple,zo=Me.pink,Jo=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:ke,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:ke,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:ke,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:ke,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:ke,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:eu,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:eu,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:eu,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:eu,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:ve,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:ve,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:ve,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:ve,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:ve,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:uu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:uu,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:uu,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:uu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:zo,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xo(){const{t:e}=ce.useTranslation();return s.useMemo(()=>{const u=Object.fromEntries(qo(e).map(n=>[n.key,n.label])),t={...u};return Jo.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const Zo="0.132.0";function Qo({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,l]=s.useState(!1),[r,a]=s.useState({}),i=s.useRef(null),f=s.useRef(null),h=s.useCallback(()=>{i.current&&a(e(i.current.getBoundingClientRect()))},[e]);s.useEffect(()=>{if(!o)return;h();const d=g=>{const E=g.target;n&&E.closest?.(n)||i.current?.contains(E)||f.current?.contains(E)||l(!1)};document.addEventListener("mousedown",d);const m=g=>{f.current?.contains(g.target)||(u==="reposition"?h():u==="close"&&l(!1))};u!=="ignore"&&window.addEventListener("scroll",m,!0);const y=()=>{t==="reposition"?h():t==="close"&&l(!1)};t!=="ignore"&&window.addEventListener("resize",y);const S=g=>{g.key==="Escape"&&l(!1)};return document.addEventListener("keydown",S),()=>{document.removeEventListener("mousedown",d),u!=="ignore"&&window.removeEventListener("scroll",m,!0),t!=="ignore"&&window.removeEventListener("resize",y),document.removeEventListener("keydown",S)}},[o,h,u,t,n]);const C=s.useCallback(()=>l(d=>!d),[]),c=s.useCallback(()=>l(!1),[]);return{open:o,setOpen:l,toggle:C,close:c,style:r,triggerRef:i,menuRef:f}}function el(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:l=1100,feedbackMs:r=1500}={}){const[a,i]=s.useState([]),[f,h]=s.useState(0),[C,c]=s.useState("idle"),[d,m]=s.useState(null),[y,S]=s.useState([]),[g,E]=s.useState(null),[w,A]=s.useState(0),_=s.useRef(0),b=s.useCallback(B=>{_.current=typeof B=="function"?B(_.current):B,A(_.current)},[]),L=s.useRef(n),T=s.useRef(o);s.useEffect(()=>{L.current=n,T.current=o},[n,o]);const v=s.useRef([]),R=()=>{v.current.forEach(clearTimeout),v.current=[]},V=(B,D)=>{v.current.push(setTimeout(D,B))};s.useEffect(()=>()=>R(),[]);const $=a[f]?.id??null,Y=s.useCallback(()=>{R(),c("playing"),S([]),E(null),b(0);let B=0;e.forEach((D,G)=>{V(B,()=>{h(G),m(D.id),L.current?.(D)}),V(B+1e3,()=>{m(null),S(H=>[...H,D.id])}),B+=1300}),V(B,()=>{c("done"),T.current?.({score:0,total:e.length})})},[e,b]),I=s.useCallback((B,D)=>{if(D>=B.length){c("done"),T.current?.({score:_.current,total:B.length});return}h(D),E(null),c("playing"),m(B[D].id),L.current?.(B[D]),V(l,()=>{m(null),c("waiting")})},[l]),M=s.useCallback(()=>{R();const B=x(e);i(B),b(0),S([]),I(B,0)},[e,I,b]),F=s.useCallback(()=>{u==="playback"?(i(e),Y()):M()},[u,e,Y,M]),J=s.useCallback(()=>{R(),c("idle"),m(null),S([]),E(null),h(0),b(0),i([])},[b]);s.useEffect(()=>{t?F():J()},[u,e.length,t]);const se=s.useCallback(B=>{C!=="waiting"||u==="playback"||(E(B),B===a[f]?.id&&b(D=>D+1),u==="exam"?(c("playing"),V(400,()=>I(a,f+1))):(c("feedback"),V(r,()=>I(a,f+1))))},[C,u,a,f,I,r,b]),ie=u==="playback"?e.length:a.length;return{bind:{activeSpeakerId:d,playedIds:y,selectedId:g,answerId:$,showFeedback:C==="feedback",clickable:C==="waiting",onSelectSpeaker:se},index:f,total:ie,score:w,phase:C,done:C==="done",start:F,reset:J}}exports.CACHE_GROUPS=Pu,exports.CORE_VERSION=Zo,exports.DocumentTitleSuppressContext=Ru,exports.EMPTY_COMPOSITION=Eu,exports.MediaQueryOverrideContext=Nu,exports.NO_CODA=ne,exports.SYLLABLE_MIN=oe,exports.VAP_PAGE_SIZE_OPTIONS=$e,exports.buildGradeSection=rt,exports.buildPartOfSpeechSection=at,exports.buildPositionSection=ao,exports.buildSelectSection=ro,exports.buildSyllableSection=lo,exports.buildWordTypeSection=st,exports.charToPronValue=ht,exports.convertComposition=pt,exports.fmtBytes=on,exports.lsBytes=Fu,exports.meaningKey=wu,exports.pronToCharValue=mt,exports.syllableToFilter=mu,exports.today=Ae,exports.toggleAttributeFilter=so,exports.useAnchoredMenu=Qo,exports.useCacheManagement=ln,exports.useDailyTrainingSelection=Po,exports.useDelayedHoverAnchor=Go,exports.useDeviceManagement=hn,exports.useDocumentTitle=Ft,exports.useEscToClose=Vo,exports.useFontScale=vt,exports.useHoverAnchor=$o,exports.useMediaQuery=Pt,exports.usePagedList=Yo,exports.usePasswordChange=Gt,exports.useRelativeDay=Vt,exports.useSoundCompassExam=el,exports.useTablePaging=fn,exports.useTableSort=gn,exports.useToastState=Uo,exports.useTrainingTypeLabels=Xo,exports.useVisitAllPanel=dn,exports.useVisitHistory=sn,exports.useVisitSchedule=Cn,exports.useWindowEvent=ju,exports.useWordAttributeFilterKeys=lt,exports.useWordDataStats=rn,exports.useWordMeanings=Ho,exports.useWordTrainingDataGeneration=No,exports.useWordTrainingFilter=Do,exports.valueToJamos=ae;
package/dist/i18n.cjs.js CHANGED
@@ -2,4 +2,4 @@
2
2
  \uC2E0\uB8B0\uB97C \uC313\uACE0
3
3
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8",kakao:"KAKAO Talk \uC624\uD508\uCC44\uD305"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638"},z={trainingPhone:{topic:"\uD143\uBC2D\uAC00\uAFB8\uAE30",prev:"\uC774\uC804",next:"\uB2E4\uC74C",speed:"\uBE60\uB974\uAE30 3",noiseType:"\uC640\uAE00\uC640\uAE00",settings:"\uC124\uC815",start:{caption:"\uC544\uB798 \uD50C\uB808\uC774(\u25B6) \uBC84\uD2BC\uC744 \uB20C\uB7EC \uBB38\uC7A5\uC744 \uC798 \uB4E4\uC5B4\uBCF4\uC138\uC694. \uC798 \uB4E4\uC73C\uC2E0 \uB4A4 \uBB38\uC7A5\uC744 \uD655\uC778\uD558\uC138\uC694."},feedback:{caption:"\uC798 \uD0A4\uC6B4 \uBAA8\uC885\uC744 \uD143\uBC2D\uC5D0 \uC2EC\uACE0 \uBE44\uB2D0\uC744 \uC798 \uB36E\uC5B4 \uC90D\uB2C8\uB2E4."},done:{heardWell:"\uC798 \uB4E4\uB9B0 \uBB38\uC7A5",listenAgain:"\uD55C \uBC88 \uB354 \uB4E3\uAE30"}}},U={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},q={options:"\uD6C8\uB828 \uC635\uC158",difficulty:"\uB09C\uC774\uB3C4",exclude:"\uC81C\uC678",chosung:"\uCD08\uC131",excludeOptions:{none:"\uC5C6\uC74C",noImage:"\uC774\uBBF8\uC9C0 \uC5C6\uC74C"}},j={answer:"\uC815\uB2F5",distractor:"\uC624\uB2F5"},Q={phaseWordDownload:"\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC",phaseImageCheck:"\uC774\uBBF8\uC9C0 \uD655\uC778",phasePairAnalysis:"\uB2E8\uC5B4\uC30D \uBD84\uC11D",downloadingCount:"{{n}}\uAC1C \uB2E4\uC6B4\uB85C\uB4DC \uC911",checkingPage:"{{page}}\uD398\uC774\uC9C0 \uBAA9\uB85D \uD655\uC778 \uC911",imageCount:"{{done}} / {{total}}\uAC1C"},J={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},Z={ariaLabel:"\uC120\uD0DD \uD0ED"},X={ariaLabel:"\uD0ED"},ee={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},te={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},ae={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"},reason:{notLoggedIn:"\uB85C\uADF8\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},list:{title:"\uBC1B\uC740 \uC219\uC81C"},status:{expired:"\uB9CC\uB8CC\uB428",done:"\uC644\uB8CC {{count}}\uD68C \xB7 {{date}}",notDone:"\uBBF8\uC644\uB8CC"}},oe={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30",crossword:"\uAC00\uB85C\uC138\uB85C"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",count:"\uC804\uCCB4",done:"\uC644\uB8CC",remaining:"\uBBF8\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},filter:{countSuffix:" \uD6C8\uB828"},time:{countLabel:"{{n}}\uD68C \uD6C8\uB828",empty:"\uD6C8\uB828 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},daily:{title:"\uC624\uB298\uC758 \uB4E3\uAE30 \uAE30\uB85D",empty:"\uC644\uB8CC\uD55C \uD68C\uCC28\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},crossword:{title:"\uAC00\uB85C\uC138\uB85C\uD034\uC988",empty:"\uC644\uB8CC\uD55C \uB808\uBCA8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",trainingType:{LISTEN_IN_NOISE:"\uC18C\uC74C \uD558 \uBB38\uC7A5",SHORT_STORY:"\uC9E7\uC740 \uC774\uC57C\uAE30",LONG_STORY:"\uAE34 \uC774\uC57C\uAE30",ORDERING_SENTENCE:"\uBB38\uC7A5 \uC21C\uC11C\uD654"}},ne={publish:{descPlaceholder:"\uB9D0\uADC0\uC790\uB8CC\uC2E4\uC5D0 \uD45C\uC2DC\uD560 \uD55C \uC904 \uC124\uBA85 (\uC120\uD0DD)"},import:"\uB0B4 \uD6C8\uB828\uC5D0 \uAC00\uC838\uC624\uAE30",publisher:"\uAC8C\uC2DC\uC790",time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"},badge:{shared:"\uB9D0\uADC0\uC790\uB8CC\uC2E4"}},ie={manage:{unit:"\uAC74"}},re={cancelLabel:"\uCDE8\uC18C"},le={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},se={panelTitle:"\uD6C8\uB828 \uC624\uB2F5",viewItems:"\uBB38\uD56D",viewTypes:"\uC720\uD615",colPending:"\uB0A8\uC740 \uAC83",colTrend:"\uBCC0\uD654",colRuns:"\uD310",unitItem:"\uAC1C",skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",summaryLabel:"\uC313\uC778 \uAE30\uB85D",summaryValue:"{{items}}\uBB38\uD56D \xB7 \uC544\uC9C1 \uBABB \uC7A1\uC740 \uAC83 {{pending}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C",picked:"\u2192 {{what}}",typeClear:"\uB2E4 \uC7A1\uC558\uC5B4\uC694",typePending:"{{total}}\uAC1C \uC911 {{pending}}\uAC1C \uB0A8\uC74C",flat:"\uBCC0\uD654 \uC5C6\uC74C",runs:"{{count}}\uD310",avgDuration:"\uD3C9\uADE0 {{sec}}\uCD08"},de={resetColumns:"\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"},ce={panelTitle:"\uB2E8\uC5B4\uD45C \uCC44\uC810",viewWords:"\uB0B1\uB9D0",viewTables:"\uD45C",colLatest:"\uB9C8\uC9C0\uB9C9",colTrend:"\uBCC0\uD654",unitTime:"\uD68C",summaryLabel:"\uC313\uC778 \uCC44\uC810",summaryValue:"{{times}}\uD68C \xB7 \uB0B1\uB9D0 {{words}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",allClear:"\uC9C0\uB09C\uBC88\uC5D0 \uBAA8\uB450 \uB9DE\uD614\uC2B5\uB2C8\uB2E4.",times:"{{count}}\uD68C",flat:"\uBCC0\uD654 \uC5C6\uC74C",recentLabel:"\uCD5C\uADFC \uCC44\uC810",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C"},ue={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},pe={selectYearMonth:"\uC5F0\uC6D4 \uC120\uD0DD",chooseDate:"\uB0A0\uC9DC \uC120\uD0DD"},me={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},ge={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},he={devNone:"\uBC1C\uB2EC \uC790\uB8CC \uC5C6\uC74C",place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},be={clearSelection:"\uC120\uD0DD \uD574\uC81C"},ye={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Se={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},ve={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},we={common:d,calendar:c,passCard:u,searchField:p,rating:m,colorPicker:g,dropdown:h,accordion:b,header:y,nav:S,settings:v,usage:w,account:f,help:T,training:L,trainingSettings:C,customers:P,payment:N,coupons:R,visits:E,company:A,trainingType:k,myWordTraining:D,myWordTable:M,keyWords:I,wordTable:O,wordSearch:_,wordPrint:x,topic:F,accessLinkManager:W,login:H,trainingPlanRun:B,device:G,manager:$,wordPairs:K,game:V,footer:Y,landing:z,date:U,trainingSetPage:q,wordTrainingPreview:j,wordData:Q,textField:J,segmentedControl:Z,tabs:X,fileUpload:ee,avatar:te,myHomework:ae,trainingStatus:oe,store:ne,homework:ie,inquiry:re,progress:le,trainingMiss:se,table:de,wordScore:ce,topBanner:ue,datePicker:pe,report:me,tooltip:ge,phonemeProfile:he,bulkBar:be,debug:ye,badge:Se,loader:ve},fe={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error"},Te={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yearMonth:"{{month}}/{{year}}",prevMonth:"Previous month",addOnDate:"Add a visit on {{date}}",nextMonth:"Next month",prevWeek:"Previous week",nextWeek:"Next week",legend:{visited:"Visited",scheduled:"Scheduled",noVisit:"No Show"},periodSelect:"Period unit"},Le={planSuffix:"Plan",labeledPlan:"{{label}} Plan",couponCode:"Pass Code",specialLabel:"Open Special",unitDay:"d",unitYear:"yr",remainingDay:"{{n}}d left",remainingHour:"{{n}}h left",remainingMinute:"{{n}}m left",remainingSecond:"{{n}}s left",menu:{use:"Activate",refund:"Refund",delete:"Delete"}},Ce={clearAriaLabel:"Clear search"},Pe={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},Ne={selected:"selected"},Re={placeholder:"Select"},Ee={collapse:"Collapse",expand:"Expand"},Ae={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu"},ke={mainMenu:"Main menu",bottomNav:"Bottom navigation",goToManager:"Go to Malgwi Manager",goToMalgwi:"Go to Malgwi",modeLabelManager:"Malgwi Manager",modeLabelMalgwi:"Malgwi",training:"Training",settings:"Settings",notifications:"Notifications",account:"Account",help:"Help",debug:"Debug",coupons:"Coupons",topic:"By Topic",trainingType:"By Training Type",wordPairs:"Word Pairs",wordSearch:"Word Search",wordTable:"Word Table Creator",company:"Company Info",more:"More",moreMenu:"More menu",badgeLabel:"{{label}}, {{count}}"},De={language:{training:{label:"Training Language",sub:"Language used for training words and speech"}},notifications:{title:"Notifications"},display:{fontSize:{small:"Small",large:"Large"}},cache:{title:"Cache Management",confirmMessage:"Delete cache ({{size}}). Do you want to continue?",delete:"Delete",deleting:"Deleting",cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"},trainingRecord:{label:"Training Record",sub:"Daily training progress and streak"}}},button:{save:"Save Settings"},popup:{clear:{confirm:"Reset"},update:{confirm:"Update"},cache:{title:"Delete {{label}}",message:"Delete {{label}} ({{size}}). Do you want to continue?"}},saved:"\u2713 Saved",account:{title:"Account",delete:{sub:"You can restore your account within 30 days of withdrawal."}}},Me={addButton:"Add Subscription",couponButton:"Enter Coupon",active:{infoTitle:"Subscription Info",refund:"Request Refund",startDate:"Start Date",endDate:"End Date",remaining:"Remaining"},pending:{title:"Pending",empty:"No pending subscriptions."},loading:"Loading\u2026",segment:{personal:"Malgwi",org:"Malgwi Manager"},org:{title:"Current Plan",disc:"Subscription plan in use by your organization.",empty:"No organization plan registered.",fallbackTitle:"Organization Plan",startDate:"Start Date",endDate:"End Date",remaining:"Remaining",duration:"Duration"}},Ie={profile:{planSuffix:"",plan:"Plan"},basicInfo:{name:{placeholder:"John Doe"}},security:{title:"Security",password:{label:"Password",currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."},twoFactor:{label:"Two-Factor Authentication",sub:"Strengthen your account security"}}},Oe={guide:{faq:{title:"FAQ",desc:"View all frequently asked questions"}}},_e={settings:"Settings",start:{title:"Start Word Training",description:"Select a training type below to begin"},difficulty:{tooltip:"The easiest difficulty is 'Random', the hardest is 'Initial Consonant Difference'."},contrast:{label:"Contrast",type:"Contrast Type",count:"Contrast Count",n:"{{n}}"},filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions:"{{n}} questions",countSentences:"{{n}} sentences",comingSoon:"Coming Soon",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",stop:"Stop",preview:"Preview",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",summary:"You heard {{correct}} item(s) correctly.",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",done:"Done",viewResult:"View Results",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen"},xe={totalCount:" training bundles",sort:{customers:"Customers"},copyLink:"Copy Link",removeLink:"Remove Link",linkRemoved:"Link removed.",linkSaveFirst:"Please save the training bundle first.",linkSaveFirstHint:"You can only create a shared link from a saved training bundle.",linkCopySelect:"Copy blocked \u2014 link selected. Press Ctrl/\u2318+C to copy.",nameRequired:"Please enter a training bundle name.",itemRequired:"Please add at least one training item.",randomAdd:"Random Add",menu:{publish:"Post to Store",duplicate:"Duplicate Training Bundle",edit:"Edit Training Bundle",move:"Move Group",rename:"Rename"},itemCount:"Number of Items",renameGroup:"Rename Group"},Fe={totalCount:" customers",loadError:"Failed to load list",basicInfo:{editTooltip:"Edit"},member:{placeholder:"Email or phone",link:"Link",linking:"Linking\u2026"},device:{title:"Hearing Devices",addTooltip:"Add New",addButton:"Add device",listTooltip:"View List",listTitle:" Device List",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",release:"Release",historyTitle:"Hearing device history"},schedule:{title:"Upcoming Visits",addTooltip:"Add Schedule",listTooltip:"View All",empty:"No upcoming visits",registerTitle:" Register Schedule",memoPlaceholder:"Enter a memo for this visit."},visitHistory:{title:"Visit History",addTooltip:"Add Visit",empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",visits:{title:"Visits"},trainingRecord:{title:"Customer Training Records"},status:{trainingSubtitle:"Training Status"},detail:{session:{completedFmt:"Done {{done}}/{{total}} \xB7 {{duration}}"},visitSuffix:" visits"},homework:{active:"Active",copied:"Link copied.",copy:"Copy Link",inactive:"Inactive",title:"Homework Progress"},duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"}},We={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},He={title:"Coupons",subtitle:"Enter a coupon code or view your coupons",input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply",error:{invalid:"Invalid coupon code.",alreadyUsed:"This coupon has already been used."},success:{applied:'"{{name}}" coupon applied.'},section:{owned:"My Coupons"},status:{used:"Used",available:"Available"}},Be={unitVisit:"",periodAll:"All",showN:"Show {{n}}"},Ge={subtitle:"Manage company and business information",editButton:"Edit Info",basicInfo:{title:"Basic Info"},contactInfo:{title:"Contact Info"}},$e={title:"Training by Type",subtitle:"Select the training type you want",listenInNoise:{title:"Sentence Listening in Noise",desc:"Train sentence comprehension in various noise environments."},shortStory:{title:"Short Story Listening",desc:"Listen to short stories and understand the content."},longStory:{title:"Long Story Listening",desc:"Focus on listening to long stories and grasp the content."},orderingSentence:{title:"Sentence Ordering",desc:"Arrange heard sentences in the correct order."},SAME_SOUND_PICK:{label:"Listen & Pick Same Sound",sub:"Pick the word card that matches what you heard."},SAME_OR_DIFF:{label:"Same or Different?",sub:"Decide whether the two sounds are the same or different."},HEAR_AND_PICK_SAME:{label:"Hear & Match Word",sub:"Pick the word card that matches the sound you heard."},HEAR_AND_PICK_INCLUDED:{label:"Find Word Containing Sound",sub:"Pick the word card that contains the syllable you heard."},STARTS_WITH_SAME_SOUND:{label:"Find Word Starting with Same Sound",sub:"Pick a word that starts with the same sound as what you heard."},LISTEN_AND_REMEMBER_ORDER:{label:"Listen & Recall Order",sub:"Select the cards in the order you heard the three words."},MERGE_2_SYLLABLES:{label:"Combine 2 Syllables",sub:"What word do two syllables make?"},MERGE_3_SYLLABLES:{label:"Combine 3 Syllables",sub:"What word do three syllables make?"},MERGE_2_PHONEMES:{label:"Combine 2 Phonemes",sub:"What sound do two phonemes make?"},MERGE_3_PHONEMES:{label:"Combine 3 Phonemes",sub:"What sound do three phonemes make?"},DROP_1_FROM_2SYLL:{label:"Drop 1 Syllable from 2-Syllable",sub:"What sound remains when you remove a syllable from a 2-syllable word?"},DROP_1_FROM_3SYLL:{label:"Drop 1 Syllable from 3-Syllable",sub:"What sound remains when you remove a syllable from a 3-syllable word?"},DROP_PART_FROM_COMPOUND:{label:"Drop Part of Compound Word",sub:"What word remains when you remove part of a compound word?"},DROP_FINAL_CONSONANT_FROM_1SYLL:{label:"Drop Final Consonant",sub:"What sound remains when you remove the final consonant?"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{label:"Drop Consonant",sub:"What sound remains when you remove the consonant?"},CHANGE_1_SYLL_IN_2SYLL:{label:"Change 1 Syllable (2-Syllable)",sub:"Change one syllable in a 2-syllable word to make a new word."},CHANGE_1_SYLL_IN_3SYLL:{label:"Change 1 Syllable (3-Syllable)",sub:"Change one syllable in a 3-syllable word to make a new word."},CHANGE_1_PHONEME_IN_1SYLL:{label:"Change 1 Phoneme (1-Syllable)",sub:"Change one phoneme in a 1-syllable word to make a new sound."},CHANGE_1_PHONEME_IN_2SYLL:{label:"Change 1 Phoneme (2-Syllable)",sub:"Change one phoneme in a 2-syllable word to make a new word."}},Ke={comingSoon:"Word training is coming soon."},Ve={colName:"Table Name",open:"Open",countSuffix:" tables",addCard:"Add Word Table Card",cardsEmpty:"No word table cards created yet.",menu:{publishStore:"Post to Training Store",unpublishStore:"Remove from Training Store"},newBadge:"Newly created",tab:{cards:"Word Table Cards",tables:"Word Tables"},publishedBadge:"Published",sharedBadge:"Shared"},Ye={title:"Key Words",empty:"No key words available."},ze={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount:"{{count}} words",deleteAriaLabel:"Delete",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",store:{badge:"Training Store"},card:{sub:"Word Table Card",empty:"No word tables in this card."},toast:{renameError:"Failed to rename",saveError:"Failed to save",deleteError:"Failed to delete",duplicateError:"Failed to duplicate",saveSuccess:"Word table saved."},scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap a cell to mark \u25CB \xB7 \u25B3 \xB7 \u2715.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"}},Ue={editBanner:{message:"Saving will update the word table you're editing."},filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193"},pageSize:"Show {{count}}",pageSizeAria:"Page size",popup:{title:"Select a word for cell {{n}}"}},qe={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},je={title:"By Topic",subtitle:"Select a topic to start listening training",noiseTitle:"Sentence Listening in Noise",shortStoryTitle:"Short Story Listening",FOOD:"Food",HLTH:"Health",WETH:"Weather",PRSN:"People",KRCT:"Korean Culture",STRY:"Stories",LOCA:"Locations",SOAR:"Society & Arts",NTSC:"Nature & Science",SPRT:"Sports",sub:{TRKRFD:"Traditional Korean Food",MDKRFD:"Modern Korean Food",WRLDFD:"World Cuisine",MTRFRT:"Ingredients & Fruits",GEFDKL:"Food Facts",HTETHB:"Healthy Eating",DISILL:"Diseases",EXCISE:"Exercise",GEHTKL:"Health Facts",GESSKL:"Seasons",SNWRAN:"Snow & Rain",WTHFCT:"Weather Forecast",GEWTKL:"Weather Facts",JODYPS:"Joseon Dynasty",MDKRPS:"Modern Korea",THKDPS:"Three Kingdoms",WRLART:"World Artists",WRLPSN:"World Figures",KRLANG:"Korean Language",TRPLCT:"Traditional Games",HERITG:"Heritage",EVTFES:"Events & Festivals",GECTKL:"General Knowledge",FRYTAL:"Fairy Tales",AMZING:"Amazing Stories",DAYSTR:"Everyday Stories",KRLDMK:"Korean Landmarks",SELNMK:"Seoul Landmarks",WRDTRB:"World Travel",NAVIGT:"Navigation",KRSOCI:"Korea",ECONEW:"Economy & News",GENART:"Arts",GELFKL:"Life Tips",ANIMAL:"Animals",PLANTS:"Plants",ETHPLT:"Earth",TOLELC:"Tools & Electronics",GESCKL:"Science Facts",INVDSP:"Individual Sports",MARART:"Martial Arts",TEAMSP:"Team Sports",FOOTBL:"Soccer",GESPKL:"Sports Facts"}},Qe={maxUses:"Max uses (leave blank for unlimited)",redirect:"Redirect URL (leave blank for app home)",creating:"Creating\u2026",create:"Create link",created:"\u2713 Link created",copied:"Copied!",copy:"Copy",loading:"Loading\u2026",empty:"No links created yet.",uses:"Used {{count}} times",expiresAt:"Expires: {{date}}",createdAt:"Created: {{date}}",confirmDelete:"Delete this link?",deactivate:"Deactivate",delete:"Delete",status:{active:"Active",expired:"Expired",inactive:"Inactive"}},Je={passwordPlaceholder:"Enter password"},Ze={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",validationError:{brandAndProduct:"Please enter brand and product name."},addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove"},Xe={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",daily:"Daily",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"},subscriptionStatus:{active:"{{pct}}% Active",expired:"{{pct}}% Expired",unused:"{{pct}}% Unused"}},et={editBanner:{message:"Saving will update the contrast pair table you're editing."},phonemeSelect:{title:"Phoneme Selection",vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:"Reflects the National Institute of Korean Language's basic vocabulary grade.",selectLabel:"Select",onlyHasImage:"Only words with images",onlySameStructure:"Only same phoneme structure"},searchLabel:{error:"Failed to load data",loading:"Loading\u2026"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},tt={sentenceTyping:{roundCount:"{{rounds}} rounds \xB7 {{timeLimit}}s each"},wordDefense:{me:"Me"},dictation:{title:"Dictation",desc:"Practice writing down exactly what you hear.",comingSoon:"Coming soon: audio playback, input field, answer comparison"},result:{heading:"Level {{number}} Answer",retry:"Try Again"},common:{accuracy:"{{pct}}% accuracy"},soundMatch:{title:"Sound Match",desc:"Quickly match words or sentences that share the same sound.",comingSoon:"Coming soon: play button, timer, score tracking"},orderSequence:{title:"Sentence Ordering",desc:"Arrange scattered sentence fragments in the correct order.",comingSoon:"Coming soon: sentence sets, ordering interface"},speedListen:{title:"Speed Listen",desc:"A challenge game to count the number of words in a sentence within a time limit.",comingSoon:"Coming soon: time limit, scoreboard"},noiseChallenge:{title:"Noise Challenge",desc:"Practice distinguishing sentences amid background noise.",comingSoon:"Coming soon: various noise levels, score tracking"},fastListen:{title:"Fast Listen",desc:"Listen to short sentences at speed and select the key word.",comingSoon:"Coming soon: speed by difficulty, timer"},shadowing:{title:"Shadowing",desc:"Practice pronunciation and intonation by repeating sentences aloud.",comingSoon:"Coming soon: playback, recording, comparison feedback"},phonemeHunt:{title:"Phoneme Hunt",desc:"Find words that contain a specific phoneme (sound).",comingSoon:"Coming soon: phoneme filter, hint feature"}},at={lead:`IHAB builds trust
4
4
  through sound
5
- and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Siocheong-gil, Chuncheon, Gangwon, Korea"},ot={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},nt={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},it={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},rt={answer:"Answer",distractor:"Distractor"},lt={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},st={clearAriaLabel:"Clear input"},dt={ariaLabel:"Select tab"},ct={ariaLabel:"Tabs"},ut={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},pt={ariaLabel:"User avatar"},mt={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},gt={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},ht={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},bt={manage:{unit:"item(s)"}},yt={cancelLabel:"Cancel"},St={subtitle:"Select a topic to start listening practice."},vt={steps:"Step {{current}} of {{total}}"},wt={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly:"{{n}} older record(s) were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs:"{{count}} run(s)",avgDuration:"{{sec}}s avg"},ft={resetColumns:"Reset column widths"},Tt={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},Lt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Ct={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Pt={previewRegion:"Report preview \u2014 scrollable sideways"},Nt={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Rt={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Et={clearSelection:"Clear selection"},At={showResult:"Show {{type}} result"},kt={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Dt={loading:"Loading"},Mt={common:fe,calendar:Te,passCard:Le,searchField:Ce,rating:Pe,colorPicker:Ne,dropdown:Re,accordion:Ee,header:Ae,nav:ke,settings:De,usage:Me,account:Ie,help:Oe,training:_e,trainingSettings:xe,customers:Fe,payment:We,coupons:He,visits:Be,company:Ge,trainingType:$e,myWordTraining:Ke,myWordTable:Ve,keyWords:Ye,wordTable:ze,wordSearch:Ue,wordPrint:qe,topic:je,accessLinkManager:Qe,login:Je,device:Ze,manager:Xe,wordPairs:et,game:tt,footer:at,landing:ot,date:nt,trainingSetPage:it,wordTrainingPreview:rt,wordData:lt,textField:st,segmentedControl:dt,tabs:ct,fileUpload:ut,avatar:pt,myHomework:mt,trainingStatus:gt,store:ht,homework:bt,inquiry:yt,trainingPlanRun:St,progress:vt,trainingMiss:wt,table:ft,wordScore:Tt,topBanner:Lt,datePicker:Ct,report:Pt,tooltip:Nt,phonemeProfile:Rt,bulkBar:Et,debug:At,badge:kt,loader:Dt};const It="0.131.0",n=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],a="ko",o="ihab_display_language";function i(){try{const e=localStorage.getItem(o);if(e&&n.some(l=>l.code===e))return e}catch{}return a}function Ot(e){try{localStorage.setItem(o,e)}catch{}}function r(e){try{document.documentElement.lang=e}catch{}}t.on("languageChanged",r),r(i()),t.use(s.initReactI18next).init({resources:{ko:{translation:we},en:{translation:Mt}},lng:i(),fallbackLng:a,interpolation:{escapeValue:!1},react:{useSuspense:!1}}),exports.default=t,exports.CORE_VERSION=It,exports.DEFAULT_LOCALE=a,exports.LOCALE_STORAGE_KEY=o,exports.SUPPORTED_LOCALES=n,exports.saveLocale=Ot;
5
+ and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Siocheong-gil, Chuncheon, Gangwon, Korea"},ot={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},nt={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},it={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},rt={answer:"Answer",distractor:"Distractor"},lt={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},st={clearAriaLabel:"Clear input"},dt={ariaLabel:"Select tab"},ct={ariaLabel:"Tabs"},ut={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},pt={ariaLabel:"User avatar"},mt={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},gt={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},ht={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},bt={manage:{unit:"item(s)"}},yt={cancelLabel:"Cancel"},St={subtitle:"Select a topic to start listening practice."},vt={steps:"Step {{current}} of {{total}}"},wt={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly:"{{n}} older record(s) were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs:"{{count}} run(s)",avgDuration:"{{sec}}s avg"},ft={resetColumns:"Reset column widths"},Tt={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},Lt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Ct={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Pt={previewRegion:"Report preview \u2014 scrollable sideways"},Nt={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Rt={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Et={clearSelection:"Clear selection"},At={showResult:"Show {{type}} result"},kt={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Dt={loading:"Loading"},Mt={common:fe,calendar:Te,passCard:Le,searchField:Ce,rating:Pe,colorPicker:Ne,dropdown:Re,accordion:Ee,header:Ae,nav:ke,settings:De,usage:Me,account:Ie,help:Oe,training:_e,trainingSettings:xe,customers:Fe,payment:We,coupons:He,visits:Be,company:Ge,trainingType:$e,myWordTraining:Ke,myWordTable:Ve,keyWords:Ye,wordTable:ze,wordSearch:Ue,wordPrint:qe,topic:je,accessLinkManager:Qe,login:Je,device:Ze,manager:Xe,wordPairs:et,game:tt,footer:at,landing:ot,date:nt,trainingSetPage:it,wordTrainingPreview:rt,wordData:lt,textField:st,segmentedControl:dt,tabs:ct,fileUpload:ut,avatar:pt,myHomework:mt,trainingStatus:gt,store:ht,homework:bt,inquiry:yt,trainingPlanRun:St,progress:vt,trainingMiss:wt,table:ft,wordScore:Tt,topBanner:Lt,datePicker:Ct,report:Pt,tooltip:Nt,phonemeProfile:Rt,bulkBar:Et,debug:At,badge:kt,loader:Dt};const It="0.132.0",n=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],a="ko",o="ihab_display_language";function i(){try{const e=localStorage.getItem(o);if(e&&n.some(l=>l.code===e))return e}catch{}return a}function Ot(e){try{localStorage.setItem(o,e)}catch{}}function r(e){try{document.documentElement.lang=e}catch{}}t.on("languageChanged",r),r(i()),t.use(s.initReactI18next).init({resources:{ko:{translation:we},en:{translation:Mt}},lng:i(),fallbackLng:a,interpolation:{escapeValue:!1},react:{useSuspense:!1}}),exports.default=t,exports.CORE_VERSION=It,exports.DEFAULT_LOCALE=a,exports.LOCALE_STORAGE_KEY=o,exports.SUPPORTED_LOCALES=n,exports.saveLocale=Ot;