@ihabdevteam/core 0.346.0 → 0.347.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 +32 -0
- package/dist/components.cjs.js +12 -12
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +176 -176
- package/dist/ihabdevteam-core.d.ts +1 -1
- package/dist/packages/core/src/components/Popup/Popup.js +12 -1
- package/dist/packages/core/src/components/Training/TrainingPagePopup.js +8 -1
- 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/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",kakao:"KAKAO Talk \uC624\uD508\uCC44\uD305"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638"},tl={trainingPhone:{topic:"\uD143\uBC2D\uAC00\uAFB8\uAE30",prev:"\uC774\uC804",next:"\uB2E4\uC74C",speed:"\uBE60\uB974\uAE30 3",noiseType:"\uC640\uAE00\uC640\uAE00",settings:"\uC124\uC815",start:{caption:"\uC544\uB798 \uD50C\uB808\uC774(\u25B6) \uBC84\uD2BC\uC744 \uB20C\uB7EC \uBB38\uC7A5\uC744 \uC798 \uB4E4\uC5B4\uBCF4\uC138\uC694. \uC798 \uB4E4\uC73C\uC2E0 \uB4A4 \uBB38\uC7A5\uC744 \uD655\uC778\uD558\uC138\uC694."},feedback:{caption:"\uC798 \uD0A4\uC6B4 \uBAA8\uC885\uC744 \uD143\uBC2D\uC5D0 \uC2EC\uACE0 \uBE44\uB2D0\uC744 \uC798 \uB36E\uC5B4 \uC90D\uB2C8\uB2E4."},done:{heardWell:"\uC798 \uB4E4\uB9B0 \uBB38\uC7A5",listenAgain:"\uD55C \uBC88 \uB354 \uB4E3\uAE30"}}},nl={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},ol={options:"\uD6C8\uB828 \uC635\uC158",difficulty:"\uB09C\uC774\uB3C4",exclude:"\uC81C\uC678",chosung:"\uCD08\uC131",excludeOptions:{none:"\uC5C6\uC74C",noImage:"\uC774\uBBF8\uC9C0 \uC5C6\uC74C"}},rl={answer:"\uC815\uB2F5",distractor:"\uC624\uB2F5"},al={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"},il={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},ul={ariaLabel:"\uC120\uD0DD \uD0ED"},ll={ariaLabel:"\uD0ED"},sl={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},cl={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},dl={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"},reason:{notLoggedIn:"\uB85C\uADF8\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},list:{title:"\uBC1B\uC740 \uC219\uC81C"},status:{expired:"\uB9CC\uB8CC\uB428",done:"\uC644\uB8CC {{count}}\uD68C \xB7 {{date}}",notDone:"\uBBF8\uC644\uB8CC"}},fl={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30",crossword:"\uAC00\uB85C\uC138\uB85C"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",count:"\uC804\uCCB4",done:"\uC644\uB8CC",remaining:"\uBBF8\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},filter:{countSuffix:" \uD6C8\uB828"},time:{countLabel:"{{n}}\uD68C \uD6C8\uB828",empty:"\uD6C8\uB828 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},daily:{title:"\uC624\uB298\uC758 \uB4E3\uAE30 \uAE30\uB85D",empty:"\uC644\uB8CC\uD55C \uD68C\uCC28\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},crossword:{title:"\uAC00\uB85C\uC138\uB85C\uD034\uC988",empty:"\uC644\uB8CC\uD55C \uB808\uBCA8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",detailFor:"{{name}} \uC0C1\uC138\uBCF4\uAE30",trainingType:{LISTEN_IN_NOISE:"\uC18C\uC74C \uD558 \uBB38\uC7A5",SHORT_STORY:"\uC9E7\uC740 \uC774\uC57C\uAE30",LONG_STORY:"\uAE34 \uC774\uC57C\uAE30",ORDERING_SENTENCE:"\uBB38\uC7A5 \uC21C\uC11C\uD654"}},pl={publish:{descPlaceholder:"\uB9D0\uADC0\uC790\uB8CC\uC2E4\uC5D0 \uD45C\uC2DC\uD560 \uD55C \uC904 \uC124\uBA85 (\uC120\uD0DD)"},import:"\uB0B4 \uD6C8\uB828\uC5D0 \uAC00\uC838\uC624\uAE30",publisher:"\uAC8C\uC2DC\uC790",time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"},badge:{shared:"\uB9D0\uADC0\uC790\uB8CC\uC2E4"}},ml={manage:{unit:"\uAC74"}},gl={cancelLabel:"\uCDE8\uC18C"},Cl={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},hl={panelTitle:"\uD6C8\uB828 \uC624\uB2F5",viewItems:"\uBB38\uD56D",viewTypes:"\uC720\uD615",colPending:"\uB0A8\uC740 \uAC83",colTrend:"\uBCC0\uD654",colRuns:"\uD310",unitItem:"\uAC1C",skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",summaryLabel:"\uC313\uC778 \uAE30\uB85D",summaryValue:"{{items}}\uBB38\uD56D \xB7 \uC544\uC9C1 \uBABB \uC7A1\uC740 \uAC83 {{pending}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C",picked:"\u2192 {{what}}",typeClear:"\uB2E4 \uC7A1\uC558\uC5B4\uC694",typePending:"{{total}}\uAC1C \uC911 {{pending}}\uAC1C \uB0A8\uC74C",flat:"\uBCC0\uD654 \uC5C6\uC74C",runs:"{{count}}\uD310",avgDuration:"\uD3C9\uADE0 {{sec}}\uCD08"},yl={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"},bl={panelTitle:"\uB2E8\uC5B4\uD45C \uCC44\uC810",viewWords:"\uB0B1\uB9D0",viewTables:"\uD45C",colLatest:"\uB9C8\uC9C0\uB9C9",colTrend:"\uBCC0\uD654",unitTime:"\uD68C",summaryLabel:"\uC313\uC778 \uCC44\uC810",summaryValue:"{{times}}\uD68C \xB7 \uB0B1\uB9D0 {{words}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",allClear:"\uC9C0\uB09C\uBC88\uC5D0 \uBAA8\uB450 \uB9DE\uD614\uC2B5\uB2C8\uB2E4.",times:"{{count}}\uD68C",flat:"\uBCC0\uD654 \uC5C6\uC74C",recentLabel:"\uCD5C\uADFC \uCC44\uC810",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C"},Sl={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},wl={selectYearMonth:"\uC5F0\uC6D4 \uC120\uD0DD",chooseDate:"\uB0A0\uC9DC \uC120\uD0DD"},El={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},Al={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},Tl={devNone:"\uBC1C\uB2EC \uC790\uB8CC \uC5C6\uC74C",place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},_l={clearSelection:"\uC120\uD0DD \uD574\uC81C"},vl={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Dl={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Nl={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},Ol={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},Ll={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},Bl={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},Rl={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"},Il={common:yu,calendar:bu,passCard:Su,searchField:wu,rating:Eu,colorPicker:Au,dropdown:Tu,accordion:_u,header:vu,nav:Du,settings:Nu,usage:Ou,account:Lu,help:Bu,training:Ru,trainingSettings:Iu,customers:Pu,payment:Mu,coupons:ku,visits:xu,company:Fu,trainingType:ju,myWordTraining:Hu,myWordTable:$u,keyWords:Gu,wordTable:Wu,wordSearch:Vu,wordPrint:Uu,topic:Yu,accessLinkManager:zu,login:Ku,trainingPlanRun:qu,device:Ju,manager:Xu,wordPairs:Qu,game:Zu,footer:el,landing:tl,date:nl,trainingSetPage:ol,wordTrainingPreview:rl,wordData:al,textField:il,segmentedControl:ul,tabs:ll,fileUpload:sl,avatar:cl,myHomework:dl,trainingStatus:fl,store:pl,homework:ml,inquiry:gl,progress:Cl,trainingMiss:hl,table:yl,wordScore:bl,topBanner:Sl,datePicker:wl,report:El,tooltip:Al,phonemeProfile:Tl,bulkBar:_l,debug:vl,badge:Dl,loader:Nl,soundCompass:Ol,breadcrumb:Ll,board:Bl,promoBannerBg:Rl},Pl={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",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."},Ml={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekLabel:"Week {{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"]},kl={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"}},xl={clearAriaLabel:"Clear search"},Fl={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},jl={selected:"selected"},Hl={placeholder:"Select"},$l={collapse:"Collapse",expand:"Expand"},Gl={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},Wl={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"},Vl={language:{training:{label:"Training Language",sub:"Language used for training words and speech"}},notifications:{title:"Notifications"},display:{fontSize:{small:"Small",large:"Large"}},cache:{title:"Cache Management",confirmMessage:"Delete cache ({{size}}). Do you want to continue?",delete:"Delete",deleting:"Deleting",cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"},trainingRecord:{label:"Training Record",sub:"Daily training progress and streak"}}},button:{save:"Save Settings"},popup:{clear:{confirm:"Reset"},update:{confirm:"Update"},cache:{title:"Delete {{label}}",message:"Delete {{label}} ({{size}}). Do you want to continue?"}},saved:"\u2713 Saved",account:{title:"Account",delete:{sub:"You can restore your account within 30 days of withdrawal."}}},Ul={addButton:"Add Subscription",couponButton:"Enter Coupon",active:{infoTitle:"Subscription Info",refund:"Request Refund",startDate:"Start Date",endDate:"End Date",remaining:"Remaining"},pending:{title:"Pending",empty:"No pending subscriptions."},loading:"Loading\u2026",segment:{personal:"Malgwi",org:"Malgwi Manager"},org:{title:"Current Plan",disc:"Subscription plan in use by your organization.",empty:"No organization plan registered.",fallbackTitle:"Organization Plan",startDate:"Start Date",endDate:"End Date",remaining:"Remaining",duration:"Duration"}},Yl={profile:{planSuffix:"",plan:"Plan"},basicInfo:{name:{placeholder:"John Doe"}},security:{title:"Security",password:{label:"Password",currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."},twoFactor:{label:"Two-Factor Authentication",sub:"Strengthen your account security"}}},zl={guide:{faq:{title:"FAQ",desc:"View all frequently asked questions"}}},Kl={settings:"Settings",start:{title:"Start Word Training",description:"Select a training type below to begin"},difficulty:{tooltip:"The easiest difficulty is 'Random', the hardest is 'Initial Consonant Difference'."},contrast:{label:"Contrast",type:"Contrast Type",count:"Contrast Count",n:"{{n}}"},filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions_one:"{{n}} question",countQuestions_other:"{{n}} questions",countSentences_one:"{{n}} sentence",countSentences_other:"{{n}} sentences",comingSoon:"Coming Soon",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",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",summary:"You heard {{correct}} item(s) correctly.",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",replaySound:"Replay item {{no}}",replaySoundStop:"Stop item {{no}}",done:"Done",viewResult:"View Results",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{idle:"Idle",resolving:"Resolving\u2026",checking_exists:"Checking file\u2026",getting_signed_url:"Getting URL\u2026",downloading:"Downloading\u2026",measuring_duration:"Measuring length\u2026",ready:"Ready",error:"Error",synthesizing:"Preparing the sound\u2026",preparing:"Preparing sound\u2026"}},ql={totalCount:" training bundles",sort:{customers:"Customers"},copyLink:"Copy Link",removeLink:"Remove Link",linkRemoved:"Link removed.",linkSaveFirst:"Please save the training bundle first.",linkSaveFirstHint:"You can only create a shared link from a saved training bundle.",linkCopySelect:"Copy blocked \u2014 link selected. Press Ctrl/\u2318+C to copy.",nameRequired:"Please enter a training bundle name.",itemRequired:"Please add at least one training item.",randomAdd:"Random Add",menu:{publish:"Post to Store",duplicate:"Duplicate Training Bundle",edit:"Edit Training Bundle",move:"Move Group",rename:"Rename"},itemCount:"Number of Items",renameGroup:"Rename Group"},Jl={totalCount:" customers",loadError:"Failed to load list",basicInfo:{editTooltip:"Edit"},member:{placeholder:"Email or phone",link:"Link",linking:"Linking\u2026"},device:{title:"Hearing Devices",addTooltip:"Add New",addButton:"Add device",listTooltip:"View List",listTitle:" Device List",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",release:"Release",historyTitle:"Hearing device history"},schedule:{title:"Upcoming Visits",addTooltip:"Add Schedule",listTooltip:"View All",empty:"No upcoming visits",registerTitle:" Register Schedule",memoPlaceholder:"Enter a memo for this visit."},visitHistory:{title:"Visit History",addTooltip:"Add Visit",empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",visits:{title:"Visits"},trainingRecord:{title:"Customer Training Records"},status:{trainingSubtitle:"Training Status"},detail:{session:{completedFmt:"Done {{done}}/{{total}} \xB7 {{duration}}"},visitSuffix:" visits"},homework:{active:"Active",copied:"Link copied.",copy:"Copy Link",inactive:"Inactive",title:"Homework Progress"},duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"}},Xl={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},Ql={title:"Coupons",subtitle:"Enter a coupon code or view your coupons",input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply",error:{invalid:"Invalid coupon code.",alreadyUsed:"This coupon has already been used."},success:{applied:'"{{name}}" coupon applied.'},section:{owned:"My Coupons"},status:{used:"Used",available:"Available"}},Zl={unitVisit:"",periodAll:"All",showN:"Show {{n}}"},es={subtitle:"Manage company and business information",editButton:"Edit Info",basicInfo:{title:"Basic Info"},contactInfo:{title:"Contact Info"}},ts={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."}},ns={comingSoon:"Word training is coming soon."},os={colName:"Table Name",open:"Open",countSuffix:" tables",addCard:"Add Word Table Card",cardsEmpty:"No word table cards created yet.",menu:{publishStore:"Post to Training Store",unpublishStore:"Remove from Training Store"},newBadge:"Newly created",tab:{cards:"Word Table Cards",tables:"Word Tables"},publishedBadge:"Published",sharedBadge:"Shared"},rs={title:"Key Words",empty:"No key words available."},as={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",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",store:{badge:"Training Store"},card:{sub:"Word Table Card",empty:"No word tables in this card."},toast:{renameError:"Failed to rename",saveError:"Failed to save",deleteError:"Failed to delete",duplicateError:"Failed to duplicate",saveSuccess:"Word table saved."},scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",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"}},is={editBanner:{message:"Saving will update the word table you're editing."},filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",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",popup:{title:"Select a word for cell {{n}}"}},us={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},ls={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"}},ss={maxUses:"Max uses (leave blank for unlimited)",redirect:"Redirect URL (leave blank for app home)",creating:"Creating\u2026",create:"Create link",created:"\u2713 Link created",copied:"Copied!",copy:"Copy",loading:"Loading\u2026",empty:"No links created yet.",uses_one:"Used {{count}} time",uses_other:"Used {{count}} times",expiresAt:"Expires: {{date}}",createdAt:"Created: {{date}}",confirmDelete:"Delete this link?",deactivate:"Deactivate",delete:"Delete",status:{active:"Active",expired:"Expired",inactive:"Inactive"}},cs={passwordPlaceholder:"Enter password"},ds={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",validationError:{brandAndProduct:"Please enter brand and product name."},addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant",other:"Other"}},fs={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",daily:"Daily",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"},subscriptionStatus:{active:"{{pct}}% Active",expired:"{{pct}}% Expired",unused:"{{pct}}% Unused"}},ps={editBanner:{message:"Saving will update the contrast pair table you're editing."},phonemeSelect:{title:"Phoneme Selection",vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",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",onlySameStructure:"Only same phoneme structure"},searchLabel:{error:"Failed to load data",loading:"Loading\u2026"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},ms={sentenceTyping:{roundCount:"{{rounds}} rounds \xB7 {{timeLimit}}s each"},wordDefense:{me:"Me"},dictation:{title:"Dictation",desc:"Practice writing down exactly what you hear.",comingSoon:"Coming soon: audio playback, input field, answer comparison"},result:{heading:"Level {{number}} Answer",retry:"Try Again"},common:{accuracy:"{{pct}}% accuracy"},soundMatch:{title:"Sound Match",desc:"Quickly match words or sentences that share the same sound.",comingSoon:"Coming soon: play button, timer, score tracking"},orderSequence:{title:"Sentence Ordering",desc:"Arrange scattered sentence fragments in the correct order.",comingSoon:"Coming soon: sentence sets, ordering interface"},speedListen:{title:"Speed Listen",desc:"A challenge game to count the number of words in a sentence within a time limit.",comingSoon:"Coming soon: time limit, scoreboard"},noiseChallenge:{title:"Noise Challenge",desc:"Practice distinguishing sentences amid background noise.",comingSoon:"Coming soon: various noise levels, score tracking"},fastListen:{title:"Fast Listen",desc:"Listen to short sentences at speed and select the key word.",comingSoon:"Coming soon: speed by difficulty, timer"},shadowing:{title:"Shadowing",desc:"Practice pronunciation and intonation by repeating sentences aloud.",comingSoon:"Coming soon: playback, recording, comparison feedback"},phonemeHunt:{title:"Phoneme Hunt",desc:"Find words that contain a specific phoneme (sound).",comingSoon:"Coming soon: phoneme filter, hint feature"}},gs={lead:`IHAB builds trust
|
|
4
4
|
through sound
|
|
5
|
-
and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea"},Cs={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},hs={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},ys={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},bs={answer:"Answer",distractor:"Distractor"},Ss={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"},ws={clearAriaLabel:"Clear input"},Es={ariaLabel:"Select tab"},As={ariaLabel:"Tabs"},Ts={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},_s={ariaLabel:"User avatar"},vs={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},Ds={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel_one:"{{n}} session",countLabel_other:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},Ns={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},Os={manage:{unit:"item(s)"}},Ls={cancelLabel:"Cancel"},Bs={subtitle:"Select a topic to start listening practice."},Rs={steps:"Step {{current}} of {{total}}"},Is={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",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.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs_one:"{{count}} run",runs_other:"{{count}} runs",avgDuration:"{{sec}}s avg"},Ps={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Ms={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},ks={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},xs={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Fs={previewRegion:"Report preview \u2014 scrollable sideways"},js={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Hs={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},$s={clearSelection:"Clear selection"},Gs={showResult:"Show {{type}} result"},Ws={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Vs={loading:"Loading"},Us={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Ys={ariaLabel:"Breadcrumb"},zs={empty:"No items yet."},Ks={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"},qs={common:Pl,calendar:Ml,passCard:kl,searchField:xl,rating:Fl,colorPicker:jl,dropdown:Hl,accordion:$l,header:Gl,nav:Wl,settings:Vl,usage:Ul,account:Yl,help:zl,training:Kl,trainingSettings:ql,customers:Jl,payment:Xl,coupons:Ql,visits:Zl,company:es,trainingType:ts,myWordTraining:ns,myWordTable:os,keyWords:rs,wordTable:as,wordSearch:is,wordPrint:us,topic:ls,accessLinkManager:ss,login:cs,device:ds,manager:fs,wordPairs:ps,game:ms,footer:gs,landing:Cs,date:hs,trainingSetPage:ys,wordTrainingPreview:bs,wordData:Ss,textField:ws,segmentedControl:Es,tabs:As,fileUpload:Ts,avatar:_s,myHomework:vs,trainingStatus:Ds,store:Ns,homework:Os,inquiry:Ls,trainingPlanRun:Bs,progress:Rs,trainingMiss:Is,table:Ps,wordScore:Ms,topBanner:ks,datePicker:xs,report:Fs,tooltip:js,phonemeProfile:Hs,bulkBar:$s,debug:Gs,badge:Ws,loader:Vs,soundCompass:Us,breadcrumb:Ys,board:zs,promoBannerBg:Ks};const Js="0.346.0",Xs=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],ao="ko",Qs="ihab_display_language";function Fr(){if(typeof window>"u")return ao;try{const e=localStorage.getItem(Qs);if(e&&Xs.some(t=>t.code===e))return e}catch{}return ao}function jr(e){try{document.documentElement.lang=e}catch{}}Be.on("languageChanged",jr),jr(Fr()),Be.use(We.initReactI18next).init({resources:{ko:{translation:Il},en:{translation:qs}},lng:Fr(),fallbackLng:ao,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Hr=new Set(["field"]),io="none";function Zs(e){return e==null||String(e).trim()===""}function ec(e){return typeof e=="string"&&lo.includes(e)}function uo(e,t){if(!e)return!0;const n=e instanceof Set?e:new Set(e);return n.size===0?!0:Zs(t)?n.has(io):n.has(String(t))}const zt=["grade","syllables","pos","wordType","field"],lo=["1","2","3","4","none"],tc=["1","2","3","4","5+"],nc=["noun","verb","modifier"],oc=["native","sino","foreign","mixed"],rc={grade:lo,syllables:tc,pos:nc,wordType:oc,field:[]},ac={noun:["\uBA85","\uC218"],verb:["\uB3D9","\uD615"],modifier:["\uBD80","\uAD00"]},ic={native:"\uACE0\uC720",sino:"\uD55C\uC790",foreign:"\uC678\uB798",mixed:"\uD63C\uC885"},uc={grade:["\uB09C\uC774\uB3C4 \uB4F1\uAE09"]},lc={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)"]}},so=new Map;try{Be.store?.on?.("added",()=>so.clear())}catch{}function Kt(e){const t=so.get(e);if(t)return t;const n=Be.getFixedT(e),o={section:{grade:n("wordSearch.filter.difficulty","\uB4F1\uAE09"),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(lo.filter(r=>r!==io).map(r=>[r,n("wordSearch.filter.grade",{n:Number(r),defaultValue:`${r}\uB4F1\uAE09`})])),[io]: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 so.set(e,o),o}const co=()=>Array.from(new Set([Be.language,"ko","en"].filter(e=>!!e)));function qt(e){if(zt.includes(e))return e;for(const t of co()){const n=Kt(t);for(const o of zt)if(n.section[o]===e)return o}for(const t of zt)if(uc[t]?.includes(e))return t;return null}function st(e,t){if(Hr.has(e)||rc[e].includes(t))return t;for(const n of co()){const o=Kt(n).value[e];for(const[r,a]of Object.entries(o))if(a===t)return r}for(const[n,o]of Object.entries(lc[e]??{}))if(o.includes(t))return n;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 sc(e,t,n=Be.language){return Kt(n).value[e][t]??t}const cc=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"&&e?[e]:[];function fo(e){const t={};for(const[n,o]of Object.entries(e??{})){const r=qt(n);if(r)for(const a of cc(o)){const i=st(r,a);if(!i)continue;const l=t[r]??(t[r]=[]);l.includes(i)||l.push(i)}}return t}function po(e,t=Be.language){const n=Kt(t||"ko"),o={};for(const r of zt){const a=(e?.[r]??[]).map(i=>n.value[r][i]??(Hr.has(r)?i:void 0)).filter(i=>!!i);a.length&&(o[n.section[r]]=a)}return o}function dc(e,t=Be.language){const n={};for(const[o,r]of Object.entries(e??{}))qt(o)||(n[o]=r);return{...n,...po(fo(e),t)}}function fc(e){for(const t of co()){const n=Kt(t);if(zt.some(o=>n.section[o]===e))return t}return Be.language||"ko"}let On=null,$r=null,Gr=null;function pc(){const e=vn();if(e&&e.entries.length>0){const t=Ht();if(On&&$r===e&&Gr===t)return On;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 On=o,$r=e,Gr=t,On}return[]}const Ue=new Proxy([],{get(e,t){const n=pc(),o=n[t];return typeof o=="function"?o.bind(n):o}});function mo(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Re(e,t){if(t>=e.length)return X(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)),a=n[o];n[o]=n[r],n[r]=a}return n.slice(0,t)}let go=null,Wr=null;function tt(){const e=vn();if(go&&Wr===e)return go;const t=new Map;for(const n of Ue)n.w&&t.set(n.w,n.pron);return go=t,Wr=e,t}function de(e){return tt().get(e)||e}function Ln(e,t,n=new Set){const o=[];for(const r of X(e)){if(o.length>=t)break;const a=de(r);n.has(a)||(n.add(a),o.push(r))}return o}let mc=0;function ge(e){return`${e}-rt-${++mc}`}function Et(e){const t=Nr();if(!t||t.total===0){const r=new Set;for(const a of e)r.add(a);return r}const n=Tn(),o=new Set;for(const r of e)n.has(r)&&o.add(r);return o}const Bn=new Map;let Vr=null,Ur=null,Yr=null;function Jt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function Co(e){const t=Array.isArray(e.choseong)&&e.choseong.length===0?"[]":Jt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),r=n?`${Jt(n.cho)}/${Jt(n.jung)}/${Jt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",a=Jt(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${a}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}const ho=new Map;function gc(e){return Co({...e,count:void 0,choicesPerItem:void 0,fullCount:!1})}async function Te(e){const t=vn(),n=Ht(),o=e.excludeNoImage?Tn():null;(t!==Vr||n!==Ur||e.excludeNoImage&&o!==Yr)&&(Bn.clear(),ho.clear(),Vr=t,Ur=n,Yr=o);const r=Co(e);return Bn.has(r)||Bn.set(r,Cc(e)),Bn.get(r)}function zr(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),r=!!e.jongNone,a=r?null:t(e.jong);return n||o||a||r?r&&!n&&!o&&!a?i=>Li(i):i=>Ri(i,{cho:n,jung:o,jong:a,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?i=>o.has(Ft(i)):null].filter(i=>i!=null):[];if(!t&&r.length===0)return null;const a=e.phonemeView==="pron";return i=>{if(!uo(t,i.grade))return!1;if(r.length===0)return!0;const l=a?de(i.w):i.w;return r.every(s=>s(l))}}async function Cc(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:r=null,excludeNoImage:a=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,l=e.sameStructureOnly??!0,s=e.phonemeView==="pron"?"pron":"char",d=Math.max(1,e.contrastCount??1),g=t==="cho"||t==="jung"||t==="jong",f=g&&d>=2,C=t==="count",m=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?B=>h.has(Ft(B)):null].filter(B=>B!=null):[],b=t==="random"||t===null,y=b||C,S=b||f||C;let T=Ue.filter(B=>!B.w||!uo(i,B.grade)?!1:S?!0:Array.isArray(B.p)&&B.p.length>0);m&&(T=T.filter(B=>{for(const H of m)if(Ni(B.w,H))return!0;return!1})),w.length>0&&(T=T.filter(B=>{const H=s==="pron"?de(B.w):B.w;return w.every(j=>j(H))})),r&&(T=T.filter(B=>B.w[0]===r));let v;if(a){const B=new Set;for(const H of T)if(B.add(H.w),Array.isArray(H.p))for(const j of H.p)B.add(j);if(y)for(const H of Ue)H.w&&B.add(H.w);v=Et(B)}else{const B=new Set;for(const H of T)if(B.add(H.w),Array.isArray(H.p))for(const j of H.p)B.add(j);if(y)for(const H of Ue)H.w&&B.add(H.w);v=B}let L=null;if(f){const B=new Set;for(const H of Ue)H.w&&B.add(H.w);L=a?Et(B):B}const I=T.filter(B=>v.has(B.w)),N=600,R=Array.from(v),x=R.length>N?Re(R,N):R,O=C&&o!=null&&(ce(o.cho)||ce(o.jung)||ce(o.jong)),z=2500,Z=new Map;if(C&&!O&&d>=2){for(const B of R){const H=Ft(B),j=Z.get(H);j?j.push(B):Z.set(H,[B])}for(const[B,H]of Z)H.length>z&&Z.set(B,Re(H,z))}const V=vi();let F=null;if(O){const B=gc(e),H=a?Tn():null,j=ho.get(B);F=j&&j.imageOkSet===H?j.map:iu(o,R,V,l,s,de),ho.set(B,{imageOkSet:H,map:F})}const k=500,K=1500,pe=e.fullCount?I:t==="random"?I.length>k?Re(I,k):I:I.length>K?Re(I,K):I,re=Ht(),Oe=[];for(const B of pe){let H;const j=de(B.w);if(f)H=Pi(B.w,t,d,L,24).filter(J=>de(J)!==j);else if(C)O?H=(F.get(B.w)??[]).filter(J=>de(J)!==j):d<=1?H=kr(B.w,re,{okSet:v,pronOf:de,decompOf:V,sameStructureOnly:!1}):H=(Z.get(Ft(B.w))??[]).filter(J=>{if(J===B.w||de(J)===j)return!1;const W=Mi(j,de(J));return d>=5?W>=5:W===d});else if(b){const J=W=>W!==B.w&&W.length===B.w.length&&de(W)!==j;if(e.fullCount){const W=Math.max(1,(e.choicesPerItem??3)-1),he=[],$e=new Set;for(const ot of x){if(!J(ot))continue;const qe=de(ot);if(!$e.has(qe)&&($e.add(qe),he.push(ot),he.length>=W))break}H=he}else H=x.filter(J)}else{const J=t;H=kr(B.w,re,{kind:J,okSet:v,pronOf:de,decompOf:V,sameStructureOnly:!1}),H.length===0&&(H=(x.length>30?Re(x,30):x).filter(W=>W!==B.w&&Di(B.w,W)===t&&de(W)!==j))}if(l&&H.length>0&&(g||C&&!O)){const J=V(de(B.w));H=H.filter(W=>!oo(J,V(de(W))))}H.length!==0&&Oe.push({word:B,usable:H})}return Oe}async function qr(e,t){const{choicesPerItem:n=3,count:o=10}=t,r=n-1,a=(await Te(t)).filter(l=>l.usable.length>=r),i=[];for(const l of X(a)){if(i.length>=o)break;const s=Ln(l.usable,r);if(s.length<r)continue;const d=X([l.word.w,...s]);i.push({id:ge(e+"-item"),index:i.length+1,word:l.word.w,syllables:l.word.s,choices:d,answerIndex:d.indexOf(l.word.w)})}return i}async function hc(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Te({...e,difficulty:null});if(r.length<t)return[];const a=e.composition??null,i=[],l=X([...r]);for(const s of l){if(i.length>=n)break;const d=s.word.w,g=[...s.word.pron||d],f=a&&Nn(a)?g.filter(b=>{const y=te(b);return!!y&<(y,a)}):[],C=mo(f.length?f:g);if(!C)continue;const m=r.filter(b=>b.word.w!==d&&b.word.s===s.word.s&&!(b.word.pron||b.word.w).includes(C)&&b.word.pron!==s.word.pron);if(m.length<o)continue;const h=Ln(m.map(b=>b.word.w),o);if(h.length<o)continue;const w=X([d,...h]);i.push({id:ge("HPI-item"),index:i.length+1,targetSyllable:C,word:d,choices:w,answerIndex:w.indexOf(d)})}return i}async function yc(e){const{count:t=10}=e,n=(await Te(e)).filter(a=>a.usable.length>=1);if(!n.length)return[];const o=n.length>=t?Re(n,t):X(Array.from({length:t},(a,i)=>n[i%n.length])),r=X(Array.from({length:t},(a,i)=>i<Math.ceil(t/2)));return o.map((a,i)=>{const l=r[i];let s;if(l)s=[a.word.w,a.word.w];else{const d=mo(a.usable);s=Math.random()<.5?[a.word.w,d]:[d,a.word.w]}return{id:ge("SOD-item"),index:i+1,word:a.word.w,pair:s,same:l}})}async function bc(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Te({...e,difficulty:null});if(r.length<t+1)return[];const a=r.map(C=>C.word.w),i=new Map(r.map(C=>[C.word.w,C.word.pron])),l=C=>(i.get(C)||C)[0]??"",s={};for(const C of r){const m=l(C.word.w);m&&(s[m]||(s[m]=[]),s[m].push(C.word.w))}const d=Object.entries(s).filter(([,C])=>new Set(C.map(m=>i.get(m)||m)).size>=2).map(([C])=>C);if(d.length===0)return[];const g=[],f=X([...d]);for(let C=0;g.length<n&&C<n*4;C++){const m=f[C%f.length],h=s[m];if(h.length<2)continue;const w=X([...h]),b=w[0],y=i.get(b)||b,S=w.find(N=>N!==b&&(i.get(N)||N)!==y);if(!b||!S)continue;const T=i.get(S)||S,v=a.filter(N=>l(N)!==m&&N!==b&&N!==S&&N.length===S.length&&(i.get(N)||N)!==T);if(v.length<o)continue;const L=Ln(v,o);if(L.length<o)continue;const I=X([S,...L]);g.push({id:ge("SWS-item"),index:g.length+1,sourceWord:b,targetSyllable:m,word:S,choices:I,answerIndex:I.indexOf(S)})}return g}function Jr(e,t,n){const o=tt(),r=s=>o.get(s)||s,a=(s,d)=>{const g=[...s],f=[...d];if(g.length!==f.length)return-1;let C=-1;for(let m=0;m<g.length;m++)if(g[m]!==f[m]){if(C>=0)return-1;C=m}return C},i=e.map(s=>({e:s,swaps:s.usable.filter(d=>!!d&&a(s.word.w,d)>=0&&r(d)!==r(s.word.w))})).filter(s=>s.swaps.length>0),l=[];for(const{e:s,swaps:d}of X(i)){if(l.length>=t)break;const g=mo(d)??"",f=[...s.word.w],C=[...g],m=a(s.word.w,g),h=Ln(s.usable.filter(w=>w&&w!==g),2,new Set([r(g),r(s.word.w)]));h.length<2||l.push({id:ge(n),index:l.length+1,word:s.word.w,original:s.word.w,changed:g,changedFrom:m>=0?f[m]:"",changedTo:m>=0?C[m]:"",distractors:h})}return l}async function Xr(e,t,n){const{count:o=10}=t,r=tt(),a=Ue.filter(h=>h.w&&h.s===e),i=t.excludeNoImage?Et(a.map(h=>h.w)):null,l=i?a.filter(h=>i.has(h.w)):a,s=new Set(l.map(h=>h.w)),d=Cu(s),g=t.phonemeView??"char",f=t.composition??null,C=Kr(t),m=[];for(const h of X(l)){if(m.length>=o)break;if(C&&!C(h))continue;const w=hu(h.w,f,r,g,d,null,null);if(!w)continue;const b=w.distractors[0],y=[...h.w],S=[...b],T=y.findIndex((v,L)=>v!==S[L]);m.push({id:ge(n),index:m.length+1,word:h.w,original:h.w,changed:b,changedFrom:T>=0?y[T]:"",changedTo:T>=0?S[T]:"",distractors:w.distractors.slice(1)})}return m}async function Sc(e){return Xr(2,e,"CS2-item")}async function wc(e){return Xr(3,e,"CS3-item")}async function Ec(e){const t=(await Te({...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 Ac(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Te({...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 Tc(e){const{count:t=10}=e,n=(await Te({...e})).filter(o=>o.word.s===2);return Re(n,t).map((o,r)=>({id:ge("M2S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function _c(e){const{count:t=10}=e,n=(await Te({...e})).filter(o=>o.word.s===3);return Re(n,t).map((o,r)=>({id:ge("M3S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}function yo(e){const t=Ue.map(n=>n.w);return e.excludeNoImage?Et(t):new Set(t)}async function vc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s===2),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=du(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=[...l.word.w],C=f[0]===d?f[1]:f[0];i.push({id:ge("D2-item"),index:i.length+1,original:l.word.w,word:l.word.w,dropped:C,missingResult:d,distractors:g})}return i}async function Dc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s===3),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=fu(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=[...l.word.w];let C="";for(let m=0;m<f.length;m++)if(f.filter((h,w)=>w!==m).join("")===d){C=f[m];break}i.push({id:ge("D3-item"),index:i.length+1,original:l.word.w,word:l.word.w,dropped:C,missingResult:d,distractors:g})}return i}async function Nc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s>=3),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=pu(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=l.word.w,C=s.dropped??(f.startsWith(d)?f.slice(d.length):f.endsWith(d)?f.slice(0,f.length-d.length):"");i.push({id:ge("DPC-item"),index:i.length+1,original:f,word:f,dropped:C,missingResult:d,distractors:g})}return i}async function Oc(e){const{count:t=10}=e,n=(await Te({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,r)=>{const a=Re(n,3);return{id:ge("LRO-item"),index:r+1,sequence:a,choices:X(a)}})}function Rn(e,t,n){const o=Ue.filter(l=>l.w&&l.s===e),r=t.excludeNoImage?Et(o.map(l=>l.w)):null,a=Kr(t),i=[];for(const l of o)if(!(r&&!r.has(l.w))&&!(a&&!a(l))){if(n){const s=te(l.w);if(!s||!n(s))continue}i.push(l)}return i}function Lc(e){const t=Rn(1,e,Dn.MERGE_2_PHONEMES.syllable);return Re(t,e.count??10).map((n,o)=>{const r=te(n.w);return{id:ge("M2P-item"),index:o+1,parts:[me[r.cho],Ae[r.jung]],answer:n.w,word:n.w}})}function Bc(e){const t=Rn(1,e,Dn.MERGE_3_PHONEMES.syllable);return Re(t,e.count??10).map((n,o)=>{const r=te(n.w);return{id:ge("M3P-item"),index:o+1,parts:[me[r.cho],Ae[r.jung],Ne[r.jong]],answer:n.w,word:n.w}})}function Rc(e){const t=Dn.DROP_FINAL_CONSONANT_FROM_1SYLL,n=Rn(t.syllables,e,t.syllable),o=tt(),r=[];for(const a of X(n)){if(r.length>=(e.count??10))break;const i=mu(a.w,null,o);if(!i)continue;const[l,...s]=i.distractors;r.push({id:ge("DFC-item"),index:r.length+1,original:a.w,word:a.w,result:l,distractors:s})}return r}function Ic(e){const t=Dn.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=Rn(t.syllables,e,t.syllable),o=tt(),r=[];for(const a of X(n)){if(r.length>=(e.count??10))break;const i=gu(a.w,null,o);if(!i)continue;const l=te(o.get(a.w)||a.w);if(!l)continue;const[s,...d]=i.distractors;r.push({id:ge("RCP-item"),index:r.length+1,base:a.w,word:a.w,missingConsonant:me[l.cho],remaining:s,distractors:d})}return r}const In=new Map;let Qr=null,Zr=null,ea=null,bo=0;async function ta(e,t={}){const n=vn(),o=Ht(),r=t.excludeNoImage?Tn():null;(n!==Qr||o!==Zr||t.excludeNoImage&&r!==ea)&&(In.clear(),bo++,Qr=n,Zr=o,ea=r);const a=`${e}:${Co(t)}`;if(In.has(a))return In.get(a);const i=bo,l=await Mc(e,t);return i===bo&&In.set(a,l),l}const Pc={SAME_SOUND_PICK:e=>qr("SSP",e),HEAR_AND_PICK_SAME:e=>qr("HPS",e),HEAR_AND_PICK_INCLUDED:e=>hc(e),SAME_OR_DIFF:e=>yc(e),STARTS_WITH_SAME_SOUND:e=>bc(e),LISTEN_AND_REMEMBER_ORDER:e=>Oc(e),MERGE_2_SYLLABLES:e=>Tc(e),MERGE_3_SYLLABLES:e=>_c(e),MERGE_2_PHONEMES:e=>Lc(e),MERGE_3_PHONEMES:e=>Bc(e),DROP_1_FROM_2SYLL:e=>vc(e),DROP_1_FROM_3SYLL:e=>Dc(e),DROP_PART_FROM_COMPOUND:e=>Nc(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Rc(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Ic(e),CHANGE_1_SYLL_IN_2SYLL:e=>Sc(e),CHANGE_1_SYLL_IN_3SYLL:e=>wc(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Ec(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Ac(e)};async function Mc(e,t={}){const n=Pc[e];return n?await n(t):[]}async function kc(e){const t=["random","count"],n=Object.keys(eo);let o=0;for(const r of t)for(const a of n){const i=eo[a];ta(a,{difficulty:i.difficulty?r:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++o%6===0&&await new Promise(l=>setTimeout(l,0))}}async function xc(e){const t=await Te({...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 Fc(e={}){const t=[];for(const l of Ue)l.w&&t.push(l.w);const n=e.excludeNoImage?Et(t):t,o=new Set,r=new Set,a=new Set,i=new Set;for(const l of n){i.add(Ft(l));for(const s of l){const d=te(s);if(d&&(me[d.cho]!=="\u3147"&&o.add(me[d.cho]),r.add(Ae[d.jung]),d.jong>0)){a.add(Ne[d.jong]);const g=An[d.jong];g&&g.forEach(f=>a.add(f))}}}return{cho:o,jung:r,jong:a,syllable:i}}const Fe="\uC804\uCCB4";function na(){const{t:e}=We.useTranslation();return c.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function oa(e,t,n){return{label:t.difficulty,items:[...[1,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}}function ra(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function aa(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function jc(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 Hc(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function $c(e,t){const{label:n,headValue:o,midValue:r,tailValue:a,includeMid:i=!0,headDisabled:l,midDisabled:s,tailDisabled:d,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:l},...i?[{value:r,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:s}]:[],{value:a,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:d}]}}function Gc(e,t,n){const o=qt(n),r=o&&t!==Fe?st(o,t):null;if(o&&(t===Fe||r)){const l={},s={};for(const[m,h]of Object.entries(e))(qt(m)===o?s:l)[m]=h;if(t===Fe)return l;const d=fo(s)[o]??[],g=d.includes(r)?d.filter(m=>m!==r):[...d,r];if(g.length===0)return l;const f=po({[o]:g},fc(n)),C=Object.values(f)[0]??[];return{...l,[n]:C}}if(t===Fe){const{[n]:l,...s}=e;return s}const a=e[n]??[],i=a.includes(t)?a.filter(l=>l!==t):[...a,t];if(i.length===0){const{[n]:l,...s}=e;return s}return{...e,[n]:i}}Object.fromEntries(Object.entries(Zn).map(([e,{nucleus:t}])=>[e,t]));const Wc={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Vc={"\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"]},Uc={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:Vc,typeMap:Wc},ia=new WeakMap;function Yc(e,t){const n=ia.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[a,i]of Object.entries(e??{})){const l=a===t.difficulty?"grade":a===t.syllables?"syllables":a===t.partOfSpeech?"pos":a===t.wordType?"wordType":a===t.field?"field":qt(a);if(l)for(const s of Array.isArray(i)?i:typeof i=="string"?[i]:[])r[l].includes(s)||r[l].push(s)}return ia.set(e,{keys:t,value:o}),o}function zc(e,t,n=Uc){const{grades:o,syls:r,poses:a,types:i}=Yc(t,n);if(o.length){const l=o.map(s=>st("grade",s)??s.replace(/\D/g,"")).filter(s=>s!=="");if(l.length===0||!uo(l,e.grade))return!1}if(r.length){const l=e.syllables??0;if(!r.some(s=>{const d=s===n.syllable5plus?"5+":st("syllables",s);return d==="5+"?l>=5:l===parseInt(d??s)}))return!1}return!(a.length&&!a.flatMap(l=>n.posMap[l]??ac[st("pos",l)??""]??[l]).some(l=>(e.pos??"").includes(l))||i.length&&!i.some(l=>e.wordType===(n.typeMap[l]??ic[st("wordType",l)??""])))}const Kc={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"})},qc={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"})},Jc={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 ua(e,t){if("place"in t)return Kc[t.place](e);const n=qc[t.vowel](e);return t.glide?`${n} \xB7 ${Jc[t.glide](e)}`:n}const Xc=(e,{defaultValue:t})=>t,la=(e,t)=>({jamos:e,phonetic:t,tooltip:ua(Xc,t)}),Ye=(e,t)=>t.map(n=>la([n],{place:e})),fe=(e,t,n)=>la([...e],n?{vowel:t,glide:n}:{vowel:t}),So={cho:[Ye("labial",["\u3142","\u3143","\u314D","\u3141"]),Ye("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Ye("alveolar",["\u3145","\u3146"]),Ye("palatal",["\u3148","\u3149","\u314A"]),Ye("velar",["\u3131","\u3132","\u314B"]),Ye("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:[Ye("labial",["\u3142","\u3141"]),Ye("alveolar",["\u3137","\u3134","\u3139"]),Ye("velar",["\u3131","\u3147"])]},Qc=[...me],Zc=[...Ae],ed=Ne.filter(e=>e!==""),ze=e=>e===je?[]:Array.from(e),je="__NO_CODA__",sa=[1,2,3,4],He=5,td=12,ca="SYL_",wo=e=>`${ca}${e}`,nd=e=>Number(e.slice(ca.length));function Eo(e){return e>=He?Array.from({length:td-He+1},(t,n)=>He+n):[e]}const da={cho:Qc,jung:Zc,jong:ed},Ao=e=>e.map(t=>t.map(({jamos:n,phonetic:o,tooltip:r})=>({v:n.join(""),phonetic:o,tooltip:r}))),To={cho:Ao(So.cho),jung:Ao(So.jung),jong:Ao(So.jong)},fa={};To.jung.flat().forEach(({v:e})=>{for(const t of ze(e))fa[t]=e});const od=new Set(To.cho.flat().map(e=>e.v));function pa(e,t){return e==="cho"?od.has(t)?t:null:e==="jung"?fa[t]??t:xt(t)}function ma(e,t,n){if(e==="jung"){const o=ze(t);return n&&o.includes(n)?n:o[0]??t}return e==="jong"&&n&&xt(n)===t?n:t}function ga(e,t,n,o){const r=(a,i)=>i?a==="jong"&&i===je?je:t==="pron"?pa(a,i):ma(a,i,a==="jung"?n:a==="jong"?o:null):null;return{...e,cho:r("cho",e.cho),jung:r("jung",e.jung),jong:r("jong",e.jong)}}const _o={cho:null,jung:null,jong:null,syllable:null},vo=e=>Array.isArray(e)?e.filter(ec):[],rd="wt_filter",Ca=e=>`wt_filter_${e}`,Do=["noun","verb","modifier"],No=["native","sino","foreign","mixed"];function ha(e,t,n,o,r){if(!Array.isArray(e))return[];const a=[];for(const i of e){if(typeof i!="string")continue;const l=t.includes(i)?i:t.find(s=>r.some(d=>o(d,n(s))===i));l&&!a.includes(l)&&a.push(l)}return a}function ya(e){try{const t=localStorage.getItem(Ca(e))??localStorage.getItem(rd);if(t)return JSON.parse(t)}catch{}return null}function ba(e){const t=e?.phonemeView;return t==="pron"?"pron":t==="direct"?"direct":"char"}function ad(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?{..._o,cho:t.choseong}:_o}const Sa=["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 wa(e){const t=e("wordPairs.filter.difficultyInfo",{returnObjects:!0,defaultValue:Sa});return Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string")?t:Sa}function id(e,t,n){const{t:o,i18n:r}=We.useTranslation(),[a]=c.useState(()=>n?.resetOnMount?null:ya(e)),[i,l]=c.useState(ba(a)),[s,d]=c.useState(()=>ad(a)),g=c.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:je,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?je:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);c.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||d(E=>E.cho||E.jung||E.syllable!=null||E.jong?E:g())},[]);const f=c.useMemo(()=>ce(s.cho)||ce(s.jung)||ce(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),C=c.useRef(i==="char"?s.jung:null),m=c.useRef(i==="char"?s.jong:null);c.useEffect(()=>{i==="char"&&(C.current=s.jung,m.current=s.jong)},[i,s.jung,s.jong]);const[h,w]=c.useState(n?.resetOnMount?!!n?.defaultImageOnly:a?.excludeNoImage??!0),[b,y]=c.useState(n?.resetOnMount?!1:a?.sameStructureOnly??!0),[S,T]=c.useState(vo(a?.gradeFilter)),v=Array.from(new Set([r.language,"ko","en"].filter(Boolean))),L=(E,$)=>r.getFixedT(E)($),I=E=>ha(E,Do,$=>`wordSearch.filter.pos.${$}`,L,v),N=E=>ha(E,No,$=>`wordSearch.filter.type.${$}`,L,v),[R,x]=c.useState(()=>I(a?.posFilter)),[O,z]=c.useState(()=>N(a?.wordTypeFilter)),Z=c.useRef(n?.resetKey);c.useEffect(()=>{Z.current!==n?.resetKey&&(Z.current=n?.resetKey,d(g()),w(!!n?.defaultImageOnly),y(!1),T([]),x([]),z([]))},[n?.resetKey]);const V=na(),F=c.useMemo(()=>Object.keys(V.posMap),[V]),k=c.useMemo(()=>Object.keys(V.typeMap),[V]),K=c.useMemo(()=>R.map(E=>F[Do.indexOf(E)]).filter(Boolean),[R,F]),pe=c.useMemo(()=>O.map(E=>k[No.indexOf(E)]).filter(Boolean),[O,k]),[re,Oe]=c.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[B,H]=c.useState(!1),[j,J]=c.useState(null),W=1,he=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length),[$e,ot]=c.useState(e);c.useEffect(()=>{if($e!==e){if(!n?.resetOnMount){const E=ya(e);d(E?.composition??g()),w(E?.excludeNoImage??!0),y(E?.sameStructureOnly??!0),l(ba(E)),T(vo(E?.gradeFilter)),x(I(E?.posFilter)),z(N(E?.wordTypeFilter))}ot(e)}},[e,$e,n?.resetOnMount]),c.useEffect(()=>{if(!n?.resetOnMount&&$e===e)try{localStorage.setItem(Ca(e),JSON.stringify({contrastCount:he,composition:s,excludeNoImage:h,sameStructureOnly:b,phonemeView:i,gradeFilter:S,posFilter:R,wordTypeFilter:O}))}catch{}},[n?.resetOnMount,e,$e,he,s,h,b,i,S,R,O]);const[qe,vt]=c.useState(0);Xn("wordpool:update",()=>vt(E=>E+1)),Xn(Ar,()=>vt(E=>E+1));const dn=c.useRef(r.language);c.useEffect(()=>{dn.current!==r.language&&(dn.current=r.language,vt(E=>E+1))},[r.language]),c.useEffect(()=>{if(!t.choseong)return;let E=!1;return Fc({difficulty:f,excludeNoImage:h}).then($=>{E||(Oe($),H($.cho.size+$.jung.size+$.jong.size>0))}).catch(()=>{E||(Oe({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),H(!1))}),()=>{E=!0}},[t.choseong,f,h,qe]),c.useEffect(()=>{let E=!1;const $=s,M=$.cho?ze($.cho):null,U=$.jung?ze($.jung):null,Q=$.jong===je,Me=Q?null:$.jong?ze($.jong):null,Le=$.syllable!=null?Eo($.syllable):null,Ge=!!(M||U||Me||Q||Le);return xc({difficulty:t.difficulty?f:null,contrastCount:t.difficulty?he:1,composition:t.choseong&&Ge?{cho:M,jung:U,jong:Me,jongNone:Q,syllable:Le}:null,excludeNoImage:h,sameStructureOnly:b,phonemeView:i==="pron"?"pron":"char",grade:S.length>0?S:null}).then(Xe=>{E||J(Xe)}).catch(()=>{E||J(null)}),()=>{E=!0}},[t.choseong,t.difficulty,f,he,s,i,h,b,qe,S]),c.useEffect(()=>{B&&d(E=>{const $={...E};let M=!1;return["cho","jung","jong"].forEach(U=>{const Q=E[U];!Q||Q===je||ze(Q).some(Me=>re[U].has(Me))||($[U]=null,M=!0)}),E.syllable!=null&&t.fixedSyllable==null&&(E.syllable>=He?[...re.syllable].some(U=>U>=He)||($.syllable=null,M=!0):(!re.syllable.has(E.syllable)||E.syllable<W)&&($.syllable=null,M=!0)),M?$:E})},[re,B,W,t.fixedSyllable]);const Dt=c.useMemo(()=>{const E=$=>{const M=new Set;for(const U of da[$])re[$].has(U)&&M.add(U);return M};return{cho:E("cho"),jung:E("jung"),jong:E("jong")}},[re]),Nt=c.useMemo(()=>({exact:new Set(sa.filter(E=>re.syllable.has(E))),min:[...re.syllable].some(E=>E>=He)}),[re]),Y=c.useMemo(()=>({composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),ne=c.useMemo(()=>({[Y.trainOnset]:"cho",[Y.trainVowel]:"jung",[Y.trainCoda]:"jong"}),[Y]),Je=c.useCallback((E,$)=>({title:$,items:E}),[]),ee=c.useMemo(()=>[o("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),o("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[o]),Ot=c.useMemo(()=>{const E=[];if(t.choseong){const $={value:je,displayLabel:Y.codaExclude},M=t.fixedNoCoda===!0,U=(Q,Me)=>{const Le=M&&Q==="jong",Ge={label:Me,groupLabel:Y.phonemeGroup,allOption:!t.requireSyllable,allLabel:Y.noLimit,allOptionDisabled:Le};if(i==="pron"){const Ee=To[Q].map(ft=>ft.map(({v:Qe,phonetic:mn})=>{const pt=ze(Qe),Bt=ua(o,mn),mt=Le||!pt.some(Rt=>re[Q].has(Rt));return pt.length>1?{value:Qe,labels:pt,tooltip:Bt,disabled:mt}:{value:Qe,tooltip:Bt,disabled:mt}}));return Q==="jong"&&!t.requireCoda&&Ee.unshift([$]),{...Ge,groups:Ee}}const Xe=da[Q].map(Ee=>!Le&&Dt[Q].has(Ee)?Ee:{value:Ee,disabled:!0});return{...Ge,items:Q==="jong"&&!t.requireCoda?[$,...Xe]:Xe}};E.push(U("cho",Y.trainOnset)),E.push(U("jung",Y.trainVowel)),E.push(U("jong",Y.trainCoda))}if(E.push({...oa(o,V,{labelInfo:Je(wa(o))}),label:Y.gradeLabel}),t.partOfSpeech&&E.push(ra(V)),t.wordType&&E.push(aa(V)),t.choseong||t.fixedSyllable!=null){const $=t.fixedSyllable;E.push({label:Y.syllableCount,items:[...sa.map(M=>({value:wo(M),displayLabel:o("wordPairs.syllableN",{n:M,defaultValue:"{{n}}\uC74C\uC808"}),disabled:$!=null?M!==$:!Nt.exact.has(M)||M<W})),{value:wo(He),displayLabel:o("wordPairs.syllableNPlus",{n:He,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:$!=null?He!==$:!Nt.min}],allOption:!0,allOptionDisabled:$!=null})}return t.choseong?E.push({label:Y.exclude,displayLabel:Y.selectLabel,multiple:!0,items:[Y.excludeImage,Y.sameStructure],labelInfo:Je(ee)}):E.push({label:Y.exclude,displayLabel:Y.selectLabel,multiple:!0,items:[Y.excludeImage],labelInfo:Je([ee[0]])}),E},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,W,Dt,re,i,Nt,Y,o,Je,ee,V]),De={...(t.choseong||t.fixedSyllable!=null)&&s.syllable!=null?{[Y.syllableCount]:wo(s.syllable)}:{},...t.choseong&&s.cho?{[Y.trainOnset]:s.cho}:{},...t.choseong&&s.jung?{[Y.trainVowel]:s.jung}:{},...t.choseong&&s.jong?{[Y.trainCoda]:s.jong}:{},[Y.exclude]:[...h?[Y.excludeImage]:[],...b?[Y.sameStructure]:[]],[Y.gradeLabel]:S.map(E=>sc("grade",E)),...t.partOfSpeech?{[V.partOfSpeech]:K}:{},...t.wordType?{[V.wordType]:pe}:{}},rt=c.useCallback((E,$)=>{if($===Y.exclude)E===Y.excludeImage?w(M=>!M):E===Y.sameStructure&&y(M=>!M);else if($===Y.syllableCount)d(M=>{if(!E||E===Fe)return{...M,syllable:null};const U=nd(E);return{...M,syllable:M.syllable===U?null:U}});else if($===Y.gradeLabel){if(!E||E===Fe){T([]);return}const M=st("grade",E);if(M==null)return;T(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else if($===V.partOfSpeech){if(!E||E===Fe){x([]);return}const M=Do[F.indexOf(E)]??I([E])[0];if(!M)return;x(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else if($===V.wordType){if(!E||E===Fe){z([]);return}const M=No[k.indexOf(E)]??N([E])[0];if(!M)return;z(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else{const M=ne[$];if(!M)return;d(U=>t.requireSyllable?E&&E!==Fe?{...U,[M]:E}:U:!E||E===Fe||U[M]===E?{...U,[M]:null}:{...U,[M]:E})}},[Y,ne,V,F,k,t.requireSyllable]),fn=c.useCallback(E=>!t.partOfSpeech&&!t.wordType?!0:zc(E,{...t.partOfSpeech?{[V.partOfSpeech]:K}:{},...t.wordType?{[V.wordType]:pe}:{}},V),[t.partOfSpeech,t.wordType,K,pe,V]),Pe=c.useCallback(E=>{E!==i&&(E!=="direct"&&i!=="direct"&&d($=>ga($,E,C.current,m.current)),l(E))},[i]),pn=c.useCallback(()=>({composition:s,contrastCount:he,excludeNoImage:h,sameStructureOnly:b,phonemeView:i,gradeFilter:S,posFilter:R,wordTypeFilter:O}),[s,he,h,b,i,S,R,O]),Lt=c.useCallback(E=>{d(E.composition),w(E.excludeNoImage),y(E.sameStructureOnly??!0),l(E.phonemeView),T(vo(E.gradeFilter)),Array.isArray(E.posFilter)&&x(I(E.posFilter)),Array.isArray(E.wordTypeFilter)&&z(N(E.wordTypeFilter))},[]);return{difficulty:f,contrastCount:he,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:b,gradeFilter:S,posFilter:K,wordTypeFilter:pe,matchesWordAttributes:fn,poolVersion:qe,filterSections:Ot,filterSelected:De,handleFilterSelect:rt,phonemeView:i,setPhonemeView:Pe,phonemeGroupLabel:Y.phonemeGroup,wordCount:j,getFilterSnapshot:pn,restoreFilterSnapshot:Lt}}function ud(e){const t=l=>l?ze(l):null,n=t(e.cho),o=t(e.jung),r=e.jong===je,a=r?null:t(e.jong),i=e.syllable!=null?Eo(e.syllable):null;return!n&&!o&&!a&&!r&&!i?null:{cho:n,jung:o,jong:a,jongNone:r,syllable:i}}function ld(e,t,n,o,r,a,i=!0,l="char",s=[]){const[d,g]=c.useState({}),[f,C]=c.useState(!1),{cho:m=null,jung:h=null,jong:w=null,syllable:b=null}=o??{},y=s.length>0?s.slice().sort().join(","):"",S=e.map(v=>v.key).join("|");c.useEffect(()=>{a>0&&kc(r).catch(()=>{})},[a,r]),c.useEffect(()=>{let v=!1;return C(!0),(async()=>{const L=ud({cho:m,jung:h,jong:w,syllable:b}),I=`${m??""}_${h??""}_${w??""}_${b??""}_${y}`,N={};await Promise.all(e.map(async R=>{const x=eo[R.key];try{const O=await ta(R.key,{difficulty:x.difficulty?t:null,contrastCount:x.difficulty?n:1,composition:x.choseong?L:null,count:5,excludeNoImage:r,sameStructureOnly:i,phonemeView:l,grade:s.length>0?s:null});O&&O.length>0?N[R.key]={id:`wt-${R.key}-${t}-${I}-${Date.now()}`,name:R.label,training_type:R.key,category_main_code:"WORD",iconColor:R.color,subTitle:R.subTitle,items:O,itemCount:O.length}:N[R.key]={id:`wt-${R.key}-empty`,name:R.label,training_type:R.key,category_main_code:"WORD",iconColor:R.color,subTitle:R.subTitle,items:[],itemCount:0,__empty:!0}}catch{N[R.key]=null}})),v||(g(N),C(!1))})(),()=>{v=!0}},[t,n,m,h,w,b,r,i,l,a,y,S]);const T=JSON.stringify(e.map(v=>[v.key,v.label,v.color,v.subTitle]));return{perTypeData:c.useMemo(()=>{const v={};for(const[L,I]of Object.entries(d)){const N=e.find(R=>R.key===L);v[L]=I&&N?{...I,name:N.label,iconColor:N.color,subTitle:N.subTitle}:I}return v},[d,T]),generating:f}}const Xt=[],Qt=[],Zt=[],en=[],Pn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Mn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},sd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Oo=null,Ea=null,Ke=null;function cd({counts:e,forceRefresh:t}={}){const n=Object.assign({},sd,e||{}),o=Mt(),r=kt(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),a=JSON.stringify(n);if(!t&&Ea===o&&Oo===a&&Ke)return Object.assign(Pn,Ke.today),Object.assign(Mn,Ke.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Pn,yesterday:Mn};const i={LISTEN_IN_NOISE:Ve(Xt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:Ve(Qt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:Ve(Zt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:Ve(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let l=null;return Ke&&Oo===a&&Ke.yesterday&&Ke.yesterday.date===r&&(l=Ke.yesterday.selection),l||(l={LISTEN_IN_NOISE:Ve(Xt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:Ve(Qt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:Ve(Zt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:Ve(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(Pn,i),Object.assign(Mn,l),Ea=o,Oo=a,Ke={today:i,yesterday:{date:r,countsKey:a,selection:l}},{today:Pn,yesterday:Mn}}let Lo=!1,tn=null;async function dd(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Jn&&Jn.tagName.toUpperCase()==="SCRIPT"&&Jn.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 fd(){if(!Lo)return tn||(tn=(async()=>{const e=await dd();if(!e){tn=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 a=r,i=String(a.training_type||n),l=String(a.category_main_code||a.category_main||a.category_0||""),s=String(a.category_sub_code||a.category_sub||a.category_1||""),d=Object.assign({},a,{training_type:i,category_0:l,category_1:s});i==="LISTEN_IN_NOISE"?t.noise.push(d):i==="SHORT_STORY"?t.short.push(d):i==="LONG_STORY"?t.long.push(d):i==="ORDERING_SENTENCE"&&t.order.push(d)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}Xt.push(...t.noise),Qt.push(...t.short),Zt.push(...t.long),en.push(...t.order),Lo=!0,Ke=null;try{cd()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),tn)}async function pd(e=3e3){const t=fd();let n;try{await Promise.race([t,new Promise(o=>{n=setTimeout(o,e)})])}finally{n!==void 0&&clearTimeout(n)}return Lo}function Aa(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 md(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 gd=Ve,Cd=e=>{const[t,n,o]=e.split("-").map(Number);return Math.round(Date.UTC(t,(n||1)-1,o||1)/864e5)},hd=(e,t)=>{const n=e??{};return String(n.id??n.name??t)};function kn(e,t,n,o,r){if(!e.length||t<=0)return[];const a=md(Aa(`${n}|${o}|${r}`)),i=Cd(o)&1,l=e.filter((d,g)=>(Aa(`${n}|${r}|${hd(d,g)}`)>>>7&1)===i),s=l.length>=t&&e.length-l.length>=t;return gd(s?l:e,t,a)}function Bo(e,t,n){const o=r=>Math.max(0,e[r]||0);return{LISTEN_IN_NOISE:kn(Xt,o("LISTEN_IN_NOISE"),t,n,"LISTEN_IN_NOISE"),SHORT_STORY:kn(Qt,o("SHORT_STORY"),t,n,"SHORT_STORY"),LONG_STORY:kn(Zt,o("LONG_STORY"),t,n,"LONG_STORY"),ORDERING_SENTENCE:kn(en,o("ORDERING_SENTENCE"),t,n,"ORDERING_SENTENCE")}}function Ro(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const yd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Io(e=!1,t=yd,n){const o=Date.now(),r=kt(o),a=kt(o-864e5),i=n??"";return Xt.length>0||Qt.length>0||Zt.length>0||en.length>0?{today:Bo(t,i,r),yesterday:Bo(t,i,a)}:{today:Bo(t,i,r),yesterday:null}}function bd(e){const t=c.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=c.useRef(null),[o,r]=c.useState(!1),[a,i]=c.useState(!1),[l,s]=c.useState(0),[d,g]=c.useState(!1),[f,C]=c.useState(()=>Mt()),m=JSON.stringify([e??"",f]),h=c.useRef(null),w=c.useRef(m);c.useEffect(()=>{const y=()=>{const T=Date.now(),v=new Date(T+9*36e5),L=Date.UTC(v.getUTCFullYear(),v.getUTCMonth(),v.getUTCDate()+1)-9*36e5;return Math.max(1e3,L-T+1e3)};let S=setTimeout(function T(){C(Mt()),S=setTimeout(T,y())},y());return()=>clearTimeout(S)},[]),c.useEffect(()=>{w.current=m,h.current=null,r(!1),g(!1);let y=!1,S=!1,T=!1,v,L=0,I=null,N=0;const R=40,x=()=>{v!==void 0&&(clearInterval(v),v=void 0)};let O=!1;try{const k=new URLSearchParams(window.location.search),K=k.get("forceRefresh")||k.get("force");O=K==="1"||K==="true"}catch{}const z=k=>{S||(T=!0,h.current=m,t.current=k.today,n.current=k.yesterday,r(!0),g(!0),s(K=>K+1),y=!0,x())},Z=async()=>{if(y)return;if(!O){const K=Io(!1,void 0,e);if(Ro(K.today)){z(K);return}}if(I){++L>=R&&V();return}if(L>=N){N=L+8,I=pd(3e3).catch(()=>!1);try{await I}finally{I=null}if(y)return}const k=Io(O,void 0,e);if(Ro(k.today)){z(k);return}++L>=R&&V()};function V(){r(!0),g(!1),y=!0,x()}const F=()=>{if(S||T)return;const k=Io(O,void 0,e);Ro(k.today)&&z(k)};try{window.addEventListener("speechear.data.updated",F)}catch{}return v=setInterval(Z,250),Z(),()=>{y=!0,S=!0,x();try{window.removeEventListener("speechear.data.updated",F)}catch{}}},[e,f]);const b=c.useCallback(y=>{if(h.current!==m)return;const S=a?n.current:t.current,T=a?t.current:n.current;return S?.[y]?.length?S[y]:T?.[y]?.length?T[y]:void 0},[a,l,m]);return{loaded:w.current===m&&o,hasData:w.current===m&&d,showYesterday:a,setShowYesterday:i,getTrainingPerType:b}}const At=[];let xn=!1;function Ta(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=At[At.length-1];t&&(e.stopPropagation(),t())}function _a(e){return At.push(e),!xn&&typeof document<"u"&&(document.addEventListener("keydown",Ta),xn=!0),()=>{const t=At.lastIndexOf(e);t>=0&&At.splice(t,1),At.length===0&&xn&&typeof document<"u"&&(document.removeEventListener("keydown",Ta),xn=!1)}}function Sd(e,t=!0){const n=Cr(e);c.useEffect(()=>{if(t)return _a(()=>{n.current?.()})},[t,n])}const Po=(e,t)=>`${e}:${t??1}`,nn=new Map,Mo=new Set,ko=new Map,Fn=6e4;function wd(e,t){const[n,o]=c.useState(0),[r,a]=c.useState(0),i=JSON.stringify(Array.from(new Set(e.map(l=>Po(l.word,l.homonum)))).sort());return c.useEffect(()=>{const l=JSON.parse(i),s=Date.now(),d=l.filter(w=>!nn.has(w)&&!Mo.has(w)&&!(s-(ko.get(w)??-1/0)<Fn));let g=!1,f=null,C=1/0;const m=(w=Fn)=>{if(g)return;const b=Date.now()+w;b>=C||(f!==null&&clearTimeout(f),C=b,f=setTimeout(()=>a(y=>y+1),w))};for(const w of l){if(nn.has(w)||Mo.has(w))continue;const b=ko.get(w);b!=null&&s-b<Fn&&m(Math.max(0,Fn-(s-b)))}if(d.length===0)return()=>{g=!0,f!==null&&clearTimeout(f)};const h=Array.from(new Set(d.map(w=>w.slice(0,w.lastIndexOf(":")))));return Promise.resolve().then(()=>t(h)).then(w=>{for(const b of w)b.Meaning&&nn.set(Po(b.Word,b.Homonum??void 0),b.Meaning);if(w.length>0)for(const b of d)nn.has(b)||Mo.add(b);else{const b=Date.now();for(const y of d)ko.set(y,b);m()}g||w.length===0||o(b=>b+1)}).catch(()=>{m()}),()=>{g=!0,f!==null&&clearTimeout(f)}},[i,t,r]),c.useMemo(()=>{const l=JSON.parse(i),s=new Map;for(const d of l){const g=nn.get(d);g!=null&&s.set(d,g)}return s},[i,n])}function Ed(){const[e,t]=c.useState(null),n=c.useCallback(a=>t(a.getBoundingClientRect()),[]),o=c.useCallback(()=>t(null),[]),r=c.useCallback(a=>{const i=a.getBoundingClientRect();t(l=>l?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:r}}function Ad(e){const[t,n]=c.useState(null),[o,r]=c.useState(null),a=c.useRef(null);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const i=c.useCallback((s,d)=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{n(s),r(d)},e)},[e]),l=c.useCallback(()=>{a.current&&clearTimeout(a.current),n(null),r(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:l}}function Td(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,r=Math.max(1,Math.ceil(e.length/o)),a=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),r):1;return{pageItems:c.useMemo(()=>e.slice((a-1)*o,a*o),[e,a,o]),totalPages:r,curPage:a}}function va(e,t){const[n,o]=c.useState(e);n!==e&&(o(e),t(1))}function _d(e={}){const{defaultPageSize:t="25",resetOn:n}=e,[o,r]=c.useState(""),[a,i]=c.useState(t),[l,s]=c.useState(1),d=C=>{const m=Number(C);return Number.isFinite(m)&&m>=1?Math.floor(m):null},g=d(t)??25,f=d(a)??g;return va(JSON.stringify([o,a,...n??[]]),s),{query:o,setQuery:r,pageSize:a,setPageSize:i,perPage:f,page:l,setPage:s}}function vd(e="warning"){const[t,n]=c.useState(""),[o,r]=c.useState(e),[a,i]=c.useState(0),l=c.useCallback((f,C)=>{r(C),n(f),i(m=>m+1)},[]),s=c.useCallback(f=>l(f,"warning"),[l]),d=c.useCallback(f=>l(f,"normal"),[l]),g=c.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:a,showToast:l,showWarning:s,showNormal:d,clearToast:g}}const Dd=[{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."}],Nd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function Od(e){return Dd.map(t=>{const n=Nd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}const on={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},rn=on.blue,jn=on.green,an=on.amber,Hn=on.purple,Ld=on.pink,Bd=[{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:rn,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:rn,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:rn,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:rn,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:rn,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:jn,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:jn,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:jn,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:jn,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:an,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:an,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:an,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:an,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:an,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:Hn,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:Hn,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:Hn,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:Hn,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:Ld,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Rd(){const{t:e}=We.useTranslation();return c.useMemo(()=>{const t=Object.fromEntries(Od(e).map(o=>[o.key,o.label])),n={...t};return Bd.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,a]=c.useState(!1),[i,l]=c.useState({position:"fixed"}),s=c.useRef(null),d=c.useRef(null),g=c.useCallback(()=>{s.current&&l(e(s.current.getBoundingClientRect(),s.current))},[e]);c.useLayoutEffect(()=>{r&&g()},[r,g]),c.useEffect(()=>{if(!r)return;let m=d.current?.offsetHeight??0;m>0&&g();let h=0,w=null;typeof ResizeObserver<"u"&&d.current&&(w=new ResizeObserver(()=>{const N=d.current?.offsetHeight??0;if(N!==m){if(m=N,++h>4){w?.disconnect(),w=null;return}g()}}),w.observe(d.current));const b=N=>{const R=N.target;o&&R.closest?.(o)||s.current?.contains(R)||d.current?.contains(R)||a(!1)};document.addEventListener("mousedown",b),document.addEventListener("pointerdown",b);let y=null;const S=()=>{if(typeof requestAnimationFrame>"u"){g();return}y===null&&(y=requestAnimationFrame(()=>{y=null,g()}))},T=N=>{d.current?.contains(N.target)||(t==="reposition"?S():t==="close"&&a(!1))};t!=="ignore"&&window.addEventListener("scroll",T,!0);const v=()=>{n==="reposition"?S():n==="close"&&a(!1)};let L=null;const I=()=>{v(),L&&clearTimeout(L),L=setTimeout(()=>{L=null,n==="reposition"&&g()},250)};return n!=="ignore"&&(window.addEventListener("resize",v),window.addEventListener("orientationchange",I)),()=>{y!==null&&cancelAnimationFrame(y),w?.disconnect(),document.removeEventListener("mousedown",b),document.removeEventListener("pointerdown",b),t!=="ignore"&&window.removeEventListener("scroll",T,!0),n!=="ignore"&&(window.removeEventListener("resize",v),window.removeEventListener("orientationchange",I)),L&&clearTimeout(L)}},[r,g,t,n,o]),c.useEffect(()=>{if(r)return _a(()=>a(!1))},[r]);const f=c.useCallback(()=>a(m=>!m),[]),C=c.useCallback(()=>a(!1),[]);return{open:r,setOpen:a,toggle:f,close:C,style:i,triggerRef:s,menuRef:d}}function Pd(e,{mode:t="playback",autoStart:n=!1,onPlaySpeaker:o,onComplete:r,playMs:a=1100,feedbackMs:i=1500}={}){const[l,s]=c.useState([]),[d,g]=c.useState(0),[f,C]=c.useState("idle"),[m,h]=c.useState(null),[w,b]=c.useState([]),[y,S]=c.useState(null),[T,v]=c.useState(0),L=c.useRef(0),I=c.useCallback(j=>{L.current=typeof j=="function"?j(L.current):j,v(L.current)},[]),N=c.useRef(o),R=c.useRef(r);c.useEffect(()=>{N.current=o,R.current=r},[o,r]);const x=c.useRef([]),O=()=>{x.current.forEach(clearTimeout),x.current=[]},z=(j,J)=>{x.current.push(setTimeout(J,j))};c.useEffect(()=>()=>O(),[]);const Z=l[d]?.id??null,V=c.useRef(null),F=c.useCallback(()=>{O(),C("playing"),b([]),S(null),I(0);let j=0;e.forEach((J,W)=>{z(j,()=>{g(W),h(J.id),N.current?.(J)}),z(j+1e3,()=>{h(null),b(he=>[...he,J.id])}),j+=1300}),z(j,()=>{C("done"),R.current?.({score:0,total:e.length})})},[e,I]),k=c.useCallback((j,J)=>{if(J>=j.length){C("done"),R.current?.({score:L.current,total:j.length});return}V.current=null,g(J),S(null),C("playing"),h(j[J].id),N.current?.(j[J]),z(a,()=>{h(null),C("waiting")})},[a]),K=c.useCallback(()=>{O();const j=X(e);s(j),I(0),b([]),k(j,0)},[e,k,I]),pe=c.useCallback(()=>{t==="playback"?(s(e),F()):K()},[t,e,F,K]),re=c.useCallback(()=>{O(),C("idle"),h(null),b([]),S(null),g(0),I(0),s([])},[I]),Oe=JSON.stringify(e.map(j=>[j.id,j.label,j.angleDeg,j.deg,j.row,j.shortcut]));c.useEffect(()=>(n?pe():re(),()=>O()),[t,Oe,n]);const B=c.useCallback(j=>{f!=="waiting"||t==="playback"||V.current===d||(V.current=d,S(j),j===l[d]?.id&&I(J=>J+1),t==="exam"?(C("playing"),z(400,()=>k(l,d+1))):(C("feedback"),z(i,()=>k(l,d+1))))},[f,t,l,d,k,i,I]),H=t==="playback"?e.length:l.length;return{bind:{activeSpeakerId:m,playedIds:w,selectedId:y,answerId:Z,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:B},index:d,total:H,score:T,phase:f,done:f==="done",start:pe,reset:re}}/*! @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 Da(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 Md(e){if(Array.isArray(e))return e}function kd(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,a,i,l=[],s=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(s=(o=a.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(g){d=!0,r=g}finally{try{if(!s&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(d)throw r}}return l}}function xd(){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",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea"},Cs={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},hs={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},ys={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},bs={answer:"Answer",distractor:"Distractor"},Ss={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"},ws={clearAriaLabel:"Clear input"},Es={ariaLabel:"Select tab"},As={ariaLabel:"Tabs"},Ts={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},_s={ariaLabel:"User avatar"},vs={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},Ds={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel_one:"{{n}} session",countLabel_other:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},Ns={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},Os={manage:{unit:"item(s)"}},Ls={cancelLabel:"Cancel"},Bs={subtitle:"Select a topic to start listening practice."},Rs={steps:"Step {{current}} of {{total}}"},Is={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",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.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs_one:"{{count}} run",runs_other:"{{count}} runs",avgDuration:"{{sec}}s avg"},Ps={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Ms={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},ks={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},xs={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Fs={previewRegion:"Report preview \u2014 scrollable sideways"},js={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Hs={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},$s={clearSelection:"Clear selection"},Gs={showResult:"Show {{type}} result"},Ws={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Vs={loading:"Loading"},Us={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Ys={ariaLabel:"Breadcrumb"},zs={empty:"No items yet."},Ks={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"},qs={common:Pl,calendar:Ml,passCard:kl,searchField:xl,rating:Fl,colorPicker:jl,dropdown:Hl,accordion:$l,header:Gl,nav:Wl,settings:Vl,usage:Ul,account:Yl,help:zl,training:Kl,trainingSettings:ql,customers:Jl,payment:Xl,coupons:Ql,visits:Zl,company:es,trainingType:ts,myWordTraining:ns,myWordTable:os,keyWords:rs,wordTable:as,wordSearch:is,wordPrint:us,topic:ls,accessLinkManager:ss,login:cs,device:ds,manager:fs,wordPairs:ps,game:ms,footer:gs,landing:Cs,date:hs,trainingSetPage:ys,wordTrainingPreview:bs,wordData:Ss,textField:ws,segmentedControl:Es,tabs:As,fileUpload:Ts,avatar:_s,myHomework:vs,trainingStatus:Ds,store:Ns,homework:Os,inquiry:Ls,trainingPlanRun:Bs,progress:Rs,trainingMiss:Is,table:Ps,wordScore:Ms,topBanner:ks,datePicker:xs,report:Fs,tooltip:js,phonemeProfile:Hs,bulkBar:$s,debug:Gs,badge:Ws,loader:Vs,soundCompass:Us,breadcrumb:Ys,board:zs,promoBannerBg:Ks};const Js="0.347.0",Xs=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],ao="ko",Qs="ihab_display_language";function Fr(){if(typeof window>"u")return ao;try{const e=localStorage.getItem(Qs);if(e&&Xs.some(t=>t.code===e))return e}catch{}return ao}function jr(e){try{document.documentElement.lang=e}catch{}}Be.on("languageChanged",jr),jr(Fr()),Be.use(We.initReactI18next).init({resources:{ko:{translation:Il},en:{translation:qs}},lng:Fr(),fallbackLng:ao,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Hr=new Set(["field"]),io="none";function Zs(e){return e==null||String(e).trim()===""}function ec(e){return typeof e=="string"&&lo.includes(e)}function uo(e,t){if(!e)return!0;const n=e instanceof Set?e:new Set(e);return n.size===0?!0:Zs(t)?n.has(io):n.has(String(t))}const zt=["grade","syllables","pos","wordType","field"],lo=["1","2","3","4","none"],tc=["1","2","3","4","5+"],nc=["noun","verb","modifier"],oc=["native","sino","foreign","mixed"],rc={grade:lo,syllables:tc,pos:nc,wordType:oc,field:[]},ac={noun:["\uBA85","\uC218"],verb:["\uB3D9","\uD615"],modifier:["\uBD80","\uAD00"]},ic={native:"\uACE0\uC720",sino:"\uD55C\uC790",foreign:"\uC678\uB798",mixed:"\uD63C\uC885"},uc={grade:["\uB09C\uC774\uB3C4 \uB4F1\uAE09"]},lc={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)"]}},so=new Map;try{Be.store?.on?.("added",()=>so.clear())}catch{}function Kt(e){const t=so.get(e);if(t)return t;const n=Be.getFixedT(e),o={section:{grade:n("wordSearch.filter.difficulty","\uB4F1\uAE09"),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(lo.filter(r=>r!==io).map(r=>[r,n("wordSearch.filter.grade",{n:Number(r),defaultValue:`${r}\uB4F1\uAE09`})])),[io]: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 so.set(e,o),o}const co=()=>Array.from(new Set([Be.language,"ko","en"].filter(e=>!!e)));function qt(e){if(zt.includes(e))return e;for(const t of co()){const n=Kt(t);for(const o of zt)if(n.section[o]===e)return o}for(const t of zt)if(uc[t]?.includes(e))return t;return null}function st(e,t){if(Hr.has(e)||rc[e].includes(t))return t;for(const n of co()){const o=Kt(n).value[e];for(const[r,a]of Object.entries(o))if(a===t)return r}for(const[n,o]of Object.entries(lc[e]??{}))if(o.includes(t))return n;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 sc(e,t,n=Be.language){return Kt(n).value[e][t]??t}const cc=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"&&e?[e]:[];function fo(e){const t={};for(const[n,o]of Object.entries(e??{})){const r=qt(n);if(r)for(const a of cc(o)){const i=st(r,a);if(!i)continue;const l=t[r]??(t[r]=[]);l.includes(i)||l.push(i)}}return t}function po(e,t=Be.language){const n=Kt(t||"ko"),o={};for(const r of zt){const a=(e?.[r]??[]).map(i=>n.value[r][i]??(Hr.has(r)?i:void 0)).filter(i=>!!i);a.length&&(o[n.section[r]]=a)}return o}function dc(e,t=Be.language){const n={};for(const[o,r]of Object.entries(e??{}))qt(o)||(n[o]=r);return{...n,...po(fo(e),t)}}function fc(e){for(const t of co()){const n=Kt(t);if(zt.some(o=>n.section[o]===e))return t}return Be.language||"ko"}let On=null,$r=null,Gr=null;function pc(){const e=vn();if(e&&e.entries.length>0){const t=Ht();if(On&&$r===e&&Gr===t)return On;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 On=o,$r=e,Gr=t,On}return[]}const Ue=new Proxy([],{get(e,t){const n=pc(),o=n[t];return typeof o=="function"?o.bind(n):o}});function mo(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function Re(e,t){if(t>=e.length)return X(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)),a=n[o];n[o]=n[r],n[r]=a}return n.slice(0,t)}let go=null,Wr=null;function tt(){const e=vn();if(go&&Wr===e)return go;const t=new Map;for(const n of Ue)n.w&&t.set(n.w,n.pron);return go=t,Wr=e,t}function de(e){return tt().get(e)||e}function Ln(e,t,n=new Set){const o=[];for(const r of X(e)){if(o.length>=t)break;const a=de(r);n.has(a)||(n.add(a),o.push(r))}return o}let mc=0;function ge(e){return`${e}-rt-${++mc}`}function Et(e){const t=Nr();if(!t||t.total===0){const r=new Set;for(const a of e)r.add(a);return r}const n=Tn(),o=new Set;for(const r of e)n.has(r)&&o.add(r);return o}const Bn=new Map;let Vr=null,Ur=null,Yr=null;function Jt(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function Co(e){const t=Array.isArray(e.choseong)&&e.choseong.length===0?"[]":Jt(e.choseong),n=e.composition,o=n?.syllable==null?"":Array.isArray(n.syllable)?n.syllable.slice().sort().join(","):String(n.syllable),r=n?`${Jt(n.cho)}/${Jt(n.jung)}/${Jt(n.jong)}/${n.jongNone?"N":""}/${o}`:"",a=Jt(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${a}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}const ho=new Map;function gc(e){return Co({...e,count:void 0,choicesPerItem:void 0,fullCount:!1})}async function Te(e){const t=vn(),n=Ht(),o=e.excludeNoImage?Tn():null;(t!==Vr||n!==Ur||e.excludeNoImage&&o!==Yr)&&(Bn.clear(),ho.clear(),Vr=t,Ur=n,Yr=o);const r=Co(e);return Bn.has(r)||Bn.set(r,Cc(e)),Bn.get(r)}function zr(e){if(!e)return null;const t=i=>i==null?null:Array.isArray(i)?i.length?i:null:[i],n=t(e.cho),o=t(e.jung),r=!!e.jongNone,a=r?null:t(e.jong);return n||o||a||r?r&&!n&&!o&&!a?i=>Li(i):i=>Ri(i,{cho:n,jung:o,jong:a,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?i=>o.has(Ft(i)):null].filter(i=>i!=null):[];if(!t&&r.length===0)return null;const a=e.phonemeView==="pron";return i=>{if(!uo(t,i.grade))return!1;if(r.length===0)return!0;const l=a?de(i.w):i.w;return r.every(s=>s(l))}}async function Cc(e){const{difficulty:t=null,choseong:n=null,composition:o=null,targetSyllable:r=null,excludeNoImage:a=!1}=e,i=e.grade&&e.grade.length>0?new Set(e.grade):null,l=e.sameStructureOnly??!0,s=e.phonemeView==="pron"?"pron":"char",d=Math.max(1,e.contrastCount??1),g=t==="cho"||t==="jung"||t==="jong",f=g&&d>=2,C=t==="count",m=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?B=>h.has(Ft(B)):null].filter(B=>B!=null):[],b=t==="random"||t===null,y=b||C,S=b||f||C;let T=Ue.filter(B=>!B.w||!uo(i,B.grade)?!1:S?!0:Array.isArray(B.p)&&B.p.length>0);m&&(T=T.filter(B=>{for(const H of m)if(Ni(B.w,H))return!0;return!1})),w.length>0&&(T=T.filter(B=>{const H=s==="pron"?de(B.w):B.w;return w.every(j=>j(H))})),r&&(T=T.filter(B=>B.w[0]===r));let v;if(a){const B=new Set;for(const H of T)if(B.add(H.w),Array.isArray(H.p))for(const j of H.p)B.add(j);if(y)for(const H of Ue)H.w&&B.add(H.w);v=Et(B)}else{const B=new Set;for(const H of T)if(B.add(H.w),Array.isArray(H.p))for(const j of H.p)B.add(j);if(y)for(const H of Ue)H.w&&B.add(H.w);v=B}let L=null;if(f){const B=new Set;for(const H of Ue)H.w&&B.add(H.w);L=a?Et(B):B}const I=T.filter(B=>v.has(B.w)),N=600,R=Array.from(v),x=R.length>N?Re(R,N):R,O=C&&o!=null&&(ce(o.cho)||ce(o.jung)||ce(o.jong)),z=2500,Z=new Map;if(C&&!O&&d>=2){for(const B of R){const H=Ft(B),j=Z.get(H);j?j.push(B):Z.set(H,[B])}for(const[B,H]of Z)H.length>z&&Z.set(B,Re(H,z))}const V=vi();let F=null;if(O){const B=gc(e),H=a?Tn():null,j=ho.get(B);F=j&&j.imageOkSet===H?j.map:iu(o,R,V,l,s,de),ho.set(B,{imageOkSet:H,map:F})}const k=500,K=1500,pe=e.fullCount?I:t==="random"?I.length>k?Re(I,k):I:I.length>K?Re(I,K):I,re=Ht(),Oe=[];for(const B of pe){let H;const j=de(B.w);if(f)H=Pi(B.w,t,d,L,24).filter(J=>de(J)!==j);else if(C)O?H=(F.get(B.w)??[]).filter(J=>de(J)!==j):d<=1?H=kr(B.w,re,{okSet:v,pronOf:de,decompOf:V,sameStructureOnly:!1}):H=(Z.get(Ft(B.w))??[]).filter(J=>{if(J===B.w||de(J)===j)return!1;const W=Mi(j,de(J));return d>=5?W>=5:W===d});else if(b){const J=W=>W!==B.w&&W.length===B.w.length&&de(W)!==j;if(e.fullCount){const W=Math.max(1,(e.choicesPerItem??3)-1),he=[],$e=new Set;for(const ot of x){if(!J(ot))continue;const qe=de(ot);if(!$e.has(qe)&&($e.add(qe),he.push(ot),he.length>=W))break}H=he}else H=x.filter(J)}else{const J=t;H=kr(B.w,re,{kind:J,okSet:v,pronOf:de,decompOf:V,sameStructureOnly:!1}),H.length===0&&(H=(x.length>30?Re(x,30):x).filter(W=>W!==B.w&&Di(B.w,W)===t&&de(W)!==j))}if(l&&H.length>0&&(g||C&&!O)){const J=V(de(B.w));H=H.filter(W=>!oo(J,V(de(W))))}H.length!==0&&Oe.push({word:B,usable:H})}return Oe}async function qr(e,t){const{choicesPerItem:n=3,count:o=10}=t,r=n-1,a=(await Te(t)).filter(l=>l.usable.length>=r),i=[];for(const l of X(a)){if(i.length>=o)break;const s=Ln(l.usable,r);if(s.length<r)continue;const d=X([l.word.w,...s]);i.push({id:ge(e+"-item"),index:i.length+1,word:l.word.w,syllables:l.word.s,choices:d,answerIndex:d.indexOf(l.word.w)})}return i}async function hc(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Te({...e,difficulty:null});if(r.length<t)return[];const a=e.composition??null,i=[],l=X([...r]);for(const s of l){if(i.length>=n)break;const d=s.word.w,g=[...s.word.pron||d],f=a&&Nn(a)?g.filter(b=>{const y=te(b);return!!y&<(y,a)}):[],C=mo(f.length?f:g);if(!C)continue;const m=r.filter(b=>b.word.w!==d&&b.word.s===s.word.s&&!(b.word.pron||b.word.w).includes(C)&&b.word.pron!==s.word.pron);if(m.length<o)continue;const h=Ln(m.map(b=>b.word.w),o);if(h.length<o)continue;const w=X([d,...h]);i.push({id:ge("HPI-item"),index:i.length+1,targetSyllable:C,word:d,choices:w,answerIndex:w.indexOf(d)})}return i}async function yc(e){const{count:t=10}=e,n=(await Te(e)).filter(a=>a.usable.length>=1);if(!n.length)return[];const o=n.length>=t?Re(n,t):X(Array.from({length:t},(a,i)=>n[i%n.length])),r=X(Array.from({length:t},(a,i)=>i<Math.ceil(t/2)));return o.map((a,i)=>{const l=r[i];let s;if(l)s=[a.word.w,a.word.w];else{const d=mo(a.usable);s=Math.random()<.5?[a.word.w,d]:[d,a.word.w]}return{id:ge("SOD-item"),index:i+1,word:a.word.w,pair:s,same:l}})}async function bc(e){const{choicesPerItem:t=3,count:n=10}=e,o=t-1,r=await Te({...e,difficulty:null});if(r.length<t+1)return[];const a=r.map(C=>C.word.w),i=new Map(r.map(C=>[C.word.w,C.word.pron])),l=C=>(i.get(C)||C)[0]??"",s={};for(const C of r){const m=l(C.word.w);m&&(s[m]||(s[m]=[]),s[m].push(C.word.w))}const d=Object.entries(s).filter(([,C])=>new Set(C.map(m=>i.get(m)||m)).size>=2).map(([C])=>C);if(d.length===0)return[];const g=[],f=X([...d]);for(let C=0;g.length<n&&C<n*4;C++){const m=f[C%f.length],h=s[m];if(h.length<2)continue;const w=X([...h]),b=w[0],y=i.get(b)||b,S=w.find(N=>N!==b&&(i.get(N)||N)!==y);if(!b||!S)continue;const T=i.get(S)||S,v=a.filter(N=>l(N)!==m&&N!==b&&N!==S&&N.length===S.length&&(i.get(N)||N)!==T);if(v.length<o)continue;const L=Ln(v,o);if(L.length<o)continue;const I=X([S,...L]);g.push({id:ge("SWS-item"),index:g.length+1,sourceWord:b,targetSyllable:m,word:S,choices:I,answerIndex:I.indexOf(S)})}return g}function Jr(e,t,n){const o=tt(),r=s=>o.get(s)||s,a=(s,d)=>{const g=[...s],f=[...d];if(g.length!==f.length)return-1;let C=-1;for(let m=0;m<g.length;m++)if(g[m]!==f[m]){if(C>=0)return-1;C=m}return C},i=e.map(s=>({e:s,swaps:s.usable.filter(d=>!!d&&a(s.word.w,d)>=0&&r(d)!==r(s.word.w))})).filter(s=>s.swaps.length>0),l=[];for(const{e:s,swaps:d}of X(i)){if(l.length>=t)break;const g=mo(d)??"",f=[...s.word.w],C=[...g],m=a(s.word.w,g),h=Ln(s.usable.filter(w=>w&&w!==g),2,new Set([r(g),r(s.word.w)]));h.length<2||l.push({id:ge(n),index:l.length+1,word:s.word.w,original:s.word.w,changed:g,changedFrom:m>=0?f[m]:"",changedTo:m>=0?C[m]:"",distractors:h})}return l}async function Xr(e,t,n){const{count:o=10}=t,r=tt(),a=Ue.filter(h=>h.w&&h.s===e),i=t.excludeNoImage?Et(a.map(h=>h.w)):null,l=i?a.filter(h=>i.has(h.w)):a,s=new Set(l.map(h=>h.w)),d=Cu(s),g=t.phonemeView??"char",f=t.composition??null,C=Kr(t),m=[];for(const h of X(l)){if(m.length>=o)break;if(C&&!C(h))continue;const w=hu(h.w,f,r,g,d,null,null);if(!w)continue;const b=w.distractors[0],y=[...h.w],S=[...b],T=y.findIndex((v,L)=>v!==S[L]);m.push({id:ge(n),index:m.length+1,word:h.w,original:h.w,changed:b,changedFrom:T>=0?y[T]:"",changedTo:T>=0?S[T]:"",distractors:w.distractors.slice(1)})}return m}async function Sc(e){return Xr(2,e,"CS2-item")}async function wc(e){return Xr(3,e,"CS3-item")}async function Ec(e){const t=(await Te({...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 Ac(e){const t=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",n=(await Te({...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 Tc(e){const{count:t=10}=e,n=(await Te({...e})).filter(o=>o.word.s===2);return Re(n,t).map((o,r)=>({id:ge("M2S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}async function _c(e){const{count:t=10}=e,n=(await Te({...e})).filter(o=>o.word.s===3);return Re(n,t).map((o,r)=>({id:ge("M3S-item"),index:r+1,word:o.word.w,answer:o.word.w,parts:[...o.word.w]}))}function yo(e){const t=Ue.map(n=>n.w);return e.excludeNoImage?Et(t):new Set(t)}async function vc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s===2),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=du(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=[...l.word.w],C=f[0]===d?f[1]:f[0];i.push({id:ge("D2-item"),index:i.length+1,original:l.word.w,word:l.word.w,dropped:C,missingResult:d,distractors:g})}return i}async function Dc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s===3),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=fu(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=[...l.word.w];let C="";for(let m=0;m<f.length;m++)if(f.filter((h,w)=>w!==m).join("")===d){C=f[m];break}i.push({id:ge("D3-item"),index:i.length+1,original:l.word.w,word:l.word.w,dropped:C,missingResult:d,distractors:g})}return i}async function Nc(e){const{count:t=10}=e,n=(await Te({...e})).filter(l=>l.word.s>=3),o=tt(),r=yo(e),a=e.phonemeView??"char",i=[];for(const l of X(n)){if(i.length>=t)break;const s=pu(l.word.w,e.composition??null,o,a,r);if(!s)continue;const[d,...g]=s.distractors,f=l.word.w,C=s.dropped??(f.startsWith(d)?f.slice(d.length):f.endsWith(d)?f.slice(0,f.length-d.length):"");i.push({id:ge("DPC-item"),index:i.length+1,original:f,word:f,dropped:C,missingResult:d,distractors:g})}return i}async function Oc(e){const{count:t=10}=e,n=(await Te({...e})).map(o=>o.word.w);return n.length<3?[]:Array.from({length:t},(o,r)=>{const a=Re(n,3);return{id:ge("LRO-item"),index:r+1,sequence:a,choices:X(a)}})}function Rn(e,t,n){const o=Ue.filter(l=>l.w&&l.s===e),r=t.excludeNoImage?Et(o.map(l=>l.w)):null,a=Kr(t),i=[];for(const l of o)if(!(r&&!r.has(l.w))&&!(a&&!a(l))){if(n){const s=te(l.w);if(!s||!n(s))continue}i.push(l)}return i}function Lc(e){const t=Rn(1,e,Dn.MERGE_2_PHONEMES.syllable);return Re(t,e.count??10).map((n,o)=>{const r=te(n.w);return{id:ge("M2P-item"),index:o+1,parts:[me[r.cho],Ae[r.jung]],answer:n.w,word:n.w}})}function Bc(e){const t=Rn(1,e,Dn.MERGE_3_PHONEMES.syllable);return Re(t,e.count??10).map((n,o)=>{const r=te(n.w);return{id:ge("M3P-item"),index:o+1,parts:[me[r.cho],Ae[r.jung],Ne[r.jong]],answer:n.w,word:n.w}})}function Rc(e){const t=Dn.DROP_FINAL_CONSONANT_FROM_1SYLL,n=Rn(t.syllables,e,t.syllable),o=tt(),r=[];for(const a of X(n)){if(r.length>=(e.count??10))break;const i=mu(a.w,null,o);if(!i)continue;const[l,...s]=i.distractors;r.push({id:ge("DFC-item"),index:r.length+1,original:a.w,word:a.w,result:l,distractors:s})}return r}function Ic(e){const t=Dn.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,n=Rn(t.syllables,e,t.syllable),o=tt(),r=[];for(const a of X(n)){if(r.length>=(e.count??10))break;const i=gu(a.w,null,o);if(!i)continue;const l=te(o.get(a.w)||a.w);if(!l)continue;const[s,...d]=i.distractors;r.push({id:ge("RCP-item"),index:r.length+1,base:a.w,word:a.w,missingConsonant:me[l.cho],remaining:s,distractors:d})}return r}const In=new Map;let Qr=null,Zr=null,ea=null,bo=0;async function ta(e,t={}){const n=vn(),o=Ht(),r=t.excludeNoImage?Tn():null;(n!==Qr||o!==Zr||t.excludeNoImage&&r!==ea)&&(In.clear(),bo++,Qr=n,Zr=o,ea=r);const a=`${e}:${Co(t)}`;if(In.has(a))return In.get(a);const i=bo,l=await Mc(e,t);return i===bo&&In.set(a,l),l}const Pc={SAME_SOUND_PICK:e=>qr("SSP",e),HEAR_AND_PICK_SAME:e=>qr("HPS",e),HEAR_AND_PICK_INCLUDED:e=>hc(e),SAME_OR_DIFF:e=>yc(e),STARTS_WITH_SAME_SOUND:e=>bc(e),LISTEN_AND_REMEMBER_ORDER:e=>Oc(e),MERGE_2_SYLLABLES:e=>Tc(e),MERGE_3_SYLLABLES:e=>_c(e),MERGE_2_PHONEMES:e=>Lc(e),MERGE_3_PHONEMES:e=>Bc(e),DROP_1_FROM_2SYLL:e=>vc(e),DROP_1_FROM_3SYLL:e=>Dc(e),DROP_PART_FROM_COMPOUND:e=>Nc(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>Rc(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Ic(e),CHANGE_1_SYLL_IN_2SYLL:e=>Sc(e),CHANGE_1_SYLL_IN_3SYLL:e=>wc(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Ec(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Ac(e)};async function Mc(e,t={}){const n=Pc[e];return n?await n(t):[]}async function kc(e){const t=["random","count"],n=Object.keys(eo);let o=0;for(const r of t)for(const a of n){const i=eo[a];ta(a,{difficulty:i.difficulty?r:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++o%6===0&&await new Promise(l=>setTimeout(l,0))}}async function xc(e){const t=await Te({...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 Fc(e={}){const t=[];for(const l of Ue)l.w&&t.push(l.w);const n=e.excludeNoImage?Et(t):t,o=new Set,r=new Set,a=new Set,i=new Set;for(const l of n){i.add(Ft(l));for(const s of l){const d=te(s);if(d&&(me[d.cho]!=="\u3147"&&o.add(me[d.cho]),r.add(Ae[d.jung]),d.jong>0)){a.add(Ne[d.jong]);const g=An[d.jong];g&&g.forEach(f=>a.add(f))}}}return{cho:o,jung:r,jong:a,syllable:i}}const Fe="\uC804\uCCB4";function na(){const{t:e}=We.useTranslation();return c.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function oa(e,t,n){return{label:t.difficulty,items:[...[1,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}}function ra(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function aa(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function jc(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 Hc(e,t){const n=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return t?.includeStructure&&n.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:n,multiple:!0,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function $c(e,t){const{label:n,headValue:o,midValue:r,tailValue:a,includeMid:i=!0,headDisabled:l,midDisabled:s,tailDisabled:d,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:l},...i?[{value:r,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:s}]:[],{value:a,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:d}]}}function Gc(e,t,n){const o=qt(n),r=o&&t!==Fe?st(o,t):null;if(o&&(t===Fe||r)){const l={},s={};for(const[m,h]of Object.entries(e))(qt(m)===o?s:l)[m]=h;if(t===Fe)return l;const d=fo(s)[o]??[],g=d.includes(r)?d.filter(m=>m!==r):[...d,r];if(g.length===0)return l;const f=po({[o]:g},fc(n)),C=Object.values(f)[0]??[];return{...l,[n]:C}}if(t===Fe){const{[n]:l,...s}=e;return s}const a=e[n]??[],i=a.includes(t)?a.filter(l=>l!==t):[...a,t];if(i.length===0){const{[n]:l,...s}=e;return s}return{...e,[n]:i}}Object.fromEntries(Object.entries(Zn).map(([e,{nucleus:t}])=>[e,t]));const Wc={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Vc={"\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"]},Uc={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:Vc,typeMap:Wc},ia=new WeakMap;function Yc(e,t){const n=ia.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[a,i]of Object.entries(e??{})){const l=a===t.difficulty?"grade":a===t.syllables?"syllables":a===t.partOfSpeech?"pos":a===t.wordType?"wordType":a===t.field?"field":qt(a);if(l)for(const s of Array.isArray(i)?i:typeof i=="string"?[i]:[])r[l].includes(s)||r[l].push(s)}return ia.set(e,{keys:t,value:o}),o}function zc(e,t,n=Uc){const{grades:o,syls:r,poses:a,types:i}=Yc(t,n);if(o.length){const l=o.map(s=>st("grade",s)??s.replace(/\D/g,"")).filter(s=>s!=="");if(l.length===0||!uo(l,e.grade))return!1}if(r.length){const l=e.syllables??0;if(!r.some(s=>{const d=s===n.syllable5plus?"5+":st("syllables",s);return d==="5+"?l>=5:l===parseInt(d??s)}))return!1}return!(a.length&&!a.flatMap(l=>n.posMap[l]??ac[st("pos",l)??""]??[l]).some(l=>(e.pos??"").includes(l))||i.length&&!i.some(l=>e.wordType===(n.typeMap[l]??ic[st("wordType",l)??""])))}const Kc={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"})},qc={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"})},Jc={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 ua(e,t){if("place"in t)return Kc[t.place](e);const n=qc[t.vowel](e);return t.glide?`${n} \xB7 ${Jc[t.glide](e)}`:n}const Xc=(e,{defaultValue:t})=>t,la=(e,t)=>({jamos:e,phonetic:t,tooltip:ua(Xc,t)}),Ye=(e,t)=>t.map(n=>la([n],{place:e})),fe=(e,t,n)=>la([...e],n?{vowel:t,glide:n}:{vowel:t}),So={cho:[Ye("labial",["\u3142","\u3143","\u314D","\u3141"]),Ye("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Ye("alveolar",["\u3145","\u3146"]),Ye("palatal",["\u3148","\u3149","\u314A"]),Ye("velar",["\u3131","\u3132","\u314B"]),Ye("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:[Ye("labial",["\u3142","\u3141"]),Ye("alveolar",["\u3137","\u3134","\u3139"]),Ye("velar",["\u3131","\u3147"])]},Qc=[...me],Zc=[...Ae],ed=Ne.filter(e=>e!==""),ze=e=>e===je?[]:Array.from(e),je="__NO_CODA__",sa=[1,2,3,4],He=5,td=12,ca="SYL_",wo=e=>`${ca}${e}`,nd=e=>Number(e.slice(ca.length));function Eo(e){return e>=He?Array.from({length:td-He+1},(t,n)=>He+n):[e]}const da={cho:Qc,jung:Zc,jong:ed},Ao=e=>e.map(t=>t.map(({jamos:n,phonetic:o,tooltip:r})=>({v:n.join(""),phonetic:o,tooltip:r}))),To={cho:Ao(So.cho),jung:Ao(So.jung),jong:Ao(So.jong)},fa={};To.jung.flat().forEach(({v:e})=>{for(const t of ze(e))fa[t]=e});const od=new Set(To.cho.flat().map(e=>e.v));function pa(e,t){return e==="cho"?od.has(t)?t:null:e==="jung"?fa[t]??t:xt(t)}function ma(e,t,n){if(e==="jung"){const o=ze(t);return n&&o.includes(n)?n:o[0]??t}return e==="jong"&&n&&xt(n)===t?n:t}function ga(e,t,n,o){const r=(a,i)=>i?a==="jong"&&i===je?je:t==="pron"?pa(a,i):ma(a,i,a==="jung"?n:a==="jong"?o:null):null;return{...e,cho:r("cho",e.cho),jung:r("jung",e.jung),jong:r("jong",e.jong)}}const _o={cho:null,jung:null,jong:null,syllable:null},vo=e=>Array.isArray(e)?e.filter(ec):[],rd="wt_filter",Ca=e=>`wt_filter_${e}`,Do=["noun","verb","modifier"],No=["native","sino","foreign","mixed"];function ha(e,t,n,o,r){if(!Array.isArray(e))return[];const a=[];for(const i of e){if(typeof i!="string")continue;const l=t.includes(i)?i:t.find(s=>r.some(d=>o(d,n(s))===i));l&&!a.includes(l)&&a.push(l)}return a}function ya(e){try{const t=localStorage.getItem(Ca(e))??localStorage.getItem(rd);if(t)return JSON.parse(t)}catch{}return null}function ba(e){const t=e?.phonemeView;return t==="pron"?"pron":t==="direct"?"direct":"char"}function ad(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?{..._o,cho:t.choseong}:_o}const Sa=["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 wa(e){const t=e("wordPairs.filter.difficultyInfo",{returnObjects:!0,defaultValue:Sa});return Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string")?t:Sa}function id(e,t,n){const{t:o,i18n:r}=We.useTranslation(),[a]=c.useState(()=>n?.resetOnMount?null:ya(e)),[i,l]=c.useState(ba(a)),[s,d]=c.useState(()=>ad(a)),g=c.useCallback(()=>t.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:je,syllable:t.fixedSyllable??null}:{cho:null,jung:null,jong:t.fixedNoCoda?je:null,syllable:t.fixedSyllable??null},[t.requireSyllable,t.fixedSyllable,t.fixedNoCoda]);c.useEffect(()=>{!t.requireSyllable&&t.fixedSyllable==null&&!t.fixedNoCoda||d(E=>E.cho||E.jung||E.syllable!=null||E.jong?E:g())},[]);const f=c.useMemo(()=>ce(s.cho)||ce(s.jung)||ce(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),C=c.useRef(i==="char"?s.jung:null),m=c.useRef(i==="char"?s.jong:null);c.useEffect(()=>{i==="char"&&(C.current=s.jung,m.current=s.jong)},[i,s.jung,s.jong]);const[h,w]=c.useState(n?.resetOnMount?!!n?.defaultImageOnly:a?.excludeNoImage??!0),[b,y]=c.useState(n?.resetOnMount?!1:a?.sameStructureOnly??!0),[S,T]=c.useState(vo(a?.gradeFilter)),v=Array.from(new Set([r.language,"ko","en"].filter(Boolean))),L=(E,$)=>r.getFixedT(E)($),I=E=>ha(E,Do,$=>`wordSearch.filter.pos.${$}`,L,v),N=E=>ha(E,No,$=>`wordSearch.filter.type.${$}`,L,v),[R,x]=c.useState(()=>I(a?.posFilter)),[O,z]=c.useState(()=>N(a?.wordTypeFilter)),Z=c.useRef(n?.resetKey);c.useEffect(()=>{Z.current!==n?.resetKey&&(Z.current=n?.resetKey,d(g()),w(!!n?.defaultImageOnly),y(!1),T([]),x([]),z([]))},[n?.resetKey]);const V=na(),F=c.useMemo(()=>Object.keys(V.posMap),[V]),k=c.useMemo(()=>Object.keys(V.typeMap),[V]),K=c.useMemo(()=>R.map(E=>F[Do.indexOf(E)]).filter(Boolean),[R,F]),pe=c.useMemo(()=>O.map(E=>k[No.indexOf(E)]).filter(Boolean),[O,k]),[re,Oe]=c.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[B,H]=c.useState(!1),[j,J]=c.useState(null),W=1,he=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length),[$e,ot]=c.useState(e);c.useEffect(()=>{if($e!==e){if(!n?.resetOnMount){const E=ya(e);d(E?.composition??g()),w(E?.excludeNoImage??!0),y(E?.sameStructureOnly??!0),l(ba(E)),T(vo(E?.gradeFilter)),x(I(E?.posFilter)),z(N(E?.wordTypeFilter))}ot(e)}},[e,$e,n?.resetOnMount]),c.useEffect(()=>{if(!n?.resetOnMount&&$e===e)try{localStorage.setItem(Ca(e),JSON.stringify({contrastCount:he,composition:s,excludeNoImage:h,sameStructureOnly:b,phonemeView:i,gradeFilter:S,posFilter:R,wordTypeFilter:O}))}catch{}},[n?.resetOnMount,e,$e,he,s,h,b,i,S,R,O]);const[qe,vt]=c.useState(0);Xn("wordpool:update",()=>vt(E=>E+1)),Xn(Ar,()=>vt(E=>E+1));const dn=c.useRef(r.language);c.useEffect(()=>{dn.current!==r.language&&(dn.current=r.language,vt(E=>E+1))},[r.language]),c.useEffect(()=>{if(!t.choseong)return;let E=!1;return Fc({difficulty:f,excludeNoImage:h}).then($=>{E||(Oe($),H($.cho.size+$.jung.size+$.jong.size>0))}).catch(()=>{E||(Oe({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),H(!1))}),()=>{E=!0}},[t.choseong,f,h,qe]),c.useEffect(()=>{let E=!1;const $=s,M=$.cho?ze($.cho):null,U=$.jung?ze($.jung):null,Q=$.jong===je,Me=Q?null:$.jong?ze($.jong):null,Le=$.syllable!=null?Eo($.syllable):null,Ge=!!(M||U||Me||Q||Le);return xc({difficulty:t.difficulty?f:null,contrastCount:t.difficulty?he:1,composition:t.choseong&&Ge?{cho:M,jung:U,jong:Me,jongNone:Q,syllable:Le}:null,excludeNoImage:h,sameStructureOnly:b,phonemeView:i==="pron"?"pron":"char",grade:S.length>0?S:null}).then(Xe=>{E||J(Xe)}).catch(()=>{E||J(null)}),()=>{E=!0}},[t.choseong,t.difficulty,f,he,s,i,h,b,qe,S]),c.useEffect(()=>{B&&d(E=>{const $={...E};let M=!1;return["cho","jung","jong"].forEach(U=>{const Q=E[U];!Q||Q===je||ze(Q).some(Me=>re[U].has(Me))||($[U]=null,M=!0)}),E.syllable!=null&&t.fixedSyllable==null&&(E.syllable>=He?[...re.syllable].some(U=>U>=He)||($.syllable=null,M=!0):(!re.syllable.has(E.syllable)||E.syllable<W)&&($.syllable=null,M=!0)),M?$:E})},[re,B,W,t.fixedSyllable]);const Dt=c.useMemo(()=>{const E=$=>{const M=new Set;for(const U of da[$])re[$].has(U)&&M.add(U);return M};return{cho:E("cho"),jung:E("jung"),jong:E("jong")}},[re]),Nt=c.useMemo(()=>({exact:new Set(sa.filter(E=>re.syllable.has(E))),min:[...re.syllable].some(E=>E>=He)}),[re]),Y=c.useMemo(()=>({composition:o("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:o("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:o("wordPairs.onset","\uCD08\uC131"),vowel:o("wordPairs.vowel","\uBAA8\uC74C"),coda:o("wordPairs.coda","\uC885\uC131"),phonemeGroup:o("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:o("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:o("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:o("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:o("training.filter.random","\uBB34\uC791\uC704"),exclude:o("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:o("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:o("common.none","\uC5C6\uC74C"),noImage:o("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:o("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:o("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:o("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:o("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:o("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[o]),ne=c.useMemo(()=>({[Y.trainOnset]:"cho",[Y.trainVowel]:"jung",[Y.trainCoda]:"jong"}),[Y]),Je=c.useCallback((E,$)=>({title:$,items:E}),[]),ee=c.useMemo(()=>[o("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),o("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[o]),Ot=c.useMemo(()=>{const E=[];if(t.choseong){const $={value:je,displayLabel:Y.codaExclude},M=t.fixedNoCoda===!0,U=(Q,Me)=>{const Le=M&&Q==="jong",Ge={label:Me,groupLabel:Y.phonemeGroup,allOption:!t.requireSyllable,allLabel:Y.noLimit,allOptionDisabled:Le};if(i==="pron"){const Ee=To[Q].map(ft=>ft.map(({v:Qe,phonetic:mn})=>{const pt=ze(Qe),Bt=ua(o,mn),mt=Le||!pt.some(Rt=>re[Q].has(Rt));return pt.length>1?{value:Qe,labels:pt,tooltip:Bt,disabled:mt}:{value:Qe,tooltip:Bt,disabled:mt}}));return Q==="jong"&&!t.requireCoda&&Ee.unshift([$]),{...Ge,groups:Ee}}const Xe=da[Q].map(Ee=>!Le&&Dt[Q].has(Ee)?Ee:{value:Ee,disabled:!0});return{...Ge,items:Q==="jong"&&!t.requireCoda?[$,...Xe]:Xe}};E.push(U("cho",Y.trainOnset)),E.push(U("jung",Y.trainVowel)),E.push(U("jong",Y.trainCoda))}if(E.push({...oa(o,V,{labelInfo:Je(wa(o))}),label:Y.gradeLabel}),t.partOfSpeech&&E.push(ra(V)),t.wordType&&E.push(aa(V)),t.choseong||t.fixedSyllable!=null){const $=t.fixedSyllable;E.push({label:Y.syllableCount,items:[...sa.map(M=>({value:wo(M),displayLabel:o("wordPairs.syllableN",{n:M,defaultValue:"{{n}}\uC74C\uC808"}),disabled:$!=null?M!==$:!Nt.exact.has(M)||M<W})),{value:wo(He),displayLabel:o("wordPairs.syllableNPlus",{n:He,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:$!=null?He!==$:!Nt.min}],allOption:!0,allOptionDisabled:$!=null})}return t.choseong?E.push({label:Y.exclude,displayLabel:Y.selectLabel,multiple:!0,items:[Y.excludeImage,Y.sameStructure],labelInfo:Je(ee)}):E.push({label:Y.exclude,displayLabel:Y.selectLabel,multiple:!0,items:[Y.excludeImage],labelInfo:Je([ee[0]])}),E},[t.choseong,t.partOfSpeech,t.wordType,t.requireSyllable,t.fixedSyllable,t.fixedNoCoda,t.requireCoda,W,Dt,re,i,Nt,Y,o,Je,ee,V]),De={...(t.choseong||t.fixedSyllable!=null)&&s.syllable!=null?{[Y.syllableCount]:wo(s.syllable)}:{},...t.choseong&&s.cho?{[Y.trainOnset]:s.cho}:{},...t.choseong&&s.jung?{[Y.trainVowel]:s.jung}:{},...t.choseong&&s.jong?{[Y.trainCoda]:s.jong}:{},[Y.exclude]:[...h?[Y.excludeImage]:[],...b?[Y.sameStructure]:[]],[Y.gradeLabel]:S.map(E=>sc("grade",E)),...t.partOfSpeech?{[V.partOfSpeech]:K}:{},...t.wordType?{[V.wordType]:pe}:{}},rt=c.useCallback((E,$)=>{if($===Y.exclude)E===Y.excludeImage?w(M=>!M):E===Y.sameStructure&&y(M=>!M);else if($===Y.syllableCount)d(M=>{if(!E||E===Fe)return{...M,syllable:null};const U=nd(E);return{...M,syllable:M.syllable===U?null:U}});else if($===Y.gradeLabel){if(!E||E===Fe){T([]);return}const M=st("grade",E);if(M==null)return;T(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else if($===V.partOfSpeech){if(!E||E===Fe){x([]);return}const M=Do[F.indexOf(E)]??I([E])[0];if(!M)return;x(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else if($===V.wordType){if(!E||E===Fe){z([]);return}const M=No[k.indexOf(E)]??N([E])[0];if(!M)return;z(U=>U.includes(M)?U.filter(Q=>Q!==M):[...U,M])}else{const M=ne[$];if(!M)return;d(U=>t.requireSyllable?E&&E!==Fe?{...U,[M]:E}:U:!E||E===Fe||U[M]===E?{...U,[M]:null}:{...U,[M]:E})}},[Y,ne,V,F,k,t.requireSyllable]),fn=c.useCallback(E=>!t.partOfSpeech&&!t.wordType?!0:zc(E,{...t.partOfSpeech?{[V.partOfSpeech]:K}:{},...t.wordType?{[V.wordType]:pe}:{}},V),[t.partOfSpeech,t.wordType,K,pe,V]),Pe=c.useCallback(E=>{E!==i&&(E!=="direct"&&i!=="direct"&&d($=>ga($,E,C.current,m.current)),l(E))},[i]),pn=c.useCallback(()=>({composition:s,contrastCount:he,excludeNoImage:h,sameStructureOnly:b,phonemeView:i,gradeFilter:S,posFilter:R,wordTypeFilter:O}),[s,he,h,b,i,S,R,O]),Lt=c.useCallback(E=>{d(E.composition),w(E.excludeNoImage),y(E.sameStructureOnly??!0),l(E.phonemeView),T(vo(E.gradeFilter)),Array.isArray(E.posFilter)&&x(I(E.posFilter)),Array.isArray(E.wordTypeFilter)&&z(N(E.wordTypeFilter))},[]);return{difficulty:f,contrastCount:he,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:b,gradeFilter:S,posFilter:K,wordTypeFilter:pe,matchesWordAttributes:fn,poolVersion:qe,filterSections:Ot,filterSelected:De,handleFilterSelect:rt,phonemeView:i,setPhonemeView:Pe,phonemeGroupLabel:Y.phonemeGroup,wordCount:j,getFilterSnapshot:pn,restoreFilterSnapshot:Lt}}function ud(e){const t=l=>l?ze(l):null,n=t(e.cho),o=t(e.jung),r=e.jong===je,a=r?null:t(e.jong),i=e.syllable!=null?Eo(e.syllable):null;return!n&&!o&&!a&&!r&&!i?null:{cho:n,jung:o,jong:a,jongNone:r,syllable:i}}function ld(e,t,n,o,r,a,i=!0,l="char",s=[]){const[d,g]=c.useState({}),[f,C]=c.useState(!1),{cho:m=null,jung:h=null,jong:w=null,syllable:b=null}=o??{},y=s.length>0?s.slice().sort().join(","):"",S=e.map(v=>v.key).join("|");c.useEffect(()=>{a>0&&kc(r).catch(()=>{})},[a,r]),c.useEffect(()=>{let v=!1;return C(!0),(async()=>{const L=ud({cho:m,jung:h,jong:w,syllable:b}),I=`${m??""}_${h??""}_${w??""}_${b??""}_${y}`,N={};await Promise.all(e.map(async R=>{const x=eo[R.key];try{const O=await ta(R.key,{difficulty:x.difficulty?t:null,contrastCount:x.difficulty?n:1,composition:x.choseong?L:null,count:5,excludeNoImage:r,sameStructureOnly:i,phonemeView:l,grade:s.length>0?s:null});O&&O.length>0?N[R.key]={id:`wt-${R.key}-${t}-${I}-${Date.now()}`,name:R.label,training_type:R.key,category_main_code:"WORD",iconColor:R.color,subTitle:R.subTitle,items:O,itemCount:O.length}:N[R.key]={id:`wt-${R.key}-empty`,name:R.label,training_type:R.key,category_main_code:"WORD",iconColor:R.color,subTitle:R.subTitle,items:[],itemCount:0,__empty:!0}}catch{N[R.key]=null}})),v||(g(N),C(!1))})(),()=>{v=!0}},[t,n,m,h,w,b,r,i,l,a,y,S]);const T=JSON.stringify(e.map(v=>[v.key,v.label,v.color,v.subTitle]));return{perTypeData:c.useMemo(()=>{const v={};for(const[L,I]of Object.entries(d)){const N=e.find(R=>R.key===L);v[L]=I&&N?{...I,name:N.label,iconColor:N.color,subTitle:N.subTitle}:I}return v},[d,T]),generating:f}}const Xt=[],Qt=[],Zt=[],en=[],Pn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Mn={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},sd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Oo=null,Ea=null,Ke=null;function cd({counts:e,forceRefresh:t}={}){const n=Object.assign({},sd,e||{}),o=Mt(),r=kt(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),a=JSON.stringify(n);if(!t&&Ea===o&&Oo===a&&Ke)return Object.assign(Pn,Ke.today),Object.assign(Mn,Ke.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Pn,yesterday:Mn};const i={LISTEN_IN_NOISE:Ve(Xt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:Ve(Qt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:Ve(Zt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:Ve(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))};let l=null;return Ke&&Oo===a&&Ke.yesterday&&Ke.yesterday.date===r&&(l=Ke.yesterday.selection),l||(l={LISTEN_IN_NOISE:Ve(Xt,Math.max(0,Number(n.LISTEN_IN_NOISE)||0)),SHORT_STORY:Ve(Qt,Math.max(0,Number(n.SHORT_STORY)||0)),LONG_STORY:Ve(Zt,Math.max(0,Number(n.LONG_STORY)||0)),ORDERING_SENTENCE:Ve(en,Math.max(0,Number(n.ORDERING_SENTENCE)||0))}),Object.assign(Pn,i),Object.assign(Mn,l),Ea=o,Oo=a,Ke={today:i,yesterday:{date:r,countsKey:a,selection:l}},{today:Pn,yesterday:Mn}}let Lo=!1,tn=null;async function dd(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Jn&&Jn.tagName.toUpperCase()==="SCRIPT"&&Jn.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 fd(){if(!Lo)return tn||(tn=(async()=>{const e=await dd();if(!e){tn=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 a=r,i=String(a.training_type||n),l=String(a.category_main_code||a.category_main||a.category_0||""),s=String(a.category_sub_code||a.category_sub||a.category_1||""),d=Object.assign({},a,{training_type:i,category_0:l,category_1:s});i==="LISTEN_IN_NOISE"?t.noise.push(d):i==="SHORT_STORY"?t.short.push(d):i==="LONG_STORY"?t.long.push(d):i==="ORDERING_SENTENCE"&&t.order.push(d)}}}catch{tn=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}Xt.push(...t.noise),Qt.push(...t.short),Zt.push(...t.long),en.push(...t.order),Lo=!0,Ke=null;try{cd()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),tn)}async function pd(e=3e3){const t=fd();let n;try{await Promise.race([t,new Promise(o=>{n=setTimeout(o,e)})])}finally{n!==void 0&&clearTimeout(n)}return Lo}function Aa(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 md(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 gd=Ve,Cd=e=>{const[t,n,o]=e.split("-").map(Number);return Math.round(Date.UTC(t,(n||1)-1,o||1)/864e5)},hd=(e,t)=>{const n=e??{};return String(n.id??n.name??t)};function kn(e,t,n,o,r){if(!e.length||t<=0)return[];const a=md(Aa(`${n}|${o}|${r}`)),i=Cd(o)&1,l=e.filter((d,g)=>(Aa(`${n}|${r}|${hd(d,g)}`)>>>7&1)===i),s=l.length>=t&&e.length-l.length>=t;return gd(s?l:e,t,a)}function Bo(e,t,n){const o=r=>Math.max(0,e[r]||0);return{LISTEN_IN_NOISE:kn(Xt,o("LISTEN_IN_NOISE"),t,n,"LISTEN_IN_NOISE"),SHORT_STORY:kn(Qt,o("SHORT_STORY"),t,n,"SHORT_STORY"),LONG_STORY:kn(Zt,o("LONG_STORY"),t,n,"LONG_STORY"),ORDERING_SENTENCE:kn(en,o("ORDERING_SENTENCE"),t,n,"ORDERING_SENTENCE")}}function Ro(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const yd={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Io(e=!1,t=yd,n){const o=Date.now(),r=kt(o),a=kt(o-864e5),i=n??"";return Xt.length>0||Qt.length>0||Zt.length>0||en.length>0?{today:Bo(t,i,r),yesterday:Bo(t,i,a)}:{today:Bo(t,i,r),yesterday:null}}function bd(e){const t=c.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),n=c.useRef(null),[o,r]=c.useState(!1),[a,i]=c.useState(!1),[l,s]=c.useState(0),[d,g]=c.useState(!1),[f,C]=c.useState(()=>Mt()),m=JSON.stringify([e??"",f]),h=c.useRef(null),w=c.useRef(m);c.useEffect(()=>{const y=()=>{const T=Date.now(),v=new Date(T+9*36e5),L=Date.UTC(v.getUTCFullYear(),v.getUTCMonth(),v.getUTCDate()+1)-9*36e5;return Math.max(1e3,L-T+1e3)};let S=setTimeout(function T(){C(Mt()),S=setTimeout(T,y())},y());return()=>clearTimeout(S)},[]),c.useEffect(()=>{w.current=m,h.current=null,r(!1),g(!1);let y=!1,S=!1,T=!1,v,L=0,I=null,N=0;const R=40,x=()=>{v!==void 0&&(clearInterval(v),v=void 0)};let O=!1;try{const k=new URLSearchParams(window.location.search),K=k.get("forceRefresh")||k.get("force");O=K==="1"||K==="true"}catch{}const z=k=>{S||(T=!0,h.current=m,t.current=k.today,n.current=k.yesterday,r(!0),g(!0),s(K=>K+1),y=!0,x())},Z=async()=>{if(y)return;if(!O){const K=Io(!1,void 0,e);if(Ro(K.today)){z(K);return}}if(I){++L>=R&&V();return}if(L>=N){N=L+8,I=pd(3e3).catch(()=>!1);try{await I}finally{I=null}if(y)return}const k=Io(O,void 0,e);if(Ro(k.today)){z(k);return}++L>=R&&V()};function V(){r(!0),g(!1),y=!0,x()}const F=()=>{if(S||T)return;const k=Io(O,void 0,e);Ro(k.today)&&z(k)};try{window.addEventListener("speechear.data.updated",F)}catch{}return v=setInterval(Z,250),Z(),()=>{y=!0,S=!0,x();try{window.removeEventListener("speechear.data.updated",F)}catch{}}},[e,f]);const b=c.useCallback(y=>{if(h.current!==m)return;const S=a?n.current:t.current,T=a?t.current:n.current;return S?.[y]?.length?S[y]:T?.[y]?.length?T[y]:void 0},[a,l,m]);return{loaded:w.current===m&&o,hasData:w.current===m&&d,showYesterday:a,setShowYesterday:i,getTrainingPerType:b}}const At=[];let xn=!1;function Ta(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=At[At.length-1];t&&(e.stopPropagation(),t())}function _a(e){return At.push(e),!xn&&typeof document<"u"&&(document.addEventListener("keydown",Ta),xn=!0),()=>{const t=At.lastIndexOf(e);t>=0&&At.splice(t,1),At.length===0&&xn&&typeof document<"u"&&(document.removeEventListener("keydown",Ta),xn=!1)}}function Sd(e,t=!0){const n=Cr(e);c.useEffect(()=>{if(t)return _a(()=>{n.current?.()})},[t,n])}const Po=(e,t)=>`${e}:${t??1}`,nn=new Map,Mo=new Set,ko=new Map,Fn=6e4;function wd(e,t){const[n,o]=c.useState(0),[r,a]=c.useState(0),i=JSON.stringify(Array.from(new Set(e.map(l=>Po(l.word,l.homonum)))).sort());return c.useEffect(()=>{const l=JSON.parse(i),s=Date.now(),d=l.filter(w=>!nn.has(w)&&!Mo.has(w)&&!(s-(ko.get(w)??-1/0)<Fn));let g=!1,f=null,C=1/0;const m=(w=Fn)=>{if(g)return;const b=Date.now()+w;b>=C||(f!==null&&clearTimeout(f),C=b,f=setTimeout(()=>a(y=>y+1),w))};for(const w of l){if(nn.has(w)||Mo.has(w))continue;const b=ko.get(w);b!=null&&s-b<Fn&&m(Math.max(0,Fn-(s-b)))}if(d.length===0)return()=>{g=!0,f!==null&&clearTimeout(f)};const h=Array.from(new Set(d.map(w=>w.slice(0,w.lastIndexOf(":")))));return Promise.resolve().then(()=>t(h)).then(w=>{for(const b of w)b.Meaning&&nn.set(Po(b.Word,b.Homonum??void 0),b.Meaning);if(w.length>0)for(const b of d)nn.has(b)||Mo.add(b);else{const b=Date.now();for(const y of d)ko.set(y,b);m()}g||w.length===0||o(b=>b+1)}).catch(()=>{m()}),()=>{g=!0,f!==null&&clearTimeout(f)}},[i,t,r]),c.useMemo(()=>{const l=JSON.parse(i),s=new Map;for(const d of l){const g=nn.get(d);g!=null&&s.set(d,g)}return s},[i,n])}function Ed(){const[e,t]=c.useState(null),n=c.useCallback(a=>t(a.getBoundingClientRect()),[]),o=c.useCallback(()=>t(null),[]),r=c.useCallback(a=>{const i=a.getBoundingClientRect();t(l=>l?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:n,close:o,toggleAt:r}}function Ad(e){const[t,n]=c.useState(null),[o,r]=c.useState(null),a=c.useRef(null);c.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const i=c.useCallback((s,d)=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{n(s),r(d)},e)},[e]),l=c.useCallback(()=>{a.current&&clearTimeout(a.current),n(null),r(null)},[]);return{payload:t,anchorRect:o,openAfterDelay:i,close:l}}function Td(e,t,n){const o=Number.isFinite(t)&&t>=1?Math.floor(t):1,r=Math.max(1,Math.ceil(e.length/o)),a=Number.isFinite(n)?Math.min(Math.max(1,Math.floor(n)),r):1;return{pageItems:c.useMemo(()=>e.slice((a-1)*o,a*o),[e,a,o]),totalPages:r,curPage:a}}function va(e,t){const[n,o]=c.useState(e);n!==e&&(o(e),t(1))}function _d(e={}){const{defaultPageSize:t="25",resetOn:n}=e,[o,r]=c.useState(""),[a,i]=c.useState(t),[l,s]=c.useState(1),d=C=>{const m=Number(C);return Number.isFinite(m)&&m>=1?Math.floor(m):null},g=d(t)??25,f=d(a)??g;return va(JSON.stringify([o,a,...n??[]]),s),{query:o,setQuery:r,pageSize:a,setPageSize:i,perPage:f,page:l,setPage:s}}function vd(e="warning"){const[t,n]=c.useState(""),[o,r]=c.useState(e),[a,i]=c.useState(0),l=c.useCallback((f,C)=>{r(C),n(f),i(m=>m+1)},[]),s=c.useCallback(f=>l(f,"warning"),[l]),d=c.useCallback(f=>l(f,"normal"),[l]),g=c.useCallback(()=>n(""),[]);return{toastMessage:t,toastType:o,toastKey:a,showToast:l,showWarning:s,showNormal:d,clearToast:g}}const Dd=[{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."}],Nd={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function Od(e){return Dd.map(t=>{const n=Nd[t.key];return n?{...t,label:e(`trainingType.${n}.title`),desc:e(`trainingType.${n}.desc`)}:t})}const on={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},rn=on.blue,jn=on.green,an=on.amber,Hn=on.purple,Ld=on.pink,Bd=[{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:rn,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:rn,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:rn,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:rn,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:rn,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:jn,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:jn,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:jn,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:jn,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:an,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:an,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:an,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:an,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:an,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:Hn,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:Hn,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:Hn,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:Hn,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:Ld,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Rd(){const{t:e}=We.useTranslation();return c.useMemo(()=>{const t=Object.fromEntries(Od(e).map(o=>[o.key,o.label])),n={...t};return Bd.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,a]=c.useState(!1),[i,l]=c.useState({position:"fixed"}),s=c.useRef(null),d=c.useRef(null),g=c.useCallback(()=>{s.current&&l(e(s.current.getBoundingClientRect(),s.current))},[e]);c.useLayoutEffect(()=>{r&&g()},[r,g]),c.useEffect(()=>{if(!r)return;let m=d.current?.offsetHeight??0;m>0&&g();let h=0,w=null;typeof ResizeObserver<"u"&&d.current&&(w=new ResizeObserver(()=>{const N=d.current?.offsetHeight??0;if(N!==m){if(m=N,++h>4){w?.disconnect(),w=null;return}g()}}),w.observe(d.current));const b=N=>{const R=N.target;o&&R.closest?.(o)||s.current?.contains(R)||d.current?.contains(R)||a(!1)};document.addEventListener("mousedown",b),document.addEventListener("pointerdown",b);let y=null;const S=()=>{if(typeof requestAnimationFrame>"u"){g();return}y===null&&(y=requestAnimationFrame(()=>{y=null,g()}))},T=N=>{d.current?.contains(N.target)||(t==="reposition"?S():t==="close"&&a(!1))};t!=="ignore"&&window.addEventListener("scroll",T,!0);const v=()=>{n==="reposition"?S():n==="close"&&a(!1)};let L=null;const I=()=>{v(),L&&clearTimeout(L),L=setTimeout(()=>{L=null,n==="reposition"&&g()},250)};return n!=="ignore"&&(window.addEventListener("resize",v),window.addEventListener("orientationchange",I)),()=>{y!==null&&cancelAnimationFrame(y),w?.disconnect(),document.removeEventListener("mousedown",b),document.removeEventListener("pointerdown",b),t!=="ignore"&&window.removeEventListener("scroll",T,!0),n!=="ignore"&&(window.removeEventListener("resize",v),window.removeEventListener("orientationchange",I)),L&&clearTimeout(L)}},[r,g,t,n,o]),c.useEffect(()=>{if(r)return _a(()=>a(!1))},[r]);const f=c.useCallback(()=>a(m=>!m),[]),C=c.useCallback(()=>a(!1),[]);return{open:r,setOpen:a,toggle:f,close:C,style:i,triggerRef:s,menuRef:d}}function Pd(e,{mode:t="playback",autoStart:n=!1,onPlaySpeaker:o,onComplete:r,playMs:a=1100,feedbackMs:i=1500}={}){const[l,s]=c.useState([]),[d,g]=c.useState(0),[f,C]=c.useState("idle"),[m,h]=c.useState(null),[w,b]=c.useState([]),[y,S]=c.useState(null),[T,v]=c.useState(0),L=c.useRef(0),I=c.useCallback(j=>{L.current=typeof j=="function"?j(L.current):j,v(L.current)},[]),N=c.useRef(o),R=c.useRef(r);c.useEffect(()=>{N.current=o,R.current=r},[o,r]);const x=c.useRef([]),O=()=>{x.current.forEach(clearTimeout),x.current=[]},z=(j,J)=>{x.current.push(setTimeout(J,j))};c.useEffect(()=>()=>O(),[]);const Z=l[d]?.id??null,V=c.useRef(null),F=c.useCallback(()=>{O(),C("playing"),b([]),S(null),I(0);let j=0;e.forEach((J,W)=>{z(j,()=>{g(W),h(J.id),N.current?.(J)}),z(j+1e3,()=>{h(null),b(he=>[...he,J.id])}),j+=1300}),z(j,()=>{C("done"),R.current?.({score:0,total:e.length})})},[e,I]),k=c.useCallback((j,J)=>{if(J>=j.length){C("done"),R.current?.({score:L.current,total:j.length});return}V.current=null,g(J),S(null),C("playing"),h(j[J].id),N.current?.(j[J]),z(a,()=>{h(null),C("waiting")})},[a]),K=c.useCallback(()=>{O();const j=X(e);s(j),I(0),b([]),k(j,0)},[e,k,I]),pe=c.useCallback(()=>{t==="playback"?(s(e),F()):K()},[t,e,F,K]),re=c.useCallback(()=>{O(),C("idle"),h(null),b([]),S(null),g(0),I(0),s([])},[I]),Oe=JSON.stringify(e.map(j=>[j.id,j.label,j.angleDeg,j.deg,j.row,j.shortcut]));c.useEffect(()=>(n?pe():re(),()=>O()),[t,Oe,n]);const B=c.useCallback(j=>{f!=="waiting"||t==="playback"||V.current===d||(V.current=d,S(j),j===l[d]?.id&&I(J=>J+1),t==="exam"?(C("playing"),z(400,()=>k(l,d+1))):(C("feedback"),z(i,()=>k(l,d+1))))},[f,t,l,d,k,i,I]),H=t==="playback"?e.length:l.length;return{bind:{activeSpeakerId:m,playedIds:w,selectedId:y,answerId:Z,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:B},index:d,total:H,score:T,phase:f,done:f==="done",start:pe,reset:re}}/*! @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 Da(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 Md(e){if(Array.isArray(e))return e}function kd(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,a,i,l=[],s=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(s=(o=a.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(g){d=!0,r=g}finally{try{if(!s&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(d)throw r}}return l}}function xd(){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 Fd(e,t){return Md(e)||kd(e,t)||jd(e,t)||xd()}function jd(e,t){if(e){if(typeof e=="string")return Da(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)?Da(e,t):void 0}}const Na=Object.entries,Oa=Object.setPrototypeOf,Hd=Object.isFrozen,$d=Object.getPrototypeOf,Gd=Object.getOwnPropertyDescriptor;let le=Object.freeze,se=Object.seal,Tt=Object.create,La=typeof Reflect<"u"&&Reflect,xo=La.apply,Fo=La.construct;le||(le=function(t){return t}),se||(se=function(t){return t}),xo||(xo=function(t,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),a=2;a<o;a++)r[a-2]=arguments[a];return t.apply(n,r)}),Fo||(Fo=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 ct=ue(Array.prototype.forEach),Wd=ue(Array.prototype.lastIndexOf),Ba=ue(Array.prototype.pop),un=ue(Array.prototype.push),Vd=ue(Array.prototype.splice),_t=Array.isArray,ln=ue(String.prototype.toLowerCase),jo=ue(String.prototype.toString),Ra=ue(String.prototype.match),sn=ue(String.prototype.replace),Ia=ue(String.prototype.indexOf),Ud=ue(String.prototype.trim),Yd=ue(Number.prototype.toString),zd=ue(Boolean.prototype.toString),Pa=typeof BigInt>"u"?null:ue(BigInt.prototype.toString),Ma=typeof Symbol>"u"?null:ue(Symbol.prototype.toString),we=ue(Object.prototype.hasOwnProperty),cn=ue(Object.prototype.toString),Ce=ue(RegExp.prototype.test),dt=Kd(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 xo(e,t,o)}}function Kd(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Fo(e,n)}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ln;if(Oa&&Oa(e,null),!_t(t))return e;let o=t.length;for(;o--;){let r=t[o];if(typeof r=="string"){const a=n(r);a!==r&&(Hd(t)||(t[o]=a),r=a)}e[r]=!0}return e}function qd(e){for(let t=0;t<e.length;t++)we(e,t)||(e[t]=null);return e}function _e(e){const t=Tt(null);for(const o of Na(e)){var n=Fd(o,2);const r=n[0],a=n[1];we(e,r)&&(_t(a)?t[r]=qd(a):a&&typeof a=="object"&&a.constructor===Object?t[r]=_e(a):t[r]=a)}return t}function Jd(e){switch(typeof e){case"string":return e;case"number":return Yd(e);case"boolean":return zd(e);case"bigint":return Pa?Pa(e):"0";case"symbol":return Ma?Ma(e):"Symbol()";case"undefined":return cn(e);case"function":case"object":{if(e===null)return cn(e);const t=e,n=Ie(t,"toString");if(typeof n=="function"){const o=n(t);return typeof o=="string"?o:cn(o)}return cn(e)}default:return cn(e)}}function Ie(e,t){for(;e!==null;){const o=Gd(e,t);if(o){if(o.get)return ue(o.get);if(typeof o.value=="function")return ue(o.value)}e=$d(e)}function n(){return null}return n}function Xd(e){try{return Ce(e,""),!0}catch{return!1}}const ka=le(["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"]),Ho=le(["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"]),$o=le(["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"]),Qd=le(["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"]),Go=le(["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"]),Zd=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xa=le(["#text"]),Fa=le(["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"]),Wo=le(["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"]),ja=le(["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"]),$n=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ef=se(/{{[\w\W]*|^[\w\W]*}}/g),tf=se(/<%[\w\W]*|^[\w\W]*%>/g),nf=se(/\${[\w\W]*/g),of=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),rf=se(/^aria-[\-\w]+$/),Ha=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),af=se(/^(?:\w+script|data):/i),uf=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lf=se(/^html$/i),sf=se(/^[a-z][.\w]*(-[.\w]+)+$/i),$a=se(/<[/\w!]/g),Ga=se(/<[/\w]/g),cf=se(/<\/no(script|embed|frames)/i),df=se(/\/>/i),ve={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wa=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ff=le(q({},Wa)),pf=(function(){const e={};return ct(Wa,t=>{e[t]=se(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),le(e)})(),mf=function(){return typeof window>"u"?null:window},gf=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 a="dompurify"+(o?"#"+o:"");try{return t.createPolicy(a,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Va=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},nt=function(t,n,o,r){return we(t,n)&&_t(t[n])?q(r.base?_e(r.base):{},t[n],r.transform):o},Vo=function(t,n,o){const r=we(t,n)?t[n]:void 0;return r&&typeof r=="object"?_e(r):o()};function Ua(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mf();const t=_=>Ua(_);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==ve.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const o=n,r=o.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,i=e.Node,l=e.Element,s=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const g=e.DOMParser,f=e.trustedTypes,C=l.prototype,m=Ie(C,"cloneNode"),h=Ie(C,"remove"),w=Ie(C,"nextSibling"),b=Ie(C,"childNodes"),y=Ie(C,"parentNode"),S=Ie(C,"shadowRoot"),T=Ie(C,"attributes"),v=i&&i.prototype?Ie(i.prototype,"nodeType"):null,L=i&&i.prototype?Ie(i.prototype,"nodeName"):null,I=i&&i.prototype?Ie(i.prototype,"ownerDocument"):null,N=function(u){return v?v(u):u.nodeType},R=function(u){return L?L(u):u.nodeName};if(typeof a=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let x,O="",z,Z=!1,V=0;const F=function(){if(V>0)throw dt('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.')},k=function(u){F(),V++;try{return x.createHTML(u)}finally{V--}},K=function(u){F(),V++;try{return x.createScriptURL(u)}finally{V--}},pe=function(){return Z||(z=gf(f,r),Z=!0),z},re=n,Oe=re.implementation,B=re.createNodeIterator,H=re.createDocumentFragment,j=re.getElementsByTagName,J=o.importNode;let W=Va();t.isSupported=typeof Na=="function"&&typeof y=="function"&&Oe&&Oe.createHTMLDocument!==void 0;const he=ef,$e=tf,ot=nf,qe=of,vt=rf,dn=af,Dt=uf,Nt=sf;let Y=Ha,ne=null;const Je=q({},[...ka,...Ho,...$o,...Go,...xa]);let ee=null;const Ot=q({},[...Fa,...Wo,...ja,...$n]);let De=Object.seal(Tt(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}})),rt=null,fn=null;const Pe=Object.seal(Tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pn=!0,Lt=!0,E=!1,$=!0,M=!1,U=!0,Q=!1,Me=!1,Le=null,Ge=null,Xe=!1,Ee=!1,ft=!1,Qe=!1,mn=!0,pt=!1;const Bt="user-content-";let mt=!0,Rt=!1,gt={},Ct=null;const zo=q({},["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 Ko=null;const qo=q({},["audio","video","img","source","image","track"]);let Jo=null;const Xo=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",Cn="http://www.w3.org/2000/svg",ke="http://www.w3.org/1999/xhtml";let ht=ke,Gn=!1,Wn=null;const za=q({},[gn,Cn,ke],jo),Qo=le(["mi","mo","mn","ms","mtext"]);let Vn=q({},Qo);const Zo=le(["annotation-xml"]);let Un=q({},Zo);const Ka=q({},["title","style","font","a","script"]);let It=null;const qa=["application/xhtml+xml","text/html"],Ja="text/html";let ie=null,yt=null;const Xa=n.createElement("form"),er=function(u){return u instanceof RegExp||u instanceof Function},Yn=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yt&&yt===u)return;(!u||typeof u!="object")&&(u={}),u=_e(u),It=qa.indexOf(u.PARSER_MEDIA_TYPE)===-1?Ja:u.PARSER_MEDIA_TYPE,ie=It==="application/xhtml+xml"?jo:ln,ne=nt(u,"ALLOWED_TAGS",Je,{transform:ie}),ee=nt(u,"ALLOWED_ATTR",Ot,{transform:ie}),Wn=nt(u,"ALLOWED_NAMESPACES",za,{transform:jo}),Jo=nt(u,"ADD_URI_SAFE_ATTR",Xo,{transform:ie,base:Xo}),Ko=nt(u,"ADD_DATA_URI_TAGS",qo,{transform:ie,base:qo}),Ct=nt(u,"FORBID_CONTENTS",zo,{transform:ie}),rt=nt(u,"FORBID_TAGS",_e({}),{transform:ie}),fn=nt(u,"FORBID_ATTR",_e({}),{transform:ie}),gt=we(u,"USE_PROFILES")?u.USE_PROFILES&&typeof u.USE_PROFILES=="object"?_e(u.USE_PROFILES):u.USE_PROFILES:!1,pn=u.ALLOW_ARIA_ATTR!==!1,Lt=u.ALLOW_DATA_ATTR!==!1,E=u.ALLOW_UNKNOWN_PROTOCOLS||!1,$=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,M=u.SAFE_FOR_TEMPLATES||!1,U=u.SAFE_FOR_XML!==!1,Q=u.WHOLE_DOCUMENT||!1,Ee=u.RETURN_DOM||!1,ft=u.RETURN_DOM_FRAGMENT||!1,Qe=u.RETURN_TRUSTED_TYPE||!1,Xe=u.FORCE_BODY||!1,mn=u.SANITIZE_DOM!==!1,pt=u.SANITIZE_NAMED_PROPS||!1,mt=u.KEEP_CONTENT!==!1,Rt=u.IN_PLACE||!1,Y=Xd(u.ALLOWED_URI_REGEXP)?u.ALLOWED_URI_REGEXP:Ha,ht=typeof u.NAMESPACE=="string"?u.NAMESPACE:ke,Vn=Vo(u,"MATHML_TEXT_INTEGRATION_POINTS",()=>q({},Qo)),Un=Vo(u,"HTML_INTEGRATION_POINTS",()=>q({},Zo));const p=Vo(u,"CUSTOM_ELEMENT_HANDLING",()=>Tt(null));if(De=Tt(null),we(p,"tagNameCheck")&&er(p.tagNameCheck)&&(De.tagNameCheck=p.tagNameCheck),we(p,"attributeNameCheck")&&er(p.attributeNameCheck)&&(De.attributeNameCheck=p.attributeNameCheck),we(p,"allowCustomizedBuiltInElements")&&typeof p.allowCustomizedBuiltInElements=="boolean"&&(De.allowCustomizedBuiltInElements=p.allowCustomizedBuiltInElements),se(De),M&&(Lt=!1),ft&&(Ee=!0),gt&&(ne=q({},xa),ee=Tt(null),gt.html===!0&&(q(ne,ka),q(ee,Fa)),gt.svg===!0&&(q(ne,Ho),q(ee,Wo),q(ee,$n)),gt.svgFilters===!0&&(q(ne,$o),q(ee,Wo),q(ee,$n)),gt.mathMl===!0&&(q(ne,Go),q(ee,ja),q(ee,$n))),Pe.tagCheck=null,Pe.attributeCheck=null,we(u,"ADD_TAGS")&&(typeof u.ADD_TAGS=="function"?Pe.tagCheck=u.ADD_TAGS:_t(u.ADD_TAGS)&&(ne===Je&&(ne=_e(ne)),q(ne,u.ADD_TAGS,ie))),we(u,"ADD_ATTR")&&(typeof u.ADD_ATTR=="function"?Pe.attributeCheck=u.ADD_ATTR:_t(u.ADD_ATTR)&&(ee===Ot&&(ee=_e(ee)),q(ee,u.ADD_ATTR,ie))),we(u,"ADD_FORBID_CONTENTS")&&_t(u.ADD_FORBID_CONTENTS)&&(Ct===zo&&(Ct=_e(Ct)),q(Ct,u.ADD_FORBID_CONTENTS,ie)),mt&&(ne["#text"]=!0),Q&&q(ne,["html","head","body"]),ne.table&&(q(ne,["tbody"]),delete rt.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const A=x;x=u.TRUSTED_TYPES_POLICY;try{O=k("")}catch(D){throw x=A,D}}else u.TRUSTED_TYPES_POLICY===null?(x=void 0,O=""):(x===void 0&&(x=pe()),x&&typeof O=="string"&&(O=k("")));le&&le(u),yt=u},tr=q({},[...Ho,...$o,...Qd]),nr=q({},[...Go,...Zd]),Qa=function(u,p,A){return p.namespaceURI===ke?u==="svg":p.namespaceURI===gn?u==="svg"&&(A==="annotation-xml"||Vn[A]):!!tr[u]},Za=function(u,p,A){return p.namespaceURI===ke?u==="math":p.namespaceURI===Cn?u==="math"&&Un[A]:!!nr[u]},ei=function(u,p,A){return p.namespaceURI===Cn&&!Un[A]||p.namespaceURI===gn&&!Vn[A]?!1:!nr[u]&&(Ka[u]||!tr[u])},ti=function(u){let p=y(u);(!p||!p.tagName)&&(p={namespaceURI:ht,tagName:"template"});const A=ln(u.tagName),D=ln(p.tagName);return Wn[u.namespaceURI]?u.namespaceURI===Cn?Qa(A,p,D):u.namespaceURI===gn?Za(A,p,D):u.namespaceURI===ke?ei(A,p,D):!!(It==="application/xhtml+xml"&&Wn[u.namespaceURI]):!1},Ze=function(u){un(t.removed,{element:u});try{y(u).removeChild(u)}catch{if(h(u),!y(u))throw dt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},or=function(u,p,A){try{u.removeAttributeNode(p)}catch{try{u.removeAttribute(A)}catch{}}},hn=function(u){yn(u);const p=b(u);if(p){const D=[];ct(p,P=>{un(D,P)}),ct(D,P=>{try{h(P)}catch{}})}const A=T(u);if(A)for(let D=A.length-1;D>=0;--D){const P=A[D],G=P&&P.name;typeof G=="string"&&or(u,P,G)}},at=function(u,p,A){if(!A)try{A=p.getAttributeNode(u)}catch{A=null}un(t.removed,{attribute:A||null,from:p});try{A?p.removeAttributeNode(A):p.removeAttribute(u)}catch{try{p.removeAttribute(u)}catch{}}if(u==="is")if(Ee||ft)try{Ze(p)}catch{}else try{p.setAttribute(u,"")}catch{}},ni=function(u){const p=T(u);if(p)for(let A=p.length-1;A>=0;--A){const D=p[A],P=D&&D.name;typeof P!="string"||ee[ie(P)]||or(u,D,P)}},yn=function(u){const p=[u];for(;p.length>0;){const A=p.pop();N(A)===ve.element&&ni(A);const P=b(A);if(P)for(let G=P.length-1;G>=0;--G)p.push(P[G])}},rr=function(u,p){return U?u==="patchsrc"?!0:u==="for"&&p!=="label"&&p!=="output":!1},oi=function(u){if(!U)return;const p=[u];for(;p.length>0;){const A=p.pop(),D=N(A);if(D===ve.processingInstruction||D===ve.comment&&Ce(Ga,A.data)){try{h(A)}catch{}continue}if(D===ve.element){const G=A,oe=ie(R(A));try{G.hasAttribute&&G.hasAttribute("patchsrc")&&G.removeAttribute("patchsrc"),G.hasAttribute&&G.hasAttribute("for")&&rr("for",oe)&&G.removeAttribute("for")}catch{}}const P=b(A);if(P)for(let G=P.length-1;G>=0;--G)p.push(P[G])}},ar=function(u){let p=null,A=null;if(Xe)u="<remove></remove>"+u;else{const G=Ra(u,/^[\r\n\t ]+/);A=G&&G[0]}It==="application/xhtml+xml"&&ht===ke&&(u='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+u+"</body></html>");const D=x?k(u):u;if(ht===ke)try{p=new g().parseFromString(D,It)}catch{}if(!p||!p.documentElement){p=Oe.createDocument(ht,"template",null);try{p.documentElement.innerHTML=Gn?O:D}catch{}}const P=p.body||p.documentElement;return u&&A&&P.insertBefore(n.createTextNode(A),P.childNodes[0]||null),ht===ke?j.call(p,Q?"html":"body")[0]:Q?p.documentElement:P},ir=function(u){const p=I?I(u):u.ownerDocument;return B.call(p||u,u,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},bn=function(u){return u=sn(u,he," "),u=sn(u,$e," "),u=sn(u,ot," "),u},zn=function(u){var p;u.normalize();const A=I?I(u):u.ownerDocument,D=B.call(A||u,u,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let P=D.nextNode();for(;P;)P.data=bn(P.data),P=D.nextNode();const G=(p=u.querySelectorAll)===null||p===void 0?void 0:p.call(u,"template");G&&ct(G,oe=>{bt(oe.content)&&zn(oe.content)})},Sn=function(u){const p=L?L(u):null;return typeof p!="string"||ie(p)!=="form"?!1:typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||u.attributes!==T(u)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function"||u.nodeType!==v(u)||u.childNodes!==b(u)},bt=function(u){if(!v||typeof u!="object"||u===null)return!1;try{return v(u)===ve.documentFragment}catch{return!1}},Pt=function(u){if(!v||typeof u!="object"||u===null)return!1;try{return typeof v(u)=="number"}catch{return!1}};function xe(_,u,p){_.length!==0&&ct(_,A=>{A.call(t,u,p,yt)})}const ri=function(u,p){return!!(U&&u.hasChildNodes()&&!Pt(u.firstElementChild)&&Ce($a,u.textContent)&&Ce($a,u.innerHTML)||U&&u.namespaceURI===ke&&ff[p]&&(Pt(u.firstElementChild)||typeof u.textContent=="string"&&Ce(pf[p],u.textContent))||u.nodeType===ve.processingInstruction||U&&u.nodeType===ve.comment&&Ce(Ga,u.data))},wn=function(u,p){if(u instanceof RegExp)return Ce(u,p);if(u instanceof Function){for(var A=arguments.length,D=new Array(A>2?A-2:0),P=2;P<A;P++)D[P-2]=arguments[P];return!!u(p,...D)}return!1},ai=function(u,p,A){if(!rt[p]&&dr(p)&&wn(De.tagNameCheck,p))return!1;if(mt&&!Ct[p]){const D=y(u),P=b(u);if(P&&D){const G=P.length;for(let oe=G-1;oe>=0;--oe){const ae=u===A?m(P[oe],!0):P[oe];D.insertBefore(ae,w(u))}}}return Ze(u),!0},ur=function(u,p,A,D){return u.length===0?p:p===A||p===D?_e(p):p},lr=function(u,p){return u===p||y(u)!==null?!1:(Rt&&yn(u),!0)},sr=function(u,p){if(xe(W.beforeSanitizeElements,u,null),lr(u,p))return!0;if(Sn(u))return Ze(u),!0;const A=ie(R(u));if(ne=ur(W.uponSanitizeElement,ne,Je,Le),xe(W.uponSanitizeElement,u,{tagName:A,allowedTags:ne}),lr(u,p))return!0;if(ri(u,A))return Ze(u),!0;if(rt[A]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(A))&&!ne[A]){const P=ai(u,A,p);return P===!1&&xe(W.afterSanitizeElements,u,null),P}if(N(u)===ve.element&&!ti(u)||(A==="noscript"||A==="noembed"||A==="noframes")&&Ce(cf,u.innerHTML))return Ze(u),!0;if(M&&u.nodeType===ve.text){const P=bn(u.textContent);u.textContent!==P&&(un(t.removed,{element:u.cloneNode()}),u.textContent=P)}return xe(W.afterSanitizeElements,u,null),!1},cr=function(u,p,A){if(fn[p]||rr(p,u)||mn&&(p==="id"||p==="name")&&(A in n||A in Xa))return!1;const D=ee[p]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(p,u);return Lt&&Ce(qe,p)||pn&&Ce(vt,p)?!0:D?Jo[p]||Ce(Y,sn(A,Dt,""))||(p==="src"||p==="xlink:href"||p==="href")&&u!=="script"&&Ia(A,"data:")===0&&Ko[u]||E&&!Ce(dn,sn(A,Dt,""))?!0:!A:dr(u)&&wn(De.tagNameCheck,u)&&wn(De.attributeNameCheck,p,u)||p==="is"&&De.allowCustomizedBuiltInElements&&wn(De.tagNameCheck,A)},ii=q({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),dr=function(u){return!ii[ln(u)]&&Ce(Nt,u)},ui=function(u,p,A,D){if(x&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!A)switch(f.getAttributeType(u,p)){case"TrustedHTML":return k(D);case"TrustedScriptURL":return K(D)}return D},li=function(u,p,A,D){try{A?u.setAttributeNS(A,p,D):u.setAttribute(p,D),Sn(u)?Ze(u):Ba(t.removed)}catch{at(p,u)}},fr=function(u){xe(W.beforeSanitizeAttributes,u,null);const p=u.attributes;if(!p||Sn(u))return;ee=ur(W.uponSanitizeAttribute,ee,Ot,Ge);const A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let D=p.length;const P=ie(u.nodeName);for(;D--;){const G=p[D],oe=G.name,ae=G.namespaceURI,be=G.value,Se=ie(oe),qn=be;let ye=oe==="value"?qn:Ud(qn);if(A.attrName=Se,A.attrValue=ye,A.keepAttr=!0,A.forceKeepAttr=void 0,xe(W.uponSanitizeAttribute,u,A),ye=A.attrValue,pt&&(Se==="id"||Se==="name")&&Ia(ye,Bt)!==0&&(at(oe,u,G),ye=Bt+ye),U&&Ce(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ye)){at(oe,u,G);continue}if(Se==="attributename"&&Ra(ye,"href")){at(oe,u,G);continue}if(!A.forceKeepAttr){if(!A.keepAttr){at(oe,u,G);continue}if(!$&&Ce(df,ye)){at(oe,u,G);continue}if(M&&(ye=bn(ye)),!cr(P,Se,ye)){at(oe,u,G);continue}ye=ui(P,Se,ae,ye),ye!==qn&&li(u,oe,ae,ye)}}xe(W.afterSanitizeAttributes,u,null)},En=function(u){let p=null;const A=ir(u);for(xe(W.beforeSanitizeShadowDOM,u,null);p=A.nextNode();)if(xe(W.uponSanitizeShadowNode,p,null),sr(p,u),fr(p),bt(p.content)&&En(p.content),N(p)===ve.element){const D=S(p);bt(D)&&(Kn(D),En(D))}xe(W.afterSanitizeShadowDOM,u,null)},Kn=function(u){const p=[{node:u,shadow:null}];for(;p.length>0;){const A=p.pop();if(A.shadow){En(A.shadow);continue}const D=A.node,G=N(D)===ve.element,oe=b(D);if(oe)for(let ae=oe.length-1;ae>=0;--ae)p.push({node:oe[ae],shadow:null});if(G){const ae=L?L(D):null;if(typeof ae=="string"&&ie(ae)==="template"){const be=D.content;bt(be)&&p.push({node:be,shadow:null})}}if(G){const ae=S(D);bt(ae)&&p.push({node:null,shadow:ae},{node:ae,shadow:null})}}};return t.sanitize=function(_){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,A=null,D=null,P=null;if(Gn=!_,Gn&&(_="<!-->"),typeof _!="string"&&!Pt(_)&&(_=Jd(_),typeof _!="string"))throw dt("dirty is not a string, aborting");if(!t.isSupported)return _;Me?(ne=Le,ee=Ge):Yn(u),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(ne=_e(ne)),W.uponSanitizeAttribute.length>0&&(ee=_e(ee)),t.removed=[];const G=Rt&&typeof _!="string"&&Pt(_);if(G){oi(_);const be=R(_);if(typeof be=="string"){const Se=ie(be);if(!ne[Se]||rt[Se])throw hn(_),dt("root node is forbidden and cannot be sanitized in-place")}if(Sn(_))throw hn(_),dt("root node is clobbered and cannot be sanitized in-place");try{Kn(_)}catch(Se){throw hn(_),Se}}else if(Pt(_))p=ar("<!---->"),A=p.ownerDocument.importNode(_,!0),A.nodeType===ve.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?p=A:p.appendChild(A),Kn(A);else{if(!Ee&&!M&&!Q&&_.indexOf("<")===-1)return x&&Qe?k(_):_;if(p=ar(_),!p)return Ee?null:Qe?O:""}p&&Xe&&Ze(p.firstChild);const oe=G?_:p;try{const be=ir(oe);for(;D=be.nextNode();)sr(D,oe),fr(D),bt(D.content)&&En(D.content)}catch(be){throw G&&(hn(_),ct(t.removed,Se=>{Se.element&&yn(Se.element)})),be}if(G)return ct(t.removed,be=>{be.element&&yn(be.element)}),M&&zn(_),_;if(Ee){if(M&&zn(p),ft)for(P=H.call(p.ownerDocument);p.firstChild;)P.appendChild(p.firstChild);else P=p;return(ee.shadowroot||ee.shadowrootmode)&&(P=J.call(o,P,!0)),P}let ae=Q?p.outerHTML:p.innerHTML;return Q&&ne["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&Ce(lf,p.ownerDocument.doctype.name)&&(ae="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
7
7
|
`+ae),M&&(ae=bn(ae)),x&&Qe?k(ae):ae},t.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(_),Me=!0,Le=ne,Ge=ee},t.clearConfig=function(){yt=null,Me=!1,Le=null,Ge=null,x=z,O=""},t.isValidAttribute=function(_,u,p){yt||Yn({});const A=ie(_),D=ie(u);return cr(A,D,p)},t.addHook=function(_,u){typeof u=="function"&&we(W,_)&&un(W[_],u)},t.removeHook=function(_,u){if(we(W,_)){if(u!==void 0){const p=Wd(W[_],u);return p===-1?void 0:Vd(W[_],p,1)[0]}return Ba(W[_])}},t.removeHooks=function(_){we(W,_)&&(W[_]=[])},t.removeAllHooks=function(){W=Va()},t}Ua();const Uo=new Map,Yo=new Map,Cf=()=>()=>{},hf=()=>!0,yf=()=>!1;function Ya(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 bf(e){const t=Yo.get(e);if(t)return t;const n=fetch(e).then(o=>o.ok?o.text():null).then(o=>(o!=null&&Uo.set(e,o),o)).catch(()=>null).finally(()=>{Yo.delete(e)});return Yo.set(e,n),n}function Sf(e,t=!0){const n=c.useSyncExternalStore(Cf,hf,yf)&&t&&e?Ya(e)??Uo.get(e)??null:null,[o,r]=c.useState({src:e,enabled:t,svg:n});return c.useEffect(()=>{if(!t||!e){r({src:e,enabled:t,svg:null});return}const a=Ya(e)??Uo.get(e)??null;if(a!==null){r({src:e,enabled:t,svg:a});return}let i=!0;return bf(e).then(l=>{i&&r({src:e,enabled:t,svg:l})}),()=>{i=!1}},[e,t]),o.src===e&&o.enabled===t?o.svg:n}exports.CACHE_GROUPS=Or,exports.CORE_VERSION=Js,exports.DocumentTitleSuppressContext=yr,exports.EMPTY_COMPOSITION=_o,exports.MediaQueryOverrideContext=mr,exports.NO_CODA=je,exports.SYLLABLE_MIN=He,exports.VAP_PAGE_SIZE_OPTIONS=wt,exports.buildGradeSection=oa,exports.buildPartOfSpeechSection=ra,exports.buildPositionSection=$c,exports.buildSelectSection=Hc,exports.buildSyllableSection=jc,exports.buildWordTypeSection=aa,exports.charToPronValue=pa,exports.convertComposition=ga,exports.fmtBytes=Gi,exports.gradeDescriptions=wa,exports.lsBytes=Lr,exports.meaningKey=Po,exports.normalizeWordAttributeFilter=dc,exports.pronToCharValue=ma,exports.syllableToFilter=Eo,exports.toWordAttributeFilterCodes=fo,exports.today=Wt,exports.toggleAttributeFilter=Gc,exports.useAnchoredMenu=Id,exports.useCacheManagement=Wi,exports.useDailyTrainingSelection=bd,exports.useDelayedHoverAnchor=Ad,exports.useDeviceManagement=ou,exports.useDocumentTitle=Ci,exports.useEscToClose=Sd,exports.useFontScale=ci,exports.useHoverAnchor=Ed,exports.useInlineSvg=Sf,exports.useListControls=_d,exports.useMediaQuery=gi,exports.usePageResetOnChange=va,exports.usePagedList=Td,exports.usePasswordChange=Ai,exports.useRelativeDay=Si,exports.useSoundCompassExam=Pd,exports.useTablePaging=tu,exports.useTableSort=nu,exports.useToastState=vd,exports.useTrainingTypeLabels=Rd,exports.useVisitAllPanel=qi,exports.useVisitHistory=Yi,exports.useVisitSchedule=Ki,exports.useWindowEvent=Xn,exports.useWordAttributeFilterKeys=na,exports.useWordDataStats=Vi,exports.useWordMeanings=wd,exports.useWordTrainingDataGeneration=ld,exports.useWordTrainingFilter=id,exports.valueToJamos=ze,exports.wordAttributeFilterFromCodes=po;
|