@ihabdevteam/core 0.424.0 → 0.425.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +137 -0
- package/README.md +9 -4
- package/dist/components.cjs.js +170 -170
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core-tokens.css +1 -1
- package/dist/ihabdevteam-core.cjs.js +80 -80
- package/dist/ihabdevteam-core.css +1 -1
- package/dist/ihabdevteam-core.d.ts +56 -10
- package/dist/packages/core/src/components/HeroVisual.css +93 -10
- package/dist/packages/core/src/components/HeroVisual.d.ts +30 -7
- package/dist/packages/core/src/components/HeroVisual.js +221 -36
- package/dist/packages/core/src/components/Word/WordTableBlock.d.ts +1 -1
- package/dist/packages/core/src/components/Word/WordTableBlock.js +3 -3
- package/dist/packages/core/src/components/Word/wordTableBlockTypes.d.ts +6 -0
- package/dist/packages/core/src/components/WordTable.d.ts +18 -1
- package/dist/packages/core/src/components/WordTable.js +2 -2
- package/dist/packages/core/src/styles.css +6 -1
- package/dist/packages/core/src/tokens.css +17 -7
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +1 -1
- package/package.json +1 -1
package/dist/components.esm.css
CHANGED
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
/* !important 불필요 — WordDataUpdatePopup.tsx의 인라인 width는 pct/isDone/isError일 때만
|
|
18
18
|
설정되고 이 indeterminate 클래스가 붙는 상태(state==='active' && pct===undefined)에서는
|
|
19
|
-
인라인 width가 아예 설정되지 않아(undefined) 경합 자체가 없음(코드 확인됨). */.ihabdevteam-core-scope .wdup-bar__fill--indeterminate{animation:wdup-indeterminate 1.4s ease-in-out infinite;width:40%}@keyframes wdup-indeterminate{0%{transform:translateX(-150%)}to{transform:translateX(400%)}}@media (prefers-reduced-motion:reduce){.ihabdevteam-core-scope .wdup-bar__fill--indeterminate{animation:none!important;transform:none;width:100%}}.ihabdevteam-core-scope .wdup-phase-card__sub{color:var(--color-lightGray)}.ihabdevteam-core-scope .hero-visual{--hero-visual-1:#3b6ff0;--hero-visual-2:#499cdf;--hero-visual-3:#2cc6f5;--hero-visual-4:#5fe0d4;--hero-visual-5:#8fe2f7;--hero-visual-6:#b9f07a;--hero-visual-cycle:9000ms;display:block;overflow:visible;position:relative;width:100%}.ihabdevteam-core-scope .hero-visual__svg{display:block;height:100%;width:100%}.ihabdevteam-core-scope .hero-visual__ring{will-change:transform,opacity}.ihabdevteam-core-scope .hero-visual__in{animation-delay:calc(var(--hero-visual-cycle)*0);animation-delay:calc(var(--hero-visual-cycle)*var(--hero-visual-turn, 0));animation-duration:var(--hero-visual-cycle);animation-fill-mode:backwards;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ihabdevteam-core-scope .hero-visual__in--bloom{animation-name:hero-visual-bloom}.ihabdevteam-core-scope .hero-visual__in--draw{animation-name:hero-visual-draw}.ihabdevteam-core-scope .hero-visual__in--fade{animation-name:hero-visual-fade}.ihabdevteam-core-scope .hero-visual__in--settle{animation-name:hero-visual-settle}.ihabdevteam-core-scope .hero-visual__in--pop{animation-name:hero-visual-pop}.ihabdevteam-core-scope .hero-visual__in--fan{animation-name:hero-visual-fan}.ihabdevteam-core-scope .hero-visual__in--meet{animation-name:hero-visual-meet}.ihabdevteam-core-scope .hero-visual__in--unfold{animation-name:hero-visual-unfold}@keyframes hero-visual-bloom{0%{opacity:0;transform:scale(.2)}10%{opacity:1;transform:scale(1.04)}14%{transform:scale(1)}76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.2)}}@keyframes hero-visual-draw{0%{stroke-dashoffset:1}26%,76%{stroke-dashoffset:0}to{stroke-dashoffset:1}}@keyframes hero-visual-fade{0%{opacity:0}26%,76%{opacity:1}to{opacity:0}}@keyframes hero-visual-settle{0%{opacity:0;transform:scale(.78)}14%,76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.78)}}@keyframes hero-visual-pop{0%{opacity:0;transform:scale(0)}11%{opacity:1;transform:scale(1.08)}15%,76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}@keyframes hero-visual-fan{0%{opacity:0;transform:translateY(0) rotate(0deg) scale(.96);transform:translateY(var(--dy,0)) rotate(0deg) scale(.96)}
|
|
19
|
+
인라인 width가 아예 설정되지 않아(undefined) 경합 자체가 없음(코드 확인됨). */.ihabdevteam-core-scope .wdup-bar__fill--indeterminate{animation:wdup-indeterminate 1.4s ease-in-out infinite;width:40%}@keyframes wdup-indeterminate{0%{transform:translateX(-150%)}to{transform:translateX(400%)}}@media (prefers-reduced-motion:reduce){.ihabdevteam-core-scope .wdup-bar__fill--indeterminate{animation:none!important;transform:none;width:100%}}.ihabdevteam-core-scope .wdup-phase-card__sub{color:var(--color-lightGray)}.ihabdevteam-core-scope .hero-visual{--hero-visual-1:#3b6ff0;--hero-visual-2:#499cdf;--hero-visual-3:#2cc6f5;--hero-visual-4:#5fe0d4;--hero-visual-5:#8fe2f7;--hero-visual-6:#b9f07a;--hero-visual-cycle:9000ms;display:block;overflow:visible;position:relative;width:100%}.ihabdevteam-core-scope .hero-visual__svg{display:block;height:100%;overflow:visible;width:100%}.ihabdevteam-core-scope .hero-visual__ring{will-change:transform,opacity}.ihabdevteam-core-scope .hero-visual__in{animation-delay:calc(var(--hero-visual-cycle)*0);animation-delay:calc(var(--hero-visual-cycle)*var(--hero-visual-turn, 0));animation-duration:var(--hero-visual-cycle);animation-fill-mode:backwards;animation-iteration-count:infinite;animation-timing-function:ease-in-out}.ihabdevteam-core-scope .hero-visual--once .hero-visual__in{animation-fill-mode:both;animation-iteration-count:1}.ihabdevteam-core-scope .hero-visual__in--bloom{animation-name:hero-visual-bloom}.ihabdevteam-core-scope .hero-visual__in--draw{animation-name:hero-visual-draw}.ihabdevteam-core-scope .hero-visual__in--fade{animation-name:hero-visual-fade}.ihabdevteam-core-scope .hero-visual__in--settle{animation-name:hero-visual-settle}.ihabdevteam-core-scope .hero-visual__in--pop{animation-name:hero-visual-pop}.ihabdevteam-core-scope .hero-visual__in--fan{animation-name:hero-visual-fan}.ihabdevteam-core-scope .hero-visual__in--meet{animation-name:hero-visual-meet}.ihabdevteam-core-scope .hero-visual__in--unfold{animation-name:hero-visual-unfold}@keyframes hero-visual-bloom{0%{opacity:0;transform:scale(.2)}10%{opacity:1;transform:scale(1.04)}14%{transform:scale(1)}76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.2)}}@keyframes hero-visual-draw{0%{stroke-dashoffset:1;opacity:0}8%{opacity:1}26%,76%{stroke-dashoffset:0;opacity:1}to{stroke-dashoffset:1;opacity:0}}@keyframes hero-visual-fade{0%{opacity:0}26%,76%{opacity:1}to{opacity:0}}@keyframes hero-visual-settle{0%{opacity:0;transform:scale(.78)}14%,76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.78)}}@keyframes hero-visual-pop{0%{opacity:0;transform:scale(0)}11%{opacity:1;transform:scale(1.08)}15%,76%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}@keyframes hero-visual-fan{0%{opacity:0;transform:translateY(0) rotate(0deg) scale(.96);transform:translateY(var(--dy,0)) rotate(0deg) scale(.96)}26%,76%{opacity:1;transform:translateY(0) rotate(0deg) scale(1);transform:translateY(0) rotate(var(--a,0deg)) scale(1)}to{opacity:0;transform:translateY(0) rotate(0deg) scale(.96);transform:translateY(var(--dy,0)) rotate(0deg) scale(.96)}}@keyframes hero-visual-meet{0%{opacity:0;transform:translateX(-200px);transform:translateX(var(--from,-200px))}18%,76%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-200px);transform:translateX(var(--from,-200px))}}@keyframes hero-visual-unfold{0%{opacity:0;transform:translate(var(--gx),var(--gy)) scale(.3)}18%,76%{opacity:1;transform:translate(0) scale(1)}to{opacity:0;transform:translate(var(--gx),var(--gy)) scale(.3)}}.ihabdevteam-core-scope .hero-visual--still .hero-visual__svg,.ihabdevteam-core-scope .hero-visual--still .hero-visual__svg *{animation:none!important}.ihabdevteam-core-scope .hero-visual--still .hero-visual__in{opacity:1;transform:none}.ihabdevteam-core-scope .hero-visual--still .hero-visual__in--draw{stroke-dashoffset:0}@media (prefers-reduced-motion:reduce){.ihabdevteam-core-scope .hero-visual .hero-visual__svg,.ihabdevteam-core-scope .hero-visual .hero-visual__svg *{animation:none!important}.ihabdevteam-core-scope .hero-visual .hero-visual__in{opacity:1;transform:none}.ihabdevteam-core-scope .hero-visual .hero-visual__in--draw{stroke-dashoffset:0}}@keyframes hero-visual-floaty{0%,to{transform:translateY(0)}50%{transform:translateY(-14px)}}@keyframes hero-visual-drift{0%,to{transform:translate(0)}50%{transform:translate(10px,-18px)}}@keyframes hero-visual-breathe{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes hero-visual-pulse{0%,to{opacity:.9;transform:scale(1)}50%{opacity:1;transform:scale(1.06)}}@keyframes hero-visual-approach{0%,to{transform:translateX(0)}50%{transform:translateX(-14px)}}@keyframes hero-visual-approach-r{0%,to{transform:translateX(0)}50%{transform:translateX(14px)}}@keyframes hero-visual-blink{0%,70%,to{opacity:.25}20%,50%{opacity:1}}@keyframes hero-visual-rove-a{0%,to{transform:translate(0)}50%{transform:translate(-10px,8px)}}@keyframes hero-visual-rove-b{0%,to{transform:translate(0)}50%{transform:translate(12px,-9px)}}@keyframes hero-visual-revolve{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes hero-visual-revolve-r{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes hero-visual-sway{0%,to{transform:rotate(-6deg)}50%{transform:rotate(6deg)}}@keyframes hero-visual-blob-1{0%,to{transform:translate(0)}25%{transform:translate(10px,-16px)}50%{transform:translate(-8px,-26px)}75%{transform:translate(-14px,-10px)}}@keyframes hero-visual-blob-2{0%,to{transform:translate(0)}25%{transform:translate(-14px,14px)}50%{transform:translate(-6px,24px)}75%{transform:translate(12px,10px)}}@keyframes hero-visual-wave{0%{opacity:0;transform:scale(1)}18%{opacity:.75}to{opacity:0;transform:scale(1.35)}}@keyframes hero-visual-gather{0%,76%{transform:translate(0)}83%,88%{transform:translate(var(--gx),var(--gy))}95%,to{transform:translate(0)}}.ihabdevteam-core-scope .hero-visual__blades,.ihabdevteam-core-scope .hero-visual__discs,.ihabdevteam-core-scope .hero-visual__lens,.ihabdevteam-core-scope .hero-visual__petals{mix-blend-mode:multiply}.ihabdevteam-core-scope .debug-result-launcher{bottom:18px;display:flex;flex-direction:column;gap:var(--spacing-xs);position:fixed;right:18px;z-index:var(--z-tooltip)}.ihabdevteam-core-scope .debug-buttons{background:rgba(11,43,47,.02);border-radius:var(--radius-s);box-shadow:var(--shadow-dropdown);display:flex;flex-direction:column;gap:6px;padding:var(--spacing-xs)}.ihabdevteam-core-scope .debug-button{background:var(--color-white);border:1px solid rgba(11,43,47,.06);border-radius:var(--radius-sm);cursor:pointer;font-size:13px;min-height:24px;padding:8px 12px}.ihabdevteam-core-scope .debug-button:hover{transform:translateY(-1px)}
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
\uC2E0\uB8B0\uB97C \uC313\uACE0
|
|
3
3
|
\uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",bizNo:"\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638",bizNoValue:"526-81-02926"},Ul={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},zl={phaseWordDownload:"\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC",phaseImageCheck:"\uC774\uBBF8\uC9C0 \uD655\uC778",phasePairAnalysis:"\uB2E8\uC5B4\uC30D \uBD84\uC11D",downloadingCount:"{{n}}\uAC1C \uB2E4\uC6B4\uB85C\uB4DC \uC911",checkingPage:"{{page}}\uD398\uC774\uC9C0 \uBAA9\uB85D \uD655\uC778 \uC911",imageCount:"{{done}} / {{total}}\uAC1C"},Kl={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},ql={ariaLabel:"\uC120\uD0DD \uD0ED"},Jl={ariaLabel:"\uD0ED"},Xl={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},Ql={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},Zl={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"}},ei={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",done:"\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",detailFor:"{{name}} \uC0C1\uC138\uBCF4\uAE30"},ti={time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"}},ni={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},oi={skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",runs:"{{count}}\uD310"},ri={resetColumns:"\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654",scrollRegion:"\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C",rowActionHint:"\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4"},ui={viewWords:"\uB0B1\uB9D0"},ai={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},li={chooseDate:"\uB0A0\uC9DC \uC120\uD0DD",selectYear:"\uC5F0 \uC120\uD0DD",selectMonth:"\uC6D4 \uC120\uD0DD"},ii={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},si={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},ci={place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},di={clearSelection:"\uC120\uD0DD \uD574\uC81C"},fi={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},pi={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Ci={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},mi={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},gi={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},hi={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},yi={main:"\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8",soft:"\uC18C\uD504\uD2B8",sub:"\uC11C\uBE0C \uCEEC\uB7EC",deep:"\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8",softSub:"\uC18C\uD504\uD2B8 \uC11C\uBE0C",warm:"\uC6DC(\uAC15\uC870)",dark:"\uB2E4\uD06C",radial:"\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8",diagonal:"\uB300\uAC01\uC120 \uD328\uD134",dots:"\uB3C4\uD2B8 \uD328\uD134",outline:"\uC544\uC6C3\uB77C\uC778",success:"\uC131\uACF5/\uC644\uB8CC",naver:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4",instagram:"\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4"},bi={common:yl,calendar:bl,passCard:Sl,rating:wl,colorPicker:El,dropdown:Al,accordion:_l,header:Tl,nav:Dl,settings:Bl,usage:Nl,account:vl,training:Ol,customers:Ll,payment:Rl,coupons:Il,visits:Ml,trainingType:Pl,myWordTable:kl,keyWords:xl,wordTable:Fl,wordSearch:jl,wordPrint:Hl,topic:$l,device:Gl,manager:Wl,wordPairs:Vl,footer:Yl,date:Ul,wordData:zl,textField:Kl,segmentedControl:ql,tabs:Jl,fileUpload:Xl,avatar:Ql,myHomework:Zl,trainingStatus:ei,store:ti,progress:ni,trainingMiss:oi,table:ri,wordScore:ui,topBanner:ai,datePicker:li,report:ii,tooltip:si,phonemeProfile:ci,bulkBar:di,debug:fi,badge:pi,loader:Ci,soundCompass:mi,breadcrumb:gi,board:hi,promoBannerBg:yi},Si={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",collapseFor:"Collapse {{name}}",expandFor:"Expand {{name}}",sortFor:"Sort {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",discardConfirm:{title:"Discard your changes?",body:"If you do not save, everything you have entered will be lost.",confirm:"Discard"},close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",likeCount_one:"{{count}} like",likeCount_other:"{{count}} likes",selectedOfMax:"{{count}} of {{max}}",downloadCount_one:"{{count}} download",downloadCount_other:"{{count}} downloads",descriptionFor:"About {{name}}",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",loading:"Loading",playFor:"Play {{name}}",pauseFor:"Pause {{name}}",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",noMatches:"No matching items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},wi={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yearMonthCompact:"{{short}}",weekLabel:"Week {{ord}}",weekLabelCompact:"W{{ord}}",prevMonth:"Previous month",addOnDate:"Add a visit on {{date}}",nextMonth:"Next month",prevWeek:"Previous week",nextWeek:"Next week",legend:{visited:"Visited",scheduled:"Scheduled",noVisit:"No Show"},periodSelect:"Period unit",visitCount_one:"{{count}} visit",visitCount_other:"{{count}} visits",statusCount:"{{count}} {{label}}",weekOrdinal:["1","2","3","4","5","6","7"]},Ei={planSuffix:"Plan",labeledPlan:"{{label}} Plan",couponCode:"Pass Code",specialLabel:"Open Special",unitDay:"d",unitYear:"yr",remainingDay:"{{n}}d left",remainingHour:"{{n}}h left",remainingMinute:"{{n}}m left",remainingSecond:"{{n}}s left",expired:"Expired",menu:{use:"Activate",refund:"Refund",delete:"Delete"}},Ai={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},_i={selected:"selected"},Ti={placeholder:"Select"},Di={collapse:"Collapse",expand:"Expand"},Bi={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},Ni={mainMenu:"Main menu",bottomNav:"Bottom navigation",goToManager:"Go to Malgwi Manager",goToMalgwi:"Go to Malgwi",modeLabelManager:"Malgwi Manager",modeLabelMalgwi:"Malgwi",training:"Training",settings:"Settings",notifications:"Notifications",account:"Account",help:"Help",feedback:"Report a bug",debug:"Debug",coupons:"Coupons",topic:"By Topic",trainingType:"By Training Type",wordPairs:"Word Pairs",wordSearch:"Word Search",wordTable:"Word Table Creator",company:"Company Info",more:"More",moreMenu:"More menu",badgeLabel:"{{label}}, {{count}}",badgeInsideLabel_one:"{{label}}, {{count}} notification inside",badgeInsideLabel_other:"{{label}}, {{count}} notifications inside"},vi={cache:{cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"}}}},Oi={couponButton:"Enter Coupon"},Li={security:{password:{currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."}}},Ri={settings:"Settings",filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions_one:"{{n}} question",countQuestions_other:"{{n}} questions",countSentences_one:"{{n}} sentence",countSentences_other:"{{n}} sentences",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",selectInOrder:"Select the cards in the order you heard.",stop:"Stop",preview:"Preview",previewFor:"Preview {{name}}",stopFor:"Stop {{name}}",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",ttsUnavailable:"Speech playback isn't available on this device.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{pendingDone:"Results are still being calculated, so you can't finish yet.",eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",replaySound:"Replay item {{no}}",replaySoundStop:"Stop item {{no}}",done:"Done",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{synthesizing:"Preparing the sound\u2026",preparing:"Preparing sound\u2026"}},Ii={totalCount:" customers",loadError:"Failed to load list",device:{title:"Hearing Devices",addButton:"Add device",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",historyTitle:"Hearing device history"},schedule:{registerTitle:" Register Schedule"},visitHistory:{empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"},consent:{record:"Record consent",kinds:"Kinds given",methodTitle:"How it was given",sourceTitle:"Who gave it",day:"Date given",note:"Note",notePlaceholder:"Referring clinic and the like \u2014 do not write anything sensitive",submit:"Save",allTaken:"All three kinds are already on record. Revoke one first to record it again.",kind:{personal:"General personal data",sensitive:"Sensitive data (hearing, diagnosis)",marketing:"Marketing messages"},method:{paper:"On paper",verbal:"Spoken",electronic:"Electronic"},source:{self:"The customer",guardian:"A guardian",referral:"A referring body"}}},Mi={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},Pi={input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply"},ki={showN:"Show {{n}}"},xi={title:"Training by Type",subtitle:"Select the training type you want",listenInNoise:{title:"Sentence Listening in Noise",desc:"Train sentence comprehension in various noise environments."},shortStory:{title:"Short Story Listening",desc:"Listen to short stories and understand the content."},longStory:{title:"Long Story Listening",desc:"Focus on listening to long stories and grasp the content."},orderingSentence:{title:"Sentence Ordering",desc:"Arrange heard sentences in the correct order."},SAME_SOUND_PICK:{label:"Listen & Pick Same Sound",sub:"Pick the word card that matches what you heard."},SAME_OR_DIFF:{label:"Same or Different?",sub:"Decide whether the two sounds are the same or different."},HEAR_AND_PICK_SAME:{label:"Hear & Match Word",sub:"Pick the word card that matches the sound you heard."},HEAR_AND_PICK_INCLUDED:{label:"Find Word Containing Sound",sub:"Pick the word card that contains the syllable you heard."},STARTS_WITH_SAME_SOUND:{label:"Find Word Starting with Same Sound",sub:"Pick a word that starts with the same sound as what you heard."},LISTEN_AND_REMEMBER_ORDER:{label:"Listen & Recall Order",sub:"Select the cards in the order you heard the three words."},MERGE_2_SYLLABLES:{label:"Combine 2 Syllables",sub:"What word do two syllables make?"},MERGE_3_SYLLABLES:{label:"Combine 3 Syllables",sub:"What word do three syllables make?"},MERGE_2_PHONEMES:{label:"Combine 2 Phonemes",sub:"What sound do two phonemes make?"},MERGE_3_PHONEMES:{label:"Combine 3 Phonemes",sub:"What sound do three phonemes make?"},DROP_1_FROM_2SYLL:{label:"Drop 1 Syllable from 2-Syllable",sub:"What sound remains when you remove a syllable from a 2-syllable word?"},DROP_1_FROM_3SYLL:{label:"Drop 1 Syllable from 3-Syllable",sub:"What sound remains when you remove a syllable from a 3-syllable word?"},DROP_PART_FROM_COMPOUND:{label:"Drop Part of Compound Word",sub:"What word remains when you remove part of a compound word?"},DROP_FINAL_CONSONANT_FROM_1SYLL:{label:"Drop Final Consonant",sub:"What sound remains when you remove the final consonant?"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{label:"Drop Consonant",sub:"What sound remains when you remove the consonant?"},CHANGE_1_SYLL_IN_2SYLL:{label:"Change 1 Syllable (2-Syllable)",sub:"Change one syllable in a 2-syllable word to make a new word."},CHANGE_1_SYLL_IN_3SYLL:{label:"Change 1 Syllable (3-Syllable)",sub:"Change one syllable in a 3-syllable word to make a new word."},CHANGE_1_PHONEME_IN_1SYLL:{label:"Change 1 Phoneme (1-Syllable)",sub:"Change one phoneme in a 1-syllable word to make a new sound."},CHANGE_1_PHONEME_IN_2SYLL:{label:"Change 1 Phoneme (2-Syllable)",sub:"Change one phoneme in a 2-syllable word to make a new word."}},Fi={newBadge:"Newly created",publishedBadge:"Published",sharedBadge:"Shared"},ji={title:"Key Words",empty:"No key words available."},Hi={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",caption:"Form",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",copyItem:"Duplicate",copyItemAria:"Duplicate the word in cell {{n}}",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount_one:"{{count}} word",itemCount_other:"{{count}} words",deleteAriaLabel:"Delete {{name}}",viewLabel:"View as",sortLabel:"Sort by",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},publisherFilter:"Show only tables by {{name}}",groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",markName:{o:"Correct",triangle:"Partial",x:"Incorrect"},button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap \u25CB \xB7 \u25B3 \xB7 \u2715 under a cell to mark it. With a mouse they appear when you hover the cell; with a keyboard, when focus reaches it.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved_one:"Saved {{count}} mark for {{name}}.",saved_other:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage_one:"Builds a new table from the {{count}} cell {{name}} got wrong or partial. Correct ones are left out.",reviewMessage_other:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated_one:"Created \u201C{{name}}\u201D \u2014 {{count}} cell.",reviewCreated_other:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage_one:"You marked {{count}} cell but have not saved. Leaving discards it.",discardMessage_other:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"},info:{grade:"Grade: {{n}}",syllables:"Syllables: {{n}}",pos:"Part of speech: {{v}}",wordType:"Type: {{v}}"},pos:{noun:"Noun",verb:"Verb",adjective:"Adjective",adverb:"Adverb",numeral:"Numeral",determiner:"Determiner",interjection:"Interjection",particle:"Particle",affix:"Affix",dependentNoun:"Dependent noun",pronoun:"Pronoun",auxVerb:"Auxiliary verb",auxAdjective:"Auxiliary adjective"},reorder:{moved:"Moved to position {{n}} of {{total}}",handle:"Reorder {{word}} (Alt + arrow keys)",hint:"Alt + \u2190 \u2192 to reorder"},thumbMore:"+{{count}}",replaceItem:"Other words",replacePair:"Other pairs",replaceItemAria:"Swap cell {{n}} only",replacePairAria:"Swap pair {{n}} only",thumbMoreAria_one:"1 more cell: {{words}}",thumbMoreAria_other:"{{count}} more cells: {{words}}",pickForm:"Other forms",pickFormAria:"Change the form in cell {{n}}",pickFormBaseAria:"Change the form of the base word"},$i={filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Difficulty",grade:"Grade {{n}}",age:"Age {{n}}",difficultyInfoAge:"Age 3\u20137: the easiest words (grade 1), split by age.",difficultyInfoGrade:"Grades 2\u20134: harder words, not split by age.",difficultyInfoNone:"None: words with no difficulty assigned.",gradeNone:"None",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",field:"Semantic Category",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193",original:"Original order"},pageSize:"Show {{count}}",pageSizeAria:"Page size"},Gi={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removePairFor:"Remove the pair {{name}}",removeWord:"Remove word",removeWordFor:"Remove {{name}}"},Wi={title:"By Topic",subtitle:"Select a topic to start listening training",noiseTitle:"Sentence Listening in Noise",shortStoryTitle:"Short Story Listening",FOOD:"Food",HLTH:"Health",WETH:"Weather",PRSN:"People",KRCT:"Korean Culture",STRY:"Stories",LOCA:"Locations",SOAR:"Society & Arts",NTSC:"Nature & Science",SPRT:"Sports",sub:{TRKRFD:"Traditional Korean Food",MDKRFD:"Modern Korean Food",WRLDFD:"World Cuisine",MTRFRT:"Ingredients & Fruits",GEFDKL:"Food Facts",HTETHB:"Healthy Eating",DISILL:"Diseases",EXCISE:"Exercise",GEHTKL:"Health Facts",GESSKL:"Seasons",SNWRAN:"Snow & Rain",WTHFCT:"Weather Forecast",GEWTKL:"Weather Facts",JODYPS:"Joseon Dynasty",MDKRPS:"Modern Korea",THKDPS:"Three Kingdoms",WRLART:"World Artists",WRLPSN:"World Figures",KRLANG:"Korean Language",TRPLCT:"Traditional Games",HERITG:"Heritage",EVTFES:"Events & Festivals",GECTKL:"General Knowledge",FRYTAL:"Fairy Tales",AMZING:"Amazing Stories",DAYSTR:"Everyday Stories",KRLDMK:"Korean Landmarks",SELNMK:"Seoul Landmarks",WRDTRB:"World Travel",NAVIGT:"Navigation",KRSOCI:"Korea",ECONEW:"Economy & News",GENART:"Arts",GELFKL:"Life Tips",ANIMAL:"Animals",PLANTS:"Plants",ETHPLT:"Earth",TOLELC:"Tools & Electronics",GESCKL:"Science Facts",INVDSP:"Individual Sports",MARART:"Martial Arts",TEAMSP:"Team Sports",FOOTBL:"Soccer",GESPKL:"Sports Facts"}},Vi={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant",other:"Other"}},Yi={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"}},Ui={phonemeSelect:{vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",countLabel:"Number of phonemes",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:["Level 1 \u2014 everyday vocabulary acquired before school age and used for life","Level 2 \u2014 difficulty of grades 1\u20132","Level 3 \u2014 difficulty of grades 3\u20134","Level 4 \u2014 difficulty of grades 5\u20136","No level \u2014 frequent everyday words outside the national standard list, plus coinages and loanwords"],selectLabel:"Select",onlyHasImage:"Only words with images",onlyHighUsage:"High-use words only",onlySameStructure:"Only same phoneme structure"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},zi={lead:`IHAB builds trust
|
|
4
4
|
through sound
|
|
5
|
-
and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},Ki={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},qi={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},Ji={clearAriaLabel:"Clear input"},Xi={ariaLabel:"Select tab"},Qi={ariaLabel:"Tabs"},Zi={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},es={ariaLabel:"User avatar"},ts={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},ns={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},os={time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"}},rs={steps:"Step {{current}} of {{total}}"},us={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},as={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},ls={viewWords:"Words"},is={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},ss={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},cs={previewRegion:"Report preview \u2014 scrollable sideways"},ds={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},fs={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},ps={clearSelection:"Clear selection"},Cs={showResult:"Show {{type}} result"},ms={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},gs={loading:"Loading"},hs={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},ys={ariaLabel:"Breadcrumb"},bs={empty:"No items yet."},Ss={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},ws={common:Si,calendar:wi,passCard:Ei,rating:Ai,colorPicker:_i,dropdown:Ti,accordion:Di,header:Bi,nav:Ni,settings:vi,usage:Oi,account:Li,training:Ri,customers:Ii,payment:Mi,coupons:Pi,visits:ki,trainingType:xi,myWordTable:Fi,keyWords:ji,wordTable:Hi,wordSearch:$i,wordPrint:Gi,topic:Wi,device:Vi,manager:Yi,wordPairs:Ui,footer:zi,date:Ki,wordData:qi,textField:Ji,segmentedControl:Xi,tabs:Qi,fileUpload:Zi,avatar:es,myHomework:ts,trainingStatus:ns,store:os,progress:rs,trainingMiss:us,table:as,wordScore:ls,topBanner:is,datePicker:ss,report:cs,tooltip:ds,phonemeProfile:fs,bulkBar:ps,debug:Cs,badge:ms,loader:gs,soundCompass:hs,breadcrumb:ys,board:bs,promoBannerBg:Ss};const Es="0.424.0",As=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],eo="ko",_s="ihab_display_language";function kr(){if(typeof window>"u")return eo;try{const e=localStorage.getItem(_s);if(e&&As.some(t=>t.code===e))return e}catch{}return eo}function xr(e){try{document.documentElement.lang=e}catch{}}Be.on("languageChanged",xr),xr(kr()),Be.use(Re.initReactI18next).init({resources:{ko:{translation:bi},en:{translation:ws}},lng:kr(),fallbackLng:eo,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Fr=new Set(["field"]),jr="none";function Ts(e){return e==null||String(e).trim()===""}function Ds(e){return typeof e=="string"&&Hr.includes(e)}function to(e,t,n){if(!e)return!0;const o=e instanceof Set?e:new Set(e);if(o.size===0)return!0;if(Ts(t))return o.has(jr);const r=String(t);return o.has(r)?!0:r!=="1"||n==null?!1:o.has(`age${n}`)}const Lt=["grade","syllables","pos","wordType","field"],Hr=["1","2","3","4","none","age3","age4","age5","age6","age7"],Bs=["1","2","3","4","5+"],Ns=["noun","verb","modifier"],vs=["native","sino","foreign","mixed"],Os={grade:Hr,syllables:Bs,pos:Ns,wordType:vs,field:[]},Ls={noun:["\uBA85","\uC218"],verb:["\uB3D9","\uD615"],modifier:["\uBD80","\uAD00"]},Rs={native:"\uACE0\uC720",sino:"\uD55C\uC790",foreign:"\uC678\uB798",mixed:"\uD63C\uC885"},Is={grade:["\uB09C\uC774\uB3C4 \uB4F1\uAE09","\uB4F1\uAE09","Grade","Difficulty"]},Ms={pos:{noun:["\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)"],verb:["\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)"],modifier:["\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)"]}},no=new Map;try{Be.store?.on?.("added",()=>no.clear())}catch{}function Rt(e){const t=no.get(e);if(t)return t;const n=Be.getFixedT(e),o={section:{grade:n("wordSearch.filter.difficulty","\uB09C\uC774\uB3C4"),syllables:n("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),pos:n("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:n("wordSearch.filter.wordType","\uC720\uD615"),field:n("wordSearch.filter.field","\uC758\uBBF8\uBC94\uC8FC")},value:{grade:{...Object.fromEntries(["1","2","3","4"].map(r=>[r,n("wordSearch.filter.grade",{n:Number(r),defaultValue:`${r}\uB4F1\uAE09`})])),...Object.fromEntries([3,4,5,6,7].map(r=>[`age${r}`,n("wordSearch.filter.age",{n:r,defaultValue:`${r}\uC138`})])),[jr]:n("wordSearch.filter.gradeNone","\uC5C6\uC74C")},syllables:{...Object.fromEntries(["1","2","3","4"].map(r=>[r,n("wordSearch.filter.syllable",{n:Number(r),defaultValue:`${r}\uC74C\uC808`})])),"5+":n("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1")},pos:{noun:n("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)"),verb:n("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)"),modifier:n("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")},wordType:{native:n("wordSearch.filter.type.native","\uACE0\uC720\uC5B4"),sino:n("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4"),foreign:n("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4"),mixed:n("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")},field:{}}};return no.set(e,o),o}const oo=()=>Array.from(new Set([Be.language,"ko","en"].filter(e=>!!e)));function It(e){if(Lt.includes(e))return e;for(const t of oo()){const n=Rt(t);for(const o of Lt)if(n.section[o]===e)return o}for(const t of Lt)if(Is[t]?.includes(e))return t;return null}function tt(e,t){if(Fr.has(e)||Os[e].includes(t))return t;for(const n of oo()){const o=Rt(n).value[e];for(const[r,u]of Object.entries(o))if(u===t)return r}for(const[n,o]of Object.entries(Ms[e]??{}))if(o.includes(t))return n;if(e==="grade"&&/(세|살|years?\s*old|yrs?)\s*$/i.test(t.trim()))return null;if(e==="grade"||e==="syllables"){const n=parseInt(t.replace(/\D/g,""),10);if(Number.isFinite(n)&&n>=1)return e==="grade"?n<=4?String(n):null:n>=5?"5+":String(n)}return null}function Ps(e,t,n=Be.language){return Rt(n).value[e][t]??t}const ks=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"&&e?[e]:[];function ro(e){const t={};for(const[n,o]of Object.entries(e??{})){const r=It(n);if(r)for(const u of ks(o)){const a=tt(r,u);if(!a)continue;const i=t[r]??(t[r]=[]);i.includes(a)||i.push(a)}}return t}function uo(e,t=Be.language){const n=Rt(t||"ko"),o={};for(const r of Lt){const u=(e?.[r]??[]).map(a=>n.value[r][a]??(Fr.has(r)?a:void 0)).filter(a=>!!a);u.length&&(o[n.section[r]]=u)}return o}function xs(e,t=Be.language){const n={};for(const[o,r]of Object.entries(e??{}))It(o)||(n[o]=r);return{...n,...uo(ro(e),t)}}function Fs(e){for(const t of oo()){const n=Rt(t);if(Lt.some(o=>n.section[o]===e))return t}return Be.language||"ko"}let hn=null,$r=null,Gr=null;function js(){const e=Cn();if(e&&e.entries.length>0){const t=_t();if(hn&&$r===e&&Gr===t)return hn;const n=new Set,o=[];for(const r of e.entries)!r.word||n.has(r.word)||(n.add(r.word),o.push({w:r.word,s:r.syllables,p:t?.[r.word]?[...t[r.word].cho??[],...t[r.word].jung??[],...t[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return hn=o,$r=e,Gr=t,hn}return[]}const Fe=new Proxy([],{get(e,t){const n=js(),o=n[t];return typeof o=="function"?o.bind(n):o}});function ao(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Ne(e,t){if(t>=e.length)return J(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const r=o+Math.floor(Math.random()*(n.length-o)),u=n[o];n[o]=n[r],n[r]=u}return n.slice(0,t)}let lo=null,Wr=null;function Ue(){const e=Cn();if(lo&&Wr===e)return lo;const t=new Map;for(const n of Fe)n.w&&t.set(n.w,n.pron);return lo=t,Wr=e,t}function de(e){return Ue().get(e)||e}function yn(e,t,n=new Set){const o=[];for(const r of J(e)){if(o.length>=t)break;const u=de(r);n.has(u)||(n.add(u),o.push(r))}return o}let Hs=0;function me(e){return`${e}-rt-${++Hs}`}function ft(e){const t=Dr();if(!t||t.total===0){const r=new Set;for(const u of e)r.add(u);return r}const n=fn(),o=new Set;for(const r of e)n.has(r)&&o.add(r);return o}const bn=new Map;let Vr=null,Yr=null,Ur=null;function Mt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function io(e){const t=Array.isArray(e.choseong)&&e.choseong.length===0?"[]":Mt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),r=n?`${Mt(n.cho)}/${Mt(n.jung)}/${Mt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",u=Mt(e.grade);return`${e.difficulty??""}|${t}|${r}|${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${u}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}const so=new Map;function $s(e){return io({...e,count:void 0,choicesPerItem:void 0,fullCount:!1})}async function Ae(e){const t=Cn(),n=_t(),o=e.excludeNoImage?fn():null;(t!==Vr||n!==Yr||e.excludeNoImage&&o!==Ur)&&(bn.clear(),so.clear(),Vr=t,Yr=n,Ur=o);const r=io(e);return bn.has(r)||bn.set(r,Gs(e)),bn.get(r)}function zr(e){if(!e)return null;const t=a=>a==null?null:Array.isArray(a)?a.length?a:null:[a],n=t(e.cho),o=t(e.jung),r=!!e.jongNone,u=r?null:t(e.jong);return n||o||u||r?r&&!n&&!o&&!u?a=>Oa(a):a=>Ra(a,{cho:n,jung:o,jong:u,jongNone:r}):null}function Kr(e){const t=e.grade&&e.grade.length>0?new Set(e.grade):null,n=e.composition??null,o=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,r=n?[zr(n),o?a=>o.has(Et(a)):null].filter(a=>a!=null):[];if(!t&&r.length===0)return null;const u=e.phonemeView==="pron";return a=>{if(!to(t,a.grade,a.age))return!1;if(r.length===0)return!0;const i=u?de(a.w):a.w;return r.every(s=>s(i))}}async function Gs(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:r=null,excludeNoImage:u=!1}=e,a=e.grade&&e.grade.length>0?new Set(e.grade):null,i=e.sameStructureOnly??!0,s=e.phonemeView==="pron"?"pron":"char",c=Math.max(1,e.contrastCount??1),g=t==="cho"||t==="jung"||t==="jong",f=g&&c>=2,C=t==="count",p=n?new Set(Array.isArray(n)?n:[n]):null,h=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[zr(o),h?R=>h.has(Et(R)):null].filter(R=>R!=null):[],y=t==="random"||t===null,b=y||C,S=y||f||C;let E=Fe.filter(R=>!R.w||!to(a,R.grade,R.age)?!1:S?!0:Array.isArray(R.p)&&R.p.length>0);p&&(E=E.filter(R=>{for(const j of p)if(Na(R.w,j))return!0;return!1})),w.length>0&&(E=E.filter(R=>{const j=s==="pron"?de(R.w):R.w;return w.every(M=>M(j))})),r&&(E=E.filter(R=>R.w[0]===r));let A;if(u){const R=new Set;for(const j of E)if(R.add(j.w),Array.isArray(j.p))for(const M of j.p)R.add(M);if(b)for(const j of Fe)j.w&&R.add(j.w);A=ft(R)}else{const R=new Set;for(const j of E)if(R.add(j.w),Array.isArray(j.p))for(const M of j.p)R.add(M);if(b)for(const j of Fe)j.w&&R.add(j.w);A=R}let N=null;if(f){const R=new Set;for(const j of Fe)j.w&&R.add(j.w);N=u?ft(R):R}const I=E.filter(R=>A.has(R.w)),B=600,L=Array.from(A),P=L.length>B?Ne(L,B):L,v=C&&o!=null&&(ce(o.cho)||ce(o.jung)||ce(o.jong)),W=2500,X=new Map;if(C&&!v&&c>=2){for(const R of L){const j=Et(R),M=X.get(j);M?M.push(R):X.set(j,[R])}for(const[R,j]of X)j.length>W&&X.set(R,Ne(j,W))}const $=Da();let F=null;if(v){const R=$s(e),j=u?fn():null,M=so.get(R);F=M&&M.imageOkSet===j?M.map:al(o,L,$,i,s,de),so.set(R,{imageOkSet:j,map:F})}const x=500,Y=1500,pe=e.fullCount?I:t==="random"?I.length>x?Ne(I,x):I:I.length>Y?Ne(I,Y):I,se=_t(),he=[];for(const R of pe){let j;const M=de(R.w);if(f)j=Ma(R.w,t,c,N,24).filter(K=>de(K)!==M);else if(C)v?j=(F.get(R.w)??[]).filter(K=>de(K)!==M):c<=1?j=Mr(R.w,se,{okSet:A,pronOf:de,decompOf:$,sameStructureOnly:!1}):j=(X.get(Et(R.w))??[]).filter(K=>{if(K===R.w||de(K)===M)return!1;const G=Pa(M,de(K));return c>=5?G>=5:G===c});else if(y){const K=G=>G!==R.w&&G.length===R.w.length&&de(G)!==M;if(e.fullCount){const G=Math.max(1,(e.choicesPerItem??3)-1),ke=[],Ke=new Set;for(const Ge of P){if(!K(Ge))continue;const Z=de(Ge);if(!Ke.has(Z)&&(Ke.add(Z),ke.push(Ge),ke.length>=G))break}j=ke}else j=P.filter(K)}else{const K=t;j=Mr(R.w,se,{kind:K,okSet:A,pronOf:de,decompOf:$,sameStructureOnly:!1}),j.length===0&&(j=(P.length>30?Ne(P,30):P).filter(G=>G!==R.w&&Ba(R.w,G)===t&&de(G)!==M))}if(i&&j.length>0&&(g||C&&!v)){const K=$(de(R.w));j=j.filter(G=>!Qn(K,$(de(G))))}j.length!==0&&he.push({word:R,usable:j})}return he}async function qr(e,t){const{choicesPerItem:n=3,count:o=10}=t,r=n-1,u=(await Ae(t)).filter(i=>i.usable.length>=r),a=[];for(const i of J(u)){if(a.length>=o)break;const s=yn(i.usable,r);if(s.length<r)continue;const c=J([i.word.w,...s]);a.push({id:me(e+"-item"),index:a.length+1,word:i.word.w,syllables:i.word.s,choices:c,answerIndex:c.indexOf(i.word.w)})}return a}async function Ws(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Ae({...e,difficulty:null});if(r.length<t)return[];const u=e.composition??null,a=[],i=J([...r]);for(const s of i){if(a.length>=n)break;const c=s.word.w,g=[...s.word.pron||c],f=u&&gn(u)?g.filter(y=>{const b=Q(y);return!!b&&et(b,u)}):[],C=ao(f.length?f:g);if(!C)continue;const p=r.filter(y=>y.word.w!==c&&y.word.s===s.word.s&&!(y.word.pron||y.word.w).includes(C)&&y.word.pron!==s.word.pron);if(p.length<o)continue;const h=yn(p.map(y=>y.word.w),o);if(h.length<o)continue;const w=J([c,...h]);a.push({id:me("HPI-item"),index:a.length+1,targetSyllable:C,word:c,choices:w,answerIndex:w.indexOf(c)})}return a}async function Vs(e){const{count:t=10}=e,n=(await Ae(e)).filter(u=>u.usable.length>=1);if(!n.length)return[];const o=n.length>=t?Ne(n,t):J(Array.from({length:t},(u,a)=>n[a%n.length])),r=J(Array.from({length:t},(u,a)=>a<Math.ceil(t/2)));return o.map((u,a)=>{const i=r[a];let s;if(i)s=[u.word.w,u.word.w];else{const c=ao(u.usable);s=Math.random()<.5?[u.word.w,c]:[c,u.word.w]}return{id:me("SOD-item"),index:a+1,word:u.word.w,pair:s,same:i}})}async function Ys(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Ae({...e,difficulty:null});if(r.length<t+1)return[];const u=r.map(C=>C.word.w),a=new Map(r.map(C=>[C.word.w,C.word.pron])),i=C=>(a.get(C)||C)[0]??"",s={};for(const C of r){const p=i(C.word.w);p&&(s[p]||(s[p]=[]),s[p].push(C.word.w))}const c=Object.entries(s).filter(([,C])=>new Set(C.map(p=>a.get(p)||p)).size>=2).map(([C])=>C);if(c.length===0)return[];const g=[],f=J([...c]);for(let C=0;g.length<n&&C<n*4;C++){const p=f[C%f.length],h=s[p];if(h.length<2)continue;const w=J([...h]),y=w[0],b=a.get(y)||y,S=w.find(B=>B!==y&&(a.get(B)||B)!==b);if(!y||!S)continue;const E=a.get(S)||S,A=u.filter(B=>i(B)!==p&&B!==y&&B!==S&&B.length===S.length&&(a.get(B)||B)!==E);if(A.length<o)continue;const N=yn(A,o);if(N.length<o)continue;const I=J([S,...N]);g.push({id:me("SWS-item"),index:g.length+1,sourceWord:y,targetSyllable:p,word:S,choices:I,answerIndex:I.indexOf(S)})}return g}function Jr(e,t,n){const o=Ue(),r=s=>o.get(s)||s,u=(s,c)=>{const g=[...s],f=[...c];if(g.length!==f.length)return-1;let C=-1;for(let p=0;p<g.length;p++)if(g[p]!==f[p]){if(C>=0)return-1;C=p}return C},a=e.map(s=>({e:s,swaps:s.usable.filter(c=>!!c&&u(s.word.w,c)>=0&&r(c)!==r(s.word.w))})).filter(s=>s.swaps.length>0),i=[];for(const{e:s,swaps:c}of J(a)){if(i.length>=t)break;const g=ao(c)??"",f=[...s.word.w],C=[...g],p=u(s.word.w,g),h=yn(s.usable.filter(w=>w&&w!==g),2,new Set([r(g),r(s.word.w)]));h.length<2||i.push({id:me(n),index:i.length+1,word:s.word.w,original:s.word.w,changed:g,changedFrom:p>=0?f[p]:"",changedTo:p>=0?C[p]:"",distractors:h})}return i}async function Xr(e,t,n){const{count:o=10}=t,r=Ue(),u=Fe.filter(h=>h.w&&h.s===e),a=t.excludeNoImage?ft(u.map(h=>h.w)):null,i=a?u.filter(h=>a.has(h.w)):u,s=new Set(i.map(h=>h.w)),c=gl(s),g=t.phonemeView??"char",f=t.composition??null,C=Kr(t),p=[];for(const h of J(i)){if(p.length>=o)break;if(C&&!C(h))continue;const w=hl(h.w,f,r,g,c,null,null);if(!w)continue;const y=w.distractors[0],b=[...h.w],S=[...y],E=b.findIndex((A,N)=>A!==S[N]);p.push({id:me(n),index:p.length+1,word:h.w,original:h.w,changed:y,changedFrom:E>=0?b[E]:"",changedTo:E>=0?S[E]:"",distractors:w.distractors.slice(1)})}return p}async function Us(e){return Xr(2,e,"CS2-item")}async function zs(e){return Xr(3,e,"CS3-item")}async function Ks(e){const t=(await Ae({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return Jr(t,e.count??10,"CP1-item")}async function qs(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Ae({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return Jr(n,e.count??10,"CP2-item")}async function Js(e){const{count:t=10}=e,n=(await Ae({...e})).filter(o=>o.word.s===2);return Ne(n,t).map((o,r)=>({id:me("M2S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Xs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(o=>o.word.s===3);return Ne(n,t).map((o,r)=>({id:me("M3S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}function co(e){const t=Fe.map(n=>n.w);return e.excludeNoImage?ft(t):new Set(t)}async function Qs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s===2),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=dl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=[...i.word.w],C=f[0]===c?f[1]:f[0];a.push({id:me("D2-item"),index:a.length+1,original:i.word.w,word:i.word.w,dropped:C,missingResult:c,distractors:g})}return a}async function Zs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s===3),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=fl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=[...i.word.w];let C="";for(let p=0;p<f.length;p++)if(f.filter((h,w)=>w!==p).join("")===c){C=f[p];break}a.push({id:me("D3-item"),index:a.length+1,original:i.word.w,word:i.word.w,dropped:C,missingResult:c,distractors:g})}return a}async function ec(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s>=3),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=pl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=i.word.w,C=s.dropped??(f.startsWith(c)?f.slice(c.length):f.endsWith(c)?f.slice(0,f.length-c.length):"");a.push({id:me("DPC-item"),index:a.length+1,original:f,word:f,dropped:C,missingResult:c,distractors:g})}return a}async function tc(e){const{count:t=10}=e,n=(await Ae({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,r)=>{const u=Ne(n,3);return{id:me("LRO-item"),index:r+1,sequence:u,choices:J(u)}})}function Sn(e,t,n){const o=Fe.filter(i=>i.w&&i.s===e),r=t.excludeNoImage?ft(o.map(i=>i.w)):null,u=Kr(t),a=[];for(const i of o)if(!(r&&!r.has(i.w))&&!(u&&!u(i))){if(n){const s=Q(i.w);if(!s||!n(s))continue}a.push(i)}return a}function nc(e){const t=Sn(1,e,mn.MERGE_2_PHONEMES.syllable);return Ne(t,e.count??10).map((n,o)=>{const r=Q(n.w);return{id:me("M2P-item"),index:o+1,parts:[Ce[r.cho],Ee[r.jung]],answer:n.w,word:n.w}})}function oc(e){const t=Sn(1,e,mn.MERGE_3_PHONEMES.syllable);return Ne(t,e.count??10).map((n,o)=>{const r=Q(n.w);return{id:me("M3P-item"),index:o+1,parts:[Ce[r.cho],Ee[r.jung],De[r.jong]],answer:n.w,word:n.w}})}function rc(e){const t=mn.DROP_FINAL_CONSONANT_FROM_1SYLL,n=Sn(t.syllables,e,t.syllable),o=Ue(),r=[];for(const u of J(n)){if(r.length>=(e.count??10))break;const a=Cl(u.w,null,o);if(!a)continue;const[i,...s]=a.distractors;r.push({id:me("DFC-item"),index:r.length+1,original:u.w,word:u.w,result:i,distractors:s})}return r}function uc(e){const t=mn.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=Sn(t.syllables,e,t.syllable),o=Ue(),r=[];for(const u of J(n)){if(r.length>=(e.count??10))break;const a=ml(u.w,null,o);if(!a)continue;const i=Q(o.get(u.w)||u.w);if(!i)continue;const[s,...c]=a.distractors;r.push({id:me("RCP-item"),index:r.length+1,base:u.w,word:u.w,missingConsonant:Ce[i.cho],remaining:s,distractors:c})}return r}const wn=new Map;let Qr=null,Zr=null,eu=null,fo=0;async function tu(e,t={}){const n=Cn(),o=_t(),r=t.excludeNoImage?fn():null;(n!==Qr||o!==Zr||t.excludeNoImage&&r!==eu)&&(wn.clear(),fo++,Qr=n,Zr=o,eu=r);const u=`${e}:${io(t)}`;if(wn.has(u))return wn.get(u);const a=fo,i=await lc(e,t);return a===fo&&wn.set(u,i),i}const ac={SAME_SOUND_PICK:e=>qr("SSP",e),HEAR_AND_PICK_SAME:e=>qr("HPS",e),HEAR_AND_PICK_INCLUDED:e=>Ws(e),SAME_OR_DIFF:e=>Vs(e),STARTS_WITH_SAME_SOUND:e=>Ys(e),LISTEN_AND_REMEMBER_ORDER:e=>tc(e),MERGE_2_SYLLABLES:e=>Js(e),MERGE_3_SYLLABLES:e=>Xs(e),MERGE_2_PHONEMES:e=>nc(e),MERGE_3_PHONEMES:e=>oc(e),DROP_1_FROM_2SYLL:e=>Qs(e),DROP_1_FROM_3SYLL:e=>Zs(e),DROP_PART_FROM_COMPOUND:e=>ec(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>rc(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>uc(e),CHANGE_1_SYLL_IN_2SYLL:e=>Us(e),CHANGE_1_SYLL_IN_3SYLL:e=>zs(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Ks(e),CHANGE_1_PHONEME_IN_2SYLL:e=>qs(e)};async function lc(e,t={}){const n=ac[e];return n?await n(t):[]}async function ic(e){const t=["random","count"],n=Object.keys(qn);let o=0;for(const r of t)for(const u of n){const a=qn[u];tu(u,{difficulty:a.difficulty?r:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++o%6===0&&await new Promise(i=>setTimeout(i,0))}}async function sc(e){const t=await Ae({...e,fullCount:!0}),n=e.choicesPerItem!=null?Math.max(1,e.choicesPerItem-1):1;return t.filter(o=>new Set(o.usable.map(r=>de(r))).size>=n).length}async function cc(e={}){const t=[];for(const i of Fe)i.w&&t.push(i.w);const n=e.excludeNoImage?ft(t):t,o=new Set,r=new Set,u=new Set,a=new Set;for(const i of n){a.add(Et(i));for(const s of i){const c=Q(s);if(c&&(Ce[c.cho]!=="\u3147"&&o.add(Ce[c.cho]),r.add(Ee[c.jung]),c.jong>0)){u.add(De[c.jong]);const g=dn[c.jong];g&&g.forEach(f=>u.add(f))}}}return{cho:o,jung:r,jong:u,syllable:a}}const dc={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},fc={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},pc={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function nu(e,t){if("place"in t)return dc[t.place](e);const n=fc[t.vowel](e);return t.glide?`${n} \xB7 ${pc[t.glide](e)}`:n}const Cc=(e,{defaultValue:t})=>t,ou=(e,t)=>({jamos:e,phonetic:t,tooltip:nu(Cc,t)}),je=(e,t)=>t.map(n=>ou([n],{place:e})),fe=(e,t,n)=>ou([...e],n?{vowel:t,glide:n}:{vowel:t}),po={cho:[je("labial",["\u3142","\u3143","\u314D","\u3141"]),je("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),je("alveolar",["\u3145","\u3146"]),je("palatal",["\u3148","\u3149","\u314A"]),je("velar",["\u3131","\u3132","\u314B"]),je("glottal",["\u314E"])],jung:[[fe("\u3163","frontHigh"),fe("\u315F","frontHigh","w"),fe("\u3162","frontHigh","velar")],[fe("\u3161","backHighUnrounded")],[fe("\u315C","backHighRounded"),fe("\u3160","backHighRounded","j")],[fe("\u3154\u3150","frontMid"),fe("\u3156\u3152","frontMid","j"),fe("\u3159\u315A\u315E","frontMid","w")],[fe("\u3153","backMidUnrounded"),fe("\u3155","backMidUnrounded","j"),fe("\u315D","backMidUnrounded","w")],[fe("\u3157","backMidRounded"),fe("\u315B","backMidRounded","j")],[fe("\u314F","low"),fe("\u3151","low","j"),fe("\u3158","low","w")]],jong:[je("labial",["\u3142","\u3141"]),je("alveolar",["\u3137","\u3134","\u3139"]),je("velar",["\u3131","\u3147"])]},mc=[...Ce],gc=[...Ee],hc=De.filter(e=>e!==""),He=e=>e===Me?[]:Array.from(e),Me="__NO_CODA__",ru=[1,2,3,4],Pe=5,yc=12,uu="SYL_",Co=e=>`${uu}${e}`,bc=e=>Number(e.slice(uu.length));function mo(e){return e>=Pe?Array.from({length:yc-Pe+1},(t,n)=>Pe+n):[e]}const au={cho:mc,jung:gc,jong:hc},go=e=>e.map(t=>t.map(({jamos:n,phonetic:o,tooltip:r})=>({v:n.join(""),phonetic:o,tooltip:r}))),ho={cho:go(po.cho),jung:go(po.jung),jong:go(po.jong)},lu={};ho.jung.flat().forEach(({v:e})=>{for(const t of He(e))lu[t]=e});const Sc=new Set(ho.cho.flat().map(e=>e.v));function iu(e,t){return e==="cho"?Sc.has(t)?t:null:e==="jung"?lu[t]??t:wt(t)}function su(e,t,n){if(e==="jung"){const o=He(t);return n&&o.includes(n)?n:o[0]??t}return e==="jong"&&n&&wt(n)===t?n:t}function cu(e,t,n,o){const r=(u,a)=>a?u==="jong"&&a===Me?Me:t==="pron"?iu(u,a):su(u,a,u==="jung"?n:u==="jong"?o:null):null;return{...e,cho:r("cho",e.cho),jung:r("jung",e.jung),jong:r("jong",e.jong)}}const yo={cho:null,jung:null,jong:null,syllable:null};function wc(e){const{caps:t,difficulty:n,contrastCount:o,composition:r,phonemeView:u,excludeNoImage:a,sameStructureOnly:i,gradeFilter:s}=e,{i18n:c}=Re.useTranslation(),[g,f]=d.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[C,p]=d.useState(!1),[h,w]=d.useState(null),[y,b]=d.useState(0);Un("wordpool:update",()=>b(E=>E+1)),Un(wr,()=>b(E=>E+1));const S=d.useRef(c.language);return d.useEffect(()=>{S.current!==c.language&&(S.current=c.language,b(E=>E+1))},[c.language]),d.useEffect(()=>{if(!t.choseong)return;let E=!1;return cc({difficulty:n,excludeNoImage:a}).then(A=>{E||(f(A),p(A.cho.size+A.jung.size+A.jong.size>0))}).catch(()=>{E||(f({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),p(!1))}),()=>{E=!0}},[t.choseong,n,a,y]),d.useEffect(()=>{let E=!1;const A=r,N=A.cho?He(A.cho):null,I=A.jung?He(A.jung):null,B=A.jong===Me,L=B?null:A.jong?He(A.jong):null,P=A.syllable!=null?mo(A.syllable):null,v=!!(N||I||L||B||P);return sc({difficulty:t.difficulty?n:null,contrastCount:t.difficulty?o:1,composition:t.choseong&&v?{cho:N,jung:I,jong:L,jongNone:B,syllable:P}:null,excludeNoImage:a,sameStructureOnly:i,phonemeView:u==="pron"?"pron":"char",grade:s.length>0?s:null}).then(W=>{E||w(W)}).catch(()=>{E||w(null)}),()=>{E=!0}},[t.choseong,t.difficulty,n,o,r,u,a,i,y,s]),{viable:g,viableReady:C,wordCount:h,poolVersion:y}}function du(){const{t:e}=Re.useTranslation();return d.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB09C\uC774\uB3C4"),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 fu(e,t,n){return{label:t.difficulty,items:[...[3,4,5,6,7].map(o=>e("wordSearch.filter.age",{n:o,defaultValue:`${o}\uC138`})),...[2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),e("wordSearch.filter.gradeNone","\uC5C6\uC74C")],multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction,labelInfo:n?.labelInfo??{title:t.difficulty,items:[e("wordSearch.filter.difficultyInfoAge","3\uC138~7\uC138: \uAC00\uC7A5 \uC26C\uC6B4 \uB0B1\uB9D0(1\uB4F1\uAE09)\uC744 \uB610\uB798\uBCC4\uB85C \uB098\uB208 \uAC83\uC785\uB2C8\uB2E4."),e("wordSearch.filter.difficultyInfoGrade","2~4\uB4F1\uAE09: \uADF8\uBCF4\uB2E4 \uC5B4\uB824\uC6B4 \uB0B1\uB9D0\uC774\uACE0, \uB098\uC774\uB85C\uB294 \uB098\uB204\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."),e("wordSearch.filter.difficultyInfoNone","\uC5C6\uC74C: \uB09C\uC774\uB3C4\uAC00 \uB9E4\uACA8\uC9C0\uC9C0 \uC54A\uC740 \uB0B1\uB9D0\uC785\uB2C8\uB2E4.")]}}}function pu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Cu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function Ec(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 Ac(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"),e("wordPairs.filter.onlyHighUsage","\uD65C\uC6A9\uB3C4 \uB192\uC740 \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,labelInfo:t?.labelInfo}}function _c(e,t){const{label:n,headValue:o,midValue:r,tailValue:u,includeMid:a=!0,headDisabled:i,midDisabled:s,tailDisabled:c,allOptionDisabled:g,groupLabel:f,labelAction:C}=t;return{label:n,...f?{groupLabel:f}:{},...C?{labelAction:C}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...g?{allOptionDisabled:g}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:i},...a?[{value:r,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:s}]:[],{value:u,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:c}]}}function Tc(e,t,n){const o=It(n),r=o&&t!==Ie?tt(o,t):null;if(o&&(t===Ie||r)){const i={},s={};for(const[p,h]of Object.entries(e))(It(p)===o?s:i)[p]=h;if(t===Ie)return i;const c=ro(s)[o]??[],g=c.includes(r)?c.filter(p=>p!==r):[...c,r];if(g.length===0)return i;const f=uo({[o]:g},Fs(n)),C=Object.values(f)[0]??[];return{...i,[n]:C}}if(t===Ie){const{[n]:i,...s}=e;return s}const u=e[n]??[],a=u.includes(t)?u.filter(i=>i!==t):[...u,t];if(a.length===0){const{[n]:i,...s}=e;return s}return{...e,[n]:a}}Object.fromEntries(Object.entries(Kn).map(([e,{nucleus:t}])=>[e,t]));const Dc={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Bc={"\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"]},Nc={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",field:"\uC758\uBBF8\uBC94\uC8FC",posMap:Bc,typeMap:Dc},mu=new WeakMap;function vc(e,t){const n=mu.get(e);if(n&&n.keys===t)return n.value;const o={grades:[],syls:[],poses:[],types:[],fields:[]},r={grade:o.grades,syllables:o.syls,pos:o.poses,wordType:o.types,field:o.fields};for(const[u,a]of Object.entries(e??{})){const i=u===t.difficulty?"grade":u===t.syllables?"syllables":u===t.partOfSpeech?"pos":u===t.wordType?"wordType":u===t.field?"field":It(u);if(i)for(const s of Array.isArray(a)?a:typeof a=="string"?[a]:[])r[i].includes(s)||r[i].push(s)}return mu.set(e,{keys:t,value:o}),o}function Oc(e,t,n=Nc){const{grades:o,syls:r,poses:u,types:a}=vc(t,n);if(o.length){const i=o.map(s=>tt("grade",s)??s.replace(/\D/g,"")).filter(s=>s!=="");if(i.length===0||!to(i,e.grade,e.age))return!1}if(r.length){const i=e.syllables??0;if(!r.some(s=>{const c=s===n.syllable5plus?"5+":tt("syllables",s);return c==="5+"?i>=5:i===parseInt(c??s)}))return!1}return!(u.length&&!u.flatMap(i=>n.posMap[i]??Ls[tt("pos",i)??""]??[i]).some(i=>(e.pos??"").includes(i))||a.length&&!a.some(i=>e.wordType===(n.typeMap[i]??Rs[tt("wordType",i)??""])))}const gu=["1\uB4F1\uAE09 : \uD559\uB839\uC804\uAE30\uC5D0 \uC2B5\uB4DD\uD558\uC5EC \uD3C9\uC0DD\uC5D0 \uAC78\uCCD0 \uC77C\uC0C1 \uC5B8\uC5B4\uC0DD\uD65C\uC744 \uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uB294 \uC5B4\uD718","2\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 1-2\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","3\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 3-4\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","4\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 5-6\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","\uB4F1\uAE09\uC5C6\uC74C : \uAD6D\uB9BD\uAD6D\uC5B4\uC6D0 \uD45C\uC900 \uC5B4\uD718 \uC678 \uACE0\uBE48\uB3C4 \uC0DD\uD65C \uC5B4\uD718, \uC2E0\uC870\uC5B4 \uBC0F \uC678\uB798\uC5B4"];function hu(e){const t=e("wordPairs.filter.difficultyInfo",{returnObjects:!0,defaultValue:gu});return Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string")?t:gu}function Lc(e){return{composition:e("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:e("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:e("wordPairs.onset","\uCD08\uC131"),vowel:e("wordPairs.vowel","\uBAA8\uC74C"),coda:e("wordPairs.coda","\uC885\uC131"),phonemeGroup:e("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:e("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:e("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:e("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:e("training.filter.random","\uBB34\uC791\uC704"),exclude:e("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:e("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:e("common.none","\uC5C6\uC74C"),noImage:e("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:e("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:e("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:e("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:e("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:e("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}}function Rc(e){const{caps:t,t:n,attrKeys:o,labels:r,phonemeView:u,viable:a,partViable:i,syllableViable:s,minSyllables:c}=e,g=(p,h)=>({title:h,items:p}),f=[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],C=[];if(t.choseong){const p={value:Me,displayLabel:r.codaExclude},h=t.fixedNoCoda===!0,w=(y,b)=>{const S=h&&y==="jong",E={label:b,groupLabel:r.phonemeGroup,allOption:!t.requireSyllable,allLabel:r.noLimit,allOptionDisabled:S};if(u==="pron"){const N=ho[y].map(I=>I.map(({v:B,phonetic:L})=>{const P=He(B),v=nu(n,L),W=S||!P.some(X=>a[y].has(X));return P.length>1?{value:B,labels:P,tooltip:v,disabled:W}:{value:B,tooltip:v,disabled:W}}));return y==="jong"&&!t.requireCoda&&N.unshift([p]),{...E,groups:N}}const A=au[y].map(N=>!S&&i[y].has(N)?N:{value:N,disabled:!0});return{...E,items:y==="jong"&&!t.requireCoda?[p,...A]:A}};C.push(w("cho",r.trainOnset)),C.push(w("jung",r.trainVowel)),C.push(w("jong",r.trainCoda))}if(C.push({...fu(n,o,{labelInfo:g(hu(n))}),label:r.gradeLabel}),t.partOfSpeech&&C.push(pu(o)),t.wordType&&C.push(Cu(o)),t.choseong||t.fixedSyllable!=null){const p=t.fixedSyllable;C.push({label:r.syllableCount,items:[...ru.map(h=>({value:Co(h),displayLabel:n("wordPairs.syllableN",{n:h,defaultValue:"{{n}}\uC74C\uC808"}),disabled:p!=null?h!==p:!s.exact.has(h)||h<c})),{value:Co(Pe),displayLabel:n("wordPairs.syllableNPlus",{n:Pe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:p!=null?Pe!==p:!s.min}],allOption:!0,allOptionDisabled:p!=null})}return t.choseong?C.push({label:r.exclude,displayLabel:r.selectLabel,multiple:!0,items:[r.excludeImage,r.sameStructure],labelInfo:g(f)}):C.push({label:r.exclude,displayLabel:r.selectLabel,multiple:!0,items:[r.excludeImage],labelInfo:g([f[0]])}),C}const bo=e=>Array.isArray(e)?e.filter(Ds):[],Ic="wt_filter",yu=e=>`wt_filter_${e}`,So=["noun","verb","modifier"],wo=["native","sino","foreign","mixed"];function bu(e,t,n,o,r){if(!Array.isArray(e))return[];const u=[];for(const a of e){if(typeof a!="string")continue;const i=t.includes(a)?a:t.find(s=>r.some(c=>o(c,n(s))===a));i&&!u.includes(i)&&u.push(i)}return u}function Su(e){try{const t=localStorage.getItem(yu(e))??localStorage.getItem(Ic);if(t)return JSON.parse(t)}catch{}return null}function wu(e){const t=e?.phonemeView;return t==="pron"?"pron":t==="direct"?"direct":"char"}function Mc(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?{...yo,cho:t.choseong}:yo}function Pc(e,t,n){const{t:o,i18n:r}=Re.useTranslation(),[u]=d.useState(()=>n?.resetOnMount?null:Su(e)),[a,i]=d.useState(wu(u)),[s,c]=d.useState(()=>Mc(u)),g=d.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Me,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Me:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);d.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||c(D=>D.cho||D.jung||D.syllable!=null||D.jong?D:g())},[]);const f=d.useMemo(()=>ce(s.cho)||ce(s.jung)||ce(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),C=d.useRef(a==="char"?s.jung:null),p=d.useRef(a==="char"?s.jong:null);d.useEffect(()=>{a==="char"&&(C.current=s.jung,p.current=s.jong)},[a,s.jung,s.jong]);const[h,w]=d.useState(n?.resetOnMount?!!n?.defaultImageOnly:u?.excludeNoImage??!0),[y,b]=d.useState(n?.resetOnMount?!1:u?.sameStructureOnly??!0),[S,E]=d.useState(bo(u?.gradeFilter)),A=Array.from(new Set([r.language,"ko","en"].filter(Boolean))),N=(D,U)=>r.getFixedT(D)(U),I=D=>bu(D,So,U=>`wordSearch.filter.pos.${U}`,N,A),B=D=>bu(D,wo,U=>`wordSearch.filter.type.${U}`,N,A),[L,P]=d.useState(()=>I(u?.posFilter)),[v,W]=d.useState(()=>B(u?.wordTypeFilter)),X=d.useRef(n?.resetKey);d.useEffect(()=>{X.current!==n?.resetKey&&(X.current=n?.resetKey,c(g()),w(!!n?.defaultImageOnly),b(!1),E([]),P([]),W([]))},[n?.resetKey]);const $=du(),F=d.useMemo(()=>Object.keys($.posMap),[$]),x=d.useMemo(()=>Object.keys($.typeMap),[$]),Y=d.useMemo(()=>L.map(D=>F[So.indexOf(D)]).filter(Boolean),[L,F]),pe=d.useMemo(()=>v.map(D=>x[wo.indexOf(D)]).filter(Boolean),[v,x]),se=1,he=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length),[R,j]=d.useState(e);d.useEffect(()=>{if(R!==e){if(!n?.resetOnMount){const D=Su(e);c(D?.composition??g()),w(D?.excludeNoImage??!0),b(D?.sameStructureOnly??!0),i(wu(D)),E(bo(D?.gradeFilter)),P(I(D?.posFilter)),W(B(D?.wordTypeFilter))}j(e)}},[e,R,n?.resetOnMount]),d.useEffect(()=>{if(!n?.resetOnMount&&R===e)try{localStorage.setItem(yu(e),JSON.stringify({contrastCount:he,composition:s,excludeNoImage:h,sameStructureOnly:y,phonemeView:a,gradeFilter:S,posFilter:L,wordTypeFilter:v}))}catch{}},[n?.resetOnMount,e,R,he,s,h,y,a,S,L,v]);const{viable:M,viableReady:K,wordCount:G,poolVersion:ke}=wc({caps:t,difficulty:f,contrastCount:he,composition:s,phonemeView:a,excludeNoImage:h,sameStructureOnly:y,gradeFilter:S});d.useEffect(()=>{K&&c(D=>{const U={...D};let V=!1;return["cho","jung","jong"].forEach(q=>{const le=D[q];!le||le===Me||He(le).some(Xt=>M[q].has(Xt))||(U[q]=null,V=!0)}),D.syllable!=null&&t.fixedSyllable==null&&(D.syllable>=Pe?[...M.syllable].some(q=>q>=Pe)||(U.syllable=null,V=!0):(!M.syllable.has(D.syllable)||D.syllable<se)&&(U.syllable=null,V=!0)),V?U:D})},[M,K,se,t.fixedSyllable]);const Ke=d.useMemo(()=>{const D=U=>{const V=new Set;for(const q of au[U])M[U].has(q)&&V.add(q);return V};return{cho:D("cho"),jung:D("jung"),jong:D("jong")}},[M]),Ge=d.useMemo(()=>({exact:new Set(ru.filter(D=>M.syllable.has(D))),min:[...M.syllable].some(D=>D>=Pe)}),[M]),Z=d.useMemo(()=>Lc(o),[o]),Kt=d.useMemo(()=>({[Z.trainOnset]:"cho",[Z.trainVowel]:"jung",[Z.trainCoda]:"jong"}),[Z]),On=d.useMemo(()=>Rc({caps:t,t:o,attrKeys:$,labels:Z,phonemeView:a,viable:M,partViable:Ke,syllableViable:Ge,minSyllables:se}),[t,o,$,Z,a,M,Ke,Ge,se]),qt={...(t.choseong||t.fixedSyllable!=null)&&s.syllable!=null?{[Z.syllableCount]:Co(s.syllable)}:{},...t.choseong&&s.cho?{[Z.trainOnset]:s.cho}:{},...t.choseong&&s.jung?{[Z.trainVowel]:s.jung}:{},...t.choseong&&s.jong?{[Z.trainCoda]:s.jong}:{},[Z.exclude]:[...h?[Z.excludeImage]:[],...y?[Z.sameStructure]:[]],[Z.gradeLabel]:S.map(D=>Ps("grade",D)),...t.partOfSpeech?{[$.partOfSpeech]:Y}:{},...t.wordType?{[$.wordType]:pe}:{}},Ln=d.useCallback((D,U)=>{if(U===Z.exclude)D===Z.excludeImage?w(V=>!V):D===Z.sameStructure&&b(V=>!V);else if(U===Z.syllableCount)c(V=>{if(!D||D===Ie)return{...V,syllable:null};const q=bc(D);return{...V,syllable:V.syllable===q?null:q}});else if(U===Z.gradeLabel){if(!D||D===Ie){E([]);return}const V=tt("grade",D);if(V==null)return;E(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else if(U===$.partOfSpeech){if(!D||D===Ie){P([]);return}const V=So[F.indexOf(D)]??I([D])[0];if(!V)return;P(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else if(U===$.wordType){if(!D||D===Ie){W([]);return}const V=wo[x.indexOf(D)]??B([D])[0];if(!V)return;W(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else{const V=Kt[U];if(!V)return;c(q=>t.requireSyllable?D&&D!==Ie?{...q,[V]:D}:q:!D||D===Ie||q[V]===D?{...q,[V]:null}:{...q,[V]:D})}},[Z,Kt,$,F,x,t.requireSyllable]),Jt=d.useCallback(D=>!t.partOfSpeech&&!t.wordType?!0:Oc(D,{...t.partOfSpeech?{[$.partOfSpeech]:Y}:{},...t.wordType?{[$.wordType]:pe}:{}},$),[t.partOfSpeech,t.wordType,Y,pe,$]),ee=d.useCallback(D=>{D!==a&&(D!=="direct"&&a!=="direct"&&c(U=>cu(U,D,C.current,p.current)),i(D))},[a]),gt=d.useCallback(()=>({composition:s,contrastCount:he,excludeNoImage:h,sameStructureOnly:y,phonemeView:a,gradeFilter:S,posFilter:L,wordTypeFilter:v}),[s,he,h,y,a,S,L,v]),te=d.useCallback(D=>{c(D.composition),w(D.excludeNoImage),b(D.sameStructureOnly??!0),i(D.phonemeView),E(bo(D.gradeFilter)),Array.isArray(D.posFilter)&&P(I(D.posFilter)),Array.isArray(D.wordTypeFilter)&&W(B(D.wordTypeFilter))},[]);return{difficulty:f,contrastCount:he,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:y,gradeFilter:S,posFilter:Y,wordTypeFilter:pe,matchesWordAttributes:Jt,poolVersion:ke,filterSections:On,filterSelected:qt,handleFilterSelect:Ln,phonemeView:a,setPhonemeView:ee,phonemeGroupLabel:Z.phonemeGroup,wordCount:G,getFilterSnapshot:gt,restoreFilterSnapshot:te}}function kc(e){const t=i=>i?He(i):null,n=t(e.cho),o=t(e.jung),r=e.jong===Me,u=r?null:t(e.jong),a=e.syllable!=null?mo(e.syllable):null;return!n&&!o&&!u&&!r&&!a?null:{cho:n,jung:o,jong:u,jongNone:r,syllable:a}}function xc(e,t,n,o,r,u,a=!0,i="char",s=[]){const[c,g]=d.useState({}),[f,C]=d.useState(!1),{cho:p=null,jung:h=null,jong:w=null,syllable:y=null}=o??{},b=s.length>0?s.slice().sort().join(","):"",S=e.map(A=>A.key).join("|");d.useEffect(()=>{u>0&&ic(r).catch(()=>{})},[u,r]),d.useEffect(()=>{let A=!1;return C(!0),(async()=>{const N=kc({cho:p,jung:h,jong:w,syllable:y}),I=`${p??""}_${h??""}_${w??""}_${y??""}_${b}`,B={};await Promise.all(e.map(async L=>{const P=qn[L.key];try{const v=await tu(L.key,{difficulty:P.difficulty?t:null,contrastCount:P.difficulty?n:1,composition:P.choseong?N:null,count:5,excludeNoImage:r,sameStructureOnly:a,phonemeView:i,grade:s.length>0?s:null});v&&v.length>0?B[L.key]={id:`wt-${L.key}-${t}-${I}-${Date.now()}`,name:L.label,training_type:L.key,category_main_code:"WORD",iconColor:L.color,subTitle:L.subTitle,items:v,itemCount:v.length}:B[L.key]={id:`wt-${L.key}-empty`,name:L.label,training_type:L.key,category_main_code:"WORD",iconColor:L.color,subTitle:L.subTitle,items:[],itemCount:0,__empty:!0}}catch{B[L.key]=null}})),A||(g(B),C(!1))})(),()=>{A=!0}},[t,n,p,h,w,y,r,a,i,u,b,S]);const E=JSON.stringify(e.map(A=>[A.key,A.label,A.color,A.subTitle]));return{perTypeData:d.useMemo(()=>{const A={};for(const[N,I]of Object.entries(c)){const B=e.find(L=>L.key===N);A[N]=I&&B?{...I,name:B.label,iconColor:B.color,subTitle:B.subTitle}:I}return A},[c,E]),generating:f}}const Pt=[],kt=[],xt=[],Ft=[],En={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Fc={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Eo=null,Eu=null,$e=null;function jc({counts:e,forceRefresh:t}={}){const n=Object.assign({},Fc,e||{}),o=bt(),r=St(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),u=JSON.stringify(n);if(!t&&Eu===o&&Eo===u&&$e)return Object.assign(En,$e.today),Object.assign(An,$e.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:En,yesterday:An};const a={LISTEN_IN_NOISE:xe(Pt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:xe(kt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:xe(xt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:xe(Ft,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let i=null;return $e&&Eo===u&&$e.yesterday&&$e.yesterday.date===r&&(i=$e.yesterday.selection),i||(i={LISTEN_IN_NOISE:xe(Pt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:xe(kt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:xe(xt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:xe(Ft,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(En,a),Object.assign(An,i),Eu=o,Eo=u,$e={today:a,yesterday:{date:r,countsKey:u,selection:i}},{today:En,yesterday:An}}let Ao=!1,jt=null;async function Hc(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Yn&&Yn.tagName.toUpperCase()==="SCRIPT"&&Yn.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 $c(){if(!Ao)return jt||(jt=(async()=>{const e=await Hc();if(!e){jt=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const t={noise:[],short:[],long:[],order:[]};try{if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid training data map");for(const n of Object.keys(e)){const o=e[n];if(!Array.isArray(o))throw new Error("Invalid training data group");for(const r of o){if(!r||typeof r!="object")continue;const u=r,a=String(u.training_type||n),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:a,category_0:i,category_1:s});a==="LISTEN_IN_NOISE"?t.noise.push(c):a==="SHORT_STORY"?t.short.push(c):a==="LONG_STORY"?t.long.push(c):a==="ORDERING_SENTENCE"&&t.order.push(c)}}}catch{jt=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}Pt.push(...t.noise),kt.push(...t.short),xt.push(...t.long),Ft.push(...t.order),Ao=!0,$e=null;try{jc()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),jt)}async function Gc(e=3e3){const t=$c();let n;try{await Promise.race([t,new Promise(o=>{n=setTimeout(o,e)})])}finally{n!==void 0&&clearTimeout(n)}return Ao}function Au(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 Wc(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 Vc=xe,Yc=e=>{const[t,n,o]=e.split("-").map(Number);return Math.round(Date.UTC(t,(n||1)-1,o||1)/864e5)},Uc=(e,t)=>{const n=e??{};return String(n.id??n.name??t)};function _n(e,t,n,o,r){if(!e.length||t<=0)return[];const u=Wc(Au(`${n}|${o}|${r}`)),a=Yc(o)&1,i=e.filter((c,g)=>(Au(`${n}|${r}|${Uc(c,g)}`)>>>7&1)===a),s=i.length>=t&&e.length-i.length>=t;return Vc(s?i:e,t,u)}function _o(e,t,n){const o=r=>Math.max(0,e[r]||0);return{LISTEN_IN_NOISE:_n(Pt,o("LISTEN_IN_NOISE"),t,n,"LISTEN_IN_NOISE"),SHORT_STORY:_n(kt,o("SHORT_STORY"),t,n,"SHORT_STORY"),LONG_STORY:_n(xt,o("LONG_STORY"),t,n,"LONG_STORY"),ORDERING_SENTENCE:_n(Ft,o("ORDERING_SENTENCE"),t,n,"ORDERING_SENTENCE")}}function To(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const zc={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Do(e=!1,t=zc,n){const o=Date.now(),r=St(o),u=St(o-864e5),a=n??"";return Pt.length>0||kt.length>0||xt.length>0||Ft.length>0?{today:_o(t,a,r),yesterday:_o(t,a,u)}:{today:_o(t,a,r),yesterday:null}}function Kc(e){const t=d.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=d.useRef(null),[o,r]=d.useState(!1),[u,a]=d.useState(!1),[i,s]=d.useState(0),[c,g]=d.useState(!1),[f,C]=d.useState(()=>bt()),p=JSON.stringify([e??"",f]),h=d.useRef(null),w=d.useRef(p);d.useEffect(()=>{const b=()=>{const E=Date.now(),A=new Date(E+9*36e5),N=Date.UTC(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()+1)-9*36e5;return Math.max(1e3,N-E+1e3)};let S=setTimeout(function E(){C(bt()),S=setTimeout(E,b())},b());return()=>clearTimeout(S)},[]),d.useEffect(()=>{w.current=p,h.current=null,r(!1),g(!1);let b=!1,S=!1,E=!1,A,N=0,I=null,B=0;const L=40,P=()=>{A!==void 0&&(clearInterval(A),A=void 0)};let v=!1;try{const x=new URLSearchParams(window.location.search),Y=x.get("forceRefresh")||x.get("force");v=Y==="1"||Y==="true"}catch{}const W=x=>{S||(E=!0,h.current=p,t.current=x.today,n.current=x.yesterday,r(!0),g(!0),s(Y=>Y+1),b=!0,P())},X=async()=>{if(b)return;if(!v){const Y=Do(!1,void 0,e);if(To(Y.today)){W(Y);return}}if(I){++N>=L&&$();return}if(N>=B){B=N+8,I=Gc(3e3).catch(()=>!1);try{await I}finally{I=null}if(b)return}const x=Do(v,void 0,e);if(To(x.today)){W(x);return}++N>=L&&$()};function $(){r(!0),g(!1),b=!0,P()}const F=()=>{if(S||E)return;const x=Do(v,void 0,e);To(x.today)&&W(x)};try{window.addEventListener("speechear.data.updated",F)}catch{}return A=setInterval(X,250),X(),()=>{b=!0,S=!0,P();try{window.removeEventListener("speechear.data.updated",F)}catch{}}},[e,f]);const y=d.useCallback(b=>{if(h.current!==p)return;const S=u?n.current:t.current,E=u?t.current:n.current;return S?.[b]?.length?S[b]:E?.[b]?.length?E[b]:void 0},[u,i,p]);return{loaded:w.current===p&&o,hasData:w.current===p&&c,showYesterday:u,setShowYesterday:a,getTrainingPerType:y}}const pt=[];let Tn=!1;function _u(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=pt[pt.length-1];t&&(e.stopPropagation(),t())}function Tu(e){return pt.push(e),!Tn&&typeof document<"u"&&(document.addEventListener("keydown",_u),Tn=!0),()=>{const t=pt.lastIndexOf(e);t>=0&&pt.splice(t,1),pt.length===0&&Tn&&typeof document<"u"&&(document.removeEventListener("keydown",_u),Tn=!1)}}function qc(e,t=!0){const n=Cr(e);d.useEffect(()=>{if(t)return Tu(()=>{n.current?.()})},[t,n])}const Bo=(e,t)=>`${e}:${t??1}`,Ht=new Map,No=new Set,vo=new Map,Dn=6e4;function Jc(e,t){const[n,o]=d.useState(0),[r,u]=d.useState(0),a=JSON.stringify(Array.from(new Set(e.map(i=>Bo(i.word,i.homonum)))).sort());return d.useEffect(()=>{const i=JSON.parse(a),s=Date.now(),c=i.filter(w=>!Ht.has(w)&&!No.has(w)&&!(s-(vo.get(w)??-1/0)<Dn));let g=!1,f=null,C=1/0;const p=(w=Dn)=>{if(g)return;const y=Date.now()+w;y>=C||(f!==null&&clearTimeout(f),C=y,f=setTimeout(()=>u(b=>b+1),w))};for(const w of i){if(Ht.has(w)||No.has(w))continue;const y=vo.get(w);y!=null&&s-y<Dn&&p(Math.max(0,Dn-(s-y)))}if(c.length===0)return()=>{g=!0,f!==null&&clearTimeout(f)};const h=Array.from(new Set(c.map(w=>w.slice(0,w.lastIndexOf(":")))));return Promise.resolve().then(()=>t(h)).then(w=>{for(const y of w)y.Meaning&&Ht.set(Bo(y.Word,y.Homonum??void 0),y.Meaning);if(w.length>0)for(const y of c)Ht.has(y)||No.add(y);else{const y=Date.now();for(const b of c)vo.set(b,y);p()}g||w.length===0||o(y=>y+1)}).catch(()=>{p()}),()=>{g=!0,f!==null&&clearTimeout(f)}},[a,t,r]),d.useMemo(()=>{const i=JSON.parse(a),s=new Map;for(const c of i){const g=Ht.get(c);g!=null&&s.set(c,g)}return s},[a,n])}function Xc(){const[e,t]=d.useState(null),n=d.useCallback(u=>t(u.getBoundingClientRect()),[]),o=d.useCallback(()=>t(null),[]),r=d.useCallback(u=>{const a=u.getBoundingClientRect();t(i=>i?null:a)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:r}}function Qc(e){const[t,n]=d.useState(null),[o,r]=d.useState(null),u=d.useRef(null);d.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const a=d.useCallback((s,c)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{n(s),r(c)},e)},[e]),i=d.useCallback(()=>{u.current&&clearTimeout(u.current),n(null),r(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:a,close:i}}function Zc(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,r=Math.max(1,Math.ceil(e.length/o)),u=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),r):1;return{pageItems:d.useMemo(()=>e.slice((u-1)*o,u*o),[e,u,o]),totalPages:r,curPage:u}}function Du(e,t){const[n,o]=d.useState(e);n!==e&&(o(e),t(1))}function ed(e={}){const{defaultPageSize:t="25",resetOn:n}=e,[o,r]=d.useState(""),[u,a]=d.useState(t),[i,s]=d.useState(1),c=C=>{const p=Number(C);return Number.isFinite(p)&&p>=1?Math.floor(p):null},g=c(t)??25,f=c(u)??g;return Du(JSON.stringify([o,u,...n??[]]),s),{query:o,setQuery:r,pageSize:u,setPageSize:a,perPage:f,page:i,setPage:s}}function td(e="warning"){const[t,n]=d.useState(""),[o,r]=d.useState(e),[u,a]=d.useState(0),i=d.useCallback((f,C)=>{r(C),n(f),a(p=>p+1)},[]),s=d.useCallback(f=>i(f,"warning"),[i]),c=d.useCallback(f=>i(f,"normal"),[i]),g=d.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:u,showToast:i,showWarning:s,showNormal:c,clearToast:g}}const nd=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"audio-lines",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."}],od={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function rd(e){return nd.map(t=>{const n=od[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}const $t={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},Gt=$t.blue,Bn=$t.green,Wt=$t.amber,Nn=$t.purple,ud=$t.pink,ad=[{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:Gt,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:Gt,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:Gt,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:Gt,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:Gt,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:Bn,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:Bn,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:Bn,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:Bn,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:Wt,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:Wt,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:Wt,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:Wt,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:Wt,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:Nn,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:Nn,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:Nn,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:Nn,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:ud,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function ld(){const{t:e}=Re.useTranslation();return d.useMemo(()=>{const t=Object.fromEntries(rd(e).map(o=>[o.key,o.label])),n={...t};return ad.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}function id({computeStyle:e,onScroll:t="close",onResize:n="close",ignoreOutsideClickSelector:o}){const[r,u]=d.useState(!1),[a,i]=d.useState({position:"fixed"}),s=d.useRef(null),c=d.useRef(null),g=d.useCallback(()=>{s.current&&i(e(s.current.getBoundingClientRect(),s.current))},[e]);d.useLayoutEffect(()=>{r&&g()},[r,g]),d.useEffect(()=>{if(!r)return;let p=c.current?.offsetHeight??0;p>0&&g();let h=0,w=null;typeof ResizeObserver<"u"&&c.current&&(w=new ResizeObserver(()=>{const B=c.current?.offsetHeight??0;if(B!==p){if(p=B,++h>4){w?.disconnect(),w=null;return}g()}}),w.observe(c.current));const y=B=>{const L=B.target;o&&L.closest?.(o)||s.current?.contains(L)||c.current?.contains(L)||u(!1)};document.addEventListener("mousedown",y),document.addEventListener("pointerdown",y);let b=null;const S=()=>{if(typeof requestAnimationFrame>"u"){g();return}b===null&&(b=requestAnimationFrame(()=>{b=null,g()}))},E=B=>{c.current?.contains(B.target)||(t==="reposition"?S():t==="close"&&u(!1))};t!=="ignore"&&window.addEventListener("scroll",E,!0);const A=()=>{n==="reposition"?S():n==="close"&&u(!1)};let N=null;const I=()=>{A(),N&&clearTimeout(N),N=setTimeout(()=>{N=null,n==="reposition"&&g()},250)};return n!=="ignore"&&(window.addEventListener("resize",A),window.addEventListener("orientationchange",I)),()=>{b!==null&&cancelAnimationFrame(b),w?.disconnect(),document.removeEventListener("mousedown",y),document.removeEventListener("pointerdown",y),t!=="ignore"&&window.removeEventListener("scroll",E,!0),n!=="ignore"&&(window.removeEventListener("resize",A),window.removeEventListener("orientationchange",I)),N&&clearTimeout(N)}},[r,g,t,n,o]),d.useEffect(()=>{if(r)return Tu(()=>u(!1))},[r]);const f=d.useCallback(()=>u(p=>!p),[]),C=d.useCallback(()=>u(!1),[]);return{open:r,setOpen:u,toggle:f,close:C,style:a,triggerRef:s,menuRef:c}}function sd(e,{mode:t="playback",autoStart:n=!1,onPlaySpeaker:o,onComplete:r,playMs:u=1100,feedbackMs:a=1500}={}){const[i,s]=d.useState([]),[c,g]=d.useState(0),[f,C]=d.useState("idle"),[p,h]=d.useState(null),[w,y]=d.useState([]),[b,S]=d.useState(null),[E,A]=d.useState(0),N=d.useRef(0),I=d.useCallback(M=>{N.current=typeof M=="function"?M(N.current):M,A(N.current)},[]),B=d.useRef(o),L=d.useRef(r);d.useEffect(()=>{B.current=o,L.current=r},[o,r]);const P=d.useRef([]),v=()=>{P.current.forEach(clearTimeout),P.current=[]},W=(M,K)=>{P.current.push(setTimeout(K,M))};d.useEffect(()=>()=>v(),[]);const X=i[c]?.id??null,$=d.useRef(null),F=d.useCallback(()=>{v(),C("playing"),y([]),S(null),I(0);let M=0;e.forEach((K,G)=>{W(M,()=>{g(G),h(K.id),B.current?.(K)}),W(M+1e3,()=>{h(null),y(ke=>[...ke,K.id])}),M+=1300}),W(M,()=>{C("done"),L.current?.({score:0,total:e.length})})},[e,I]),x=d.useCallback((M,K)=>{if(K>=M.length){C("done"),L.current?.({score:N.current,total:M.length});return}$.current=null,g(K),S(null),C("playing"),h(M[K].id),B.current?.(M[K]),W(u,()=>{h(null),C("waiting")})},[u]),Y=d.useCallback(()=>{v();const M=J(e);s(M),I(0),y([]),x(M,0)},[e,x,I]),pe=d.useCallback(()=>{t==="playback"?(s(e),F()):Y()},[t,e,F,Y]),se=d.useCallback(()=>{v(),C("idle"),h(null),y([]),S(null),g(0),I(0),s([])},[I]),he=JSON.stringify(e.map(M=>[M.id,M.label,M.angleDeg,M.deg,M.row,M.shortcut]));d.useEffect(()=>(n?pe():se(),()=>v()),[t,he,n]);const R=d.useCallback(M=>{f!=="waiting"||t==="playback"||$.current===c||($.current=c,S(M),M===i[c]?.id&&I(K=>K+1),t==="exam"?(C("playing"),W(400,()=>x(i,c+1))):(C("feedback"),W(a,()=>x(i,c+1))))},[f,t,i,c,x,a,I]),j=t==="playback"?e.length:i.length;return{bind:{activeSpeakerId:p,playedIds:w,selectedId:b,answerId:X,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:R},index:c,total:j,score:E,phase:f,done:f==="done",start:pe,reset:se}}/*! @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 Bu(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 cd(e){if(Array.isArray(e))return e}function dd(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,u,a,i=[],s=!0,c=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(s=(o=u.call(n)).done)&&(i.push(o.value),i.length!==t);s=!0);}catch(g){c=!0,r=g}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}function fd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
|
+
and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},Ki={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},qi={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},Ji={clearAriaLabel:"Clear input"},Xi={ariaLabel:"Select tab"},Qi={ariaLabel:"Tabs"},Zi={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},es={ariaLabel:"User avatar"},ts={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},ns={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},os={time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"}},rs={steps:"Step {{current}} of {{total}}"},us={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},as={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},ls={viewWords:"Words"},is={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},ss={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},cs={previewRegion:"Report preview \u2014 scrollable sideways"},ds={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},fs={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},ps={clearSelection:"Clear selection"},Cs={showResult:"Show {{type}} result"},ms={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},gs={loading:"Loading"},hs={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},ys={ariaLabel:"Breadcrumb"},bs={empty:"No items yet."},Ss={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},ws={common:Si,calendar:wi,passCard:Ei,rating:Ai,colorPicker:_i,dropdown:Ti,accordion:Di,header:Bi,nav:Ni,settings:vi,usage:Oi,account:Li,training:Ri,customers:Ii,payment:Mi,coupons:Pi,visits:ki,trainingType:xi,myWordTable:Fi,keyWords:ji,wordTable:Hi,wordSearch:$i,wordPrint:Gi,topic:Wi,device:Vi,manager:Yi,wordPairs:Ui,footer:zi,date:Ki,wordData:qi,textField:Ji,segmentedControl:Xi,tabs:Qi,fileUpload:Zi,avatar:es,myHomework:ts,trainingStatus:ns,store:os,progress:rs,trainingMiss:us,table:as,wordScore:ls,topBanner:is,datePicker:ss,report:cs,tooltip:ds,phonemeProfile:fs,bulkBar:ps,debug:Cs,badge:ms,loader:gs,soundCompass:hs,breadcrumb:ys,board:bs,promoBannerBg:Ss};const Es="0.425.0",As=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],eo="ko",_s="ihab_display_language";function kr(){if(typeof window>"u")return eo;try{const e=localStorage.getItem(_s);if(e&&As.some(t=>t.code===e))return e}catch{}return eo}function xr(e){try{document.documentElement.lang=e}catch{}}Be.on("languageChanged",xr),xr(kr()),Be.use(Re.initReactI18next).init({resources:{ko:{translation:bi},en:{translation:ws}},lng:kr(),fallbackLng:eo,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Fr=new Set(["field"]),jr="none";function Ts(e){return e==null||String(e).trim()===""}function Ds(e){return typeof e=="string"&&Hr.includes(e)}function to(e,t,n){if(!e)return!0;const o=e instanceof Set?e:new Set(e);if(o.size===0)return!0;if(Ts(t))return o.has(jr);const r=String(t);return o.has(r)?!0:r!=="1"||n==null?!1:o.has(`age${n}`)}const Lt=["grade","syllables","pos","wordType","field"],Hr=["1","2","3","4","none","age3","age4","age5","age6","age7"],Bs=["1","2","3","4","5+"],Ns=["noun","verb","modifier"],vs=["native","sino","foreign","mixed"],Os={grade:Hr,syllables:Bs,pos:Ns,wordType:vs,field:[]},Ls={noun:["\uBA85","\uC218"],verb:["\uB3D9","\uD615"],modifier:["\uBD80","\uAD00"]},Rs={native:"\uACE0\uC720",sino:"\uD55C\uC790",foreign:"\uC678\uB798",mixed:"\uD63C\uC885"},Is={grade:["\uB09C\uC774\uB3C4 \uB4F1\uAE09","\uB4F1\uAE09","Grade","Difficulty"]},Ms={pos:{noun:["\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)"],verb:["\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)"],modifier:["\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)"]}},no=new Map;try{Be.store?.on?.("added",()=>no.clear())}catch{}function Rt(e){const t=no.get(e);if(t)return t;const n=Be.getFixedT(e),o={section:{grade:n("wordSearch.filter.difficulty","\uB09C\uC774\uB3C4"),syllables:n("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),pos:n("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:n("wordSearch.filter.wordType","\uC720\uD615"),field:n("wordSearch.filter.field","\uC758\uBBF8\uBC94\uC8FC")},value:{grade:{...Object.fromEntries(["1","2","3","4"].map(r=>[r,n("wordSearch.filter.grade",{n:Number(r),defaultValue:`${r}\uB4F1\uAE09`})])),...Object.fromEntries([3,4,5,6,7].map(r=>[`age${r}`,n("wordSearch.filter.age",{n:r,defaultValue:`${r}\uC138`})])),[jr]:n("wordSearch.filter.gradeNone","\uC5C6\uC74C")},syllables:{...Object.fromEntries(["1","2","3","4"].map(r=>[r,n("wordSearch.filter.syllable",{n:Number(r),defaultValue:`${r}\uC74C\uC808`})])),"5+":n("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1")},pos:{noun:n("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)"),verb:n("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)"),modifier:n("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")},wordType:{native:n("wordSearch.filter.type.native","\uACE0\uC720\uC5B4"),sino:n("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4"),foreign:n("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4"),mixed:n("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")},field:{}}};return no.set(e,o),o}const oo=()=>Array.from(new Set([Be.language,"ko","en"].filter(e=>!!e)));function It(e){if(Lt.includes(e))return e;for(const t of oo()){const n=Rt(t);for(const o of Lt)if(n.section[o]===e)return o}for(const t of Lt)if(Is[t]?.includes(e))return t;return null}function tt(e,t){if(Fr.has(e)||Os[e].includes(t))return t;for(const n of oo()){const o=Rt(n).value[e];for(const[r,u]of Object.entries(o))if(u===t)return r}for(const[n,o]of Object.entries(Ms[e]??{}))if(o.includes(t))return n;if(e==="grade"&&/(세|살|years?\s*old|yrs?)\s*$/i.test(t.trim()))return null;if(e==="grade"||e==="syllables"){const n=parseInt(t.replace(/\D/g,""),10);if(Number.isFinite(n)&&n>=1)return e==="grade"?n<=4?String(n):null:n>=5?"5+":String(n)}return null}function Ps(e,t,n=Be.language){return Rt(n).value[e][t]??t}const ks=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"&&e?[e]:[];function ro(e){const t={};for(const[n,o]of Object.entries(e??{})){const r=It(n);if(r)for(const u of ks(o)){const a=tt(r,u);if(!a)continue;const i=t[r]??(t[r]=[]);i.includes(a)||i.push(a)}}return t}function uo(e,t=Be.language){const n=Rt(t||"ko"),o={};for(const r of Lt){const u=(e?.[r]??[]).map(a=>n.value[r][a]??(Fr.has(r)?a:void 0)).filter(a=>!!a);u.length&&(o[n.section[r]]=u)}return o}function xs(e,t=Be.language){const n={};for(const[o,r]of Object.entries(e??{}))It(o)||(n[o]=r);return{...n,...uo(ro(e),t)}}function Fs(e){for(const t of oo()){const n=Rt(t);if(Lt.some(o=>n.section[o]===e))return t}return Be.language||"ko"}let hn=null,$r=null,Gr=null;function js(){const e=Cn();if(e&&e.entries.length>0){const t=_t();if(hn&&$r===e&&Gr===t)return hn;const n=new Set,o=[];for(const r of e.entries)!r.word||n.has(r.word)||(n.add(r.word),o.push({w:r.word,s:r.syllables,p:t?.[r.word]?[...t[r.word].cho??[],...t[r.word].jung??[],...t[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return hn=o,$r=e,Gr=t,hn}return[]}const Fe=new Proxy([],{get(e,t){const n=js(),o=n[t];return typeof o=="function"?o.bind(n):o}});function ao(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Ne(e,t){if(t>=e.length)return J(e);if(t===0)return[];const n=e.slice();for(let o=0;o<t;o++){const r=o+Math.floor(Math.random()*(n.length-o)),u=n[o];n[o]=n[r],n[r]=u}return n.slice(0,t)}let lo=null,Wr=null;function Ue(){const e=Cn();if(lo&&Wr===e)return lo;const t=new Map;for(const n of Fe)n.w&&t.set(n.w,n.pron);return lo=t,Wr=e,t}function de(e){return Ue().get(e)||e}function yn(e,t,n=new Set){const o=[];for(const r of J(e)){if(o.length>=t)break;const u=de(r);n.has(u)||(n.add(u),o.push(r))}return o}let Hs=0;function me(e){return`${e}-rt-${++Hs}`}function ft(e){const t=Dr();if(!t||t.total===0){const r=new Set;for(const u of e)r.add(u);return r}const n=fn(),o=new Set;for(const r of e)n.has(r)&&o.add(r);return o}const bn=new Map;let Vr=null,Yr=null,Ur=null;function Mt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function io(e){const t=Array.isArray(e.choseong)&&e.choseong.length===0?"[]":Mt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),r=n?`${Mt(n.cho)}/${Mt(n.jung)}/${Mt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",u=Mt(e.grade);return`${e.difficulty??""}|${t}|${r}|${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${u}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}const so=new Map;function $s(e){return io({...e,count:void 0,choicesPerItem:void 0,fullCount:!1})}async function Ae(e){const t=Cn(),n=_t(),o=e.excludeNoImage?fn():null;(t!==Vr||n!==Yr||e.excludeNoImage&&o!==Ur)&&(bn.clear(),so.clear(),Vr=t,Yr=n,Ur=o);const r=io(e);return bn.has(r)||bn.set(r,Gs(e)),bn.get(r)}function zr(e){if(!e)return null;const t=a=>a==null?null:Array.isArray(a)?a.length?a:null:[a],n=t(e.cho),o=t(e.jung),r=!!e.jongNone,u=r?null:t(e.jong);return n||o||u||r?r&&!n&&!o&&!u?a=>Oa(a):a=>Ra(a,{cho:n,jung:o,jong:u,jongNone:r}):null}function Kr(e){const t=e.grade&&e.grade.length>0?new Set(e.grade):null,n=e.composition??null,o=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,r=n?[zr(n),o?a=>o.has(Et(a)):null].filter(a=>a!=null):[];if(!t&&r.length===0)return null;const u=e.phonemeView==="pron";return a=>{if(!to(t,a.grade,a.age))return!1;if(r.length===0)return!0;const i=u?de(a.w):a.w;return r.every(s=>s(i))}}async function Gs(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:r=null,excludeNoImage:u=!1}=e,a=e.grade&&e.grade.length>0?new Set(e.grade):null,i=e.sameStructureOnly??!0,s=e.phonemeView==="pron"?"pron":"char",c=Math.max(1,e.contrastCount??1),g=t==="cho"||t==="jung"||t==="jong",f=g&&c>=2,C=t==="count",p=n?new Set(Array.isArray(n)?n:[n]):null,h=o?.syllable!=null?new Set(Array.isArray(o.syllable)?o.syllable:[o.syllable]):null,w=o?[zr(o),h?R=>h.has(Et(R)):null].filter(R=>R!=null):[],y=t==="random"||t===null,b=y||C,S=y||f||C;let E=Fe.filter(R=>!R.w||!to(a,R.grade,R.age)?!1:S?!0:Array.isArray(R.p)&&R.p.length>0);p&&(E=E.filter(R=>{for(const j of p)if(Na(R.w,j))return!0;return!1})),w.length>0&&(E=E.filter(R=>{const j=s==="pron"?de(R.w):R.w;return w.every(M=>M(j))})),r&&(E=E.filter(R=>R.w[0]===r));let A;if(u){const R=new Set;for(const j of E)if(R.add(j.w),Array.isArray(j.p))for(const M of j.p)R.add(M);if(b)for(const j of Fe)j.w&&R.add(j.w);A=ft(R)}else{const R=new Set;for(const j of E)if(R.add(j.w),Array.isArray(j.p))for(const M of j.p)R.add(M);if(b)for(const j of Fe)j.w&&R.add(j.w);A=R}let N=null;if(f){const R=new Set;for(const j of Fe)j.w&&R.add(j.w);N=u?ft(R):R}const I=E.filter(R=>A.has(R.w)),B=600,L=Array.from(A),P=L.length>B?Ne(L,B):L,v=C&&o!=null&&(ce(o.cho)||ce(o.jung)||ce(o.jong)),W=2500,X=new Map;if(C&&!v&&c>=2){for(const R of L){const j=Et(R),M=X.get(j);M?M.push(R):X.set(j,[R])}for(const[R,j]of X)j.length>W&&X.set(R,Ne(j,W))}const $=Da();let F=null;if(v){const R=$s(e),j=u?fn():null,M=so.get(R);F=M&&M.imageOkSet===j?M.map:al(o,L,$,i,s,de),so.set(R,{imageOkSet:j,map:F})}const x=500,Y=1500,pe=e.fullCount?I:t==="random"?I.length>x?Ne(I,x):I:I.length>Y?Ne(I,Y):I,se=_t(),he=[];for(const R of pe){let j;const M=de(R.w);if(f)j=Ma(R.w,t,c,N,24).filter(K=>de(K)!==M);else if(C)v?j=(F.get(R.w)??[]).filter(K=>de(K)!==M):c<=1?j=Mr(R.w,se,{okSet:A,pronOf:de,decompOf:$,sameStructureOnly:!1}):j=(X.get(Et(R.w))??[]).filter(K=>{if(K===R.w||de(K)===M)return!1;const G=Pa(M,de(K));return c>=5?G>=5:G===c});else if(y){const K=G=>G!==R.w&&G.length===R.w.length&&de(G)!==M;if(e.fullCount){const G=Math.max(1,(e.choicesPerItem??3)-1),ke=[],Ke=new Set;for(const Ge of P){if(!K(Ge))continue;const Z=de(Ge);if(!Ke.has(Z)&&(Ke.add(Z),ke.push(Ge),ke.length>=G))break}j=ke}else j=P.filter(K)}else{const K=t;j=Mr(R.w,se,{kind:K,okSet:A,pronOf:de,decompOf:$,sameStructureOnly:!1}),j.length===0&&(j=(P.length>30?Ne(P,30):P).filter(G=>G!==R.w&&Ba(R.w,G)===t&&de(G)!==M))}if(i&&j.length>0&&(g||C&&!v)){const K=$(de(R.w));j=j.filter(G=>!Qn(K,$(de(G))))}j.length!==0&&he.push({word:R,usable:j})}return he}async function qr(e,t){const{choicesPerItem:n=3,count:o=10}=t,r=n-1,u=(await Ae(t)).filter(i=>i.usable.length>=r),a=[];for(const i of J(u)){if(a.length>=o)break;const s=yn(i.usable,r);if(s.length<r)continue;const c=J([i.word.w,...s]);a.push({id:me(e+"-item"),index:a.length+1,word:i.word.w,syllables:i.word.s,choices:c,answerIndex:c.indexOf(i.word.w)})}return a}async function Ws(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Ae({...e,difficulty:null});if(r.length<t)return[];const u=e.composition??null,a=[],i=J([...r]);for(const s of i){if(a.length>=n)break;const c=s.word.w,g=[...s.word.pron||c],f=u&&gn(u)?g.filter(y=>{const b=Q(y);return!!b&&et(b,u)}):[],C=ao(f.length?f:g);if(!C)continue;const p=r.filter(y=>y.word.w!==c&&y.word.s===s.word.s&&!(y.word.pron||y.word.w).includes(C)&&y.word.pron!==s.word.pron);if(p.length<o)continue;const h=yn(p.map(y=>y.word.w),o);if(h.length<o)continue;const w=J([c,...h]);a.push({id:me("HPI-item"),index:a.length+1,targetSyllable:C,word:c,choices:w,answerIndex:w.indexOf(c)})}return a}async function Vs(e){const{count:t=10}=e,n=(await Ae(e)).filter(u=>u.usable.length>=1);if(!n.length)return[];const o=n.length>=t?Ne(n,t):J(Array.from({length:t},(u,a)=>n[a%n.length])),r=J(Array.from({length:t},(u,a)=>a<Math.ceil(t/2)));return o.map((u,a)=>{const i=r[a];let s;if(i)s=[u.word.w,u.word.w];else{const c=ao(u.usable);s=Math.random()<.5?[u.word.w,c]:[c,u.word.w]}return{id:me("SOD-item"),index:a+1,word:u.word.w,pair:s,same:i}})}async function Ys(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Ae({...e,difficulty:null});if(r.length<t+1)return[];const u=r.map(C=>C.word.w),a=new Map(r.map(C=>[C.word.w,C.word.pron])),i=C=>(a.get(C)||C)[0]??"",s={};for(const C of r){const p=i(C.word.w);p&&(s[p]||(s[p]=[]),s[p].push(C.word.w))}const c=Object.entries(s).filter(([,C])=>new Set(C.map(p=>a.get(p)||p)).size>=2).map(([C])=>C);if(c.length===0)return[];const g=[],f=J([...c]);for(let C=0;g.length<n&&C<n*4;C++){const p=f[C%f.length],h=s[p];if(h.length<2)continue;const w=J([...h]),y=w[0],b=a.get(y)||y,S=w.find(B=>B!==y&&(a.get(B)||B)!==b);if(!y||!S)continue;const E=a.get(S)||S,A=u.filter(B=>i(B)!==p&&B!==y&&B!==S&&B.length===S.length&&(a.get(B)||B)!==E);if(A.length<o)continue;const N=yn(A,o);if(N.length<o)continue;const I=J([S,...N]);g.push({id:me("SWS-item"),index:g.length+1,sourceWord:y,targetSyllable:p,word:S,choices:I,answerIndex:I.indexOf(S)})}return g}function Jr(e,t,n){const o=Ue(),r=s=>o.get(s)||s,u=(s,c)=>{const g=[...s],f=[...c];if(g.length!==f.length)return-1;let C=-1;for(let p=0;p<g.length;p++)if(g[p]!==f[p]){if(C>=0)return-1;C=p}return C},a=e.map(s=>({e:s,swaps:s.usable.filter(c=>!!c&&u(s.word.w,c)>=0&&r(c)!==r(s.word.w))})).filter(s=>s.swaps.length>0),i=[];for(const{e:s,swaps:c}of J(a)){if(i.length>=t)break;const g=ao(c)??"",f=[...s.word.w],C=[...g],p=u(s.word.w,g),h=yn(s.usable.filter(w=>w&&w!==g),2,new Set([r(g),r(s.word.w)]));h.length<2||i.push({id:me(n),index:i.length+1,word:s.word.w,original:s.word.w,changed:g,changedFrom:p>=0?f[p]:"",changedTo:p>=0?C[p]:"",distractors:h})}return i}async function Xr(e,t,n){const{count:o=10}=t,r=Ue(),u=Fe.filter(h=>h.w&&h.s===e),a=t.excludeNoImage?ft(u.map(h=>h.w)):null,i=a?u.filter(h=>a.has(h.w)):u,s=new Set(i.map(h=>h.w)),c=gl(s),g=t.phonemeView??"char",f=t.composition??null,C=Kr(t),p=[];for(const h of J(i)){if(p.length>=o)break;if(C&&!C(h))continue;const w=hl(h.w,f,r,g,c,null,null);if(!w)continue;const y=w.distractors[0],b=[...h.w],S=[...y],E=b.findIndex((A,N)=>A!==S[N]);p.push({id:me(n),index:p.length+1,word:h.w,original:h.w,changed:y,changedFrom:E>=0?b[E]:"",changedTo:E>=0?S[E]:"",distractors:w.distractors.slice(1)})}return p}async function Us(e){return Xr(2,e,"CS2-item")}async function zs(e){return Xr(3,e,"CS3-item")}async function Ks(e){const t=(await Ae({...e,difficulty:"count",contrastCount:1})).filter(n=>n.word.s===1&&n.usable.length>=1);return Jr(t,e.count??10,"CP1-item")}async function qs(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Ae({...e,difficulty:t,contrastCount:1})).filter(o=>o.word.s===2&&o.usable.length>=1);return Jr(n,e.count??10,"CP2-item")}async function Js(e){const{count:t=10}=e,n=(await Ae({...e})).filter(o=>o.word.s===2);return Ne(n,t).map((o,r)=>({id:me("M2S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function Xs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(o=>o.word.s===3);return Ne(n,t).map((o,r)=>({id:me("M3S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}function co(e){const t=Fe.map(n=>n.w);return e.excludeNoImage?ft(t):new Set(t)}async function Qs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s===2),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=dl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=[...i.word.w],C=f[0]===c?f[1]:f[0];a.push({id:me("D2-item"),index:a.length+1,original:i.word.w,word:i.word.w,dropped:C,missingResult:c,distractors:g})}return a}async function Zs(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s===3),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=fl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=[...i.word.w];let C="";for(let p=0;p<f.length;p++)if(f.filter((h,w)=>w!==p).join("")===c){C=f[p];break}a.push({id:me("D3-item"),index:a.length+1,original:i.word.w,word:i.word.w,dropped:C,missingResult:c,distractors:g})}return a}async function ec(e){const{count:t=10}=e,n=(await Ae({...e})).filter(i=>i.word.s>=3),o=Ue(),r=co(e),u=e.phonemeView??"char",a=[];for(const i of J(n)){if(a.length>=t)break;const s=pl(i.word.w,e.composition??null,o,u,r);if(!s)continue;const[c,...g]=s.distractors,f=i.word.w,C=s.dropped??(f.startsWith(c)?f.slice(c.length):f.endsWith(c)?f.slice(0,f.length-c.length):"");a.push({id:me("DPC-item"),index:a.length+1,original:f,word:f,dropped:C,missingResult:c,distractors:g})}return a}async function tc(e){const{count:t=10}=e,n=(await Ae({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,r)=>{const u=Ne(n,3);return{id:me("LRO-item"),index:r+1,sequence:u,choices:J(u)}})}function Sn(e,t,n){const o=Fe.filter(i=>i.w&&i.s===e),r=t.excludeNoImage?ft(o.map(i=>i.w)):null,u=Kr(t),a=[];for(const i of o)if(!(r&&!r.has(i.w))&&!(u&&!u(i))){if(n){const s=Q(i.w);if(!s||!n(s))continue}a.push(i)}return a}function nc(e){const t=Sn(1,e,mn.MERGE_2_PHONEMES.syllable);return Ne(t,e.count??10).map((n,o)=>{const r=Q(n.w);return{id:me("M2P-item"),index:o+1,parts:[Ce[r.cho],Ee[r.jung]],answer:n.w,word:n.w}})}function oc(e){const t=Sn(1,e,mn.MERGE_3_PHONEMES.syllable);return Ne(t,e.count??10).map((n,o)=>{const r=Q(n.w);return{id:me("M3P-item"),index:o+1,parts:[Ce[r.cho],Ee[r.jung],De[r.jong]],answer:n.w,word:n.w}})}function rc(e){const t=mn.DROP_FINAL_CONSONANT_FROM_1SYLL,n=Sn(t.syllables,e,t.syllable),o=Ue(),r=[];for(const u of J(n)){if(r.length>=(e.count??10))break;const a=Cl(u.w,null,o);if(!a)continue;const[i,...s]=a.distractors;r.push({id:me("DFC-item"),index:r.length+1,original:u.w,word:u.w,result:i,distractors:s})}return r}function uc(e){const t=mn.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=Sn(t.syllables,e,t.syllable),o=Ue(),r=[];for(const u of J(n)){if(r.length>=(e.count??10))break;const a=ml(u.w,null,o);if(!a)continue;const i=Q(o.get(u.w)||u.w);if(!i)continue;const[s,...c]=a.distractors;r.push({id:me("RCP-item"),index:r.length+1,base:u.w,word:u.w,missingConsonant:Ce[i.cho],remaining:s,distractors:c})}return r}const wn=new Map;let Qr=null,Zr=null,eu=null,fo=0;async function tu(e,t={}){const n=Cn(),o=_t(),r=t.excludeNoImage?fn():null;(n!==Qr||o!==Zr||t.excludeNoImage&&r!==eu)&&(wn.clear(),fo++,Qr=n,Zr=o,eu=r);const u=`${e}:${io(t)}`;if(wn.has(u))return wn.get(u);const a=fo,i=await lc(e,t);return a===fo&&wn.set(u,i),i}const ac={SAME_SOUND_PICK:e=>qr("SSP",e),HEAR_AND_PICK_SAME:e=>qr("HPS",e),HEAR_AND_PICK_INCLUDED:e=>Ws(e),SAME_OR_DIFF:e=>Vs(e),STARTS_WITH_SAME_SOUND:e=>Ys(e),LISTEN_AND_REMEMBER_ORDER:e=>tc(e),MERGE_2_SYLLABLES:e=>Js(e),MERGE_3_SYLLABLES:e=>Xs(e),MERGE_2_PHONEMES:e=>nc(e),MERGE_3_PHONEMES:e=>oc(e),DROP_1_FROM_2SYLL:e=>Qs(e),DROP_1_FROM_3SYLL:e=>Zs(e),DROP_PART_FROM_COMPOUND:e=>ec(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>rc(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>uc(e),CHANGE_1_SYLL_IN_2SYLL:e=>Us(e),CHANGE_1_SYLL_IN_3SYLL:e=>zs(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Ks(e),CHANGE_1_PHONEME_IN_2SYLL:e=>qs(e)};async function lc(e,t={}){const n=ac[e];return n?await n(t):[]}async function ic(e){const t=["random","count"],n=Object.keys(qn);let o=0;for(const r of t)for(const u of n){const a=qn[u];tu(u,{difficulty:a.difficulty?r:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++o%6===0&&await new Promise(i=>setTimeout(i,0))}}async function sc(e){const t=await Ae({...e,fullCount:!0}),n=e.choicesPerItem!=null?Math.max(1,e.choicesPerItem-1):1;return t.filter(o=>new Set(o.usable.map(r=>de(r))).size>=n).length}async function cc(e={}){const t=[];for(const i of Fe)i.w&&t.push(i.w);const n=e.excludeNoImage?ft(t):t,o=new Set,r=new Set,u=new Set,a=new Set;for(const i of n){a.add(Et(i));for(const s of i){const c=Q(s);if(c&&(Ce[c.cho]!=="\u3147"&&o.add(Ce[c.cho]),r.add(Ee[c.jung]),c.jong>0)){u.add(De[c.jong]);const g=dn[c.jong];g&&g.forEach(f=>u.add(f))}}}return{cho:o,jung:r,jong:u,syllable:a}}const dc={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},fc={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},pc={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function nu(e,t){if("place"in t)return dc[t.place](e);const n=fc[t.vowel](e);return t.glide?`${n} \xB7 ${pc[t.glide](e)}`:n}const Cc=(e,{defaultValue:t})=>t,ou=(e,t)=>({jamos:e,phonetic:t,tooltip:nu(Cc,t)}),je=(e,t)=>t.map(n=>ou([n],{place:e})),fe=(e,t,n)=>ou([...e],n?{vowel:t,glide:n}:{vowel:t}),po={cho:[je("labial",["\u3142","\u3143","\u314D","\u3141"]),je("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),je("alveolar",["\u3145","\u3146"]),je("palatal",["\u3148","\u3149","\u314A"]),je("velar",["\u3131","\u3132","\u314B"]),je("glottal",["\u314E"])],jung:[[fe("\u3163","frontHigh"),fe("\u315F","frontHigh","w"),fe("\u3162","frontHigh","velar")],[fe("\u3161","backHighUnrounded")],[fe("\u315C","backHighRounded"),fe("\u3160","backHighRounded","j")],[fe("\u3154\u3150","frontMid"),fe("\u3156\u3152","frontMid","j"),fe("\u3159\u315A\u315E","frontMid","w")],[fe("\u3153","backMidUnrounded"),fe("\u3155","backMidUnrounded","j"),fe("\u315D","backMidUnrounded","w")],[fe("\u3157","backMidRounded"),fe("\u315B","backMidRounded","j")],[fe("\u314F","low"),fe("\u3151","low","j"),fe("\u3158","low","w")]],jong:[je("labial",["\u3142","\u3141"]),je("alveolar",["\u3137","\u3134","\u3139"]),je("velar",["\u3131","\u3147"])]},mc=[...Ce],gc=[...Ee],hc=De.filter(e=>e!==""),He=e=>e===Me?[]:Array.from(e),Me="__NO_CODA__",ru=[1,2,3,4],Pe=5,yc=12,uu="SYL_",Co=e=>`${uu}${e}`,bc=e=>Number(e.slice(uu.length));function mo(e){return e>=Pe?Array.from({length:yc-Pe+1},(t,n)=>Pe+n):[e]}const au={cho:mc,jung:gc,jong:hc},go=e=>e.map(t=>t.map(({jamos:n,phonetic:o,tooltip:r})=>({v:n.join(""),phonetic:o,tooltip:r}))),ho={cho:go(po.cho),jung:go(po.jung),jong:go(po.jong)},lu={};ho.jung.flat().forEach(({v:e})=>{for(const t of He(e))lu[t]=e});const Sc=new Set(ho.cho.flat().map(e=>e.v));function iu(e,t){return e==="cho"?Sc.has(t)?t:null:e==="jung"?lu[t]??t:wt(t)}function su(e,t,n){if(e==="jung"){const o=He(t);return n&&o.includes(n)?n:o[0]??t}return e==="jong"&&n&&wt(n)===t?n:t}function cu(e,t,n,o){const r=(u,a)=>a?u==="jong"&&a===Me?Me:t==="pron"?iu(u,a):su(u,a,u==="jung"?n:u==="jong"?o:null):null;return{...e,cho:r("cho",e.cho),jung:r("jung",e.jung),jong:r("jong",e.jong)}}const yo={cho:null,jung:null,jong:null,syllable:null};function wc(e){const{caps:t,difficulty:n,contrastCount:o,composition:r,phonemeView:u,excludeNoImage:a,sameStructureOnly:i,gradeFilter:s}=e,{i18n:c}=Re.useTranslation(),[g,f]=d.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[C,p]=d.useState(!1),[h,w]=d.useState(null),[y,b]=d.useState(0);Un("wordpool:update",()=>b(E=>E+1)),Un(wr,()=>b(E=>E+1));const S=d.useRef(c.language);return d.useEffect(()=>{S.current!==c.language&&(S.current=c.language,b(E=>E+1))},[c.language]),d.useEffect(()=>{if(!t.choseong)return;let E=!1;return cc({difficulty:n,excludeNoImage:a}).then(A=>{E||(f(A),p(A.cho.size+A.jung.size+A.jong.size>0))}).catch(()=>{E||(f({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),p(!1))}),()=>{E=!0}},[t.choseong,n,a,y]),d.useEffect(()=>{let E=!1;const A=r,N=A.cho?He(A.cho):null,I=A.jung?He(A.jung):null,B=A.jong===Me,L=B?null:A.jong?He(A.jong):null,P=A.syllable!=null?mo(A.syllable):null,v=!!(N||I||L||B||P);return sc({difficulty:t.difficulty?n:null,contrastCount:t.difficulty?o:1,composition:t.choseong&&v?{cho:N,jung:I,jong:L,jongNone:B,syllable:P}:null,excludeNoImage:a,sameStructureOnly:i,phonemeView:u==="pron"?"pron":"char",grade:s.length>0?s:null}).then(W=>{E||w(W)}).catch(()=>{E||w(null)}),()=>{E=!0}},[t.choseong,t.difficulty,n,o,r,u,a,i,y,s]),{viable:g,viableReady:C,wordCount:h,poolVersion:y}}function du(){const{t:e}=Re.useTranslation();return d.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB09C\uC774\uB3C4"),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 fu(e,t,n){return{label:t.difficulty,items:[...[3,4,5,6,7].map(o=>e("wordSearch.filter.age",{n:o,defaultValue:`${o}\uC138`})),...[2,3,4].map(o=>e("wordSearch.filter.grade",{n:o})),e("wordSearch.filter.gradeNone","\uC5C6\uC74C")],multiple:!0,allOption:!0,allLabel:n?.allLabel,labelAction:n?.labelAction,labelInfo:n?.labelInfo??{title:t.difficulty,items:[e("wordSearch.filter.difficultyInfoAge","3\uC138~7\uC138: \uAC00\uC7A5 \uC26C\uC6B4 \uB0B1\uB9D0(1\uB4F1\uAE09)\uC744 \uB610\uB798\uBCC4\uB85C \uB098\uB208 \uAC83\uC785\uB2C8\uB2E4."),e("wordSearch.filter.difficultyInfoGrade","2~4\uB4F1\uAE09: \uADF8\uBCF4\uB2E4 \uC5B4\uB824\uC6B4 \uB0B1\uB9D0\uC774\uACE0, \uB098\uC774\uB85C\uB294 \uB098\uB204\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."),e("wordSearch.filter.difficultyInfoNone","\uC5C6\uC74C: \uB09C\uC774\uB3C4\uAC00 \uB9E4\uACA8\uC9C0\uC9C0 \uC54A\uC740 \uB0B1\uB9D0\uC785\uB2C8\uB2E4.")]}}}function pu(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Cu(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function Ec(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 Ac(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"),e("wordPairs.filter.onlyHighUsage","\uD65C\uC6A9\uB3C4 \uB192\uC740 \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,labelInfo:t?.labelInfo}}function _c(e,t){const{label:n,headValue:o,midValue:r,tailValue:u,includeMid:a=!0,headDisabled:i,midDisabled:s,tailDisabled:c,allOptionDisabled:g,groupLabel:f,labelAction:C}=t;return{label:n,...f?{groupLabel:f}:{},...C?{labelAction:C}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...g?{allOptionDisabled:g}:{},items:[{value:o,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:i},...a?[{value:r,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:s}]:[],{value:u,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:c}]}}function Tc(e,t,n){const o=It(n),r=o&&t!==Ie?tt(o,t):null;if(o&&(t===Ie||r)){const i={},s={};for(const[p,h]of Object.entries(e))(It(p)===o?s:i)[p]=h;if(t===Ie)return i;const c=ro(s)[o]??[],g=c.includes(r)?c.filter(p=>p!==r):[...c,r];if(g.length===0)return i;const f=uo({[o]:g},Fs(n)),C=Object.values(f)[0]??[];return{...i,[n]:C}}if(t===Ie){const{[n]:i,...s}=e;return s}const u=e[n]??[],a=u.includes(t)?u.filter(i=>i!==t):[...u,t];if(a.length===0){const{[n]:i,...s}=e;return s}return{...e,[n]:a}}Object.fromEntries(Object.entries(Kn).map(([e,{nucleus:t}])=>[e,t]));const Dc={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Bc={"\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"]},Nc={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",field:"\uC758\uBBF8\uBC94\uC8FC",posMap:Bc,typeMap:Dc},mu=new WeakMap;function vc(e,t){const n=mu.get(e);if(n&&n.keys===t)return n.value;const o={grades:[],syls:[],poses:[],types:[],fields:[]},r={grade:o.grades,syllables:o.syls,pos:o.poses,wordType:o.types,field:o.fields};for(const[u,a]of Object.entries(e??{})){const i=u===t.difficulty?"grade":u===t.syllables?"syllables":u===t.partOfSpeech?"pos":u===t.wordType?"wordType":u===t.field?"field":It(u);if(i)for(const s of Array.isArray(a)?a:typeof a=="string"?[a]:[])r[i].includes(s)||r[i].push(s)}return mu.set(e,{keys:t,value:o}),o}function Oc(e,t,n=Nc){const{grades:o,syls:r,poses:u,types:a}=vc(t,n);if(o.length){const i=o.map(s=>tt("grade",s)??s.replace(/\D/g,"")).filter(s=>s!=="");if(i.length===0||!to(i,e.grade,e.age))return!1}if(r.length){const i=e.syllables??0;if(!r.some(s=>{const c=s===n.syllable5plus?"5+":tt("syllables",s);return c==="5+"?i>=5:i===parseInt(c??s)}))return!1}return!(u.length&&!u.flatMap(i=>n.posMap[i]??Ls[tt("pos",i)??""]??[i]).some(i=>(e.pos??"").includes(i))||a.length&&!a.some(i=>e.wordType===(n.typeMap[i]??Rs[tt("wordType",i)??""])))}const gu=["1\uB4F1\uAE09 : \uD559\uB839\uC804\uAE30\uC5D0 \uC2B5\uB4DD\uD558\uC5EC \uD3C9\uC0DD\uC5D0 \uAC78\uCCD0 \uC77C\uC0C1 \uC5B8\uC5B4\uC0DD\uD65C\uC744 \uD558\uB294 \uB370 \uC0AC\uC6A9\uB418\uB294 \uC5B4\uD718","2\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 1-2\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","3\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 3-4\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","4\uB4F1\uAE09 : \uCD08\uB4F1\uD559\uAD50 5-6\uD559\uB144 \uB09C\uC774\uB3C4 \uC5B4\uD718","\uB4F1\uAE09\uC5C6\uC74C : \uAD6D\uB9BD\uAD6D\uC5B4\uC6D0 \uD45C\uC900 \uC5B4\uD718 \uC678 \uACE0\uBE48\uB3C4 \uC0DD\uD65C \uC5B4\uD718, \uC2E0\uC870\uC5B4 \uBC0F \uC678\uB798\uC5B4"];function hu(e){const t=e("wordPairs.filter.difficultyInfo",{returnObjects:!0,defaultValue:gu});return Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string")?t:gu}function Lc(e){return{composition:e("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:e("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:e("wordPairs.onset","\uCD08\uC131"),vowel:e("wordPairs.vowel","\uBAA8\uC74C"),coda:e("wordPairs.coda","\uC885\uC131"),phonemeGroup:e("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:e("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:e("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:e("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:e("training.filter.random","\uBB34\uC791\uC704"),exclude:e("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:e("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:e("common.none","\uC5C6\uC74C"),noImage:e("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:e("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:e("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:e("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:e("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:e("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}}function Rc(e){const{caps:t,t:n,attrKeys:o,labels:r,phonemeView:u,viable:a,partViable:i,syllableViable:s,minSyllables:c}=e,g=(p,h)=>({title:h,items:p}),f=[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],C=[];if(t.choseong){const p={value:Me,displayLabel:r.codaExclude},h=t.fixedNoCoda===!0,w=(y,b)=>{const S=h&&y==="jong",E={label:b,groupLabel:r.phonemeGroup,allOption:!t.requireSyllable,allLabel:r.noLimit,allOptionDisabled:S};if(u==="pron"){const N=ho[y].map(I=>I.map(({v:B,phonetic:L})=>{const P=He(B),v=nu(n,L),W=S||!P.some(X=>a[y].has(X));return P.length>1?{value:B,labels:P,tooltip:v,disabled:W}:{value:B,tooltip:v,disabled:W}}));return y==="jong"&&!t.requireCoda&&N.unshift([p]),{...E,groups:N}}const A=au[y].map(N=>!S&&i[y].has(N)?N:{value:N,disabled:!0});return{...E,items:y==="jong"&&!t.requireCoda?[p,...A]:A}};C.push(w("cho",r.trainOnset)),C.push(w("jung",r.trainVowel)),C.push(w("jong",r.trainCoda))}if(C.push({...fu(n,o,{labelInfo:g(hu(n))}),label:r.gradeLabel}),t.partOfSpeech&&C.push(pu(o)),t.wordType&&C.push(Cu(o)),t.choseong||t.fixedSyllable!=null){const p=t.fixedSyllable;C.push({label:r.syllableCount,items:[...ru.map(h=>({value:Co(h),displayLabel:n("wordPairs.syllableN",{n:h,defaultValue:"{{n}}\uC74C\uC808"}),disabled:p!=null?h!==p:!s.exact.has(h)||h<c})),{value:Co(Pe),displayLabel:n("wordPairs.syllableNPlus",{n:Pe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:p!=null?Pe!==p:!s.min}],allOption:!0,allOptionDisabled:p!=null})}return t.choseong?C.push({label:r.exclude,displayLabel:r.selectLabel,multiple:!0,items:[r.excludeImage,r.sameStructure],labelInfo:g(f)}):C.push({label:r.exclude,displayLabel:r.selectLabel,multiple:!0,items:[r.excludeImage],labelInfo:g([f[0]])}),C}const bo=e=>Array.isArray(e)?e.filter(Ds):[],Ic="wt_filter",yu=e=>`wt_filter_${e}`,So=["noun","verb","modifier"],wo=["native","sino","foreign","mixed"];function bu(e,t,n,o,r){if(!Array.isArray(e))return[];const u=[];for(const a of e){if(typeof a!="string")continue;const i=t.includes(a)?a:t.find(s=>r.some(c=>o(c,n(s))===a));i&&!u.includes(i)&&u.push(i)}return u}function Su(e){try{const t=localStorage.getItem(yu(e))??localStorage.getItem(Ic);if(t)return JSON.parse(t)}catch{}return null}function wu(e){const t=e?.phonemeView;return t==="pron"?"pron":t==="direct"?"direct":"char"}function Mc(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?{...yo,cho:t.choseong}:yo}function Pc(e,t,n){const{t:o,i18n:r}=Re.useTranslation(),[u]=d.useState(()=>n?.resetOnMount?null:Su(e)),[a,i]=d.useState(wu(u)),[s,c]=d.useState(()=>Mc(u)),g=d.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:Me,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?Me:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);d.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||c(D=>D.cho||D.jung||D.syllable!=null||D.jong?D:g())},[]);const f=d.useMemo(()=>ce(s.cho)||ce(s.jung)||ce(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),C=d.useRef(a==="char"?s.jung:null),p=d.useRef(a==="char"?s.jong:null);d.useEffect(()=>{a==="char"&&(C.current=s.jung,p.current=s.jong)},[a,s.jung,s.jong]);const[h,w]=d.useState(n?.resetOnMount?!!n?.defaultImageOnly:u?.excludeNoImage??!0),[y,b]=d.useState(n?.resetOnMount?!1:u?.sameStructureOnly??!0),[S,E]=d.useState(bo(u?.gradeFilter)),A=Array.from(new Set([r.language,"ko","en"].filter(Boolean))),N=(D,U)=>r.getFixedT(D)(U),I=D=>bu(D,So,U=>`wordSearch.filter.pos.${U}`,N,A),B=D=>bu(D,wo,U=>`wordSearch.filter.type.${U}`,N,A),[L,P]=d.useState(()=>I(u?.posFilter)),[v,W]=d.useState(()=>B(u?.wordTypeFilter)),X=d.useRef(n?.resetKey);d.useEffect(()=>{X.current!==n?.resetKey&&(X.current=n?.resetKey,c(g()),w(!!n?.defaultImageOnly),b(!1),E([]),P([]),W([]))},[n?.resetKey]);const $=du(),F=d.useMemo(()=>Object.keys($.posMap),[$]),x=d.useMemo(()=>Object.keys($.typeMap),[$]),Y=d.useMemo(()=>L.map(D=>F[So.indexOf(D)]).filter(Boolean),[L,F]),pe=d.useMemo(()=>v.map(D=>x[wo.indexOf(D)]).filter(Boolean),[v,x]),se=1,he=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length),[R,j]=d.useState(e);d.useEffect(()=>{if(R!==e){if(!n?.resetOnMount){const D=Su(e);c(D?.composition??g()),w(D?.excludeNoImage??!0),b(D?.sameStructureOnly??!0),i(wu(D)),E(bo(D?.gradeFilter)),P(I(D?.posFilter)),W(B(D?.wordTypeFilter))}j(e)}},[e,R,n?.resetOnMount]),d.useEffect(()=>{if(!n?.resetOnMount&&R===e)try{localStorage.setItem(yu(e),JSON.stringify({contrastCount:he,composition:s,excludeNoImage:h,sameStructureOnly:y,phonemeView:a,gradeFilter:S,posFilter:L,wordTypeFilter:v}))}catch{}},[n?.resetOnMount,e,R,he,s,h,y,a,S,L,v]);const{viable:M,viableReady:K,wordCount:G,poolVersion:ke}=wc({caps:t,difficulty:f,contrastCount:he,composition:s,phonemeView:a,excludeNoImage:h,sameStructureOnly:y,gradeFilter:S});d.useEffect(()=>{K&&c(D=>{const U={...D};let V=!1;return["cho","jung","jong"].forEach(q=>{const le=D[q];!le||le===Me||He(le).some(Xt=>M[q].has(Xt))||(U[q]=null,V=!0)}),D.syllable!=null&&t.fixedSyllable==null&&(D.syllable>=Pe?[...M.syllable].some(q=>q>=Pe)||(U.syllable=null,V=!0):(!M.syllable.has(D.syllable)||D.syllable<se)&&(U.syllable=null,V=!0)),V?U:D})},[M,K,se,t.fixedSyllable]);const Ke=d.useMemo(()=>{const D=U=>{const V=new Set;for(const q of au[U])M[U].has(q)&&V.add(q);return V};return{cho:D("cho"),jung:D("jung"),jong:D("jong")}},[M]),Ge=d.useMemo(()=>({exact:new Set(ru.filter(D=>M.syllable.has(D))),min:[...M.syllable].some(D=>D>=Pe)}),[M]),Z=d.useMemo(()=>Lc(o),[o]),Kt=d.useMemo(()=>({[Z.trainOnset]:"cho",[Z.trainVowel]:"jung",[Z.trainCoda]:"jong"}),[Z]),On=d.useMemo(()=>Rc({caps:t,t:o,attrKeys:$,labels:Z,phonemeView:a,viable:M,partViable:Ke,syllableViable:Ge,minSyllables:se}),[t,o,$,Z,a,M,Ke,Ge,se]),qt={...(t.choseong||t.fixedSyllable!=null)&&s.syllable!=null?{[Z.syllableCount]:Co(s.syllable)}:{},...t.choseong&&s.cho?{[Z.trainOnset]:s.cho}:{},...t.choseong&&s.jung?{[Z.trainVowel]:s.jung}:{},...t.choseong&&s.jong?{[Z.trainCoda]:s.jong}:{},[Z.exclude]:[...h?[Z.excludeImage]:[],...y?[Z.sameStructure]:[]],[Z.gradeLabel]:S.map(D=>Ps("grade",D)),...t.partOfSpeech?{[$.partOfSpeech]:Y}:{},...t.wordType?{[$.wordType]:pe}:{}},Ln=d.useCallback((D,U)=>{if(U===Z.exclude)D===Z.excludeImage?w(V=>!V):D===Z.sameStructure&&b(V=>!V);else if(U===Z.syllableCount)c(V=>{if(!D||D===Ie)return{...V,syllable:null};const q=bc(D);return{...V,syllable:V.syllable===q?null:q}});else if(U===Z.gradeLabel){if(!D||D===Ie){E([]);return}const V=tt("grade",D);if(V==null)return;E(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else if(U===$.partOfSpeech){if(!D||D===Ie){P([]);return}const V=So[F.indexOf(D)]??I([D])[0];if(!V)return;P(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else if(U===$.wordType){if(!D||D===Ie){W([]);return}const V=wo[x.indexOf(D)]??B([D])[0];if(!V)return;W(q=>q.includes(V)?q.filter(le=>le!==V):[...q,V])}else{const V=Kt[U];if(!V)return;c(q=>t.requireSyllable?D&&D!==Ie?{...q,[V]:D}:q:!D||D===Ie||q[V]===D?{...q,[V]:null}:{...q,[V]:D})}},[Z,Kt,$,F,x,t.requireSyllable]),Jt=d.useCallback(D=>!t.partOfSpeech&&!t.wordType?!0:Oc(D,{...t.partOfSpeech?{[$.partOfSpeech]:Y}:{},...t.wordType?{[$.wordType]:pe}:{}},$),[t.partOfSpeech,t.wordType,Y,pe,$]),ee=d.useCallback(D=>{D!==a&&(D!=="direct"&&a!=="direct"&&c(U=>cu(U,D,C.current,p.current)),i(D))},[a]),gt=d.useCallback(()=>({composition:s,contrastCount:he,excludeNoImage:h,sameStructureOnly:y,phonemeView:a,gradeFilter:S,posFilter:L,wordTypeFilter:v}),[s,he,h,y,a,S,L,v]),te=d.useCallback(D=>{c(D.composition),w(D.excludeNoImage),b(D.sameStructureOnly??!0),i(D.phonemeView),E(bo(D.gradeFilter)),Array.isArray(D.posFilter)&&P(I(D.posFilter)),Array.isArray(D.wordTypeFilter)&&W(B(D.wordTypeFilter))},[]);return{difficulty:f,contrastCount:he,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:y,gradeFilter:S,posFilter:Y,wordTypeFilter:pe,matchesWordAttributes:Jt,poolVersion:ke,filterSections:On,filterSelected:qt,handleFilterSelect:Ln,phonemeView:a,setPhonemeView:ee,phonemeGroupLabel:Z.phonemeGroup,wordCount:G,getFilterSnapshot:gt,restoreFilterSnapshot:te}}function kc(e){const t=i=>i?He(i):null,n=t(e.cho),o=t(e.jung),r=e.jong===Me,u=r?null:t(e.jong),a=e.syllable!=null?mo(e.syllable):null;return!n&&!o&&!u&&!r&&!a?null:{cho:n,jung:o,jong:u,jongNone:r,syllable:a}}function xc(e,t,n,o,r,u,a=!0,i="char",s=[]){const[c,g]=d.useState({}),[f,C]=d.useState(!1),{cho:p=null,jung:h=null,jong:w=null,syllable:y=null}=o??{},b=s.length>0?s.slice().sort().join(","):"",S=e.map(A=>A.key).join("|");d.useEffect(()=>{u>0&&ic(r).catch(()=>{})},[u,r]),d.useEffect(()=>{let A=!1;return C(!0),(async()=>{const N=kc({cho:p,jung:h,jong:w,syllable:y}),I=`${p??""}_${h??""}_${w??""}_${y??""}_${b}`,B={};await Promise.all(e.map(async L=>{const P=qn[L.key];try{const v=await tu(L.key,{difficulty:P.difficulty?t:null,contrastCount:P.difficulty?n:1,composition:P.choseong?N:null,count:5,excludeNoImage:r,sameStructureOnly:a,phonemeView:i,grade:s.length>0?s:null});v&&v.length>0?B[L.key]={id:`wt-${L.key}-${t}-${I}-${Date.now()}`,name:L.label,training_type:L.key,category_main_code:"WORD",iconColor:L.color,subTitle:L.subTitle,items:v,itemCount:v.length}:B[L.key]={id:`wt-${L.key}-empty`,name:L.label,training_type:L.key,category_main_code:"WORD",iconColor:L.color,subTitle:L.subTitle,items:[],itemCount:0,__empty:!0}}catch{B[L.key]=null}})),A||(g(B),C(!1))})(),()=>{A=!0}},[t,n,p,h,w,y,r,a,i,u,b,S]);const E=JSON.stringify(e.map(A=>[A.key,A.label,A.color,A.subTitle]));return{perTypeData:d.useMemo(()=>{const A={};for(const[N,I]of Object.entries(c)){const B=e.find(L=>L.key===N);A[N]=I&&B?{...I,name:B.label,iconColor:B.color,subTitle:B.subTitle}:I}return A},[c,E]),generating:f}}const Pt=[],kt=[],xt=[],Ft=[],En={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},An={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Fc={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Eo=null,Eu=null,$e=null;function jc({counts:e,forceRefresh:t}={}){const n=Object.assign({},Fc,e||{}),o=bt(),r=St(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),u=JSON.stringify(n);if(!t&&Eu===o&&Eo===u&&$e)return Object.assign(En,$e.today),Object.assign(An,$e.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:En,yesterday:An};const a={LISTEN_IN_NOISE:xe(Pt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:xe(kt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:xe(xt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:xe(Ft,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let i=null;return $e&&Eo===u&&$e.yesterday&&$e.yesterday.date===r&&(i=$e.yesterday.selection),i||(i={LISTEN_IN_NOISE:xe(Pt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:xe(kt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:xe(xt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:xe(Ft,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(En,a),Object.assign(An,i),Eu=o,Eo=u,$e={today:a,yesterday:{date:r,countsKey:u,selection:i}},{today:En,yesterday:An}}let Ao=!1,jt=null;async function Hc(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Yn&&Yn.tagName.toUpperCase()==="SCRIPT"&&Yn.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 $c(){if(!Ao)return jt||(jt=(async()=>{const e=await Hc();if(!e){jt=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const t={noise:[],short:[],long:[],order:[]};try{if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid training data map");for(const n of Object.keys(e)){const o=e[n];if(!Array.isArray(o))throw new Error("Invalid training data group");for(const r of o){if(!r||typeof r!="object")continue;const u=r,a=String(u.training_type||n),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:a,category_0:i,category_1:s});a==="LISTEN_IN_NOISE"?t.noise.push(c):a==="SHORT_STORY"?t.short.push(c):a==="LONG_STORY"?t.long.push(c):a==="ORDERING_SENTENCE"&&t.order.push(c)}}}catch{jt=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}Pt.push(...t.noise),kt.push(...t.short),xt.push(...t.long),Ft.push(...t.order),Ao=!0,$e=null;try{jc()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),jt)}async function Gc(e=3e3){const t=$c();let n;try{await Promise.race([t,new Promise(o=>{n=setTimeout(o,e)})])}finally{n!==void 0&&clearTimeout(n)}return Ao}function Au(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 Wc(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 Vc=xe,Yc=e=>{const[t,n,o]=e.split("-").map(Number);return Math.round(Date.UTC(t,(n||1)-1,o||1)/864e5)},Uc=(e,t)=>{const n=e??{};return String(n.id??n.name??t)};function _n(e,t,n,o,r){if(!e.length||t<=0)return[];const u=Wc(Au(`${n}|${o}|${r}`)),a=Yc(o)&1,i=e.filter((c,g)=>(Au(`${n}|${r}|${Uc(c,g)}`)>>>7&1)===a),s=i.length>=t&&e.length-i.length>=t;return Vc(s?i:e,t,u)}function _o(e,t,n){const o=r=>Math.max(0,e[r]||0);return{LISTEN_IN_NOISE:_n(Pt,o("LISTEN_IN_NOISE"),t,n,"LISTEN_IN_NOISE"),SHORT_STORY:_n(kt,o("SHORT_STORY"),t,n,"SHORT_STORY"),LONG_STORY:_n(xt,o("LONG_STORY"),t,n,"LONG_STORY"),ORDERING_SENTENCE:_n(Ft,o("ORDERING_SENTENCE"),t,n,"ORDERING_SENTENCE")}}function To(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const zc={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Do(e=!1,t=zc,n){const o=Date.now(),r=St(o),u=St(o-864e5),a=n??"";return Pt.length>0||kt.length>0||xt.length>0||Ft.length>0?{today:_o(t,a,r),yesterday:_o(t,a,u)}:{today:_o(t,a,r),yesterday:null}}function Kc(e){const t=d.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=d.useRef(null),[o,r]=d.useState(!1),[u,a]=d.useState(!1),[i,s]=d.useState(0),[c,g]=d.useState(!1),[f,C]=d.useState(()=>bt()),p=JSON.stringify([e??"",f]),h=d.useRef(null),w=d.useRef(p);d.useEffect(()=>{const b=()=>{const E=Date.now(),A=new Date(E+9*36e5),N=Date.UTC(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()+1)-9*36e5;return Math.max(1e3,N-E+1e3)};let S=setTimeout(function E(){C(bt()),S=setTimeout(E,b())},b());return()=>clearTimeout(S)},[]),d.useEffect(()=>{w.current=p,h.current=null,r(!1),g(!1);let b=!1,S=!1,E=!1,A,N=0,I=null,B=0;const L=40,P=()=>{A!==void 0&&(clearInterval(A),A=void 0)};let v=!1;try{const x=new URLSearchParams(window.location.search),Y=x.get("forceRefresh")||x.get("force");v=Y==="1"||Y==="true"}catch{}const W=x=>{S||(E=!0,h.current=p,t.current=x.today,n.current=x.yesterday,r(!0),g(!0),s(Y=>Y+1),b=!0,P())},X=async()=>{if(b)return;if(!v){const Y=Do(!1,void 0,e);if(To(Y.today)){W(Y);return}}if(I){++N>=L&&$();return}if(N>=B){B=N+8,I=Gc(3e3).catch(()=>!1);try{await I}finally{I=null}if(b)return}const x=Do(v,void 0,e);if(To(x.today)){W(x);return}++N>=L&&$()};function $(){r(!0),g(!1),b=!0,P()}const F=()=>{if(S||E)return;const x=Do(v,void 0,e);To(x.today)&&W(x)};try{window.addEventListener("speechear.data.updated",F)}catch{}return A=setInterval(X,250),X(),()=>{b=!0,S=!0,P();try{window.removeEventListener("speechear.data.updated",F)}catch{}}},[e,f]);const y=d.useCallback(b=>{if(h.current!==p)return;const S=u?n.current:t.current,E=u?t.current:n.current;return S?.[b]?.length?S[b]:E?.[b]?.length?E[b]:void 0},[u,i,p]);return{loaded:w.current===p&&o,hasData:w.current===p&&c,showYesterday:u,setShowYesterday:a,getTrainingPerType:y}}const pt=[];let Tn=!1;function _u(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=pt[pt.length-1];t&&(e.stopPropagation(),t())}function Tu(e){return pt.push(e),!Tn&&typeof document<"u"&&(document.addEventListener("keydown",_u),Tn=!0),()=>{const t=pt.lastIndexOf(e);t>=0&&pt.splice(t,1),pt.length===0&&Tn&&typeof document<"u"&&(document.removeEventListener("keydown",_u),Tn=!1)}}function qc(e,t=!0){const n=Cr(e);d.useEffect(()=>{if(t)return Tu(()=>{n.current?.()})},[t,n])}const Bo=(e,t)=>`${e}:${t??1}`,Ht=new Map,No=new Set,vo=new Map,Dn=6e4;function Jc(e,t){const[n,o]=d.useState(0),[r,u]=d.useState(0),a=JSON.stringify(Array.from(new Set(e.map(i=>Bo(i.word,i.homonum)))).sort());return d.useEffect(()=>{const i=JSON.parse(a),s=Date.now(),c=i.filter(w=>!Ht.has(w)&&!No.has(w)&&!(s-(vo.get(w)??-1/0)<Dn));let g=!1,f=null,C=1/0;const p=(w=Dn)=>{if(g)return;const y=Date.now()+w;y>=C||(f!==null&&clearTimeout(f),C=y,f=setTimeout(()=>u(b=>b+1),w))};for(const w of i){if(Ht.has(w)||No.has(w))continue;const y=vo.get(w);y!=null&&s-y<Dn&&p(Math.max(0,Dn-(s-y)))}if(c.length===0)return()=>{g=!0,f!==null&&clearTimeout(f)};const h=Array.from(new Set(c.map(w=>w.slice(0,w.lastIndexOf(":")))));return Promise.resolve().then(()=>t(h)).then(w=>{for(const y of w)y.Meaning&&Ht.set(Bo(y.Word,y.Homonum??void 0),y.Meaning);if(w.length>0)for(const y of c)Ht.has(y)||No.add(y);else{const y=Date.now();for(const b of c)vo.set(b,y);p()}g||w.length===0||o(y=>y+1)}).catch(()=>{p()}),()=>{g=!0,f!==null&&clearTimeout(f)}},[a,t,r]),d.useMemo(()=>{const i=JSON.parse(a),s=new Map;for(const c of i){const g=Ht.get(c);g!=null&&s.set(c,g)}return s},[a,n])}function Xc(){const[e,t]=d.useState(null),n=d.useCallback(u=>t(u.getBoundingClientRect()),[]),o=d.useCallback(()=>t(null),[]),r=d.useCallback(u=>{const a=u.getBoundingClientRect();t(i=>i?null:a)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:r}}function Qc(e){const[t,n]=d.useState(null),[o,r]=d.useState(null),u=d.useRef(null);d.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const a=d.useCallback((s,c)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{n(s),r(c)},e)},[e]),i=d.useCallback(()=>{u.current&&clearTimeout(u.current),n(null),r(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:a,close:i}}function Zc(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,r=Math.max(1,Math.ceil(e.length/o)),u=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),r):1;return{pageItems:d.useMemo(()=>e.slice((u-1)*o,u*o),[e,u,o]),totalPages:r,curPage:u}}function Du(e,t){const[n,o]=d.useState(e);n!==e&&(o(e),t(1))}function ed(e={}){const{defaultPageSize:t="25",resetOn:n}=e,[o,r]=d.useState(""),[u,a]=d.useState(t),[i,s]=d.useState(1),c=C=>{const p=Number(C);return Number.isFinite(p)&&p>=1?Math.floor(p):null},g=c(t)??25,f=c(u)??g;return Du(JSON.stringify([o,u,...n??[]]),s),{query:o,setQuery:r,pageSize:u,setPageSize:a,perPage:f,page:i,setPage:s}}function td(e="warning"){const[t,n]=d.useState(""),[o,r]=d.useState(e),[u,a]=d.useState(0),i=d.useCallback((f,C)=>{r(C),n(f),a(p=>p+1)},[]),s=d.useCallback(f=>i(f,"warning"),[i]),c=d.useCallback(f=>i(f,"normal"),[i]),g=d.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:u,showToast:i,showWarning:s,showNormal:c,clearToast:g}}const nd=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"audio-lines",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."}],od={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function rd(e){return nd.map(t=>{const n=od[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}const $t={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},Gt=$t.blue,Bn=$t.green,Wt=$t.amber,Nn=$t.purple,ud=$t.pink,ad=[{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:Gt,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:Gt,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:Gt,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:Gt,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:Gt,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:Bn,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:Bn,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:Bn,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:Bn,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:Wt,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:Wt,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:Wt,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:Wt,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:Wt,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:Nn,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:Nn,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:Nn,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:Nn,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:ud,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function ld(){const{t:e}=Re.useTranslation();return d.useMemo(()=>{const t=Object.fromEntries(rd(e).map(o=>[o.key,o.label])),n={...t};return ad.flatMap(o=>o.types).forEach(o=>{n[o.key]=e(`trainingType.${o.key}.label`,{defaultValue:o.label})}),{sentence:t,all:n}},[e])}function id({computeStyle:e,onScroll:t="close",onResize:n="close",ignoreOutsideClickSelector:o}){const[r,u]=d.useState(!1),[a,i]=d.useState({position:"fixed"}),s=d.useRef(null),c=d.useRef(null),g=d.useCallback(()=>{s.current&&i(e(s.current.getBoundingClientRect(),s.current))},[e]);d.useLayoutEffect(()=>{r&&g()},[r,g]),d.useEffect(()=>{if(!r)return;let p=c.current?.offsetHeight??0;p>0&&g();let h=0,w=null;typeof ResizeObserver<"u"&&c.current&&(w=new ResizeObserver(()=>{const B=c.current?.offsetHeight??0;if(B!==p){if(p=B,++h>4){w?.disconnect(),w=null;return}g()}}),w.observe(c.current));const y=B=>{const L=B.target;o&&L.closest?.(o)||s.current?.contains(L)||c.current?.contains(L)||u(!1)};document.addEventListener("mousedown",y),document.addEventListener("pointerdown",y);let b=null;const S=()=>{if(typeof requestAnimationFrame>"u"){g();return}b===null&&(b=requestAnimationFrame(()=>{b=null,g()}))},E=B=>{c.current?.contains(B.target)||(t==="reposition"?S():t==="close"&&u(!1))};t!=="ignore"&&window.addEventListener("scroll",E,!0);const A=()=>{n==="reposition"?S():n==="close"&&u(!1)};let N=null;const I=()=>{A(),N&&clearTimeout(N),N=setTimeout(()=>{N=null,n==="reposition"&&g()},250)};return n!=="ignore"&&(window.addEventListener("resize",A),window.addEventListener("orientationchange",I)),()=>{b!==null&&cancelAnimationFrame(b),w?.disconnect(),document.removeEventListener("mousedown",y),document.removeEventListener("pointerdown",y),t!=="ignore"&&window.removeEventListener("scroll",E,!0),n!=="ignore"&&(window.removeEventListener("resize",A),window.removeEventListener("orientationchange",I)),N&&clearTimeout(N)}},[r,g,t,n,o]),d.useEffect(()=>{if(r)return Tu(()=>u(!1))},[r]);const f=d.useCallback(()=>u(p=>!p),[]),C=d.useCallback(()=>u(!1),[]);return{open:r,setOpen:u,toggle:f,close:C,style:a,triggerRef:s,menuRef:c}}function sd(e,{mode:t="playback",autoStart:n=!1,onPlaySpeaker:o,onComplete:r,playMs:u=1100,feedbackMs:a=1500}={}){const[i,s]=d.useState([]),[c,g]=d.useState(0),[f,C]=d.useState("idle"),[p,h]=d.useState(null),[w,y]=d.useState([]),[b,S]=d.useState(null),[E,A]=d.useState(0),N=d.useRef(0),I=d.useCallback(M=>{N.current=typeof M=="function"?M(N.current):M,A(N.current)},[]),B=d.useRef(o),L=d.useRef(r);d.useEffect(()=>{B.current=o,L.current=r},[o,r]);const P=d.useRef([]),v=()=>{P.current.forEach(clearTimeout),P.current=[]},W=(M,K)=>{P.current.push(setTimeout(K,M))};d.useEffect(()=>()=>v(),[]);const X=i[c]?.id??null,$=d.useRef(null),F=d.useCallback(()=>{v(),C("playing"),y([]),S(null),I(0);let M=0;e.forEach((K,G)=>{W(M,()=>{g(G),h(K.id),B.current?.(K)}),W(M+1e3,()=>{h(null),y(ke=>[...ke,K.id])}),M+=1300}),W(M,()=>{C("done"),L.current?.({score:0,total:e.length})})},[e,I]),x=d.useCallback((M,K)=>{if(K>=M.length){C("done"),L.current?.({score:N.current,total:M.length});return}$.current=null,g(K),S(null),C("playing"),h(M[K].id),B.current?.(M[K]),W(u,()=>{h(null),C("waiting")})},[u]),Y=d.useCallback(()=>{v();const M=J(e);s(M),I(0),y([]),x(M,0)},[e,x,I]),pe=d.useCallback(()=>{t==="playback"?(s(e),F()):Y()},[t,e,F,Y]),se=d.useCallback(()=>{v(),C("idle"),h(null),y([]),S(null),g(0),I(0),s([])},[I]),he=JSON.stringify(e.map(M=>[M.id,M.label,M.angleDeg,M.deg,M.row,M.shortcut]));d.useEffect(()=>(n?pe():se(),()=>v()),[t,he,n]);const R=d.useCallback(M=>{f!=="waiting"||t==="playback"||$.current===c||($.current=c,S(M),M===i[c]?.id&&I(K=>K+1),t==="exam"?(C("playing"),W(400,()=>x(i,c+1))):(C("feedback"),W(a,()=>x(i,c+1))))},[f,t,i,c,x,a,I]),j=t==="playback"?e.length:i.length;return{bind:{activeSpeakerId:p,playedIds:w,selectedId:b,answerId:X,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:R},index:c,total:j,score:E,phase:f,done:f==="done",start:pe,reset:se}}/*! @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 Bu(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 cd(e){if(Array.isArray(e))return e}function dd(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,u,a,i=[],s=!0,c=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(s=(o=u.call(n)).done)&&(i.push(o.value),i.length!==t);s=!0);}catch(g){c=!0,r=g}finally{try{if(!s&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}function fd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
6
6
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pd(e,t){return cd(e)||dd(e,t)||Cd(e,t)||fd()}function Cd(e,t){if(e){if(typeof e=="string")return Bu(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)?Bu(e,t):void 0}}const Nu=Object.entries,vu=Object.setPrototypeOf,md=Object.isFrozen,gd=Object.getPrototypeOf,hd=Object.getOwnPropertyDescriptor;let ae=Object.freeze,ie=Object.seal,Ct=Object.create,Ou=typeof Reflect<"u"&&Reflect,Oo=Ou.apply,Lo=Ou.construct;ae||(ae=function(t){return t}),ie||(ie=function(t){return t}),Oo||(Oo=function(t,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),u=2;u<o;u++)r[u-2]=arguments[u];return t.apply(n,r)}),Lo||(Lo=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return new t(...o)});const nt=ue(Array.prototype.forEach),yd=ue(Array.prototype.lastIndexOf),Lu=ue(Array.prototype.pop),Vt=ue(Array.prototype.push),bd=ue(Array.prototype.splice),mt=Array.isArray,Yt=ue(String.prototype.toLowerCase),Ro=ue(String.prototype.toString),Ru=ue(String.prototype.match),Ut=ue(String.prototype.replace),Iu=ue(String.prototype.indexOf),Sd=ue(String.prototype.trim),wd=ue(Number.prototype.toString),Ed=ue(Boolean.prototype.toString),Mu=typeof BigInt>"u"?null:ue(BigInt.prototype.toString),Pu=typeof Symbol>"u"?null:ue(Symbol.prototype.toString),we=ue(Object.prototype.hasOwnProperty),zt=ue(Object.prototype.toString),ge=ue(RegExp.prototype.test),ot=Ad(TypeError);function ue(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return Oo(e,t,o)}}function Ad(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Lo(e,n)}}function z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yt;if(vu&&vu(e,null),!mt(t))return e;let o=t.length;for(;o--;){let r=t[o];if(typeof r=="string"){const u=n(r);u!==r&&(md(t)||(t[o]=u),r=u)}e[r]=!0}return e}function _d(e){for(let t=0;t<e.length;t++)we(e,t)||(e[t]=null);return e}function _e(e){const t=Ct(null);for(const o of Nu(e)){var n=pd(o,2);const r=n[0],u=n[1];we(e,r)&&(mt(u)?t[r]=_d(u):u&&typeof u=="object"&&u.constructor===Object?t[r]=_e(u):t[r]=u)}return t}function Td(e){switch(typeof e){case"string":return e;case"number":return wd(e);case"boolean":return Ed(e);case"bigint":return Mu?Mu(e):"0";case"symbol":return Pu?Pu(e):"Symbol()";case"undefined":return zt(e);case"function":case"object":{if(e===null)return zt(e);const t=e,n=ve(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:zt(o)}return zt(e)}default:return zt(e)}}function ve(e,t){for(;e!==null;){const o=hd(e,t);if(o){if(o.get)return ue(o.get);if(typeof o.value=="function")return ue(o.value)}e=gd(e)}function n(){return null}return n}function Dd(e){try{return ge(e,""),!0}catch{return!1}}const ku=ae(["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"]),Io=ae(["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"]),Mo=ae(["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"]),Bd=ae(["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"]),Po=ae(["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"]),Nd=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xu=ae(["#text"]),Fu=ae(["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"]),ko=ae(["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"]),ju=ae(["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"]),vn=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vd=ie(/{{[\w\W]*|^[\w\W]*}}/g),Od=ie(/<%[\w\W]*|^[\w\W]*%>/g),Ld=ie(/\${[\w\W]*/g),Rd=ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),Id=ie(/^aria-[\-\w]+$/),Hu=ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Md=ie(/^(?:\w+script|data):/i),Pd=ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kd=ie(/^html$/i),xd=ie(/^[a-z][.\w]*(-[.\w]+)+$/i),$u=ie(/<[/\w!]/g),Gu=ie(/<[/\w]/g),Fd=ie(/<\/no(script|embed|frames)/i),jd=ie(/\/>/i),Te={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wu=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Hd=ae(z({},Wu)),$d=(function(){const e={};return nt(Wu,t=>{e[t]=ie(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ae(e)})(),Gd=function(){return typeof window>"u"?null:window},Wd=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(o=n.getAttribute(r));const u="dompurify"+(o?"#"+o:"");try{return t.createPolicy(u,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Vu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ze=function(t,n,o,r){return we(t,n)&&mt(t[n])?z(r.base?_e(r.base):{},t[n],r.transform):o},xo=function(t,n,o){const r=we(t,n)?t[n]:void 0;return r&&typeof r=="object"?_e(r):o()};function Yu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gd();const t=T=>Yu(T);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Te.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,r=o.currentScript;e.DocumentFragment;const u=e.HTMLTemplateElement,a=e.Node,i=e.Element,s=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const g=e.DOMParser,f=e.trustedTypes,C=i.prototype,p=ve(C,"cloneNode"),h=ve(C,"remove"),w=ve(C,"nextSibling"),y=ve(C,"childNodes"),b=ve(C,"parentNode"),S=ve(C,"shadowRoot"),E=ve(C,"attributes"),A=a&&a.prototype?ve(a.prototype,"nodeType"):null,N=a&&a.prototype?ve(a.prototype,"nodeName"):null,I=a&&a.prototype?ve(a.prototype,"ownerDocument"):null,B=function(l){return A?A(l):l.nodeType},L=function(l){return N?N(l):l.nodeName};if(typeof u=="function"){const T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}let P,v="",W,X=!1,$=0;const F=function(){if($>0)throw ot('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(l){F(),$++;try{return P.createHTML(l)}finally{$--}},Y=function(l){F(),$++;try{return P.createScriptURL(l)}finally{$--}},pe=function(){return X||(W=Wd(f,r),X=!0),W},se=n,he=se.implementation,R=se.createNodeIterator,j=se.createDocumentFragment,M=se.getElementsByTagName,K=o.importNode;let G=Vu();t.isSupported=typeof Nu=="function"&&typeof b=="function"&&he&&he.createHTMLDocument!==void 0;const ke=vd,Ke=Od,Ge=Ld,Z=Rd,Kt=Id,On=Md,qt=Pd,Ln=xd;let Jt=Hu,ee=null;const gt=z({},[...ku,...Io,...Mo,...Po,...xu]);let te=null;const D=z({},[...Fu,...ko,...ju,...vn]);let U=Object.seal(Ct(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}})),V=null,q=null;const le=Object.seal(Ct(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Xt=!0,Rn=!0,Ho=!1,$o=!0,We=!1,qe=!0,Je=!1,In=!1,Qt=null,Zt=null,Mn=!1,rt=!1,en=!1,tn=!1,Go=!0,Wo=!1;const Vo="user-content-";let Pn=!0,kn=!1,ut={},at=null;const Yo=z({},["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 Uo=null;const zo=z({},["audio","video","img","source","image","track"]);let Ko=null;const qo=z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nn="http://www.w3.org/1998/Math/MathML",on="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let lt=Oe,xn=!1,Fn=null;const zu=z({},[nn,on,Oe],Ro),Jo=ae(["mi","mo","mn","ms","mtext"]);let jn=z({},Jo);const Xo=ae(["annotation-xml"]);let Hn=z({},Xo);const Ku=z({},["title","style","font","a","script"]);let ht=null;const qu=["application/xhtml+xml","text/html"],Ju="text/html";let re=null,it=null;const Xu=n.createElement("form"),Qo=function(l){return l instanceof RegExp||l instanceof Function},$n=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(it&&it===l)return;(!l||typeof l!="object")&&(l={}),l=_e(l),ht=qu.indexOf(l.PARSER_MEDIA_TYPE)===-1?Ju:l.PARSER_MEDIA_TYPE,re=ht==="application/xhtml+xml"?Ro:Yt,ee=ze(l,"ALLOWED_TAGS",gt,{transform:re}),te=ze(l,"ALLOWED_ATTR",D,{transform:re}),Fn=ze(l,"ALLOWED_NAMESPACES",zu,{transform:Ro}),Ko=ze(l,"ADD_URI_SAFE_ATTR",qo,{transform:re,base:qo}),Uo=ze(l,"ADD_DATA_URI_TAGS",zo,{transform:re,base:zo}),at=ze(l,"FORBID_CONTENTS",Yo,{transform:re}),V=ze(l,"FORBID_TAGS",_e({}),{transform:re}),q=ze(l,"FORBID_ATTR",_e({}),{transform:re}),ut=we(l,"USE_PROFILES")?l.USE_PROFILES&&typeof l.USE_PROFILES=="object"?_e(l.USE_PROFILES):l.USE_PROFILES:!1,Xt=l.ALLOW_ARIA_ATTR!==!1,Rn=l.ALLOW_DATA_ATTR!==!1,Ho=l.ALLOW_UNKNOWN_PROTOCOLS||!1,$o=l.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=l.SAFE_FOR_TEMPLATES||!1,qe=l.SAFE_FOR_XML!==!1,Je=l.WHOLE_DOCUMENT||!1,rt=l.RETURN_DOM||!1,en=l.RETURN_DOM_FRAGMENT||!1,tn=l.RETURN_TRUSTED_TYPE||!1,Mn=l.FORCE_BODY||!1,Go=l.SANITIZE_DOM!==!1,Wo=l.SANITIZE_NAMED_PROPS||!1,Pn=l.KEEP_CONTENT!==!1,kn=l.IN_PLACE||!1,Jt=Dd(l.ALLOWED_URI_REGEXP)?l.ALLOWED_URI_REGEXP:Hu,lt=typeof l.NAMESPACE=="string"?l.NAMESPACE:Oe,jn=xo(l,"MATHML_TEXT_INTEGRATION_POINTS",()=>z({},Jo)),Hn=xo(l,"HTML_INTEGRATION_POINTS",()=>z({},Xo));const m=xo(l,"CUSTOM_ELEMENT_HANDLING",()=>Ct(null));if(U=Ct(null),we(m,"tagNameCheck")&&Qo(m.tagNameCheck)&&(U.tagNameCheck=m.tagNameCheck),we(m,"attributeNameCheck")&&Qo(m.attributeNameCheck)&&(U.attributeNameCheck=m.attributeNameCheck),we(m,"allowCustomizedBuiltInElements")&&typeof m.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=m.allowCustomizedBuiltInElements),ie(U),We&&(Rn=!1),en&&(rt=!0),ut&&(ee=z({},xu),te=Ct(null),ut.html===!0&&(z(ee,ku),z(te,Fu)),ut.svg===!0&&(z(ee,Io),z(te,ko),z(te,vn)),ut.svgFilters===!0&&(z(ee,Mo),z(te,ko),z(te,vn)),ut.mathMl===!0&&(z(ee,Po),z(te,ju),z(te,vn))),le.tagCheck=null,le.attributeCheck=null,we(l,"ADD_TAGS")&&(typeof l.ADD_TAGS=="function"?le.tagCheck=l.ADD_TAGS:mt(l.ADD_TAGS)&&(ee===gt&&(ee=_e(ee)),z(ee,l.ADD_TAGS,re))),we(l,"ADD_ATTR")&&(typeof l.ADD_ATTR=="function"?le.attributeCheck=l.ADD_ATTR:mt(l.ADD_ATTR)&&(te===D&&(te=_e(te)),z(te,l.ADD_ATTR,re))),we(l,"ADD_FORBID_CONTENTS")&&mt(l.ADD_FORBID_CONTENTS)&&(at===Yo&&(at=_e(at)),z(at,l.ADD_FORBID_CONTENTS,re)),Pn&&(ee["#text"]=!0),Je&&z(ee,["html","head","body"]),ee.table&&(z(ee,["tbody"]),delete V.tbody),l.TRUSTED_TYPES_POLICY){if(typeof l.TRUSTED_TYPES_POLICY.createHTML!="function")throw ot('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof l.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ot('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _=P;P=l.TRUSTED_TYPES_POLICY;try{v=x("")}catch(O){throw P=_,O}}else l.TRUSTED_TYPES_POLICY===null?(P=void 0,v=""):(P===void 0&&(P=pe()),P&&typeof v=="string"&&(v=x("")));ae&&ae(l),it=l},Zo=z({},[...Io,...Mo,...Bd]),er=z({},[...Po,...Nd]),Qu=function(l,m,_){return m.namespaceURI===Oe?l==="svg":m.namespaceURI===nn?l==="svg"&&(_==="annotation-xml"||jn[_]):!!Zo[l]},Zu=function(l,m,_){return m.namespaceURI===Oe?l==="math":m.namespaceURI===on?l==="math"&&Hn[_]:!!er[l]},ea=function(l,m,_){return m.namespaceURI===on&&!Hn[_]||m.namespaceURI===nn&&!jn[_]?!1:!er[l]&&(Ku[l]||!Zo[l])},ta=function(l){let m=b(l);(!m||!m.tagName)&&(m={namespaceURI:lt,tagName:"template"});const _=Yt(l.tagName),O=Yt(m.tagName);return Fn[l.namespaceURI]?l.namespaceURI===on?Qu(_,m,O):l.namespaceURI===nn?Zu(_,m,O):l.namespaceURI===Oe?ea(_,m,O):!!(ht==="application/xhtml+xml"&&Fn[l.namespaceURI]):!1},Ve=function(l){Vt(t.removed,{element:l});try{b(l).removeChild(l)}catch{if(h(l),!b(l))throw ot("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tr=function(l,m,_){try{l.removeAttributeNode(m)}catch{try{l.removeAttribute(_)}catch{}}},rn=function(l){un(l);const m=y(l);if(m){const O=[];nt(m,k=>{Vt(O,k)}),nt(O,k=>{try{h(k)}catch{}})}const _=E(l);if(_)for(let O=_.length-1;O>=0;--O){const k=_[O],H=k&&k.name;typeof H=="string"&&tr(l,k,H)}},Xe=function(l,m,_){if(!_)try{_=m.getAttributeNode(l)}catch{_=null}Vt(t.removed,{attribute:_||null,from:m});try{_?m.removeAttributeNode(_):m.removeAttribute(l)}catch{try{m.removeAttribute(l)}catch{}}if(l==="is")if(rt||en)try{Ve(m)}catch{}else try{m.setAttribute(l,"")}catch{}},na=function(l){const m=E(l);if(m)for(let _=m.length-1;_>=0;--_){const O=m[_],k=O&&O.name;typeof k!="string"||te[re(k)]||tr(l,O,k)}},un=function(l){const m=[l];for(;m.length>0;){const _=m.pop();B(_)===Te.element&&na(_);const k=y(_);if(k)for(let H=k.length-1;H>=0;--H)m.push(k[H])}},nr=function(l,m){return qe?l==="patchsrc"?!0:l==="for"&&m!=="label"&&m!=="output":!1},oa=function(l){if(!qe)return;const m=[l];for(;m.length>0;){const _=m.pop(),O=B(_);if(O===Te.processingInstruction||O===Te.comment&&ge(Gu,_.data)){try{h(_)}catch{}continue}if(O===Te.element){const H=_,ne=re(L(_));try{H.hasAttribute&&H.hasAttribute("patchsrc")&&H.removeAttribute("patchsrc"),H.hasAttribute&&H.hasAttribute("for")&&nr("for",ne)&&H.removeAttribute("for")}catch{}}const k=y(_);if(k)for(let H=k.length-1;H>=0;--H)m.push(k[H])}},or=function(l){let m=null,_=null;if(Mn)l="<remove></remove>"+l;else{const H=Ru(l,/^[\r\n\t ]+/);_=H&&H[0]}ht==="application/xhtml+xml"&<===Oe&&(l='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+l+"</body></html>");const O=P?x(l):l;if(lt===Oe)try{m=new g().parseFromString(O,ht)}catch{}if(!m||!m.documentElement){m=he.createDocument(lt,"template",null);try{m.documentElement.innerHTML=xn?v:O}catch{}}const k=m.body||m.documentElement;return l&&_&&k.insertBefore(n.createTextNode(_),k.childNodes[0]||null),lt===Oe?M.call(m,Je?"html":"body")[0]:Je?m.documentElement:k},rr=function(l){const m=I?I(l):l.ownerDocument;return R.call(m||l,l,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},an=function(l){return l=Ut(l,ke," "),l=Ut(l,Ke," "),l=Ut(l,Ge," "),l},Gn=function(l){var m;l.normalize();const _=I?I(l):l.ownerDocument,O=R.call(_||l,l,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let k=O.nextNode();for(;k;)k.data=an(k.data),k=O.nextNode();const H=(m=l.querySelectorAll)===null||m===void 0?void 0:m.call(l,"template");H&&nt(H,ne=>{st(ne.content)&&Gn(ne.content)})},ln=function(l){const m=N?N(l):null;return typeof m!="string"||re(m)!=="form"?!1:typeof l.nodeName!="string"||typeof l.textContent!="string"||typeof l.removeChild!="function"||l.attributes!==E(l)||typeof l.removeAttribute!="function"||typeof l.setAttribute!="function"||typeof l.namespaceURI!="string"||typeof l.insertBefore!="function"||typeof l.hasChildNodes!="function"||l.nodeType!==A(l)||l.childNodes!==y(l)},st=function(l){if(!A||typeof l!="object"||l===null)return!1;try{return A(l)===Te.documentFragment}catch{return!1}},yt=function(l){if(!A||typeof l!="object"||l===null)return!1;try{return typeof A(l)=="number"}catch{return!1}};function Le(T,l,m){T.length!==0&&nt(T,_=>{_.call(t,l,m,it)})}const ra=function(l,m){return!!(qe&&l.hasChildNodes()&&!yt(l.firstElementChild)&&ge($u,l.textContent)&&ge($u,l.innerHTML)||qe&&l.namespaceURI===Oe&&Hd[m]&&(yt(l.firstElementChild)||typeof l.textContent=="string"&&ge($d[m],l.textContent))||l.nodeType===Te.processingInstruction||qe&&l.nodeType===Te.comment&&ge(Gu,l.data))},sn=function(l,m){if(l instanceof RegExp)return ge(l,m);if(l instanceof Function){for(var _=arguments.length,O=new Array(_>2?_-2:0),k=2;k<_;k++)O[k-2]=arguments[k];return!!l(m,...O)}return!1},ua=function(l,m,_){if(!V[m]&&sr(m)&&sn(U.tagNameCheck,m))return!1;if(Pn&&!at[m]){const O=b(l),k=y(l);if(k&&O){const H=k.length;for(let ne=H-1;ne>=0;--ne){const oe=l===_?p(k[ne],!0):k[ne];O.insertBefore(oe,w(l))}}}return Ve(l),!0},ur=function(l,m,_,O){return l.length===0?m:m===_||m===O?_e(m):m},ar=function(l,m){return l===m||b(l)!==null?!1:(kn&&un(l),!0)},lr=function(l,m){if(Le(G.beforeSanitizeElements,l,null),ar(l,m))return!0;if(ln(l))return Ve(l),!0;const _=re(L(l));if(ee=ur(G.uponSanitizeElement,ee,gt,Qt),Le(G.uponSanitizeElement,l,{tagName:_,allowedTags:ee}),ar(l,m))return!0;if(ra(l,_))return Ve(l),!0;if(V[_]||!(le.tagCheck instanceof Function&&le.tagCheck(_))&&!ee[_]){const k=ua(l,_,m);return k===!1&&Le(G.afterSanitizeElements,l,null),k}if(B(l)===Te.element&&!ta(l)||(_==="noscript"||_==="noembed"||_==="noframes")&&ge(Fd,l.innerHTML))return Ve(l),!0;if(We&&l.nodeType===Te.text){const k=an(l.textContent);l.textContent!==k&&(Vt(t.removed,{element:l.cloneNode()}),l.textContent=k)}return Le(G.afterSanitizeElements,l,null),!1},ir=function(l,m,_){if(q[m]||nr(m,l)||Go&&(m==="id"||m==="name")&&(_ in n||_ in Xu))return!1;const O=te[m]||le.attributeCheck instanceof Function&&le.attributeCheck(m,l);return Rn&&ge(Z,m)||Xt&&ge(Kt,m)?!0:O?Ko[m]||ge(Jt,Ut(_,qt,""))||(m==="src"||m==="xlink:href"||m==="href")&&l!=="script"&&Iu(_,"data:")===0&&Uo[l]||Ho&&!ge(On,Ut(_,qt,""))?!0:!_:sr(l)&&sn(U.tagNameCheck,l)&&sn(U.attributeNameCheck,m,l)||m==="is"&&U.allowCustomizedBuiltInElements&&sn(U.tagNameCheck,_)},aa=z({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),sr=function(l){return!aa[Yt(l)]&&ge(Ln,l)},la=function(l,m,_,O){if(P&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!_)switch(f.getAttributeType(l,m)){case"TrustedHTML":return x(O);case"TrustedScriptURL":return Y(O)}return O},ia=function(l,m,_,O){try{_?l.setAttributeNS(_,m,O):l.setAttribute(m,O),ln(l)?Ve(l):Lu(t.removed)}catch{Xe(m,l)}},cr=function(l){Le(G.beforeSanitizeAttributes,l,null);const m=l.attributes;if(!m||ln(l))return;te=ur(G.uponSanitizeAttribute,te,D,Zt);const _={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let O=m.length;const k=re(l.nodeName);for(;O--;){const H=m[O],ne=H.name,oe=H.namespaceURI,be=H.value,Se=re(ne),Vn=be;let ye=ne==="value"?Vn:Sd(Vn);if(_.attrName=Se,_.attrValue=ye,_.keepAttr=!0,_.forceKeepAttr=void 0,Le(G.uponSanitizeAttribute,l,_),ye=_.attrValue,Wo&&(Se==="id"||Se==="name")&&Iu(ye,Vo)!==0&&(Xe(ne,l,H),ye=Vo+ye),qe&&ge(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ye)){Xe(ne,l,H);continue}if(Se==="attributename"&&Ru(ye,"href")){Xe(ne,l,H);continue}if(!_.forceKeepAttr){if(!_.keepAttr){Xe(ne,l,H);continue}if(!$o&&ge(jd,ye)){Xe(ne,l,H);continue}if(We&&(ye=an(ye)),!ir(k,Se,ye)){Xe(ne,l,H);continue}ye=la(k,Se,oe,ye),ye!==Vn&&ia(l,ne,oe,ye)}}Le(G.afterSanitizeAttributes,l,null)},cn=function(l){let m=null;const _=rr(l);for(Le(G.beforeSanitizeShadowDOM,l,null);m=_.nextNode();)if(Le(G.uponSanitizeShadowNode,m,null),lr(m,l),cr(m),st(m.content)&&cn(m.content),B(m)===Te.element){const O=S(m);st(O)&&(Wn(O),cn(O))}Le(G.afterSanitizeShadowDOM,l,null)},Wn=function(l){const m=[{node:l,shadow:null}];for(;m.length>0;){const _=m.pop();if(_.shadow){cn(_.shadow);continue}const O=_.node,H=B(O)===Te.element,ne=y(O);if(ne)for(let oe=ne.length-1;oe>=0;--oe)m.push({node:ne[oe],shadow:null});if(H){const oe=N?N(O):null;if(typeof oe=="string"&&re(oe)==="template"){const be=O.content;st(be)&&m.push({node:be,shadow:null})}}if(H){const oe=S(O);st(oe)&&m.push({node:null,shadow:oe},{node:oe,shadow:null})}}};return t.sanitize=function(T){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,_=null,O=null,k=null;if(xn=!T,xn&&(T="<!-->"),typeof T!="string"&&!yt(T)&&(T=Td(T),typeof T!="string"))throw ot("dirty is not a string, aborting");if(!t.isSupported)return T;In?(ee=Qt,te=Zt):$n(l),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ee=_e(ee)),G.uponSanitizeAttribute.length>0&&(te=_e(te)),t.removed=[];const H=kn&&typeof T!="string"&&yt(T);if(H){oa(T);const be=L(T);if(typeof be=="string"){const Se=re(be);if(!ee[Se]||V[Se])throw rn(T),ot("root node is forbidden and cannot be sanitized in-place")}if(ln(T))throw rn(T),ot("root node is clobbered and cannot be sanitized in-place");try{Wn(T)}catch(Se){throw rn(T),Se}}else if(yt(T))m=or("<!---->"),_=m.ownerDocument.importNode(T,!0),_.nodeType===Te.element&&_.nodeName==="BODY"||_.nodeName==="HTML"?m=_:m.appendChild(_),Wn(_);else{if(!rt&&!We&&!Je&&T.indexOf("<")===-1)return P&&tn?x(T):T;if(m=or(T),!m)return rt?null:tn?v:""}m&&Mn&&Ve(m.firstChild);const ne=H?T:m;try{const be=rr(ne);for(;O=be.nextNode();)lr(O,ne),cr(O),st(O.content)&&cn(O.content)}catch(be){throw H&&(rn(T),nt(t.removed,Se=>{Se.element&&un(Se.element)})),be}if(H)return nt(t.removed,be=>{be.element&&un(be.element)}),We&&Gn(T),T;if(rt){if(We&&Gn(m),en)for(k=j.call(m.ownerDocument);m.firstChild;)k.appendChild(m.firstChild);else k=m;return(te.shadowroot||te.shadowrootmode)&&(k=K.call(o,k,!0)),k}let oe=Je?m.outerHTML:m.innerHTML;return Je&&ee["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&ge(kd,m.ownerDocument.doctype.name)&&(oe="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
|
|
7
7
|
`+oe),We&&(oe=an(oe)),P&&tn?x(oe):oe},t.setConfig=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$n(T),In=!0,Qt=ee,Zt=te},t.clearConfig=function(){it=null,In=!1,Qt=null,Zt=null,P=W,v=""},t.isValidAttribute=function(T,l,m){it||$n({});const _=re(T),O=re(l);return ir(_,O,m)},t.addHook=function(T,l){typeof l=="function"&&we(G,T)&&Vt(G[T],l)},t.removeHook=function(T,l){if(we(G,T)){if(l!==void 0){const m=yd(G[T],l);return m===-1?void 0:bd(G[T],m,1)[0]}return Lu(G[T])}},t.removeHooks=function(T){we(G,T)&&(G[T]=[])},t.removeAllHooks=function(){G=Vu()},t}Yu();const Fo=new Map,jo=new Map,Vd=()=>()=>{},Yd=()=>!0,Ud=()=>!1;function Uu(e){const t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e);if(!t)return null;try{if(!t[1])return decodeURIComponent(t[2]);const n=Uint8Array.from(atob(t[2]),o=>o.charCodeAt(0));return new TextDecoder("utf-8").decode(n)}catch{return null}}function zd(e){const t=jo.get(e);if(t)return t;const n=fetch(e).then(o=>o.ok?o.text():null).then(o=>(o!=null&&Fo.set(e,o),o)).catch(()=>null).finally(()=>{jo.delete(e)});return jo.set(e,n),n}function Kd(e,t=!0){const n=d.useSyncExternalStore(Vd,Yd,Ud)&&t&&e?Uu(e)??Fo.get(e)??null:null,[o,r]=d.useState({src:e,enabled:t,svg:n});return d.useEffect(()=>{if(!t||!e){r({src:e,enabled:t,svg:null});return}const u=Uu(e)??Fo.get(e)??null;if(u!==null){r({src:e,enabled:t,svg:u});return}let a=!0;return zd(e).then(i=>{a&&r({src:e,enabled:t,svg:i})}),()=>{a=!1}},[e,t]),o.src===e&&o.enabled===t?o.svg:n}exports.CACHE_GROUPS=Br,exports.CORE_VERSION=Es,exports.DocumentTitleSuppressContext=gr,exports.EMPTY_COMPOSITION=yo,exports.MediaQueryOverrideContext=fr,exports.NO_CODA=Me,exports.SYLLABLE_MIN=Pe,exports.VAP_PAGE_SIZE_OPTIONS=dt,exports.buildGradeSection=fu,exports.buildPartOfSpeechSection=pu,exports.buildPositionSection=_c,exports.buildSelectSection=Ac,exports.buildSyllableSection=Ec,exports.buildWordTypeSection=Cu,exports.charToPronValue=iu,exports.convertComposition=cu,exports.fmtBytes=Ga,exports.gradeDescriptions=hu,exports.lsBytes=Nr,exports.meaningKey=Bo,exports.normalizeWordAttributeFilter=xs,exports.pronToCharValue=su,exports.syllableToFilter=mo,exports.toWordAttributeFilterCodes=ro,exports.today=Bt,exports.toggleAttributeFilter=Tc,exports.useAnchoredMenu=id,exports.useCacheManagement=Wa,exports.useDailyTrainingSelection=Kc,exports.useDelayedHoverAnchor=Qc,exports.useDeviceManagement=ol,exports.useDocumentTitle=ga,exports.useEscToClose=qc,exports.useFontScale=ca,exports.useHoverAnchor=Xc,exports.useInlineSvg=Kd,exports.useListControls=ed,exports.useMediaQuery=ma,exports.usePageResetOnChange=Du,exports.usePagedList=Zc,exports.usePasswordChange=Aa,exports.useRelativeDay=Sa,exports.useSoundCompassExam=sd,exports.useTablePaging=tl,exports.useTableSort=nl,exports.useToastState=td,exports.useTrainingTypeLabels=ld,exports.useVisitAllPanel=qa,exports.useVisitHistory=Ua,exports.useVisitSchedule=Ka,exports.useWindowEvent=Un,exports.useWordAttributeFilterKeys=du,exports.useWordDataStats=Va,exports.useWordMeanings=Jc,exports.useWordTrainingDataGeneration=xc,exports.useWordTrainingFilter=Pc,exports.valueToJamos=He,exports.wordAttributeFilterFromCodes=uo;
|