@ihabdevteam/core 0.9.9 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/hooks.cjs.js +5 -5
- package/dist/ihabdevteam-core-fonts.css +36 -0
- package/dist/ihabdevteam-core.cjs.js +14 -14
- package/dist/ihabdevteam-core.d.ts +2 -0
- package/dist/packages/core/src/fonts.css +36 -0
- package/dist/packages/core/src/hooks/useDailyTrainingSelection.d.ts +2 -0
- package/dist/packages/core/src/hooks/useDailyTrainingSelection.js +15 -1
- package/package.json +14 -6
package/dist/hooks.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var l=require("react"),gt=require("react-i18next"),V=require("react/jsx-runtime"),Bo=require("react-dom"),Pn=typeof document<"u"?document.currentScript:null;function gr({storageKey:e="fontScale",baseFont:t=20,minScale:n=.8,maxScale:o=1.4,step:u=.1,lineHeightRatio:r=1.4}={}){const i=E=>Math.max(n,Math.min(o,Number(E))),[s,c]=l.useState(()=>{try{const E=localStorage.getItem(e),g=E?Number(E):1;return Number.isFinite(g)?g:1}catch{return 1}});l.useEffect(()=>{try{localStorage.setItem(e,String(s))}catch{}},[e,s]);const C=E=>{c(typeof E=="function"?g=>i(E(g)):i(E))},f=()=>C(E=>+(E+u).toFixed(6)),p=()=>C(E=>+(E-u).toFixed(6)),d=s<o-Number.EPSILON,m=s>n+Number.EPSILON,k=Math.round(t*s),w=Math.round(k*r);return{scale:s,setScale:C,increase:f,decrease:p,canIncrease:d,canDecrease:m,fontSize:k,lineHeight:w}}const Do=l.createContext(null);function _r(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Er(e){const t=l.useContext(Do),n=r=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(r).matches,[o,u]=l.useState(n(e));return l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=c=>u(c.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),u(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t&&typeof t.mobile=="boolean"&&_r(e)?t.mobile:o}function vo(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),t}function Oo(e,t){const n=vo(t);l.useEffect(()=>{const o=()=>n.current();try{window.addEventListener(e,o)}catch{}return()=>{try{window.removeEventListener(e,o)}catch{}}},[e,n])}const $n=" \xB7 ",Lo=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes($n)?e.split($n).pop()??e:e})(),Ro=l.createContext(!1);function br(e){const t=l.useContext(Ro);l.useEffect(()=>{if(t||typeof e!="string"||!e)return;const n=document.title;return document.title=Lo?`${e}${$n}${Lo}`:e,()=>{document.title=n}},[e,t])}function Sr(){const{t:e}=gt.useTranslation();return l.useCallback(t=>{if(!t)return"";const n=new Date(t).getTime();if(Number.isNaN(n))return"";const o=Math.floor((Date.now()-n)/864e5);return o<=0?e("myHomework.relativeDay.today","\uC624\uB298"):o===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n:o})},[e])}function kr(e){const[t,n]=l.useState({current:"",next:"",confirm:""}),[o,u]=l.useState(null),[r,i]=l.useState(!1),s=l.useRef(null);l.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);const c=l.useCallback(()=>{n({current:"",next:"",confirm:""}),u(null)},[]),C=l.useCallback(async()=>{if(!t.current){u({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!t.next){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(t.next!==t.confirm){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}i(!0);const f=e?await e(t.current,t.next):null;if(i(!1),f){u({type:"error",text:f});return}u({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),n({current:"",next:"",confirm:""}),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>u(null),1500)},[t,e]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:u,pwLoading:r,handleChangePw:C,reset:c}}const ke=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],rt=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Fe=["","\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 le(e){if(!e)return null;const t=e.charCodeAt(0)-44032;return t<0||t>=11172?null:{cho:Math.floor(t/588),jung:Math.floor(t%588/28),jong:t%28}}function Ar(){const e=new Map;return t=>{let n=e.get(t);return n||(n=[...t].map(o=>le(o)),e.set(t,n)),n}}function _t(e,t,n=0){return String.fromCharCode(44032+(e*21+t)*28+n)}function wr(e,t){if(!e||!t||e===t||e.length!==t.length)return"random";let n=0,o=null;for(let u=0;u<e.length;u++){const r=le(e[u]),i=le(t[u]);if(!r||!i)return"random";if(r.cho===i.cho&&r.jung===i.jung&&r.jong===i.jong)continue;n++;const s=r.cho!==i.cho,c=r.jung!==i.jung,C=r.jong!==i.jong;(s?1:0)+(c?1:0)+(C?1:0)>1?o="multi":s?o="cho":c?o="jung":o="jong"}return n!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}const $t={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($t).map(([e,t])=>[t.join(""),Fe[Number(e)]]));function Mr(e,t){if(!e||!t)return!1;for(const n of e){const o=le(n);if(o){if(ke[o.cho]===t)return!0;if(o.jong>0){if(Fe[o.jong]===t)return!0;const u=$t[o.jong];if(u&&u.includes(t))return!0}}}return!1}function pn(e){if(!e)return 0;let t=0;for(const n of e)le(n)&&t++;return t}function Nr(e){if(!e)return!1;let t=!1;for(const n of e){const o=le(n);if(o&&(t=!0,o.jong>0))return!1}return t}function Tr(e,t){if(e.jong<=0)return!1;if(t.includes(Fe[e.jong]))return!0;const n=$t[e.jong];return!!n&&n.some(o=>t.includes(o))}function xr(e,t,n){if(!e)return!1;const o=[...e],u=r=>{const i=le(o[r]);if(!i||t.cho&&!t.cho.includes(ke[i.cho])||t.jung&&!t.jung.includes(rt[i.jung]))return!1;if(t.jongNone){if(i.jong>0)return!1}else if(t.jong&&!Tr(i,t.jong))return!1;return!0};if(n==="head")return u(0);if(n==="tail")return u(o.length-1);if(n==="mid"){for(let r=1;r<o.length-1;r++)if(u(r))return!0;return!1}for(let r=0;r<o.length;r++)if(u(r))return!0;return!1}const Br={cho:ke.length,jung:rt.length,jong:Fe.length};function Dr(e,t,n,o,u=1/0){if(!e||n<1)return[];const r=[...e].map(p=>le(p));if(r.some(p=>!p))return[];const i=r,s=i.length;if(n>s)return[];const c=Br[t],C=new Set,f=[];(function p(d,m){if(m.length===n){f.push([...m]);return}for(let k=d;k<s;k++)m.push(k),p(k+1,m),m.pop()})(0,[]);for(const p of f)if((function d(m,k){if(C.size>=u)return;if(m===p.length){const g=k.map(S=>_t(S.cho,S.jung,S.jong)).join("");g!==e&&o.has(g)&&C.add(g);return}const w=p[m],E=i[w][t];for(let g=0;g<c;g++){if(g===E)continue;const S=k.slice();if(S[w]={...k[w],[t]:g},d(m+1,S),C.size>=u)return}})(0,i),C.size>=u)break;return[...C]}function vr(e,t){if(!e||!t||e.length!==t.length)return-1;let n=0;for(let o=0;o<e.length;o++){const u=le(e[o]),r=le(t[o]);if(!u||!r)return-1;u.cho!==r.cho&&n++,u.jung!==r.jung&&n++,u.jong!==r.jong&&n++}return n}const Io="word_pair_index_v2",jo="word_pair_index_sig_v2";let Ft=null;function Or(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Io),t=localStorage.getItem(jo);return!e||!t?null:{index:JSON.parse(e),sig:t}}catch{return null}}function Ht(){if(Ft)return Ft;const e=Or();return e?(Ft=e.index,e.sig,Ft):null}function Lr(){Ft=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Io),localStorage.removeItem(jo))}catch{}}const Po="word_image_existence_map_v1";let Bt=null;function $o(){if(Bt)return Bt;try{const e=typeof localStorage<"u"?localStorage.getItem(Po):null;Bt=e?JSON.parse(e):{}}catch{Bt={}}return Bt}function Rr(e,t){return`${e}_${t??1}`}function Ir(e,t){const n=$o(),o=Rr(e,t);return o in n?n[o]:void 0}function Fo(){const e=$o(),t=Object.values(e);return t.length===0?null:{total:t.length,exists:t.filter(Boolean).length}}function jr(){Bt={};try{typeof localStorage<"u"&&localStorage.removeItem(Po)}catch{}}const Ho=[{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 zo(e){return e.reduce((t,n)=>{try{const o=localStorage.getItem(n);return t+(o?new Blob([o]).size:0)}catch{return t}},0)}function Pr(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 $r(e){const{t}=gt.useTranslation(),[n,o]=l.useState({}),[u,r]=l.useState(null),[i,s]=l.useState(null),[c,C]=l.useState(null),f=l.useCallback(()=>{const d={};Ho.forEach(m=>{d[m.id]=zo([...m.keys])}),o(d),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(m=>{C({usage:m.usage??0,quota:m.quota??0})}).catch(()=>{})},[]);l.useEffect(()=>{f()},[f]);const p=l.useCallback(async d=>{r(d);try{d==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):d==="pairIndex"?Lr():d==="imageCache"&&jr(),f(),e?.(t("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[f,e,t]);return{cacheSizes:n,clearingId:u,confirmCacheId:i,setConfirmCacheId:s,storageEstimate:c,refreshCacheSizes:f,handleClearCache:p}}function Fr(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useCallback(()=>{const i=Ht();if(i){const c=Object.values(i),C=c.filter(f=>f.cho.length+f.jung.length+f.jong.length>0).length;n({matched:C,total:c.length})}else n(null);const s=Fo();u(s?{exists:s.exists,total:s.total}:null)},[]);return l.useEffect(()=>{r();const i=setTimeout(r,1e3);return()=>clearTimeout(i)},[e?.length,r]),{pairStats:t,imgStats:o,setPairStats:n,setImgStats:u,refreshStats:r}}function Vo(e,t=[]){const[n,o]=l.useState(t),[u,r]=l.useState(null),[i,s]=l.useState(!1),[c,C]=l.useState(e),f=l.useRef(i);l.useEffect(()=>{f.current=i});const p=l.useRef(null);l.useEffect(()=>{if(f.current)return;const g=p.current;g!==null&&g.length===t.length&&g.every((S,A)=>S===t[A])||(p.current=t,o(t))},[t]);const d=l.useCallback(g=>{r(g),s(!1),C({...g})},[]),m=l.useCallback(()=>s(!0),[]),k=l.useCallback(()=>s(!1),[]),w=l.useCallback((g,S)=>{o(g),r(S),s(!1)},[]),E=l.useCallback(g=>{o(S=>S.filter(A=>A!==g)),r(null)},[]);return{list:n,setList:o,selected:u,setSelected:r,isEditing:i,setIsEditing:s,editForm:c,setEditForm:C,openDetail:d,startEditing:m,cancelEditing:k,commitEdit:w,remove:E}}const zt=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},Hr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function zr(e=[]){const{list:t,setList:n,selected:o,setSelected:u,isEditing:r,setIsEditing:i,editForm:s,setEditForm:c,openDetail:C,commitEdit:f}=Vo(Hr,e),{year:p,month:d,day:m}=zt(),[k,w]=l.useState({year:p,month:d,day:m,hour:"09",minute:"00",memo:""});return{visitHistory:t,visitForm:k,setVisitForm:w,setVisit:E=>g=>w(S=>({...S,[E]:g})),selectedVisit:o,setSelectedVisit:u,isEditingVisit:r,setIsEditingVisit:i,editVisitForm:s,setEditVisitForm:c,openVisitDetail:C,handleVisitSave:E=>{n(B=>[k,...B]);const{year:g,month:S,day:A}=zt();w({year:g,month:S,day:A,hour:"09",minute:"00",memo:""}),E?.()},handleVisitEditSave:()=>{f(E=>E.map(g=>g===o?s:g),s)},addVisit:E=>{n(g=>[E,...g])},removeVisit:E=>{n(g=>g.filter(S=>S!==E))},revertVisitEdit:(E,g)=>{n(S=>S.map(A=>A===g?E:A)),u(S=>S===g?E:S)}}}const Uo=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")}`,Cn=e=>[...e].sort((t,n)=>{const o=Uo(t),u=Uo(n);return o<u?-1:o>u?1:0}),Vr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Ur(e,t=[]){const n=l.useMemo(()=>Cn(t),[t]),{list:o,setList:u,selected:r,setSelected:i,isEditing:s,setIsEditing:c,editForm:C,setEditForm:f,openDetail:p,commitEdit:d,remove:m}=Vo(Vr,n),[k,w]=l.useState([]),{year:E,month:g,day:S}=zt(),[A,B]=l.useState({year:E,month:g,day:S,hour:"09",minute:"00",memo:""}),L=F=>x=>B(v=>({...v,[F]:x})),D=F=>{u(Z=>Cn([...Z,A]));const{year:x,month:v,day:ye}=zt();B({year:x,month:v,day:ye,hour:"09",minute:"00",memo:""}),F?.()},I=()=>{d(F=>Cn(F.map(x=>x===r?C:x)),C)},$=l.useCallback(F=>{m(F)},[m]),G=l.useCallback(F=>{e({year:F.year,month:F.month,day:F.day,hour:F.hour,minute:F.minute,memo:F.memo}),m(F)},[e,m]),P=l.useCallback(F=>{u(x=>x.filter(v=>v!==F)),w(x=>[F,...x]),i(null)},[u,i]),Q=l.useCallback(F=>{u(x=>Cn([...x,F]))},[u]),Y=l.useCallback(F=>{u(x=>x.filter(v=>v!==F))},[u]),W=l.useCallback((F,x)=>{u(v=>v.map(ye=>ye===x?F:ye)),i(v=>v===x?F:v)},[u,i]);return{scheduleList:o,noShowList:k,addSchedule:Q,removeSchedule:Y,revertScheduleEdit:W,scheduleForm:A,setScheduleForm:B,setSchedule:L,selectedSchedule:r,setSelectedSchedule:i,isEditingSchedule:s,setIsEditingSchedule:c,editScheduleForm:C,setEditScheduleForm:f,openScheduleDetail:p,handleScheduleSave:D,handleScheduleEditSave:I,handleScheduleDelete:$,handleScheduleToVisit:G,handleScheduleNoVisit:P}}const Go=[{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 Gr(e){const[t,n]=l.useState(""),[o,u]=l.useState("25"),[r,i]=l.useState("all"),[s,c]=l.useState(1),C=l.useMemo(()=>e.filter(({item:m,status:k})=>!(t&&!m.memo.includes(t)||r!=="all"&&k!==r)),[e,t,r]),f=Math.max(1,Math.ceil(C.length/Number(o))),p=Math.min(s,f),d=l.useMemo(()=>C.slice((p-1)*Number(o),p*Number(o)),[C,p,o]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:u,vapStatus:r,setVapStatus:i,vapPage:p,setVapPage:c,vapFiltered:C,vapTotal:f,vapPageItems:d}}function Yr(e,t){const{t:n}=gt.useTranslation(),[o,u]=l.useState("25"),[r,i]=l.useState(1),[s,c]=l.useState(t);s!==t&&(c(t),r!==1&&i(1));const C=l.useMemo(()=>Go.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),f=l.useCallback(m=>{u(m),i(1)},[]),p=Math.max(1,Math.ceil(e.length/Number(o))),d=Math.min(r,p);return{pageRows:l.useMemo(()=>e.slice((d-1)*Number(o),d*Number(o)),[e,d,o]),pageSizeProps:{options:C,value:o,onChange:f},paginationProps:{page:d,total:p,onChange:i},setPage:i}}function qr(){const[e,t]=l.useState(null),n=l.useCallback(u=>{t(r=>r?.key===u?{key:u,asc:!r.asc}:{key:u,asc:!0})},[]),o=l.useCallback((u,r)=>({label:u,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>n(r)}),[e,n]);return{\uC815\uB82C:e,\uCE78:o}}function Wr(){const[e,t]=l.useState(!1),[n,o]=l.useState("\uC88C"),[u,r]=l.useState({\uC88C:null,\uC6B0:null}),[i,s]=l.useState({\uC88C:[],\uC6B0:[]}),[c,C]=l.useState(!1),[f,p]=l.useState("\uC88C"),d=l.useCallback(k=>{const w=k.direction;r(E=>({...E,[w]:k})),s(E=>({...E,[w]:[k,...E[w]]})),t(!1)},[]),m=l.useCallback(k=>{const w=k.direction;r(E=>({...E,[w]:k})),C(!1)},[]);return{showDevice:e,setShowDevice:t,deviceDirection:n,setDeviceDirection:o,devices:u,setDevices:r,deviceHistory:i,setDeviceHistory:s,showDeviceList:c,setShowDeviceList:C,listForSide:f,setListForSide:p,handleDeviceSubmit:d,handleSelectFromList:m}}const Kr="__ihab_core_word_pool__";function yn(){return globalThis[Kr]??null}function re(e,t=Math.random){const n=e.slice();for(let o=n.length-1;o>0;o--){const u=Math.floor(t()*(o+1));[n[o],n[u]]=[n[u],n[o]]}return n}function at(e,t,n=Math.random){return!Array.isArray(e)||e.length===0||t<=0?[]:t>=e.length?re(e,n):re(e,n).slice(0,t)}const Fn={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"}},Xr=ke.indexOf("\u3147"),Yo={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!==Xr},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}},Zr={\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"},Jr={\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 qo(e){return Zr[e]??e}const Hn={cho:ke,jung:rt,jong:Fe},_e=e=>Array.isArray(e)?e.length>0:!!e;function zn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const o=e[n],u=t[n];if(!(!o||!u)&&(o.cho!==u.cho&&ke[o.cho]==="\u3147"!=(ke[u.cho]==="\u3147")||o.jong!==u.jong&&o.jong===0!=(u.jong===0)))return!0}return!1}function Qr(e,t,n){const o=n.pronOf(e),u=n.decompOf,r=n.sameStructureOnly&&u?u(o):null,i=[];for(const s of t)s!==e&&(n.okSet&&!n.okSet.has(s)||n.pronOf(s)!==o&&(r&&u&&zn(r,u(n.pronOf(s)))||i.push(s)));return i}function Wo(e,t,n){const o=t?.[e];if(!o)return[];const u=n.kind?o[n.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Qr(e,u,n)}function ea(e,t,n,o,u,r,i){const s=["cho","jung","jong"].filter(d=>_e(e[d])),c={};for(const d of s){const m=e[d];c[d]=new Set(Array.isArray(m)?m:[m])}const C=u==="pron",f=new Map;for(const d of t){const m=n(r(d));if(m.some(g=>!g))continue;let k=m;if(!C&&(k=n(d),k.length!==m.length||k.some(g=>!g)))continue;const w=m.length,E=f.get(w);E?E.push({w:d,dPron:m,dPos:k}):f.set(w,[{w:d,dPron:m,dPos:k}])}const p=new Map;for(const[d,m]of f){const k=new Map,w=(E,g)=>{const S=E.dPos[g];return S!=null&&s.every(A=>c[A].has(Hn[A][S[A]]))};for(const E of m){let g;if(i==="head")g=w(E,0)?0:-1;else if(i==="tail")g=w(E,d-1)?d-1:-1;else if(i==="mid"){g=-1;for(let A=1;A<d-1;A++)if(w(E,A)){g=A;break}}else g=E.dPos.findIndex(A=>A!=null&&s.every(B=>c[B].has(Hn[B][A[B]])));if(g<0)continue;const S=k.get(g);S?S.push(E):k.set(g,[E])}for(const[E,g]of k){const S=new Set(s.map(L=>E+":"+L)),A=L=>{let D="";for(let I=0;I<d;I++){const $=L[I];for(const G of["cho","jung","jong"])D+=(S.has(I+":"+G)?"*":$[G])+"."}return D},B=new Map;for(const L of m){const D=A(L.dPron),I=B.get(D);I?I.push(L):B.set(D,[L])}for(const L of g){const D=B.get(A(L.dPron))??[],I=[];for(const $ of D){if($.w===L.w)continue;let G=!0;for(const P of s){const Q=L.dPron[E][P],Y=$.dPron[E][P];if(Y===Q){G=!1;break}if(C&&c[P].has(Hn[P][Y])){G=!1;break}}G&&(o&&zn(L.dPron,$.dPron)||I.push($.w))}p.set(L.w,I)}}}return p}const ta=e=>e==null?[]:Array.isArray(e)?e:[e];function na(e){if([...e].length!==1)return"";const t=le(e);if(!t)return"";const n=qo(Fe[t.jong]),o=n===""?0:Fe.indexOf(n);return _t(t.cho,t.jung,o<0?0:o)}function Ko(e,t){return t.get(e)||na(e)||e}function Vn(e){return e?_e(e.cho)?"cho":_e(e.jung)?"jung":_e(e.jong)?"jong":null:null}function Dt(e,t){const n=(o,u)=>!_e(o)||ta(o).includes(u);return n(t.cho,ke[e.cho])&&n(t.jung,rt[e.jung])&&n(t.jong,Fe[e.jong])}function Vt(e,t,n){const o=[...e];if(n!=="pron")return o.map(r=>le(r));const u=[...t.get(e)||e];return u.length!==o.length?o.map(r=>le(r)):u.map(r=>le(r))}function Ut(e,t,n,o,u){const r=t==="cho"?ke:t==="jung"?rt:Fe,i=e[t],s=[],c=new Set([Ko(n,u)]),C=re(r.map((f,p)=>p).filter(f=>f!==i&&(t!=="cho"||r[f]!=="\u3147")&&(t!=="jong"||f!==0)));for(const f of C){if(s.length>=o)break;const p=t==="cho"?_t(f,e.jung,e.jong):t==="jung"?_t(e.cho,f,e.jong):_t(e.cho,e.jung,f),d=Ko(p,u);c.has(d)||(c.add(d),s.push(p))}return s}function oa(e,t,n,o,u,r=null){const i=[...e];if(i.length!==2)return null;const s=i.map(p=>le(p));if(s.some(p=>!p))return null;const c=Vt(e,n,o);if(c.some(p=>!p))return null;const C=Vn(t);let f=C&&t?c.map((p,d)=>Dt(p,t)?d:-1).filter(p=>p>=0):[0,1];if(r!=null&&(f=f.filter(p=>p!==r)),!f.length)return null;for(const p of re(f)){const d=i[p];if(!u.has(d))continue;const m=Ut(s[p],C??"cho",d,40,n),k=[];for(const w of m)if(w!==d&&u.has(w)&&!k.includes(w)&&k.push(w),k.length>=2)break;if(!(k.length<2))return{question:e,distractors:[d,...k]}}return null}function ua(e,t,n,o,u,r=null){const i=[...e];if(i.length!==3)return null;const s=i.map(p=>le(p));if(s.some(p=>!p))return null;const c=Vt(e,n,o);if(c.some(p=>!p))return null;const C=Vn(t),f=C&&t?c.map((p,d)=>Dt(p,t)?d:-1).filter(p=>p>=0):[0,1,2];if(!f.length)return null;for(const p of re(f))for(const d of re([0,1,2].filter(m=>m!==p&&(r==null||m===r)))){const m=[0,1,2].filter(S=>S!==d),k=m.map(S=>i[S]).join("");if(!u.has(k))continue;const w=m.indexOf(p),E=Ut(s[p],C??"cho",i[p],40,n),g=[];for(const S of E){const A=m.map(L=>i[L]);A[w]=S;const B=A.join("");if(B!==k&&u.has(B)&&!g.includes(B)&&g.push(B),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[k,...g]}}return null}function ra(e,t,n,o,u,r=null){const i=[...e],s=i.length;if(s<2)return null;const c=[];for(let f=1;f<=s-1;f++)c.push({remain:i.slice(0,f).join(""),dropped:i.slice(f).join(""),droppedEnd:1}),c.push({remain:i.slice(s-f).join(""),dropped:i.slice(0,s-f).join(""),droppedEnd:0});const C=Vn(t);for(const{remain:f,dropped:p,droppedEnd:d}of re(c)){if(r!=null&&d!==r||f===e||!u.has(f)||!u.has(p))continue;const m=[...f],k=m.map(g=>le(g));if(k.some(g=>!g))continue;const w=Vt(f,n,o);if(w.some(g=>!g))continue;const E=C&&t?w.map((g,S)=>Dt(g,t)?S:-1).filter(g=>g>=0):m.map((g,S)=>S);if(E.length)for(const g of re(E)){const S=Ut(k[g],C??"cho",m[g],40,n),A=[];for(const B of S){const L=[...m];L[g]=B;const D=L.join("");if(D!==f&&u.has(D)&&!A.includes(D)&&A.push(D),A.length>=2)break}if(A.length>=2)return{question:e,distractors:[f,...A]}}}return null}function aa(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=le(n.get(e)||e);if(!i||i.jong===0)return null;const s=_t(i.cho,i.jung,0),c=Ut({cho:i.cho,jung:i.jung,jong:0},"cho",s,2,n);return c.length<2?null:{question:e,distractors:[s,...c]}}const Un=ke.indexOf("\u3147");function ia(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=le(n.get(e)||e);if(!i||i.jong!==0||i.cho===Un)return null;const s=_t(Un,i.jung,0),c=Ut({cho:Un,jung:i.jung,jong:0},"jung",s,2,n);return c.length<2?null:{question:e,distractors:[s,...c]}}function sa(e){const t=new Map;for(const n of e){const o=[...n],u=o.length;if(!(u<2||u>3))for(let r=0;r<u;r++){let i=u+"|"+r+"|";for(let c=0;c<u;c++)i+=c===r?"*":o[c];const s=t.get(i);s?s.push(n):t.set(i,[n])}}return t}function la(e,t,n,o,u,r=null,i=null,s=2){const c=[...e],C=c.length;if(C<2||C>3)return null;const f=c.map(S=>le(S));if(f.some(S=>!S))return null;const p=Vt(e,n,o);if(p.some(S=>!S))return null;const d=S=>n.get(S)??S,m=d(e),k=!!t&&(_e(t.cho)||_e(t.jung)||_e(t.jong)),w=!!i&&(_e(i.cho)||_e(i.jung)||_e(i.jong)),E=S=>{let A=C+"|"+S+"|";for(let B=0;B<C;B++)A+=B===S?"*":c[B];return A};let g;if(r!=null){if(r>=C||k&&!Dt(p[r],t))return null;g=[r]}else k?g=p.map((S,A)=>Dt(S,t)?A:-1).filter(S=>S>=0):g=Array.from({length:C},(S,A)=>A);for(const S of re(g)){const A=u.get(E(S))??[],B=[],L=[];for(const P of A){if(P===e)continue;const Q=[...P].map(x=>le(x)),Y=f[S],W=Q[S];if(!Y||!W)continue;let F=0;if(Y.cho!==W.cho&&F++,Y.jung!==W.jung&&F++,Y.jong!==W.jong&&F++,!(F<s||d(P)===m))if(w){const x=Vt(P,n,o)[S];x&&Dt(x,i)?B.push(P):L.push(P)}else B.push(P)}if(!B.length)continue;const D=re(B)[0],I=[],$=new Set([m,d(D)]),G=w?L:B.filter(P=>P!==D);for(const P of re(G)){const Q=d(P);if(!$.has(Q)&&($.add(Q),I.push(P),I.length>=2))break}if(!w&&I.length<2)for(const P of re(A)){if(P===e||P===D)continue;const Q=d(P);if(!$.has(Q)&&($.add(Q),I.push(P),I.length>=2))break}if(!(I.length<2))return{question:e,distractors:[D,...I]}}return null}let mn=null,Xo=null,Zo=null;function ca(){const e=yn();if(e&&e.entries.length>0){const t=Ht();if(mn&&Xo===e&&Zo===t)return mn;const n=new Set,o=[];for(const u of e.entries)!u.word||n.has(u.word)||(n.add(u.word),o.push({w:u.word,s:u.syllables,p:t?.[u.word]?[...t[u.word].cho??[],...t[u.word].jung??[],...t[u.word].jong??[]]:[],pron:u.pronunciation||u.word,grade:u.grade}));return mn=o,Xo=e,Zo=t,mn}return[]}const Ge=new Proxy([],{get(e,t){const n=ca(),o=n[t];return typeof o=="function"?o.bind(n):o}});function gn(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Ye(e,t){if(t>=e.length)return re(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const u=o+Math.floor(Math.random()*(n.length-o)),r=n[o];n[o]=n[u],n[u]=r}return n.slice(0,t)}let Gn=null,Jo=null;function Et(){const e=yn();if(Gn&&Jo===e)return Gn;const t=new Map;for(const n of Ge)n.w&&t.set(n.w,n.pron);return Gn=t,Jo=e,t}function Oe(e){return Et().get(e)||e}function Yn(e,t,n=new Set){const o=[];for(const u of re(e)){if(o.length>=t)break;const r=Oe(u);n.has(r)||(n.add(r),o.push(u))}return o}let da=0;function Ae(e){return`${e}-rt-${++da}`}function Gt(e){const t=Fo();if(!t||t.total===0){const o=new Set;for(const u of e)o.add(u);return o}const n=new Set;for(const o of e)Ir(o)===!0&&n.add(o);return n}const _n=new Map;let Qo=null,eu=null;function Yt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function tu(e){const t=Yt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),u=n?`${Yt(n.cho)}/${Yt(n.jung)}/${Yt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",r=Yt(e.grade);return`${e.difficulty??""}|${t}|${u}|${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${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Le(e){const t=yn(),n=Ht();(t!==Qo||n!==eu)&&(_n.clear(),Qo=t,eu=n);const o=tu(e);return _n.has(o)||_n.set(o,fa(e)),_n.get(o)}function ha(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),u=!!e.jongNone,r=u?null:t(e.jong);return n||o||r||u?u&&!n&&!o&&!r?i=>Nr(i):i=>xr(i,{cho:n,jung:o,jong:r,jongNone:u}):null}async function fa(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:u=null,excludeNoImage:r=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,c=e.phonemeView==="pron"?"pron":"char",C=Math.max(1,e.contrastCount??1),f=t==="cho"||t==="jung"||t==="jong",p=f&&C>=2,d=t==="count",m=n?new Set(Array.isArray(n)?n:[n]):null,k=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[ha(o),k?M=>k.has(pn(M)):null].filter(M=>M!=null):[],E=t==="random"||t===null,g=E||d,S=E||p||d;let A=Ge.filter(M=>!M.w||i&&(!M.grade||!i.has(M.grade))?!1:S?!0:Array.isArray(M.p)&&M.p.length>0);m&&(A=A.filter(M=>{for(const j of m)if(Mr(M.w,j))return!0;return!1})),w.length>0&&(A=A.filter(M=>{const j=c==="pron"?Oe(M.w):M.w;return w.every(ae=>ae(j))})),u&&(A=A.filter(M=>M.w[0]===u));let B;if(r){const M=new Set;for(const j of A)if(M.add(j.w),Array.isArray(j.p))for(const ae of j.p)M.add(ae);if(g)for(const j of Ge)j.w&&M.add(j.w);B=Gt(M)}else{const M=new Set;for(const j of A)if(M.add(j.w),Array.isArray(j.p))for(const ae of j.p)M.add(ae);if(g)for(const j of Ge)j.w&&M.add(j.w);B=M}let L=null;if(p){const M=new Set;for(const j of Ge)j.w&&M.add(j.w);L=r?Gt(M):M}const D=A.filter(M=>B.has(M.w)),I=600,$=Array.from(B),G=$.length>I?Ye($,I):$,P=d&&o!=null&&(_e(o.cho)||_e(o.jung)||_e(o.jong)),Q=2500,Y=new Map;if(d&&!P&&C>=2){for(const M of $){const j=pn(M),ae=Y.get(j);ae?ae.push(M):Y.set(j,[M])}for(const[M,j]of Y)j.length>Q&&Y.set(M,Ye(j,Q))}const W=Ar(),F=P?ea(o,$,W,s,c,Oe):null,x=500,v=1500,ye=e.fullCount?D:t==="random"?D.length>x?Ye(D,x):D:D.length>v?Ye(D,v):D,Z=Ht(),ee=[];for(const M of ye){let j;const ae=Oe(M.w);if(p)j=Dr(M.w,t,C,L,24).filter(ne=>Oe(ne)!==ae);else if(d)P?j=(F.get(M.w)??[]).filter(ne=>Oe(ne)!==ae):C<=1?j=Wo(M.w,Z,{okSet:B,pronOf:Oe,decompOf:W,sameStructureOnly:!1}):j=(Y.get(pn(M.w))??[]).filter(ne=>{if(ne===M.w||Oe(ne)===ae)return!1;const q=vr(M.w,ne);return C>=5?q>=5:q===C});else if(E)j=G.filter(ne=>ne!==M.w&&ne.length===M.w.length&&Oe(ne)!==ae);else{const ne=t;j=Wo(M.w,Z,{kind:ne,okSet:B,pronOf:Oe,decompOf:W,sameStructureOnly:!1}),j.length===0&&(j=(G.length>30?Ye(G,30):G).filter(q=>q!==M.w&&wr(M.w,q)===t&&Oe(q)!==ae))}if(s&&j.length>0&&(f||d&&!P)){const ne=W(Oe(M.w));j=j.filter(q=>!zn(ne,W(Oe(q))))}j.length!==0&&ee.push({word:M,usable:j})}return ee}async function nu(e,t){const{choicesPerItem:n=3,count:o=10}=t,u=n-1,r=(await Le(t)).filter(s=>s.usable.length>=u),i=[];for(const s of re(r)){if(i.length>=o)break;const c=Yn(s.usable,u);if(c.length<u)continue;const C=re([s.word.w,...c]);i.push({id:Ae(e+"-item"),index:i.length+1,word:s.word.w,syllables:s.word.s,choices:C,answerIndex:C.indexOf(s.word.w)})}return i}async function pa(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Le({...e,difficulty:null});if(u.length<t)return[];const r=[],i=re([...u]);for(const s of i){if(r.length>=n)break;const c=s.word.w,C=[...s.word.pron||c],f=gn(C);if(!f)continue;const p=u.filter(k=>k.word.w!==c&&k.word.s===s.word.s&&!(k.word.pron||k.word.w).includes(f)&&k.word.pron!==s.word.pron);if(p.length<o)continue;const d=Yn(p.map(k=>k.word.w),o);if(d.length<o)continue;const m=re([c,...d]);r.push({id:Ae("HPI-item"),index:r.length+1,targetSyllable:f,word:c,choices:m,answerIndex:m.indexOf(c)})}return r}async function Ca(e){const{count:t=10}=e,n=(await Le(e)).filter(o=>o.usable.length>=1);return Array.from({length:t},(o,u)=>{const r=gn(n);if(!r)return null;const i=u%2===0;let s;if(i)s=[r.word.w,r.word.w];else{const c=gn(r.usable);s=Math.random()<.5?[r.word.w,c]:[c,r.word.w]}return{id:Ae("SOD-item"),index:u+1,word:r.word.w,pair:s,same:i}}).filter(o=>!!o)}async function ya(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Le({...e,difficulty:null});if(u.length<t+1)return[];const r=u.map(d=>d.word.w),i=new Map(u.map(d=>[d.word.w,d.word.pron])),s=d=>(i.get(d)||d)[0]??"",c={};for(const d of u){const m=s(d.word.w);m&&(c[m]||(c[m]=[]),c[m].push(d.word.w))}const C=Object.entries(c).filter(([,d])=>d.length>=2).map(([d])=>d);if(C.length===0)return[];const f=[],p=re([...C]);for(let d=0;f.length<n&&d<n*4;d++){const m=p[d%p.length],k=c[m];if(k.length<2)continue;const w=re([...k]),E=w[0],g=w[1];if(!E||!g||E===g||(i.get(E)||E)===(i.get(g)||g))continue;const S=i.get(g)||g,A=r.filter(D=>s(D)!==m&&D!==E&&D!==g&&D.length===g.length&&(i.get(D)||D)!==S);if(A.length<o)continue;const B=Yn(A,o);if(B.length<o)continue;const L=re([g,...B]);f.push({id:Ae("SWS-item"),index:f.length+1,sourceWord:E,targetSyllable:m,word:g,choices:L,answerIndex:L.indexOf(g)})}return f}function ou(e,t,n){return Ye(e,t).map((o,u)=>{const r=gn(o.usable)??"",i=[...o.word.w],s=[...r],c=i.findIndex((f,p)=>f!==s[p]),C=re(o.usable.filter(f=>f&&f!==r)).slice(0,2);return{id:Ae(n),index:u+1,word:o.word.w,original:o.word.w,changed:r,changedFrom:c>=0?i[c]:"",changedTo:c>=0?s[c]:"",distractors:C}})}async function uu(e,t,n){const{count:o=10}=t,u=Et(),r=Ge.filter(m=>m.w&&m.s===e),i=t.excludeNoImage?Gt(r.map(m=>m.w)):null,s=i?r.filter(m=>i.has(m.w)):r,c=new Set(s.map(m=>m.w)),C=sa(c),f=t.phonemeView??"char",p=t.composition??null,d=[];for(const m of re(s)){if(d.length>=o)break;const k=la(m.w,p,u,f,C,null,null);if(!k)continue;const w=k.distractors[0],E=[...m.w],g=[...w],S=E.findIndex((A,B)=>A!==g[B]);d.push({id:Ae(n),index:d.length+1,word:m.w,original:m.w,changed:w,changedFrom:S>=0?E[S]:"",changedTo:S>=0?g[S]:"",distractors:k.distractors.slice(1)})}return d}async function ma(e){return uu(2,e,"CS2-item")}async function ga(e){return uu(3,e,"CS3-item")}async function _a(e){const t=(await Le({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return ou(t,e.count??10,"CP1-item")}async function Ea(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Le({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return ou(n,e.count??10,"CP2-item")}async function ba(e){const{count:t=10}=e,n=(await Le({...e})).filter(o=>o.word.s===2);return Ye(n,t).map((o,u)=>({id:Ae("M2S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Sa(e){const{count:t=10}=e,n=(await Le({...e})).filter(o=>o.word.s===3);return Ye(n,t).map((o,u)=>({id:Ae("M3S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function ka(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s===2),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const c=oa(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=[...s.word.w],d=p[0]===C?p[1]:p[0];i.push({id:Ae("D2-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:d,missingResult:C,distractors:f})}return i}async function Aa(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s===3),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const c=ua(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=[...s.word.w];let d="";for(let m=0;m<p.length;m++)if(p.filter((k,w)=>w!==m).join("")===C){d=p[m];break}i.push({id:Ae("D3-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:d,missingResult:C,distractors:f})}return i}async function wa(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s>=2),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const c=ra(s.word.w,e.composition??null,o,r,u);if(!c)continue;const[C,...f]=c.distractors,p=s.word.w,d=p.startsWith(C)?p.slice(C.length):p.endsWith(C)?p.slice(0,p.length-C.length):"";i.push({id:Ae("DPC-item"),index:i.length+1,original:p,word:p,dropped:d,missingResult:C,distractors:f})}return i}async function Ma(e){const{count:t=10}=e,n=(await Le({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,u)=>{const r=Ye(n,3);return{id:Ae("LRO-item"),index:u+1,sequence:r,choices:re(r)}})}function En(e,t,n){const o=Ge.filter(i=>i.w&&i.s===e),u=t?Gt(o.map(i=>i.w)):null,r=[];for(const i of o)if(!(u&&!u.has(i.w))){if(n){const s=le(i.w);if(!s||!n(s))continue}r.push(i)}return r}function Na(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong===0);return Ye(t,e.count??10).map((n,o)=>{const u=le(n.w);return{id:Ae("M2P-item"),index:o+1,parts:[ke[u.cho],rt[u.jung]],answer:n.w,word:n.w}})}function Ta(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong>0&&!$t[n.jong]);return Ye(t,e.count??10).map((n,o)=>{const u=le(n.w);return{id:Ae("M3P-item"),index:o+1,parts:[ke[u.cho],rt[u.jung],Fe[u.jong]],answer:n.w,word:n.w}})}function xa(e){const t=Yo.DROP_FINAL_CONSONANT_FROM_1SYLL,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=Et(),u=[];for(const r of re(n)){if(u.length>=(e.count??10))break;const i=aa(r.w,null,o);if(!i)continue;const[s,...c]=i.distractors;u.push({id:Ae("DFC-item"),index:u.length+1,original:r.w,word:r.w,result:s,distractors:c})}return u}function Ba(e){const t=Yo.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=Et(),u=[];for(const r of re(n)){if(u.length>=(e.count??10))break;const i=ia(r.w,null,o);if(!i)continue;const s=le(o.get(r.w)||r.w);if(!s)continue;const[c,...C]=i.distractors;u.push({id:Ae("RCP-item"),index:u.length+1,base:r.w,word:r.w,missingConsonant:ke[s.cho],remaining:c,distractors:C})}return u}const bn=new Map;let ru=null,au=null;async function iu(e,t={}){const n=yn(),o=Ht();(n!==ru||o!==au)&&(bn.clear(),ru=n,au=o);const u=`${e}:${tu(t)}`;if(bn.has(u))return bn.get(u);const r=await va(e,t);return bn.set(u,r),r}const Da={SAME_SOUND_PICK:e=>nu("SSP",e),HEAR_AND_PICK_SAME:e=>nu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>pa(e),SAME_OR_DIFF:e=>Ca(e),STARTS_WITH_SAME_SOUND:e=>ya(e),LISTEN_AND_REMEMBER_ORDER:e=>Ma(e),MERGE_2_SYLLABLES:e=>ba(e),MERGE_3_SYLLABLES:e=>Sa(e),MERGE_2_PHONEMES:e=>Na(e),MERGE_3_PHONEMES:e=>Ta(e),DROP_1_FROM_2SYLL:e=>ka(e),DROP_1_FROM_3SYLL:e=>Aa(e),DROP_PART_FROM_COMPOUND:e=>wa(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>xa(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Ba(e),CHANGE_1_SYLL_IN_2SYLL:e=>ma(e),CHANGE_1_SYLL_IN_3SYLL:e=>ga(e),CHANGE_1_PHONEME_IN_1SYLL:e=>_a(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Ea(e)};async function va(e,t={}){const n=Da[e];return n?await n(t):[]}async function Oa(e){const t=[null,"count"],n=Object.keys(Fn);let o=0;for(const u of t)for(const r of n){const i=Fn[r];iu(r,{difficulty:i.difficulty?u:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++o%6===0&&await new Promise(s=>setTimeout(s,0))}}async function La(e){return(await Le({...e,fullCount:!0})).length}async function Ra(e={}){const t=[];for(const s of Ge)s.w&&t.push(s.w);const n=e.excludeNoImage?Gt(t):t,o=new Set,u=new Set,r=new Set,i=new Set;for(const s of n){i.add(pn(s));for(const c of s){const C=le(c);if(C&&(ke[C.cho]!=="\u3147"&&o.add(ke[C.cho]),u.add(rt[C.jung]),C.jong>0)){r.add(Fe[C.jong]);const f=$t[C.jong];f&&f.forEach(p=>r.add(p))}}}return{cho:o,jung:u,jong:r,syllable:i}}const bt="\uC804\uCCB4";function Ia(...e){return e.filter(Boolean).join(" ")}/**
|
|
1
|
+
"use strict";var l=require("react"),gt=require("react-i18next"),V=require("react/jsx-runtime"),Bo=require("react-dom"),Pn=typeof document<"u"?document.currentScript:null;function gr({storageKey:e="fontScale",baseFont:t=20,minScale:n=.8,maxScale:o=1.4,step:u=.1,lineHeightRatio:r=1.4}={}){const i=_=>Math.max(n,Math.min(o,Number(_))),[s,d]=l.useState(()=>{try{const _=localStorage.getItem(e),g=_?Number(_):1;return Number.isFinite(g)?g:1}catch{return 1}});l.useEffect(()=>{try{localStorage.setItem(e,String(s))}catch{}},[e,s]);const p=_=>{d(typeof _=="function"?g=>i(_(g)):i(_))},f=()=>p(_=>+(_+u).toFixed(6)),C=()=>p(_=>+(_-u).toFixed(6)),c=s<o-Number.EPSILON,m=s>n+Number.EPSILON,S=Math.round(t*s),w=Math.round(S*r);return{scale:s,setScale:p,increase:f,decrease:C,canIncrease:c,canDecrease:m,fontSize:S,lineHeight:w}}const Do=l.createContext(null);function _r(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Er(e){const t=l.useContext(Do),n=r=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(r).matches,[o,u]=l.useState(n(e));return l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=d=>u(d.matches),s=r;return s.addEventListener?s.addEventListener("change",i):s.addListener&&s.addListener(i),u(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",i):s.removeListener&&s.removeListener(i)}},[e]),t&&typeof t.mobile=="boolean"&&_r(e)?t.mobile:o}function vo(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),t}function Oo(e,t){const n=vo(t);l.useEffect(()=>{const o=()=>n.current();try{window.addEventListener(e,o)}catch{}return()=>{try{window.removeEventListener(e,o)}catch{}}},[e,n])}const $n=" \xB7 ",Lo=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes($n)?e.split($n).pop()??e:e})(),Ro=l.createContext(!1);function br(e){const t=l.useContext(Ro);l.useEffect(()=>{if(t||typeof e!="string"||!e)return;const n=document.title;return document.title=Lo?`${e}${$n}${Lo}`:e,()=>{document.title=n}},[e,t])}function Sr(){const{t:e}=gt.useTranslation();return l.useCallback(t=>{if(!t)return"";const n=new Date(t).getTime();if(Number.isNaN(n))return"";const o=Math.floor((Date.now()-n)/864e5);return o<=0?e("myHomework.relativeDay.today","\uC624\uB298"):o===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n:o})},[e])}function kr(e){const[t,n]=l.useState({current:"",next:"",confirm:""}),[o,u]=l.useState(null),[r,i]=l.useState(!1),s=l.useRef(null);l.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);const d=l.useCallback(()=>{n({current:"",next:"",confirm:""}),u(null)},[]),p=l.useCallback(async()=>{if(!t.current){u({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!t.next){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(t.next!==t.confirm){u({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}i(!0);const f=e?await e(t.current,t.next):null;if(i(!1),f){u({type:"error",text:f});return}u({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),n({current:"",next:"",confirm:""}),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>u(null),1500)},[t,e]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:u,pwLoading:r,handleChangePw:p,reset:d}}const ke=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],rt=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Fe=["","\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 le(e){if(!e)return null;const t=e.charCodeAt(0)-44032;return t<0||t>=11172?null:{cho:Math.floor(t/588),jung:Math.floor(t%588/28),jong:t%28}}function Ar(){const e=new Map;return t=>{let n=e.get(t);return n||(n=[...t].map(o=>le(o)),e.set(t,n)),n}}function _t(e,t,n=0){return String.fromCharCode(44032+(e*21+t)*28+n)}function wr(e,t){if(!e||!t||e===t||e.length!==t.length)return"random";let n=0,o=null;for(let u=0;u<e.length;u++){const r=le(e[u]),i=le(t[u]);if(!r||!i)return"random";if(r.cho===i.cho&&r.jung===i.jung&&r.jong===i.jong)continue;n++;const s=r.cho!==i.cho,d=r.jung!==i.jung,p=r.jong!==i.jong;(s?1:0)+(d?1:0)+(p?1:0)>1?o="multi":s?o="cho":d?o="jung":o="jong"}return n!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}const $t={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($t).map(([e,t])=>[t.join(""),Fe[Number(e)]]));function Mr(e,t){if(!e||!t)return!1;for(const n of e){const o=le(n);if(o){if(ke[o.cho]===t)return!0;if(o.jong>0){if(Fe[o.jong]===t)return!0;const u=$t[o.jong];if(u&&u.includes(t))return!0}}}return!1}function pn(e){if(!e)return 0;let t=0;for(const n of e)le(n)&&t++;return t}function Nr(e){if(!e)return!1;let t=!1;for(const n of e){const o=le(n);if(o&&(t=!0,o.jong>0))return!1}return t}function Tr(e,t){if(e.jong<=0)return!1;if(t.includes(Fe[e.jong]))return!0;const n=$t[e.jong];return!!n&&n.some(o=>t.includes(o))}function xr(e,t,n){if(!e)return!1;const o=[...e],u=r=>{const i=le(o[r]);if(!i||t.cho&&!t.cho.includes(ke[i.cho])||t.jung&&!t.jung.includes(rt[i.jung]))return!1;if(t.jongNone){if(i.jong>0)return!1}else if(t.jong&&!Tr(i,t.jong))return!1;return!0};if(n==="head")return u(0);if(n==="tail")return u(o.length-1);if(n==="mid"){for(let r=1;r<o.length-1;r++)if(u(r))return!0;return!1}for(let r=0;r<o.length;r++)if(u(r))return!0;return!1}const Br={cho:ke.length,jung:rt.length,jong:Fe.length};function Dr(e,t,n,o,u=1/0){if(!e||n<1)return[];const r=[...e].map(C=>le(C));if(r.some(C=>!C))return[];const i=r,s=i.length;if(n>s)return[];const d=Br[t],p=new Set,f=[];(function C(c,m){if(m.length===n){f.push([...m]);return}for(let S=c;S<s;S++)m.push(S),C(S+1,m),m.pop()})(0,[]);for(const C of f)if((function c(m,S){if(p.size>=u)return;if(m===C.length){const g=S.map(k=>_t(k.cho,k.jung,k.jong)).join("");g!==e&&o.has(g)&&p.add(g);return}const w=C[m],_=i[w][t];for(let g=0;g<d;g++){if(g===_)continue;const k=S.slice();if(k[w]={...S[w],[t]:g},c(m+1,k),p.size>=u)return}})(0,i),p.size>=u)break;return[...p]}function vr(e,t){if(!e||!t||e.length!==t.length)return-1;let n=0;for(let o=0;o<e.length;o++){const u=le(e[o]),r=le(t[o]);if(!u||!r)return-1;u.cho!==r.cho&&n++,u.jung!==r.jung&&n++,u.jong!==r.jong&&n++}return n}const Io="word_pair_index_v2",jo="word_pair_index_sig_v2";let Ft=null;function Or(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Io),t=localStorage.getItem(jo);return!e||!t?null:{index:JSON.parse(e),sig:t}}catch{return null}}function Ht(){if(Ft)return Ft;const e=Or();return e?(Ft=e.index,e.sig,Ft):null}function Lr(){Ft=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Io),localStorage.removeItem(jo))}catch{}}const Po="word_image_existence_map_v1";let Bt=null;function $o(){if(Bt)return Bt;try{const e=typeof localStorage<"u"?localStorage.getItem(Po):null;Bt=e?JSON.parse(e):{}}catch{Bt={}}return Bt}function Rr(e,t){return`${e}_${t??1}`}function Ir(e,t){const n=$o(),o=Rr(e,t);return o in n?n[o]:void 0}function Fo(){const e=$o(),t=Object.values(e);return t.length===0?null:{total:t.length,exists:t.filter(Boolean).length}}function jr(){Bt={};try{typeof localStorage<"u"&&localStorage.removeItem(Po)}catch{}}const Ho=[{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 zo(e){return e.reduce((t,n)=>{try{const o=localStorage.getItem(n);return t+(o?new Blob([o]).size:0)}catch{return t}},0)}function Pr(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 $r(e){const{t}=gt.useTranslation(),[n,o]=l.useState({}),[u,r]=l.useState(null),[i,s]=l.useState(null),[d,p]=l.useState(null),f=l.useCallback(()=>{const c={};Ho.forEach(m=>{c[m.id]=zo([...m.keys])}),o(c),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(m=>{p({usage:m.usage??0,quota:m.quota??0})}).catch(()=>{})},[]);l.useEffect(()=>{f()},[f]);const C=l.useCallback(async c=>{r(c);try{c==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):c==="pairIndex"?Lr():c==="imageCache"&&jr(),f(),e?.(t("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[f,e,t]);return{cacheSizes:n,clearingId:u,confirmCacheId:i,setConfirmCacheId:s,storageEstimate:d,refreshCacheSizes:f,handleClearCache:C}}function Fr(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useCallback(()=>{const i=Ht();if(i){const d=Object.values(i),p=d.filter(f=>f.cho.length+f.jung.length+f.jong.length>0).length;n({matched:p,total:d.length})}else n(null);const s=Fo();u(s?{exists:s.exists,total:s.total}:null)},[]);return l.useEffect(()=>{r();const i=setTimeout(r,1e3);return()=>clearTimeout(i)},[e?.length,r]),{pairStats:t,imgStats:o,setPairStats:n,setImgStats:u,refreshStats:r}}function Vo(e,t=[]){const[n,o]=l.useState(t),[u,r]=l.useState(null),[i,s]=l.useState(!1),[d,p]=l.useState(e),f=l.useRef(i);l.useEffect(()=>{f.current=i});const C=l.useRef(null);l.useEffect(()=>{if(f.current)return;const g=C.current;g!==null&&g.length===t.length&&g.every((k,A)=>k===t[A])||(C.current=t,o(t))},[t]);const c=l.useCallback(g=>{r(g),s(!1),p({...g})},[]),m=l.useCallback(()=>s(!0),[]),S=l.useCallback(()=>s(!1),[]),w=l.useCallback((g,k)=>{o(g),r(k),s(!1)},[]),_=l.useCallback(g=>{o(k=>k.filter(A=>A!==g)),r(null)},[]);return{list:n,setList:o,selected:u,setSelected:r,isEditing:i,setIsEditing:s,editForm:d,setEditForm:p,openDetail:c,startEditing:m,cancelEditing:S,commitEdit:w,remove:_}}const zt=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},Hr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function zr(e=[]){const{list:t,setList:n,selected:o,setSelected:u,isEditing:r,setIsEditing:i,editForm:s,setEditForm:d,openDetail:p,commitEdit:f}=Vo(Hr,e),{year:C,month:c,day:m}=zt(),[S,w]=l.useState({year:C,month:c,day:m,hour:"09",minute:"00",memo:""});return{visitHistory:t,visitForm:S,setVisitForm:w,setVisit:_=>g=>w(k=>({...k,[_]:g})),selectedVisit:o,setSelectedVisit:u,isEditingVisit:r,setIsEditingVisit:i,editVisitForm:s,setEditVisitForm:d,openVisitDetail:p,handleVisitSave:_=>{n(T=>[S,...T]);const{year:g,month:k,day:A}=zt();w({year:g,month:k,day:A,hour:"09",minute:"00",memo:""}),_?.()},handleVisitEditSave:()=>{f(_=>_.map(g=>g===o?s:g),s)},addVisit:_=>{n(g=>[_,...g])},removeVisit:_=>{n(g=>g.filter(k=>k!==_))},revertVisitEdit:(_,g)=>{n(k=>k.map(A=>A===g?_:A)),u(k=>k===g?_:k)}}}const Uo=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")}`,Cn=e=>[...e].sort((t,n)=>{const o=Uo(t),u=Uo(n);return o<u?-1:o>u?1:0}),Vr={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Ur(e,t=[]){const n=l.useMemo(()=>Cn(t),[t]),{list:o,setList:u,selected:r,setSelected:i,isEditing:s,setIsEditing:d,editForm:p,setEditForm:f,openDetail:C,commitEdit:c,remove:m}=Vo(Vr,n),[S,w]=l.useState([]),{year:_,month:g,day:k}=zt(),[A,T]=l.useState({year:_,month:g,day:k,hour:"09",minute:"00",memo:""}),v=F=>B=>T(O=>({...O,[F]:B})),D=F=>{u(Z=>Cn([...Z,A]));const{year:B,month:O,day:ye}=zt();T({year:B,month:O,day:ye,hour:"09",minute:"00",memo:""}),F?.()},I=()=>{c(F=>Cn(F.map(B=>B===r?p:B)),p)},$=l.useCallback(F=>{m(F)},[m]),G=l.useCallback(F=>{e({year:F.year,month:F.month,day:F.day,hour:F.hour,minute:F.minute,memo:F.memo}),m(F)},[e,m]),P=l.useCallback(F=>{u(B=>B.filter(O=>O!==F)),w(B=>[F,...B]),i(null)},[u,i]),Q=l.useCallback(F=>{u(B=>Cn([...B,F]))},[u]),Y=l.useCallback(F=>{u(B=>B.filter(O=>O!==F))},[u]),W=l.useCallback((F,B)=>{u(O=>O.map(ye=>ye===B?F:ye)),i(O=>O===B?F:O)},[u,i]);return{scheduleList:o,noShowList:S,addSchedule:Q,removeSchedule:Y,revertScheduleEdit:W,scheduleForm:A,setScheduleForm:T,setSchedule:v,selectedSchedule:r,setSelectedSchedule:i,isEditingSchedule:s,setIsEditingSchedule:d,editScheduleForm:p,setEditScheduleForm:f,openScheduleDetail:C,handleScheduleSave:D,handleScheduleEditSave:I,handleScheduleDelete:$,handleScheduleToVisit:G,handleScheduleNoVisit:P}}const Go=[{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 Gr(e){const[t,n]=l.useState(""),[o,u]=l.useState("25"),[r,i]=l.useState("all"),[s,d]=l.useState(1),p=l.useMemo(()=>e.filter(({item:m,status:S})=>!(t&&!m.memo.includes(t)||r!=="all"&&S!==r)),[e,t,r]),f=Math.max(1,Math.ceil(p.length/Number(o))),C=Math.min(s,f),c=l.useMemo(()=>p.slice((C-1)*Number(o),C*Number(o)),[p,C,o]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:u,vapStatus:r,setVapStatus:i,vapPage:C,setVapPage:d,vapFiltered:p,vapTotal:f,vapPageItems:c}}function Yr(e,t){const{t:n}=gt.useTranslation(),[o,u]=l.useState("25"),[r,i]=l.useState(1),[s,d]=l.useState(t);s!==t&&(d(t),r!==1&&i(1));const p=l.useMemo(()=>Go.map(m=>({...m,label:n("visits.showN",{n:m.value})})),[n]),f=l.useCallback(m=>{u(m),i(1)},[]),C=Math.max(1,Math.ceil(e.length/Number(o))),c=Math.min(r,C);return{pageRows:l.useMemo(()=>e.slice((c-1)*Number(o),c*Number(o)),[e,c,o]),pageSizeProps:{options:p,value:o,onChange:f},paginationProps:{page:c,total:C,onChange:i},setPage:i}}function qr(){const[e,t]=l.useState(null),n=l.useCallback(u=>{t(r=>r?.key===u?{key:u,asc:!r.asc}:{key:u,asc:!0})},[]),o=l.useCallback((u,r)=>({label:u,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>n(r)}),[e,n]);return{\uC815\uB82C:e,\uCE78:o}}function Wr(){const[e,t]=l.useState(!1),[n,o]=l.useState("\uC88C"),[u,r]=l.useState({\uC88C:null,\uC6B0:null}),[i,s]=l.useState({\uC88C:[],\uC6B0:[]}),[d,p]=l.useState(!1),[f,C]=l.useState("\uC88C"),c=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),s(_=>({..._,[w]:[S,..._[w]]})),t(!1)},[]),m=l.useCallback(S=>{const w=S.direction;r(_=>({..._,[w]:S})),p(!1)},[]);return{showDevice:e,setShowDevice:t,deviceDirection:n,setDeviceDirection:o,devices:u,setDevices:r,deviceHistory:i,setDeviceHistory:s,showDeviceList:d,setShowDeviceList:p,listForSide:f,setListForSide:C,handleDeviceSubmit:c,handleSelectFromList:m}}const Kr="__ihab_core_word_pool__";function yn(){return globalThis[Kr]??null}function re(e,t=Math.random){const n=e.slice();for(let o=n.length-1;o>0;o--){const u=Math.floor(t()*(o+1));[n[o],n[u]]=[n[u],n[o]]}return n}function at(e,t,n=Math.random){return!Array.isArray(e)||e.length===0||t<=0?[]:t>=e.length?re(e,n):re(e,n).slice(0,t)}const Fn={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"}},Xr=ke.indexOf("\u3147"),Yo={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!==Xr},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}},Zr={\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"},Jr={\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 qo(e){return Zr[e]??e}const Hn={cho:ke,jung:rt,jong:Fe},_e=e=>Array.isArray(e)?e.length>0:!!e;function zn(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const o=e[n],u=t[n];if(!(!o||!u)&&(o.cho!==u.cho&&ke[o.cho]==="\u3147"!=(ke[u.cho]==="\u3147")||o.jong!==u.jong&&o.jong===0!=(u.jong===0)))return!0}return!1}function Qr(e,t,n){const o=n.pronOf(e),u=n.decompOf,r=n.sameStructureOnly&&u?u(o):null,i=[];for(const s of t)s!==e&&(n.okSet&&!n.okSet.has(s)||n.pronOf(s)!==o&&(r&&u&&zn(r,u(n.pronOf(s)))||i.push(s)));return i}function Wo(e,t,n){const o=t?.[e];if(!o)return[];const u=n.kind?o[n.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return Qr(e,u,n)}function ea(e,t,n,o,u,r,i){const s=["cho","jung","jong"].filter(c=>_e(e[c])),d={};for(const c of s){const m=e[c];d[c]=new Set(Array.isArray(m)?m:[m])}const p=u==="pron",f=new Map;for(const c of t){const m=n(r(c));if(m.some(g=>!g))continue;let S=m;if(!p&&(S=n(c),S.length!==m.length||S.some(g=>!g)))continue;const w=m.length,_=f.get(w);_?_.push({w:c,dPron:m,dPos:S}):f.set(w,[{w:c,dPron:m,dPos:S}])}const C=new Map;for(const[c,m]of f){const S=new Map,w=(_,g)=>{const k=_.dPos[g];return k!=null&&s.every(A=>d[A].has(Hn[A][k[A]]))};for(const _ of m){let g;if(i==="head")g=w(_,0)?0:-1;else if(i==="tail")g=w(_,c-1)?c-1:-1;else if(i==="mid"){g=-1;for(let A=1;A<c-1;A++)if(w(_,A)){g=A;break}}else g=_.dPos.findIndex(A=>A!=null&&s.every(T=>d[T].has(Hn[T][A[T]])));if(g<0)continue;const k=S.get(g);k?k.push(_):S.set(g,[_])}for(const[_,g]of S){const k=new Set(s.map(v=>_+":"+v)),A=v=>{let D="";for(let I=0;I<c;I++){const $=v[I];for(const G of["cho","jung","jong"])D+=(k.has(I+":"+G)?"*":$[G])+"."}return D},T=new Map;for(const v of m){const D=A(v.dPron),I=T.get(D);I?I.push(v):T.set(D,[v])}for(const v of g){const D=T.get(A(v.dPron))??[],I=[];for(const $ of D){if($.w===v.w)continue;let G=!0;for(const P of s){const Q=v.dPron[_][P],Y=$.dPron[_][P];if(Y===Q){G=!1;break}if(p&&d[P].has(Hn[P][Y])){G=!1;break}}G&&(o&&zn(v.dPron,$.dPron)||I.push($.w))}C.set(v.w,I)}}}return C}const ta=e=>e==null?[]:Array.isArray(e)?e:[e];function na(e){if([...e].length!==1)return"";const t=le(e);if(!t)return"";const n=qo(Fe[t.jong]),o=n===""?0:Fe.indexOf(n);return _t(t.cho,t.jung,o<0?0:o)}function Ko(e,t){return t.get(e)||na(e)||e}function Vn(e){return e?_e(e.cho)?"cho":_e(e.jung)?"jung":_e(e.jong)?"jong":null:null}function Dt(e,t){const n=(o,u)=>!_e(o)||ta(o).includes(u);return n(t.cho,ke[e.cho])&&n(t.jung,rt[e.jung])&&n(t.jong,Fe[e.jong])}function Vt(e,t,n){const o=[...e];if(n!=="pron")return o.map(r=>le(r));const u=[...t.get(e)||e];return u.length!==o.length?o.map(r=>le(r)):u.map(r=>le(r))}function Ut(e,t,n,o,u){const r=t==="cho"?ke:t==="jung"?rt:Fe,i=e[t],s=[],d=new Set([Ko(n,u)]),p=re(r.map((f,C)=>C).filter(f=>f!==i&&(t!=="cho"||r[f]!=="\u3147")&&(t!=="jong"||f!==0)));for(const f of p){if(s.length>=o)break;const C=t==="cho"?_t(f,e.jung,e.jong):t==="jung"?_t(e.cho,f,e.jong):_t(e.cho,e.jung,f),c=Ko(C,u);d.has(c)||(d.add(c),s.push(C))}return s}function oa(e,t,n,o,u,r=null){const i=[...e];if(i.length!==2)return null;const s=i.map(C=>le(C));if(s.some(C=>!C))return null;const d=Vt(e,n,o);if(d.some(C=>!C))return null;const p=Vn(t);let f=p&&t?d.map((C,c)=>Dt(C,t)?c:-1).filter(C=>C>=0):[0,1];if(r!=null&&(f=f.filter(C=>C!==r)),!f.length)return null;for(const C of re(f)){const c=i[C];if(!u.has(c))continue;const m=Ut(s[C],p??"cho",c,40,n),S=[];for(const w of m)if(w!==c&&u.has(w)&&!S.includes(w)&&S.push(w),S.length>=2)break;if(!(S.length<2))return{question:e,distractors:[c,...S]}}return null}function ua(e,t,n,o,u,r=null){const i=[...e];if(i.length!==3)return null;const s=i.map(C=>le(C));if(s.some(C=>!C))return null;const d=Vt(e,n,o);if(d.some(C=>!C))return null;const p=Vn(t),f=p&&t?d.map((C,c)=>Dt(C,t)?c:-1).filter(C=>C>=0):[0,1,2];if(!f.length)return null;for(const C of re(f))for(const c of re([0,1,2].filter(m=>m!==C&&(r==null||m===r)))){const m=[0,1,2].filter(k=>k!==c),S=m.map(k=>i[k]).join("");if(!u.has(S))continue;const w=m.indexOf(C),_=Ut(s[C],p??"cho",i[C],40,n),g=[];for(const k of _){const A=m.map(v=>i[v]);A[w]=k;const T=A.join("");if(T!==S&&u.has(T)&&!g.includes(T)&&g.push(T),g.length>=2)break}if(!(g.length<2))return{question:e,distractors:[S,...g]}}return null}function ra(e,t,n,o,u,r=null){const i=[...e],s=i.length;if(s<2)return null;const d=[];for(let f=1;f<=s-1;f++)d.push({remain:i.slice(0,f).join(""),dropped:i.slice(f).join(""),droppedEnd:1}),d.push({remain:i.slice(s-f).join(""),dropped:i.slice(0,s-f).join(""),droppedEnd:0});const p=Vn(t);for(const{remain:f,dropped:C,droppedEnd:c}of re(d)){if(r!=null&&c!==r||f===e||!u.has(f)||!u.has(C))continue;const m=[...f],S=m.map(g=>le(g));if(S.some(g=>!g))continue;const w=Vt(f,n,o);if(w.some(g=>!g))continue;const _=p&&t?w.map((g,k)=>Dt(g,t)?k:-1).filter(g=>g>=0):m.map((g,k)=>k);if(_.length)for(const g of re(_)){const k=Ut(S[g],p??"cho",m[g],40,n),A=[];for(const T of k){const v=[...m];v[g]=T;const D=v.join("");if(D!==f&&u.has(D)&&!A.includes(D)&&A.push(D),A.length>=2)break}if(A.length>=2)return{question:e,distractors:[f,...A]}}}return null}function aa(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=le(n.get(e)||e);if(!i||i.jong===0)return null;const s=_t(i.cho,i.jung,0),d=Ut({cho:i.cho,jung:i.jung,jong:0},"cho",s,2,n);return d.length<2?null:{question:e,distractors:[s,...d]}}const Un=ke.indexOf("\u3147");function ia(e,t,n,o,u,r=null){if([...e].length!==1)return null;const i=le(n.get(e)||e);if(!i||i.jong!==0||i.cho===Un)return null;const s=_t(Un,i.jung,0),d=Ut({cho:Un,jung:i.jung,jong:0},"jung",s,2,n);return d.length<2?null:{question:e,distractors:[s,...d]}}function sa(e){const t=new Map;for(const n of e){const o=[...n],u=o.length;if(!(u<2||u>3))for(let r=0;r<u;r++){let i=u+"|"+r+"|";for(let d=0;d<u;d++)i+=d===r?"*":o[d];const s=t.get(i);s?s.push(n):t.set(i,[n])}}return t}function la(e,t,n,o,u,r=null,i=null,s=2){const d=[...e],p=d.length;if(p<2||p>3)return null;const f=d.map(k=>le(k));if(f.some(k=>!k))return null;const C=Vt(e,n,o);if(C.some(k=>!k))return null;const c=k=>n.get(k)??k,m=c(e),S=!!t&&(_e(t.cho)||_e(t.jung)||_e(t.jong)),w=!!i&&(_e(i.cho)||_e(i.jung)||_e(i.jong)),_=k=>{let A=p+"|"+k+"|";for(let T=0;T<p;T++)A+=T===k?"*":d[T];return A};let g;if(r!=null){if(r>=p||S&&!Dt(C[r],t))return null;g=[r]}else S?g=C.map((k,A)=>Dt(k,t)?A:-1).filter(k=>k>=0):g=Array.from({length:p},(k,A)=>A);for(const k of re(g)){const A=u.get(_(k))??[],T=[],v=[];for(const P of A){if(P===e)continue;const Q=[...P].map(B=>le(B)),Y=f[k],W=Q[k];if(!Y||!W)continue;let F=0;if(Y.cho!==W.cho&&F++,Y.jung!==W.jung&&F++,Y.jong!==W.jong&&F++,!(F<s||c(P)===m))if(w){const B=Vt(P,n,o)[k];B&&Dt(B,i)?T.push(P):v.push(P)}else T.push(P)}if(!T.length)continue;const D=re(T)[0],I=[],$=new Set([m,c(D)]),G=w?v:T.filter(P=>P!==D);for(const P of re(G)){const Q=c(P);if(!$.has(Q)&&($.add(Q),I.push(P),I.length>=2))break}if(!w&&I.length<2)for(const P of re(A)){if(P===e||P===D)continue;const Q=c(P);if(!$.has(Q)&&($.add(Q),I.push(P),I.length>=2))break}if(!(I.length<2))return{question:e,distractors:[D,...I]}}return null}let mn=null,Xo=null,Zo=null;function ca(){const e=yn();if(e&&e.entries.length>0){const t=Ht();if(mn&&Xo===e&&Zo===t)return mn;const n=new Set,o=[];for(const u of e.entries)!u.word||n.has(u.word)||(n.add(u.word),o.push({w:u.word,s:u.syllables,p:t?.[u.word]?[...t[u.word].cho??[],...t[u.word].jung??[],...t[u.word].jong??[]]:[],pron:u.pronunciation||u.word,grade:u.grade}));return mn=o,Xo=e,Zo=t,mn}return[]}const Ge=new Proxy([],{get(e,t){const n=ca(),o=n[t];return typeof o=="function"?o.bind(n):o}});function gn(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Ye(e,t){if(t>=e.length)return re(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const u=o+Math.floor(Math.random()*(n.length-o)),r=n[o];n[o]=n[u],n[u]=r}return n.slice(0,t)}let Gn=null,Jo=null;function Et(){const e=yn();if(Gn&&Jo===e)return Gn;const t=new Map;for(const n of Ge)n.w&&t.set(n.w,n.pron);return Gn=t,Jo=e,t}function Oe(e){return Et().get(e)||e}function Yn(e,t,n=new Set){const o=[];for(const u of re(e)){if(o.length>=t)break;const r=Oe(u);n.has(r)||(n.add(r),o.push(u))}return o}let da=0;function Ae(e){return`${e}-rt-${++da}`}function Gt(e){const t=Fo();if(!t||t.total===0){const o=new Set;for(const u of e)o.add(u);return o}const n=new Set;for(const o of e)Ir(o)===!0&&n.add(o);return n}const _n=new Map;let Qo=null,eu=null;function Yt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function tu(e){const t=Yt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),u=n?`${Yt(n.cho)}/${Yt(n.jung)}/${Yt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",r=Yt(e.grade);return`${e.difficulty??""}|${t}|${u}|${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${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Le(e){const t=yn(),n=Ht();(t!==Qo||n!==eu)&&(_n.clear(),Qo=t,eu=n);const o=tu(e);return _n.has(o)||_n.set(o,fa(e)),_n.get(o)}function ha(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),u=!!e.jongNone,r=u?null:t(e.jong);return n||o||r||u?u&&!n&&!o&&!r?i=>Nr(i):i=>xr(i,{cho:n,jung:o,jong:r,jongNone:u}):null}async function fa(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:u=null,excludeNoImage:r=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,d=e.phonemeView==="pron"?"pron":"char",p=Math.max(1,e.contrastCount??1),f=t==="cho"||t==="jung"||t==="jong",C=f&&p>=2,c=t==="count",m=n?new Set(Array.isArray(n)?n:[n]):null,S=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[ha(o),S?M=>S.has(pn(M)):null].filter(M=>M!=null):[],_=t==="random"||t===null,g=_||c,k=_||C||c;let A=Ge.filter(M=>!M.w||i&&(!M.grade||!i.has(M.grade))?!1:k?!0:Array.isArray(M.p)&&M.p.length>0);m&&(A=A.filter(M=>{for(const j of m)if(Mr(M.w,j))return!0;return!1})),w.length>0&&(A=A.filter(M=>{const j=d==="pron"?Oe(M.w):M.w;return w.every(ae=>ae(j))})),u&&(A=A.filter(M=>M.w[0]===u));let T;if(r){const M=new Set;for(const j of A)if(M.add(j.w),Array.isArray(j.p))for(const ae of j.p)M.add(ae);if(g)for(const j of Ge)j.w&&M.add(j.w);T=Gt(M)}else{const M=new Set;for(const j of A)if(M.add(j.w),Array.isArray(j.p))for(const ae of j.p)M.add(ae);if(g)for(const j of Ge)j.w&&M.add(j.w);T=M}let v=null;if(C){const M=new Set;for(const j of Ge)j.w&&M.add(j.w);v=r?Gt(M):M}const D=A.filter(M=>T.has(M.w)),I=600,$=Array.from(T),G=$.length>I?Ye($,I):$,P=c&&o!=null&&(_e(o.cho)||_e(o.jung)||_e(o.jong)),Q=2500,Y=new Map;if(c&&!P&&p>=2){for(const M of $){const j=pn(M),ae=Y.get(j);ae?ae.push(M):Y.set(j,[M])}for(const[M,j]of Y)j.length>Q&&Y.set(M,Ye(j,Q))}const W=Ar(),F=P?ea(o,$,W,s,d,Oe):null,B=500,O=1500,ye=e.fullCount?D:t==="random"?D.length>B?Ye(D,B):D:D.length>O?Ye(D,O):D,Z=Ht(),ee=[];for(const M of ye){let j;const ae=Oe(M.w);if(C)j=Dr(M.w,t,p,v,24).filter(ne=>Oe(ne)!==ae);else if(c)P?j=(F.get(M.w)??[]).filter(ne=>Oe(ne)!==ae):p<=1?j=Wo(M.w,Z,{okSet:T,pronOf:Oe,decompOf:W,sameStructureOnly:!1}):j=(Y.get(pn(M.w))??[]).filter(ne=>{if(ne===M.w||Oe(ne)===ae)return!1;const q=vr(M.w,ne);return p>=5?q>=5:q===p});else if(_)j=G.filter(ne=>ne!==M.w&&ne.length===M.w.length&&Oe(ne)!==ae);else{const ne=t;j=Wo(M.w,Z,{kind:ne,okSet:T,pronOf:Oe,decompOf:W,sameStructureOnly:!1}),j.length===0&&(j=(G.length>30?Ye(G,30):G).filter(q=>q!==M.w&&wr(M.w,q)===t&&Oe(q)!==ae))}if(s&&j.length>0&&(f||c&&!P)){const ne=W(Oe(M.w));j=j.filter(q=>!zn(ne,W(Oe(q))))}j.length!==0&&ee.push({word:M,usable:j})}return ee}async function nu(e,t){const{choicesPerItem:n=3,count:o=10}=t,u=n-1,r=(await Le(t)).filter(s=>s.usable.length>=u),i=[];for(const s of re(r)){if(i.length>=o)break;const d=Yn(s.usable,u);if(d.length<u)continue;const p=re([s.word.w,...d]);i.push({id:Ae(e+"-item"),index:i.length+1,word:s.word.w,syllables:s.word.s,choices:p,answerIndex:p.indexOf(s.word.w)})}return i}async function pa(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Le({...e,difficulty:null});if(u.length<t)return[];const r=[],i=re([...u]);for(const s of i){if(r.length>=n)break;const d=s.word.w,p=[...s.word.pron||d],f=gn(p);if(!f)continue;const C=u.filter(S=>S.word.w!==d&&S.word.s===s.word.s&&!(S.word.pron||S.word.w).includes(f)&&S.word.pron!==s.word.pron);if(C.length<o)continue;const c=Yn(C.map(S=>S.word.w),o);if(c.length<o)continue;const m=re([d,...c]);r.push({id:Ae("HPI-item"),index:r.length+1,targetSyllable:f,word:d,choices:m,answerIndex:m.indexOf(d)})}return r}async function Ca(e){const{count:t=10}=e,n=(await Le(e)).filter(o=>o.usable.length>=1);return Array.from({length:t},(o,u)=>{const r=gn(n);if(!r)return null;const i=u%2===0;let s;if(i)s=[r.word.w,r.word.w];else{const d=gn(r.usable);s=Math.random()<.5?[r.word.w,d]:[d,r.word.w]}return{id:Ae("SOD-item"),index:u+1,word:r.word.w,pair:s,same:i}}).filter(o=>!!o)}async function ya(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,u=await Le({...e,difficulty:null});if(u.length<t+1)return[];const r=u.map(c=>c.word.w),i=new Map(u.map(c=>[c.word.w,c.word.pron])),s=c=>(i.get(c)||c)[0]??"",d={};for(const c of u){const m=s(c.word.w);m&&(d[m]||(d[m]=[]),d[m].push(c.word.w))}const p=Object.entries(d).filter(([,c])=>c.length>=2).map(([c])=>c);if(p.length===0)return[];const f=[],C=re([...p]);for(let c=0;f.length<n&&c<n*4;c++){const m=C[c%C.length],S=d[m];if(S.length<2)continue;const w=re([...S]),_=w[0],g=w[1];if(!_||!g||_===g||(i.get(_)||_)===(i.get(g)||g))continue;const k=i.get(g)||g,A=r.filter(D=>s(D)!==m&&D!==_&&D!==g&&D.length===g.length&&(i.get(D)||D)!==k);if(A.length<o)continue;const T=Yn(A,o);if(T.length<o)continue;const v=re([g,...T]);f.push({id:Ae("SWS-item"),index:f.length+1,sourceWord:_,targetSyllable:m,word:g,choices:v,answerIndex:v.indexOf(g)})}return f}function ou(e,t,n){return Ye(e,t).map((o,u)=>{const r=gn(o.usable)??"",i=[...o.word.w],s=[...r],d=i.findIndex((f,C)=>f!==s[C]),p=re(o.usable.filter(f=>f&&f!==r)).slice(0,2);return{id:Ae(n),index:u+1,word:o.word.w,original:o.word.w,changed:r,changedFrom:d>=0?i[d]:"",changedTo:d>=0?s[d]:"",distractors:p}})}async function uu(e,t,n){const{count:o=10}=t,u=Et(),r=Ge.filter(m=>m.w&&m.s===e),i=t.excludeNoImage?Gt(r.map(m=>m.w)):null,s=i?r.filter(m=>i.has(m.w)):r,d=new Set(s.map(m=>m.w)),p=sa(d),f=t.phonemeView??"char",C=t.composition??null,c=[];for(const m of re(s)){if(c.length>=o)break;const S=la(m.w,C,u,f,p,null,null);if(!S)continue;const w=S.distractors[0],_=[...m.w],g=[...w],k=_.findIndex((A,T)=>A!==g[T]);c.push({id:Ae(n),index:c.length+1,word:m.w,original:m.w,changed:w,changedFrom:k>=0?_[k]:"",changedTo:k>=0?g[k]:"",distractors:S.distractors.slice(1)})}return c}async function ma(e){return uu(2,e,"CS2-item")}async function ga(e){return uu(3,e,"CS3-item")}async function _a(e){const t=(await Le({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return ou(t,e.count??10,"CP1-item")}async function Ea(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Le({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return ou(n,e.count??10,"CP2-item")}async function ba(e){const{count:t=10}=e,n=(await Le({...e})).filter(o=>o.word.s===2);return Ye(n,t).map((o,u)=>({id:Ae("M2S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Sa(e){const{count:t=10}=e,n=(await Le({...e})).filter(o=>o.word.s===3);return Ye(n,t).map((o,u)=>({id:Ae("M3S-item"),index:u+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function ka(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s===2),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const d=oa(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=[...s.word.w],c=C[0]===p?C[1]:C[0];i.push({id:Ae("D2-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:c,missingResult:p,distractors:f})}return i}async function Aa(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s===3),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const d=ua(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=[...s.word.w];let c="";for(let m=0;m<C.length;m++)if(C.filter((S,w)=>w!==m).join("")===p){c=C[m];break}i.push({id:Ae("D3-item"),index:i.length+1,original:s.word.w,word:s.word.w,dropped:c,missingResult:p,distractors:f})}return i}async function wa(e){const{count:t=10}=e,n=(await Le({...e})).filter(s=>s.word.s>=2),o=Et(),u=new Set(Ge.map(s=>s.w)),r=e.phonemeView??"char",i=[];for(const s of re(n)){if(i.length>=t)break;const d=ra(s.word.w,e.composition??null,o,r,u);if(!d)continue;const[p,...f]=d.distractors,C=s.word.w,c=C.startsWith(p)?C.slice(p.length):C.endsWith(p)?C.slice(0,C.length-p.length):"";i.push({id:Ae("DPC-item"),index:i.length+1,original:C,word:C,dropped:c,missingResult:p,distractors:f})}return i}async function Ma(e){const{count:t=10}=e,n=(await Le({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,u)=>{const r=Ye(n,3);return{id:Ae("LRO-item"),index:u+1,sequence:r,choices:re(r)}})}function En(e,t,n){const o=Ge.filter(i=>i.w&&i.s===e),u=t?Gt(o.map(i=>i.w)):null,r=[];for(const i of o)if(!(u&&!u.has(i.w))){if(n){const s=le(i.w);if(!s||!n(s))continue}r.push(i)}return r}function Na(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong===0);return Ye(t,e.count??10).map((n,o)=>{const u=le(n.w);return{id:Ae("M2P-item"),index:o+1,parts:[ke[u.cho],rt[u.jung]],answer:n.w,word:n.w}})}function Ta(e){const t=En(1,e.excludeNoImage??!1,n=>n.jong>0&&!$t[n.jong]);return Ye(t,e.count??10).map((n,o)=>{const u=le(n.w);return{id:Ae("M3P-item"),index:o+1,parts:[ke[u.cho],rt[u.jung],Fe[u.jong]],answer:n.w,word:n.w}})}function xa(e){const t=Yo.DROP_FINAL_CONSONANT_FROM_1SYLL,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=Et(),u=[];for(const r of re(n)){if(u.length>=(e.count??10))break;const i=aa(r.w,null,o);if(!i)continue;const[s,...d]=i.distractors;u.push({id:Ae("DFC-item"),index:u.length+1,original:r.w,word:r.w,result:s,distractors:d})}return u}function Ba(e){const t=Yo.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=En(t.syllables,e.excludeNoImage??!1,t.syllable),o=Et(),u=[];for(const r of re(n)){if(u.length>=(e.count??10))break;const i=ia(r.w,null,o);if(!i)continue;const s=le(o.get(r.w)||r.w);if(!s)continue;const[d,...p]=i.distractors;u.push({id:Ae("RCP-item"),index:u.length+1,base:r.w,word:r.w,missingConsonant:ke[s.cho],remaining:d,distractors:p})}return u}const bn=new Map;let ru=null,au=null;async function iu(e,t={}){const n=yn(),o=Ht();(n!==ru||o!==au)&&(bn.clear(),ru=n,au=o);const u=`${e}:${tu(t)}`;if(bn.has(u))return bn.get(u);const r=await va(e,t);return bn.set(u,r),r}const Da={SAME_SOUND_PICK:e=>nu("SSP",e),HEAR_AND_PICK_SAME:e=>nu("HPS",e),HEAR_AND_PICK_INCLUDED:e=>pa(e),SAME_OR_DIFF:e=>Ca(e),STARTS_WITH_SAME_SOUND:e=>ya(e),LISTEN_AND_REMEMBER_ORDER:e=>Ma(e),MERGE_2_SYLLABLES:e=>ba(e),MERGE_3_SYLLABLES:e=>Sa(e),MERGE_2_PHONEMES:e=>Na(e),MERGE_3_PHONEMES:e=>Ta(e),DROP_1_FROM_2SYLL:e=>ka(e),DROP_1_FROM_3SYLL:e=>Aa(e),DROP_PART_FROM_COMPOUND:e=>wa(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>xa(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Ba(e),CHANGE_1_SYLL_IN_2SYLL:e=>ma(e),CHANGE_1_SYLL_IN_3SYLL:e=>ga(e),CHANGE_1_PHONEME_IN_1SYLL:e=>_a(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Ea(e)};async function va(e,t={}){const n=Da[e];return n?await n(t):[]}async function Oa(e){const t=[null,"count"],n=Object.keys(Fn);let o=0;for(const u of t)for(const r of n){const i=Fn[r];iu(r,{difficulty:i.difficulty?u:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++o%6===0&&await new Promise(s=>setTimeout(s,0))}}async function La(e){return(await Le({...e,fullCount:!0})).length}async function Ra(e={}){const t=[];for(const s of Ge)s.w&&t.push(s.w);const n=e.excludeNoImage?Gt(t):t,o=new Set,u=new Set,r=new Set,i=new Set;for(const s of n){i.add(pn(s));for(const d of s){const p=le(d);if(p&&(ke[p.cho]!=="\u3147"&&o.add(ke[p.cho]),u.add(rt[p.jung]),p.jong>0)){r.add(Fe[p.jong]);const f=$t[p.jong];f&&f.forEach(C=>r.add(C))}}}return{cho:o,jung:u,jong:r,syllable:i}}const bt="\uC804\uCCB4";function Ia(...e){return e.filter(Boolean).join(" ")}/**
|
|
2
2
|
* @license lucide-react v1.38.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const $a=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Fa=l.createContext({}),Ha=()=>l.useContext(Fa),za=l.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:o,className:u="",children:r,iconNode:i,...s},
|
|
31
|
+
*/const $a=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Fa=l.createContext({}),Ha=()=>l.useContext(Fa),za=l.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:o,className:u="",children:r,iconNode:i,...s},d)=>{const{size:p=24,strokeWidth:f=2,absoluteStrokeWidth:C=!1,color:c="currentColor",className:m=""}=Ha()??{},S=o??C?Number(n??f)*24/Number(t??p):n??f;return l.createElement("svg",{ref:d,...qn,width:t??p??qn.width,height:t??p??qn.height,stroke:e??c,strokeWidth:S,className:su("lucide",m,u),...!r&&!$a(s)&&{"aria-hidden":"true"},...s},[...i.map(([w,_])=>l.createElement(w,_)),...Array.isArray(r)?r:[r]])});/**
|
|
32
32
|
* @license lucide-react v1.38.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
@@ -778,6 +778,6 @@
|
|
|
778
778
|
*
|
|
779
779
|
* This source code is licensed under the ISC license.
|
|
780
780
|
* See the LICENSE file in the root directory of this source tree.
|
|
781
|
-
*/const h0=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],f0=y("thumbs-up",h0),fu={"alert-triangle":cu,"align-start-vertical":Ga,anchor:w1,"arrow-down":qa,"arrow-left":Ka,"arrow-right":Za,"arrow-right-left":Qa,"arrow-up-a-z":N1,"audio-lines":ti,baby:oi,ban:ri,"bar-chart-2":x1,bell:ii,"book-marked":li,"book-open":di,"bow-arrow":fi,braces:Ci,bug:mi,calendar:D1,"calendar-check":_i,"calendar-days":bi,camera:ki,car:O1,"chart-column":wi,"chart-line":Ni,"chart-pie":xi,check:Di,"chevron-down":t0,"chevron-left":Oi,"chevron-right":Ri,"chevron-up":o0,circle:r0,"clipboard-list":ji,coffee:R1,combine:$i,copy:Hi,"credit-card":Vi,database:Gi,diff:qi,download:Ki,ear:Zi,edit:Qi,"edit-2":ts,"edit-3":os,ellipsis:du,eraser:as,"external-link":ss,eye:cs,"file-text":hs,"flip-horizontal":ps,"folder-open":ys,"folder-plus":gs,gamepad:Es,"gamepad-2":j1,gavel:Ss,"git-merge":As,globe:Ms,headphones:Ts,heart:Bs,home:vs,inbox:$1,info:Ls,"key-round":Is,landmark:Ps,layers:Fs,"layout-dashboard":zs,leaf:Us,lightbulb:Ys,link:Ws,"link-2":Xs,"link-2-off":Js,list:el,"list-checks":nl,"list-ordered":ul,"list-tree":H1,loader:al,"log-out":sl,mail:cl,"map-pin":hl,menu:l0,"message-circle":pl,"message-circle-question-mark":yl,"message-square":gl,"message-square-more":V1,"message-square-text":El,minus:G1,"minus-circle":Sl,moon:d0,"more-horizontal":du,package:Al,palette:Ml,"party-popper":Tl,pause:Bl,pencil:vl,phone:Ll,play:Il,"play-circle":Pl,plus:Fl,printer:zl,"refresh-cw":Ul,repeat:Yl,replace:Wl,rocket:Xl,"rotate-ccw":Jl,"rotate-cw":ec,salad:nc,"scan-search":uc,search:lc,"circle-alert":hu,"alert-circle":hu,"check-circle":ic,scissors:dc,"search-x":fc,send:Cc,settings:mc,"share-2":q1,"shield-check":_c,"shopping-cart":bc,shuffle:kc,"skip-back":wc,"skip-forward":Nc,sparkles:K1,square:xc,star:Dc,store:Oc,"sun-medium":Rc,table:jc,"table-2":$c,terminal:Hc,"text-cursor-input":Vc,"text-initial":Gc,"thumbs-up":f0,ticket:qc,triangle:i0,"trash-2":Kc,"trending-up":Zc,"triangle-alert":cu,trophy:Qc,type:Z1,unlink:t1,upload:o1,user:r1,"user-plus":i1,"user-round":l1,"user-round-check":d1,users:f1,"users-round":C1,volume:Q1,"volume-2":m1,wrench:_1,x:b1,zap:k1};function p0(e){return fu[e]??null}const pu=new Set,C0=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function y0(e){return C0&&!(e in fu)&&!pu.has(e)&&(pu.add(e),console.warn(`[ihabdevteam-core] lucide \uC544\uC774\uCF58 '${e}' \uC774 \uC815\uC801 \uBAA9\uB85D\uC5D0 \uC5C6\uC5B4 \uB80C\uB354\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. utils/lucideIconSet.ts \uC758 STATIC_LUCIDE_ICONS \uC5D0 \uCD94\uAC00\uD558\uC138\uC694.`)),Promise.resolve(null)}const m0=e=>e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Za-z])([0-9])/g,"$1-$2").replace(/[_ ]+/g,"-").toLowerCase();function g0(e){const t=e.toLowerCase();if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||e.includes("/assets/"))return null;const n=(e.split("/").pop()||"").replace(/\.svg$/,"");return n?m0(n):null}const Cu=new Map;function _0(e){const t=typeof e=="string"?g0(e):null,n=t?p0(t)??Cu.get(t)??null:null,[o,u]=l.useState(null);return l.useEffect(()=>{if(!t||n)return;let r=!1;return y0(t).then(i=>{Cu.set(t,i),r||u(i)}),()=>{r=!0}},[t,n]),n??o}/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function E0(e){if(Array.isArray(e))return e}function b0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,u,r,i,s=[],
|
|
782
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k0(e,t){return E0(e)||b0(e,t)||A0(e,t)||S0()}function A0(e,t){if(e){if(typeof e=="string")return yu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yu(e,t):void 0}}const mu=Object.entries,gu=Object.setPrototypeOf,w0=Object.isFrozen,M0=Object.getPrototypeOf,N0=Object.getOwnPropertyDescriptor;let Ce=Object.freeze,ge=Object.seal,vt=Object.create,_u=typeof Reflect<"u"&&Reflect,Wn=_u.apply,Kn=_u.construct;Ce||(Ce=function(t){return t}),ge||(ge=function(t){return t}),Wn||(Wn=function(t,n){for(var o=arguments.length,u=new Array(o>2?o-2:0),r=2;r<o;r++)u[r-2]=arguments[r];return t.apply(n,u)}),Kn||(Kn=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return new t(...o)});const St=fe(Array.prototype.forEach),T0=fe(Array.prototype.lastIndexOf),Eu=fe(Array.prototype.pop),qt=fe(Array.prototype.push),x0=fe(Array.prototype.splice),Ot=Array.isArray,Wt=fe(String.prototype.toLowerCase),Xn=fe(String.prototype.toString),bu=fe(String.prototype.match),Kt=fe(String.prototype.replace),Su=fe(String.prototype.indexOf),B0=fe(String.prototype.trim),D0=fe(Number.prototype.toString),v0=fe(Boolean.prototype.toString),ku=typeof BigInt>"u"?null:fe(BigInt.prototype.toString),Au=typeof Symbol>"u"?null:fe(Symbol.prototype.toString),De=fe(Object.prototype.hasOwnProperty),Xt=fe(Object.prototype.toString),we=fe(RegExp.prototype.test),kt=O0(TypeError);function fe(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return Wn(e,t,o)}}function O0(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Kn(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wt;if(gu&&gu(e,null),!Ot(t))return e;let o=t.length;for(;o--;){let u=t[o];if(typeof u=="string"){const r=n(u);r!==u&&(w0(t)||(t[o]=r),u=r)}e[u]=!0}return e}function L0(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Re(e){const t=vt(null);for(const o of mu(e)){var n=k0(o,2);const u=n[0],r=n[1];De(e,u)&&(Ot(r)?t[u]=L0(r):r&&typeof r=="object"&&r.constructor===Object?t[u]=Re(r):t[u]=r)}return t}function R0(e){switch(typeof e){case"string":return e;case"number":return D0(e);case"boolean":return v0(e);case"bigint":return ku?ku(e):"0";case"symbol":return Au?Au(e):"Symbol()";case"undefined":return Xt(e);case"function":case"object":{if(e===null)return Xt(e);const t=e,n=qe(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:Xt(o)}return Xt(e)}default:return Xt(e)}}function qe(e,t){for(;e!==null;){const o=N0(e,t);if(o){if(o.get)return fe(o.get);if(typeof o.value=="function")return fe(o.value)}e=M0(e)}function n(){return null}return n}function I0(e){try{return we(e,""),!0}catch{return!1}}const wu=Ce(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zn=Ce(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jn=Ce(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),j0=Ce(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Qn=Ce(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P0=Ce(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mu=Ce(["#text"]),Nu=Ce(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eo=Ce(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tu=Ce(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Sn=Ce(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$0=ge(/{{[\w\W]*|^[\w\W]*}}/g),F0=ge(/<%[\w\W]*|^[\w\W]*%>/g),H0=ge(/\${[\w\W]*/g),z0=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),V0=ge(/^aria-[\-\w]+$/),xu=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U0=ge(/^(?:\w+script|data):/i),G0=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y0=ge(/^html$/i),q0=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),Bu=ge(/<[/\w!]/g),Du=ge(/<[/\w]/g),W0=ge(/<\/no(script|embed|frames)/i),K0=ge(/\/>/i),Ie={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vu=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],X0=Ce(J({},vu)),Z0=(function(){const e={};return St(vu,t=>{e[t]=ge(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ce(e)})(),J0=function(){return typeof window>"u"?null:window},Q0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const u="data-tt-policy-suffix";n&&n.hasAttribute(u)&&(o=n.getAttribute(u));const r="dompurify"+(o?"#"+o:"");try{return t.createPolicy(r,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ou=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ht=function(t,n,o,u){return De(t,n)&&Ot(t[n])?J(u.base?Re(u.base):{},t[n],u.transform):o},to=function(t,n,o){const u=De(t,n)?t[n]:void 0;return u&&typeof u=="object"?Re(u):o()};function Lu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J0();const t=N=>Lu(N);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Ie.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,u=o.currentScript;e.DocumentFragment;const r=e.HTMLTemplateElement,i=e.Node,s=e.Element,c=e.NodeFilter,C=e.NamedNodeMap;C===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,p=e.trustedTypes,d=s.prototype,m=qe(d,"cloneNode"),k=qe(d,"remove"),w=qe(d,"nextSibling"),E=qe(d,"childNodes"),g=qe(d,"parentNode"),S=qe(d,"shadowRoot"),A=qe(d,"attributes"),B=i&&i.prototype?qe(i.prototype,"nodeType"):null,L=i&&i.prototype?qe(i.prototype,"nodeName"):null,D=i&&i.prototype?qe(i.prototype,"ownerDocument"):null,I=function(a){return B?B(a):a.nodeType},$=function(a){return L?L(a):a.nodeName};if(typeof r=="function"){const N=n.createElement("template");N.content&&N.content.ownerDocument&&(n=N.content.ownerDocument)}let G,P="",Q,Y=!1,W=0;const F=function(){if(W>0)throw kt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},x=function(a){F(),W++;try{return G.createHTML(a)}finally{W--}},v=function(a){F(),W++;try{return G.createScriptURL(a)}finally{W--}},ye=function(){return Y||(Q=Q0(p,u),Y=!0),Q},Z=n,ee=Z.implementation,M=Z.createNodeIterator,j=Z.createDocumentFragment,ae=Z.getElementsByTagName,ne=o.importNode;let q=Ou();t.isSupported=typeof mu=="function"&&typeof g=="function"&&ee&&ee.createHTMLDocument!==void 0;const Me=$0,X=F0,he=H0,H=z0,He=V0,ze=U0,je=G0,tt=q0;let Ve=xu,te=null;const nt=J({},[...wu,...Zn,...Jn,...Qn,...Mu]);let oe=null;const pt=J({},[...Nu,...eo,...Tu,...Sn]);let pe=Object.seal(vt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_=null,z=null;const O=Object.seal(vt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let K=!0,ie=!0,Pe=!1,ve=!0,be=!1,Ne=!0,Se=!1,Ct=!1,We=null,ot=null,Ue=!1,$e=!1,lt=!1,yt=!1,Rt=!0,me=!1;const At="user-content-";let wt=!0,ut=!1,ct={},Ke=null;const ue=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Xe=null;const It=J({},["audio","video","img","source","image","track"]);let Mt=null;const po=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Nt=Ze,Bn=!1,Dn=null;const nr=J({},[rn,an,Ze],Xn),Co=Ce(["mi","mo","mn","ms","mtext"]);let vn=J({},Co);const yo=Ce(["annotation-xml"]);let On=J({},yo);const or=J({},["title","style","font","a","script"]);let jt=null;const ur=["application/xhtml+xml","text/html"],rr="text/html";let de=null,Tt=null;const ar=n.createElement("form"),mo=function(a){return a instanceof RegExp||a instanceof Function},Ln=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tt&&Tt===a)return;(!a||typeof a!="object")&&(a={}),a=Re(a),jt=ur.indexOf(a.PARSER_MEDIA_TYPE)===-1?rr:a.PARSER_MEDIA_TYPE,de=jt==="application/xhtml+xml"?Xn:Wt,te=ht(a,"ALLOWED_TAGS",nt,{transform:de}),oe=ht(a,"ALLOWED_ATTR",pt,{transform:de}),Dn=ht(a,"ALLOWED_NAMESPACES",nr,{transform:Xn}),Mt=ht(a,"ADD_URI_SAFE_ATTR",po,{transform:de,base:po}),Xe=ht(a,"ADD_DATA_URI_TAGS",It,{transform:de,base:It}),Ke=ht(a,"FORBID_CONTENTS",ue,{transform:de}),_=ht(a,"FORBID_TAGS",Re({}),{transform:de}),z=ht(a,"FORBID_ATTR",Re({}),{transform:de}),ct=De(a,"USE_PROFILES")?a.USE_PROFILES&&typeof a.USE_PROFILES=="object"?Re(a.USE_PROFILES):a.USE_PROFILES:!1,K=a.ALLOW_ARIA_ATTR!==!1,ie=a.ALLOW_DATA_ATTR!==!1,Pe=a.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=a.SAFE_FOR_TEMPLATES||!1,Ne=a.SAFE_FOR_XML!==!1,Se=a.WHOLE_DOCUMENT||!1,$e=a.RETURN_DOM||!1,lt=a.RETURN_DOM_FRAGMENT||!1,yt=a.RETURN_TRUSTED_TYPE||!1,Ue=a.FORCE_BODY||!1,Rt=a.SANITIZE_DOM!==!1,me=a.SANITIZE_NAMED_PROPS||!1,wt=a.KEEP_CONTENT!==!1,ut=a.IN_PLACE||!1,Ve=I0(a.ALLOWED_URI_REGEXP)?a.ALLOWED_URI_REGEXP:xu,Nt=typeof a.NAMESPACE=="string"?a.NAMESPACE:Ze,vn=to(a,"MATHML_TEXT_INTEGRATION_POINTS",()=>J({},Co)),On=to(a,"HTML_INTEGRATION_POINTS",()=>J({},yo));const h=to(a,"CUSTOM_ELEMENT_HANDLING",()=>vt(null));if(pe=vt(null),De(h,"tagNameCheck")&&mo(h.tagNameCheck)&&(pe.tagNameCheck=h.tagNameCheck),De(h,"attributeNameCheck")&&mo(h.attributeNameCheck)&&(pe.attributeNameCheck=h.attributeNameCheck),De(h,"allowCustomizedBuiltInElements")&&typeof h.allowCustomizedBuiltInElements=="boolean"&&(pe.allowCustomizedBuiltInElements=h.allowCustomizedBuiltInElements),ge(pe),be&&(ie=!1),lt&&($e=!0),ct&&(te=J({},Mu),oe=vt(null),ct.html===!0&&(J(te,wu),J(oe,Nu)),ct.svg===!0&&(J(te,Zn),J(oe,eo),J(oe,Sn)),ct.svgFilters===!0&&(J(te,Jn),J(oe,eo),J(oe,Sn)),ct.mathMl===!0&&(J(te,Qn),J(oe,Tu),J(oe,Sn))),O.tagCheck=null,O.attributeCheck=null,De(a,"ADD_TAGS")&&(typeof a.ADD_TAGS=="function"?O.tagCheck=a.ADD_TAGS:Ot(a.ADD_TAGS)&&(te===nt&&(te=Re(te)),J(te,a.ADD_TAGS,de))),De(a,"ADD_ATTR")&&(typeof a.ADD_ATTR=="function"?O.attributeCheck=a.ADD_ATTR:Ot(a.ADD_ATTR)&&(oe===pt&&(oe=Re(oe)),J(oe,a.ADD_ATTR,de))),De(a,"ADD_FORBID_CONTENTS")&&Ot(a.ADD_FORBID_CONTENTS)&&(Ke===ue&&(Ke=Re(Ke)),J(Ke,a.ADD_FORBID_CONTENTS,de)),wt&&(te["#text"]=!0),Se&&J(te,["html","head","body"]),te.table&&(J(te,["tbody"]),delete _.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const b=G;G=a.TRUSTED_TYPES_POLICY;try{P=x("")}catch(T){throw G=b,T}}else a.TRUSTED_TYPES_POLICY===null?(G=void 0,P=""):(G===void 0&&(G=ye()),G&&typeof P=="string"&&(P=x("")));Ce&&Ce(a),Tt=a},go=J({},[...Zn,...Jn,...j0]),_o=J({},[...Qn,...P0]),ir=function(a,h,b){return h.namespaceURI===Ze?a==="svg":h.namespaceURI===rn?a==="svg"&&(b==="annotation-xml"||vn[b]):!!go[a]},sr=function(a,h,b){return h.namespaceURI===Ze?a==="math":h.namespaceURI===an?a==="math"&&On[b]:!!_o[a]},lr=function(a,h,b){return h.namespaceURI===an&&!On[b]||h.namespaceURI===rn&&!vn[b]?!1:!_o[a]&&(or[a]||!go[a])},cr=function(a){let h=g(a);(!h||!h.tagName)&&(h={namespaceURI:Nt,tagName:"template"});const b=Wt(a.tagName),T=Wt(h.tagName);return Dn[a.namespaceURI]?a.namespaceURI===an?ir(b,h,T):a.namespaceURI===rn?sr(b,h,T):a.namespaceURI===Ze?lr(b,h,T):!!(jt==="application/xhtml+xml"&&Dn[a.namespaceURI]):!1},dt=function(a){qt(t.removed,{element:a});try{g(a).removeChild(a)}catch{if(k(a),!g(a))throw kt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Eo=function(a,h,b){try{a.removeAttributeNode(h)}catch{try{a.removeAttribute(b)}catch{}}},sn=function(a){ln(a);const h=E(a);if(h){const T=[];St(h,R=>{qt(T,R)}),St(T,R=>{try{k(R)}catch{}})}const b=A(a);if(b)for(let T=b.length-1;T>=0;--T){const R=b[T],U=R&&R.name;typeof U=="string"&&Eo(a,R,U)}},mt=function(a,h,b){if(!b)try{b=h.getAttributeNode(a)}catch{b=null}qt(t.removed,{attribute:b||null,from:h});try{b?h.removeAttributeNode(b):h.removeAttribute(a)}catch{try{h.removeAttribute(a)}catch{}}if(a==="is")if($e||lt)try{dt(h)}catch{}else try{h.setAttribute(a,"")}catch{}},dr=function(a){const h=A(a);if(h)for(let b=h.length-1;b>=0;--b){const T=h[b],R=T&&T.name;typeof R!="string"||oe[de(R)]||Eo(a,T,R)}},ln=function(a){const h=[a];for(;h.length>0;){const b=h.pop();I(b)===Ie.element&&dr(b);const R=E(b);if(R)for(let U=R.length-1;U>=0;--U)h.push(R[U])}},bo=function(a,h){return Ne?a==="patchsrc"?!0:a==="for"&&h!=="label"&&h!=="output":!1},hr=function(a){if(!Ne)return;const h=[a];for(;h.length>0;){const b=h.pop(),T=I(b);if(T===Ie.processingInstruction||T===Ie.comment&&we(Du,b.data)){try{k(b)}catch{}continue}if(T===Ie.element){const U=b,se=de($(b));try{U.hasAttribute&&U.hasAttribute("patchsrc")&&U.removeAttribute("patchsrc"),U.hasAttribute&&U.hasAttribute("for")&&bo("for",se)&&U.removeAttribute("for")}catch{}}const R=E(b);if(R)for(let U=R.length-1;U>=0;--U)h.push(R[U])}},So=function(a){let h=null,b=null;if(Ue)a="<remove></remove>"+a;else{const U=bu(a,/^[\r\n\t ]+/);b=U&&U[0]}jt==="application/xhtml+xml"&&Nt===Ze&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");const T=G?x(a):a;if(Nt===Ze)try{h=new f().parseFromString(T,jt)}catch{}if(!h||!h.documentElement){h=ee.createDocument(Nt,"template",null);try{h.documentElement.innerHTML=Bn?P:T}catch{}}const R=h.body||h.documentElement;return a&&b&&R.insertBefore(n.createTextNode(b),R.childNodes[0]||null),Nt===Ze?ae.call(h,Se?"html":"body")[0]:Se?h.documentElement:R},ko=function(a){const h=D?D(a):a.ownerDocument;return M.call(h||a,a,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},cn=function(a){return a=Kt(a,Me," "),a=Kt(a,X," "),a=Kt(a,he," "),a},Rn=function(a){var h;a.normalize();const b=D?D(a):a.ownerDocument,T=M.call(b||a,a,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let R=T.nextNode();for(;R;)R.data=cn(R.data),R=T.nextNode();const U=(h=a.querySelectorAll)===null||h===void 0?void 0:h.call(a,"template");U&&St(U,se=>{xt(se.content)&&Rn(se.content)})},dn=function(a){const h=L?L(a):null;return typeof h!="string"||de(h)!=="form"?!1:typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||a.attributes!==A(a)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function"||a.nodeType!==B(a)||a.childNodes!==E(a)},xt=function(a){if(!B||typeof a!="object"||a===null)return!1;try{return B(a)===Ie.documentFragment}catch{return!1}},Pt=function(a){if(!B||typeof a!="object"||a===null)return!1;try{return typeof B(a)=="number"}catch{return!1}};function Je(N,a,h){N.length!==0&&St(N,b=>{b.call(t,a,h,Tt)})}const fr=function(a,h){return!!(Ne&&a.hasChildNodes()&&!Pt(a.firstElementChild)&&we(Bu,a.textContent)&&we(Bu,a.innerHTML)||Ne&&a.namespaceURI===Ze&&X0[h]&&(Pt(a.firstElementChild)||typeof a.textContent=="string"&&we(Z0[h],a.textContent))||a.nodeType===Ie.processingInstruction||Ne&&a.nodeType===Ie.comment&&we(Du,a.data))},hn=function(a,h){if(a instanceof RegExp)return we(a,h);if(a instanceof Function){for(var b=arguments.length,T=new Array(b>2?b-2:0),R=2;R<b;R++)T[R-2]=arguments[R];return!!a(h,...T)}return!1},pr=function(a,h,b){if(!_[h]&&To(h)&&hn(pe.tagNameCheck,h))return!1;if(wt&&!Ke[h]){const T=g(a),R=E(a);if(R&&T){const U=R.length;for(let se=U-1;se>=0;--se){const ce=a===b?m(R[se],!0):R[se];T.insertBefore(ce,w(a))}}}return dt(a),!0},Ao=function(a,h,b,T){return a.length===0?h:h===b||h===T?Re(h):h},wo=function(a,h){return a===h||g(a)!==null?!1:(ut&&ln(a),!0)},Mo=function(a,h){if(Je(q.beforeSanitizeElements,a,null),wo(a,h))return!0;if(dn(a))return dt(a),!0;const b=de($(a));if(te=Ao(q.uponSanitizeElement,te,nt,We),Je(q.uponSanitizeElement,a,{tagName:b,allowedTags:te}),wo(a,h))return!0;if(fr(a,b))return dt(a),!0;if(_[b]||!(O.tagCheck instanceof Function&&O.tagCheck(b))&&!te[b]){const R=pr(a,b,h);return R===!1&&Je(q.afterSanitizeElements,a,null),R}if(I(a)===Ie.element&&!cr(a)||(b==="noscript"||b==="noembed"||b==="noframes")&&we(W0,a.innerHTML))return dt(a),!0;if(be&&a.nodeType===Ie.text){const R=cn(a.textContent);a.textContent!==R&&(qt(t.removed,{element:a.cloneNode()}),a.textContent=R)}return Je(q.afterSanitizeElements,a,null),!1},No=function(a,h,b){if(z[h]||bo(h,a)||Rt&&(h==="id"||h==="name")&&(b in n||b in ar))return!1;const T=oe[h]||O.attributeCheck instanceof Function&&O.attributeCheck(h,a);return ie&&we(H,h)||K&&we(He,h)?!0:T?Mt[h]||we(Ve,Kt(b,je,""))||(h==="src"||h==="xlink:href"||h==="href")&&a!=="script"&&Su(b,"data:")===0&&Xe[a]||Pe&&!we(ze,Kt(b,je,""))?!0:!b:To(a)&&hn(pe.tagNameCheck,a)&&hn(pe.attributeNameCheck,h,a)||h==="is"&&pe.allowCustomizedBuiltInElements&&hn(pe.tagNameCheck,b)},Cr=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),To=function(a){return!Cr[Wt(a)]&&we(tt,a)},yr=function(a,h,b,T){if(G&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!b)switch(p.getAttributeType(a,h)){case"TrustedHTML":return x(T);case"TrustedScriptURL":return v(T)}return T},mr=function(a,h,b,T){try{b?a.setAttributeNS(b,h,T):a.setAttribute(h,T),dn(a)?dt(a):Eu(t.removed)}catch{mt(h,a)}},xo=function(a){Je(q.beforeSanitizeAttributes,a,null);const h=a.attributes;if(!h||dn(a))return;oe=Ao(q.uponSanitizeAttribute,oe,pt,ot);const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let T=h.length;const R=de(a.nodeName);for(;T--;){const U=h[T],se=U.name,ce=U.namespaceURI,xe=U.value,Be=de(se),jn=xe;let Te=se==="value"?jn:B0(jn);if(b.attrName=Be,b.attrValue=Te,b.keepAttr=!0,b.forceKeepAttr=void 0,Je(q.uponSanitizeAttribute,a,b),Te=b.attrValue,me&&(Be==="id"||Be==="name")&&Su(Te,At)!==0&&(mt(se,a,U),Te=At+Te),Ne&&we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Te)){mt(se,a,U);continue}if(Be==="attributename"&&bu(Te,"href")){mt(se,a,U);continue}if(!b.forceKeepAttr){if(!b.keepAttr){mt(se,a,U);continue}if(!ve&&we(K0,Te)){mt(se,a,U);continue}if(be&&(Te=cn(Te)),!No(R,Be,Te)){mt(se,a,U);continue}Te=yr(R,Be,ce,Te),Te!==jn&&mr(a,se,ce,Te)}}Je(q.afterSanitizeAttributes,a,null)},fn=function(a){let h=null;const b=ko(a);for(Je(q.beforeSanitizeShadowDOM,a,null);h=b.nextNode();)if(Je(q.uponSanitizeShadowNode,h,null),Mo(h,a),xo(h),xt(h.content)&&fn(h.content),I(h)===Ie.element){const T=S(h);xt(T)&&(In(T),fn(T))}Je(q.afterSanitizeShadowDOM,a,null)},In=function(a){const h=[{node:a,shadow:null}];for(;h.length>0;){const b=h.pop();if(b.shadow){fn(b.shadow);continue}const T=b.node,U=I(T)===Ie.element,se=E(T);if(se)for(let ce=se.length-1;ce>=0;--ce)h.push({node:se[ce],shadow:null});if(U){const ce=L?L(T):null;if(typeof ce=="string"&&de(ce)==="template"){const xe=T.content;xt(xe)&&h.push({node:xe,shadow:null})}}if(U){const ce=S(T);xt(ce)&&h.push({node:null,shadow:ce},{node:ce,shadow:null})}}};return t.sanitize=function(N){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,b=null,T=null,R=null;if(Bn=!N,Bn&&(N="<!-->"),typeof N!="string"&&!Pt(N)&&(N=R0(N),typeof N!="string"))throw kt("dirty is not a string, aborting");if(!t.isSupported)return N;Ct?(te=We,oe=ot):Ln(a),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(te=Re(te)),q.uponSanitizeAttribute.length>0&&(oe=Re(oe)),t.removed=[];const U=ut&&typeof N!="string"&&Pt(N);if(U){hr(N);const xe=$(N);if(typeof xe=="string"){const Be=de(xe);if(!te[Be]||_[Be])throw sn(N),kt("root node is forbidden and cannot be sanitized in-place")}if(dn(N))throw sn(N),kt("root node is clobbered and cannot be sanitized in-place");try{In(N)}catch(Be){throw sn(N),Be}}else if(Pt(N))h=So("<!---->"),b=h.ownerDocument.importNode(N,!0),b.nodeType===Ie.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?h=b:h.appendChild(b),In(b);else{if(!$e&&!be&&!Se&&N.indexOf("<")===-1)return G&&yt?x(N):N;if(h=So(N),!h)return $e?null:yt?P:""}h&&Ue&&dt(h.firstChild);const se=U?N:h;try{const xe=ko(se);for(;T=xe.nextNode();)Mo(T,se),xo(T),xt(T.content)&&fn(T.content)}catch(xe){throw U&&(sn(N),St(t.removed,Be=>{Be.element&&ln(Be.element)})),xe}if(U)return St(t.removed,xe=>{xe.element&&ln(xe.element)}),be&&Rn(N),N;if($e){if(be&&Rn(h),lt)for(R=j.call(h.ownerDocument);h.firstChild;)R.appendChild(h.firstChild);else R=h;return(oe.shadowroot||oe.shadowrootmode)&&(R=ne.call(o,R,!0)),R}let ce=Se?h.outerHTML:h.innerHTML;return Se&&te["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&we(Y0,h.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+h.ownerDocument.doctype.name+`>
|
|
783
|
-
`+ce),be&&(ce=cn(ce)),G&&yt?x(ce):ce},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(N),Ct=!0,We=te,ot=oe},t.clearConfig=function(){Tt=null,Ct=!1,We=null,ot=null,G=Q,P=""},t.isValidAttribute=function(N,a,h){Tt||Ln({});const b=de(N),T=de(a);return No(b,T,h)},t.addHook=function(N,a){typeof a=="function"&&De(q,N)&&qt(q[N],a)},t.removeHook=function(N,a){if(De(q,N)){if(a!==void 0){const h=T0(q[N],a);return h===-1?void 0:x0(q[N],h,1)[0]}return Eu(q[N])}},t.removeHooks=function(N){De(q,N)&&(q[N]=[])},t.removeAllHooks=function(){q=Ou()},t}var ed=Lu();const td=/^(?:[a-z]+:)?\/\//i;let nd="";function od(){return nd}function no(e){const t=String(e||"").trim();if(!t)return"";if(td.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const n=t.startsWith("/")?t:`/${t}`,o=od();return o?`${o}${n}`:n}function ud(){return kn(new Date)}function kn(e){if(e==null||e==="")return"";const t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(t)}const Zt=[],Jt=[],Qt=[],en=[],An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},wn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},rd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let oo=null,Ru=null,ft=null;function ad({counts:e,forceRefresh:t}={}){const n=Object.assign({},rd,e||{}),o=ud(),u=kn(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(n);if(!t&&Ru===o&&oo===r&&ft)return Object.assign(An,ft.today),Object.assign(wn,ft.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:An,yesterday:wn};const i={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let s=null;return ft&&oo===r&&ft.yesterday&&ft.yesterday.date===u&&(s=ft.yesterday.selection),s||(s={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(An,i),Object.assign(wn,s),Ru=o,oo=r,ft={today:i,yesterday:{date:u,countsKey:r,selection:s}},{today:An,yesterday:wn}}let Iu=!1,tn=null;async function id(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Pn&&Pn.tagName.toUpperCase()==="SCRIPT"&&Pn.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",t=await fetch(`${e}data/allTrainingData.json`);return t.ok?await t.json():null}catch{return null}}async function sd(){if(!Iu)return tn||(tn=(async()=>{const e=await id();if(!e){tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const u=o,r=String(u.training_type||t),i=String(u.category_main_code||u.category_main||u.category_0||""),s=String(u.category_sub_code||u.category_sub||u.category_1||""),c=Object.assign({},u,{training_type:r,category_0:i,category_1:s});r==="LISTEN_IN_NOISE"?Zt.push(c):r==="SHORT_STORY"?Jt.push(c):r==="LONG_STORY"?Qt.push(c):r==="ORDERING_SENTENCE"&&en.push(c)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{ad()}catch{}Iu=!0})(),tn)}async function ld(e=3e3){const t=sd();return Promise.race([t,new Promise(n=>setTimeout(n,e))])}const cd=[{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."}],dd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function hd(e){return cd.map(t=>{const n=dd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}function fd(e){return typeof window>"u"?"":ed.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use"],FORBID_ATTR:["xlink:href","href"]})}function pd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),[r,i]=l.useState(null),[s,c]=l.useState(null);return l.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){n(null),u(null),i(null);return}const C=e.split("/").pop();let f=e;C&&(e.startsWith("/")?f=no(e):/^(Logo|Symbol)/i.test(C)?f=no(`logo/${C}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),n(f)},[e]),l.useEffect(()=>{if(!t)return;let C=!1;async function f(){try{let p=await fetch(t);p.ok||(p=await fetch(t));const d=p.headers.get("content-type")||"";if(C)return;if(d.includes("svg")){u("mask");return}if(d.startsWith("image/")){u("img");return}const m=await fetch(t);if(!m.ok)throw new Error("not ok");const k=await m.text();if(C)return;if(/^\s*<svg[\s>]/i.test(k)){const w=fd(k);if(!w){u("none");return}i(w),u("inline");return}u("none")}catch{C||u("none")}}return f(),()=>{C=!0}},[t]),l.useEffect(()=>{let C=!1,f=null;return o==="mask"&&t&&fetch(t).then(p=>{if(!p.ok)throw new Error("fetch failed");return p.blob()}).then(p=>{C||(f=URL.createObjectURL(p),c(f))}).catch(()=>{C||u("img")}),()=>{C=!0,f&&URL.revokeObjectURL(f),c(null)}},[o,t]),{iconToUse:t,mode:o,svgText:r,blobUrl:s}}function Cd(e){const{icon:t,label:n,className:o,imgClassName:u,maskClassName:r,svgClassName:i,wrapperStyle:s,size:c}=e||{},C=o??"iconRenderer-icon",f=u??"iconRenderer-icon-image",p=r??"iconRenderer-icon-mask",d=i??"iconRenderer-icon-svg",m=typeof t=="string"?t:null,k=_0(m),{iconToUse:w,mode:E,svgText:g,blobUrl:S}=pd(m),A=(I,$={})=>V.jsx("span",{className:C,style:s,...$,children:I}),B=(I,$={})=>V.jsx("img",{src:I,alt:typeof n=="string"?n:n?String(n):"",className:f,...$});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(V.jsx("span",{className:d,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(k)try{return A(l.createElement(k,{className:d,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(w&&w.endsWith(".svg")){if(E==="mask"){const I={"--icon-url":S?`url(${S})`:`url(${w})`};return A(V.jsx("span",{className:p,style:I}),{"aria-hidden":"true"})}return E==="img"?A(B(w,{onError:I=>{I.currentTarget.onerror=null,I.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):E==="inline"?A(V.jsx("span",{className:d,dangerouslySetInnerHTML:g?{__html:g}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return B(no(t),{style:s,onError:I=>{I.currentTarget.onerror=null,I.currentTarget.style.display="none"}});const L=typeof c=="number"?c:20,D=`<svg width="${L}" height="${L}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(V.jsx("span",{className:d,dangerouslySetInnerHTML:{__html:D}}),{"aria-hidden":"true"})}function ju(e){const{anchorRect:t,anchorEl:n,offset:o=20,edgeMargin:u=20,onClose:r,closeOnOutsideClick:i=!0,className:s="",role:c="dialog",ariaLabel:C="",children:f,backdrop:p=!1,isMobilePopup:d=!1,useBorder:m=!0,header:k}=e||{},w=l.useRef(null),[E,g]=l.useState({position:"fixed",left:0,top:-9999}),[S,A]=l.useState(!1),[B,L]=l.useState("bottom"),[D,I]=l.useState(!1),[$,G]=l.useState(!1),P=!t&&!n,Q=l.useCallback((x=!1)=>{if($&&d)return;const v=n?n.getBoundingClientRect():t;if(!v||!w.current)return;const ye=w.current,{offsetWidth:Z,offsetHeight:ee}=ye,M=window.innerWidth,j=window.innerHeight,ae=M-v.right,ne=v.left,q=v.top,Me=j-v.bottom;let X=0,he=0,H="top";if(q>=ee+o)H="top",he=v.top-o-ee,X=v.left+v.width/2-Z/2;else if(Me>=ee+o)H="bottom",he=v.bottom+o,X=v.left+v.width/2-Z/2;else if(ae>=Z+o)H="right",X=v.right+o,he=v.top+v.height/2-ee/2;else if(ne>=Z+o)H="left",X=v.left-o-Z,he=v.top+v.height/2-ee/2;else{const tt=Math.max(q,Me,ae,ne);tt===q?(H="top",he=v.top-o-ee,X=v.left+v.width/2-Z/2):tt===Me?(H="bottom",he=v.bottom+o,X=v.left+v.width/2-Z/2):tt===ae?(H="right",X=v.right+o,he=v.top+v.height/2-ee/2):(H="left",X=v.left-o-Z,he=v.top+v.height/2-ee/2)}const He=Number(u)||8;X=Math.min(Math.max(X,He),M-Z-He),he=Math.min(Math.max(he,He),j-ee-He);const ze=Math.round(X),je=Math.round(he);x&&w.current?(w.current.style.left=`${ze}px`,w.current.style.top=`${je}px`,w.current.dataset.placement=H):(L(H||B),g({position:"fixed",left:ze,top:je}),I(!0))},[$,d,n,t,o,u,B]);l.useLayoutEffect(()=>{if(P)return;if($&&d){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),I(!0);return}Q();const x=requestAnimationFrame(()=>Q());return()=>cancelAnimationFrame(x)},[t,n,o,f,u,P,$,d,Q]),l.useEffect(()=>{if(P||$&&d||!w.current||typeof ResizeObserver>"u")return;const x=new ResizeObserver(()=>{t&&Q()});return x.observe(w.current),()=>x.disconnect()},[t,f,u,P,$,d,Q]),l.useEffect(()=>{if(P||$&&d)return;const x=()=>Q(!0);return window.addEventListener("resize",x),document.addEventListener("scroll",x,{passive:!0,capture:!0}),()=>{window.removeEventListener("resize",x),document.removeEventListener("scroll",x,{capture:!0})}},[t,o,f,u,P,$,d,Q]),l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const x=window.matchMedia("(max-width: 768px)"),v=()=>G(!!x.matches);v();try{x.addEventListener?x.addEventListener("change",v):x.addListener(v)}catch{try{x.addListener(v)}catch{}}return()=>{try{x.removeEventListener?x.removeEventListener("change",v):x.removeListener(v)}catch{}}},[]);const Y=l.useRef(!1),W=l.useCallback((x=!1)=>{if(!(S||Y.current)){if(Y.current=!0,x){A(!0);try{r&&r()}catch{}return}A(!0),setTimeout(()=>{r&&r()},200)}},[S,r,A]);l.useEffect(()=>{const x=Z=>{const ee=w.current;if(!ee)return;const M=Z.target;if(M&&!ee.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},v=Z=>{const ee=w.current;if(!ee)return;const M=Z.target;if(M&&!ee.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},ye=Z=>{if(Z.key==="Escape"){Z.stopPropagation(),W();return}if(Z.key==="Tab"){const ee=w.current;if(!ee)return;const M=ee.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!M||M.length===0)return;const j=M[0],ae=M[M.length-1],ne=document.activeElement;Z.shiftKey?ne===j&&(Z.preventDefault(),ae.focus()):ne===ae&&(Z.preventDefault(),j.focus())}};return document.addEventListener("pointerdown",x,!0),document.addEventListener("click",v,!0),document.addEventListener("keydown",ye),()=>{document.removeEventListener("pointerdown",x,!0),document.removeEventListener("click",v,!0),document.removeEventListener("keydown",ye)}},[r,i,W]),l.useEffect(()=>{const x=()=>{W(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",x),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",x)}},[W]);const F=V.jsxs("div",{ref:w,className:`tooltip-content ${m?"tooltip-content--bordered":""} ${S?"is-closing":""} ${s} ${$&&d?"is-mobile":""}`,role:c,"aria-label":C||void 0,style:P?{}:{...E,visibility:D?"visible":"hidden"},tabIndex:-1,"data-placement":B,"data-left":P?"":E.left,"data-top":P?"":E.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[k!=null&&V.jsx("div",{className:"tooltip-content__header h5",children:k}),f]});if(P||typeof document>"u")return F;if(p||$&&d){const x=V.jsxs("div",{className:"tooltip-portal",children:[V.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&W(!0)}}),F]});return Bo.createPortal(x,document.body)}return Bo.createPortal(F,document.body)}function yd(e){const{anchorRect:t,text:n,offset:o=8,onClose:u,className:r="",ariaLabel:i}=e||{};return n?V.jsx(ju,{anchorRect:t,offset:o,onClose:u,closeOnOutsideClick:!1,className:`tooltip-info ${r}`,ariaLabel:i||n,children:V.jsx("div",{className:"tooltip-info__content body-3",children:n})}):null}function Pu(e){const{anchorRect:t,title:n,items:o,activeIndex:u=-1,showIndex:r=!0,onClose:i,offset:s=12}=e||{},c=Array.isArray(o)?o:o?[o]:[];return!c.length&&!n?null:V.jsx(ju,{anchorRect:t,offset:s,onClose:i,closeOnOutsideClick:!0,useBorder:!1,className:"tooltip-description",children:V.jsxs("div",{className:"tooltip-description__box",children:[n&&V.jsx("span",{className:"tooltip-description__title body-2",children:n}),V.jsx("ol",{className:"tooltip-description__items",children:c.map((C,f)=>V.jsxs("li",{className:`tooltip-description__item body-3${f===u?" tooltip-description__item--active":""}`,children:[r&&c.length>1&&V.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),V.jsx("span",{children:C})]},f))})]})})}function md(e){const{size:t=48,type:n,htmlType:o,href:u,target:r,rel:i,icon:s,rightIcon:c,label:C,count:f,subLabel:p,children:d,ariaLabel:m,variant:k="default",align:w="center",selected:E,toggleable:g=!1,disabled:S=!1,useLabel:A=!0,useBorder:B=!0,useBG:L=!0,useDisabledCovered:D=!1,useDisabledInvisible:I=!1,width:$,minWidth:G,onClick:P,onDisabledClick:Q,showTooltipInfo:Y=!1,tooltipInfoText:W=null,tooltipDescription:F=null,iconSize:x="medium",iconColor:v,shape:ye="rounded",color:Z,className:ee,...M}=e,j=typeof t=="string"&&isNaN(Number(t))?t.toLowerCase():String(Number(t)||48),ae=j.match(/^\d+$/)?`button${j}`:`button-${j}`,ne=Number(t),q=!isNaN(ne)&&ne<40?"button-2":"button-1",Me=C??d,X=S||!!M.disabled,he=X?D?"disabled-covered":I?"disabled-invisibled":"disabled":k,H=he?`button--variant-${he}`:"",He=w?`button--align-${w}`:"",ze=ye?`button--shape-${ye}`:"",je=typeof v=="string"&&v.startsWith("--")?`var(${v})`:v,tt={...$?{width:typeof $=="number"?`${$}px`:$}:{},...G?{minWidth:typeof G=="number"?`${G}px`:G}:{},...B?{}:{"--button-border":X?"0":"1px solid transparent"},...je?{"--button-icon-color":je}:{},...Z?{"--color-main":Z}:{}},Ve=A===!1?"":Me,te=Array.isArray(Ve)?Ve.length>0:!!Ve,nt=!!c,oe=n??(te||s||nt?"bar":"dot"),pt=`${ae}--${oe}`,pe=l.useRef(null),_=l.useRef(X),[z,O]=l.useState(!!E),[K,ie]=l.useState(!1),[Pe,ve]=l.useState(null),be=l.useCallback(()=>ie(!1),[]);l.useEffect(()=>{(Y||F)&&X&&K&&(ie(!1),ve(null))},[X,Y,F,K]),l.useEffect(()=>{typeof E=="boolean"&&O(E)},[E]),l.useEffect(()=>{if(_.current&&!X&&pe.current){const ue=pe.current;ue.blur(),ue.style.pointerEvents="none";const Xe=requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe.current&&(pe.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(Xe)}_.current=X},[X]);const Ne=typeof E=="boolean"?!!E:z,Se=g||typeof E=="boolean"?Ne?"true":"false":void 0,Ct=Ia("button",ae,pt,H,He,ze,Ne?"is-selected":null,L?null:"button--no-bg",ee),We=`button__icon button__icon--${x}`,ot=Array.isArray(p)?p:p!==void 0?[p]:[],Ue=()=>{if(Array.isArray(Ve))return Ve.map((Xe,It)=>{const Mt=ot[It];return V.jsxs("span",{className:`button__label-text${Mt!==void 0?" button__label-text--has-sub":""}`,children:[Xe,Mt!==void 0&&V.jsx("span",{className:"button__sub-label-text caption-1",children:Mt})]},It)});const ue=p!==void 0;return V.jsxs("span",{className:`button__label-text${ue?" button__label-text--has-sub":""}`,children:[Ve,f!=null&&V.jsx("span",{className:"button__count",children:f}),ue&&V.jsx("span",{className:"button__sub-label-text caption-1",children:p})]})},$e=ue=>{X||(typeof M.onMouseLeave=="function"&&M.onMouseLeave(ue),typeof E!="boolean"&&O(!1),ue.currentTarget.blur())},lt=ue=>{if(X){Q?.(ue);return}typeof E!="boolean"&&g&&O(Xe=>!Xe),P?.(ue)},yt=l.useCallback(()=>{!X&&(Y||F)&&(ie(!0),ve(pe.current?.getBoundingClientRect()??null))},[X,Y,F]),Rt=l.useCallback(()=>{(Y||F)&&(ie(!1),ve(null))},[Y,F]),me={...M};delete me.disabled,delete me.className,delete me.faded,delete me.useFaded,delete me.loading,delete me.onMouseLeave,delete me.onPointerEnter,delete me.onPointerLeave,delete me.onFocus,delete me.onBlur,X&&(Object.keys(me).forEach(ue=>{/^on[A-Z]/.test(ue)&&typeof me[ue]=="function"&&delete me[ue]}),me["aria-disabled"]="true");const At=(typeof Y=="string"?Y:null)??(typeof W=="string"?W:null)??(typeof m=="string"?m:null)??(typeof Me=="string"?Me:null)??void 0,wt=typeof m=="string"?m:typeof Me=="string"?Me:At,ut=(ue,Xe)=>V.jsx(Cd,{icon:ue,label:Xe??wt,className:We,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),ct=()=>oe==="dot"?V.jsxs(V.Fragment,{children:[ut(s),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()})]}):w==="center"&&s?V.jsxs(V.Fragment,{children:[V.jsxs("span",{className:"button__center-group",children:[V.jsx("span",{className:"button__left",children:ut(s)}),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()})]}),nt&&V.jsx("span",{className:"button__right",children:ut(c)})]}):V.jsxs(V.Fragment,{children:[s&&V.jsx("span",{className:"button__left",children:ut(s,m??Me)}),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()}),nt&&V.jsx("span",{className:"button__right",children:ut(c)})]}),Ke=!!u&&!X;return V.jsxs(V.Fragment,{children:[V.jsx(Ke?"a":"button",{...me,ref:pe,...Ke?{href:u,target:r,rel:i??(r==="_blank"?"noreferrer":void 0)}:{type:o,disabled:X&&!Q},className:Ct,"aria-pressed":Se,"aria-label":wt,"aria-disabled":Ke&&X?!0:void 0,style:tt,onClick:lt,onMouseLeave:$e,onPointerEnter:ue=>{yt(),!X&&typeof M.onPointerEnter=="function"&&M.onPointerEnter(ue)},onPointerLeave:ue=>{Rt(),!X&&typeof M.onPointerLeave=="function"&&M.onPointerLeave(ue)},onFocus:ue=>{yt(),!X&&typeof M.onFocus=="function"&&M.onFocus(ue)},onBlur:ue=>{$e(ue),Rt(),!X&&typeof M.onBlur=="function"&&M.onBlur(ue)},children:ct()}),K&&F?V.jsx(Pu,{anchorRect:Pe,title:F.title,items:F.items,onClose:be}):K&&At?V.jsx(yd,{anchorRect:Pe,text:At,onClose:be}):null]})}function $u(){const[e,t]=l.useState(null),n=l.useCallback(r=>t(r.getBoundingClientRect()),[]),o=l.useCallback(()=>t(null),[]),u=l.useCallback(r=>{const i=r.getBoundingClientRect();t(s=>s?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:u}}function gd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useRef(null);l.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=l.useCallback((c,C)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n(c),u(C)},e)},[e]),s=l.useCallback(()=>{r.current&&clearTimeout(r.current),n(null),u(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:s}}function _d({title:e,items:t}){const{t:n}=gt.useTranslation(),{anchorRect:o,openAt:u,close:r}=$u();return V.jsxs(V.Fragment,{children:[V.jsx(md,{size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!o,ariaLabel:n("common.info","\uC124\uBA85"),onPointerEnter:i=>u(i.currentTarget),onPointerLeave:r,onFocus:i=>u(i.currentTarget),onBlur:r}),o&&V.jsx(Pu,{title:e,items:t,showIndex:t.length>1,anchorRect:o,onClose:r})]})}function Fu(){const{t:e}=gt.useTranslation();return l.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 Hu(e,t,n){return{label:t.difficulty,items:[1,2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction}}function zu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Vu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function Ed(e,t){return{label:t.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}),t.syllable5plus],multiple:!0,allOption:!0}}function bd(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction}}function Sd(e,t){const{label:n,headValue:o,midValue:u,tailValue:r,includeMid:i=!0,headDisabled:s,midDisabled:c,tailDisabled:C,allOptionDisabled:f,groupLabel:p,labelAction:d}=t;return{label:n,...p?{groupLabel:p}:{},...d?{labelAction:d}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...f?{allOptionDisabled:f}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...i?[{value:u,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:c}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:C}]}}function kd(e,t,n){if(t===bt){const{[n]:r,...i}=e;return i}const o=e[n]??[],u=o.includes(t)?o.filter(r=>r!==t):[...o,t];if(u.length===0){const{[n]:r,...i}=e;return i}return{...e,[n]:u}}Object.fromEntries(Object.entries(Jr).map(([e,{nucleus:t}])=>[e,t]));const Ad={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},wd={"\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"]},Md={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:wd,typeMap:Ad};function Nd(e,t,n=Md){const o=t[n.difficulty];if(o?.length&&!o.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const u=t[n.syllables];if(u?.length){const s=e.syllables??0;if(!u.some(c=>c===n.syllable5plus?s>=5:s===parseInt(c)))return!1}const r=t[n.partOfSpeech];if(r?.length&&!r.flatMap(s=>n.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const i=t[n.wordType];return!(i?.length&&!i.some(s=>e.wordType===n.typeMap[s]))}const it=(e,t)=>t.map(n=>({jamos:[n],tooltip:e})),Ee=(e,t)=>({jamos:[...e],tooltip:t}),uo={cho:[it("\uC591\uC21C\uC74C",["\u3142","\u3143","\u314D","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3138","\u314C","\u3134","\u3139"]),it("\uCE58\uC870\uC74C",["\u3145","\u3146"]),it("\uACBD\uAD6C\uAC1C\uC74C",["\u3148","\u3149","\u314A"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3132","\u314B"]),it("\uC131\uBB38\uC74C",["\u314E"])],jung:[[Ee("\u3163","\uC804\uC124 \uACE0\uBAA8\uC74C"),Ee("\u315F","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 w\uD65C\uC74C"),Ee("\u3162","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 \u0270\uD65C\uC74C")],[Ee("\u3161","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C")],[Ee("\u315C","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u3160","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u3154\u3150","\uC804\uC124 \uC911\uBAA8\uC74C"),Ee("\u3156\u3152","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3159\u315A\u315E","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 w\uD65C\uC74C")],[Ee("\u3153","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"),Ee("\u3155","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 j\uD65C\uC74C"),Ee("\u315D","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 w\uD65C\uC74C")],[Ee("\u3157","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u315B","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u314F","\uC800\uBAA8\uC74C"),Ee("\u3151","\uC800\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3158","\uC800\uBAA8\uC74C \xB7 w\uD65C\uC74C")]],jong:[it("\uC591\uC21C\uC74C",["\u3142","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3134","\u3139"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3147"])]},Td=[...ke],xd=[...rt],Bd=Fe.filter(e=>e!==""),st=e=>e===Qe?[]:Array.from(e),Qe="__NO_CODA__",Uu=[1,2,3,4],et=5,Dd=12,Gu="SYL_",ro=e=>`${Gu}${e}`,vd=e=>Number(e.slice(Gu.length));function ao(e){return e>=et?Array.from({length:Dd-et+1},(t,n)=>et+n):[e]}const Yu={cho:Td,jung:xd,jong:Bd},io=e=>e.map(t=>t.map(({jamos:n,tooltip:o})=>({v:n.join(""),tooltip:o}))),so={cho:io(uo.cho),jung:io(uo.jung),jong:io(uo.jong)},qu={};so.jung.flat().forEach(({v:e})=>{for(const t of st(e))qu[t]=e});const Od=new Set(so.cho.flat().map(e=>e.v));function Wu(e,t){return e==="cho"?Od.has(t)?t:null:e==="jung"?qu[t]??t:qo(t)}function Ku(e,t,n){if(e==="jung"){const o=st(t);return n&&o.includes(n)?n:o[0]??t}return t}function Xu(e,t,n){const o=(u,r)=>r?u==="jong"&&r===Qe?Qe:t==="pron"?Wu(u,r):Ku(u,r,u==="jung"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const lo={cho:null,jung:null,jong:null,syllable:null},Ld="wt_filter",Zu=e=>`wt_filter_${e}`;function Ju(e){try{const t=localStorage.getItem(Zu(e))??localStorage.getItem(Ld);if(t)return JSON.parse(t)}catch{}return null}function Rd(e){const t=e;return t?.composition?{cho:t.composition.cho??null,jung:t.composition.jung??null,jong:t.composition.jong??null,syllable:t.composition.syllable??null}:t?.choseong?{...lo,cho:t.choseong}:lo}function Id(e,t,n){const{t:o,i18n:u}=gt.useTranslation(),[r]=l.useState(()=>n?.resetOnMount?null:Ju(e)),i=r?.contrastCount,s=typeof i=="number"&&Number.isFinite(i)?i:1,[c,C]=l.useState(Math.min(5,Math.max(1,s))),[f,p]=l.useState(r?.phonemeView==="pron"?"pron":r?.phonemeView==="direct"?"direct":"char"),[d,m]=l.useState(()=>Rd(r)),k=l.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Qe,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Qe:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);l.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||m(_=>_.cho||_.jung||_.syllable!=null||_.jong?_:k())},[]);const w=l.useMemo(()=>_e(d.cho)||_e(d.jung)||_e(d.jong)?"count":"random",[d.cho,d.jung,d.jong]),E=l.useRef(f==="char"?d.jung:null);l.useEffect(()=>{f==="char"&&(E.current=d.jung)},[f,d.jung]);const[g,S]=l.useState(n?.resetOnMount?!!n?.defaultImageOnly:r?.excludeNoImage??!0),[A,B]=l.useState(n?.resetOnMount?!1:r?.sameStructureOnly??!0),[L,D]=l.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),[I,$]=l.useState(Array.isArray(r?.posFilter)?r.posFilter:[]),[G,P]=l.useState(Array.isArray(r?.wordTypeFilter)?r.wordTypeFilter:[]),Q=l.useRef(n?.resetKey);l.useEffect(()=>{Q.current!==n?.resetKey&&(Q.current=n?.resetKey,m(k()),S(!1),B(!1),D([]),$([]),P([]),C(1))},[n?.resetKey]);const Y=Fu(),[W,F]=l.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[x,v]=l.useState(!1),[ye,Z]=l.useState(null),ee=1,M=Math.max(1,[d.cho,d.jung,d.jong].filter(Boolean).length);l.useEffect(()=>{c<M&&C(M)},[M,c]);const[j,ae]=l.useState(e);l.useEffect(()=>{if(j!==e){if(!n?.resetOnMount){const _=Ju(e),z=typeof _?.contrastCount=="number"&&Number.isFinite(_.contrastCount)?_.contrastCount:1;C(Math.min(5,Math.max(1,z))),m(_?.composition??k()),S(_?.excludeNoImage??!0),B(_?.sameStructureOnly??!0),p(_?.phonemeView==="pron"?"pron":"char"),D(Array.isArray(_?.gradeFilter)?_.gradeFilter:[]),$(Array.isArray(_?.posFilter)?_.posFilter:[]),P(Array.isArray(_?.wordTypeFilter)?_.wordTypeFilter:[])}ae(e)}},[e,j,n?.resetOnMount]),l.useEffect(()=>{if(!n?.resetOnMount&&j===e)try{localStorage.setItem(Zu(e),JSON.stringify({contrastCount:c,composition:d,excludeNoImage:g,sameStructureOnly:A,phonemeView:f,gradeFilter:L,posFilter:I,wordTypeFilter:G}))}catch{}},[n?.resetOnMount,e,j,c,d,g,A,f,L,I,G]);const[ne,q]=l.useState(0);Oo("wordpool:update",()=>q(_=>_+1));const Me=l.useRef(u.language);l.useEffect(()=>{Me.current!==u.language&&(Me.current=u.language,q(_=>_+1))},[u.language]),l.useEffect(()=>{if(!t.choseong)return;let _=!1;return Ra({difficulty:w,excludeNoImage:g}).then(z=>{_||(F(z),z.cho.size+z.jung.size+z.jong.size>0&&v(!0))}).catch(()=>{_||F({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{_=!0}},[t.choseong,w,g,ne]),l.useEffect(()=>{let _=!1;const z=d,O=z.cho?st(z.cho):null,K=z.jung?st(z.jung):null,ie=z.jong===Qe,Pe=ie?null:z.jong?st(z.jong):null,ve=z.syllable!=null?ao(z.syllable):null,be=!!(O||K||Pe||ie||ve);return La({difficulty:t.difficulty?w:null,contrastCount:t.difficulty?c:1,composition:t.choseong&&be?{cho:O,jung:K,jong:Pe,jongNone:ie,syllable:ve}:null,excludeNoImage:g,sameStructureOnly:A,phonemeView:f==="pron"?"pron":"char",grade:L.length>0?L:null}).then(Ne=>{_||Z(Ne)}).catch(()=>{_||Z(null)}),()=>{_=!0}},[t.choseong,t.difficulty,w,c,d,f,g,A,ne,L]),l.useEffect(()=>{x&&m(_=>{const z={..._};let O=!1;return["cho","jung","jong"].forEach(K=>{const ie=_[K];!ie||ie===Qe||st(ie).some(Pe=>W[K].has(Pe))||(z[K]=null,O=!0)}),_.syllable!=null&&t.fixedSyllable==null&&(_.syllable>=et?[...W.syllable].some(K=>K>=et)||(z.syllable=null,O=!0):(!W.syllable.has(_.syllable)||_.syllable<ee)&&(z.syllable=null,O=!0)),O?z:_})},[W,x,ee,t.fixedSyllable]);const X=l.useMemo(()=>{const _=z=>{const O=new Set;for(const K of Yu[z])W[z].has(K)&&O.add(K);return O};return{cho:_("cho"),jung:_("jung"),jong:_("jong")}},[W]),he=l.useMemo(()=>({exact:new Set(Uu.filter(_=>W.syllable.has(_))),min:[...W.syllable].some(_=>_>=et)}),[W]),H=l.useMemo(()=>({diffPhonemeCount:o("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),He=l.useMemo(()=>({[H.trainOnset]:"cho",[H.trainVowel]:"jung",[H.trainCoda]:"jong"}),[H]),ze=l.useCallback((_,z)=>l.createElement(_d,{title:z,items:_}),[]),je=l.useMemo(()=>[o("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."}),o("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."})],[o]),tt=l.useMemo(()=>{const _=[];if(t.choseong){const z={value:Qe,displayLabel:H.codaExclude},O=t.fixedNoCoda===!0,K=(ie,Pe)=>{const ve=O&&ie==="jong",be={label:Pe,groupLabel:H.phonemeGroup,allOption:!t.requireSyllable,allLabel:H.noLimit,allOptionDisabled:ve};if(f==="pron"){const Se=so[ie].map(Ct=>Ct.map(({v:We,tooltip:ot})=>{const Ue=st(We),$e=ve||!Ue.some(lt=>W[ie].has(lt));return Ue.length>1?{value:We,labels:Ue,tooltip:ot,disabled:$e}:{value:We,tooltip:ot,disabled:$e}}));return ie==="jong"&&!t.requireCoda&&Se.unshift([z]),{...be,groups:Se}}const Ne=Yu[ie].map(Se=>!ve&&X[ie].has(Se)?Se:{value:Se,disabled:!0});return{...be,items:ie==="jong"&&!t.requireCoda?[z,...Ne]:Ne}};_.push(K("cho",H.trainOnset)),_.push(K("jung",H.trainVowel)),_.push(K("jong",H.trainCoda))}if(_.push({...Hu(o,Y,{labelAction:ze([o("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:H.gradeLabel}),t.partOfSpeech&&_.push(zu(Y)),t.wordType&&_.push(Vu(Y)),t.choseong||t.fixedSyllable!=null){const z=t.fixedSyllable;_.push({label:H.syllableCount,items:[...Uu.map(O=>({value:ro(O),displayLabel:o("wordPairs.syllableN",{n:O,defaultValue:"{{n}}\uC74C\uC808"}),disabled:z!=null?O!==z:!he.exact.has(O)||O<ee})),{value:ro(et),displayLabel:o("wordPairs.syllableNPlus",{n:et,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:z!=null?et!==z:!he.min}],allOption:!0,allOptionDisabled:z!=null})}return t.choseong?_.push({label:H.exclude,displayLabel:H.selectLabel,multiple:!0,items:[H.excludeImage,H.sameStructure],labelAction:ze(je)}):_.push({label:H.exclude,displayLabel:H.selectLabel,multiple:!0,items:[H.excludeImage],labelAction:ze([je[0]])}),_},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,ee,X,W,f,he,H,o,ze,je,Y]),Ve={...t.difficulty?{[H.diffPhonemeCount]:String(c)}:{},...(t.choseong||t.fixedSyllable!=null)&&d.syllable!=null?{[H.syllableCount]:ro(d.syllable)}:{},...t.choseong&&d.cho?{[H.trainOnset]:d.cho}:{},...t.choseong&&d.jung?{[H.trainVowel]:d.jung}:{},...t.choseong&&d.jong?{[H.trainCoda]:d.jong}:{},[H.exclude]:[...g?[H.excludeImage]:[],...A?[H.sameStructure]:[]],[H.gradeLabel]:L.map(_=>o("wordSearch.filter.grade",{n:Number(_),defaultValue:"{{n}}\uB4F1\uAE09"})),...t.partOfSpeech?{[Y.partOfSpeech]:I}:{},...t.wordType?{[Y.wordType]:G}:{}},te=l.useCallback((_,z)=>{if(z===H.diffPhonemeCount){const O=Number(_);O>=1&&C(O)}else if(z===H.exclude)_===H.excludeImage?S(O=>!O):_===H.sameStructure&&B(O=>!O);else if(z===H.syllableCount)m(O=>{if(!_||_===bt)return{...O,syllable:null};const K=vd(_);return{...O,syllable:O.syllable===K?null:K}});else if(z===H.gradeLabel){if(!_||_===bt){D([]);return}const O=_.replace(/\D/g,"");D(K=>K.includes(O)?K.filter(ie=>ie!==O):[...K,O])}else if(z===Y.partOfSpeech){if(!_||_===bt){$([]);return}$(O=>O.includes(_)?O.filter(K=>K!==_):[...O,_])}else if(z===Y.wordType){if(!_||_===bt){P([]);return}P(O=>O.includes(_)?O.filter(K=>K!==_):[...O,_])}else{const O=He[z];if(!O)return;m(K=>t.requireSyllable?_&&_!==bt?{...K,[O]:_}:K:!_||_===bt||K[O]===_?{...K,[O]:null}:{...K,[O]:_})}},[H,He,Y,t.requireSyllable]),nt=l.useCallback(_=>!t.partOfSpeech&&!t.wordType?!0:Nd(_,{...t.partOfSpeech?{[Y.partOfSpeech]:I}:{},...t.wordType?{[Y.wordType]:G}:{}},Y),[t.partOfSpeech,t.wordType,I,G,Y]),oe=l.useCallback(_=>{_!==f&&(_!=="direct"&&f!=="direct"&&m(z=>Xu(z,_,E.current)),p(_))},[f]),pt=l.useCallback(()=>({composition:d,contrastCount:c,excludeNoImage:g,sameStructureOnly:A,phonemeView:f,gradeFilter:L}),[d,c,g,A,f,L]),pe=l.useCallback(_=>{m(_.composition),C(_.contrastCount),S(_.excludeNoImage),B(_.sameStructureOnly??!0),p(_.phonemeView),D(Array.isArray(_.gradeFilter)?_.gradeFilter:[])},[]);return{difficulty:w,contrastCount:c,composition:d,choseong:d.cho,excludeNoImage:g,sameStructureOnly:A,gradeFilter:L,posFilter:I,wordTypeFilter:G,matchesWordAttributes:nt,poolVersion:ne,filterSections:tt,filterSelected:Ve,handleFilterSelect:te,phonemeView:f,setPhonemeView:oe,phonemeGroupLabel:H.phonemeGroup,wordCount:ye,getFilterSnapshot:pt,restoreFilterSnapshot:pe}}function jd(e){const t=s=>s?st(s):null,n=t(e.cho),o=t(e.jung),u=e.jong===Qe,r=u?null:t(e.jong),i=e.syllable!=null?ao(e.syllable):null;return!n&&!o&&!r&&!u&&!i?null:{cho:n,jung:o,jong:r,jongNone:u,syllable:i}}function Pd(e,t,n,o,u,r,i=!0,s="char",c=[]){const[C,f]=l.useState({}),[p,d]=l.useState(!1),{cho:m=null,jung:k=null,jong:w=null,syllable:E=null}=o??{},g=c.length>0?c.slice().sort().join(","):"";return l.useEffect(()=>{r>0&&Oa(u).catch(()=>{})},[r,u]),l.useEffect(()=>{let S=!1;return d(!0),(async()=>{const A=jd({cho:m,jung:k,jong:w,syllable:E}),B=`${m??""}_${k??""}_${w??""}_${E??""}_${g}`,L={};await Promise.all(e.map(async D=>{const I=Fn[D.key];try{const $=await iu(D.key,{difficulty:I.difficulty?t:null,contrastCount:I.difficulty?n:1,composition:I.choseong?A:null,count:5,excludeNoImage:u,sameStructureOnly:i,phonemeView:s,grade:c.length>0?c:null});$&&$.length>0?L[D.key]={id:`wt-${D.key}-${t}-${B}-${Date.now()}`,name:D.label,training_type:D.key,category_main_code:"WORD",iconColor:D.color,subTitle:D.subTitle,items:$,itemCount:$.length}:L[D.key]={id:`wt-${D.key}-empty`,name:D.label,training_type:D.key,category_main_code:"WORD",iconColor:D.color,subTitle:D.subTitle,items:[],itemCount:0,__empty:!0}}catch{L[D.key]=null}})),S||(f(L),d(!1))})(),()=>{S=!0}},[t,n,m,k,w,E,u,i,s,r,g]),{perTypeData:C,generating:p}}function $d(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Fd(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}const Mn=at;function co(e,t){const n=t?Fd($d(t)):Math.random;return{LISTEN_IN_NOISE:Mn(Zt,Math.max(0,e.LISTEN_IN_NOISE||0),n),SHORT_STORY:Mn(Jt,Math.max(0,e.SHORT_STORY||0),n),LONG_STORY:Mn(Qt,Math.max(0,e.LONG_STORY||0),n),ORDERING_SENTENCE:Mn(en,Math.max(0,e.ORDERING_SENTENCE||0),n)}}function Qu(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Hd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function er(e=!1,t=Hd,n){const o=kn(Date.now()),u=kn(Date.now()-864e5),r=`${n??""}|${o}`,i=`${n??""}|${u}`;return Zt.length>0||Jt.length>0||Qt.length>0||en.length>0?{today:co(t,r),yesterday:co(t,i)}:{today:co(t,r),yesterday:null}}function zd(e){const t=l.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=l.useRef(null),[o,u]=l.useState(!1),[r,i]=l.useState(!1),[s,c]=l.useState(0);l.useEffect(()=>{let f=!1,p,d=0;const m=40,k=()=>{p!==void 0&&(clearInterval(p),p=void 0)};let w=!1;try{const S=new URLSearchParams(window.location.search),A=S.get("forceRefresh")||S.get("force");w=A==="1"||A==="true"}catch{}const E=S=>{t.current=S.today,n.current=S.yesterday,u(!0),c(A=>A+1),f=!0,k()},g=async()=>{if(f)return;if(!w){const A=er(!1,void 0,e);if(Qu(A.today)){E(A);return}}try{await ld(3e3)}catch{}if(f)return;const S=er(w,void 0,e);if(Qu(S.today)){E(S);return}++d>=m&&(u(!0),f=!0,k())};return g(),p=setInterval(g,250),()=>{f=!0,k()}},[e]);const C=l.useCallback(f=>{const p=r?n.current:t.current,d=r?t.current:n.current;return p?.[f]?.length?p[f]:d?.[f]?.length?d[f]:void 0},[r,s]);return{loaded:o,showYesterday:r,setShowYesterday:i,getTrainingPerType:C}}const Lt=[];let Nn=!1;function tr(e){if(e.key!=="Escape"||e.defaultPrevented)return;const t=Lt[Lt.length-1];t&&(e.stopPropagation(),t())}function Vd(e){return Lt.push(e),!Nn&&typeof document<"u"&&(document.addEventListener("keydown",tr),Nn=!0),()=>{const t=Lt.lastIndexOf(e);t>=0&&Lt.splice(t,1),Lt.length===0&&Nn&&typeof document<"u"&&(document.removeEventListener("keydown",tr),Nn=!1)}}function Ud(e,t=!0){const n=vo(e);l.useEffect(()=>{if(t)return Vd(()=>{n.current?.()})},[t,n])}const ho=(e,t)=>`${e}:${t??1}`,fo=new Map;function Gd(e,t){const[n,o]=l.useState(0),u=e.map(r=>ho(r.word,r.homonum)).join("|");return l.useEffect(()=>{const r=(u?u.split("|"):[]).filter(c=>!fo.has(c));if(r.length===0)return;let i=!1;const s=Array.from(new Set(r.map(c=>c.slice(0,c.lastIndexOf(":")))));return t(s).then(c=>{if(!(i||c.length===0)){for(const C of c)C.Meaning&&fo.set(ho(C.Word,C.Homonum??void 0),C.Meaning);o(C=>C+1)}}),()=>{i=!0}},[u,t]),l.useMemo(()=>{const r=u?u.split("|"):[],i=new Map;for(const s of r){const c=fo.get(s);c!=null&&i.set(s,c)}return i},[u,n])}function Yd(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,u=Math.max(1,Math.ceil(e.length/o)),r=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),u):1;return{pageItems:l.useMemo(()=>e.slice((r-1)*o,r*o),[e,r,o]),totalPages:u,curPage:r}}function qd(e="warning"){const[t,n]=l.useState(""),[o,u]=l.useState(e),[r,i]=l.useState(0),s=l.useCallback((p,d)=>{u(d),n(p),i(m=>m+1)},[]),c=l.useCallback(p=>s(p,"warning"),[s]),C=l.useCallback(p=>s(p,"normal"),[s]),f=l.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:r,showToast:s,showWarning:c,showNormal:C,clearToast:f}}const nn={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},on=nn.blue,Tn=nn.green,un=nn.amber,xn=nn.purple,Wd=nn.pink,Kd=[{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:on,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:on,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:on,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:on,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:on,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:Tn,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:Tn,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:Tn,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:Tn,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:un,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:un,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:un,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:un,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:un,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:xn,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:xn,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:xn,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:xn,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:Wd,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xd(){const{t:e}=gt.useTranslation();return l.useMemo(()=>{const t=Object.fromEntries(hd(e).map(o=>[o.key,o.label])),n={...t};return Kd.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}exports.CACHE_GROUPS=Ho,exports.DocumentTitleSuppressContext=Ro,exports.EMPTY_COMPOSITION=lo,exports.MediaQueryOverrideContext=Do,exports.NO_CODA=Qe,exports.SYLLABLE_MIN=et,exports.VAP_PAGE_SIZE_OPTIONS=Go,exports.buildGradeSection=Hu,exports.buildPartOfSpeechSection=zu,exports.buildPositionSection=Sd,exports.buildSelectSection=bd,exports.buildSyllableSection=Ed,exports.buildWordTypeSection=Vu,exports.charToPronValue=Wu,exports.convertComposition=Xu,exports.fmtBytes=Pr,exports.lsBytes=zo,exports.meaningKey=ho,exports.pronToCharValue=Ku,exports.syllableToFilter=ao,exports.today=zt,exports.toggleAttributeFilter=kd,exports.useCacheManagement=$r,exports.useDailyTrainingSelection=zd,exports.useDelayedHoverAnchor=gd,exports.useDeviceManagement=Wr,exports.useDocumentTitle=br,exports.useEscToClose=Ud,exports.useFontScale=gr,exports.useHoverAnchor=$u,exports.useMediaQuery=Er,exports.usePagedList=Yd,exports.usePasswordChange=kr,exports.useRelativeDay=Sr,exports.useTablePaging=Yr,exports.useTableSort=qr,exports.useToastState=qd,exports.useTrainingTypeLabels=Xd,exports.useVisitAllPanel=Gr,exports.useVisitHistory=zr,exports.useVisitSchedule=Ur,exports.useWindowEvent=Oo,exports.useWordAttributeFilterKeys=Fu,exports.useWordDataStats=Fr,exports.useWordMeanings=Gd,exports.useWordTrainingDataGeneration=Pd,exports.useWordTrainingFilter=Id,exports.valueToJamos=st;
|
|
781
|
+
*/const h0=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],f0=y("thumbs-up",h0),fu={"alert-triangle":cu,"align-start-vertical":Ga,anchor:w1,"arrow-down":qa,"arrow-left":Ka,"arrow-right":Za,"arrow-right-left":Qa,"arrow-up-a-z":N1,"audio-lines":ti,baby:oi,ban:ri,"bar-chart-2":x1,bell:ii,"book-marked":li,"book-open":di,"bow-arrow":fi,braces:Ci,bug:mi,calendar:D1,"calendar-check":_i,"calendar-days":bi,camera:ki,car:O1,"chart-column":wi,"chart-line":Ni,"chart-pie":xi,check:Di,"chevron-down":t0,"chevron-left":Oi,"chevron-right":Ri,"chevron-up":o0,circle:r0,"clipboard-list":ji,coffee:R1,combine:$i,copy:Hi,"credit-card":Vi,database:Gi,diff:qi,download:Ki,ear:Zi,edit:Qi,"edit-2":ts,"edit-3":os,ellipsis:du,eraser:as,"external-link":ss,eye:cs,"file-text":hs,"flip-horizontal":ps,"folder-open":ys,"folder-plus":gs,gamepad:Es,"gamepad-2":j1,gavel:Ss,"git-merge":As,globe:Ms,headphones:Ts,heart:Bs,home:vs,inbox:$1,info:Ls,"key-round":Is,landmark:Ps,layers:Fs,"layout-dashboard":zs,leaf:Us,lightbulb:Ys,link:Ws,"link-2":Xs,"link-2-off":Js,list:el,"list-checks":nl,"list-ordered":ul,"list-tree":H1,loader:al,"log-out":sl,mail:cl,"map-pin":hl,menu:l0,"message-circle":pl,"message-circle-question-mark":yl,"message-square":gl,"message-square-more":V1,"message-square-text":El,minus:G1,"minus-circle":Sl,moon:d0,"more-horizontal":du,package:Al,palette:Ml,"party-popper":Tl,pause:Bl,pencil:vl,phone:Ll,play:Il,"play-circle":Pl,plus:Fl,printer:zl,"refresh-cw":Ul,repeat:Yl,replace:Wl,rocket:Xl,"rotate-ccw":Jl,"rotate-cw":ec,salad:nc,"scan-search":uc,search:lc,"circle-alert":hu,"alert-circle":hu,"check-circle":ic,scissors:dc,"search-x":fc,send:Cc,settings:mc,"share-2":q1,"shield-check":_c,"shopping-cart":bc,shuffle:kc,"skip-back":wc,"skip-forward":Nc,sparkles:K1,square:xc,star:Dc,store:Oc,"sun-medium":Rc,table:jc,"table-2":$c,terminal:Hc,"text-cursor-input":Vc,"text-initial":Gc,"thumbs-up":f0,ticket:qc,triangle:i0,"trash-2":Kc,"trending-up":Zc,"triangle-alert":cu,trophy:Qc,type:Z1,unlink:t1,upload:o1,user:r1,"user-plus":i1,"user-round":l1,"user-round-check":d1,users:f1,"users-round":C1,volume:Q1,"volume-2":m1,wrench:_1,x:b1,zap:k1};function p0(e){return fu[e]??null}const pu=new Set,C0=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function y0(e){return C0&&!(e in fu)&&!pu.has(e)&&(pu.add(e),console.warn(`[ihabdevteam-core] lucide \uC544\uC774\uCF58 '${e}' \uC774 \uC815\uC801 \uBAA9\uB85D\uC5D0 \uC5C6\uC5B4 \uB80C\uB354\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. utils/lucideIconSet.ts \uC758 STATIC_LUCIDE_ICONS \uC5D0 \uCD94\uAC00\uD558\uC138\uC694.`)),Promise.resolve(null)}const m0=e=>e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Za-z])([0-9])/g,"$1-$2").replace(/[_ ]+/g,"-").toLowerCase();function g0(e){const t=e.toLowerCase();if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||e.includes("/assets/"))return null;const n=(e.split("/").pop()||"").replace(/\.svg$/,"");return n?m0(n):null}const Cu=new Map;function _0(e){const t=typeof e=="string"?g0(e):null,n=t?p0(t)??Cu.get(t)??null:null,[o,u]=l.useState(null);return l.useEffect(()=>{if(!t||n)return;let r=!1;return y0(t).then(i=>{Cu.set(t,i),r||u(i)}),()=>{r=!0}},[t,n]),n??o}/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function yu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function E0(e){if(Array.isArray(e))return e}function b0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,u,r,i,s=[],d=!0,p=!1;try{if(r=(n=n.call(e)).next,t!==0)for(;!(d=(o=r.call(n)).done)&&(s.push(o.value),s.length!==t);d=!0);}catch(f){p=!0,u=f}finally{try{if(!d&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(p)throw u}}return s}}function S0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
782
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k0(e,t){return E0(e)||b0(e,t)||A0(e,t)||S0()}function A0(e,t){if(e){if(typeof e=="string")return yu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yu(e,t):void 0}}const mu=Object.entries,gu=Object.setPrototypeOf,w0=Object.isFrozen,M0=Object.getPrototypeOf,N0=Object.getOwnPropertyDescriptor;let Ce=Object.freeze,ge=Object.seal,vt=Object.create,_u=typeof Reflect<"u"&&Reflect,Wn=_u.apply,Kn=_u.construct;Ce||(Ce=function(t){return t}),ge||(ge=function(t){return t}),Wn||(Wn=function(t,n){for(var o=arguments.length,u=new Array(o>2?o-2:0),r=2;r<o;r++)u[r-2]=arguments[r];return t.apply(n,u)}),Kn||(Kn=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return new t(...o)});const St=fe(Array.prototype.forEach),T0=fe(Array.prototype.lastIndexOf),Eu=fe(Array.prototype.pop),qt=fe(Array.prototype.push),x0=fe(Array.prototype.splice),Ot=Array.isArray,Wt=fe(String.prototype.toLowerCase),Xn=fe(String.prototype.toString),bu=fe(String.prototype.match),Kt=fe(String.prototype.replace),Su=fe(String.prototype.indexOf),B0=fe(String.prototype.trim),D0=fe(Number.prototype.toString),v0=fe(Boolean.prototype.toString),ku=typeof BigInt>"u"?null:fe(BigInt.prototype.toString),Au=typeof Symbol>"u"?null:fe(Symbol.prototype.toString),De=fe(Object.prototype.hasOwnProperty),Xt=fe(Object.prototype.toString),we=fe(RegExp.prototype.test),kt=O0(TypeError);function fe(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),u=1;u<n;u++)o[u-1]=arguments[u];return Wn(e,t,o)}}function O0(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Kn(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wt;if(gu&&gu(e,null),!Ot(t))return e;let o=t.length;for(;o--;){let u=t[o];if(typeof u=="string"){const r=n(u);r!==u&&(w0(t)||(t[o]=r),u=r)}e[u]=!0}return e}function L0(e){for(let t=0;t<e.length;t++)De(e,t)||(e[t]=null);return e}function Re(e){const t=vt(null);for(const o of mu(e)){var n=k0(o,2);const u=n[0],r=n[1];De(e,u)&&(Ot(r)?t[u]=L0(r):r&&typeof r=="object"&&r.constructor===Object?t[u]=Re(r):t[u]=r)}return t}function R0(e){switch(typeof e){case"string":return e;case"number":return D0(e);case"boolean":return v0(e);case"bigint":return ku?ku(e):"0";case"symbol":return Au?Au(e):"Symbol()";case"undefined":return Xt(e);case"function":case"object":{if(e===null)return Xt(e);const t=e,n=qe(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:Xt(o)}return Xt(e)}default:return Xt(e)}}function qe(e,t){for(;e!==null;){const o=N0(e,t);if(o){if(o.get)return fe(o.get);if(typeof o.value=="function")return fe(o.value)}e=M0(e)}function n(){return null}return n}function I0(e){try{return we(e,""),!0}catch{return!1}}const wu=Ce(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zn=Ce(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jn=Ce(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),j0=Ce(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Qn=Ce(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P0=Ce(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mu=Ce(["#text"]),Nu=Ce(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eo=Ce(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Tu=Ce(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Sn=Ce(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$0=ge(/{{[\w\W]*|^[\w\W]*}}/g),F0=ge(/<%[\w\W]*|^[\w\W]*%>/g),H0=ge(/\${[\w\W]*/g),z0=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),V0=ge(/^aria-[\-\w]+$/),xu=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U0=ge(/^(?:\w+script|data):/i),G0=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y0=ge(/^html$/i),q0=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),Bu=ge(/<[/\w!]/g),Du=ge(/<[/\w]/g),W0=ge(/<\/no(script|embed|frames)/i),K0=ge(/\/>/i),Ie={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vu=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],X0=Ce(J({},vu)),Z0=(function(){const e={};return St(vu,t=>{e[t]=ge(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ce(e)})(),J0=function(){return typeof window>"u"?null:window},Q0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const u="data-tt-policy-suffix";n&&n.hasAttribute(u)&&(o=n.getAttribute(u));const r="dompurify"+(o?"#"+o:"");try{return t.createPolicy(r,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ou=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ht=function(t,n,o,u){return De(t,n)&&Ot(t[n])?J(u.base?Re(u.base):{},t[n],u.transform):o},to=function(t,n,o){const u=De(t,n)?t[n]:void 0;return u&&typeof u=="object"?Re(u):o()};function Lu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J0();const t=N=>Lu(N);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Ie.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,u=o.currentScript;e.DocumentFragment;const r=e.HTMLTemplateElement,i=e.Node,s=e.Element,d=e.NodeFilter,p=e.NamedNodeMap;p===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,C=e.trustedTypes,c=s.prototype,m=qe(c,"cloneNode"),S=qe(c,"remove"),w=qe(c,"nextSibling"),_=qe(c,"childNodes"),g=qe(c,"parentNode"),k=qe(c,"shadowRoot"),A=qe(c,"attributes"),T=i&&i.prototype?qe(i.prototype,"nodeType"):null,v=i&&i.prototype?qe(i.prototype,"nodeName"):null,D=i&&i.prototype?qe(i.prototype,"ownerDocument"):null,I=function(a){return T?T(a):a.nodeType},$=function(a){return v?v(a):a.nodeName};if(typeof r=="function"){const N=n.createElement("template");N.content&&N.content.ownerDocument&&(n=N.content.ownerDocument)}let G,P="",Q,Y=!1,W=0;const F=function(){if(W>0)throw kt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},B=function(a){F(),W++;try{return G.createHTML(a)}finally{W--}},O=function(a){F(),W++;try{return G.createScriptURL(a)}finally{W--}},ye=function(){return Y||(Q=Q0(C,u),Y=!0),Q},Z=n,ee=Z.implementation,M=Z.createNodeIterator,j=Z.createDocumentFragment,ae=Z.getElementsByTagName,ne=o.importNode;let q=Ou();t.isSupported=typeof mu=="function"&&typeof g=="function"&&ee&&ee.createHTMLDocument!==void 0;const Me=$0,X=F0,he=H0,H=z0,He=V0,ze=U0,je=G0,tt=q0;let Ve=xu,te=null;const nt=J({},[...wu,...Zn,...Jn,...Qn,...Mu]);let oe=null;const pt=J({},[...Nu,...eo,...Tu,...Sn]);let pe=Object.seal(vt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),E=null,z=null;const L=Object.seal(vt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let K=!0,ie=!0,Pe=!1,ve=!0,be=!1,Ne=!0,Se=!1,Ct=!1,We=null,ot=null,Ue=!1,$e=!1,lt=!1,yt=!1,Rt=!0,me=!1;const At="user-content-";let wt=!0,ut=!1,ct={},Ke=null;const ue=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Xe=null;const It=J({},["audio","video","img","source","image","track"]);let Mt=null;const po=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Nt=Ze,Bn=!1,Dn=null;const nr=J({},[rn,an,Ze],Xn),Co=Ce(["mi","mo","mn","ms","mtext"]);let vn=J({},Co);const yo=Ce(["annotation-xml"]);let On=J({},yo);const or=J({},["title","style","font","a","script"]);let jt=null;const ur=["application/xhtml+xml","text/html"],rr="text/html";let de=null,Tt=null;const ar=n.createElement("form"),mo=function(a){return a instanceof RegExp||a instanceof Function},Ln=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tt&&Tt===a)return;(!a||typeof a!="object")&&(a={}),a=Re(a),jt=ur.indexOf(a.PARSER_MEDIA_TYPE)===-1?rr:a.PARSER_MEDIA_TYPE,de=jt==="application/xhtml+xml"?Xn:Wt,te=ht(a,"ALLOWED_TAGS",nt,{transform:de}),oe=ht(a,"ALLOWED_ATTR",pt,{transform:de}),Dn=ht(a,"ALLOWED_NAMESPACES",nr,{transform:Xn}),Mt=ht(a,"ADD_URI_SAFE_ATTR",po,{transform:de,base:po}),Xe=ht(a,"ADD_DATA_URI_TAGS",It,{transform:de,base:It}),Ke=ht(a,"FORBID_CONTENTS",ue,{transform:de}),E=ht(a,"FORBID_TAGS",Re({}),{transform:de}),z=ht(a,"FORBID_ATTR",Re({}),{transform:de}),ct=De(a,"USE_PROFILES")?a.USE_PROFILES&&typeof a.USE_PROFILES=="object"?Re(a.USE_PROFILES):a.USE_PROFILES:!1,K=a.ALLOW_ARIA_ATTR!==!1,ie=a.ALLOW_DATA_ATTR!==!1,Pe=a.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=a.SAFE_FOR_TEMPLATES||!1,Ne=a.SAFE_FOR_XML!==!1,Se=a.WHOLE_DOCUMENT||!1,$e=a.RETURN_DOM||!1,lt=a.RETURN_DOM_FRAGMENT||!1,yt=a.RETURN_TRUSTED_TYPE||!1,Ue=a.FORCE_BODY||!1,Rt=a.SANITIZE_DOM!==!1,me=a.SANITIZE_NAMED_PROPS||!1,wt=a.KEEP_CONTENT!==!1,ut=a.IN_PLACE||!1,Ve=I0(a.ALLOWED_URI_REGEXP)?a.ALLOWED_URI_REGEXP:xu,Nt=typeof a.NAMESPACE=="string"?a.NAMESPACE:Ze,vn=to(a,"MATHML_TEXT_INTEGRATION_POINTS",()=>J({},Co)),On=to(a,"HTML_INTEGRATION_POINTS",()=>J({},yo));const h=to(a,"CUSTOM_ELEMENT_HANDLING",()=>vt(null));if(pe=vt(null),De(h,"tagNameCheck")&&mo(h.tagNameCheck)&&(pe.tagNameCheck=h.tagNameCheck),De(h,"attributeNameCheck")&&mo(h.attributeNameCheck)&&(pe.attributeNameCheck=h.attributeNameCheck),De(h,"allowCustomizedBuiltInElements")&&typeof h.allowCustomizedBuiltInElements=="boolean"&&(pe.allowCustomizedBuiltInElements=h.allowCustomizedBuiltInElements),ge(pe),be&&(ie=!1),lt&&($e=!0),ct&&(te=J({},Mu),oe=vt(null),ct.html===!0&&(J(te,wu),J(oe,Nu)),ct.svg===!0&&(J(te,Zn),J(oe,eo),J(oe,Sn)),ct.svgFilters===!0&&(J(te,Jn),J(oe,eo),J(oe,Sn)),ct.mathMl===!0&&(J(te,Qn),J(oe,Tu),J(oe,Sn))),L.tagCheck=null,L.attributeCheck=null,De(a,"ADD_TAGS")&&(typeof a.ADD_TAGS=="function"?L.tagCheck=a.ADD_TAGS:Ot(a.ADD_TAGS)&&(te===nt&&(te=Re(te)),J(te,a.ADD_TAGS,de))),De(a,"ADD_ATTR")&&(typeof a.ADD_ATTR=="function"?L.attributeCheck=a.ADD_ATTR:Ot(a.ADD_ATTR)&&(oe===pt&&(oe=Re(oe)),J(oe,a.ADD_ATTR,de))),De(a,"ADD_FORBID_CONTENTS")&&Ot(a.ADD_FORBID_CONTENTS)&&(Ke===ue&&(Ke=Re(Ke)),J(Ke,a.ADD_FORBID_CONTENTS,de)),wt&&(te["#text"]=!0),Se&&J(te,["html","head","body"]),te.table&&(J(te,["tbody"]),delete E.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const b=G;G=a.TRUSTED_TYPES_POLICY;try{P=B("")}catch(x){throw G=b,x}}else a.TRUSTED_TYPES_POLICY===null?(G=void 0,P=""):(G===void 0&&(G=ye()),G&&typeof P=="string"&&(P=B("")));Ce&&Ce(a),Tt=a},go=J({},[...Zn,...Jn,...j0]),_o=J({},[...Qn,...P0]),ir=function(a,h,b){return h.namespaceURI===Ze?a==="svg":h.namespaceURI===rn?a==="svg"&&(b==="annotation-xml"||vn[b]):!!go[a]},sr=function(a,h,b){return h.namespaceURI===Ze?a==="math":h.namespaceURI===an?a==="math"&&On[b]:!!_o[a]},lr=function(a,h,b){return h.namespaceURI===an&&!On[b]||h.namespaceURI===rn&&!vn[b]?!1:!_o[a]&&(or[a]||!go[a])},cr=function(a){let h=g(a);(!h||!h.tagName)&&(h={namespaceURI:Nt,tagName:"template"});const b=Wt(a.tagName),x=Wt(h.tagName);return Dn[a.namespaceURI]?a.namespaceURI===an?ir(b,h,x):a.namespaceURI===rn?sr(b,h,x):a.namespaceURI===Ze?lr(b,h,x):!!(jt==="application/xhtml+xml"&&Dn[a.namespaceURI]):!1},dt=function(a){qt(t.removed,{element:a});try{g(a).removeChild(a)}catch{if(S(a),!g(a))throw kt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Eo=function(a,h,b){try{a.removeAttributeNode(h)}catch{try{a.removeAttribute(b)}catch{}}},sn=function(a){ln(a);const h=_(a);if(h){const x=[];St(h,R=>{qt(x,R)}),St(x,R=>{try{S(R)}catch{}})}const b=A(a);if(b)for(let x=b.length-1;x>=0;--x){const R=b[x],U=R&&R.name;typeof U=="string"&&Eo(a,R,U)}},mt=function(a,h,b){if(!b)try{b=h.getAttributeNode(a)}catch{b=null}qt(t.removed,{attribute:b||null,from:h});try{b?h.removeAttributeNode(b):h.removeAttribute(a)}catch{try{h.removeAttribute(a)}catch{}}if(a==="is")if($e||lt)try{dt(h)}catch{}else try{h.setAttribute(a,"")}catch{}},dr=function(a){const h=A(a);if(h)for(let b=h.length-1;b>=0;--b){const x=h[b],R=x&&x.name;typeof R!="string"||oe[de(R)]||Eo(a,x,R)}},ln=function(a){const h=[a];for(;h.length>0;){const b=h.pop();I(b)===Ie.element&&dr(b);const R=_(b);if(R)for(let U=R.length-1;U>=0;--U)h.push(R[U])}},bo=function(a,h){return Ne?a==="patchsrc"?!0:a==="for"&&h!=="label"&&h!=="output":!1},hr=function(a){if(!Ne)return;const h=[a];for(;h.length>0;){const b=h.pop(),x=I(b);if(x===Ie.processingInstruction||x===Ie.comment&&we(Du,b.data)){try{S(b)}catch{}continue}if(x===Ie.element){const U=b,se=de($(b));try{U.hasAttribute&&U.hasAttribute("patchsrc")&&U.removeAttribute("patchsrc"),U.hasAttribute&&U.hasAttribute("for")&&bo("for",se)&&U.removeAttribute("for")}catch{}}const R=_(b);if(R)for(let U=R.length-1;U>=0;--U)h.push(R[U])}},So=function(a){let h=null,b=null;if(Ue)a="<remove></remove>"+a;else{const U=bu(a,/^[\r\n\t ]+/);b=U&&U[0]}jt==="application/xhtml+xml"&&Nt===Ze&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");const x=G?B(a):a;if(Nt===Ze)try{h=new f().parseFromString(x,jt)}catch{}if(!h||!h.documentElement){h=ee.createDocument(Nt,"template",null);try{h.documentElement.innerHTML=Bn?P:x}catch{}}const R=h.body||h.documentElement;return a&&b&&R.insertBefore(n.createTextNode(b),R.childNodes[0]||null),Nt===Ze?ae.call(h,Se?"html":"body")[0]:Se?h.documentElement:R},ko=function(a){const h=D?D(a):a.ownerDocument;return M.call(h||a,a,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},cn=function(a){return a=Kt(a,Me," "),a=Kt(a,X," "),a=Kt(a,he," "),a},Rn=function(a){var h;a.normalize();const b=D?D(a):a.ownerDocument,x=M.call(b||a,a,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let R=x.nextNode();for(;R;)R.data=cn(R.data),R=x.nextNode();const U=(h=a.querySelectorAll)===null||h===void 0?void 0:h.call(a,"template");U&&St(U,se=>{xt(se.content)&&Rn(se.content)})},dn=function(a){const h=v?v(a):null;return typeof h!="string"||de(h)!=="form"?!1:typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||a.attributes!==A(a)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function"||a.nodeType!==T(a)||a.childNodes!==_(a)},xt=function(a){if(!T||typeof a!="object"||a===null)return!1;try{return T(a)===Ie.documentFragment}catch{return!1}},Pt=function(a){if(!T||typeof a!="object"||a===null)return!1;try{return typeof T(a)=="number"}catch{return!1}};function Je(N,a,h){N.length!==0&&St(N,b=>{b.call(t,a,h,Tt)})}const fr=function(a,h){return!!(Ne&&a.hasChildNodes()&&!Pt(a.firstElementChild)&&we(Bu,a.textContent)&&we(Bu,a.innerHTML)||Ne&&a.namespaceURI===Ze&&X0[h]&&(Pt(a.firstElementChild)||typeof a.textContent=="string"&&we(Z0[h],a.textContent))||a.nodeType===Ie.processingInstruction||Ne&&a.nodeType===Ie.comment&&we(Du,a.data))},hn=function(a,h){if(a instanceof RegExp)return we(a,h);if(a instanceof Function){for(var b=arguments.length,x=new Array(b>2?b-2:0),R=2;R<b;R++)x[R-2]=arguments[R];return!!a(h,...x)}return!1},pr=function(a,h,b){if(!E[h]&&To(h)&&hn(pe.tagNameCheck,h))return!1;if(wt&&!Ke[h]){const x=g(a),R=_(a);if(R&&x){const U=R.length;for(let se=U-1;se>=0;--se){const ce=a===b?m(R[se],!0):R[se];x.insertBefore(ce,w(a))}}}return dt(a),!0},Ao=function(a,h,b,x){return a.length===0?h:h===b||h===x?Re(h):h},wo=function(a,h){return a===h||g(a)!==null?!1:(ut&&ln(a),!0)},Mo=function(a,h){if(Je(q.beforeSanitizeElements,a,null),wo(a,h))return!0;if(dn(a))return dt(a),!0;const b=de($(a));if(te=Ao(q.uponSanitizeElement,te,nt,We),Je(q.uponSanitizeElement,a,{tagName:b,allowedTags:te}),wo(a,h))return!0;if(fr(a,b))return dt(a),!0;if(E[b]||!(L.tagCheck instanceof Function&&L.tagCheck(b))&&!te[b]){const R=pr(a,b,h);return R===!1&&Je(q.afterSanitizeElements,a,null),R}if(I(a)===Ie.element&&!cr(a)||(b==="noscript"||b==="noembed"||b==="noframes")&&we(W0,a.innerHTML))return dt(a),!0;if(be&&a.nodeType===Ie.text){const R=cn(a.textContent);a.textContent!==R&&(qt(t.removed,{element:a.cloneNode()}),a.textContent=R)}return Je(q.afterSanitizeElements,a,null),!1},No=function(a,h,b){if(z[h]||bo(h,a)||Rt&&(h==="id"||h==="name")&&(b in n||b in ar))return!1;const x=oe[h]||L.attributeCheck instanceof Function&&L.attributeCheck(h,a);return ie&&we(H,h)||K&&we(He,h)?!0:x?Mt[h]||we(Ve,Kt(b,je,""))||(h==="src"||h==="xlink:href"||h==="href")&&a!=="script"&&Su(b,"data:")===0&&Xe[a]||Pe&&!we(ze,Kt(b,je,""))?!0:!b:To(a)&&hn(pe.tagNameCheck,a)&&hn(pe.attributeNameCheck,h,a)||h==="is"&&pe.allowCustomizedBuiltInElements&&hn(pe.tagNameCheck,b)},Cr=J({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),To=function(a){return!Cr[Wt(a)]&&we(tt,a)},yr=function(a,h,b,x){if(G&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!b)switch(C.getAttributeType(a,h)){case"TrustedHTML":return B(x);case"TrustedScriptURL":return O(x)}return x},mr=function(a,h,b,x){try{b?a.setAttributeNS(b,h,x):a.setAttribute(h,x),dn(a)?dt(a):Eu(t.removed)}catch{mt(h,a)}},xo=function(a){Je(q.beforeSanitizeAttributes,a,null);const h=a.attributes;if(!h||dn(a))return;oe=Ao(q.uponSanitizeAttribute,oe,pt,ot);const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let x=h.length;const R=de(a.nodeName);for(;x--;){const U=h[x],se=U.name,ce=U.namespaceURI,xe=U.value,Be=de(se),jn=xe;let Te=se==="value"?jn:B0(jn);if(b.attrName=Be,b.attrValue=Te,b.keepAttr=!0,b.forceKeepAttr=void 0,Je(q.uponSanitizeAttribute,a,b),Te=b.attrValue,me&&(Be==="id"||Be==="name")&&Su(Te,At)!==0&&(mt(se,a,U),Te=At+Te),Ne&&we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Te)){mt(se,a,U);continue}if(Be==="attributename"&&bu(Te,"href")){mt(se,a,U);continue}if(!b.forceKeepAttr){if(!b.keepAttr){mt(se,a,U);continue}if(!ve&&we(K0,Te)){mt(se,a,U);continue}if(be&&(Te=cn(Te)),!No(R,Be,Te)){mt(se,a,U);continue}Te=yr(R,Be,ce,Te),Te!==jn&&mr(a,se,ce,Te)}}Je(q.afterSanitizeAttributes,a,null)},fn=function(a){let h=null;const b=ko(a);for(Je(q.beforeSanitizeShadowDOM,a,null);h=b.nextNode();)if(Je(q.uponSanitizeShadowNode,h,null),Mo(h,a),xo(h),xt(h.content)&&fn(h.content),I(h)===Ie.element){const x=k(h);xt(x)&&(In(x),fn(x))}Je(q.afterSanitizeShadowDOM,a,null)},In=function(a){const h=[{node:a,shadow:null}];for(;h.length>0;){const b=h.pop();if(b.shadow){fn(b.shadow);continue}const x=b.node,U=I(x)===Ie.element,se=_(x);if(se)for(let ce=se.length-1;ce>=0;--ce)h.push({node:se[ce],shadow:null});if(U){const ce=v?v(x):null;if(typeof ce=="string"&&de(ce)==="template"){const xe=x.content;xt(xe)&&h.push({node:xe,shadow:null})}}if(U){const ce=k(x);xt(ce)&&h.push({node:null,shadow:ce},{node:ce,shadow:null})}}};return t.sanitize=function(N){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,b=null,x=null,R=null;if(Bn=!N,Bn&&(N="<!-->"),typeof N!="string"&&!Pt(N)&&(N=R0(N),typeof N!="string"))throw kt("dirty is not a string, aborting");if(!t.isSupported)return N;Ct?(te=We,oe=ot):Ln(a),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(te=Re(te)),q.uponSanitizeAttribute.length>0&&(oe=Re(oe)),t.removed=[];const U=ut&&typeof N!="string"&&Pt(N);if(U){hr(N);const xe=$(N);if(typeof xe=="string"){const Be=de(xe);if(!te[Be]||E[Be])throw sn(N),kt("root node is forbidden and cannot be sanitized in-place")}if(dn(N))throw sn(N),kt("root node is clobbered and cannot be sanitized in-place");try{In(N)}catch(Be){throw sn(N),Be}}else if(Pt(N))h=So("<!---->"),b=h.ownerDocument.importNode(N,!0),b.nodeType===Ie.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?h=b:h.appendChild(b),In(b);else{if(!$e&&!be&&!Se&&N.indexOf("<")===-1)return G&&yt?B(N):N;if(h=So(N),!h)return $e?null:yt?P:""}h&&Ue&&dt(h.firstChild);const se=U?N:h;try{const xe=ko(se);for(;x=xe.nextNode();)Mo(x,se),xo(x),xt(x.content)&&fn(x.content)}catch(xe){throw U&&(sn(N),St(t.removed,Be=>{Be.element&&ln(Be.element)})),xe}if(U)return St(t.removed,xe=>{xe.element&&ln(xe.element)}),be&&Rn(N),N;if($e){if(be&&Rn(h),lt)for(R=j.call(h.ownerDocument);h.firstChild;)R.appendChild(h.firstChild);else R=h;return(oe.shadowroot||oe.shadowrootmode)&&(R=ne.call(o,R,!0)),R}let ce=Se?h.outerHTML:h.innerHTML;return Se&&te["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&we(Y0,h.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+h.ownerDocument.doctype.name+`>
|
|
783
|
+
`+ce),be&&(ce=cn(ce)),G&&yt?B(ce):ce},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(N),Ct=!0,We=te,ot=oe},t.clearConfig=function(){Tt=null,Ct=!1,We=null,ot=null,G=Q,P=""},t.isValidAttribute=function(N,a,h){Tt||Ln({});const b=de(N),x=de(a);return No(b,x,h)},t.addHook=function(N,a){typeof a=="function"&&De(q,N)&&qt(q[N],a)},t.removeHook=function(N,a){if(De(q,N)){if(a!==void 0){const h=T0(q[N],a);return h===-1?void 0:x0(q[N],h,1)[0]}return Eu(q[N])}},t.removeHooks=function(N){De(q,N)&&(q[N]=[])},t.removeAllHooks=function(){q=Ou()},t}var ed=Lu();const td=/^(?:[a-z]+:)?\/\//i;let nd="";function od(){return nd}function no(e){const t=String(e||"").trim();if(!t)return"";if(td.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const n=t.startsWith("/")?t:`/${t}`,o=od();return o?`${o}${n}`:n}function ud(){return kn(new Date)}function kn(e){if(e==null||e==="")return"";const t=e instanceof Date?e:new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(t)}const Zt=[],Jt=[],Qt=[],en=[],An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},wn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},rd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let oo=null,Ru=null,ft=null;function ad({counts:e,forceRefresh:t}={}){const n=Object.assign({},rd,e||{}),o=ud(),u=kn(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(n);if(!t&&Ru===o&&oo===r&&ft)return Object.assign(An,ft.today),Object.assign(wn,ft.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:An,yesterday:wn};const i={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let s=null;return ft&&oo===r&&ft.yesterday&&ft.yesterday.date===u&&(s=ft.yesterday.selection),s||(s={LISTEN_IN_NOISE:at(Zt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:at(Jt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:at(Qt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:at(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(An,i),Object.assign(wn,s),Ru=o,oo=r,ft={today:i,yesterday:{date:u,countsKey:r,selection:s}},{today:An,yesterday:wn}}let Iu=!1,tn=null;async function id(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Pn&&Pn.tagName.toUpperCase()==="SCRIPT"&&Pn.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",t=await fetch(`${e}data/allTrainingData.json`);return t.ok?await t.json():null}catch{return null}}async function sd(){if(!Iu)return tn||(tn=(async()=>{const e=await id();if(!e){tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const u=o,r=String(u.training_type||t),i=String(u.category_main_code||u.category_main||u.category_0||""),s=String(u.category_sub_code||u.category_sub||u.category_1||""),d=Object.assign({},u,{training_type:r,category_0:i,category_1:s});r==="LISTEN_IN_NOISE"?Zt.push(d):r==="SHORT_STORY"?Jt.push(d):r==="LONG_STORY"?Qt.push(d):r==="ORDERING_SENTENCE"&&en.push(d)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{ad()}catch{}Iu=!0})(),tn)}async function ld(e=3e3){const t=sd();return Promise.race([t,new Promise(n=>setTimeout(n,e))])}const cd=[{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."}],dd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function hd(e){return cd.map(t=>{const n=dd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}function fd(e){return typeof window>"u"?"":ed.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use"],FORBID_ATTR:["xlink:href","href"]})}function pd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),[r,i]=l.useState(null),[s,d]=l.useState(null);return l.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){n(null),u(null),i(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=no(e):/^(Logo|Symbol)/i.test(p)?f=no(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),n(f)},[e]),l.useEffect(()=>{if(!t)return;let p=!1;async function f(){try{let C=await fetch(t);C.ok||(C=await fetch(t));const c=C.headers.get("content-type")||"";if(p)return;if(c.includes("svg")){u("mask");return}if(c.startsWith("image/")){u("img");return}const m=await fetch(t);if(!m.ok)throw new Error("not ok");const S=await m.text();if(p)return;if(/^\s*<svg[\s>]/i.test(S)){const w=fd(S);if(!w){u("none");return}i(w),u("inline");return}u("none")}catch{p||u("none")}}return f(),()=>{p=!0}},[t]),l.useEffect(()=>{let p=!1,f=null;return o==="mask"&&t&&fetch(t).then(C=>{if(!C.ok)throw new Error("fetch failed");return C.blob()}).then(C=>{p||(f=URL.createObjectURL(C),d(f))}).catch(()=>{p||u("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),d(null)}},[o,t]),{iconToUse:t,mode:o,svgText:r,blobUrl:s}}function Cd(e){const{icon:t,label:n,className:o,imgClassName:u,maskClassName:r,svgClassName:i,wrapperStyle:s,size:d}=e||{},p=o??"iconRenderer-icon",f=u??"iconRenderer-icon-image",C=r??"iconRenderer-icon-mask",c=i??"iconRenderer-icon-svg",m=typeof t=="string"?t:null,S=_0(m),{iconToUse:w,mode:_,svgText:g,blobUrl:k}=pd(m),A=(I,$={})=>V.jsx("span",{className:p,style:s,...$,children:I}),T=(I,$={})=>V.jsx("img",{src:I,alt:typeof n=="string"?n:n?String(n):"",className:f,...$});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(V.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(S)try{return A(l.createElement(S,{className:c,size:typeof d=="number"?d:20}),{"aria-hidden":"true"})}catch{}if(w&&w.endsWith(".svg")){if(_==="mask"){const I={"--icon-url":k?`url(${k})`:`url(${w})`};return A(V.jsx("span",{className:C,style:I}),{"aria-hidden":"true"})}return _==="img"?A(T(w,{onError:I=>{I.currentTarget.onerror=null,I.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):_==="inline"?A(V.jsx("span",{className:c,dangerouslySetInnerHTML:g?{__html:g}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return T(no(t),{style:s,onError:I=>{I.currentTarget.onerror=null,I.currentTarget.style.display="none"}});const v=typeof d=="number"?d:20,D=`<svg width="${v}" height="${v}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(V.jsx("span",{className:c,dangerouslySetInnerHTML:{__html:D}}),{"aria-hidden":"true"})}function ju(e){const{anchorRect:t,anchorEl:n,offset:o=20,edgeMargin:u=20,onClose:r,closeOnOutsideClick:i=!0,className:s="",role:d="dialog",ariaLabel:p="",children:f,backdrop:C=!1,isMobilePopup:c=!1,useBorder:m=!0,header:S}=e||{},w=l.useRef(null),[_,g]=l.useState({position:"fixed",left:0,top:-9999}),[k,A]=l.useState(!1),[T,v]=l.useState("bottom"),[D,I]=l.useState(!1),[$,G]=l.useState(!1),P=!t&&!n,Q=l.useCallback((B=!1)=>{if($&&c)return;const O=n?n.getBoundingClientRect():t;if(!O||!w.current)return;const ye=w.current,{offsetWidth:Z,offsetHeight:ee}=ye,M=window.innerWidth,j=window.innerHeight,ae=M-O.right,ne=O.left,q=O.top,Me=j-O.bottom;let X=0,he=0,H="top";if(q>=ee+o)H="top",he=O.top-o-ee,X=O.left+O.width/2-Z/2;else if(Me>=ee+o)H="bottom",he=O.bottom+o,X=O.left+O.width/2-Z/2;else if(ae>=Z+o)H="right",X=O.right+o,he=O.top+O.height/2-ee/2;else if(ne>=Z+o)H="left",X=O.left-o-Z,he=O.top+O.height/2-ee/2;else{const tt=Math.max(q,Me,ae,ne);tt===q?(H="top",he=O.top-o-ee,X=O.left+O.width/2-Z/2):tt===Me?(H="bottom",he=O.bottom+o,X=O.left+O.width/2-Z/2):tt===ae?(H="right",X=O.right+o,he=O.top+O.height/2-ee/2):(H="left",X=O.left-o-Z,he=O.top+O.height/2-ee/2)}const He=Number(u)||8;X=Math.min(Math.max(X,He),M-Z-He),he=Math.min(Math.max(he,He),j-ee-He);const ze=Math.round(X),je=Math.round(he);B&&w.current?(w.current.style.left=`${ze}px`,w.current.style.top=`${je}px`,w.current.dataset.placement=H):(v(H||T),g({position:"fixed",left:ze,top:je}),I(!0))},[$,c,n,t,o,u,T]);l.useLayoutEffect(()=>{if(P)return;if($&&c){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),I(!0);return}Q();const B=requestAnimationFrame(()=>Q());return()=>cancelAnimationFrame(B)},[t,n,o,f,u,P,$,c,Q]),l.useEffect(()=>{if(P||$&&c||!w.current||typeof ResizeObserver>"u")return;const B=new ResizeObserver(()=>{t&&Q()});return B.observe(w.current),()=>B.disconnect()},[t,f,u,P,$,c,Q]),l.useEffect(()=>{if(P||$&&c)return;const B=()=>Q(!0);return window.addEventListener("resize",B),document.addEventListener("scroll",B,{passive:!0,capture:!0}),()=>{window.removeEventListener("resize",B),document.removeEventListener("scroll",B,{capture:!0})}},[t,o,f,u,P,$,c,Q]),l.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const B=window.matchMedia("(max-width: 768px)"),O=()=>G(!!B.matches);O();try{B.addEventListener?B.addEventListener("change",O):B.addListener(O)}catch{try{B.addListener(O)}catch{}}return()=>{try{B.removeEventListener?B.removeEventListener("change",O):B.removeListener(O)}catch{}}},[]);const Y=l.useRef(!1),W=l.useCallback((B=!1)=>{if(!(k||Y.current)){if(Y.current=!0,B){A(!0);try{r&&r()}catch{}return}A(!0),setTimeout(()=>{r&&r()},200)}},[k,r,A]);l.useEffect(()=>{const B=Z=>{const ee=w.current;if(!ee)return;const M=Z.target;if(M&&!ee.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},O=Z=>{const ee=w.current;if(!ee)return;const M=Z.target;if(M&&!ee.contains(M)){try{if(M.closest&&M.closest("[data-tooltip-ignore]"))return}catch{}i&&W(!0)}},ye=Z=>{if(Z.key==="Escape"){Z.stopPropagation(),W();return}if(Z.key==="Tab"){const ee=w.current;if(!ee)return;const M=ee.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!M||M.length===0)return;const j=M[0],ae=M[M.length-1],ne=document.activeElement;Z.shiftKey?ne===j&&(Z.preventDefault(),ae.focus()):ne===ae&&(Z.preventDefault(),j.focus())}};return document.addEventListener("pointerdown",B,!0),document.addEventListener("click",O,!0),document.addEventListener("keydown",ye),()=>{document.removeEventListener("pointerdown",B,!0),document.removeEventListener("click",O,!0),document.removeEventListener("keydown",ye)}},[r,i,W]),l.useEffect(()=>{const B=()=>{W(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",B),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",B)}},[W]);const F=V.jsxs("div",{ref:w,className:`tooltip-content ${m?"tooltip-content--bordered":""} ${k?"is-closing":""} ${s} ${$&&c?"is-mobile":""}`,role:d,"aria-label":p||void 0,style:P?{}:{..._,visibility:D?"visible":"hidden"},tabIndex:-1,"data-placement":T,"data-left":P?"":_.left,"data-top":P?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[S!=null&&V.jsx("div",{className:"tooltip-content__header h5",children:S}),f]});if(P||typeof document>"u")return F;if(C||$&&c){const B=V.jsxs("div",{className:"tooltip-portal",children:[V.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&W(!0)}}),F]});return Bo.createPortal(B,document.body)}return Bo.createPortal(F,document.body)}function yd(e){const{anchorRect:t,text:n,offset:o=8,onClose:u,className:r="",ariaLabel:i}=e||{};return n?V.jsx(ju,{anchorRect:t,offset:o,onClose:u,closeOnOutsideClick:!1,className:`tooltip-info ${r}`,ariaLabel:i||n,children:V.jsx("div",{className:"tooltip-info__content body-3",children:n})}):null}function Pu(e){const{anchorRect:t,title:n,items:o,activeIndex:u=-1,showIndex:r=!0,onClose:i,offset:s=12}=e||{},d=Array.isArray(o)?o:o?[o]:[];return!d.length&&!n?null:V.jsx(ju,{anchorRect:t,offset:s,onClose:i,closeOnOutsideClick:!0,useBorder:!1,className:"tooltip-description",children:V.jsxs("div",{className:"tooltip-description__box",children:[n&&V.jsx("span",{className:"tooltip-description__title body-2",children:n}),V.jsx("ol",{className:"tooltip-description__items",children:d.map((p,f)=>V.jsxs("li",{className:`tooltip-description__item body-3${f===u?" tooltip-description__item--active":""}`,children:[r&&d.length>1&&V.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),V.jsx("span",{children:p})]},f))})]})})}function md(e){const{size:t=48,type:n,htmlType:o,href:u,target:r,rel:i,icon:s,rightIcon:d,label:p,count:f,subLabel:C,children:c,ariaLabel:m,variant:S="default",align:w="center",selected:_,toggleable:g=!1,disabled:k=!1,useLabel:A=!0,useBorder:T=!0,useBG:v=!0,useDisabledCovered:D=!1,useDisabledInvisible:I=!1,width:$,minWidth:G,onClick:P,onDisabledClick:Q,showTooltipInfo:Y=!1,tooltipInfoText:W=null,tooltipDescription:F=null,iconSize:B="medium",iconColor:O,shape:ye="rounded",color:Z,className:ee,...M}=e,j=typeof t=="string"&&isNaN(Number(t))?t.toLowerCase():String(Number(t)||48),ae=j.match(/^\d+$/)?`button${j}`:`button-${j}`,ne=Number(t),q=!isNaN(ne)&&ne<40?"button-2":"button-1",Me=p??c,X=k||!!M.disabled,he=X?D?"disabled-covered":I?"disabled-invisibled":"disabled":S,H=he?`button--variant-${he}`:"",He=w?`button--align-${w}`:"",ze=ye?`button--shape-${ye}`:"",je=typeof O=="string"&&O.startsWith("--")?`var(${O})`:O,tt={...$?{width:typeof $=="number"?`${$}px`:$}:{},...G?{minWidth:typeof G=="number"?`${G}px`:G}:{},...T?{}:{"--button-border":X?"0":"1px solid transparent"},...je?{"--button-icon-color":je}:{},...Z?{"--color-main":Z}:{}},Ve=A===!1?"":Me,te=Array.isArray(Ve)?Ve.length>0:!!Ve,nt=!!d,oe=n??(te||s||nt?"bar":"dot"),pt=`${ae}--${oe}`,pe=l.useRef(null),E=l.useRef(X),[z,L]=l.useState(!!_),[K,ie]=l.useState(!1),[Pe,ve]=l.useState(null),be=l.useCallback(()=>ie(!1),[]);l.useEffect(()=>{(Y||F)&&X&&K&&(ie(!1),ve(null))},[X,Y,F,K]),l.useEffect(()=>{typeof _=="boolean"&&L(_)},[_]),l.useEffect(()=>{if(E.current&&!X&&pe.current){const ue=pe.current;ue.blur(),ue.style.pointerEvents="none";const Xe=requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe.current&&(pe.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(Xe)}E.current=X},[X]);const Ne=typeof _=="boolean"?!!_:z,Se=g||typeof _=="boolean"?Ne?"true":"false":void 0,Ct=Ia("button",ae,pt,H,He,ze,Ne?"is-selected":null,v?null:"button--no-bg",ee),We=`button__icon button__icon--${B}`,ot=Array.isArray(C)?C:C!==void 0?[C]:[],Ue=()=>{if(Array.isArray(Ve))return Ve.map((Xe,It)=>{const Mt=ot[It];return V.jsxs("span",{className:`button__label-text${Mt!==void 0?" button__label-text--has-sub":""}`,children:[Xe,Mt!==void 0&&V.jsx("span",{className:"button__sub-label-text caption-1",children:Mt})]},It)});const ue=C!==void 0;return V.jsxs("span",{className:`button__label-text${ue?" button__label-text--has-sub":""}`,children:[Ve,f!=null&&V.jsx("span",{className:"button__count",children:f}),ue&&V.jsx("span",{className:"button__sub-label-text caption-1",children:C})]})},$e=ue=>{X||(typeof M.onMouseLeave=="function"&&M.onMouseLeave(ue),typeof _!="boolean"&&L(!1),ue.currentTarget.blur())},lt=ue=>{if(X){Q?.(ue);return}typeof _!="boolean"&&g&&L(Xe=>!Xe),P?.(ue)},yt=l.useCallback(()=>{!X&&(Y||F)&&(ie(!0),ve(pe.current?.getBoundingClientRect()??null))},[X,Y,F]),Rt=l.useCallback(()=>{(Y||F)&&(ie(!1),ve(null))},[Y,F]),me={...M};delete me.disabled,delete me.className,delete me.faded,delete me.useFaded,delete me.loading,delete me.onMouseLeave,delete me.onPointerEnter,delete me.onPointerLeave,delete me.onFocus,delete me.onBlur,X&&(Object.keys(me).forEach(ue=>{/^on[A-Z]/.test(ue)&&typeof me[ue]=="function"&&delete me[ue]}),me["aria-disabled"]="true");const At=(typeof Y=="string"?Y:null)??(typeof W=="string"?W:null)??(typeof m=="string"?m:null)??(typeof Me=="string"?Me:null)??void 0,wt=typeof m=="string"?m:typeof Me=="string"?Me:At,ut=(ue,Xe)=>V.jsx(Cd,{icon:ue,label:Xe??wt,className:We,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),ct=()=>oe==="dot"?V.jsxs(V.Fragment,{children:[ut(s),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()})]}):w==="center"&&s?V.jsxs(V.Fragment,{children:[V.jsxs("span",{className:"button__center-group",children:[V.jsx("span",{className:"button__left",children:ut(s)}),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()})]}),nt&&V.jsx("span",{className:"button__right",children:ut(d)})]}):V.jsxs(V.Fragment,{children:[s&&V.jsx("span",{className:"button__left",children:ut(s,m??Me)}),te&&V.jsx("span",{className:`button__label ${q}`,children:Ue()}),nt&&V.jsx("span",{className:"button__right",children:ut(d)})]}),Ke=!!u&&!X;return V.jsxs(V.Fragment,{children:[V.jsx(Ke?"a":"button",{...me,ref:pe,...Ke?{href:u,target:r,rel:i??(r==="_blank"?"noreferrer":void 0)}:{type:o,disabled:X&&!Q},className:Ct,"aria-pressed":Se,"aria-label":wt,"aria-disabled":Ke&&X?!0:void 0,style:tt,onClick:lt,onMouseLeave:$e,onPointerEnter:ue=>{yt(),!X&&typeof M.onPointerEnter=="function"&&M.onPointerEnter(ue)},onPointerLeave:ue=>{Rt(),!X&&typeof M.onPointerLeave=="function"&&M.onPointerLeave(ue)},onFocus:ue=>{yt(),!X&&typeof M.onFocus=="function"&&M.onFocus(ue)},onBlur:ue=>{$e(ue),Rt(),!X&&typeof M.onBlur=="function"&&M.onBlur(ue)},children:ct()}),K&&F?V.jsx(Pu,{anchorRect:Pe,title:F.title,items:F.items,onClose:be}):K&&At?V.jsx(yd,{anchorRect:Pe,text:At,onClose:be}):null]})}function $u(){const[e,t]=l.useState(null),n=l.useCallback(r=>t(r.getBoundingClientRect()),[]),o=l.useCallback(()=>t(null),[]),u=l.useCallback(r=>{const i=r.getBoundingClientRect();t(s=>s?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:u}}function gd(e){const[t,n]=l.useState(null),[o,u]=l.useState(null),r=l.useRef(null);l.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=l.useCallback((d,p)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n(d),u(p)},e)},[e]),s=l.useCallback(()=>{r.current&&clearTimeout(r.current),n(null),u(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:s}}function _d({title:e,items:t}){const{t:n}=gt.useTranslation(),{anchorRect:o,openAt:u,close:r}=$u();return V.jsxs(V.Fragment,{children:[V.jsx(md,{size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!o,ariaLabel:n("common.info","\uC124\uBA85"),onPointerEnter:i=>u(i.currentTarget),onPointerLeave:r,onFocus:i=>u(i.currentTarget),onBlur:r}),o&&V.jsx(Pu,{title:e,items:t,showIndex:t.length>1,anchorRect:o,onClose:r})]})}function Fu(){const{t:e}=gt.useTranslation();return l.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 Hu(e,t,n){return{label:t.difficulty,items:[1,2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction}}function zu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Vu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function Ed(e,t){return{label:t.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}),t.syllable5plus],multiple:!0,allOption:!0}}function bd(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction}}function Sd(e,t){const{label:n,headValue:o,midValue:u,tailValue:r,includeMid:i=!0,headDisabled:s,midDisabled:d,tailDisabled:p,allOptionDisabled:f,groupLabel:C,labelAction:c}=t;return{label:n,...C?{groupLabel:C}:{},...c?{labelAction:c}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...f?{allOptionDisabled:f}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...i?[{value:u,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:d}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:p}]}}function kd(e,t,n){if(t===bt){const{[n]:r,...i}=e;return i}const o=e[n]??[],u=o.includes(t)?o.filter(r=>r!==t):[...o,t];if(u.length===0){const{[n]:r,...i}=e;return i}return{...e,[n]:u}}Object.fromEntries(Object.entries(Jr).map(([e,{nucleus:t}])=>[e,t]));const Ad={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},wd={"\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"]},Md={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:wd,typeMap:Ad};function Nd(e,t,n=Md){const o=t[n.difficulty];if(o?.length&&!o.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const u=t[n.syllables];if(u?.length){const s=e.syllables??0;if(!u.some(d=>d===n.syllable5plus?s>=5:s===parseInt(d)))return!1}const r=t[n.partOfSpeech];if(r?.length&&!r.flatMap(s=>n.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const i=t[n.wordType];return!(i?.length&&!i.some(s=>e.wordType===n.typeMap[s]))}const it=(e,t)=>t.map(n=>({jamos:[n],tooltip:e})),Ee=(e,t)=>({jamos:[...e],tooltip:t}),uo={cho:[it("\uC591\uC21C\uC74C",["\u3142","\u3143","\u314D","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3138","\u314C","\u3134","\u3139"]),it("\uCE58\uC870\uC74C",["\u3145","\u3146"]),it("\uACBD\uAD6C\uAC1C\uC74C",["\u3148","\u3149","\u314A"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3132","\u314B"]),it("\uC131\uBB38\uC74C",["\u314E"])],jung:[[Ee("\u3163","\uC804\uC124 \uACE0\uBAA8\uC74C"),Ee("\u315F","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 w\uD65C\uC74C"),Ee("\u3162","\uC804\uC124 \uACE0\uBAA8\uC74C \xB7 \u0270\uD65C\uC74C")],[Ee("\u3161","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C")],[Ee("\u315C","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u3160","\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u3154\u3150","\uC804\uC124 \uC911\uBAA8\uC74C"),Ee("\u3156\u3152","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3159\u315A\u315E","\uC804\uC124 \uC911\uBAA8\uC74C \xB7 w\uD65C\uC74C")],[Ee("\u3153","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"),Ee("\u3155","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 j\uD65C\uC74C"),Ee("\u315D","\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C \xB7 w\uD65C\uC74C")],[Ee("\u3157","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"),Ee("\u315B","\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C \xB7 j\uD65C\uC74C")],[Ee("\u314F","\uC800\uBAA8\uC74C"),Ee("\u3151","\uC800\uBAA8\uC74C \xB7 j\uD65C\uC74C"),Ee("\u3158","\uC800\uBAA8\uC74C \xB7 w\uD65C\uC74C")]],jong:[it("\uC591\uC21C\uC74C",["\u3142","\u3141"]),it("\uCE58\uC870\uC74C",["\u3137","\u3134","\u3139"]),it("\uC5F0\uAD6C\uAC1C\uC74C",["\u3131","\u3147"])]},Td=[...ke],xd=[...rt],Bd=Fe.filter(e=>e!==""),st=e=>e===Qe?[]:Array.from(e),Qe="__NO_CODA__",Uu=[1,2,3,4],et=5,Dd=12,Gu="SYL_",ro=e=>`${Gu}${e}`,vd=e=>Number(e.slice(Gu.length));function ao(e){return e>=et?Array.from({length:Dd-et+1},(t,n)=>et+n):[e]}const Yu={cho:Td,jung:xd,jong:Bd},io=e=>e.map(t=>t.map(({jamos:n,tooltip:o})=>({v:n.join(""),tooltip:o}))),so={cho:io(uo.cho),jung:io(uo.jung),jong:io(uo.jong)},qu={};so.jung.flat().forEach(({v:e})=>{for(const t of st(e))qu[t]=e});const Od=new Set(so.cho.flat().map(e=>e.v));function Wu(e,t){return e==="cho"?Od.has(t)?t:null:e==="jung"?qu[t]??t:qo(t)}function Ku(e,t,n){if(e==="jung"){const o=st(t);return n&&o.includes(n)?n:o[0]??t}return t}function Xu(e,t,n){const o=(u,r)=>r?u==="jong"&&r===Qe?Qe:t==="pron"?Wu(u,r):Ku(u,r,u==="jung"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const lo={cho:null,jung:null,jong:null,syllable:null},Ld="wt_filter",Zu=e=>`wt_filter_${e}`;function Ju(e){try{const t=localStorage.getItem(Zu(e))??localStorage.getItem(Ld);if(t)return JSON.parse(t)}catch{}return null}function Rd(e){const t=e;return t?.composition?{cho:t.composition.cho??null,jung:t.composition.jung??null,jong:t.composition.jong??null,syllable:t.composition.syllable??null}:t?.choseong?{...lo,cho:t.choseong}:lo}function Id(e,t,n){const{t:o,i18n:u}=gt.useTranslation(),[r]=l.useState(()=>n?.resetOnMount?null:Ju(e)),i=r?.contrastCount,s=typeof i=="number"&&Number.isFinite(i)?i:1,[d,p]=l.useState(Math.min(5,Math.max(1,s))),[f,C]=l.useState(r?.phonemeView==="pron"?"pron":r?.phonemeView==="direct"?"direct":"char"),[c,m]=l.useState(()=>Rd(r)),S=l.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Qe,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Qe:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);l.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||m(E=>E.cho||E.jung||E.syllable!=null||E.jong?E:S())},[]);const w=l.useMemo(()=>_e(c.cho)||_e(c.jung)||_e(c.jong)?"count":"random",[c.cho,c.jung,c.jong]),_=l.useRef(f==="char"?c.jung:null);l.useEffect(()=>{f==="char"&&(_.current=c.jung)},[f,c.jung]);const[g,k]=l.useState(n?.resetOnMount?!!n?.defaultImageOnly:r?.excludeNoImage??!0),[A,T]=l.useState(n?.resetOnMount?!1:r?.sameStructureOnly??!0),[v,D]=l.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),[I,$]=l.useState(Array.isArray(r?.posFilter)?r.posFilter:[]),[G,P]=l.useState(Array.isArray(r?.wordTypeFilter)?r.wordTypeFilter:[]),Q=l.useRef(n?.resetKey);l.useEffect(()=>{Q.current!==n?.resetKey&&(Q.current=n?.resetKey,m(S()),k(!1),T(!1),D([]),$([]),P([]),p(1))},[n?.resetKey]);const Y=Fu(),[W,F]=l.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[B,O]=l.useState(!1),[ye,Z]=l.useState(null),ee=1,M=Math.max(1,[c.cho,c.jung,c.jong].filter(Boolean).length);l.useEffect(()=>{d<M&&p(M)},[M,d]);const[j,ae]=l.useState(e);l.useEffect(()=>{if(j!==e){if(!n?.resetOnMount){const E=Ju(e),z=typeof E?.contrastCount=="number"&&Number.isFinite(E.contrastCount)?E.contrastCount:1;p(Math.min(5,Math.max(1,z))),m(E?.composition??S()),k(E?.excludeNoImage??!0),T(E?.sameStructureOnly??!0),C(E?.phonemeView==="pron"?"pron":"char"),D(Array.isArray(E?.gradeFilter)?E.gradeFilter:[]),$(Array.isArray(E?.posFilter)?E.posFilter:[]),P(Array.isArray(E?.wordTypeFilter)?E.wordTypeFilter:[])}ae(e)}},[e,j,n?.resetOnMount]),l.useEffect(()=>{if(!n?.resetOnMount&&j===e)try{localStorage.setItem(Zu(e),JSON.stringify({contrastCount:d,composition:c,excludeNoImage:g,sameStructureOnly:A,phonemeView:f,gradeFilter:v,posFilter:I,wordTypeFilter:G}))}catch{}},[n?.resetOnMount,e,j,d,c,g,A,f,v,I,G]);const[ne,q]=l.useState(0);Oo("wordpool:update",()=>q(E=>E+1));const Me=l.useRef(u.language);l.useEffect(()=>{Me.current!==u.language&&(Me.current=u.language,q(E=>E+1))},[u.language]),l.useEffect(()=>{if(!t.choseong)return;let E=!1;return Ra({difficulty:w,excludeNoImage:g}).then(z=>{E||(F(z),z.cho.size+z.jung.size+z.jong.size>0&&O(!0))}).catch(()=>{E||F({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{E=!0}},[t.choseong,w,g,ne]),l.useEffect(()=>{let E=!1;const z=c,L=z.cho?st(z.cho):null,K=z.jung?st(z.jung):null,ie=z.jong===Qe,Pe=ie?null:z.jong?st(z.jong):null,ve=z.syllable!=null?ao(z.syllable):null,be=!!(L||K||Pe||ie||ve);return La({difficulty:t.difficulty?w:null,contrastCount:t.difficulty?d:1,composition:t.choseong&&be?{cho:L,jung:K,jong:Pe,jongNone:ie,syllable:ve}:null,excludeNoImage:g,sameStructureOnly:A,phonemeView:f==="pron"?"pron":"char",grade:v.length>0?v:null}).then(Ne=>{E||Z(Ne)}).catch(()=>{E||Z(null)}),()=>{E=!0}},[t.choseong,t.difficulty,w,d,c,f,g,A,ne,v]),l.useEffect(()=>{B&&m(E=>{const z={...E};let L=!1;return["cho","jung","jong"].forEach(K=>{const ie=E[K];!ie||ie===Qe||st(ie).some(Pe=>W[K].has(Pe))||(z[K]=null,L=!0)}),E.syllable!=null&&t.fixedSyllable==null&&(E.syllable>=et?[...W.syllable].some(K=>K>=et)||(z.syllable=null,L=!0):(!W.syllable.has(E.syllable)||E.syllable<ee)&&(z.syllable=null,L=!0)),L?z:E})},[W,B,ee,t.fixedSyllable]);const X=l.useMemo(()=>{const E=z=>{const L=new Set;for(const K of Yu[z])W[z].has(K)&&L.add(K);return L};return{cho:E("cho"),jung:E("jung"),jong:E("jong")}},[W]),he=l.useMemo(()=>({exact:new Set(Uu.filter(E=>W.syllable.has(E))),min:[...W.syllable].some(E=>E>=et)}),[W]),H=l.useMemo(()=>({diffPhonemeCount:o("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),He=l.useMemo(()=>({[H.trainOnset]:"cho",[H.trainVowel]:"jung",[H.trainCoda]:"jong"}),[H]),ze=l.useCallback((E,z)=>l.createElement(_d,{title:z,items:E}),[]),je=l.useMemo(()=>[o("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."}),o("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."})],[o]),tt=l.useMemo(()=>{const E=[];if(t.choseong){const z={value:Qe,displayLabel:H.codaExclude},L=t.fixedNoCoda===!0,K=(ie,Pe)=>{const ve=L&&ie==="jong",be={label:Pe,groupLabel:H.phonemeGroup,allOption:!t.requireSyllable,allLabel:H.noLimit,allOptionDisabled:ve};if(f==="pron"){const Se=so[ie].map(Ct=>Ct.map(({v:We,tooltip:ot})=>{const Ue=st(We),$e=ve||!Ue.some(lt=>W[ie].has(lt));return Ue.length>1?{value:We,labels:Ue,tooltip:ot,disabled:$e}:{value:We,tooltip:ot,disabled:$e}}));return ie==="jong"&&!t.requireCoda&&Se.unshift([z]),{...be,groups:Se}}const Ne=Yu[ie].map(Se=>!ve&&X[ie].has(Se)?Se:{value:Se,disabled:!0});return{...be,items:ie==="jong"&&!t.requireCoda?[z,...Ne]:Ne}};E.push(K("cho",H.trainOnset)),E.push(K("jung",H.trainVowel)),E.push(K("jong",H.trainCoda))}if(E.push({...Hu(o,Y,{labelAction:ze([o("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:H.gradeLabel}),t.partOfSpeech&&E.push(zu(Y)),t.wordType&&E.push(Vu(Y)),t.choseong||t.fixedSyllable!=null){const z=t.fixedSyllable;E.push({label:H.syllableCount,items:[...Uu.map(L=>({value:ro(L),displayLabel:o("wordPairs.syllableN",{n:L,defaultValue:"{{n}}\uC74C\uC808"}),disabled:z!=null?L!==z:!he.exact.has(L)||L<ee})),{value:ro(et),displayLabel:o("wordPairs.syllableNPlus",{n:et,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:z!=null?et!==z:!he.min}],allOption:!0,allOptionDisabled:z!=null})}return t.choseong?E.push({label:H.exclude,displayLabel:H.selectLabel,multiple:!0,items:[H.excludeImage,H.sameStructure],labelAction:ze(je)}):E.push({label:H.exclude,displayLabel:H.selectLabel,multiple:!0,items:[H.excludeImage],labelAction:ze([je[0]])}),E},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,ee,X,W,f,he,H,o,ze,je,Y]),Ve={...t.difficulty?{[H.diffPhonemeCount]:String(d)}:{},...(t.choseong||t.fixedSyllable!=null)&&c.syllable!=null?{[H.syllableCount]:ro(c.syllable)}:{},...t.choseong&&c.cho?{[H.trainOnset]:c.cho}:{},...t.choseong&&c.jung?{[H.trainVowel]:c.jung}:{},...t.choseong&&c.jong?{[H.trainCoda]:c.jong}:{},[H.exclude]:[...g?[H.excludeImage]:[],...A?[H.sameStructure]:[]],[H.gradeLabel]:v.map(E=>o("wordSearch.filter.grade",{n:Number(E),defaultValue:"{{n}}\uB4F1\uAE09"})),...t.partOfSpeech?{[Y.partOfSpeech]:I}:{},...t.wordType?{[Y.wordType]:G}:{}},te=l.useCallback((E,z)=>{if(z===H.diffPhonemeCount){const L=Number(E);L>=1&&p(L)}else if(z===H.exclude)E===H.excludeImage?k(L=>!L):E===H.sameStructure&&T(L=>!L);else if(z===H.syllableCount)m(L=>{if(!E||E===bt)return{...L,syllable:null};const K=vd(E);return{...L,syllable:L.syllable===K?null:K}});else if(z===H.gradeLabel){if(!E||E===bt){D([]);return}const L=E.replace(/\D/g,"");D(K=>K.includes(L)?K.filter(ie=>ie!==L):[...K,L])}else if(z===Y.partOfSpeech){if(!E||E===bt){$([]);return}$(L=>L.includes(E)?L.filter(K=>K!==E):[...L,E])}else if(z===Y.wordType){if(!E||E===bt){P([]);return}P(L=>L.includes(E)?L.filter(K=>K!==E):[...L,E])}else{const L=He[z];if(!L)return;m(K=>t.requireSyllable?E&&E!==bt?{...K,[L]:E}:K:!E||E===bt||K[L]===E?{...K,[L]:null}:{...K,[L]:E})}},[H,He,Y,t.requireSyllable]),nt=l.useCallback(E=>!t.partOfSpeech&&!t.wordType?!0:Nd(E,{...t.partOfSpeech?{[Y.partOfSpeech]:I}:{},...t.wordType?{[Y.wordType]:G}:{}},Y),[t.partOfSpeech,t.wordType,I,G,Y]),oe=l.useCallback(E=>{E!==f&&(E!=="direct"&&f!=="direct"&&m(z=>Xu(z,E,_.current)),C(E))},[f]),pt=l.useCallback(()=>({composition:c,contrastCount:d,excludeNoImage:g,sameStructureOnly:A,phonemeView:f,gradeFilter:v}),[c,d,g,A,f,v]),pe=l.useCallback(E=>{m(E.composition),p(E.contrastCount),k(E.excludeNoImage),T(E.sameStructureOnly??!0),C(E.phonemeView),D(Array.isArray(E.gradeFilter)?E.gradeFilter:[])},[]);return{difficulty:w,contrastCount:d,composition:c,choseong:c.cho,excludeNoImage:g,sameStructureOnly:A,gradeFilter:v,posFilter:I,wordTypeFilter:G,matchesWordAttributes:nt,poolVersion:ne,filterSections:tt,filterSelected:Ve,handleFilterSelect:te,phonemeView:f,setPhonemeView:oe,phonemeGroupLabel:H.phonemeGroup,wordCount:ye,getFilterSnapshot:pt,restoreFilterSnapshot:pe}}function jd(e){const t=s=>s?st(s):null,n=t(e.cho),o=t(e.jung),u=e.jong===Qe,r=u?null:t(e.jong),i=e.syllable!=null?ao(e.syllable):null;return!n&&!o&&!r&&!u&&!i?null:{cho:n,jung:o,jong:r,jongNone:u,syllable:i}}function Pd(e,t,n,o,u,r,i=!0,s="char",d=[]){const[p,f]=l.useState({}),[C,c]=l.useState(!1),{cho:m=null,jung:S=null,jong:w=null,syllable:_=null}=o??{},g=d.length>0?d.slice().sort().join(","):"";return l.useEffect(()=>{r>0&&Oa(u).catch(()=>{})},[r,u]),l.useEffect(()=>{let k=!1;return c(!0),(async()=>{const A=jd({cho:m,jung:S,jong:w,syllable:_}),T=`${m??""}_${S??""}_${w??""}_${_??""}_${g}`,v={};await Promise.all(e.map(async D=>{const I=Fn[D.key];try{const $=await iu(D.key,{difficulty:I.difficulty?t:null,contrastCount:I.difficulty?n:1,composition:I.choseong?A:null,count:5,excludeNoImage:u,sameStructureOnly:i,phonemeView:s,grade:d.length>0?d:null});$&&$.length>0?v[D.key]={id:`wt-${D.key}-${t}-${T}-${Date.now()}`,name:D.label,training_type:D.key,category_main_code:"WORD",iconColor:D.color,subTitle:D.subTitle,items:$,itemCount:$.length}:v[D.key]={id:`wt-${D.key}-empty`,name:D.label,training_type:D.key,category_main_code:"WORD",iconColor:D.color,subTitle:D.subTitle,items:[],itemCount:0,__empty:!0}}catch{v[D.key]=null}})),k||(f(v),c(!1))})(),()=>{k=!0}},[t,n,m,S,w,_,u,i,s,r,g]),{perTypeData:p,generating:C}}function $d(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Fd(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}const Mn=at;function co(e,t){const n=t?Fd($d(t)):Math.random;return{LISTEN_IN_NOISE:Mn(Zt,Math.max(0,e.LISTEN_IN_NOISE||0),n),SHORT_STORY:Mn(Jt,Math.max(0,e.SHORT_STORY||0),n),LONG_STORY:Mn(Qt,Math.max(0,e.LONG_STORY||0),n),ORDERING_SENTENCE:Mn(en,Math.max(0,e.ORDERING_SENTENCE||0),n)}}function Qu(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Hd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function er(e=!1,t=Hd,n){const o=kn(Date.now()),u=kn(Date.now()-864e5),r=`${n??""}|${o}`,i=`${n??""}|${u}`;return Zt.length>0||Jt.length>0||Qt.length>0||en.length>0?{today:co(t,r),yesterday:co(t,i)}:{today:co(t,r),yesterday:null}}function zd(e){const t=l.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=l.useRef(null),[o,u]=l.useState(!1),[r,i]=l.useState(!1),[s,d]=l.useState(0),[p,f]=l.useState(!1);l.useEffect(()=>{let c=!1,m,S=0;const w=40,_=()=>{m!==void 0&&(clearInterval(m),m=void 0)};let g=!1;try{const T=new URLSearchParams(window.location.search),v=T.get("forceRefresh")||T.get("force");g=v==="1"||v==="true"}catch{}const k=T=>{t.current=T.today,n.current=T.yesterday,u(!0),f(!0),d(v=>v+1),c=!0,_()},A=async()=>{if(c)return;if(!g){const v=er(!1,void 0,e);if(Qu(v.today)){k(v);return}}try{await ld(3e3)}catch{}if(c)return;const T=er(g,void 0,e);if(Qu(T.today)){k(T);return}++S>=w&&(u(!0),f(!1),c=!0,_())};return A(),m=setInterval(A,250),()=>{c=!0,_()}},[e]);const C=l.useCallback(c=>{const m=r?n.current:t.current,S=r?t.current:n.current;return m?.[c]?.length?m[c]:S?.[c]?.length?S[c]:void 0},[r,s]);return{loaded:o,hasData:p,showYesterday:r,setShowYesterday:i,getTrainingPerType:C}}const Lt=[];let Nn=!1;function tr(e){if(e.key!=="Escape"||e.defaultPrevented)return;const t=Lt[Lt.length-1];t&&(e.stopPropagation(),t())}function Vd(e){return Lt.push(e),!Nn&&typeof document<"u"&&(document.addEventListener("keydown",tr),Nn=!0),()=>{const t=Lt.lastIndexOf(e);t>=0&&Lt.splice(t,1),Lt.length===0&&Nn&&typeof document<"u"&&(document.removeEventListener("keydown",tr),Nn=!1)}}function Ud(e,t=!0){const n=vo(e);l.useEffect(()=>{if(t)return Vd(()=>{n.current?.()})},[t,n])}const ho=(e,t)=>`${e}:${t??1}`,fo=new Map;function Gd(e,t){const[n,o]=l.useState(0),u=e.map(r=>ho(r.word,r.homonum)).join("|");return l.useEffect(()=>{const r=(u?u.split("|"):[]).filter(d=>!fo.has(d));if(r.length===0)return;let i=!1;const s=Array.from(new Set(r.map(d=>d.slice(0,d.lastIndexOf(":")))));return t(s).then(d=>{if(!(i||d.length===0)){for(const p of d)p.Meaning&&fo.set(ho(p.Word,p.Homonum??void 0),p.Meaning);o(p=>p+1)}}),()=>{i=!0}},[u,t]),l.useMemo(()=>{const r=u?u.split("|"):[],i=new Map;for(const s of r){const d=fo.get(s);d!=null&&i.set(s,d)}return i},[u,n])}function Yd(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,u=Math.max(1,Math.ceil(e.length/o)),r=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),u):1;return{pageItems:l.useMemo(()=>e.slice((r-1)*o,r*o),[e,r,o]),totalPages:u,curPage:r}}function qd(e="warning"){const[t,n]=l.useState(""),[o,u]=l.useState(e),[r,i]=l.useState(0),s=l.useCallback((C,c)=>{u(c),n(C),i(m=>m+1)},[]),d=l.useCallback(C=>s(C,"warning"),[s]),p=l.useCallback(C=>s(C,"normal"),[s]),f=l.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:r,showToast:s,showWarning:d,showNormal:p,clearToast:f}}const nn={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},on=nn.blue,Tn=nn.green,un=nn.amber,xn=nn.purple,Wd=nn.pink,Kd=[{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:on,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:on,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:on,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:on,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:on,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:Tn,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:Tn,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:Tn,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:Tn,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:un,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:un,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:un,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:un,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:un,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:xn,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:xn,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:xn,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:xn,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:Wd,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Xd(){const{t:e}=gt.useTranslation();return l.useMemo(()=>{const t=Object.fromEntries(hd(e).map(o=>[o.key,o.label])),n={...t};return Kd.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}exports.CACHE_GROUPS=Ho,exports.DocumentTitleSuppressContext=Ro,exports.EMPTY_COMPOSITION=lo,exports.MediaQueryOverrideContext=Do,exports.NO_CODA=Qe,exports.SYLLABLE_MIN=et,exports.VAP_PAGE_SIZE_OPTIONS=Go,exports.buildGradeSection=Hu,exports.buildPartOfSpeechSection=zu,exports.buildPositionSection=Sd,exports.buildSelectSection=bd,exports.buildSyllableSection=Ed,exports.buildWordTypeSection=Vu,exports.charToPronValue=Wu,exports.convertComposition=Xu,exports.fmtBytes=Pr,exports.lsBytes=zo,exports.meaningKey=ho,exports.pronToCharValue=Ku,exports.syllableToFilter=ao,exports.today=zt,exports.toggleAttributeFilter=kd,exports.useCacheManagement=$r,exports.useDailyTrainingSelection=zd,exports.useDelayedHoverAnchor=gd,exports.useDeviceManagement=Wr,exports.useDocumentTitle=br,exports.useEscToClose=Ud,exports.useFontScale=gr,exports.useHoverAnchor=$u,exports.useMediaQuery=Er,exports.usePagedList=Yd,exports.usePasswordChange=kr,exports.useRelativeDay=Sr,exports.useTablePaging=Yr,exports.useTableSort=qr,exports.useToastState=qd,exports.useTrainingTypeLabels=Xd,exports.useVisitAllPanel=Gr,exports.useVisitHistory=zr,exports.useVisitSchedule=Ur,exports.useWindowEvent=Oo,exports.useWordAttributeFilterKeys=Fu,exports.useWordDataStats=Fr,exports.useWordMeanings=Gd,exports.useWordTrainingDataGeneration=Pd,exports.useWordTrainingFilter=Id,exports.valueToJamos=st;
|