@ihabdevteam/core 0.398.0 → 0.399.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.
@@ -819,7 +819,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
819
819
  \uC2E0\uB8B0\uB97C \uC313\uACE0
820
820
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",bizNo:"\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638",bizNoValue:"526-81-02926"},Nb={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},Eb={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"},Db={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},Sb={ariaLabel:"\uC120\uD0DD \uD0ED"},jb={ariaLabel:"\uD0ED"},Tb={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},Mb={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},Lb={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"}},$b={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",done:"\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",detailFor:"{{name}} \uC0C1\uC138\uBCF4\uAE30"},Rb={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"}},Pb={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},Fb={skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",runs:"{{count}}\uD310"},Ib={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"},Ob={viewWords:"\uB0B1\uB9D0"},zb={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},Wb={chooseDate:"\uB0A0\uC9DC \uC120\uD0DD",selectYear:"\uC5F0 \uC120\uD0DD",selectMonth:"\uC6D4 \uC120\uD0DD"},Hb={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},Vb={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},qb={place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},Ub={clearSelection:"\uC120\uD0DD \uD574\uC81C"},Gb={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Kb={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Yb={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},Zb={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},Xb={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},Jb={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},Qb={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"},eg={common:Qf,calendar:eb,passCard:tb,rating:nb,colorPicker:ab,dropdown:rb,accordion:ob,header:sb,nav:lb,settings:ib,usage:ub,account:cb,training:db,customers:pb,payment:hb,coupons:mb,visits:Cb,trainingType:fb,myWordTable:bb,keyWords:gb,wordTable:yb,wordSearch:vb,wordPrint:_b,topic:xb,device:wb,manager:Bb,wordPairs:kb,footer:Ab,date:Nb,wordData:Eb,textField:Db,segmentedControl:Sb,tabs:jb,fileUpload:Tb,avatar:Mb,myHomework:Lb,trainingStatus:$b,store:Rb,progress:Pb,trainingMiss:Fb,table:Ib,wordScore:Ob,topBanner:zb,datePicker:Wb,report:Hb,tooltip:Vb,phonemeProfile:qb,bulkBar:Ub,debug:Gb,badge:Kb,loader:Yb,soundCompass:Zb,breadcrumb:Xb,board:Jb,promoBannerBg:Qb},tg={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",collapseFor:"Collapse {{name}}",expandFor:"Expand {{name}}",sortFor:"Sort {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",discardConfirm:{title:"Discard your changes?",body:"If you do not save, everything you have entered will be lost.",confirm:"Discard"},close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",likeCount_one:"{{count}} like",likeCount_other:"{{count}} likes",selectedOfMax:"{{count}} of {{max}}",downloadCount_one:"{{count}} download",downloadCount_other:"{{count}} downloads",descriptionFor:"About {{name}}",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",loading:"Loading",playFor:"Play {{name}}",pauseFor:"Pause {{name}}",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",noMatches:"No matching items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},ng={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"]},ag={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"}},rg={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},og={selected:"selected"},sg={placeholder:"Select"},lg={collapse:"Collapse",expand:"Expand"},ig={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},ug={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"},cg={cache:{cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"}}}},dg={couponButton:"Enter Coupon"},pg={security:{password:{currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."}}},hg={settings:"Settings",filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions_one:"{{n}} question",countQuestions_other:"{{n}} questions",countSentences_one:"{{n}} sentence",countSentences_other:"{{n}} sentences",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",selectInOrder:"Select the cards in the order you heard.",stop:"Stop",preview:"Preview",previewFor:"Preview {{name}}",stopFor:"Stop {{name}}",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",ttsUnavailable:"Speech playback isn't available on this device.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{pendingDone:"Results are still being calculated, so you can't finish yet.",eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",replaySound:"Replay item {{no}}",replaySoundStop:"Stop item {{no}}",done:"Done",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{synthesizing:"Preparing the sound\u2026",preparing:"Preparing sound\u2026"}},mg={totalCount:" customers",loadError:"Failed to load list",device:{title:"Hearing Devices",addButton:"Add device",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",historyTitle:"Hearing device history"},schedule:{registerTitle:" Register Schedule"},visitHistory:{empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"},consent:{record:"Record consent",kinds:"Kinds given",methodTitle:"How it was given",sourceTitle:"Who gave it",day:"Date given",note:"Note",notePlaceholder:"Referring clinic and the like \u2014 do not write anything sensitive",submit:"Save",allTaken:"All three kinds are already on record. Revoke one first to record it again.",kind:{personal:"General personal data",sensitive:"Sensitive data (hearing, diagnosis)",marketing:"Marketing messages"},method:{paper:"On paper",verbal:"Spoken",electronic:"Electronic"},source:{self:"The customer",guardian:"A guardian",referral:"A referring body"}}},Cg={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},fg={input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply"},bg={showN:"Show {{n}}"},gg={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."}},yg={newBadge:"Newly created",publishedBadge:"Published",sharedBadge:"Shared"},vg={title:"Key Words",empty:"No key words available."},_g={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",caption:"Form",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",copyItem:"Duplicate",copyItemAria:"Duplicate the word in cell {{n}}",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount_one:"{{count}} word",itemCount_other:"{{count}} words",deleteAriaLabel:"Delete {{name}}",viewLabel:"View as",sortLabel:"Sort by",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},publisherFilter:"Show only tables by {{name}}",groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",markName:{o:"Correct",triangle:"Partial",x:"Incorrect"},button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap \u25CB \xB7 \u25B3 \xB7 \u2715 under a cell to mark it. With a mouse they appear when you hover the cell; with a keyboard, when focus reaches it.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved_one:"Saved {{count}} mark for {{name}}.",saved_other:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage_one:"Builds a new table from the {{count}} cell {{name}} got wrong or partial. Correct ones are left out.",reviewMessage_other:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated_one:"Created \u201C{{name}}\u201D \u2014 {{count}} cell.",reviewCreated_other:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage_one:"You marked {{count}} cell but have not saved. Leaving discards it.",discardMessage_other:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"},info:{grade:"Grade: {{n}}",syllables:"Syllables: {{n}}",pos:"Part of speech: {{v}}",wordType:"Type: {{v}}"},pos:{noun:"Noun",verb:"Verb",adjective:"Adjective",adverb:"Adverb",numeral:"Numeral",determiner:"Determiner",interjection:"Interjection",particle:"Particle",affix:"Affix",dependentNoun:"Dependent noun",pronoun:"Pronoun",auxVerb:"Auxiliary verb",auxAdjective:"Auxiliary adjective"},reorder:{moved:"Moved to position {{n}} of {{total}}",handle:"Reorder {{word}} (Alt + arrow keys)",hint:"Alt + \u2190 \u2192 to reorder"},thumbMore:"+{{count}}"},xg={filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Difficulty",grade:"Grade {{n}}",age:"Age {{n}}",difficultyInfoAge:"Age 3\u20137: the easiest words (grade 1), split by age.",difficultyInfoGrade:"Grades 2\u20134: harder words, not split by age.",difficultyInfoNone:"None: words with no difficulty assigned.",gradeNone:"None",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",field:"Semantic Category",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193",original:"Original order"},pageSize:"Show {{count}}",pageSizeAria:"Page size"},wg={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removePairFor:"Remove the pair {{name}}",removeWord:"Remove word",removeWordFor:"Remove {{name}}"},Bg={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"}},kg={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant",other:"Other"}},Ag={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"}},Ng={phonemeSelect:{vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",countLabel:"Number of phonemes",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:["Level 1 \u2014 everyday vocabulary acquired before school age and used for life","Level 2 \u2014 difficulty of grades 1\u20132","Level 3 \u2014 difficulty of grades 3\u20134","Level 4 \u2014 difficulty of grades 5\u20136","No level \u2014 frequent everyday words outside the national standard list, plus coinages and loanwords"],selectLabel:"Select",onlyHasImage:"Only words with images",onlyHighUsage:"High-use words only",onlySameStructure:"Only same phoneme structure"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},Eg={lead:`IHAB builds trust
821
821
  through sound
822
- and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},Dg={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},Sg={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"},jg={clearAriaLabel:"Clear input"},Tg={ariaLabel:"Select tab"},Mg={ariaLabel:"Tabs"},Lg={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},$g={ariaLabel:"User avatar"},Rg={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Pg={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},Fg={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"}},Ig={steps:"Step {{current}} of {{total}}"},Og={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},zg={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Wg={viewWords:"Words"},Hg={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Vg={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},qg={previewRegion:"Report preview \u2014 scrollable sideways"},Ug={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Gg={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Kg={clearSelection:"Clear selection"},Yg={showResult:"Show {{type}} result"},Zg={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Xg={loading:"Loading"},Jg={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Qg={ariaLabel:"Breadcrumb"},ey={empty:"No items yet."},ty={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"},ny={common:tg,calendar:ng,passCard:ag,rating:rg,colorPicker:og,dropdown:sg,accordion:lg,header:ig,nav:ug,settings:cg,usage:dg,account:pg,training:hg,customers:mg,payment:Cg,coupons:fg,visits:bg,trainingType:gg,myWordTable:yg,keyWords:vg,wordTable:_g,wordSearch:xg,wordPrint:wg,topic:Bg,device:kg,manager:Ag,wordPairs:Ng,footer:Eg,date:Dg,wordData:Sg,textField:jg,segmentedControl:Tg,tabs:Mg,fileUpload:Lg,avatar:$g,myHomework:Rg,trainingStatus:Pg,store:Fg,progress:Ig,trainingMiss:Og,table:zg,wordScore:Wg,topBanner:Hg,datePicker:Vg,report:qg,tooltip:Ug,phonemeProfile:Gg,bulkBar:Kg,debug:Yg,badge:Zg,loader:Xg,soundCompass:Jg,breadcrumb:Qg,board:ey,promoBannerBg:ty};const ay="0.398.0",ry=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],mo="ko",oy="ihab_display_language";function Jl(){if(typeof window>"u")return mo;try{const e=localStorage.getItem(oy);if(e&&ry.some(t=>t.code===e))return e}catch{}return mo}function Ql(e){try{document.documentElement.lang=e}catch{}}Vt.on("languageChanged",Ql),Ql(Jl()),Vt.use(xe.initReactI18next).init({resources:{ko:{translation:eg},en:{translation:ny}},lng:Jl(),fallbackLng:mo,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const sy=new Map;try{Vt.store?.on?.("added",()=>sy.clear())}catch{}let pr=null,ei=null,ti=null;function ly(){const e=zl();if(e&&e.entries.length>0){const t=yf();if(pr&&ei===e&&ti===t)return pr;const a=new Set,r=[];for(const s of e.entries)!s.word||a.has(s.word)||(a.add(s.word),r.push({w:s.word,s:s.syllables,p:t?.[s.word]?[...t[s.word].cho??[],...t[s.word].jung??[],...t[s.word].jong??[]]:[],pron:s.pronunciation||s.word,grade:s.grade}));return pr=r,ei=e,ti=t,pr}return[]}new Proxy([],{get(e,t){const a=ly(),r=a[t];return typeof r=="function"?r.bind(a):r}});function iy(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function uy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&iy(r.attrValue)&&(r.keepAttr=!1)};ia.addHook("uponSanitizeAttribute",t);try{return ia.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{ia.removeHook("uponSanitizeAttribute",t)}}function cy(e){const[t,a]=o.useState(null),[r,s]=o.useState(null),[l,i]=o.useState(null),[u,c]=o.useState(null),[d,h]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),s(null),i(null),c(null);return}const p=e.split("/").pop();let m=e;p&&(e.startsWith("/")?m=eo(e):/^(Logo|Symbol)/i.test(p)?m=eo(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),m=e)),i(null),c(null),a(e),s(m)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function m(){try{let g=await fetch(r);g.ok||(g=await fetch(r));const y=g.headers.get("content-type")||"";if(p)return;if(y.includes("svg")){i("mask");return}if(y.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const f=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(f)){const _=uy(f);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return m(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,m=null;return l==="mask"&&r&&fetch(r).then(g=>{if(!g.ok)throw new Error("fetch failed");return g.blob()}).then(g=>{p||(m=URL.createObjectURL(g),h(m))}).catch(()=>{p||i("img")}),()=>{p=!0,m&&URL.revokeObjectURL(m),h(null)}},[l,r]),t===e?{iconToUse:r,mode:l,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function at(e){const{icon:t,label:a,className:r,imgClassName:s,maskClassName:l,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",h=s??"iconRenderer-icon-image",p=l??"iconRenderer-icon-mask",m=i??"iconRenderer-icon-svg",g=typeof t=="string"?t:null,y=J0(g),{iconToUse:C,mode:f,svgText:_,blobUrl:b}=cy(g),w=(B,D={})=>n.jsx("span",{className:d,style:u,...D,children:B}),v=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,A=(B,D={})=>n.jsx("img",{src:B,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:h,...D,style:v?{...D.style,...v}:D.style});if(!t)return null;if(typeof t!="string")return w(t);if(t==="none")return w(n.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(y)try{return w(o.createElement(y,{className:m,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(f==="mask"){const B={"--icon-url":b?`url(${b})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return w(n.jsx("span",{className:p,style:B}),{"aria-hidden":"true"})}return f==="img"?w(A(C,{onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):f==="inline"?w(n.jsx("span",{className:m,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):w(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return A(eo(t),{style:u,onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}});const x=typeof c=="number"?c:20,E=`<svg width="${x}" height="${x}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return w(n.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:E}}),{"aria-hidden":"true"})}function ni(e){const[t,a]=o.useState(!1),r=o.useRef(!1),s=o.useRef(!0);o.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]);const l=o.useCallback(()=>{if(!e||r.current)return;const i=e();if(i&&typeof i.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,s.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:l}}function dy({icon:e,title:t,message:a,action:r,className:s}){const{pending:l,press:i}=ni(r?.onClick);return n.jsxs("div",{className:Ae("empty-state",s),children:[e&&n.jsx(at,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:i,disabled:l,"aria-busy":l||void 0,children:[r.icon&&n.jsx(at,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function py({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:s,className:l}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=ni(r);return n.jsxs("div",{className:Ae("empty-state","error-state",l),role:"alert",children:[n.jsx(at,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??i("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(at,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:s??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function hy({icon:e,title:t,description:a,cta:r,tone:s="main",disabled:l=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,h=`${c}-desc`,p=`${c}-cta`,m=()=>{l||i?.()};return n.jsx("section",{role:"button",tabIndex:l?-1:0,"aria-disabled":l||void 0,"aria-labelledby":d,"aria-describedby":`${h} ${p}`,onClick:m,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),m())},className:Ae("action-card",`action-card--${s}`,l&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(at,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:h,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(at,{icon:"arrow-right",size:18})})]})]})})}function my({as:e="div",className:t="",children:a,storage:r,...s}){r&&I1({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const l=Ae("ihabdevteam-core-scope",t);return n.jsx(e,{className:l,...s,children:a})}function Cy(e){if(e.closest('[aria-hidden="true"], [hidden], [inert]'))return!1;for(let t=e;t;t=t.parentElement){const a=window.getComputedStyle(t);if(a.display==="none"||a.visibility==="hidden"||a.visibility==="collapse")return!1}return!0}function Co(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=s=>{if(s.key!=="Tab")return;const l=Array.from(a.querySelectorAll(Nn)).filter(Cy);if(!l.length){s.preventDefault();return}const i=l[0],u=l[l.length-1],c=document.activeElement,d=c===a;s.shiftKey&&(c===i||d)?(s.preventDefault(),u.focus()):!s.shiftKey&&c===u&&(s.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const Nn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',fo=new WeakMap;function bo(e,t){e&&fo.set(e,t)}function go(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!fo.has(r);)r=r.parentElement;if(!r)return t;t=fo.get(r)??null}return t}function ai(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function hr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(ai(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const s=Array.from(document.querySelectorAll(Nn)).filter(c=>!(e&&e.contains(c))&&ai(c));let l=null,i=null;for(const c of s)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?l=c:i||(i=c);const u=l??i;return u?.focus(),u}function fy({title:e="",lines:t=[],notices:a=null,children:r,variant:s="default",dismissible:l=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),h=o.useRef(null),p=o.useCallback(()=>{const C=h.current;C&&C.contains(document.activeElement)&&hr(C),d(!0)},[]);if(c)return null;const m=`notice-box notice-box--${s} body-2 ${i}`.trim(),g=l&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:m,role:"note",children:[a.map((C,f)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,b)=>n.jsx("span",{className:"notice-box__line body-3",children:_},b))}):C.children??null})]},f)),g]});const y=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,f)=>n.jsx("li",{className:"notice-box__line",children:C},f))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:h,className:m,role:"note",children:[y,g]})}const by={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function pa(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:s=null,label:l}=e||{},i=l||t("loader.loading","Loading");if(a==="bar"){const c=s==null||!Number.isFinite(Number(s)),d=c?0:Math.max(0,Math.min(100,Number(s)));return n.jsx("div",{className:`loader-bar${c?" loader-bar--indeterminate":""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c?void 0:d,"aria-label":i,children:n.jsx("div",{className:"loader-bar__inner",style:c?void 0:{width:`${d}%`}})})}const u=typeof r=="number"?`${r}px`:r;return n.jsxs("div",{className:"loader-spinner",style:{width:u,height:u},role:"status","aria-label":i,children:[n.jsx("span",{style:by,children:i}),n.jsxs("svg",{className:"loader-spinner__svg",viewBox:"0 0 50 50",width:r,height:r,children:[n.jsx("circle",{className:"loader-spinner__bg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"}),n.jsx("circle",{className:"loader-spinner__fg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round"})]})]})}const ha=[];let mr=!1;function ri(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ha[ha.length-1];t&&(e.stopPropagation(),t())}function Zn(e){return ha.push(e),!mr&&typeof document<"u"&&(document.addEventListener("keydown",ri),mr=!0),()=>{const t=ha.lastIndexOf(e);t>=0&&ha.splice(t,1),ha.length===0&&mr&&typeof document<"u"&&(document.removeEventListener("keydown",ri),mr=!1)}}const oi=o.createContext(null);function gy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const si=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function yy(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return Rs.useSyncExternalStore(t,()=>si(e),()=>!1)}function vy(e){const[t,a]=o.useState(si(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),s=i=>a(i.matches),l=r;return l.addEventListener?l.addEventListener("change",s):l.addListener&&l.addListener(s),a(r.matches),()=>{l.removeEventListener?l.removeEventListener("change",s):l.removeListener&&l.removeListener(s)}},[e]),t}const _y=typeof Rs.useSyncExternalStore=="function"?yy:vy;function yn(e){const t=o.useContext(oi),a=_y(e);return t&&typeof t.mobile=="boolean"&&gy(e)?t.mobile:a}const xy="(prefers-reduced-motion: reduce)";function yo(){return yn(xy)}const li={"menu-tooltip":"tooltip-menu","description-tooltip":"tooltip-description","text-box-tooltip":"tooltip-textbox","training-tooltip":"tooltip-training","word-image-tooltip":"tooltip-word-image","info-tooltip":"tooltip-info","noise-settings-tooltip":"noise-settings",tooltip__header:"tooltip-content__header",tooltip__content:"tooltip-content",tooltip__backdrop:"tooltip-backdrop",tooltip__portal:"tooltip-portal","word-table__section":"word-table-block","word-table__content":"word-table-block__content","word-table__card":"word-table-block__card","word-table__card-handle":"word-table-block__card-handle","word-table__card-close":"word-table-block__card-close","word-table__card-actions":"word-table-block__card-actions","word-table__edit-cell":"word-table-block__edit-cell","word-table__pair-divider":"word-table-block__pair-divider","chart-section__legend-dot":"manager-bar-chart-legend-dot","chart-section__legend-item":"manager-bar-chart-legend-item","chart-section__legend":"manager-bar-chart-legend","chart-section__controls":"manager-section-controls","chart-section__sub-row":"barchart-sub-row","chart-section__total":"barchart-total","chart-section":"manager-section","bar-chart__stack-segment":"manager-bar-chart-stack-segment","bar-chart__detail-btn":"manager-bar-chart-detail-btn","bar-chart__gridline":"manager-bar-chart-gridline","bar-chart__loading":"manager-bar-chart-loading","bar-chart__scroll":"manager-bar-chart-scroll","bar-chart__stack":"manager-bar-chart-stack","bar-chart__x-axis":"manager-bar-chart-x-axis","bar-chart__inner":"manager-bar-chart-inner","bar-chart__area":"manager-bar-chart-area","bar-chart__plot":"manager-bar-chart-plot","bar-chart__wrap":"manager-bar-chart-wrap","bar-chart__slot":"manager-bar-chart-slot","bar-chart__col":"manager-bar-chart-col","bar-chart__bar":"manager-bar-chart-bar","stat-chart__card":"manager-stat-card"};function wy(e,t){const a=Object.keys(e).sort((r,s)=>s.length-r.length);for(const r of a){if(!t.startsWith(r))continue;const s=t.slice(r.length);if(!(s!==""&&!s.startsWith("__")&&!s.startsWith("--")))return e[r]+s}return null}function By(e){return wy(li,e)}function se(e){if(!e||Object.keys(li).length===0)return e;const t=[];for(const a of e.split(/\s+/)){if(!a)continue;const r=By(a);r&&t.push(r)}return t.length?`${e} ${t.join(" ")}`:e}function wn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:s=20,onClose:l,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:h,backdrop:p=!1,isMobilePopup:m=!1,useBorder:g=!0,header:y,focusOnOpen:C}=e||{},f=o.useRef(null),[_,b]=o.useState({position:"fixed",left:0,top:-9999}),[w,v]=o.useState(!1),[A,x]=o.useState("bottom"),[E,B]=o.useState(!1),[D,N]=o.useState(!1),k=!t&&!a,P=o.useRef(null),$=o.useCallback((L=!1,W=!1)=>{if(D&&m)return;const Y=a?a.getBoundingClientRect():t,U=W&&P.current?P.current:Y;if(!U||!f.current)return;const j=f.current,{offsetWidth:R,offsetHeight:z}=j,O=window.innerWidth,ue=window.innerHeight,te=O-U.right,de=U.left,ee=U.top,V=ue-U.bottom;let ae=0,H=0,q="top";if(ee>=z+r)q="top",H=U.top-r-z,ae=U.left+U.width/2-R/2;else if(V>=z+r)q="bottom",H=U.bottom+r,ae=U.left+U.width/2-R/2;else if(te>=R+r)q="right",ae=U.right+r,H=U.top+U.height/2-z/2;else if(de>=R+r)q="left",ae=U.left-r-R,H=U.top+U.height/2-z/2;else{const he=Math.max(ee,V,te,de);he===ee?(q="top",H=U.top-r-z,ae=U.left+U.width/2-R/2):he===V?(q="bottom",H=U.bottom+r,ae=U.left+U.width/2-R/2):he===te?(q="right",ae=U.right+r,H=U.top+U.height/2-z/2):(q="left",ae=U.left-r-R,H=U.top+U.height/2-z/2)}const ie=Number.isFinite(Number(s))?Number(s):8;ae=Math.min(Math.max(ae,ie),O-R-ie),H=Math.min(Math.max(H,ie),ue-z-ie);const Ne=Math.round(ae),_e=Math.round(H);L&&f.current?(f.current.style.left=`${Ne}px`,f.current.style.top=`${_e}px`,f.current.dataset.placement=q):(x(q||A),b({position:"fixed",left:Ne,top:_e}),B(!0))},[D,m,a,t,r,s,A]);o.useEffect(()=>()=>{P.current=null},[a,t]),o.useLayoutEffect(()=>{if(k)return;if(D&&m){b({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),B(!0);return}P.current===null&&(P.current=a?a.getBoundingClientRect():t??null),$(!1,!0);const L=requestAnimationFrame(()=>$(!1,!0));return()=>cancelAnimationFrame(L)},[t,a,r,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m||!f.current||typeof ResizeObserver>"u")return;const L=new ResizeObserver(()=>{t&&$()});return L.observe(f.current),()=>L.disconnect()},[t,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m)return;let L=null;const W=()=>{if(a&&(P.current=a.getBoundingClientRect()),typeof requestAnimationFrame>"u"){$(!0);return}L===null&&(L=requestAnimationFrame(()=>{L=null,$(!0)}))},Y=U=>{if(!a&&l){const j=U.target;if(j&&f.current&&f.current.contains(j))return;try{if(j&&j.closest&&j.closest("[data-tooltip-ignore]"))return}catch{}Q.current(!0);return}W()};return window.addEventListener("resize",W),document.addEventListener("scroll",Y,{passive:!0,capture:!0}),()=>{L!==null&&cancelAnimationFrame(L),window.removeEventListener("resize",W),document.removeEventListener("scroll",Y,{capture:!0})}},[t,a,l,r,h,s,k,D,m,$]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const L=window.matchMedia("(max-width: 768px)"),W=()=>N(!!L.matches);W();try{L.addEventListener?L.addEventListener("change",W):L.addListener(W)}catch{try{L.addListener(W)}catch{}}return()=>{try{L.removeEventListener?L.removeEventListener("change",W):L.removeListener(W)}catch{}}},[]);const G=o.useRef(!1),T=o.useRef(null),F=yo(),M=o.useCallback((L=!1)=>{if(l&&!(w||G.current)){if(G.current=!0,L){v(!0);try{l&&l()}catch{G.current=!1,v(!1)}return}v(!0),T.current=setTimeout(()=>{T.current=null;try{l&&l()}catch{G.current=!1,v(!1)}},F?0:200)}},[w,l,v,F]);o.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]),o.useEffect(()=>{if(k)return;const L=U=>{const j=f.current;if(!j)return;const R=U.target;if(R&&!j.contains(R)){try{if(R.closest&&R.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},W=U=>{const j=f.current;if(!j)return;const R=U.target;if(R&&!j.contains(R)){try{if(R.closest&&R.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},Y=U=>{if(U.key==="Tab"){const j=f.current;if(!j)return;const R=j.querySelectorAll(Nn);if(!R||R.length===0)return;const z=R[0],O=R[R.length-1],ue=document.activeElement;U.shiftKey?ue===z&&(U.preventDefault(),O.focus()):ue===O&&(U.preventDefault(),z.focus())}};return document.addEventListener("pointerdown",L,!0),document.addEventListener("click",W,!0),document.addEventListener("keydown",Y),()=>{document.removeEventListener("pointerdown",L,!0),document.removeEventListener("click",W,!0),document.removeEventListener("keydown",Y)}},[l,i,M,k]);const Q=o.useRef(M);o.useEffect(()=>{Q.current=M});const Z=!!l;o.useEffect(()=>{if(!(k||!Z))return Zn(()=>Q.current())},[k,Z]),o.useEffect(()=>{const L=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",L),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",L)}},[M]);const I=o.useRef(null);o.useEffect(()=>{if(k||C===!1||!E)return;const L=f.current;if(!L)return;const W=L.querySelector(Nn);if(W)return I.current=document.activeElement,W.focus({preventScroll:!0}),()=>{const Y=I.current;I.current=null,Y&&document.contains(Y)&&Y.focus({preventScroll:!0})}},[k,C,E]),o.useEffect(()=>{c==="dialog"&&!d&&Bt("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const K=n.jsxs("div",{ref:f,className:se(`tooltip__content ${k?"tooltip__content--inline":""} ${g?"tooltip__content--bordered":""} ${w?"is-closing":""} ${u} ${D&&m?"is-mobile":""}`),role:c,"aria-label":d||void 0,style:k?{}:{..._,visibility:E?"visible":"hidden"},tabIndex:-1,"data-placement":A,"data-left":k?"":_.left,"data-top":k?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[y!=null&&n.jsx("div",{className:se("tooltip__header h5"),children:y}),h]});if(k||typeof document>"u")return K;if(p||D&&m){const L=n.jsxs("div",{className:se("tooltip__portal"),children:[n.jsx("div",{className:se("tooltip__backdrop"),onClick:()=>{i&&M(!0)}}),K]});return pn.createPortal(L,document.body)}return pn.createPortal(K,document.body)}function Tn(e){const{anchorRect:t,text:a,offset:r=8,onClose:s,className:l="",ariaLabel:i}=e||{};return a?n.jsx(wn,{anchorRect:t,offset:r,onClose:s,closeOnOutsideClick:!1,className:se(`info-tooltip ${l}`),ariaLabel:i||a,children:n.jsx("div",{className:se("info-tooltip__content body-3"),children:a})}):null}function Xn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:s,activeIndex:l=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},h=(Array.isArray(s)?s:s?[s]:[]).map(p=>typeof p=="string"?{text:p}:p);return!h.length&&!r?null:n.jsx(wn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:se("description-tooltip"),ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:se("description-tooltip__box"),children:[r&&n.jsx("span",{className:se("description-tooltip__title body-2"),children:r}),n.jsx("ol",{className:se("description-tooltip__items"),children:h.map((p,m)=>n.jsxs("li",{className:se(`description-tooltip__item body-3${m===l?" description-tooltip__item--active":""}`),children:[i&&h.length>1&&n.jsxs("span",{className:se("description-tooltip__index button-1"),children:[m+1,"."]}),p.color&&n.jsx("span",{className:se("description-tooltip__dot"),style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},m))})]})})}function Fa(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let vo=0,ii=!1;function ui(){ii||typeof document>"u"||(ii=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(vo=Date.now())},!0),document.addEventListener("touchstart",()=>{vo=Date.now()},{capture:!0,passive:!0}))}ui();function ma(e){return!!e&&e.pointerType==="touch"}function Ca(e=1e3){return ui(),Date.now()-vo<e}function _o(e,t,a,{enabled:r=!0,fallbackOnParent:s=!1}={}){const l=Fa(e),i=Fa(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const h=p=>{const m=p,g=p.target,y=a.current,C=!!(g&&y&&y.contains(g));if(m.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=l.current;return}u.current=null,l.current&&!(g&&g.closest?.(".tooltip__content"))&&i.current(!1,y)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[r,a,l,i]);const d=o.useCallback(h=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),i.current(!p,h??a.current),!0)},[a,i]);return o.useEffect(()=>{if(!r||!s)return;const h=a.current,p=h?.parentElement;if(!h||!p)return;let m=null;const g=f=>{const _=f.changedTouches?.[0];if(!_)return!1;const b=h.getBoundingClientRect();return _.clientX>=b.left&&_.clientX<=b.right&&_.clientY>=b.top&&_.clientY<=b.bottom},y=f=>{m=g(f)?l.current:null},C=f=>{const _=m;m=null,!(_===null||Date.now()-c.current<700||!g(f))&&(u.current=null,c.current=Date.now(),i.current(!_,h))};return p.addEventListener("touchstart",y,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",y),p.removeEventListener("touchend",C)}},[r,s,a,l,i]),{touchPress:d}}function ky(e,t){const{size:a=48,type:r,htmlType:s,href:l,target:i,rel:u,icon:c,rightIcon:d,label:h,count:p,subLabel:m,children:g,ariaLabel:y,variant:C="default",align:f="center",nowrap:_=!1,selected:b,toggleable:w=!1,ariaExpanded:v,ariaControls:A,disabled:x=!1,loading:E=!1,useLabel:B=!0,useBorder:D=!0,useBG:N=!0,useDisabledCovered:k=!1,useDisabledInvisible:P=!1,useDisabledFilled:$=!1,width:G,minWidth:T,onClick:F,onDisabledClick:M,showTooltipInfo:Q=!1,tooltipInfoText:Z=null,tooltipDescription:I=null,tooltipOnly:K=!1,iconSize:L="medium",iconColor:W,shape:Y="rounded",color:U,className:j,...R}=e,z=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),O=z.match(/^\d+$/)?`button${z}`:`button-${z}`,ue=Number(a),te=!isNaN(ue)&&ue<40?"button-2":"button-1",de=h??g,ee=x||!!R.disabled,V=ee?k?"disabled-covered":P?"disabled-invisibled":$?"disabled-filled":"disabled":C,ae=V?`button--variant-${V}`:"",H=f?`button--align-${f}`:"",q=_?"button--nowrap":"",ie=Y?`button--shape-${Y}`:"",Ne=typeof W=="string"&&W.startsWith("--")?`var(${W})`:W,_e={...G?{width:typeof G=="number"?`${G}px`:G}:{},...T?{minWidth:typeof T=="number"?`${T}px`:T}:{},...D?{}:{"--button-border":ee?"0":"1px solid transparent"},...Ne?{"--button-icon-color":Ne}:{},...U?{"--color-main":U}:{}},he=B===!1?"":de,je=Array.isArray(he)?he.length>0:!!he,$e=!!d,De=r??(je||c||$e?"bar":"dot"),le=`${O}--${De}`,we=o.useRef(null);o.useEffect(()=>{!On||s!==void 0||we.current?.closest("form")&&Bt(`button-in-form:${typeof de=="string"?de:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof de=="string"&&de?` \uB2E8\uCD94: ${de}`:""))},[s,de]);const Le=o.useRef(t);Le.current=t;const Be=o.useCallback(Me=>{we.current=Me;const lt=Le.current;typeof lt=="function"?lt(Me):lt&&(lt.current=Me)},[]),ze=o.useRef(ee),[Ve,ut]=o.useState(!!b),[et,Xe]=o.useState(!1),[yt,Te]=o.useState(null),Ke=o.useCallback(()=>Xe(!1),[]),[ke,qe]=o.useState(!1),Je=o.useId();o.useEffect(()=>{typeof b=="boolean"&&ut(b)},[b]),o.useEffect(()=>{if(ze.current&&!ee&&we.current){const Me=we.current;let lt=!1;try{lt=Me.matches(":focus:not(:focus-visible)")}catch{lt=!1}lt&&Me.blur(),Me.style.pointerEvents="none";const re=requestAnimationFrame(()=>{requestAnimationFrame(()=>{we.current&&(we.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(re)}ze.current=ee},[ee]);const tt=typeof b=="boolean"?!!b:Ve,xt=typeof v=="boolean"?void 0:w||typeof b=="boolean"?tt?"true":"false":R["aria-pressed"],wt=Ae("button",O,le,ae,H,q,ie,tt?"is-selected":null,N?null:"button--no-bg",K?"button--tooltip-only":null,j),Dt=`button__icon button__icon--${L}`,rt=Array.isArray(m)?m:m!==void 0?[m]:[],nt=()=>{if(Array.isArray(he))return he.map((lt,re)=>{const ve=rt[re];return n.jsxs("span",{className:`button__label-text${ve!==void 0?" button__label-text--has-sub":""}`,children:[lt,ve!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:ve})]},re)});const Me=m!==void 0;return n.jsxs("span",{className:`button__label-text${Me?" button__label-text--has-sub":""}`,children:[he,p!=null&&n.jsx("span",{className:"button__count",children:p}),Me&&n.jsx("span",{className:"button__sub-label-text caption-1",children:m})]})},kt=Me=>{typeof b!="boolean"&&!w&&ut(!1),Me.currentTarget.blur()},At=Me=>{ee||(typeof R.onMouseLeave=="function"&&R.onMouseLeave(Me),kt(Me))},Lt=Me=>{if(K&&ot&&ct.touchPress(Me.currentTarget),ee){ot&&ct.touchPress(Me.currentTarget),Me.preventDefault(),M?.(Me);return}typeof b!="boolean"&&w&&ut(lt=>!lt),F?.(Me)},jt=o.useCallback(()=>{(Q||I)&&(Xe(!0),Te(we.current?.getBoundingClientRect()??null))},[Q,I]),vt=o.useCallback(()=>{(Q||I)&&(Xe(!1),Te(null))},[Q,I]),ot=!!(Q||I),ct=_o(et,Me=>{Me?jt():vt()},we,{enabled:ot&&(ee||K),fallbackOnParent:ot&&ee}),dt={...R};delete dt.disabled,delete dt.className,delete dt.faded,delete dt.useFaded,delete dt.loading,delete dt.onMouseLeave,delete dt.onPointerEnter,delete dt.onPointerLeave,delete dt.onPointerUp,delete dt.onFocus,delete dt.onBlur,ee&&(Object.keys(dt).forEach(Me=>{/^on[A-Z]/.test(Me)&&typeof dt[Me]=="function"&&delete dt[Me]}),dt["aria-disabled"]="true"),E&&(dt["aria-busy"]="true");const _t=(typeof Q=="string"?Q:null)??(typeof Z=="string"?Z:null)??(typeof y=="string"?y:null)??(typeof de=="string"?de:null)??void 0,Ce=typeof y=="string"?y:typeof de=="string"?de:_t,Pe=I?[I.title,...I.items??[]].filter(Boolean).join(". "):Q&&_t&&_t!==Ce?_t:"",ye=[typeof R["aria-describedby"]=="string"?R["aria-describedby"]:void 0,Pe?Je:null].filter(Boolean).join(" ")||void 0,Ye=()=>n.jsx("span",{className:`${Dt} button__spinner`,"aria-hidden":"true",children:n.jsx(pa,{variant:"spinner",size:"100%"})}),bt=(Me,lt)=>n.jsx(at,{icon:Me,label:lt??Ce,className:Dt,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),Nt=Me=>E?Ye():bt(c,Me),mt=()=>De==="dot"?n.jsxs(n.Fragment,{children:[Nt(),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()})]}):f==="center"&&(c||E)?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Nt()}),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()})]}),$e&&n.jsx("span",{className:"button__right",children:bt(d)})]}):n.jsxs(n.Fragment,{children:[(c||E)&&n.jsx("span",{className:"button__left",children:Nt(y??de)}),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()}),$e&&n.jsx("span",{className:"button__right",children:bt(d)})]}),gt=!!l&&!ee;return n.jsxs(n.Fragment,{children:[n.jsxs(gt?"a":"button",{...dt,ref:Be,...gt?{href:l,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:s??"button",disabled:ee&&!M&&!ke},className:wt,"aria-pressed":xt,"aria-expanded":typeof v=="boolean"?v:R["aria-expanded"],"aria-controls":A??R["aria-controls"],"aria-label":Ce,"aria-disabled":ee&&(gt||M||ke)?!0:void 0,"aria-describedby":ye,style:_e,onClick:Lt,onMouseLeave:At,onPointerEnter:Me=>{ma(Me)||jt(),!ee&&typeof R.onPointerEnter=="function"&&R.onPointerEnter(Me)},onPointerLeave:Me=>{ma(Me)||vt(),!ee&&typeof R.onPointerLeave=="function"&&R.onPointerLeave(Me)},onPointerUp:Me=>{ee&&ot&&ct.touchPress(Me.currentTarget),!ee&&typeof R.onPointerUp=="function"&&R.onPointerUp(Me)},onFocus:Me=>{qe(!0),Ca()||jt(),!ee&&typeof R.onFocus=="function"&&R.onFocus(Me)},onBlur:Me=>{qe(!1),ee||kt(Me),vt(),!ee&&typeof R.onBlur=="function"&&R.onBlur(Me)},children:[mt(),Pe?n.jsx("span",{id:Je,hidden:!0,"aria-label":Pe}):null]}),et&&I?n.jsx(Xn,{anchorRect:yt,title:I.title,items:I.items,onClose:Ke}):et&&_t?n.jsx(Tn,{anchorRect:yt,text:_t,onClose:Ke}):null]})}const be=o.forwardRef(ky);be.displayName="Button";function Mt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const s=r.current?.parentElement??null;return t(s,e),()=>a(s)},[e,t,a]),r}const Ia={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},xo=new WeakMap;function wo(e){if(e)return xo.get(e)}function Zt(e,t){e&&(e.style.setProperty(Ia.title,t.title),e.style.setProperty(Ia.description,t.description),xo.set(e,t))}function Xt(e){e&&(e.style.removeProperty(Ia.title),e.style.removeProperty(Ia.description),xo.delete(e))}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function di(){const e=Mt(ci,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const pi={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function hi(){const e=Mt(pi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const mi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ci(){const e=Mt(mi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const fi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function bi(){const e=Mt(fi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const gi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function yi(){const e=Mt(gi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const vi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function _i(){const e=Mt(vi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const xi={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function wi(){const e=Mt(xi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const Bi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ki(){const e=Mt(Bi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const Ai={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function Ni(){const e=Mt(Ai,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const Ei={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function Di(){const e=Mt(Ei,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Si={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ji(){const e=Mt(Si,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const Ti={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Mi(){const e=Mt(Ti,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Li={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function $i(){const e=Mt(Li,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function Pi(){const e=Mt(Ri,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const rn=(e,t,a)=>({key:e,get label(){return Vt.t(`promoBannerBg.${e}`,t)},textTone:a}),Ay=[rn("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("soft","\uC18C\uD504\uD2B8","dark"),rn("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),rn("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),rn("warm","\uC6DC(\uAC15\uC870)","dark"),rn("dark","\uB2E4\uD06C","light"),rn("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),rn("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),rn("outline","\uC544\uC6C3\uB77C\uC778","dark"),rn("success","\uC131\uACF5/\uC644\uB8CC","light"),rn("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),rn("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Fi={main:di,soft:hi,sub:Ci,deep:bi,softSub:yi,warm:_i,dark:wi,radial:ki,diagonal:Ni,dots:Di,outline:ji,success:Mi,naver:$i,instagram:Pi};function Ii({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:s=.1,lineHeightRatio:l=1.4}={}){const i=w=>Math.max(a,Math.min(r,Number(w))),u=w=>{try{const v=localStorage.getItem(w),A=v?Number(v):1;return Number.isFinite(A)?i(A):i(1)}catch{return i(1)}},[c,d]=o.useState(()=>u(e)),[h,p]=o.useState(e);h!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const m=w=>{d(typeof w=="function"?v=>i(w(v)):i(w))},g=()=>m(w=>+(w+s).toFixed(6)),y=()=>m(w=>+(w-s).toFixed(6)),C=c<r-Number.EPSILON,f=c>a+Number.EPSILON,_=Math.round(t*c),b=Math.round(_*l);return{scale:c,setScale:m,increase:g,decrease:y,canIncrease:C,canDecrease:f,fontSize:_,lineHeight:b}}function Oi(e,t){const a=Fa(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const Bo=" \xB7 ",zi=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(Bo)?e.split(Bo).pop()??e:e})(),Ny=o.createContext(!1),Jn=[];let Wi=null;function Ey(e){const t=o.useContext(Ny);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Jn.length===0&&(Wi=document.title);const a={text:zi?`${e}${Bo}${zi}`:e};return Jn.push(a),document.title=a.text,()=>{const r=Jn.lastIndexOf(a);r>=0&&Jn.splice(r,1),document.title=Jn.length?Jn[Jn.length-1].text:Wi??document.title}},[e,t])}const ko=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],Dy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function Cn(e,t){return Dy().compare(e,t)}const Cr=new Map;function Sy(e){const t=Cr.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let s=0;for(let l=r.exec(e);l;l=r.exec(e)){let i=l.index,u=l[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>s&&a.push(e.slice(s,i)),a.push(Number(u)),s=l.index+l[0].length}return s<e.length&&a.push(e.slice(s)),Cr.size>5e3&&Cr.clear(),Cr.set(e,a),a}function jy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function Ty(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),s=a(t);if(r===s)return 0;const l=(d,h)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=jy(h);return p!==null?[p]:Sy(h)},i=l(e,r),u=l(t,s),c=Math.min(i.length,u.length);for(let d=0;d<c;d++){const h=i[d],p=u[d];if(typeof h=="number"&&typeof p=="number"){if(h!==p)return h-p;continue}if(typeof h=="number")return-1;if(typeof p=="number")return 1;const m=Cn(h,p);if(m!==0)return m}return i.length!==u.length?i.length-u.length:Cn(r,s)}const Hi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function fr(e,t,a){const r=Hi(e),s=Hi(t);if(r||s)return r===s?0:r?1:-1;const l=Ty(e,t);return a?l:-l}function My(e,t,a){const{t:r}=xe.useTranslation(),[s,l]=o.useState(()=>{const y=a?.initialPageSize;return y&&ko.some(C=>C.value===y)?y:"25"}),[i,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),i!==1&&u(1));const h=o.useMemo(()=>ko.map(y=>({...y,label:r("visits.showN",{n:y.value})})),[r]),p=o.useCallback(y=>{ko.some(C=>C.value===y)&&(l(y),u(1))},[]),m=Math.max(1,Math.ceil(e.length/Number(s))),g=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),m);return i!==g&&u(g),{pageRows:o.useMemo(()=>e.slice((g-1)*Number(s),g*Number(s)),[e,g,s]),pageSizeProps:{options:h,value:s,onChange:p},paginationProps:{page:g,total:m,onChange:u},setPage:u}}function Ly(e){const[t,a]=o.useState(()=>e?.defaultKey!=null?{key:e.defaultKey,asc:e.defaultAsc??!0}:null),r=o.useRef(t),s=o.useRef(e?.onSortChange);s.current=e?.onSortChange;const l=o.useCallback(c=>{const d=r.current,h=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=h,a(h),s.current?.(h)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>l(d)}),[t,l]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:h,asc:p}=t;return[...c].sort((m,g)=>fr(d(m,h),d(g,h),p))},[t]);return{sort:t,field:i,sortRows:u}}const Bn="\uC804\uCCB4";Object.fromEntries(Object.entries(cf).map(([e,{nucleus:t}])=>[e,t]));const $y={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"})},Ry={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"})},Py={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 Fy(e,t){if("place"in t)return $y[t.place](e);const a=Ry[t.vowel](e);return t.glide?`${a} \xB7 ${Py[t.glide](e)}`:a}const Iy=(e,{defaultValue:t})=>t,Vi=(e,t)=>({jamos:e,phonetic:t,tooltip:Fy(Iy,t)}),Mn=(e,t)=>t.map(a=>Vi([a],{place:e})),qt=(e,t,a)=>Vi([...e],a?{vowel:t,glide:a}:{vowel:t}),Ao={cho:[Mn("labial",["\u3142","\u3143","\u314D","\u3141"]),Mn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Mn("alveolar",["\u3145","\u3146"]),Mn("palatal",["\u3148","\u3149","\u314A"]),Mn("velar",["\u3131","\u3132","\u314B"]),Mn("glottal",["\u314E"])],jung:[[qt("\u3163","frontHigh"),qt("\u315F","frontHigh","w"),qt("\u3162","frontHigh","velar")],[qt("\u3161","backHighUnrounded")],[qt("\u315C","backHighRounded"),qt("\u3160","backHighRounded","j")],[qt("\u3154\u3150","frontMid"),qt("\u3156\u3152","frontMid","j"),qt("\u3159\u315A\u315E","frontMid","w")],[qt("\u3153","backMidUnrounded"),qt("\u3155","backMidUnrounded","j"),qt("\u315D","backMidUnrounded","w")],[qt("\u3157","backMidRounded"),qt("\u315B","backMidRounded","j")],[qt("\u314F","low"),qt("\u3151","low","j"),qt("\u3158","low","w")]],jong:[Mn("labial",["\u3142","\u3141"]),Mn("alveolar",["\u3137","\u3134","\u3139"]),Mn("velar",["\u3131","\u3147"])]},Oy=e=>e===zy?[]:Array.from(e),zy="__NO_CODA__",No=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:s})=>({v:a.join(""),phonetic:r,tooltip:s}))),qi={cho:No(Ao.cho),jung:No(Ao.jung),jong:No(Ao.jong)};qi.jung.flat().forEach(({v:e})=>{for(const t of Oy(e));}),new Set(qi.cho.flat().map(e=>e.v));function Wy(e,t=!0){const a=Fa(e);o.useEffect(()=>{if(t)return Zn(()=>{a.current?.()})},[t,a])}function Oa(){const[e,t]=o.useState(null),a=o.useCallback(l=>t(l.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),s=o.useCallback(l=>{const i=l.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:s}}function Hy(e){const[t,a]=o.useState(null),[r,s]=o.useState(null),l=o.useRef(null);o.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const i=o.useCallback((c,d)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(c),s(d)},e)},[e]),u=o.useCallback(()=>{l.current&&clearTimeout(l.current),a(null),s(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Ui(e="warning"){const[t,a]=o.useState(""),[r,s]=o.useState(e),[l,i]=o.useState(0),u=o.useCallback((p,m)=>{s(m),a(p),i(g=>g+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),h=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:l,showToast:u,showWarning:c,showNormal:d,clearToast:h}}function za(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Wa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[s,l]=o.useState(!1),[i,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),h=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{s&&h()},[s,h]),o.useEffect(()=>{if(!s)return;let g=d.current?.offsetHeight??0;g>0&&h();let y=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const E=d.current?.offsetHeight??0;if(E!==g){if(g=E,++y>4){C?.disconnect(),C=null;return}h()}}),C.observe(d.current));const f=E=>{const B=E.target;r&&B.closest?.(r)||c.current?.contains(B)||d.current?.contains(B)||l(!1)};document.addEventListener("mousedown",f),document.addEventListener("pointerdown",f);let _=null;const b=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},w=E=>{d.current?.contains(E.target)||(t==="reposition"?b():t==="close"&&l(!1))};t!=="ignore"&&window.addEventListener("scroll",w,!0);const v=()=>{a==="reposition"?b():a==="close"&&l(!1)};let A=null;const x=()=>{v(),A&&clearTimeout(A),A=setTimeout(()=>{A=null,a==="reposition"&&h()},250)};return a!=="ignore"&&(window.addEventListener("resize",v),window.addEventListener("orientationchange",x)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",f),document.removeEventListener("pointerdown",f),t!=="ignore"&&window.removeEventListener("scroll",w,!0),a!=="ignore"&&(window.removeEventListener("resize",v),window.removeEventListener("orientationchange",x)),A&&clearTimeout(A)}},[s,h,t,a,r]),o.useEffect(()=>{if(s)return Zn(()=>l(!1))},[s]);const p=o.useCallback(()=>l(g=>!g),[]),m=o.useCallback(()=>l(!1),[]);return{open:s,setOpen:l,toggle:p,close:m,style:i,triggerRef:c,menuRef:d}}function Vy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:s,playMs:l=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,h]=o.useState(0),[p,m]=o.useState("idle"),[g,y]=o.useState(null),[C,f]=o.useState([]),[_,b]=o.useState(null),[w,v]=o.useState(0),A=o.useRef(0),x=o.useCallback(L=>{A.current=typeof L=="function"?L(A.current):L,v(A.current)},[]),E=o.useRef(r),B=o.useRef(s);o.useEffect(()=>{E.current=r,B.current=s},[r,s]);const D=o.useRef([]),N=()=>{D.current.forEach(clearTimeout),D.current=[]},k=(L,W)=>{D.current.push(setTimeout(W,L))};o.useEffect(()=>()=>N(),[]);const P=u[d]?.id??null,$=o.useRef(null),G=o.useCallback(()=>{N(),m("playing"),f([]),b(null),x(0);let L=0;e.forEach((W,Y)=>{k(L,()=>{h(Y),y(W.id),E.current?.(W)}),k(L+1e3,()=>{y(null),f(U=>[...U,W.id])}),L+=1300}),k(L,()=>{m("done"),B.current?.({score:0,total:e.length})})},[e,x]),T=o.useCallback((L,W)=>{if(W>=L.length){m("done"),B.current?.({score:A.current,total:L.length});return}$.current=null,h(W),b(null),m("playing"),y(L[W].id),E.current?.(L[W]),k(l,()=>{y(null),m("waiting")})},[l]),F=o.useCallback(()=>{N();const L=$a(e);c(L),x(0),f([]),T(L,0)},[e,T,x]),M=o.useCallback(()=>{t==="playback"?(c(e),G()):F()},[t,e,G,F]),Q=o.useCallback(()=>{N(),m("idle"),y(null),f([]),b(null),h(0),x(0),c([])},[x]),Z=JSON.stringify(e.map(L=>[L.id,L.label,L.angleDeg,L.deg,L.row,L.shortcut]));o.useEffect(()=>(a?M():Q(),()=>N()),[t,Z,a]);const I=o.useCallback(L=>{p!=="waiting"||t==="playback"||$.current===d||($.current=d,b(L),L===u[d]?.id&&x(W=>W+1),t==="exam"?(m("playing"),k(400,()=>T(u,d+1))):(m("feedback"),k(i,()=>T(u,d+1))))},[p,t,u,d,T,i,x]),K=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:g,playedIds:C,selectedId:_,answerId:P,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:I},index:d,total:K,score:w,phase:p,done:p==="done",start:M,reset:Q}}const Eo=new Map,Do=new Map,qy=()=>()=>{},Uy=()=>!0,Gy=()=>!1;function Gi(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 a=Uint8Array.from(atob(t[2]),r=>r.charCodeAt(0));return new TextDecoder("utf-8").decode(a)}catch{return null}}function Ky(e){if(typeof window>"u")return"";const t=(a,r)=>{const s=r.attrName.toLowerCase(),l=r.attrValue.trim();(s==="href"||s==="xlink:href")&&!l.startsWith("#")&&(r.keepAttr=!1),(s==="style"||l.includes("\\")&&l.includes("("))&&(r.keepAttr=!1);const i=l.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};ia.addHook("uponSanitizeAttribute",t);try{return ia.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{ia.removeHook("uponSanitizeAttribute",t)}}function Yy(e,t){const a=new Set;for(const i of e.matchAll(/url\(\s*(['"]?)#([^)\s"']+)\1\s*\)/g))a.add(i[2]);for(const i of e.matchAll(/(?:xlink:)?href="#([^"]+)"/g))a.add(i[1]);const r=new Set([...e.matchAll(/id="([^"]*)"/g)].map(i=>i[1])),s=[...a].filter(i=>r.has(i));if(s.length===0)return e;let l=e;for(const i of s){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;l=l.replace(new RegExp(`id="${u}"`,"g"),`id="${c}"`).replace(new RegExp(`url\\(\\s*(['"]?)#${u}\\1\\s*\\)`,"g"),(d,h)=>`url(${h}#${c}${h})`).replace(new RegExp(`((?:xlink:)?href)="#${u}"`,"g"),`$1="#${c}"`)}return l}function Zy(e){const t=Do.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&Eo.set(e,r),r)).catch(()=>null).finally(()=>{Do.delete(e)});return Do.set(e,a),a}function Xy(e,t=!0){const a=o.useSyncExternalStore(qy,Uy,Gy)&&t&&e?Gi(e)??Eo.get(e)??null:null,[r,s]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){s({src:e,enabled:t,svg:null});return}const l=Gi(e)??Eo.get(e)??null;if(l!==null){s({src:e,enabled:t,svg:l});return}let i=!0;return Zy(e).then(u=>{i&&s({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Jy({title:e,description:t,actionLabel:a,onAction:r,bg:s,color:l,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:h=""}){const p=s??l??"main",m=o.useRef(null),[g,y]=o.useState("main"),C=yn("(max-width: 767px)"),f=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const w=m.current;if(!w)return;const v=wo(w),A=(x,E,B)=>{if(B!==void 0)w.style.setProperty(E,B),f.current[x]=!0;else if(f.current[x]){const D=v?.[x];D?w.style.setProperty(E,D):w.style.removeProperty(E),f.current[x]=!1}};A("title","--promo-banner-bg-title",c),A("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const w=m.current;if(!w)return;const v=wo(w);y(v?.actionVariant??"main")},[p]);const _=Ae("promo-banner",`promo-banner--${i}`,h),b=Fi[p];return n.jsxs("div",{ref:m,className:_,role:"note",children:[n.jsx(b,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${i==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(be,{htmlType:"button",size:40,variant:u??g,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Qy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":s}){const{t:l}=xe.useTranslation(),i=s??l("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,h]=o.useState(0),[p,m]=o.useState(!1),[g,y]=o.useState(!1),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),w=o.useRef(null),v=yo(),A=p||g||C,x=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||A||v)return;const B=window.setInterval(()=>h(D=>(Math.min(D,c-1)+1)%c),t);return()=>window.clearInterval(B)},[c,t,A,v]);const E=B=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>{b.current=null,f(!1)},B)};return o.useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current)},[]),o.useEffect(()=>{if(!C)return;const B=D=>{D.pointerType==="touch"&&(w.current&&w.current.contains(D.target)||(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!1)))};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[C]),c===0?null:n.jsxs("section",{ref:w,className:Ae("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:B=>{_.current=B.pointerType},onPointerDown:B=>{_.current=B.pointerType,B.pointerType==="touch"&&(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!0))},onPointerUp:B=>{B.pointerType==="touch"&&E(5e3)},onPointerCancel:B=>{B.pointerType==="touch"&&E(5e3)},onMouseEnter:()=>{_.current!=="touch"&&m(!0)},onMouseLeave:()=>m(!1),onFocus:B=>{let D=!0;try{D=B.target.matches(":focus-visible")}catch{D=!0}y(D)},onBlur:B=>{B.currentTarget.contains(B.relatedTarget)||y(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${x*100}%)`},children:u.map((B,D)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":D!==x,...D!==x?{inert:!0}:{},children:B},D))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[x]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((B,D)=>n.jsx("button",{type:"button",className:`top-banner__dot${D===x?" top-banner__dot--active":""}`,"aria-label":l("topBanner.dotAriaLabel",{count:c,index:D+1,defaultValue:`${c}\uAC1C \uC911 ${D+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":D===x,onClick:()=>h(D)},D))})]})}function e2({title:e,body:t,open:a=!1,onToggle:r,avatar:s,titleClassName:l="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const h=d.currentTarget.closest('[role="list"]');if(!h)return;const p=Array.from(h.querySelectorAll("[data-accordion-header]")),m=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[m+1]:p[m-1])?.focus()}},children:[s&&n.jsx("div",{className:"accordion-item__avatar",children:s}),n.jsx("div",{className:`accordion-item__title ${l}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(at,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${i}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function t2({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:s}){const[l,i]=o.useState({index:t}),u=(c,d)=>l.id!=null&&c.id!=null?c.id===l.id:l.id==null&&d===l.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(e2,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>i(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:s},c.id??d))})}function n2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function a2(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function r2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function En({children:e,icon:t,number:a,position:r="top-left",size:s=24,animate:l=!1,onClick:i,"aria-label":u,"aria-hidden":c,className:d=""}){const{t:h}=xe.useTranslation(),p=t??"check",m=a!==void 0,g=e!==void 0||m?"number":p,y=e!==void 0?void 0:m?h("badge.nthSelected",{n:a,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:h("badge.selected","\uC120\uD0DD\uB428"),remove:h("badge.remove","\uC81C\uAC70"),minus:h("badge.exclude","\uC81C\uC678")}[p],C=c?void 0:u??y;return n.jsxs("span",{className:Ae("circle-badge",`circle-badge--${g}`,`circle-badge--${s}`,`circle-badge--${r}`,l?"circle-badge--animate":"",i?"circle-badge--clickable":"",d),onClick:i,onKeyDown:i?f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),f.currentTarget.click())}:void 0,"aria-label":C,"aria-hidden":c||void 0,role:i?"button":C?"img":void 0,tabIndex:i?0:void 0,children:[e??(m?a:null),e===void 0&&!m&&p==="check"&&n.jsx(n2,{}),e===void 0&&!m&&p==="remove"&&n.jsx(a2,{}),e===void 0&&!m&&p==="minus"&&n.jsx(r2,{})]})}function Ha({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:s}=xe.useTranslation(),l=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const f=[{title:null,columns:e}];let _=e;for(const b of i){const w=_?.[b.ci]?.items?.[b.ii];if(!w||!Array.isArray(w.children)||!w.children.length)break;_=[{title:null,items:w.children}],f.push({title:w.label||null,columns:_})}return f},[e,i]),d=c[c.length-1],h=c.length-1,p=o.useCallback(()=>u(f=>f.slice(0,Math.max(0,Math.min(f.length,h)-1))),[h]),m=o.useRef(null),g=o.useRef(null),y=c.length;o.useEffect(()=>{g.current||(g.current=document.activeElement);let f=0,_=0;const b=()=>{const w=m.current?.querySelector("button:not([disabled])");if(w&&w.offsetParent){w.focus({preventScroll:!0});return}_++<20&&(f=requestAnimationFrame(b))};return f=requestAnimationFrame(b),()=>cancelAnimationFrame(f)},[y]),o.useEffect(()=>()=>{g.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((f,_,b)=>{if(f){if(Array.isArray(f.children)&&f.children.length){u(w=>[...w.slice(0,h),{ci:_,ii:b}]);return}try{typeof f.onClick=="function"&&f.onClick()}catch{}try{f&&f.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,h]);return n.jsxs("div",{className:se(`menu-tooltip menu-tooltip--${r} ${a}`),children:[(c.length>1||d.title)&&n.jsxs("div",{className:se("menu-tooltip__header"),children:[c.length>1?n.jsx(be,{htmlType:"button",size:l,type:"dot",icon:"chevron-left",ariaLabel:s("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:se("menu-tooltip__title button-1"),children:d.title})]}),n.jsx("div",{className:se("menu-tooltip__columns"),ref:m,children:d.columns&&d.columns.map((f,_)=>{const b=(f.items||[]).some(w=>!!w.icon||w.selected!==void 0);return n.jsxs("div",{className:se("menu-tooltip__column"),children:[f.title?n.jsx("div",{className:se("menu-tooltip__column-title body-3"),children:f.title}):null,n.jsx("div",{className:se("menu-tooltip__items"),children:(f.items||[]).map((w,v)=>n.jsxs(o.Fragment,{children:[w.separatorBefore&&v>0&&n.jsx("div",{className:se("menu-tooltip__separator"),role:"separator"}),n.jsx(be,{htmlType:"button",className:se("menu-tooltip__item"),size:l,type:w.label?"bar":"dot",icon:w.selected?"check":w.icon||(b||!w.label?"none":void 0),rightIcon:Array.isArray(w.children)&&w.children.length?"chevron-right":w.badgeCount?n.jsx(En,{position:"inline",number:Math.min(w.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:w.label,ariaLabel:w.label&&w.badgeCount&&w.badgeCount>0?s("nav.badgeLabel",{label:w.label,count:w.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):w.label,onClick:()=>C(w,_,v),selected:w.selected,disabled:w.disabled,showTooltipInfo:w.tooltip||!1,useBorder:!1,align:"left"})]},v))})]},_)})})]})}const Ki=".content-area";function So(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Ki);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&Bt("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Ki}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const jo=52,br=10,Yi=e=>e&&e>0?e:0;function Zi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:s,moreItems:l=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",h=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[m,g]=o.useState(0),y=e.length;o.useEffect(()=>{const L=p.current;if(!L)return;const W=()=>{const j=typeof getComputedStyle=="function"?getComputedStyle(L):null,R=L.clientWidth-(parseFloat(j?.paddingLeft??"")||0)-(parseFloat(j?.paddingRight??"")||0),z=L.querySelector(".bottom-nav__left"),O=z?.nextElementSibling,ue=(z?.offsetWidth??0)+(z&&O?.classList.contains("bottom-nav__divider")?O.offsetWidth:0);g(Math.max(0,R-ue))};if(W(),typeof ResizeObserver>"u")return;const Y=new ResizeObserver(W);Y.observe(L);const U=L.querySelector(".bottom-nav__left");return U&&Y.observe(U),()=>Y.disconnect()},[s]);const C=jo+1,f=L=>Math.max(0,Math.floor((L+br)/(jo+br))),_=y*(jo+br)-br<=m,b=m<=0||l.length===0&&_?y:Math.min(y,f(m-C)),w=m>0&&b<y,v=w?b:y,A=e.slice(0,v),x=e.slice(v),E=w||l.length>0,B=o.useCallback((L,W)=>({position:"fixed",bottom:window.innerHeight-L.top+8,right:window.innerWidth-L.right,zIndex:za(W)}),[]),D=o.useId(),{open:N,toggle:k,close:P,style:$,triggerRef:G,menuRef:T}=Wa({computeStyle:B,onScroll:"ignore",onResize:"reposition"}),F=o.useCallback((L,W)=>W>0?u("nav.badgeLabel",{label:L,count:W,defaultValue:"{{label}}, {{count}}\uAC1C"}):L,[u]),M=o.useCallback((L,W)=>W>0?u("nav.badgeInsideLabel",{label:L,count:W,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):L,[u]),Q=o.useCallback(()=>s?.(c),[s,c]),Z=o.useMemo(()=>x.find(L=>!!L.key&&L.key===t)??l.find(L=>L.selected||L.key&&L.key===t),[x,t,l]),I=o.useMemo(()=>[{items:[...x.map(L=>({label:L.label,icon:L.icon,badgeCount:L.badgeCount,selected:!!L.key&&L.key===t,closeOnSelect:!0,disabled:L.state==="disabled",onClick:()=>{L.state!=="disabled"&&(L.key&&a&&(a(L.key),So(i,"BottomNav")),P())}})),...l.map(L=>({label:L.label,icon:L.icon,badgeCount:L.badgeCount,selected:L.selected??(!!L.key&&L.key===t),closeOnSelect:!0,onClick:()=>{L.onClick?.(),P()}}))]}],[x,l,t,a,P]),K=[...x,...l].reduce((L,W)=>L+Yi(W.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:h,className:"bottom-nav-item",onClick:Q})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:A.map((L,W)=>{const Y=Yi(L.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:L.icon,ariaLabel:F(L.label,Y),selected:!!L.key&&L.key===t,disabled:L.state==="disabled",className:"bottom-nav-item",onClick:()=>{L.key&&(a?.(L.key),So(i,"BottomNav"))}}),Y>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(En,{position:"top-right",number:Math.min(Y,99),size:24})})]},L.key??`__slot-${W}`)})}),E&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:G,className:"bottom-nav__slot",children:[n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:Z?.icon??"ellipsis",ariaLabel:M(Z?.label??u("nav.more","\uB354\uBCF4\uAE30"),K),selected:!!Z,className:"bottom-nav-item",onClick:k,"aria-expanded":N,"aria-controls":N?D:void 0}),K>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(En,{position:"top-right",number:Math.min(K,99),size:24})}),N&&pn.createPortal(n.jsx("div",{id:D,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:se("tooltip__content"),style:$,ref:T,children:n.jsx(Ha,{columns:I,onClose:P})}),document.body)]})})]})]})}function Xi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const s=r.charCodeAt(0);s<=32||s>=127&&s<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ji(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function o2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:s,onNotification:l,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},h="default";return s||l||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[s&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:s,selected:a==="debug"}),l&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"bell",ariaLabel:Ji(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:l,selected:a==="notifications"}),!!r&&r>0&&n.jsx(En,{number:Math.min(r,99),size:24,"aria-hidden":!0})]}),i&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:i,selected:a==="settings"}),u&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function Qi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:s,icon:l,active:i,onClick:u,style:c,state:d,labelStyle:h}=e||{},p=a?.key??r??"",m=a?.label??s??"",g=a?.icon??l??"",y=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(at,{icon:g,label:typeof m=="string"?m:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),f=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${f?"disabled":""} ${a?.child?"side-nav__item--child":""}`,b=o.useCallback(w=>{if(f)return;const v=w.detail>0;if(v)try{w.currentTarget.blur()}catch{}u?.(p,w.currentTarget,v)},[f,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:b,"aria-label":typeof m=="string"?Ji(t,m,y):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":f,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:h,children:m}),y>0&&n.jsx(En,{position:"inline",number:Math.min(y,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function eu(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:s,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g,scrollContainer:y}=e||{},C=m==="manager",f=o.useCallback(()=>g?.(C?"malgwi":"manager"),[g,C]),_=o.useRef(null),[b,w]=o.useState(null);o.useEffect(()=>{const B=_.current;if(!B)return;let D=null;const N=()=>{const{scrollHeight:$,clientHeight:G,scrollTop:T}=B;if($<=G+1){w(I=>I===null?I:null);return}const F=Math.max(24,G/$*G),M=G-F,Q=$-G,Z={top:Math.round(T/Q*M),height:Math.round(F)};w(I=>I&&I.top===Z.top&&I.height===Z.height?I:Z)},k=()=>{if(typeof requestAnimationFrame>"u"){N();return}D===null&&(D=requestAnimationFrame(()=>{D=null,N()}))};N(),B.addEventListener("scroll",k,{passive:!0});const P=typeof ResizeObserver<"u"?new ResizeObserver(k):null;P?.observe(B);for(const $ of Array.from(B.children))P?.observe($);return()=>{D!==null&&cancelAnimationFrame(D),B.removeEventListener("scroll",k),P?.disconnect()}},[a]);const v=o.useRef(null),A=o.useCallback(B=>{const D=_.current;D&&(B.preventDefault(),v.current={y:B.clientY,top:D.scrollTop},B.currentTarget.setPointerCapture(B.pointerId))},[]),x=o.useCallback(B=>{const D=_.current,N=v.current;!D||!N||(D.scrollTop=N.top+(B.clientY-N.y)*(D.scrollHeight/D.clientHeight))},[]),E=o.useCallback(B=>{v.current=null,B.currentTarget.hasPointerCapture(B.pointerId)&&B.currentTarget.releasePointerCapture(B.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[b&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:b.top,height:b.height},onPointerDown:A,onPointerMove:x,onPointerUp:E,onPointerCancel:E})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(B=>!B.section&&(B.key||B.label)).map((B,D)=>n.jsxs(o.Fragment,{children:[B.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Qi,{item:B,active:!!B.key&&B.key===r,state:B.disabled?"disabled":void 0,onClick:(N,k,P)=>{if(B.disabled)return;if(B.href){if(Xi(B.href)&&window.open(B.href,"_blank","noopener,noreferrer"),P)try{k?.blur()}catch{}return}if(s?.(B.key),So(y,"SideNav"),!P)return;try{k?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const $=document.querySelector(".header");if($){const G=typeof $.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&G&&$.matches(":hover"))){$.classList.add("header--force-collapsed");const T=()=>{$.classList.remove("header--force-collapsed"),$.removeEventListener("mouseenter",T)};$.addEventListener("mouseenter",T)}}}})]},B.key??`side-nav__item-${D}`)),g&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),g&&n.jsx(Qi,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:f})]}),n.jsx(o2,{activeKey:r,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p})]})}var gr='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',To='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',s2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';function tu({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?To:gr,s=s2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:s,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function nu({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:s,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g,scrollContainer:y}){const{t:C}=xe.useTranslation(),f=yn("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter($=>!$.section&&($.key||$.label)).map($=>({key:$.key,label:typeof $.label=="string"?$.label:void 0,icon:$.icon,state:$.disabled?"disabled":void 0,badgeCount:$.badge})),[a]),b=o.useCallback($=>{const G=a?.find(T=>T.key===$);if(!G?.disabled){if(G?.href){Xi(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.($)}},[a,t]),w=o.useMemo(()=>{const $=[];return i&&$.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&$.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:l,onClick:u}),d&&$.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),h&&$.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:h}),p&&$.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&$.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),$},[C,i,u,d,h,p,c,l]),v=o.useCallback(($,G)=>({position:"fixed",top:$.bottom+8,right:Math.max(8,window.innerWidth-$.right),zIndex:za(G)}),[]),A=o.useId(),{open:x,toggle:E,close:B,style:D,triggerRef:N,menuRef:k}=Wa({computeStyle:v,onScroll:"ignore",onResize:"reposition"}),P=o.useMemo(()=>[{items:w.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===e),closeOnSelect:!0,onClick:()=>{$.onClick?.(),B()}}))}],[w,e,B]);return n.jsxs("aside",{className:`header${m==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(tu,{appMode:m}),n.jsxs("div",{className:"header__menu-button",ref:N,children:[n.jsx(be,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&l&&l>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:l,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:E,"aria-expanded":x,"aria-controls":x?A:void 0}),!!u&&!!l&&l>0&&n.jsx(En,{number:Math.min(l,99),size:24,"aria-hidden":!0}),x&&pn.createPortal(n.jsx("div",{id:A,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:se("tooltip__content"),style:D,ref:k,children:n.jsx(Ha,{columns:P,onClose:B})}),document.body)]})]}),n.jsx(eu,{scrollContainer:y,items:a,activeKey:e??void 0,onChange:t,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g}),f&&n.jsx(Zi,{items:_,activeKey:e??void 0,onChange:b,scrollContainer:y,appMode:m,onAppModeChange:g})]})}const l2=nu;function on(e){const{type:t="dot",size:a,className:r="","aria-label":s,"aria-hidden":l,role:i}=e;(e.icon!==void 0||e.number!==void 0||e.position!==void 0||e.animate!==void 0||e.onClick!==void 0)&&Bt("badge-circle-props","[ihab/core] Badge \uAC00 \uC6D0\uD615 \uBC43\uC9C0\uC758 \uD504\uB86D(icon \xB7 number \xB7 position \xB7 animate \xB7 onClick)\uC744 \uBC1B\uC558\uC2B5\uB2C8\uB2E4. \uC6D0\uD615\uC740 \uC774\uC81C CircleBadge \uAC00 \uADF8\uB9BD\uB2C8\uB2E4 \u2014 Badge \uC758 dot \uB294 \uC791\uC740 \uC54C\uC57D \uC774\uB984\uD45C\uC785\uB2C8\uB2E4. \uADF8 \uC790\uB9AC\uB97C <CircleBadge \u2026/> \uB85C \uBC14\uAFB8\uC138\uC694."),i&&l&&Bt("badge-role-with-hidden",`[ihab/core] Badge \uAC00 role="${i}" \uACFC aria-hidden \uC744 \uD568\uAED8 \uBC1B\uC558\uC2B5\uB2C8\uB2E4. \uC228\uAE34 \uAC83\uC740 \uB0AD\uB3C5\uAE30\uC5D0 \uB07C\uC5B4\uB4E4 \uC218 \uC5C6\uC5B4 \uC544\uBB34\uAC83\uB3C4 \uC548 \uC77D\uD799\uB2C8\uB2E4 \u2014 \uB458 \uC911 \uD558\uB098\uB9CC \uC8FC\uC138\uC694.`);const{label:u,children:c,variant:d="default",fill:h="filled",minWidth:p,iconLeft:m,iconRight:g,color:y}=e,C=t==="bar",f=typeof a=="number"?"medium":a??"medium",_=(C?{small:"caption-2",medium:"body-3",large:"body-2"}:{small:"caption-2b",medium:"body-3b",large:"body-2b"})[f]??(C?"body-2":"body-2b"),b={small:12,medium:14,large:16}[f]??14,w=Ae("badge",C?"badge--bar":"",`badge--${d}`,`badge--${f}`,h!=="filled"?`badge--${h}`:"",_,r),v=y?.startsWith("--")?`var(${y})`:y,A=p!==void 0||v?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...v?{"--badge-color":v}:{}}:void 0;return n.jsxs("span",{className:w,style:A,"aria-label":l?void 0:s,role:i??(s&&!l?"img":void 0),"aria-hidden":l||void 0,children:[m&&n.jsx(at,{icon:m,size:b,className:"badge__icon"}),u??c,g&&n.jsx(at,{icon:g,size:b,className:"badge__icon"})]})}const i2=()=>Vt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function au(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return da(`${t.toLocaleString("ko-KR")}\uC6D0`)}return da(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function u2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function c2(e){if(e.durationDays&&e.durationDays>0){const l=e.durationDays;return l%365===0?`${l/365}\uB144`:`${l}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const s=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return s?s[2].toLowerCase()==="year"?`${s[1]}\uB144`:`${s[1]}\uC77C`:a||i2()}function d2(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function ru(e){return{type:e.type??u2(e),plan:c2(e),label:e.label,price:au(e.price),originalPrice:au(e.originalPrice),discountLabel:e.discountLabel}}var p2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',h2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',ou='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Qn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},Mo=new WeakMap;function m2(e){if(e)return Mo.get(e)}function Ln(e,t){e&&(e.style.setProperty(Qn.text,t.text),e.style.setProperty(Qn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Qn.copyright,t.copyrightColor),Mo.set(e,t))}function $n(e){e&&(e.style.removeProperty(Qn.text),e.style.removeProperty(Qn.sub),e.style.removeProperty(Qn.copyright),Mo.delete(e))}const su={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function lu(e={}){const t=Mt(su,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${ou}")`}})]})}const iu="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",fa=240;var Va='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/></svg>';const C2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},f2=100,b2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function uu(e={}){const t=Mt(C2,Ln,$n),a="var(--color-main)",r=270,s=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:b2.map(({scale:l,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${s}) scale(${l*f2/fa}) translate(${-fa/2} ${-fa/2})`,opacity:i,children:n.jsx("path",{d:iu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const g2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},y2=100,v2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function _2(e={}){const t=Mt(g2,Ln,$n),a="#ffffff",r=270,s=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:v2.map(({scale:l,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${s}) scale(${l*y2/fa}) translate(${-fa/2} ${-fa/2})`,opacity:i,children:n.jsx("path",{d:iu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${ou}")`}})]})}const x2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function w2(e={}){const t=Mt(x2,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const B2={Logo_SpeechEar_ko:{"":gr,_mono:p2},Logo_SpeechEarManager_ko:{"":To,_mono:h2}};function k2(e,t){if(e)return B2[e]?.[t??""]??void 0}const A2={speechear:gr,manager:To},N2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},cu=10;function E2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function du(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const s=Math.floor(e/60);return s>0?t("passCard.remainingMinute",{n:s}):t("passCard.remainingSecond",{n:Math.floor(e)})}function D2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),s=a==="\uC624\uD508\uD2B9\uAC00"||a===Vt.t("passCard.specialLabel");return r?n.jsx(w2,{}):s?n.jsx(_2,{}):n.jsx(uu,{})}return n.jsx(lu,{})}function pu({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:s,endDate:l,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:h=!1,textColor:p,subColor:m,copyrightColor:g,logoSrc:y,label:C,price:f,originalPrice:_,discountLabel:b,onUse:w,onRefund:v,onDelete:A}){const{t:x}=xe.useTranslation(),E=t?ru(t):void 0,B=s??E?.type??"speechear",D=r??E?.plan??x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),N=C??E?.label,k=f??(a?E?.price:void 0),P=_??(a?E?.originalPrice:void 0),$=b??E?.discountLabel,G=o.useMemo(()=>{if(k)return null;const H=t?.durationDays??d2(t?.code);if(!H||H<=0)return i!=null?{percent:null,remainingLabel:du(i,x)}:null;const q=H*86400;let ie;if(i!=null)ie=i;else if((c==="active"||c==="expired")&&l){const he=new Date(l).getTime();if(Number.isNaN(he))return null;const je=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(l)),$e=/^(\d{4})-(\d{2})-(\d{2})/.exec(Pa()),De=Math.round(je&&$e?(Date.UTC(+je[1],+je[2]-1,+je[3])-Date.UTC(+$e[1],+$e[2]-1,+$e[3]))/864e5:(he-Date.now())/864e5);ie=Math.max(0,u?De+1:De)*86400}else c==="expired"?ie=0:ie=q;const Ne=E2(ie),_e=Math.max(0,Math.min(100,Math.floor(Math.min(Ne,q)/q*100)));return c==="pending"&&_e>=100?null:{percent:_e,remainingLabel:c==="expired"?x("passCard.expired","\uB9CC\uB8CC\uB428"):du(ie,x)}},[k,c,l,i,u,t?.durationDays,t?.code,x]),T=o.useRef(null),[F,M]=o.useState({}),[Q,Z]=o.useState(null),I=!!(w||v||A),K=o.useRef(!1),L=o.useRef(void 0),[W,Y]=o.useState(y);o.useLayoutEffect(()=>{Y(y)},[y]),o.useLayoutEffect(()=>{const H=T.current;H&&(p!==void 0&&H.style.setProperty("--pass-card-text",p),m!==void 0&&H.style.setProperty("--pass-card-sub",m),g!==void 0&&H.style.setProperty("--pass-card-copyright",g))},[p,m,g]),o.useLayoutEffect(()=>{const H=T.current;if(!H)return;const q=m2(H);if(!y){const ie=N2[B],Ne=c==="expired"?"_mono":q?.logoColor??"",_e=k2(ie,Ne);Y(_e)}},[d,y,B,c]);const U=H=>{const q=T.current;if(!q)return null;const{left:ie,top:Ne,width:_e,height:he}=q.getBoundingClientRect(),je=(H.clientX-ie)/_e-.5;return{rotateX:-((H.clientY-Ne)/he-.5)*cu,rotateY:je*cu}},j=(H,q)=>{const ie=q*-.7,Ne=H*.7+10,_e=20+(Math.abs(H)+Math.abs(q))*.4;return`${ie}px ${Ne}px ${_e}px rgba(0, 0, 0, 0.18)`},R=o.useCallback(H=>{if(Ca())return;K.current=!0,clearTimeout(L.current),L.current=setTimeout(()=>{K.current=!1},200);const q=U(H);q&&M({transform:`perspective(800px) rotateX(${q.rotateX}deg) rotateY(${q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:j(q.rotateX,q.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),z=o.useCallback(H=>{if(Ca())return;const q=U(H);if(!q)return;const ie=K.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";M({transform:`perspective(800px) rotateX(${q.rotateX}deg) rotateY(${q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:j(q.rotateX,q.rotateY),transition:ie})},[]),O=o.useCallback(()=>{clearTimeout(L.current),K.current=!1,M({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),ue=o.useCallback(()=>Z(null),[]),te=o.useMemo(()=>{const H=x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),q=D.replace("\uC774\uC6A9\uAD8C","").replace(H==="\uC774\uC6A9\uAD8C"?"":H,"").trim(),ie=q.match(/^(.*?)(일|년)$/);return ie?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:ie[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:ie[2]==="\uB144"?x("passCard.unitYear","\uB144"):x("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:q})},[D,x]),de=o.useMemo(()=>{const H=da(k);if(!H)return null;const q=H.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!q)return n.jsx("span",{className:"h1",children:H});const[,ie,Ne,_e]=q;return n.jsxs(n.Fragment,{children:[ie&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ie}),n.jsx("span",{className:"h1 pass-card__price-amount",children:Ne}),_e.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:_e.trim()})]})},[k]),ee=o.useCallback(()=>{I&&Z(H=>{if(H)return null;const q=T.current?.getBoundingClientRect();if(!q)return null;const ie=50;return{left:q.left,right:q.right,width:q.width,height:q.height,x:q.x,y:q.y+ie,top:q.top+ie,bottom:q.bottom+ie}})},[I]),V=o.useCallback(H=>{I&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),ee())},[I,ee]),ae=[{items:[...w?[{label:x("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{w(),Z(null)},closeOnSelect:!0}]:[],...v?[{label:x("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{v(),Z(null)},closeOnSelect:!0}]:[],...A?[{label:x("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{A(),Z(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:T,className:`pass-card pass-card--${c}${I?" pass-card--clickable":""}`,style:F,onMouseEnter:R,onMouseMove:z,onMouseLeave:O,onPointerUp:H=>{H.pointerType==="touch"&&O()},onPointerCancel:H=>{H.pointerType==="touch"&&O()},onClick:ee,onKeyDown:I?V:void 0,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":e,"aria-haspopup":I?"menu":void 0,"aria-expanded":I?!!Q:void 0,children:[d??D2(B,D,N),!h&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:W??A2[B],className:"pass-card__logo",alt:B==="manager"?x("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):x("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:te}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:N?x("passCard.labeledPlan",{label:N}):x("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),k?n.jsxs("div",{className:"pass-card__price-area",children:[$&&n.jsx("span",{className:"pass-card__discount body-3",children:$}),n.jsxs("div",{className:"pass-card__price",children:[P&&n.jsx("span",{className:"pass-card__price-original body-3",children:da(P)}),de]})]}):G?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:G.remainingLabel}),G.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:G.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Q&&n.jsx(wn,{anchorRect:Q,onClose:ue,ariaLabel:x("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:ae,onClose:ue,size:"small"})})]})}const S2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function j2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Mt(S2,Ln,$n);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const T2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function M2(e={}){const t=Mt(T2,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}function L2(e,t){if(e){if(t==="manager_pro")return n.jsx(M2,{});if(t==="manager_standard")return n.jsx(j2,{});if(t==="manager_lite")return n.jsx(uu,{})}}function $2(e){const t=da(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,s,l]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),s,l.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:l.trim()})]})}function R2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:s,onSelect:l,period:i="monthly",ownedCodes:u}=e||{},c=v=>!!v&&!!u?.includes(v),d=v=>v.onceOnly??/오픈\s*특가/.test(v.label??""),h=(s.tiers||[]).some(v=>d(v)&&c(v.code)),p=v=>{const A=v.prices?v.prices[i]:v.price;return A?(s.tiers||[]).some(x=>!!x.badge&&x.originals?.[i]===A):!1},m=s.colorToken?`var(--color-${s.colorToken})`:"var(--color-gray)",g=t("payment.plan.freePrice","\uBB34\uB8CC"),y=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=v=>v.prices?v.prices[i]:v.price,f=(s.tiers||[]).length>0&&(s.tiers||[]).every(v=>{const A=C(v);return A==="\uBB34\uB8CC"||A===g||A==="0\uC6D0"||typeof A=="string"&&/\d/.test(A)&&!/[1-9]/.test(A)}),_=(s.tiers||[]).length>0&&(s.tiers||[]).every(v=>{const A=C(v);return A==="\uBB38\uC758"||A===y}),b=s.group==="org",w=b?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:m,"--plan-color":m},children:[s.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(on,{label:s.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:m},children:s.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:s.tier??s.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:s.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(s.recommendedFor||[]).map((v,A)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},A))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(s.features||[]).map((v,A)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},A))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:f?null:_?n.jsx(be,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>s.tiers?.[0]&&l?.({...s.tiers[0],productId:s.id,productTitle:s.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(s.tiers||[]).map(v=>{const A=v.label||a,x=d(v),E=x||v.openPromo===!0,B=A.replace(/^오픈\s*특가\s*/,"")||a,D=v.prices?v.prices[i]:v.price,N=v.badge?E?`${r}
822
+ and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},Dg={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},Sg={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"},jg={clearAriaLabel:"Clear input"},Tg={ariaLabel:"Select tab"},Mg={ariaLabel:"Tabs"},Lg={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},$g={ariaLabel:"User avatar"},Rg={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Pg={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},Fg={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"}},Ig={steps:"Step {{current}} of {{total}}"},Og={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},zg={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Wg={viewWords:"Words"},Hg={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Vg={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},qg={previewRegion:"Report preview \u2014 scrollable sideways"},Ug={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Gg={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Kg={clearSelection:"Clear selection"},Yg={showResult:"Show {{type}} result"},Zg={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Xg={loading:"Loading"},Jg={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Qg={ariaLabel:"Breadcrumb"},ey={empty:"No items yet."},ty={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"},ny={common:tg,calendar:ng,passCard:ag,rating:rg,colorPicker:og,dropdown:sg,accordion:lg,header:ig,nav:ug,settings:cg,usage:dg,account:pg,training:hg,customers:mg,payment:Cg,coupons:fg,visits:bg,trainingType:gg,myWordTable:yg,keyWords:vg,wordTable:_g,wordSearch:xg,wordPrint:wg,topic:Bg,device:kg,manager:Ag,wordPairs:Ng,footer:Eg,date:Dg,wordData:Sg,textField:jg,segmentedControl:Tg,tabs:Mg,fileUpload:Lg,avatar:$g,myHomework:Rg,trainingStatus:Pg,store:Fg,progress:Ig,trainingMiss:Og,table:zg,wordScore:Wg,topBanner:Hg,datePicker:Vg,report:qg,tooltip:Ug,phonemeProfile:Gg,bulkBar:Kg,debug:Yg,badge:Zg,loader:Xg,soundCompass:Jg,breadcrumb:Qg,board:ey,promoBannerBg:ty};const ay="0.399.0",ry=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],mo="ko",oy="ihab_display_language";function Jl(){if(typeof window>"u")return mo;try{const e=localStorage.getItem(oy);if(e&&ry.some(t=>t.code===e))return e}catch{}return mo}function Ql(e){try{document.documentElement.lang=e}catch{}}Vt.on("languageChanged",Ql),Ql(Jl()),Vt.use(xe.initReactI18next).init({resources:{ko:{translation:eg},en:{translation:ny}},lng:Jl(),fallbackLng:mo,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const sy=new Map;try{Vt.store?.on?.("added",()=>sy.clear())}catch{}let pr=null,ei=null,ti=null;function ly(){const e=zl();if(e&&e.entries.length>0){const t=yf();if(pr&&ei===e&&ti===t)return pr;const a=new Set,r=[];for(const s of e.entries)!s.word||a.has(s.word)||(a.add(s.word),r.push({w:s.word,s:s.syllables,p:t?.[s.word]?[...t[s.word].cho??[],...t[s.word].jung??[],...t[s.word].jong??[]]:[],pron:s.pronunciation||s.word,grade:s.grade}));return pr=r,ei=e,ti=t,pr}return[]}new Proxy([],{get(e,t){const a=ly(),r=a[t];return typeof r=="function"?r.bind(a):r}});function iy(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function uy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&iy(r.attrValue)&&(r.keepAttr=!1)};ia.addHook("uponSanitizeAttribute",t);try{return ia.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{ia.removeHook("uponSanitizeAttribute",t)}}function cy(e){const[t,a]=o.useState(null),[r,s]=o.useState(null),[l,i]=o.useState(null),[u,c]=o.useState(null),[d,h]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),s(null),i(null),c(null);return}const p=e.split("/").pop();let m=e;p&&(e.startsWith("/")?m=eo(e):/^(Logo|Symbol)/i.test(p)?m=eo(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),m=e)),i(null),c(null),a(e),s(m)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function m(){try{let g=await fetch(r);g.ok||(g=await fetch(r));const y=g.headers.get("content-type")||"";if(p)return;if(y.includes("svg")){i("mask");return}if(y.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const f=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(f)){const _=uy(f);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return m(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,m=null;return l==="mask"&&r&&fetch(r).then(g=>{if(!g.ok)throw new Error("fetch failed");return g.blob()}).then(g=>{p||(m=URL.createObjectURL(g),h(m))}).catch(()=>{p||i("img")}),()=>{p=!0,m&&URL.revokeObjectURL(m),h(null)}},[l,r]),t===e?{iconToUse:r,mode:l,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function at(e){const{icon:t,label:a,className:r,imgClassName:s,maskClassName:l,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",h=s??"iconRenderer-icon-image",p=l??"iconRenderer-icon-mask",m=i??"iconRenderer-icon-svg",g=typeof t=="string"?t:null,y=J0(g),{iconToUse:C,mode:f,svgText:_,blobUrl:b}=cy(g),w=(B,D={})=>n.jsx("span",{className:d,style:u,...D,children:B}),v=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,A=(B,D={})=>n.jsx("img",{src:B,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:h,...D,style:v?{...D.style,...v}:D.style});if(!t)return null;if(typeof t!="string")return w(t);if(t==="none")return w(n.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(y)try{return w(o.createElement(y,{className:m,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(f==="mask"){const B={"--icon-url":b?`url(${b})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return w(n.jsx("span",{className:p,style:B}),{"aria-hidden":"true"})}return f==="img"?w(A(C,{onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):f==="inline"?w(n.jsx("span",{className:m,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):w(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return A(eo(t),{style:u,onError:B=>{B.currentTarget.onerror=null,B.currentTarget.style.display="none"}});const x=typeof c=="number"?c:20,E=`<svg width="${x}" height="${x}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return w(n.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:E}}),{"aria-hidden":"true"})}function ni(e){const[t,a]=o.useState(!1),r=o.useRef(!1),s=o.useRef(!0);o.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]);const l=o.useCallback(()=>{if(!e||r.current)return;const i=e();if(i&&typeof i.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,s.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:l}}function dy({icon:e,title:t,message:a,action:r,className:s}){const{pending:l,press:i}=ni(r?.onClick);return n.jsxs("div",{className:Ae("empty-state",s),children:[e&&n.jsx(at,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:i,disabled:l,"aria-busy":l||void 0,children:[r.icon&&n.jsx(at,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function py({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:s,className:l}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=ni(r);return n.jsxs("div",{className:Ae("empty-state","error-state",l),role:"alert",children:[n.jsx(at,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??i("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(at,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:s??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function hy({icon:e,title:t,description:a,cta:r,tone:s="main",disabled:l=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,h=`${c}-desc`,p=`${c}-cta`,m=()=>{l||i?.()};return n.jsx("section",{role:"button",tabIndex:l?-1:0,"aria-disabled":l||void 0,"aria-labelledby":d,"aria-describedby":`${h} ${p}`,onClick:m,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),m())},className:Ae("action-card",`action-card--${s}`,l&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(at,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:h,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(at,{icon:"arrow-right",size:18})})]})]})})}function my({as:e="div",className:t="",children:a,storage:r,...s}){r&&I1({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const l=Ae("ihabdevteam-core-scope",t);return n.jsx(e,{className:l,...s,children:a})}function Cy(e){if(e.closest('[aria-hidden="true"], [hidden], [inert]'))return!1;for(let t=e;t;t=t.parentElement){const a=window.getComputedStyle(t);if(a.display==="none"||a.visibility==="hidden"||a.visibility==="collapse")return!1}return!0}function Co(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=s=>{if(s.key!=="Tab")return;const l=Array.from(a.querySelectorAll(Nn)).filter(Cy);if(!l.length){s.preventDefault();return}const i=l[0],u=l[l.length-1],c=document.activeElement,d=c===a;s.shiftKey&&(c===i||d)?(s.preventDefault(),u.focus()):!s.shiftKey&&c===u&&(s.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const Nn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',fo=new WeakMap;function bo(e,t){e&&fo.set(e,t)}function go(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!fo.has(r);)r=r.parentElement;if(!r)return t;t=fo.get(r)??null}return t}function ai(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function hr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(ai(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const s=Array.from(document.querySelectorAll(Nn)).filter(c=>!(e&&e.contains(c))&&ai(c));let l=null,i=null;for(const c of s)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?l=c:i||(i=c);const u=l??i;return u?.focus(),u}function fy({title:e="",lines:t=[],notices:a=null,children:r,variant:s="default",dismissible:l=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),h=o.useRef(null),p=o.useCallback(()=>{const C=h.current;C&&C.contains(document.activeElement)&&hr(C),d(!0)},[]);if(c)return null;const m=`notice-box notice-box--${s} body-2 ${i}`.trim(),g=l&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:m,role:"note",children:[a.map((C,f)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,b)=>n.jsx("span",{className:"notice-box__line body-3",children:_},b))}):C.children??null})]},f)),g]});const y=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,f)=>n.jsx("li",{className:"notice-box__line",children:C},f))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:h,className:m,role:"note",children:[y,g]})}const by={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function pa(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:s=null,label:l}=e||{},i=l||t("loader.loading","Loading");if(a==="bar"){const c=s==null||!Number.isFinite(Number(s)),d=c?0:Math.max(0,Math.min(100,Number(s)));return n.jsx("div",{className:`loader-bar${c?" loader-bar--indeterminate":""}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c?void 0:d,"aria-label":i,children:n.jsx("div",{className:"loader-bar__inner",style:c?void 0:{width:`${d}%`}})})}const u=typeof r=="number"?`${r}px`:r;return n.jsxs("div",{className:"loader-spinner",style:{width:u,height:u},role:"status","aria-label":i,children:[n.jsx("span",{style:by,children:i}),n.jsxs("svg",{className:"loader-spinner__svg",viewBox:"0 0 50 50",width:r,height:r,children:[n.jsx("circle",{className:"loader-spinner__bg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4"}),n.jsx("circle",{className:"loader-spinner__fg",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"4",strokeLinecap:"round"})]})]})}const ha=[];let mr=!1;function ri(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ha[ha.length-1];t&&(e.stopPropagation(),t())}function Zn(e){return ha.push(e),!mr&&typeof document<"u"&&(document.addEventListener("keydown",ri),mr=!0),()=>{const t=ha.lastIndexOf(e);t>=0&&ha.splice(t,1),ha.length===0&&mr&&typeof document<"u"&&(document.removeEventListener("keydown",ri),mr=!1)}}const oi=o.createContext(null);function gy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const si=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function yy(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return Rs.useSyncExternalStore(t,()=>si(e),()=>!1)}function vy(e){const[t,a]=o.useState(si(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),s=i=>a(i.matches),l=r;return l.addEventListener?l.addEventListener("change",s):l.addListener&&l.addListener(s),a(r.matches),()=>{l.removeEventListener?l.removeEventListener("change",s):l.removeListener&&l.removeListener(s)}},[e]),t}const _y=typeof Rs.useSyncExternalStore=="function"?yy:vy;function yn(e){const t=o.useContext(oi),a=_y(e);return t&&typeof t.mobile=="boolean"&&gy(e)?t.mobile:a}const xy="(prefers-reduced-motion: reduce)";function yo(){return yn(xy)}const li={"menu-tooltip":"tooltip-menu","description-tooltip":"tooltip-description","text-box-tooltip":"tooltip-textbox","training-tooltip":"tooltip-training","word-image-tooltip":"tooltip-word-image","info-tooltip":"tooltip-info","noise-settings-tooltip":"noise-settings",tooltip__header:"tooltip-content__header",tooltip__content:"tooltip-content",tooltip__backdrop:"tooltip-backdrop",tooltip__portal:"tooltip-portal","word-table__section":"word-table-block","word-table__content":"word-table-block__content","word-table__card":"word-table-block__card","word-table__card-handle":"word-table-block__card-handle","word-table__card-close":"word-table-block__card-close","word-table__card-actions":"word-table-block__card-actions","word-table__edit-cell":"word-table-block__edit-cell","word-table__pair-divider":"word-table-block__pair-divider","chart-section__legend-dot":"manager-bar-chart-legend-dot","chart-section__legend-item":"manager-bar-chart-legend-item","chart-section__legend":"manager-bar-chart-legend","chart-section__controls":"manager-section-controls","chart-section__sub-row":"barchart-sub-row","chart-section__total":"barchart-total","chart-section":"manager-section","bar-chart__stack-segment":"manager-bar-chart-stack-segment","bar-chart__detail-btn":"manager-bar-chart-detail-btn","bar-chart__gridline":"manager-bar-chart-gridline","bar-chart__loading":"manager-bar-chart-loading","bar-chart__scroll":"manager-bar-chart-scroll","bar-chart__stack":"manager-bar-chart-stack","bar-chart__x-axis":"manager-bar-chart-x-axis","bar-chart__inner":"manager-bar-chart-inner","bar-chart__area":"manager-bar-chart-area","bar-chart__plot":"manager-bar-chart-plot","bar-chart__wrap":"manager-bar-chart-wrap","bar-chart__slot":"manager-bar-chart-slot","bar-chart__col":"manager-bar-chart-col","bar-chart__bar":"manager-bar-chart-bar","stat-chart__card":"manager-stat-card"};function wy(e,t){const a=Object.keys(e).sort((r,s)=>s.length-r.length);for(const r of a){if(!t.startsWith(r))continue;const s=t.slice(r.length);if(!(s!==""&&!s.startsWith("__")&&!s.startsWith("--")))return e[r]+s}return null}function By(e){return wy(li,e)}function se(e){if(!e||Object.keys(li).length===0)return e;const t=[];for(const a of e.split(/\s+/)){if(!a)continue;const r=By(a);r&&t.push(r)}return t.length?`${e} ${t.join(" ")}`:e}function wn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:s=20,onClose:l,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:h,backdrop:p=!1,isMobilePopup:m=!1,useBorder:g=!0,header:y,focusOnOpen:C}=e||{},f=o.useRef(null),[_,b]=o.useState({position:"fixed",left:0,top:-9999}),[w,v]=o.useState(!1),[A,x]=o.useState("bottom"),[E,B]=o.useState(!1),[D,N]=o.useState(!1),k=!t&&!a,P=o.useRef(null),$=o.useCallback((L=!1,W=!1)=>{if(D&&m)return;const Y=a?a.getBoundingClientRect():t,U=W&&P.current?P.current:Y;if(!U||!f.current)return;const j=f.current,{offsetWidth:R,offsetHeight:z}=j,O=window.innerWidth,ue=window.innerHeight,te=O-U.right,de=U.left,ee=U.top,V=ue-U.bottom;let ae=0,H=0,q="top";if(ee>=z+r)q="top",H=U.top-r-z,ae=U.left+U.width/2-R/2;else if(V>=z+r)q="bottom",H=U.bottom+r,ae=U.left+U.width/2-R/2;else if(te>=R+r)q="right",ae=U.right+r,H=U.top+U.height/2-z/2;else if(de>=R+r)q="left",ae=U.left-r-R,H=U.top+U.height/2-z/2;else{const he=Math.max(ee,V,te,de);he===ee?(q="top",H=U.top-r-z,ae=U.left+U.width/2-R/2):he===V?(q="bottom",H=U.bottom+r,ae=U.left+U.width/2-R/2):he===te?(q="right",ae=U.right+r,H=U.top+U.height/2-z/2):(q="left",ae=U.left-r-R,H=U.top+U.height/2-z/2)}const ie=Number.isFinite(Number(s))?Number(s):8;ae=Math.min(Math.max(ae,ie),O-R-ie),H=Math.min(Math.max(H,ie),ue-z-ie);const Ne=Math.round(ae),_e=Math.round(H);L&&f.current?(f.current.style.left=`${Ne}px`,f.current.style.top=`${_e}px`,f.current.dataset.placement=q):(x(q||A),b({position:"fixed",left:Ne,top:_e}),B(!0))},[D,m,a,t,r,s,A]);o.useEffect(()=>()=>{P.current=null},[a,t]),o.useLayoutEffect(()=>{if(k)return;if(D&&m){b({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),B(!0);return}P.current===null&&(P.current=a?a.getBoundingClientRect():t??null),$(!1,!0);const L=requestAnimationFrame(()=>$(!1,!0));return()=>cancelAnimationFrame(L)},[t,a,r,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m||!f.current||typeof ResizeObserver>"u")return;const L=new ResizeObserver(()=>{t&&$()});return L.observe(f.current),()=>L.disconnect()},[t,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m)return;let L=null;const W=()=>{if(a&&(P.current=a.getBoundingClientRect()),typeof requestAnimationFrame>"u"){$(!0);return}L===null&&(L=requestAnimationFrame(()=>{L=null,$(!0)}))},Y=U=>{if(!a&&l){const j=U.target;if(j&&f.current&&f.current.contains(j))return;try{if(j&&j.closest&&j.closest("[data-tooltip-ignore]"))return}catch{}Q.current(!0);return}W()};return window.addEventListener("resize",W),document.addEventListener("scroll",Y,{passive:!0,capture:!0}),()=>{L!==null&&cancelAnimationFrame(L),window.removeEventListener("resize",W),document.removeEventListener("scroll",Y,{capture:!0})}},[t,a,l,r,h,s,k,D,m,$]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const L=window.matchMedia("(max-width: 768px)"),W=()=>N(!!L.matches);W();try{L.addEventListener?L.addEventListener("change",W):L.addListener(W)}catch{try{L.addListener(W)}catch{}}return()=>{try{L.removeEventListener?L.removeEventListener("change",W):L.removeListener(W)}catch{}}},[]);const G=o.useRef(!1),T=o.useRef(null),F=yo(),M=o.useCallback((L=!1)=>{if(l&&!(w||G.current)){if(G.current=!0,L){v(!0);try{l&&l()}catch{G.current=!1,v(!1)}return}v(!0),T.current=setTimeout(()=>{T.current=null;try{l&&l()}catch{G.current=!1,v(!1)}},F?0:200)}},[w,l,v,F]);o.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]),o.useEffect(()=>{if(k)return;const L=U=>{const j=f.current;if(!j)return;const R=U.target;if(R&&!j.contains(R)){try{if(R.closest&&R.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},W=U=>{const j=f.current;if(!j)return;const R=U.target;if(R&&!j.contains(R)){try{if(R.closest&&R.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},Y=U=>{if(U.key==="Tab"){const j=f.current;if(!j)return;const R=j.querySelectorAll(Nn);if(!R||R.length===0)return;const z=R[0],O=R[R.length-1],ue=document.activeElement;U.shiftKey?ue===z&&(U.preventDefault(),O.focus()):ue===O&&(U.preventDefault(),z.focus())}};return document.addEventListener("pointerdown",L,!0),document.addEventListener("click",W,!0),document.addEventListener("keydown",Y),()=>{document.removeEventListener("pointerdown",L,!0),document.removeEventListener("click",W,!0),document.removeEventListener("keydown",Y)}},[l,i,M,k]);const Q=o.useRef(M);o.useEffect(()=>{Q.current=M});const Z=!!l;o.useEffect(()=>{if(!(k||!Z))return Zn(()=>Q.current())},[k,Z]),o.useEffect(()=>{const L=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",L),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",L)}},[M]);const I=o.useRef(null);o.useEffect(()=>{if(k||C===!1||!E)return;const L=f.current;if(!L)return;const W=L.querySelector(Nn);if(W)return I.current=document.activeElement,W.focus({preventScroll:!0}),()=>{const Y=I.current;I.current=null,Y&&document.contains(Y)&&Y.focus({preventScroll:!0})}},[k,C,E]),o.useEffect(()=>{c==="dialog"&&!d&&Bt("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const K=n.jsxs("div",{ref:f,className:se(`tooltip__content ${k?"tooltip__content--inline":""} ${g?"tooltip__content--bordered":""} ${w?"is-closing":""} ${u} ${D&&m?"is-mobile":""}`),role:c,"aria-label":d||void 0,style:k?{}:{..._,visibility:E?"visible":"hidden"},tabIndex:-1,"data-placement":A,"data-left":k?"":_.left,"data-top":k?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[y!=null&&n.jsx("div",{className:se("tooltip__header h5"),children:y}),h]});if(k||typeof document>"u")return K;if(p||D&&m){const L=n.jsxs("div",{className:se("tooltip__portal"),children:[n.jsx("div",{className:se("tooltip__backdrop"),onClick:()=>{i&&M(!0)}}),K]});return pn.createPortal(L,document.body)}return pn.createPortal(K,document.body)}function Tn(e){const{anchorRect:t,text:a,offset:r=8,onClose:s,className:l="",ariaLabel:i}=e||{};return a?n.jsx(wn,{anchorRect:t,offset:r,onClose:s,closeOnOutsideClick:!1,className:se(`info-tooltip ${l}`),ariaLabel:i||a,children:n.jsx("div",{className:se("info-tooltip__content body-3"),children:a})}):null}function Xn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:s,activeIndex:l=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},h=(Array.isArray(s)?s:s?[s]:[]).map(p=>typeof p=="string"?{text:p}:p);return!h.length&&!r?null:n.jsx(wn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:se("description-tooltip"),ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:se("description-tooltip__box"),children:[r&&n.jsx("span",{className:se("description-tooltip__title body-2"),children:r}),n.jsx("ol",{className:se("description-tooltip__items"),children:h.map((p,m)=>n.jsxs("li",{className:se(`description-tooltip__item body-3${m===l?" description-tooltip__item--active":""}`),children:[i&&h.length>1&&n.jsxs("span",{className:se("description-tooltip__index button-1"),children:[m+1,"."]}),p.color&&n.jsx("span",{className:se("description-tooltip__dot"),style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},m))})]})})}function Fa(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let vo=0,ii=!1;function ui(){ii||typeof document>"u"||(ii=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(vo=Date.now())},!0),document.addEventListener("touchstart",()=>{vo=Date.now()},{capture:!0,passive:!0}))}ui();function ma(e){return!!e&&e.pointerType==="touch"}function Ca(e=1e3){return ui(),Date.now()-vo<e}function _o(e,t,a,{enabled:r=!0,fallbackOnParent:s=!1}={}){const l=Fa(e),i=Fa(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const h=p=>{const m=p,g=p.target,y=a.current,C=!!(g&&y&&y.contains(g));if(m.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=l.current;return}u.current=null,l.current&&!(g&&g.closest?.(".tooltip__content"))&&i.current(!1,y)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[r,a,l,i]);const d=o.useCallback(h=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),i.current(!p,h??a.current),!0)},[a,i]);return o.useEffect(()=>{if(!r||!s)return;const h=a.current,p=h?.parentElement;if(!h||!p)return;let m=null;const g=f=>{const _=f.changedTouches?.[0];if(!_)return!1;const b=h.getBoundingClientRect();return _.clientX>=b.left&&_.clientX<=b.right&&_.clientY>=b.top&&_.clientY<=b.bottom},y=f=>{m=g(f)?l.current:null},C=f=>{const _=m;m=null,!(_===null||Date.now()-c.current<700||!g(f))&&(u.current=null,c.current=Date.now(),i.current(!_,h))};return p.addEventListener("touchstart",y,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",y),p.removeEventListener("touchend",C)}},[r,s,a,l,i]),{touchPress:d}}function ky(e,t){const{size:a=48,type:r,htmlType:s,href:l,target:i,rel:u,icon:c,rightIcon:d,label:h,count:p,subLabel:m,children:g,ariaLabel:y,variant:C="default",align:f="center",nowrap:_=!1,selected:b,toggleable:w=!1,ariaExpanded:v,ariaControls:A,disabled:x=!1,loading:E=!1,useLabel:B=!0,useBorder:D=!0,useBG:N=!0,useDisabledCovered:k=!1,useDisabledInvisible:P=!1,useDisabledFilled:$=!1,width:G,minWidth:T,onClick:F,onDisabledClick:M,showTooltipInfo:Q=!1,tooltipInfoText:Z=null,tooltipDescription:I=null,tooltipOnly:K=!1,iconSize:L="medium",iconColor:W,shape:Y="rounded",color:U,className:j,...R}=e,z=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),O=z.match(/^\d+$/)?`button${z}`:`button-${z}`,ue=Number(a),te=!isNaN(ue)&&ue<40?"button-2":"button-1",de=h??g,ee=x||!!R.disabled,V=ee?k?"disabled-covered":P?"disabled-invisibled":$?"disabled-filled":"disabled":C,ae=V?`button--variant-${V}`:"",H=f?`button--align-${f}`:"",q=_?"button--nowrap":"",ie=Y?`button--shape-${Y}`:"",Ne=typeof W=="string"&&W.startsWith("--")?`var(${W})`:W,_e={...G?{width:typeof G=="number"?`${G}px`:G}:{},...T?{minWidth:typeof T=="number"?`${T}px`:T}:{},...D?{}:{"--button-border":ee?"0":"1px solid transparent"},...Ne?{"--button-icon-color":Ne}:{},...U?{"--color-main":U}:{}},he=B===!1?"":de,je=Array.isArray(he)?he.length>0:!!he,$e=!!d,De=r??(je||c||$e?"bar":"dot"),le=`${O}--${De}`,we=o.useRef(null);o.useEffect(()=>{!On||s!==void 0||we.current?.closest("form")&&Bt(`button-in-form:${typeof de=="string"?de:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof de=="string"&&de?` \uB2E8\uCD94: ${de}`:""))},[s,de]);const Le=o.useRef(t);Le.current=t;const Be=o.useCallback(Me=>{we.current=Me;const lt=Le.current;typeof lt=="function"?lt(Me):lt&&(lt.current=Me)},[]),ze=o.useRef(ee),[Ve,ut]=o.useState(!!b),[et,Xe]=o.useState(!1),[yt,Te]=o.useState(null),Ke=o.useCallback(()=>Xe(!1),[]),[ke,qe]=o.useState(!1),Je=o.useId();o.useEffect(()=>{typeof b=="boolean"&&ut(b)},[b]),o.useEffect(()=>{if(ze.current&&!ee&&we.current){const Me=we.current;let lt=!1;try{lt=Me.matches(":focus:not(:focus-visible)")}catch{lt=!1}lt&&Me.blur(),Me.style.pointerEvents="none";const re=requestAnimationFrame(()=>{requestAnimationFrame(()=>{we.current&&(we.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(re)}ze.current=ee},[ee]);const tt=typeof b=="boolean"?!!b:Ve,xt=typeof v=="boolean"?void 0:w||typeof b=="boolean"?tt?"true":"false":R["aria-pressed"],wt=Ae("button",O,le,ae,H,q,ie,tt?"is-selected":null,N?null:"button--no-bg",K?"button--tooltip-only":null,j),Dt=`button__icon button__icon--${L}`,rt=Array.isArray(m)?m:m!==void 0?[m]:[],nt=()=>{if(Array.isArray(he))return he.map((lt,re)=>{const ve=rt[re];return n.jsxs("span",{className:`button__label-text${ve!==void 0?" button__label-text--has-sub":""}`,children:[lt,ve!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:ve})]},re)});const Me=m!==void 0;return n.jsxs("span",{className:`button__label-text${Me?" button__label-text--has-sub":""}`,children:[he,p!=null&&n.jsx("span",{className:"button__count",children:p}),Me&&n.jsx("span",{className:"button__sub-label-text caption-1",children:m})]})},kt=Me=>{typeof b!="boolean"&&!w&&ut(!1),Me.currentTarget.blur()},At=Me=>{ee||(typeof R.onMouseLeave=="function"&&R.onMouseLeave(Me),kt(Me))},Lt=Me=>{if(K&&ot&&ct.touchPress(Me.currentTarget),ee){ot&&ct.touchPress(Me.currentTarget),Me.preventDefault(),M?.(Me);return}typeof b!="boolean"&&w&&ut(lt=>!lt),F?.(Me)},jt=o.useCallback(()=>{(Q||I)&&(Xe(!0),Te(we.current?.getBoundingClientRect()??null))},[Q,I]),vt=o.useCallback(()=>{(Q||I)&&(Xe(!1),Te(null))},[Q,I]),ot=!!(Q||I),ct=_o(et,Me=>{Me?jt():vt()},we,{enabled:ot&&(ee||K),fallbackOnParent:ot&&ee}),dt={...R};delete dt.disabled,delete dt.className,delete dt.faded,delete dt.useFaded,delete dt.loading,delete dt.onMouseLeave,delete dt.onPointerEnter,delete dt.onPointerLeave,delete dt.onPointerUp,delete dt.onFocus,delete dt.onBlur,ee&&(Object.keys(dt).forEach(Me=>{/^on[A-Z]/.test(Me)&&typeof dt[Me]=="function"&&delete dt[Me]}),dt["aria-disabled"]="true"),E&&(dt["aria-busy"]="true");const _t=(typeof Q=="string"?Q:null)??(typeof Z=="string"?Z:null)??(typeof y=="string"?y:null)??(typeof de=="string"?de:null)??void 0,Ce=typeof y=="string"?y:typeof de=="string"?de:_t,Pe=I?[I.title,...I.items??[]].filter(Boolean).join(". "):Q&&_t&&_t!==Ce?_t:"",ye=[typeof R["aria-describedby"]=="string"?R["aria-describedby"]:void 0,Pe?Je:null].filter(Boolean).join(" ")||void 0,Ye=()=>n.jsx("span",{className:`${Dt} button__spinner`,"aria-hidden":"true",children:n.jsx(pa,{variant:"spinner",size:"100%"})}),bt=(Me,lt)=>n.jsx(at,{icon:Me,label:lt??Ce,className:Dt,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),Nt=Me=>E?Ye():bt(c,Me),mt=()=>De==="dot"?n.jsxs(n.Fragment,{children:[Nt(),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()})]}):f==="center"&&(c||E)?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Nt()}),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()})]}),$e&&n.jsx("span",{className:"button__right",children:bt(d)})]}):n.jsxs(n.Fragment,{children:[(c||E)&&n.jsx("span",{className:"button__left",children:Nt(y??de)}),je&&n.jsx("span",{className:`button__label ${te}`,children:nt()}),$e&&n.jsx("span",{className:"button__right",children:bt(d)})]}),gt=!!l&&!ee;return n.jsxs(n.Fragment,{children:[n.jsxs(gt?"a":"button",{...dt,ref:Be,...gt?{href:l,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:s??"button",disabled:ee&&!M&&!ke},className:wt,"aria-pressed":xt,"aria-expanded":typeof v=="boolean"?v:R["aria-expanded"],"aria-controls":A??R["aria-controls"],"aria-label":Ce,"aria-disabled":ee&&(gt||M||ke)?!0:void 0,"aria-describedby":ye,style:_e,onClick:Lt,onMouseLeave:At,onPointerEnter:Me=>{ma(Me)||jt(),!ee&&typeof R.onPointerEnter=="function"&&R.onPointerEnter(Me)},onPointerLeave:Me=>{ma(Me)||vt(),!ee&&typeof R.onPointerLeave=="function"&&R.onPointerLeave(Me)},onPointerUp:Me=>{ee&&ot&&ct.touchPress(Me.currentTarget),!ee&&typeof R.onPointerUp=="function"&&R.onPointerUp(Me)},onFocus:Me=>{qe(!0),Ca()||jt(),!ee&&typeof R.onFocus=="function"&&R.onFocus(Me)},onBlur:Me=>{qe(!1),ee||kt(Me),vt(),!ee&&typeof R.onBlur=="function"&&R.onBlur(Me)},children:[mt(),Pe?n.jsx("span",{id:Je,hidden:!0,"aria-label":Pe}):null]}),et&&I?n.jsx(Xn,{anchorRect:yt,title:I.title,items:I.items,onClose:Ke}):et&&_t?n.jsx(Tn,{anchorRect:yt,text:_t,onClose:Ke}):null]})}const be=o.forwardRef(ky);be.displayName="Button";function Mt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const s=r.current?.parentElement??null;return t(s,e),()=>a(s)},[e,t,a]),r}const Ia={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},xo=new WeakMap;function wo(e){if(e)return xo.get(e)}function Zt(e,t){e&&(e.style.setProperty(Ia.title,t.title),e.style.setProperty(Ia.description,t.description),xo.set(e,t))}function Xt(e){e&&(e.style.removeProperty(Ia.title),e.style.removeProperty(Ia.description),xo.delete(e))}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function di(){const e=Mt(ci,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const pi={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function hi(){const e=Mt(pi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const mi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ci(){const e=Mt(mi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const fi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function bi(){const e=Mt(fi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const gi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function yi(){const e=Mt(gi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const vi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function _i(){const e=Mt(vi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const xi={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function wi(){const e=Mt(xi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const Bi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ki(){const e=Mt(Bi,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const Ai={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function Ni(){const e=Mt(Ai,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const Ei={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function Di(){const e=Mt(Ei,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Si={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ji(){const e=Mt(Si,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const Ti={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Mi(){const e=Mt(Ti,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Li={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function $i(){const e=Mt(Li,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function Pi(){const e=Mt(Ri,Zt,Xt);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const rn=(e,t,a)=>({key:e,get label(){return Vt.t(`promoBannerBg.${e}`,t)},textTone:a}),Ay=[rn("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("soft","\uC18C\uD504\uD2B8","dark"),rn("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),rn("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),rn("warm","\uC6DC(\uAC15\uC870)","dark"),rn("dark","\uB2E4\uD06C","light"),rn("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),rn("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),rn("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),rn("outline","\uC544\uC6C3\uB77C\uC778","dark"),rn("success","\uC131\uACF5/\uC644\uB8CC","light"),rn("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),rn("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Fi={main:di,soft:hi,sub:Ci,deep:bi,softSub:yi,warm:_i,dark:wi,radial:ki,diagonal:Ni,dots:Di,outline:ji,success:Mi,naver:$i,instagram:Pi};function Ii({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:s=.1,lineHeightRatio:l=1.4}={}){const i=w=>Math.max(a,Math.min(r,Number(w))),u=w=>{try{const v=localStorage.getItem(w),A=v?Number(v):1;return Number.isFinite(A)?i(A):i(1)}catch{return i(1)}},[c,d]=o.useState(()=>u(e)),[h,p]=o.useState(e);h!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const m=w=>{d(typeof w=="function"?v=>i(w(v)):i(w))},g=()=>m(w=>+(w+s).toFixed(6)),y=()=>m(w=>+(w-s).toFixed(6)),C=c<r-Number.EPSILON,f=c>a+Number.EPSILON,_=Math.round(t*c),b=Math.round(_*l);return{scale:c,setScale:m,increase:g,decrease:y,canIncrease:C,canDecrease:f,fontSize:_,lineHeight:b}}function Oi(e,t){const a=Fa(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const Bo=" \xB7 ",zi=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(Bo)?e.split(Bo).pop()??e:e})(),Ny=o.createContext(!1),Jn=[];let Wi=null;function Ey(e){const t=o.useContext(Ny);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Jn.length===0&&(Wi=document.title);const a={text:zi?`${e}${Bo}${zi}`:e};return Jn.push(a),document.title=a.text,()=>{const r=Jn.lastIndexOf(a);r>=0&&Jn.splice(r,1),document.title=Jn.length?Jn[Jn.length-1].text:Wi??document.title}},[e,t])}const ko=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],Dy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function Cn(e,t){return Dy().compare(e,t)}const Cr=new Map;function Sy(e){const t=Cr.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let s=0;for(let l=r.exec(e);l;l=r.exec(e)){let i=l.index,u=l[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>s&&a.push(e.slice(s,i)),a.push(Number(u)),s=l.index+l[0].length}return s<e.length&&a.push(e.slice(s)),Cr.size>5e3&&Cr.clear(),Cr.set(e,a),a}function jy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function Ty(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),s=a(t);if(r===s)return 0;const l=(d,h)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=jy(h);return p!==null?[p]:Sy(h)},i=l(e,r),u=l(t,s),c=Math.min(i.length,u.length);for(let d=0;d<c;d++){const h=i[d],p=u[d];if(typeof h=="number"&&typeof p=="number"){if(h!==p)return h-p;continue}if(typeof h=="number")return-1;if(typeof p=="number")return 1;const m=Cn(h,p);if(m!==0)return m}return i.length!==u.length?i.length-u.length:Cn(r,s)}const Hi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function fr(e,t,a){const r=Hi(e),s=Hi(t);if(r||s)return r===s?0:r?1:-1;const l=Ty(e,t);return a?l:-l}function My(e,t,a){const{t:r}=xe.useTranslation(),[s,l]=o.useState(()=>{const y=a?.initialPageSize;return y&&ko.some(C=>C.value===y)?y:"25"}),[i,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),i!==1&&u(1));const h=o.useMemo(()=>ko.map(y=>({...y,label:r("visits.showN",{n:y.value})})),[r]),p=o.useCallback(y=>{ko.some(C=>C.value===y)&&(l(y),u(1))},[]),m=Math.max(1,Math.ceil(e.length/Number(s))),g=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),m);return i!==g&&u(g),{pageRows:o.useMemo(()=>e.slice((g-1)*Number(s),g*Number(s)),[e,g,s]),pageSizeProps:{options:h,value:s,onChange:p},paginationProps:{page:g,total:m,onChange:u},setPage:u}}function Ly(e){const[t,a]=o.useState(()=>e?.defaultKey!=null?{key:e.defaultKey,asc:e.defaultAsc??!0}:null),r=o.useRef(t),s=o.useRef(e?.onSortChange);s.current=e?.onSortChange;const l=o.useCallback(c=>{const d=r.current,h=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=h,a(h),s.current?.(h)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>l(d)}),[t,l]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:h,asc:p}=t;return[...c].sort((m,g)=>fr(d(m,h),d(g,h),p))},[t]);return{sort:t,field:i,sortRows:u}}const Bn="\uC804\uCCB4";Object.fromEntries(Object.entries(cf).map(([e,{nucleus:t}])=>[e,t]));const $y={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"})},Ry={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"})},Py={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 Fy(e,t){if("place"in t)return $y[t.place](e);const a=Ry[t.vowel](e);return t.glide?`${a} \xB7 ${Py[t.glide](e)}`:a}const Iy=(e,{defaultValue:t})=>t,Vi=(e,t)=>({jamos:e,phonetic:t,tooltip:Fy(Iy,t)}),Mn=(e,t)=>t.map(a=>Vi([a],{place:e})),qt=(e,t,a)=>Vi([...e],a?{vowel:t,glide:a}:{vowel:t}),Ao={cho:[Mn("labial",["\u3142","\u3143","\u314D","\u3141"]),Mn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Mn("alveolar",["\u3145","\u3146"]),Mn("palatal",["\u3148","\u3149","\u314A"]),Mn("velar",["\u3131","\u3132","\u314B"]),Mn("glottal",["\u314E"])],jung:[[qt("\u3163","frontHigh"),qt("\u315F","frontHigh","w"),qt("\u3162","frontHigh","velar")],[qt("\u3161","backHighUnrounded")],[qt("\u315C","backHighRounded"),qt("\u3160","backHighRounded","j")],[qt("\u3154\u3150","frontMid"),qt("\u3156\u3152","frontMid","j"),qt("\u3159\u315A\u315E","frontMid","w")],[qt("\u3153","backMidUnrounded"),qt("\u3155","backMidUnrounded","j"),qt("\u315D","backMidUnrounded","w")],[qt("\u3157","backMidRounded"),qt("\u315B","backMidRounded","j")],[qt("\u314F","low"),qt("\u3151","low","j"),qt("\u3158","low","w")]],jong:[Mn("labial",["\u3142","\u3141"]),Mn("alveolar",["\u3137","\u3134","\u3139"]),Mn("velar",["\u3131","\u3147"])]},Oy=e=>e===zy?[]:Array.from(e),zy="__NO_CODA__",No=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:s})=>({v:a.join(""),phonetic:r,tooltip:s}))),qi={cho:No(Ao.cho),jung:No(Ao.jung),jong:No(Ao.jong)};qi.jung.flat().forEach(({v:e})=>{for(const t of Oy(e));}),new Set(qi.cho.flat().map(e=>e.v));function Wy(e,t=!0){const a=Fa(e);o.useEffect(()=>{if(t)return Zn(()=>{a.current?.()})},[t,a])}function Oa(){const[e,t]=o.useState(null),a=o.useCallback(l=>t(l.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),s=o.useCallback(l=>{const i=l.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:s}}function Hy(e){const[t,a]=o.useState(null),[r,s]=o.useState(null),l=o.useRef(null);o.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const i=o.useCallback((c,d)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(c),s(d)},e)},[e]),u=o.useCallback(()=>{l.current&&clearTimeout(l.current),a(null),s(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Ui(e="warning"){const[t,a]=o.useState(""),[r,s]=o.useState(e),[l,i]=o.useState(0),u=o.useCallback((p,m)=>{s(m),a(p),i(g=>g+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),h=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:l,showToast:u,showWarning:c,showNormal:d,clearToast:h}}function za(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Wa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[s,l]=o.useState(!1),[i,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),h=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{s&&h()},[s,h]),o.useEffect(()=>{if(!s)return;let g=d.current?.offsetHeight??0;g>0&&h();let y=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const E=d.current?.offsetHeight??0;if(E!==g){if(g=E,++y>4){C?.disconnect(),C=null;return}h()}}),C.observe(d.current));const f=E=>{const B=E.target;r&&B.closest?.(r)||c.current?.contains(B)||d.current?.contains(B)||l(!1)};document.addEventListener("mousedown",f),document.addEventListener("pointerdown",f);let _=null;const b=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},w=E=>{d.current?.contains(E.target)||(t==="reposition"?b():t==="close"&&l(!1))};t!=="ignore"&&window.addEventListener("scroll",w,!0);const v=()=>{a==="reposition"?b():a==="close"&&l(!1)};let A=null;const x=()=>{v(),A&&clearTimeout(A),A=setTimeout(()=>{A=null,a==="reposition"&&h()},250)};return a!=="ignore"&&(window.addEventListener("resize",v),window.addEventListener("orientationchange",x)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",f),document.removeEventListener("pointerdown",f),t!=="ignore"&&window.removeEventListener("scroll",w,!0),a!=="ignore"&&(window.removeEventListener("resize",v),window.removeEventListener("orientationchange",x)),A&&clearTimeout(A)}},[s,h,t,a,r]),o.useEffect(()=>{if(s)return Zn(()=>l(!1))},[s]);const p=o.useCallback(()=>l(g=>!g),[]),m=o.useCallback(()=>l(!1),[]);return{open:s,setOpen:l,toggle:p,close:m,style:i,triggerRef:c,menuRef:d}}function Vy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:s,playMs:l=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,h]=o.useState(0),[p,m]=o.useState("idle"),[g,y]=o.useState(null),[C,f]=o.useState([]),[_,b]=o.useState(null),[w,v]=o.useState(0),A=o.useRef(0),x=o.useCallback(L=>{A.current=typeof L=="function"?L(A.current):L,v(A.current)},[]),E=o.useRef(r),B=o.useRef(s);o.useEffect(()=>{E.current=r,B.current=s},[r,s]);const D=o.useRef([]),N=()=>{D.current.forEach(clearTimeout),D.current=[]},k=(L,W)=>{D.current.push(setTimeout(W,L))};o.useEffect(()=>()=>N(),[]);const P=u[d]?.id??null,$=o.useRef(null),G=o.useCallback(()=>{N(),m("playing"),f([]),b(null),x(0);let L=0;e.forEach((W,Y)=>{k(L,()=>{h(Y),y(W.id),E.current?.(W)}),k(L+1e3,()=>{y(null),f(U=>[...U,W.id])}),L+=1300}),k(L,()=>{m("done"),B.current?.({score:0,total:e.length})})},[e,x]),T=o.useCallback((L,W)=>{if(W>=L.length){m("done"),B.current?.({score:A.current,total:L.length});return}$.current=null,h(W),b(null),m("playing"),y(L[W].id),E.current?.(L[W]),k(l,()=>{y(null),m("waiting")})},[l]),F=o.useCallback(()=>{N();const L=$a(e);c(L),x(0),f([]),T(L,0)},[e,T,x]),M=o.useCallback(()=>{t==="playback"?(c(e),G()):F()},[t,e,G,F]),Q=o.useCallback(()=>{N(),m("idle"),y(null),f([]),b(null),h(0),x(0),c([])},[x]),Z=JSON.stringify(e.map(L=>[L.id,L.label,L.angleDeg,L.deg,L.row,L.shortcut]));o.useEffect(()=>(a?M():Q(),()=>N()),[t,Z,a]);const I=o.useCallback(L=>{p!=="waiting"||t==="playback"||$.current===d||($.current=d,b(L),L===u[d]?.id&&x(W=>W+1),t==="exam"?(m("playing"),k(400,()=>T(u,d+1))):(m("feedback"),k(i,()=>T(u,d+1))))},[p,t,u,d,T,i,x]),K=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:g,playedIds:C,selectedId:_,answerId:P,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:I},index:d,total:K,score:w,phase:p,done:p==="done",start:M,reset:Q}}const Eo=new Map,Do=new Map,qy=()=>()=>{},Uy=()=>!0,Gy=()=>!1;function Gi(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 a=Uint8Array.from(atob(t[2]),r=>r.charCodeAt(0));return new TextDecoder("utf-8").decode(a)}catch{return null}}function Ky(e){if(typeof window>"u")return"";const t=(a,r)=>{const s=r.attrName.toLowerCase(),l=r.attrValue.trim();(s==="href"||s==="xlink:href")&&!l.startsWith("#")&&(r.keepAttr=!1),(s==="style"||l.includes("\\")&&l.includes("("))&&(r.keepAttr=!1);const i=l.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};ia.addHook("uponSanitizeAttribute",t);try{return ia.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{ia.removeHook("uponSanitizeAttribute",t)}}function Yy(e,t){const a=new Set;for(const i of e.matchAll(/url\(\s*(['"]?)#([^)\s"']+)\1\s*\)/g))a.add(i[2]);for(const i of e.matchAll(/(?:xlink:)?href="#([^"]+)"/g))a.add(i[1]);const r=new Set([...e.matchAll(/id="([^"]*)"/g)].map(i=>i[1])),s=[...a].filter(i=>r.has(i));if(s.length===0)return e;let l=e;for(const i of s){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;l=l.replace(new RegExp(`id="${u}"`,"g"),`id="${c}"`).replace(new RegExp(`url\\(\\s*(['"]?)#${u}\\1\\s*\\)`,"g"),(d,h)=>`url(${h}#${c}${h})`).replace(new RegExp(`((?:xlink:)?href)="#${u}"`,"g"),`$1="#${c}"`)}return l}function Zy(e){const t=Do.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&Eo.set(e,r),r)).catch(()=>null).finally(()=>{Do.delete(e)});return Do.set(e,a),a}function Xy(e,t=!0){const a=o.useSyncExternalStore(qy,Uy,Gy)&&t&&e?Gi(e)??Eo.get(e)??null:null,[r,s]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){s({src:e,enabled:t,svg:null});return}const l=Gi(e)??Eo.get(e)??null;if(l!==null){s({src:e,enabled:t,svg:l});return}let i=!0;return Zy(e).then(u=>{i&&s({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Jy({title:e,description:t,actionLabel:a,onAction:r,bg:s,color:l,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:h=""}){const p=s??l??"main",m=o.useRef(null),[g,y]=o.useState("main"),C=yn("(max-width: 767px)"),f=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const w=m.current;if(!w)return;const v=wo(w),A=(x,E,B)=>{if(B!==void 0)w.style.setProperty(E,B),f.current[x]=!0;else if(f.current[x]){const D=v?.[x];D?w.style.setProperty(E,D):w.style.removeProperty(E),f.current[x]=!1}};A("title","--promo-banner-bg-title",c),A("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const w=m.current;if(!w)return;const v=wo(w);y(v?.actionVariant??"main")},[p]);const _=Ae("promo-banner",`promo-banner--${i}`,h),b=Fi[p];return n.jsxs("div",{ref:m,className:_,role:"note",children:[n.jsx(b,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${i==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(be,{htmlType:"button",size:40,variant:u??g,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Qy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":s}){const{t:l}=xe.useTranslation(),i=s??l("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,h]=o.useState(0),[p,m]=o.useState(!1),[g,y]=o.useState(!1),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),w=o.useRef(null),v=yo(),A=p||g||C,x=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||A||v)return;const B=window.setInterval(()=>h(D=>(Math.min(D,c-1)+1)%c),t);return()=>window.clearInterval(B)},[c,t,A,v]);const E=B=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>{b.current=null,f(!1)},B)};return o.useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current)},[]),o.useEffect(()=>{if(!C)return;const B=D=>{D.pointerType==="touch"&&(w.current&&w.current.contains(D.target)||(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!1)))};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[C]),c===0?null:n.jsxs("section",{ref:w,className:Ae("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:B=>{_.current=B.pointerType},onPointerDown:B=>{_.current=B.pointerType,B.pointerType==="touch"&&(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!0))},onPointerUp:B=>{B.pointerType==="touch"&&E(5e3)},onPointerCancel:B=>{B.pointerType==="touch"&&E(5e3)},onMouseEnter:()=>{_.current!=="touch"&&m(!0)},onMouseLeave:()=>m(!1),onFocus:B=>{let D=!0;try{D=B.target.matches(":focus-visible")}catch{D=!0}y(D)},onBlur:B=>{B.currentTarget.contains(B.relatedTarget)||y(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${x*100}%)`},children:u.map((B,D)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":D!==x,...D!==x?{inert:!0}:{},children:B},D))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[x]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((B,D)=>n.jsx("button",{type:"button",className:`top-banner__dot${D===x?" top-banner__dot--active":""}`,"aria-label":l("topBanner.dotAriaLabel",{count:c,index:D+1,defaultValue:`${c}\uAC1C \uC911 ${D+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":D===x,onClick:()=>h(D)},D))})]})}function e2({title:e,body:t,open:a=!1,onToggle:r,avatar:s,titleClassName:l="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const h=d.currentTarget.closest('[role="list"]');if(!h)return;const p=Array.from(h.querySelectorAll("[data-accordion-header]")),m=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[m+1]:p[m-1])?.focus()}},children:[s&&n.jsx("div",{className:"accordion-item__avatar",children:s}),n.jsx("div",{className:`accordion-item__title ${l}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(at,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${i}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function t2({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:s}){const[l,i]=o.useState({index:t}),u=(c,d)=>l.id!=null&&c.id!=null?c.id===l.id:l.id==null&&d===l.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(e2,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>i(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:s},c.id??d))})}function n2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function a2(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function r2(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function En({children:e,icon:t,number:a,position:r="top-left",size:s=24,animate:l=!1,onClick:i,"aria-label":u,"aria-hidden":c,className:d=""}){const{t:h}=xe.useTranslation(),p=t??"check",m=a!==void 0,g=e!==void 0||m?"number":p,y=e!==void 0?void 0:m?h("badge.nthSelected",{n:a,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:h("badge.selected","\uC120\uD0DD\uB428"),remove:h("badge.remove","\uC81C\uAC70"),minus:h("badge.exclude","\uC81C\uC678")}[p],C=c?void 0:u??y;return n.jsxs("span",{className:Ae("circle-badge",`circle-badge--${g}`,`circle-badge--${s}`,`circle-badge--${r}`,l?"circle-badge--animate":"",i?"circle-badge--clickable":"",d),onClick:i,onKeyDown:i?f=>{f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),f.currentTarget.click())}:void 0,"aria-label":C,"aria-hidden":c||void 0,role:i?"button":C?"img":void 0,tabIndex:i?0:void 0,children:[e??(m?a:null),e===void 0&&!m&&p==="check"&&n.jsx(n2,{}),e===void 0&&!m&&p==="remove"&&n.jsx(a2,{}),e===void 0&&!m&&p==="minus"&&n.jsx(r2,{})]})}function Ha({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:s}=xe.useTranslation(),l=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const f=[{title:null,columns:e}];let _=e;for(const b of i){const w=_?.[b.ci]?.items?.[b.ii];if(!w||!Array.isArray(w.children)||!w.children.length)break;_=[{title:null,items:w.children}],f.push({title:w.label||null,columns:_})}return f},[e,i]),d=c[c.length-1],h=c.length-1,p=o.useCallback(()=>u(f=>f.slice(0,Math.max(0,Math.min(f.length,h)-1))),[h]),m=o.useRef(null),g=o.useRef(null),y=c.length;o.useEffect(()=>{g.current||(g.current=document.activeElement);let f=0,_=0;const b=()=>{const w=m.current?.querySelector("button:not([disabled])");if(w&&w.offsetParent){w.focus({preventScroll:!0});return}_++<20&&(f=requestAnimationFrame(b))};return f=requestAnimationFrame(b),()=>cancelAnimationFrame(f)},[y]),o.useEffect(()=>()=>{g.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((f,_,b)=>{if(f){if(Array.isArray(f.children)&&f.children.length){u(w=>[...w.slice(0,h),{ci:_,ii:b}]);return}try{typeof f.onClick=="function"&&f.onClick()}catch{}try{f&&f.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,h]);return n.jsxs("div",{className:se(`menu-tooltip menu-tooltip--${r} ${a}`),children:[(c.length>1||d.title)&&n.jsxs("div",{className:se("menu-tooltip__header"),children:[c.length>1?n.jsx(be,{htmlType:"button",size:l,type:"dot",icon:"chevron-left",ariaLabel:s("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:se("menu-tooltip__title button-1"),children:d.title})]}),n.jsx("div",{className:se("menu-tooltip__columns"),ref:m,children:d.columns&&d.columns.map((f,_)=>{const b=(f.items||[]).some(w=>!!w.icon||w.selected!==void 0);return n.jsxs("div",{className:se("menu-tooltip__column"),children:[f.title?n.jsx("div",{className:se("menu-tooltip__column-title body-3"),children:f.title}):null,n.jsx("div",{className:se("menu-tooltip__items"),children:(f.items||[]).map((w,v)=>n.jsxs(o.Fragment,{children:[w.separatorBefore&&v>0&&n.jsx("div",{className:se("menu-tooltip__separator"),role:"separator"}),n.jsx(be,{htmlType:"button",className:se("menu-tooltip__item"),size:l,type:w.label?"bar":"dot",icon:w.selected?"check":w.icon||(b||!w.label?"none":void 0),rightIcon:Array.isArray(w.children)&&w.children.length?"chevron-right":w.badgeCount?n.jsx(En,{position:"inline",number:Math.min(w.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:w.label,ariaLabel:w.label&&w.badgeCount&&w.badgeCount>0?s("nav.badgeLabel",{label:w.label,count:w.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):w.label,onClick:()=>C(w,_,v),selected:w.selected,disabled:w.disabled,showTooltipInfo:w.tooltip||!1,useBorder:!1,align:"left"})]},v))})]},_)})})]})}const Ki=".content-area";function So(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Ki);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&Bt("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Ki}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const jo=52,br=10,Yi=e=>e&&e>0?e:0;function Zi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:s,moreItems:l=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",h=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[m,g]=o.useState(0),y=e.length;o.useEffect(()=>{const L=p.current;if(!L)return;const W=()=>{const j=typeof getComputedStyle=="function"?getComputedStyle(L):null,R=L.clientWidth-(parseFloat(j?.paddingLeft??"")||0)-(parseFloat(j?.paddingRight??"")||0),z=L.querySelector(".bottom-nav__left"),O=z?.nextElementSibling,ue=(z?.offsetWidth??0)+(z&&O?.classList.contains("bottom-nav__divider")?O.offsetWidth:0);g(Math.max(0,R-ue))};if(W(),typeof ResizeObserver>"u")return;const Y=new ResizeObserver(W);Y.observe(L);const U=L.querySelector(".bottom-nav__left");return U&&Y.observe(U),()=>Y.disconnect()},[s]);const C=jo+1,f=L=>Math.max(0,Math.floor((L+br)/(jo+br))),_=y*(jo+br)-br<=m,b=m<=0||l.length===0&&_?y:Math.min(y,f(m-C)),w=m>0&&b<y,v=w?b:y,A=e.slice(0,v),x=e.slice(v),E=w||l.length>0,B=o.useCallback((L,W)=>({position:"fixed",bottom:window.innerHeight-L.top+8,right:window.innerWidth-L.right,zIndex:za(W)}),[]),D=o.useId(),{open:N,toggle:k,close:P,style:$,triggerRef:G,menuRef:T}=Wa({computeStyle:B,onScroll:"ignore",onResize:"reposition"}),F=o.useCallback((L,W)=>W>0?u("nav.badgeLabel",{label:L,count:W,defaultValue:"{{label}}, {{count}}\uAC1C"}):L,[u]),M=o.useCallback((L,W)=>W>0?u("nav.badgeInsideLabel",{label:L,count:W,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):L,[u]),Q=o.useCallback(()=>s?.(c),[s,c]),Z=o.useMemo(()=>x.find(L=>!!L.key&&L.key===t)??l.find(L=>L.selected||L.key&&L.key===t),[x,t,l]),I=o.useMemo(()=>[{items:[...x.map(L=>({label:L.label,icon:L.icon,badgeCount:L.badgeCount,selected:!!L.key&&L.key===t,closeOnSelect:!0,disabled:L.state==="disabled",onClick:()=>{L.state!=="disabled"&&(L.key&&a&&(a(L.key),So(i,"BottomNav")),P())}})),...l.map(L=>({label:L.label,icon:L.icon,badgeCount:L.badgeCount,selected:L.selected??(!!L.key&&L.key===t),closeOnSelect:!0,onClick:()=>{L.onClick?.(),P()}}))]}],[x,l,t,a,P]),K=[...x,...l].reduce((L,W)=>L+Yi(W.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:h,className:"bottom-nav-item",onClick:Q})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:A.map((L,W)=>{const Y=Yi(L.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:L.icon,ariaLabel:F(L.label,Y),selected:!!L.key&&L.key===t,disabled:L.state==="disabled",className:"bottom-nav-item",onClick:()=>{L.key&&(a?.(L.key),So(i,"BottomNav"))}}),Y>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(En,{position:"top-right",number:Math.min(Y,99),size:24})})]},L.key??`__slot-${W}`)})}),E&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:G,className:"bottom-nav__slot",children:[n.jsx(be,{htmlType:"button",size:52,type:"dot",icon:Z?.icon??"ellipsis",ariaLabel:M(Z?.label??u("nav.more","\uB354\uBCF4\uAE30"),K),selected:!!Z,className:"bottom-nav-item",onClick:k,"aria-expanded":N,"aria-controls":N?D:void 0}),K>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(En,{position:"top-right",number:Math.min(K,99),size:24})}),N&&pn.createPortal(n.jsx("div",{id:D,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:se("tooltip__content"),style:$,ref:T,children:n.jsx(Ha,{columns:I,onClose:P})}),document.body)]})})]})]})}function Xi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const s=r.charCodeAt(0);s<=32||s>=127&&s<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ji(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function o2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:s,onNotification:l,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},h="default";return s||l||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[s&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:s,selected:a==="debug"}),l&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"bell",ariaLabel:Ji(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:l,selected:a==="notifications"}),!!r&&r>0&&n.jsx(En,{number:Math.min(r,99),size:24,"aria-hidden":!0})]}),i&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:i,selected:a==="settings"}),u&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(be,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function Qi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:s,icon:l,active:i,onClick:u,style:c,state:d,labelStyle:h}=e||{},p=a?.key??r??"",m=a?.label??s??"",g=a?.icon??l??"",y=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(at,{icon:g,label:typeof m=="string"?m:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),f=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${f?"disabled":""} ${a?.child?"side-nav__item--child":""}`,b=o.useCallback(w=>{if(f)return;const v=w.detail>0;if(v)try{w.currentTarget.blur()}catch{}u?.(p,w.currentTarget,v)},[f,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:b,"aria-label":typeof m=="string"?Ji(t,m,y):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":f,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:h,children:m}),y>0&&n.jsx(En,{position:"inline",number:Math.min(y,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function eu(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:s,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g,scrollContainer:y}=e||{},C=m==="manager",f=o.useCallback(()=>g?.(C?"malgwi":"manager"),[g,C]),_=o.useRef(null),[b,w]=o.useState(null);o.useEffect(()=>{const B=_.current;if(!B)return;let D=null;const N=()=>{const{scrollHeight:$,clientHeight:G,scrollTop:T}=B;if($<=G+1){w(I=>I===null?I:null);return}const F=Math.max(24,G/$*G),M=G-F,Q=$-G,Z={top:Math.round(T/Q*M),height:Math.round(F)};w(I=>I&&I.top===Z.top&&I.height===Z.height?I:Z)},k=()=>{if(typeof requestAnimationFrame>"u"){N();return}D===null&&(D=requestAnimationFrame(()=>{D=null,N()}))};N(),B.addEventListener("scroll",k,{passive:!0});const P=typeof ResizeObserver<"u"?new ResizeObserver(k):null;P?.observe(B);for(const $ of Array.from(B.children))P?.observe($);return()=>{D!==null&&cancelAnimationFrame(D),B.removeEventListener("scroll",k),P?.disconnect()}},[a]);const v=o.useRef(null),A=o.useCallback(B=>{const D=_.current;D&&(B.preventDefault(),v.current={y:B.clientY,top:D.scrollTop},B.currentTarget.setPointerCapture(B.pointerId))},[]),x=o.useCallback(B=>{const D=_.current,N=v.current;!D||!N||(D.scrollTop=N.top+(B.clientY-N.y)*(D.scrollHeight/D.clientHeight))},[]),E=o.useCallback(B=>{v.current=null,B.currentTarget.hasPointerCapture(B.pointerId)&&B.currentTarget.releasePointerCapture(B.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[b&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:b.top,height:b.height},onPointerDown:A,onPointerMove:x,onPointerUp:E,onPointerCancel:E})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(B=>!B.section&&(B.key||B.label)).map((B,D)=>n.jsxs(o.Fragment,{children:[B.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Qi,{item:B,active:!!B.key&&B.key===r,state:B.disabled?"disabled":void 0,onClick:(N,k,P)=>{if(B.disabled)return;if(B.href){if(Xi(B.href)&&window.open(B.href,"_blank","noopener,noreferrer"),P)try{k?.blur()}catch{}return}if(s?.(B.key),So(y,"SideNav"),!P)return;try{k?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const $=document.querySelector(".header");if($){const G=typeof $.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&G&&$.matches(":hover"))){$.classList.add("header--force-collapsed");const T=()=>{$.classList.remove("header--force-collapsed"),$.removeEventListener("mouseenter",T)};$.addEventListener("mouseenter",T)}}}})]},B.key??`side-nav__item-${D}`)),g&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),g&&n.jsx(Qi,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:f})]}),n.jsx(o2,{activeKey:r,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p})]})}var gr='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',To='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',s2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';function tu({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?To:gr,s=s2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:s,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function nu({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:s,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g,scrollContainer:y}){const{t:C}=xe.useTranslation(),f=yn("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter($=>!$.section&&($.key||$.label)).map($=>({key:$.key,label:typeof $.label=="string"?$.label:void 0,icon:$.icon,state:$.disabled?"disabled":void 0,badgeCount:$.badge})),[a]),b=o.useCallback($=>{const G=a?.find(T=>T.key===$);if(!G?.disabled){if(G?.href){Xi(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.($)}},[a,t]),w=o.useMemo(()=>{const $=[];return i&&$.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&$.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:l,onClick:u}),d&&$.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),h&&$.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:h}),p&&$.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&$.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),$},[C,i,u,d,h,p,c,l]),v=o.useCallback(($,G)=>({position:"fixed",top:$.bottom+8,right:Math.max(8,window.innerWidth-$.right),zIndex:za(G)}),[]),A=o.useId(),{open:x,toggle:E,close:B,style:D,triggerRef:N,menuRef:k}=Wa({computeStyle:v,onScroll:"ignore",onResize:"reposition"}),P=o.useMemo(()=>[{items:w.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===e),closeOnSelect:!0,onClick:()=>{$.onClick?.(),B()}}))}],[w,e,B]);return n.jsxs("aside",{className:`header${m==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(tu,{appMode:m}),n.jsxs("div",{className:"header__menu-button",ref:N,children:[n.jsx(be,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&l&&l>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:l,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:E,"aria-expanded":x,"aria-controls":x?A:void 0}),!!u&&!!l&&l>0&&n.jsx(En,{number:Math.min(l,99),size:24,"aria-hidden":!0}),x&&pn.createPortal(n.jsx("div",{id:A,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:se("tooltip__content"),style:D,ref:k,children:n.jsx(Ha,{columns:P,onClose:B})}),document.body)]})]}),n.jsx(eu,{scrollContainer:y,items:a,activeKey:e??void 0,onChange:t,unreadCount:l,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:m,onAppModeChange:g}),f&&n.jsx(Zi,{items:_,activeKey:e??void 0,onChange:b,scrollContainer:y,appMode:m,onAppModeChange:g})]})}const l2=nu;function on(e){const{type:t="dot",size:a,className:r="","aria-label":s,"aria-hidden":l,role:i}=e;(e.icon!==void 0||e.number!==void 0||e.position!==void 0||e.animate!==void 0||e.onClick!==void 0)&&Bt("badge-circle-props","[ihab/core] Badge \uAC00 \uC6D0\uD615 \uBC43\uC9C0\uC758 \uD504\uB86D(icon \xB7 number \xB7 position \xB7 animate \xB7 onClick)\uC744 \uBC1B\uC558\uC2B5\uB2C8\uB2E4. \uC6D0\uD615\uC740 \uC774\uC81C CircleBadge \uAC00 \uADF8\uB9BD\uB2C8\uB2E4 \u2014 Badge \uC758 dot \uB294 \uC791\uC740 \uC54C\uC57D \uC774\uB984\uD45C\uC785\uB2C8\uB2E4. \uADF8 \uC790\uB9AC\uB97C <CircleBadge \u2026/> \uB85C \uBC14\uAFB8\uC138\uC694."),i&&l&&Bt("badge-role-with-hidden",`[ihab/core] Badge \uAC00 role="${i}" \uACFC aria-hidden \uC744 \uD568\uAED8 \uBC1B\uC558\uC2B5\uB2C8\uB2E4. \uC228\uAE34 \uAC83\uC740 \uB0AD\uB3C5\uAE30\uC5D0 \uB07C\uC5B4\uB4E4 \uC218 \uC5C6\uC5B4 \uC544\uBB34\uAC83\uB3C4 \uC548 \uC77D\uD799\uB2C8\uB2E4 \u2014 \uB458 \uC911 \uD558\uB098\uB9CC \uC8FC\uC138\uC694.`);const{label:u,children:c,variant:d="default",fill:h="filled",minWidth:p,iconLeft:m,iconRight:g,color:y}=e,C=t==="bar",f=typeof a=="number"?"medium":a??"medium",_=(C?{small:"caption-2",medium:"body-3",large:"body-2"}:{small:"caption-2b",medium:"body-3b",large:"body-2b"})[f]??(C?"body-2":"body-2b"),b={small:12,medium:14,large:16}[f]??14,w=Ae("badge",C?"badge--bar":"",`badge--${d}`,`badge--${f}`,h!=="filled"?`badge--${h}`:"",_,r),v=y?.startsWith("--")?`var(${y})`:y,A=p!==void 0||v?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...v?{"--badge-color":v}:{}}:void 0;return n.jsxs("span",{className:w,style:A,"aria-label":l?void 0:s,role:i??(s&&!l?"img":void 0),"aria-hidden":l||void 0,children:[m&&n.jsx(at,{icon:m,size:b,className:"badge__icon"}),u??c,g&&n.jsx(at,{icon:g,size:b,className:"badge__icon"})]})}const i2=()=>Vt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function au(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return da(`${t.toLocaleString("ko-KR")}\uC6D0`)}return da(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function u2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function c2(e){if(e.durationDays&&e.durationDays>0){const l=e.durationDays;return l%365===0?`${l/365}\uB144`:`${l}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const s=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return s?s[2].toLowerCase()==="year"?`${s[1]}\uB144`:`${s[1]}\uC77C`:a||i2()}function d2(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function ru(e){return{type:e.type??u2(e),plan:c2(e),label:e.label,price:au(e.price),originalPrice:au(e.originalPrice),discountLabel:e.discountLabel}}var p2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',h2='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',ou='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Qn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},Mo=new WeakMap;function m2(e){if(e)return Mo.get(e)}function Ln(e,t){e&&(e.style.setProperty(Qn.text,t.text),e.style.setProperty(Qn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Qn.copyright,t.copyrightColor),Mo.set(e,t))}function $n(e){e&&(e.style.removeProperty(Qn.text),e.style.removeProperty(Qn.sub),e.style.removeProperty(Qn.copyright),Mo.delete(e))}const su={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function lu(e={}){const t=Mt(su,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${ou}")`}})]})}const iu="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",fa=240;var Va='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/></svg>';const C2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},f2=100,b2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function uu(e={}){const t=Mt(C2,Ln,$n),a="var(--color-main)",r=270,s=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:b2.map(({scale:l,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${s}) scale(${l*f2/fa}) translate(${-fa/2} ${-fa/2})`,opacity:i,children:n.jsx("path",{d:iu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const g2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},y2=100,v2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function _2(e={}){const t=Mt(g2,Ln,$n),a="#ffffff",r=270,s=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:v2.map(({scale:l,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${s}) scale(${l*y2/fa}) translate(${-fa/2} ${-fa/2})`,opacity:i,children:n.jsx("path",{d:iu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${ou}")`}})]})}const x2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function w2(e={}){const t=Mt(x2,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const B2={Logo_SpeechEar_ko:{"":gr,_mono:p2},Logo_SpeechEarManager_ko:{"":To,_mono:h2}};function k2(e,t){if(e)return B2[e]?.[t??""]??void 0}const A2={speechear:gr,manager:To},N2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},cu=10;function E2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function du(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const s=Math.floor(e/60);return s>0?t("passCard.remainingMinute",{n:s}):t("passCard.remainingSecond",{n:Math.floor(e)})}function D2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),s=a==="\uC624\uD508\uD2B9\uAC00"||a===Vt.t("passCard.specialLabel");return r?n.jsx(w2,{}):s?n.jsx(_2,{}):n.jsx(uu,{})}return n.jsx(lu,{})}function pu({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:s,endDate:l,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:h=!1,textColor:p,subColor:m,copyrightColor:g,logoSrc:y,label:C,price:f,originalPrice:_,discountLabel:b,onUse:w,onRefund:v,onDelete:A}){const{t:x}=xe.useTranslation(),E=t?ru(t):void 0,B=s??E?.type??"speechear",D=r??E?.plan??x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),N=C??E?.label,k=f??(a?E?.price:void 0),P=_??(a?E?.originalPrice:void 0),$=b??E?.discountLabel,G=o.useMemo(()=>{if(k)return null;const H=t?.durationDays??d2(t?.code);if(!H||H<=0)return i!=null?{percent:null,remainingLabel:du(i,x)}:null;const q=H*86400;let ie;if(i!=null)ie=i;else if((c==="active"||c==="expired")&&l){const he=new Date(l).getTime();if(Number.isNaN(he))return null;const je=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(l)),$e=/^(\d{4})-(\d{2})-(\d{2})/.exec(Pa()),De=Math.round(je&&$e?(Date.UTC(+je[1],+je[2]-1,+je[3])-Date.UTC(+$e[1],+$e[2]-1,+$e[3]))/864e5:(he-Date.now())/864e5);ie=Math.max(0,u?De+1:De)*86400}else c==="expired"?ie=0:ie=q;const Ne=E2(ie),_e=Math.max(0,Math.min(100,Math.floor(Math.min(Ne,q)/q*100)));return c==="pending"&&_e>=100?null:{percent:_e,remainingLabel:c==="expired"?x("passCard.expired","\uB9CC\uB8CC\uB428"):du(ie,x)}},[k,c,l,i,u,t?.durationDays,t?.code,x]),T=o.useRef(null),[F,M]=o.useState({}),[Q,Z]=o.useState(null),I=!!(w||v||A),K=o.useRef(!1),L=o.useRef(void 0),[W,Y]=o.useState(y);o.useLayoutEffect(()=>{Y(y)},[y]),o.useLayoutEffect(()=>{const H=T.current;H&&(p!==void 0&&H.style.setProperty("--pass-card-text",p),m!==void 0&&H.style.setProperty("--pass-card-sub",m),g!==void 0&&H.style.setProperty("--pass-card-copyright",g))},[p,m,g]),o.useLayoutEffect(()=>{const H=T.current;if(!H)return;const q=m2(H);if(!y){const ie=N2[B],Ne=c==="expired"?"_mono":q?.logoColor??"",_e=k2(ie,Ne);Y(_e)}},[d,y,B,c]);const U=H=>{const q=T.current;if(!q)return null;const{left:ie,top:Ne,width:_e,height:he}=q.getBoundingClientRect(),je=(H.clientX-ie)/_e-.5;return{rotateX:-((H.clientY-Ne)/he-.5)*cu,rotateY:je*cu}},j=(H,q)=>{const ie=q*-.7,Ne=H*.7+10,_e=20+(Math.abs(H)+Math.abs(q))*.4;return`${ie}px ${Ne}px ${_e}px rgba(0, 0, 0, 0.18)`},R=o.useCallback(H=>{if(Ca())return;K.current=!0,clearTimeout(L.current),L.current=setTimeout(()=>{K.current=!1},200);const q=U(H);q&&M({transform:`perspective(800px) rotateX(${q.rotateX}deg) rotateY(${q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:j(q.rotateX,q.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),z=o.useCallback(H=>{if(Ca())return;const q=U(H);if(!q)return;const ie=K.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";M({transform:`perspective(800px) rotateX(${q.rotateX}deg) rotateY(${q.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:j(q.rotateX,q.rotateY),transition:ie})},[]),O=o.useCallback(()=>{clearTimeout(L.current),K.current=!1,M({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),ue=o.useCallback(()=>Z(null),[]),te=o.useMemo(()=>{const H=x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),q=D.replace("\uC774\uC6A9\uAD8C","").replace(H==="\uC774\uC6A9\uAD8C"?"":H,"").trim(),ie=q.match(/^(.*?)(일|년)$/);return ie?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:ie[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:ie[2]==="\uB144"?x("passCard.unitYear","\uB144"):x("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:q})},[D,x]),de=o.useMemo(()=>{const H=da(k);if(!H)return null;const q=H.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!q)return n.jsx("span",{className:"h1",children:H});const[,ie,Ne,_e]=q;return n.jsxs(n.Fragment,{children:[ie&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ie}),n.jsx("span",{className:"h1 pass-card__price-amount",children:Ne}),_e.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:_e.trim()})]})},[k]),ee=o.useCallback(()=>{I&&Z(H=>{if(H)return null;const q=T.current?.getBoundingClientRect();if(!q)return null;const ie=50;return{left:q.left,right:q.right,width:q.width,height:q.height,x:q.x,y:q.y+ie,top:q.top+ie,bottom:q.bottom+ie}})},[I]),V=o.useCallback(H=>{I&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),ee())},[I,ee]),ae=[{items:[...w?[{label:x("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{w(),Z(null)},closeOnSelect:!0}]:[],...v?[{label:x("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{v(),Z(null)},closeOnSelect:!0}]:[],...A?[{label:x("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{A(),Z(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:T,className:`pass-card pass-card--${c}${I?" pass-card--clickable":""}`,style:F,onMouseEnter:R,onMouseMove:z,onMouseLeave:O,onPointerUp:H=>{H.pointerType==="touch"&&O()},onPointerCancel:H=>{H.pointerType==="touch"&&O()},onClick:ee,onKeyDown:I?V:void 0,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":e,"aria-haspopup":I?"menu":void 0,"aria-expanded":I?!!Q:void 0,children:[d??D2(B,D,N),!h&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:W??A2[B],className:"pass-card__logo",alt:B==="manager"?x("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):x("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:te}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:N?x("passCard.labeledPlan",{label:N}):x("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),k?n.jsxs("div",{className:"pass-card__price-area",children:[$&&n.jsx("span",{className:"pass-card__discount body-3",children:$}),n.jsxs("div",{className:"pass-card__price",children:[P&&n.jsx("span",{className:"pass-card__price-original body-3",children:da(P)}),de]})]}):G?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:G.remainingLabel}),G.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:G.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Q&&n.jsx(wn,{anchorRect:Q,onClose:ue,ariaLabel:x("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:ae,onClose:ue,size:"small"})})]})}const S2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function j2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Mt(S2,Ln,$n);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}const T2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function M2(e={}){const t=Mt(T2,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}function L2(e,t){if(e){if(t==="manager_pro")return n.jsx(M2,{});if(t==="manager_standard")return n.jsx(j2,{});if(t==="manager_lite")return n.jsx(uu,{})}}function $2(e){const t=da(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,s,l]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),s,l.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:l.trim()})]})}function R2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:s,onSelect:l,period:i="monthly",ownedCodes:u}=e||{},c=v=>!!v&&!!u?.includes(v),d=v=>v.onceOnly??/오픈\s*특가/.test(v.label??""),h=(s.tiers||[]).some(v=>d(v)&&c(v.code)),p=v=>{const A=v.prices?v.prices[i]:v.price;return A?(s.tiers||[]).some(x=>!!x.badge&&x.originals?.[i]===A):!1},m=s.colorToken?`var(--color-${s.colorToken})`:"var(--color-gray)",g=t("payment.plan.freePrice","\uBB34\uB8CC"),y=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=v=>v.prices?v.prices[i]:v.price,f=(s.tiers||[]).length>0&&(s.tiers||[]).every(v=>{const A=C(v);return A==="\uBB34\uB8CC"||A===g||A==="0\uC6D0"||typeof A=="string"&&/\d/.test(A)&&!/[1-9]/.test(A)}),_=(s.tiers||[]).length>0&&(s.tiers||[]).every(v=>{const A=C(v);return A==="\uBB38\uC758"||A===y}),b=s.group==="org",w=b?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:m,"--plan-color":m},children:[s.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(on,{label:s.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:m},children:s.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:s.tier??s.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:s.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(s.recommendedFor||[]).map((v,A)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},A))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(s.features||[]).map((v,A)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(at,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},A))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:f?null:_?n.jsx(be,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>s.tiers?.[0]&&l?.({...s.tiers[0],productId:s.id,productTitle:s.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(s.tiers||[]).map(v=>{const A=v.label||a,x=d(v),E=x||v.openPromo===!0,B=A.replace(/^오픈\s*특가\s*/,"")||a,D=v.prices?v.prices[i]:v.price,N=v.badge?E?`${r}
823
823
  ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(v)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${v.highlight?" payment-plan__pricing-row--highlight":""}`,children:[n.jsx("div",{className:"payment-plan__pricing-row-title",children:n.jsx("div",{className:"payment-plan__pricing-row-label h5b",children:v.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:$2(D)})})]},v.id);const k=s.tier??(b?s.title:void 0),P=n.jsx(pu,{showPrice:!0,product:{type:w,code:v.code,name:B,label:k,price:D,originalPrice:v.originals?.[i]??void 0,discountLabel:N},bg:L2(b,s.id)}),$=()=>l?.({...v,productId:s.id,productTitle:s.title,preview:P});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:$,onKeyDown:l?G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),$())}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,children:P},v.id)})})})})]})}function P2({variant:e="default"}){return n.jsxs("div",{className:`pass-card-bg pass-card-bg--${e}`,"aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--1"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--2"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--3"})]})}var Lo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_IHAB_en" xmlns="http://www.w3.org/2000/svg" width="765.08" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 765.08 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/><g id="text"><path d="M316.21,190.6h-36.74V50.61h36.74v139.99Z"/><path d="M335.16,50.61h36.74v55.11h51.63v-55.11h36.93v139.99h-36.93v-55.11h-51.63v55.11h-36.74V50.61Z"/><path d="M473.99,190.6l46.6-139.99h50.08l46.41,139.99h-39.64l-8.31-27.46h-46.99l-8.31,27.46h-39.83ZM560.62,135.3l-14.5-46.99h-1.16l-14.31,46.99h29.97Z"/><path d="M631,50.61h59.94c31.9,0,48.73,13.73,48.73,35.19,0,15.47-11.02,27.26-26.88,30.55v1.35c17.6.58,32.29,13.54,32.29,33.45,0,22.82-18.56,39.45-49.11,39.45h-64.97V50.61ZM701.77,93.53c0-8.89-6.96-13.92-17.02-13.92h-17.02v27.84h16.44c10.25,0,17.6-5.03,17.6-13.92ZM706.22,146.51c0-10.25-7.35-16.05-19.14-16.05h-19.34v30.55h18.76c13.15,0,19.72-5.03,19.72-14.5Z"/></g></svg>';const hu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function F2(){const e=Mt(hu,Ln,$n);return n.jsx("div",{ref:e,className:"pass-card-bg pass-card-bg-ihab","aria-hidden":"true",children:n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-ihab__symbol-top",style:{"--symbol-url":`url("${Lo}")`}})})}const mu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function I2(e={}){const t=Mt(mu,Ln,$n);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-left-color-grid","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-left-color-grid__bar"}),n.jsx("div",{className:"pass-card-bg-left-color-grid__grid"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-left-color-grid__symbol",style:{"--symbol-url":`url("${Va}")`}})]})}function Cu({keys:e,anchor:t="top-right",scale:a,className:r=""}){const s=Array.isArray(e)?e:[e];return n.jsx("span",{className:Ae("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:s.map((l,i)=>n.jsxs("span",{className:"shortcut-badge__group",children:[i>0&&n.jsx("span",{className:"shortcut-badge__plus",children:"+"}),n.jsx("kbd",{className:"shortcut-badge__key",children:l})]},`${l}-${i}`))})}const qa=(e,t,a)=>e+(t-e)*a;function O2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:s,selectedId:l=null,answerId:i=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:h,clickable:p=!1,onSelectSpeaker:m,buttonSize:g=40,showIcon:y=!0,onCenterClick:C,centerLabel:f,centerDisabled:_=!1,centerAttention:b=!1,shortcutAnchor:w="top-right",shortcutScale:v,scaleShortcut:A=!1}){const{t:x}=xe.useTranslation(),E=Math.max(0,Math.min(1,a)),B=t/2,D=110/300,N=.18,k=H=>t*(D+(H-1)*N),P=H=>{const q=k(H.row??1),ie=H.angleDeg*Math.PI/180;return{x:B+q*Math.cos(ie),y:B+q*Math.sin(ie)}},$=Math.max(...e.map(H=>H.row??1),1),G=t*.08,T=t*.1,F=t*.24,M=t-2*G,Q=t-T-F,Z=t-F/2,I=o.useMemo(()=>[...new Set(e.map(H=>H.deg))].sort((H,q)=>H-q),[e]),K=I.length,L=Math.max(68,K>1?M/(K-1):0),W=o.useMemo(()=>new Map(I.map((H,q)=>[H,q])),[I]),Y=H=>{const q=W.get(H.deg)??0,ie=B+(q-(K-1)/2)*L,Ne=$>1?Math.min(68,Q/($-1)):0,_e=Ne*($-1),he=T+(Q-_e)/2,je=$===1?T+Q*.4:he+($-(H.row??1))*Ne;return{x:ie,y:je}},U=H=>{const q=P(H),ie=Y(H);return{x:qa(q.x,ie.x,E),y:qa(q.y,ie.y,E)}},j={x:B,y:qa(B,Z,E)},R=Math.round(g*1.2),z=Math.round(Math.max(16,Math.min(80,g*.7))),O=[],ue=new Map;for(const H of e){const q=H.row??1;ue.has(q)||ue.set(q,[]),ue.get(q).push(H)}for(const[H,q]of ue.entries()){if(q.length<2)continue;const ie=[...q].sort((Ve,ut)=>Ve.deg-ut.deg),Ne=ie.map(Ve=>U(Ve)),_e=ie.map(Ve=>Ve.deg),he=_e[_e.length-1]-_e[0],je=he/(_e.length-1),$e=360-he,De=ie.length>=3&&je>0&&$e<=je*1.5,le=Math.round(k(H)*1e3)/1e3,we=(Ve,ut,et,Xe)=>{const yt=(ut.angleDeg-Ve.angleDeg+540)%360-180;if(yt===0)return`L ${Xe.x} ${Xe.y}`;if(E===0)return`A ${le} ${le} 0 0 ${yt>0?1:0} ${Xe.x} ${Xe.y}`;const Te=(Ve.angleDeg+yt/2)*Math.PI/180,Ke={x:B+le*Math.cos(Te),y:B+le*Math.sin(Te)},ke={x:(et.x+Xe.x)/2,y:(et.y+Xe.y)/2},qe={x:qa(Ke.x,ke.x,E),y:qa(Ke.y,ke.y,E)},Je={x:2*qe.x-ke.x,y:2*qe.y-ke.y};return`Q ${Je.x} ${Je.y} ${Xe.x} ${Xe.y}`},Le=De?[...ie,ie[0]]:ie,Be=De?[...Ne,Ne[0]]:Ne;let ze=`M ${Be[0].x} ${Be[0].y}`;for(let Ve=1;Ve<Be.length;Ve++)ze+=" "+we(Le[Ve-1],Le[Ve],Be[Ve-1],Be[Ve]);O.push({key:`arc-${H}`,d:ze})}const te=o.useMemo(()=>new Set(s??[]),[s]),de=H=>({idle:"",active:x("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:x("soundCompass.state.played","\uB4E4\uC74C"),correct:x("soundCompass.state.correct","\uC815\uB2F5"),wrong:x("soundCompass.state.wrong","\uC624\uB2F5")})[H],ee=H=>{if(r===H.id)return"active";if(u){if(H.id===i)return"correct";if(H.id===l&&l!==i)return"wrong"}return te.has(H.id)?"played":"idle"},V=H=>r===H.id?"loop":u?H.id===i?"loop":null:c&&H.id===l?"once":null,ae=(H,q)=>{switch(H){case"played":case"correct":return n.jsx(zs,{size:q});case"wrong":return n.jsx(Xs,{size:q});default:return n.jsx(Zs,{size:q})}};return n.jsx("div",{className:"sound-compass",children:n.jsxs("div",{className:"sound-compass__compass-wrap",style:{width:t,height:t},children:[n.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:"sound-compass__svg",children:[E===0&&e.map(H=>{const{x:q,y:ie}=U(H);return n.jsx("line",{x1:j.x,y1:j.y,x2:q,y2:ie,stroke:"#dde3ec",strokeWidth:"1"},H.id)}),O.map(H=>n.jsx("path",{d:H.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},H.key))]}),b&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:R,height:R,left:j.x-R/2,top:j.y-R/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:R,height:R,left:j.x,top:j.y},"aria-label":f,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(zr,{size:z,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:R,height:R,left:j.x,top:j.y},children:n.jsx(zr,{size:z,color:"currentColor",strokeWidth:1.5})}),e.map((H,q)=>{const{x:ie,y:Ne}=U(H),_e=ee(H),he=V(H),je={...v!==void 0||A?{"--shortcut-badge-scale":String(v??Math.max(.75,Math.min(3,g/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:_e!=="idle"?10:1},$e=g,De=Math.round(Math.max(10,Math.min(56,$e*.38))),le=Math.round(Math.max(7,Math.min(18,$e*.2))),we=Math.round(Math.max(10,Math.min(56,$e*.4))),Le=y==="answered"&&(_e==="played"||_e==="correct"||_e==="wrong"),Be=y===!0||Le,ze=!Le;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...je,left:ie-$e/2,top:Ne-$e/2},children:[he&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${_e}`+(he==="once"?" sound-compass__pulse--once":""),style:{width:$e,height:$e,...he==="once"&&d!==void 0?{"--sc-pulse-duration-once":`${d}ms`}:null,...h!==void 0?{"--sc-pulse-scale":String(h)}:null}}),n.jsxs("button",{type:"button",tabIndex:p?0:-1,"aria-disabled":p?void 0:!0,onClick:p?()=>m?.(H.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${_e}`,style:{width:$e,height:$e},"aria-label":de(_e)?`${H.label}, ${de(_e)}`:H.label,"aria-pressed":l!=null?H.id===l:void 0,children:[Be&&ae(_e,De),ze&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:y===!0?le:we},children:q+1})]}),H.shortcut&&n.jsx(Cu,{keys:H.shortcut,anchor:w,className:"sound-compass__speaker-shortcut"})]},H.id)})]})})}function z2({orientation:e="horizontal",label:t,className:a=""}){const r=Ae("divider",`divider--${e}`,t&&e==="horizontal"?"divider--labeled":"",a);return e==="vertical"?n.jsx("div",{className:r,role:"separator","aria-orientation":"vertical"}):t?n.jsxs("div",{className:r,role:"separator","aria-orientation":"horizontal",children:[n.jsx("span",{className:"divider__line"}),n.jsx("span",{className:"divider__label caption-1",children:t}),n.jsx("span",{className:"divider__line"})]}):n.jsx("div",{className:r,role:"separator","aria-orientation":"horizontal"})}function fu({checked:e,onChange:t,name:a,value:r,disabled:s=!1,label:l,className:i=""}){const u=o.useId();return n.jsxs("label",{className:`radio${s?" radio--disabled":""} ${i}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:s,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),l&&n.jsx("span",{className:"radio__label body-2",children:l})]})}function W2({options:e,value:t,onChange:a,name:r,disabled:s=!1,direction:l="vertical",className:i="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${l} ${i}`.trim(),role:"radiogroup","aria-label":u,children:e.map(h=>n.jsx(fu,{name:d,value:h.value,checked:t===h.value,disabled:s||h.disabled,label:h.label,onChange:p=>{p&&a?.(h.value)}},h.value))})}const H2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function V2({tone:e="info",title:t,message:a,children:r,dismissible:s=!1,onDismiss:l,live:i,className:u=""}){const{t:c}=xe.useTranslation(),[d,h]=o.useState(!1),p=o.useRef(null),m=o.useCallback(()=>{const b=p.current;b&&b.contains(document.activeElement)&&hr(b),h(!0),l?.()},[l]);if(d)return null;const g=Ae("alert",`alert--${e}`,u),y=i??(e==="danger"||e==="warning"?"assertive":"polite"),C=y==="assertive"?"alert":y==="polite"?"status":void 0,f=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:g,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(at,{icon:H2[e],size:20,className:"alert__icon"}),f&&n.jsx("span",{className:"alert__title body-2",children:t}),!f&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),f&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),s&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:m,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const q2={ready:"search",guide:"info",error:"circle-alert"};function U2(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let s=0,l=0;for(const i of a){const u=e.indexOf(i,s);u<0||(u>s&&r.push(e.slice(s,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:i},l++)),s=u+i.length)}return s<e.length&&r.push(e.slice(s)),r}function G2({status:e="guide",label:t,children:a,emphasis:r,icon:s,className:l=""}){const i=s===!1?null:s??q2[e],u=Ae("search-summary",`search-summary--${e}`,l),c=t??a,d=typeof c=="string"&&r&&r.length>0?U2(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[i!=null&&n.jsx(at,{icon:i,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Ua({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:s,close:l}=Oa(),i=o.useRef(null),u=_o(!!r,(c,d)=>{c&&d?s(i.current?.querySelector("button")??d):l()},i);return n.jsxs("span",{ref:i,style:{display:"contents"},children:[n.jsx(be,{htmlType:"button",size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!r,ariaLabel:a("common.info","\uC124\uBA85"),onPointerEnter:c=>{ma(c)||s(c.currentTarget)},onPointerLeave:c=>{ma(c)||l()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{Ca()||s(c.currentTarget)},onBlur:l}),r&&n.jsx(Xn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:l})]})}function K2({items:e=[],value:t,onChange:a,className:r="",size:s=40}){const l=o.useId(),{t:i}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,h=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),m=(C,f=p())=>{if(f.length===0)return;const _=(C%f.length+f.length)%f.length;f[_]?.focus(),f[_]?.click()},g=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const f=p(),_=f.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?m(_+1,f):C.key==="ArrowLeft"||C.key==="ArrowUp"?m(_-1,f):C.key==="Home"?m(0,f):m(f.length-1,f)},y=e.find(C=>C.key===d);return n.jsxs("div",{className:`tabs ${r}`.trim(),children:[n.jsx("div",{ref:u,className:`tabs__list tabs__list--${s}`,role:"tablist","aria-label":i("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${l}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${l}-${C.key}`,disabled:C.disabled,tabIndex:C.key===h?0:-1,className:`tabs__tab body-2${C.key===d?" tabs__tab--active":""}`,onClick:()=>{C.key!==t&&a?.(C.key)},onKeyDown:g,children:C.label},C.key))}),y&&n.jsx("div",{id:`tabs__panel-${l}-${y.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${l}-${y.key}`,tabIndex:0,className:"tabs__panel",children:y.panel},y.key)]})}const Y2={xs:12,sm:16,md:20,lg:28,xl:36};function Z2(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.length===1?[...t[0]].slice(0,2).join("").toUpperCase():([...t[0]][0]+[...t[t.length-1]][0]).toUpperCase()}function X2({src:e,name:t,size:a="md",shape:r="circle",className:s=""}){const{t:l}=xe.useTranslation(),[i,u]=o.useState(null),c=!!e&&i===e,d=t?Z2(t):"",h=!!e&&!c,p=!h&&!!d,m=t||l("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${s}`.trim(),role:"img","aria-label":m,children:[h&&n.jsx("img",{className:"avatar__image",src:e,alt:m,onError:()=>u(e??null)}),!h&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!h&&!p&&n.jsx(at,{icon:"user-round",size:Y2[a],className:"avatar__icon"})]})}function J2(e,t){if(!t)return!0;const a=t.split(",").map(l=>l.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),s=e.type.toLowerCase();return a.some(l=>{const i=l.toLowerCase();return i.startsWith(".")?r.endsWith(i):i.endsWith("/*")?s.startsWith(i.slice(0,-1)):s===i})}function Q2({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:s=!0,files:l,onRemove:i,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[h,p]=o.useState(!1),[m,g]=o.useState([]),y=l??m,C=x=>{if(!x||x.length===0)return;const E=Array.from(x).filter(D=>J2(D,t));if(E.length===0)return;const B=a?E:E.slice(0,1);if(l===void 0){const D=a?[...y,...B]:B;g(D),e?.(D)}else e?.(B)},f=x=>{x.preventDefault(),!r&&p(!0)},_=x=>{x.preventDefault(),p(!1)},b=x=>{x.preventDefault(),p(!1),!r&&C(x.dataTransfer.files)},w=x=>{const E=x.target;try{C(E.files)}finally{E.value=""}},v=()=>{r||d.current?.click()},A=x=>{if(!r&&(i?.(x),l===void 0)){const E=y.filter((B,D)=>D!==x);g(E),i||e?.(E)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:Ae("file-upload__dropzone",h&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:v,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),v())},onDragOver:f,onDragLeave:_,onDrop:b,children:[n.jsx(at,{icon:"upload",size:24,className:"file-upload__icon"}),n.jsx("span",{className:"file-upload__prompt body-2",children:c("fileUpload.dragPrompt","\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC")}),n.jsx("button",{type:"button",className:"file-upload__browse-button body-3",disabled:r,onClick:x=>{x.stopPropagation(),v()},children:c("fileUpload.browseButton","\uD30C\uC77C \uC120\uD0DD")}),n.jsx("input",{ref:d,type:"file",className:"file-upload__input",accept:t,multiple:a,disabled:r,onChange:w,tabIndex:-1})]}),s&&y.length>0&&n.jsx("ul",{className:"file-upload__list",children:y.map((x,E)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:x.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:x.name}),disabled:r,onClick:()=>A(E),children:n.jsx(at,{icon:"x",size:14})})]},`${x.name}-${E}`))})]})}function ev({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,s)=>{const l=s===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[l?n.jsx("span",{className:"breadcrumb__current body-3","aria-current":"page",children:r.label}):r.href?n.jsx("a",{className:"breadcrumb__link body-3",href:r.href,target:r.target,rel:r.rel??(r.target==="_blank"?"noopener noreferrer":void 0),onClick:r.onClick,children:r.label}):r.onClick?n.jsx("button",{type:"button",className:"breadcrumb__link body-3",onClick:r.onClick,children:r.label}):n.jsx("span",{className:"breadcrumb__text body-3",children:r.label}),!l&&n.jsx(at,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},s)})})})}const tv={small:14,medium:20,large:28};function nv({value:e,onChange:t,max:a=5,readOnly:r=!1,size:s="medium",ariaLabel:l,className:i=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,h]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,m=d??p,g=tv[s],y=x=>{x!==e&&t?.(x)},C=x=>{c||y(x)},f=x=>{c||Ca()||h(x)},_=o.useRef(null),b=x=>{const E=Math.min(a,Math.max(1,x));y(E),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(B=>B.dataset.star===String(E))?.focus()},w=x=>{if(!c){switch(x.key){case"ArrowRight":case"ArrowUp":b((p||0)+1);break;case"ArrowLeft":case"ArrowDown":b((p||1)-1);break;case"Home":b(1);break;case"End":b(a);break;default:return}x.preventDefault()}},v=p>=1&&p<=a?Math.round(p):1,A=()=>{c||h(null)};return n.jsx("div",{className:`rating rating--${s}${c?" rating--readOnly":""} ${i}`.trim(),ref:_,onKeyDown:w,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):l??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:A,onPointerUp:x=>{x.pointerType==="touch"&&A()},onPointerCancel:x=>{x.pointerType==="touch"&&A()},children:Array.from({length:a},(x,E)=>{const B=E+1,D=Math.max(0,Math.min(1,m-E)),N=D>0&&D<1,k=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(at,{icon:"star",size:g,className:"rating__star rating__star--empty"}),D>0&&n.jsx("span",{className:`rating__star-fill${N?" rating__star-fill--half":""}`,style:N?{width:`${D*100}%`}:void 0,children:n.jsx(at,{icon:"star",size:g,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:k},B):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===B,"aria-label":u("rating.starLabel",{n:B}),"data-star":B,tabIndex:B===v?0:-1,onClick:()=>C(B),onMouseEnter:()=>f(B),children:k},B)})})}const av=20,rv=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function ov({value:e,onChange:t,palette:a=rv,size:r=40,className:s="",ariaLabel:l}){const{t:i}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${s}`.trim(),role:"group","aria-label":l,children:a.map(u=>{const c=e?.toLowerCase()===u.toLowerCase();return n.jsx("button",{type:"button",className:`color-picker__swatch color-picker__swatch--${r}`,style:{backgroundColor:u},onClick:()=>t(u),"aria-pressed":c,"aria-label":c?`${u} ${i("colorPicker.selected","\uC120\uD0DD\uB428")}`:u,children:c&&n.jsx(at,{icon:"check",size:av,className:"color-picker__check"})},u)})})}function bu({icon:e,label:t,tooltip:a,wrapperStyle:r,color:s,bgColor:l,useHover:i=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",h=Ae("category-icon",d?"category-icon--small":""),p=d?16:20,m=o.useRef(null),[g,y]=o.useState(!1),C=o.useMemo(()=>{const B=r&&typeof r=="object"?{...r}:{};return!s&&!l?B:{...B,...s?{color:s,"--t-item-fg":s}:{},...l?{"--t-item-bg":l}:{}}},[r,s,l]),f=a||t,_=i&&!!f,[b,w]=o.useState(null);o.useLayoutEffect(()=>{g&&w(m.current?.getBoundingClientRect()??null)},[g]),o.useEffect(()=>{if(!i&&g)try{y(!1)}catch{}},[i,g]),o.useEffect(()=>{if(!g)return;const B=D=>{const N=m.current;if(!N)return;const k=D.target;k&&!N.contains(k)&&y(!1)};return document.addEventListener("pointerdown",B,!0),()=>document.removeEventListener("pointerdown",B,!0)},[g]);const v=o.useCallback(()=>{i&&y(!0)},[i]),A=o.useCallback(()=>{i&&y(!1)},[i]),x=o.useCallback(()=>y(!1),[]),E=o.useCallback(B=>{if(B.key==="Escape"){y(!1);return}(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y(D=>!D))},[]);return n.jsxs("span",{ref:m,className:Ae("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:v,onPointerLeave:A,onFocus:v,onBlur:A,onKeyDown:E,role:"button",tabIndex:0,"aria-label":typeof f=="string"?c("common.descriptionFor",{name:f,defaultValue:`${f} \uC124\uBA85`}):void 0,"aria-haspopup":!!f,"aria-expanded":g,"data-tooltip-ignore":!0,children:[n.jsx(at,{icon:e,label:t,className:h,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),g&&f&&n.jsx(Tn,{anchorRect:b,text:typeof f=="string"?f:void 0,offset:8,onClose:x,className:"category-icon__tooltip",ariaLabel:typeof f=="string"?f:void 0})]})}let Vn=null;function Ga(e){if(Vn&&Vn!==e)try{Vn()}catch{}return Vn=e,()=>{Vn===e&&(Vn=null)}}function yr(e){if(Vn===e){Vn=null;try{e()}catch{}}}function Ka(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){Bt("one-shot-empty-url","[core] playOneShot \uC5D0 \uBE48 \uC8FC\uC18C\uAC00 \uC654\uB2E4 \u2014 \uC548 \uD2BC\uB2E4. \uBD80\uB974\uB294 \uCABD\uC774 \uC8FC\uC18C\uB97C \uC5BB\uAE30 \uC804\uC5D0 \uBD88\uB800\uB2E4.",new Error("playOneShot(empty)").stack),a(!1);try{t?.(!1)}catch{}return{el:{},stop:()=>{},done:r}}let s=!1;const l=u=>{if(!s){s=!0;try{t?.(u)}catch{}a(u)}};let i;try{i=new Audio(e)}catch{return l(!1),{el:{},stop:()=>{},done:r}}i.onended=()=>l(!0),i.onerror=()=>l(!1);try{i.play().catch(()=>l(!1))}catch{l(!1)}return{el:i,stop:()=>{try{i.pause()}catch{}l(!1)},done:r}}function sv(e,t){if(!e)return{previewCodes:[],previewBucket:null};const a=e,r=i=>i.map(u=>u?.contextCode||u?.context_code).filter(Boolean).map(String);if(t==="LISTEN_IN_NOISE"){const i=a.sentences||a.items||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}if(t==="SHORT_STORY"){const i=a.items||a.sentences||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"SHORT_S"}}if(t==="LONG_STORY"){const i=a.items||a.sentences||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LONG"}}if(t==="ORDERING_SENTENCE"){const i=a.sentences||a.items||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}const s=a.sentences||a.items||[],l=r(Array.isArray(s)?s:[]);return l.length===0&&(a.contextCode||a.context_code)&&l.push(String(a.contextCode||a.context_code)),{previewCodes:l,previewBucket:null}}function lv(e,t){const[a,r]=o.useState(!1),[s,l]=o.useState(-1),[i,u]=o.useState({key:"",urls:[]}),c=o.useRef(null),d=o.useRef(!1),h=o.useRef(null),p=o.useRef(null),[m,g]=o.useState(!1),y=o.useRef([]),{previewCodes:C,previewBucket:f}=sv(e,t),_=`${C.join(",")}|${f??""}`,b=o.useMemo(()=>i.key===_?i.urls:[],[i,_]);o.useEffect(()=>{if(!C.length)return;let v=!1;return(async()=>{const A=[],x=[];for(const E of C)try{const B=Bl(E,f);if(!B){A.push("");continue}let D=null;try{D=await kl(B)}catch{}if(!D)try{const N=await Al(B);N&&(D=URL.createObjectURL(N),x.push(D))}catch{}A.push(D??"")}catch{A.push("")}v?x.forEach(E=>{try{URL.revokeObjectURL(E)}catch{}}):(y.current.forEach(E=>{try{URL.revokeObjectURL(E)}catch{}}),y.current=x,u({key:_,urls:A}))})(),()=>{v=!0}},[C.join(","),f]),o.useEffect(()=>()=>{y.current.forEach(v=>{try{URL.revokeObjectURL(v)}catch{}}),y.current=[]},[]);const w=o.useCallback(async v=>{if(v.stopPropagation(),v.preventDefault(),d.current){h.current&&yr(h.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),l(-1);return}if(!b.filter(Boolean).length)return;let A=null;const x=()=>{d.current=!1,A?.stop()};h.current=x;const E=Ga(x);d.current=!0,r(!0);for(let B=0;B<b.length&&d.current;B++){const D=b[B];if(D&&(l(B),A=Ka(D),c.current=A.el,!await A.done))break}E(),h.current===x&&(h.current=null,d.current=!1,r(!1),l(-1))},[b]);return o.useEffect(()=>()=>{h.current&&yr(h.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:s,previewUrls:b,previewHover:m,setPreviewHover:g,previewBtnRef:p,handlePreview:w}}const iv=e=>{if(!e)return[];const t=typeof e.context=="string"&&e.context.trim()||typeof e.sentence=="string"&&e.sentence.trim()||typeof e.text=="string"&&e.text.trim()||"";if(t)return[String(t)];const a=e.sentences||e.items||e.questions||[];return Array.isArray(a)&&a.length>0?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const s=r;return s.sentence||s.text||s.context||s.question||s.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function $o(e){const{index:t,type:a,trainingData:r,ariaLabel:s,depth:l,renderPopup:i,completed:u,completedIds:c,selectedIds:d,tooltipText:h,useDescriptionTooltip:p=!1,onRemove:m,hideCheckBadge:g=!1,showTypeLabel:y=!1,onComplete:C,onSelect:f,onMore:_,countLabelOverride:b,size:w="square"}=e||{},{t:v}=xe.useTranslation(),[A,x]=o.useState(!1),E=o.useRef(null),[B,D]=o.useState(!1);o.useEffect(()=>{E.current?.matches(":hover")&&D(!0)},[]);const{playing:N,playingIndex:k,previewUrls:P,previewHover:$,setPreviewHover:G,previewBtnRef:T,handlePreview:F}=lv(r,a?.key),M=o.useCallback(()=>{f?f():x(!0)},[f]),Q=o.useCallback(()=>x(!1),[]),Z=o.useCallback(()=>D(!0),[]),I=o.useCallback(()=>D(!1),[]),K=o.useCallback(()=>G(!0),[G]),L=o.useCallback(()=>G(!1),[G]),[W,Y]=o.useState(null);o.useLayoutEffect(()=>{$&&Y(T.current?.getBoundingClientRect()??null)},[$,T]);const[U,j]=o.useState(null);o.useLayoutEffect(()=>{B&&!A&&p&&j(E.current?.getBoundingClientRect()??null)},[B,A,p]);const R=o.useCallback(ke=>{ke.target===ke.currentTarget&&(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),M())},[M]),z=r||null,O=o.useMemo(()=>{if(!p)return null;const ke=h?(Array.isArray(h)?h:[h]).filter(Boolean):null,qe=ke&&ke.length>0?ke:iv(z);return qe&&qe.length>0?qe:null},[p,h,z]),ue=o.useCallback(ke=>{ke.stopPropagation(),m?.()},[m]),te=o.useCallback(ke=>ke.stopPropagation(),[]),de=o.useCallback(ke=>{typeof C=="function"&&C(ke)},[C]),ee=u||(c&&r?.id!=null?c.has(String(r.id)):!1),V=!ee&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Oi("speechear.popup.close",Q);const ae=Zl(),H=`${a?.label||""} ${t+1}`,q=z?.title||z?.name||H;let ie=a?.icon,Ne,_e="",he="";try{const ke=z?.category_0||z?.category_main_code||z?.category_main,qe=z?.category_1||z?.category_sub_code||z?.category_sub,Je=ae.find(tt=>tt.key===ke);Je?.icon&&(ie=Je.icon),!Ne&&Je?.color&&(Ne={"--t-item-fg":Je.color}),!Ne&&z?.iconColor&&(Ne={"--t-item-fg":z.iconColor}),_e=Je?v(`topic.${Je.key}`,{defaultValue:Je.label||""}):"";try{const tt=Je?.subs?.find(xt=>xt.key===qe);he=tt?v(`topic.sub.${tt.key}`,{defaultValue:tt.label||""}):""}catch{}}catch{}const je=he?`${_e} / ${he}`:_e||a?.label||q,$e=ke=>v("training.countQuestions",{n:ke,count:ke}),De=ke=>v("training.countSentences",{n:ke,count:ke});let le="";try{if(z)if(a?.key==="LISTEN_IN_NOISE"){let ke=0;Array.isArray(z.items)&&z.items.length>0?ke=z.items.length:Array.isArray(z.sentences)&&z.sentences.length>0?ke=z.sentences.length:z.sentences&&(ke=1),le=De(ke)}else if(a?.key==="SHORT_STORY"){let ke=1;Array.isArray(r?.items)?ke=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?ke=r.raw.items.length:Array.isArray(z?.questions)?ke=z.questions.length:Array.isArray(z?.sentences)&&(ke=z.sentences.length),le=$e(ke)}else if(a?.key==="LONG_STORY"){let ke=1;if(Array.isArray(z.items)&&z.items.length>0){const qe=z.items.reduce((Je,tt)=>{const xt=tt.questionItems;return Array.isArray(xt)?Je+xt.length:Array.isArray(tt.questions)?Je+tt.questions.length:Je},0);ke=qe>0?qe:z.items.length}else Array.isArray(z.questions)&&z.questions.length>0?ke=z.questions.length:Array.isArray(z.sentences)&&z.sentences.length>0&&(ke=z.sentences.length);le=$e(ke)}else if(a?.key==="ORDERING_SENTENCE"){let ke=1;Array.isArray(z.items)&&z.items.length>0?ke=z.items.length:Array.isArray(z.sentences)&&z.sentences.length>0&&(ke=z.sentences.length),le=De(ke)}else Array.isArray(z.items)&&(le=z.items.length>0?$e(z.items.length):"")}catch{}const we=w==="row",Le=w==="list"||we,Be=w==="compact",ze=w==="small",Ve=ze&&a?.key?qf().find(ke=>ke.key===a.key):void 0,ut=Ve?Xl[Ve.key]:void 0,et=Ve?ut?v(`trainingType.${ut}.title`,{defaultValue:Ve.label}):Ve.label??"":"",Xe=y&&a?.label&&a.label!==String(q)?String(a.label):ze&&et&&et!==String(q)?et:"",yt=!!Xe,Te=b!==void 0?b:le,Ke=[Xe,typeof q=="string"?q:"",Te].map(ke=>String(ke??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:E,className:`training-block-button${Le?" training-block-button--list":""}${we?" training-block-button--row":""}${Be?" training-block-button--compact":""}${ze?" training-block-button--small":""}${ee?" training-block-button--completed":""}${V?" training-block-button--selected":""}${yt&&!ze?" training-block-button--withType":""}${ze&&!yt?" training-block-button--no-type-label":""}`,onClick:M,onPointerEnter:Z,onPointerLeave:I,role:"button",tabIndex:0,onKeyDown:R,"aria-label":typeof s=="string"?s:Ke||void 0,title:!p&&h&&(Array.isArray(h)?h.filter(Boolean).join(`
824
824
  `):h)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[y&&a?.label&&a.label!==String(q)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),ze&&et&&et!==String(q)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:et}),n.jsx(bu,{icon:ie,label:q,tooltip:je,wrapperStyle:Ne,iconSize:ze||Be?"small":"medium"}),!g&&(ee||V)&&!(m&&B)&&n.jsx(En,{className:m?"training-block-button__check--removable":void 0,icon:"check",position:"top-left",size:32,"aria-label":ee?v("training.completed","\uD6C8\uB828 \uC644\uB8CC"):v("training.selected","\uC120\uD0DD\uB428")}),m&&n.jsx(En,{className:`training-block-button__remove${B?" is-hover":""}`,icon:"remove",position:"top-left",size:32,"aria-label":v("common.remove","\uC81C\uAC70"),onClick:ue}),n.jsx("div",{className:`training-block-button__title ${Be?"body-3":ze?"body-3b":"h3"}`,children:String(q)}),n.jsxs("div",{className:"training-block-button__description",children:[Te?n.jsx("div",{className:`training-block-button__count ${ze?"caption-2":"caption-1"}`,children:Te}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(at,{icon:"chevron-right",label:v("training.next","\uB2E4\uC74C"),className:"training-block-button__chevron-icon",imgClassName:"training-block-button__chevron-icon-image",maskClassName:"training-block-button__chevron-icon-mask",svgClassName:"training-block-button__chevron-icon-svg",size:ze?12:20})})]}),(Le&&!we||ze)&&P.length>0&&n.jsx("div",{ref:T,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:te,onPointerEnter:K,onPointerLeave:L,children:n.jsx(be,{htmlType:"button",size:ze?28:32,type:"dot",icon:N?"pause":"play",variant:ze?"transparent-lightGray":"default",useBorder:!1,selected:N,ariaLabel:String(q).trim()?N?v("training.stopFor",{name:q,defaultValue:`${q} \uC815\uC9C0`}):v("training.previewFor",{name:q,defaultValue:`${q} \uBBF8\uB9AC \uB4E3\uAE30`}):N?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:F})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:ke=>{ke.stopPropagation(),_(ke)},children:n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(q).trim()?v("common.moreFor",{name:q}):v("common.more","\uB354\uBCF4\uAE30")})})]}),$&&n.jsx(Tn,{anchorRect:W,text:N?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:L}),B&&!A&&p&&(O?n.jsx(Xn,{anchorRect:U,items:O,activeIndex:k,onClose:I}):z?.subTitle?n.jsx(Tn,{anchorRect:U,text:z.subTitle,offset:8,onClose:I}):null),A&&i&&i({trainingData:z,typeKey:a?.key??"",onClose:Q,onComplete:de,popupTitle:String(q),popupSubTitle:a?.subTitle,depth:l!=null?String(l):void 0,popupIcon:ie,popupIconTooltip:String(je),popupWrapperStyle:Ne})]})}const gu=200;function uv(e){return e.itemId?(Zf()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function yu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:s}){const{t:l}=xe.useTranslation(),i=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):Jf(l).map(c=>{const d=(e?.items??[]).filter(h=>h.trainingType===c.key);return{key:c.key,label:c.label,type:c,pickedCount:d.length,data:d.map(uv).filter(h=>h!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,l]);if(i.length===0)return null;const u=n.jsx("div",{className:se("training-tooltip__box"),children:n.jsx("div",{className:se("training-tooltip__groups"),children:i.flatMap(({key:c,label:d,type:h,data:p},m)=>[m>0?n.jsx("div",{className:se("training-tooltip__divider")},`div-${c}`):null,n.jsxs("div",{className:se("training-tooltip__section"),children:[n.jsx("div",{className:se("training-tooltip__section-header"),children:n.jsx("span",{className:se("training-tooltip__type-label body-3b"),children:d})}),n.jsx("div",{className:se("training-tooltip__items"),children:p.map((g,y)=>n.jsx($o,{index:y,type:h,trainingData:g,size:"compact",hideCheckBadge:!0},String(g.id??y)))})]},c)])})});return a?n.jsx(wn,{anchorRect:a,offset:r,onClose:s,closeOnOutsideClick:!1,className:se("training-tooltip"),ariaLabel:l("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const cv=200;function dv({icon:e,count:t,title:a,plan:r,tooltip:s=!0,hoverAccent:l=!1,className:i="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const h=!!u||!!c||s&&!!r,p=Ae("count-tile",h&&"count-tile--interactive",h&&l&&"count-tile--accent",u&&"count-tile--clickable",i),m=o.useRef(null),[g,y]=o.useState(null),C=o.useRef(null),f=o.useRef(null),_=!!(g&&r&&s),b=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),w=o.useCallback(()=>{b(),y(null)},[b]),v=o.useCallback(()=>{!s||!r||(b(),C.current=setTimeout(()=>{C.current=null,y(m.current?.getBoundingClientRect()??null)},gu))},[s,r,b]),A=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!f.current&&(f.current=setTimeout(()=>{f.current=null,y(null)},cv))},[]);return o.useEffect(()=>()=>{b()},[b]),o.useEffect(()=>{(!s||!r)&&w()},[s,r,w]),o.useEffect(()=>{if(!_)return;const x=B=>B instanceof Element&&(m.current?.contains(B)||!!B.closest(".training-tooltip")),E=B=>{x(B.target)?b():A()};return document.addEventListener("pointerover",E,!0),()=>document.removeEventListener("pointerover",E,!0)},[_,b,A]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:m,className:p,onClick:u?x=>{w(),u(x)}:void 0,onKeyDown:u?x=>{x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),x.currentTarget.click())}:void 0,onPointerEnter:x=>{x.pointerType==="touch"||x.pointerType==="pen"?w():v()},onMouseEnter:c,onMouseLeave:x=>{A(),d?.(x)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(at,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),g&&r&&n.jsx(yu,{plan:r,anchorRect:g,onClose:w})]})}let Ya=0,vu="",Ro="",Za=0;function _u(){return xu(!1)}function pv(){return xu(!0)}function xu(e){const t=typeof document<"u";Ya===0&&t&&(vu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(Za===0&&(Ro=document.body.style.paddingRight),Za++,document.body.style.paddingRight="0px"),Ya++;let a=!1;return()=>{a||(a=!0,Ya=Math.max(0,Ya-1),e&&t&&(Za=Math.max(0,Za-1),Za===0&&(Ro?document.body.style.paddingRight=Ro:document.body.style.removeProperty("padding-right"))),Ya===0&&t&&(document.body.style.overflow=vu))}}function hv(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,children:n.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function mv({open:e,onClose:t,ariaLabel:a,title:r,children:s,size:l="md",closeOnBackdrop:i=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:h}){const{t:p}=xe.useTranslation(),m=o.useId(),g=o.useRef(null),y=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const b=document.activeElement,w=_u(),v=g.current;return bo(v,b),v?.focus(),()=>{w();const A=document.activeElement;(!A||A===document.body||v&&v.contains(A))&&go(b)?.focus?.()}},[e]);const C=o.useRef(y),f=o.useRef(u);o.useEffect(()=>{C.current=y,f.current=u}),o.useEffect(()=>{if(e)return Zn(()=>{f.current&&C.current()})},[e]);const _=o.useRef(!1);return Co(g,e),!e||typeof document>"u"?null:pn.createPortal(n.jsx("div",{className:Ae("dialog",d),onPointerDown:i?b=>{_.current=b.target===b.currentTarget}:void 0,onMouseDown:b=>{b.target===b.currentTarget&&b.preventDefault()},onClick:i?b=>{const w=_.current;_.current=!1,w&&b.target===b.currentTarget&&y()}:void 0,children:n.jsxs("div",{ref:g,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?m:void 0,tabIndex:-1,className:Ae("dialog__surface",`dialog__surface--${l}`,h),onClick:b=>b.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:m,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:y,children:n.jsx(hv,{})}):null,n.jsx("div",{className:"dialog__body",children:s})]})}),document.body)}function Cv({columns:e,rows:t,rowKey:a,title:r,toolbar:s,empty:l,loading:i,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),h=!i&&t.length===0;return n.jsxs("div",{className:Ae("board",c),children:[r||s?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),s?n.jsx("div",{className:"board__toolbar",children:s}):null]}):null,n.jsxs("table",{className:"board__table",children:[u?n.jsx("caption",{className:"board__caption",children:u}):null,n.jsx("thead",{children:n.jsx("tr",{children:e.map(p=>n.jsx("th",{scope:"col",className:Ae("board__th",`board__cell--${p.headerAlign??p.align??"left"}`),style:p.width?{width:p.width}:void 0,children:p.header},p.key))})}),n.jsx("tbody",{children:i?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:i})}):h?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:l??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,m)=>n.jsx("tr",{className:"board__row",children:e.map(g=>n.jsx("td",{className:Ae("board__td",`board__cell--${g.align??"left"}`),children:g.render(p,m)},g.key))},a(p,m)))})]})]})}function fv({name:e,role:t,photo:a,media:r,credentials:s,size:l=190,className:i=""}){return n.jsxs("div",{className:Ae("person-card",i),children:[n.jsx("div",{className:"person-card__photo",style:{width:l,height:l},children:r??(a?n.jsx("img",{src:a,alt:t?`${e} ${t}`:e}):null)}),n.jsx("h3",{className:"person-card__name",children:e}),t?n.jsx("p",{className:"person-card__role",children:t}):null,s?.length?n.jsx("ul",{className:"person-card__credentials",children:s.map(u=>n.jsx("li",{children:u},u))}):null]})}function bv({groups:e,className:t=""}){return n.jsx("div",{className:Ae("timeline",t),children:e.map(a=>n.jsxs("section",{className:"timeline__group",children:[n.jsx("h3",{className:"timeline__title",children:a.title}),n.jsx("ul",{className:"timeline__rows",children:a.entries.map((r,s)=>n.jsxs("li",{className:"timeline__row",children:[r.label?n.jsx("span",{className:"timeline__label",children:r.label}):null,n.jsx("div",{className:"timeline__items",children:r.items.map((l,i)=>n.jsx("p",{children:l},i))})]},`${r.label??""}-${s}`))})]},a.title))})}function gv({title:e,kind:t,body:a,badge:r,badgeSrc:s,footer:l,width:i,className:u=""}){const c=r??(s?n.jsx("img",{src:s,alt:""}):null);return n.jsxs("div",{className:Ae("publication-card",u),style:i?{width:i,flexShrink:0}:void 0,children:[c?n.jsx("div",{className:"publication-card__badge","aria-hidden":"true",children:c}):null,n.jsx("h3",{className:"publication-card__title",children:e}),t?n.jsx("p",{className:"publication-card__kind",children:t}):null,n.jsx("p",{className:"publication-card__body",children:a}),l?n.jsx("div",{className:"publication-card__footer",children:l}):null]})}function yv({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const s=Fa(a);return o.useEffect(()=>{const l=setTimeout(()=>s.current?.(),r);return()=>clearTimeout(l)},[r,s]),n.jsx("div",{className:"splash-logo",style:{"--splash-logo-duration":`${r}ms`},"aria-hidden":"true",children:n.jsx("img",{src:e,alt:t,className:"splash-logo__image"})})}function vv({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:s=2,tone:l="dark",className:i=""}){const u=s===1?"h1":"h2";return n.jsxs("div",{className:Ae("section-header",`section-header--${l}`,i),children:[e?n.jsxs("p",{className:"section-header__eyebrow",children:[t?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"section-header__index",children:t}),n.jsx("span",{"aria-hidden":!0,className:"section-header__rule"})]}):null,e]}):null,a?n.jsx(u,{className:"section-header__title",children:a}):null,r?n.jsx("div",{className:"section-header__description",children:r}):null]})}function _v({items:e,className:t=""}){return n.jsx("ul",{className:Ae("company-meta",t),children:e.map((a,r)=>n.jsxs("li",{className:"company-meta__item",children:[r>0?n.jsx("span",{"aria-hidden":!0,className:"company-meta__divider",children:"|"}):null,a]},a))})}const Xa=new Map;function vn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(v=>!v.disabled)?.key??a[0]?.key,onChange:s=v=>{},className:l="",size:i=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:h,ariaLabel:p}=e||{},m=o.useRef(null),g=a.filter(v=>!v.disabled),y=o.useId(),C=a.map(v=>v.key).join("\xB7");o.useEffect(()=>{if(!(!On||p!=null&&p!=="")){if(Xa.set(y,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Xa.size>1){const v=[...Xa.values()].sort();Bt(`segmented-control-unnamed:${v.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Xa.size} \uAC1C \uC11C \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uB0AD\uB3C5\uAE30\uB294 \uBAA8\uB450 "\uC120\uD0DD \uD0ED" \uC73C\uB85C \uC77D\uC5B4 \uC5B4\uB290 \uAC83\uC774 \uBB34\uC5C7\uC778\uC9C0 \uAC00\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ariaLabel \uC744 \uC8FC\uC138\uC694. \uC9C0\uAE08 \uC120 \uAC83(\uBCF4\uAE30 \uC774\uB984\uC73C\uB85C \uC801\uC74C): ${v.join(" / ")}`)}return()=>{Xa.delete(y)}}},[p,C,y]);const f=v=>{if(!g.length)return;const A=Math.max(0,g.findIndex(E=>E.key===r)),x=v==="first"?g[0]:v==="last"?g[g.length-1]:g[(A+v+g.length)%g.length];x&&(s(x.key),Array.from(m.current?.querySelectorAll("[data-segkey]")??[]).find(E=>E.dataset.segkey===x.key)?.focus())},_=v=>{switch(v.key){case"ArrowRight":case"ArrowDown":f(1);break;case"ArrowLeft":case"ArrowUp":f(-1);break;case"Home":f("first");break;case"End":f("last");break;default:return}v.preventDefault()},b=v=>{const A=x=>typeof x=="string"||typeof x=="number";if(!(!A(v.label)||v.count==null||v.count===!1||!A(v.count)))return`${v.label}, ${v.count}`},w=g.some(v=>v.key===r)?r:g[0]?.key;return n.jsx("div",{ref:m,onKeyDown:_,className:Ae("segmented-control",`segmented-control--${u}`,`segmented-control--${i}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",h!=null&&"segmented-control--min",l),style:h!=null?{"--segmented-min-button-w":`${h}px`}:void 0,role:"radiogroup","aria-label":p??t("segmentedControl.ariaLabel","\uC120\uD0DD \uD0ED"),children:a.map(v=>n.jsx(be,{htmlType:"button",role:"radio","aria-checked":v.key===r,"data-segkey":v.key,tabIndex:v.key===w?0:-1,label:v.label,count:v.count,ariaLabel:b(v),disabled:v.disabled,className:v.key===r?"is-selected":"",onClick:()=>{v.disabled||s(v.key)},size:i,shape:u,useBorder:!1,useBG:!1},v.key))})}const xv=260;function Rn(e){const{t}=xe.useTranslation(),{title:a,subtitle:r,headerActions:s,headerSegment:l,children:i,buttons:u,footer:c,footerStart:d,footerEnd:h,footerNote:p,footerNoteDivider:m=!1,footerClassName:g="",footerLayout:y="center",onClose:C,closeDisabled:f=!1,beforeClose:_,closeOnBackdrop:b=!0,className:w="",ariaLabel:v,useTitle:A=!0,inline:x=!1,size:E,layer:B="modal",height:D,fillBody:N=!1,resetScrollKey:k}=e||{},[P,$]=o.useState(!1),G=o.useRef(!1),T=o.useRef(null),F=o.useId(),M=o.useRef(null);o.useEffect(()=>{},[x,a,v,w]),o.useEffect(()=>{k!==void 0&&M.current&&(M.current.scrollTop=0)},[k]);const[Q,Z]=o.useState(!1);o.useEffect(()=>{const V=M.current;if(!V)return;const ae=()=>Z(V.scrollHeight>V.clientHeight+1);if(ae(),typeof ResizeObserver>"u")return;const H=new ResizeObserver(ae);H.observe(V);const q=V.firstElementChild;return q&&H.observe(q),()=>H.disconnect()},[i,k]),o.useEffect(()=>{if(!x)return _u()},[x]);const I=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{if(x)return;const V=I.current,ae=T.current;return bo(ae,V),ae&&!ae.contains(document.activeElement)&&(ae.querySelector(Nn)??ae).focus(),()=>{const H=document.activeElement;(!H||H===document.body||ae&&ae.contains(H))&&go(V)?.focus?.()}},[x]),Co(T,!x);const K=o.useRef(!0),L=yo(),W=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,W.current&&(clearTimeout(W.current),W.current=null)}),[]);const Y=o.useCallback(()=>{!K.current||!G.current||(G.current=!1,$(!1))},[]),U=o.useCallback((V,ae=!1)=>{if(ae&&!K.current||G.current)return;G.current=!0,$(!0);const H=setTimeout(()=>{W.current===H&&(W.current=null);let q;try{q=V?V():void 0}catch{Y();return}q&&typeof q.then=="function"&&q.then(()=>{setTimeout(Y,120)},Y)},L?0:xv);ae&&(W.current=H)},[Y,L]),j=o.useCallback(()=>{f||_&&_()===!1||U(C,!0)},[U,C,f,_]),R=o.useRef(j);o.useEffect(()=>{R.current=j});const z=!x&&!!C;o.useEffect(()=>{if(z)return Zn(()=>R.current())},[z]);const O=z&&b,ue=o.useRef(!1),te=V=>{ue.current=V.target===V.currentTarget},de=V=>{const ae=ue.current;ue.current=!1,ae&&V.target===V.currentTarget&&j()},ee=n.jsx("div",{className:`popup ${x?"popup--inline":""} ${B==="belowPagePopup"?"popup--below-page-popup":""} ${P?"popup--closing":""} ${w}`,onPointerDown:O?te:void 0,onClick:O?de:void 0,onMouseDown:x?void 0:V=>{V.target===V.currentTarget&&V.preventDefault()},children:n.jsxs("div",{ref:T,className:`popup-panel${E?` popup-panel--${E}`:""}${D!=null?" popup-panel--has-height":""}${N?" popup-panel--fill-body":""}`,style:D!=null?{"--popup-height":typeof D=="number"?`${D}px`:D}:void 0,tabIndex:-1,role:x?void 0:"dialog","aria-modal":x?void 0:!0,"aria-labelledby":!x&&A&&a?F:void 0,"aria-label":!x&&!(A&&a)?v??(typeof a=="string"?a:void 0):void 0,children:[!A&&(s||C)?n.jsxs("div",{className:"popup-close-float",children:[s,C&&n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:j,disabled:f,ariaLabel:t("common.close","\uB2EB\uAE30")})]}):a||s||C?n.jsxs("div",{className:`popup-header${r?" popup-header--with-subtitle":""}`,children:[n.jsxs("div",{className:"popup-header-main",children:[a?n.jsx("h2",{id:F,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:F,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),n.jsxs("div",{className:"popup-header-aside",children:[l&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(vn,{size:40,ariaLabel:l.ariaLabel,options:l.options.map(V=>({key:V.key,label:V.label,disabled:V.disabled})),value:l.value,onChange:l.onChange})}),n.jsxs("div",{className:"popup-header-actions",children:[s,C&&n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:j,disabled:f,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]})]}):null,n.jsx("div",{className:"popup-content",ref:M,tabIndex:Q?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof i=="function"?i({animateThen:U,closeWithAnimation:j}):i})}),p!=null&&p!==!1&&n.jsx("div",{className:`popup-footer-note caption-1${m?" popup-footer-note--divider":""}`,role:"note",children:p}),d||h?n.jsxs("div",{className:`popup-footer popup-footer--bar${g?` ${g}`:""}`,children:[n.jsx("div",{className:"popup-footer__start",children:typeof d=="function"?d({animateThen:U,closeWithAnimation:j}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof h=="function"?h({animateThen:U,closeWithAnimation:j}):h})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${y!=="center"?` popup-footer--${y}`:""}`,children:u.map((V,ae)=>n.jsx(be,{htmlType:"button",size:48,variant:V.variant??"default",label:V.label,disabled:V.disabled,onClick:()=>V.onClick?.({animateThen:U,closeWithAnimation:j})},ae))}):c?n.jsx("div",{className:`popup-footer${y!=="center"?` popup-footer--${y}`:""}${g?` ${g}`:""}`,children:typeof c=="function"?c({animateThen:U,closeWithAnimation:j}):c}):null]})});return x||typeof document>"u"?ee:pn.createPortal(ee,document.body)}function wu({checked:e,onChange:t,disabled:a=!1,label:r,ariaLabel:s,labelPosition:l="right",className:i="",id:u}){const c=r&&n.jsx("span",{className:"toggle__label body-3",children:r});return n.jsxs("label",{className:`toggle${a?" toggle--disabled":""} ${i}`.trim(),children:[l==="left"&&c,n.jsx("input",{id:u,type:"checkbox",role:"switch",checked:e,disabled:a,onChange:d=>t?.(d.target.checked),"aria-label":!r&&s?s:void 0}),n.jsx("span",{className:"toggle__slider"}),l==="right"&&c]})}function _n({options:e,value:t,onChange:a,placeholder:r,disabled:s=!1,block:l=!1,size:i=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:h}){const{t:p}=xe.useTranslation(),m=r??p("dropdown.placeholder","\uC120\uD0DD"),g=o.useId(),y=o.useId(),C=o.useRef(null),f=o.useCallback((T,F)=>{const M=window.innerHeight-T.bottom<260&&T.top>260;return{position:"fixed",left:T.left,minWidth:T.width,...M?{bottom:window.innerHeight-T.top+6}:{top:T.bottom+6},zIndex:za(F)}},[]),{open:_,setOpen:b,toggle:w,style:v,triggerRef:A,menuRef:x}=Wa({computeStyle:f}),[E,B]=o.useState(-1),D=o.useCallback(()=>B(-1),[]),N=e.find(T=>T.value===t);o.useEffect(()=>{if(_){const T=e.findIndex(F=>F.value===t);B(T>=0?T:e.length?0:-1),requestAnimationFrame(()=>{const F=x.current;if(!F)return;const M=F.querySelectorAll(".dropdown__option")[T];M&&(F.scrollTop=Math.max(0,M.offsetTop-F.clientHeight/2+M.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&B(T=>{if(T>=0&&T<e.length)return T;const F=e.findIndex(M=>M.value===t);return F>=0?F:e.length?0:-1})},[_,e.length]);const k=o.useCallback(()=>{s||w()},[s,w]),P=o.useCallback(T=>{T.disabled||s||(T.value!==t&&a?.(T.value),b(!1))},[a,b,s,t]);o.useEffect(()=>{s&&b(!1)},[s,b]);const $=o.useCallback(T=>{if(!s){if(!_){(T.key==="Enter"||T.key===" "||T.key==="ArrowDown")&&(T.preventDefault(),b(!0));return}if(T.key==="Escape"){T.preventDefault(),b(!1);return}T.key==="ArrowDown"?(T.preventDefault(),B(F=>{let M=F+1;for(;M<e.length&&e[M].disabled;)M++;return M<e.length?M:F})):T.key==="ArrowUp"?(T.preventDefault(),B(F=>{let M=F-1;for(;M>=0&&e[M].disabled;)M--;return M>=0?M:F})):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),e[E]?P(e[E]):b(!1))}},[s,_,e,E,P,b]),G=_?n.jsx("div",{ref:x,id:g,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:v,onMouseLeave:D,onMouseDown:T=>T.preventDefault(),children:e.map((T,F)=>n.jsxs("button",{id:`${g}-option-${F}`,type:"button",role:"option","aria-selected":T.value===t,className:Ae("dropdown__option body-2",T.value===t?"dropdown__option--active":"",F===E?"dropdown__option--active":"",T.disabled?"dropdown__option--disabled":""),onMouseDown:M=>M.preventDefault(),onClick:()=>P(T),onMouseEnter:()=>B(F),disabled:T.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:T.value===t&&n.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2 7 5.5 10.5 12 3.5"})})}),T.label]},T.value))}):null;return n.jsxs("div",{ref:C,className:Ae("dropdown",`dropdown--s${i}`,_?"dropdown--open":"",l?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:$,children:[n.jsxs("button",{ref:A,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?g:void 0,"aria-activedescendant":_&&E>=0?`${g}-option-${E}`:void 0,"aria-label":d,"aria-describedby":[d&&N?y:"",h??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:s,onClick:k,onBlur:T=>{_&&!x.current?.contains(T.relatedTarget)&&b(!1)},children:[n.jsx("span",{id:y,className:`dropdown__trigger-label body-2${N?"":" dropdown__trigger-label--placeholder"}`,children:N?N.label:m}),n.jsx("svg",{className:"dropdown__chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"4 6 8 10 12 6"})})]}),typeof document<"u"&&pn.createPortal(G,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}const wv={hearingAid:"hearingAid",cochlearImplant:"cochlearImplant",other:"other",\uBCF4\uCCAD\uAE30:"hearingAid",\uC778\uACF5\uC640\uC6B0:"cochlearImplant",\uAE30\uD0C0:"other"};function Bu(e){return e?wv[e]??null:null}function ku(e){switch(Bu(e)){case"hearingAid":return"main";case"cochlearImplant":return"sub";default:return"default"}}function Au(e,t){const a=Bu(e);return a?t(`device.type.${a}`,{defaultValue:e??""}):e??""}const ba=e=>e==null?"":String(e).trim();function Po(e,t,a,r){const s=ba(e),l=ba(t),i=ba(a);if(r&&s&&l&&i){const c=`${s.padStart(4,"0")}-${l.padStart(2,"0")}-${i.padStart(2,"0")}`,d=new Date(c);if(!Number.isNaN(d.getTime())&&d.toISOString().slice(0,10)===c){const h=Vl(c,r);if(h)return h}}const u=[s,l,i];for(;u.length>0&&u[u.length-1]==="";)u.pop();return u.join(".")}function Bv(e,t,a){const r=ba(e);return r?`${r}-${ba(t).padStart(2,"0")}-${ba(a).padStart(2,"0")}`:""}function Nu(e){return typeof e=="string"?e:e.label}function Eu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:s,onSelectSuggestion:l,autoActiveFirst:i=!1}){const u=o.useId(),[c,d]=o.useState(!1),[h,p]=o.useState(-1),m=o.useRef(null),g=o.useMemo(()=>{if(!a.length)return[];const k=e??"";return s===!1?a:k?typeof s=="function"?s(a,k):a.filter(P=>Nu(P).toLowerCase().includes(k.toLowerCase())):r?a:[]},[a,e,r,s]),[y,C]=o.useState(!1),f=o.useRef([]),_=y&&g.length===0?f.current:g;o.useEffect(()=>{_.length&&(f.current=_)},[_]);const b=o.useCallback(()=>C(!0),[]),w=o.useCallback(()=>C(!1),[]),v=i?0:-1;o.useEffect(()=>{c||p(v)},[c,v]),o.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const A=h<_.length?h:v<_.length?v:-1,x=o.useCallback(k=>{l?l(k):t?.(Nu(k)),d(!1)},[t,l]),E=o.useCallback(()=>d(!0),[]),B=o.useCallback(()=>{d(!0),p(v)},[v]),D=o.useCallback(()=>{m.current=setTimeout(()=>d(!1),120)},[]),N=o.useCallback(k=>{k.nativeEvent.isComposing||k.keyCode===229||(k.key==="ArrowDown"?(k.preventDefault(),d(!0),p(P=>Math.min(_.length-1,(P<_.length?P:v)+1))):k.key==="ArrowUp"?(k.preventDefault(),p(P=>Math.max(v,(P<_.length?P:_.length)-1))):k.key==="Enter"?A>=0&&x(_[A]):k.key==="Escape"&&c&&(k.preventDefault(),d(!1)))},[_,A,c,x,v]);return{listId:u,open:c,activeIdx:A,filtered:_,handleFocus:E,handleBlur:D,handleInput:B,handleKeyDown:N,handleSelect:x,handleCompositionStart:b,handleCompositionEnd:w}}const Fo=typeof window<"u"?o.useLayoutEffect:o.useEffect;function qn(e){const{value:t,defaultValue:a,name:r,inputRef:s,onChange:l,label:i,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:h,ghostText:p,ghostHint:m,type:g="text",disabled:y=!1,readOnly:C=!1,error:f,helperText:_,maxLength:b,size:w=40,variant:v="input",fullWidth:A=!1,newline:x=!1,multiline:E=!1,rows:B=3,leftIcon:D,rightIcon:N,clearable:k=!1,list:P,showCount:$=!0,className:G="",onFocus:T,onBlur:F,onKeyDown:M,onEnter:Q,inputMode:Z,autoComplete:I,autoFocus:K,suggestions:L,filterSuggestions:W,onSelectSuggestion:Y,autoActiveFirst:U,openOnFocus:j=!1}=e,R=C||y?void 0:L,{t:z}=xe.useTranslation(),O=o.useId();!i&&!u&&Bt(`TextField:unnamed:${O}`,"[ihab/TextField] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 label \uC774\uB098 ariaLabel \uC911 \uD558\uB098\uB97C \uC8FC\uC138\uC694. placeholder \uB294 \uC774\uB984\uC744 \uB300\uC2E0\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4.");const ue=`tf-${O}`,te=`tf-helper-${O}`,de=o.useRef(null),ee=Eu({value:t??"",onChange:l,suggestions:R??[],openOnFocus:j,filterSuggestions:W,onSelectSuggestion:Y,autoActiveFirst:U}),V=!!R&&ee.open&&ee.filtered.length>0,ae=o.useRef(null),[H,q]=o.useState(null),ie=o.useCallback(()=>{const Te=ae.current;if(!Te||typeof window>"u")return;const Ke=Te.getBoundingClientRect(),ke=230,qe=window.innerHeight-Ke.bottom<ke+8&&Ke.top>ke+8;q({position:"fixed",left:Ke.left,width:Ke.width,...qe?{bottom:window.innerHeight-Ke.top+8}:{top:Ke.bottom+8},zIndex:za(Te)})},[]);Fo(()=>{if(!V)return;ie();let Te=null;const Ke=()=>{if(typeof requestAnimationFrame>"u"){ie();return}Te===null&&(Te=requestAnimationFrame(()=>{Te=null,ie()}))},ke=qe=>{const Je=qe.target;Je&&Je.nodeType===1&&Je.closest?.(".text-field__suggestions")||Ke()};return window.addEventListener("scroll",ke,!0),window.addEventListener("resize",Ke),()=>{Te!==null&&cancelAnimationFrame(Te),window.removeEventListener("scroll",ke,!0),window.removeEventListener("resize",Ke)}},[V,ie]);const Ne=o.useCallback(Te=>{de.current=Te,typeof s=="function"?s(Te):s&&(s.current=Te)},[s]),_e=p?`${p}${m??z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:h,he=t!==void 0,je=he&&g==="password",[$e,De]=o.useState((a??"").length),le=he?(t??"").length:$e,we=o.useRef(t);Fo(()=>{we.current=t}),o.useEffect(()=>{const Te=de.current;if(!je||!Te)return;const Ke=t??"";Te.value!==Ke&&(Te.value=Ke)},[je,t]),o.useEffect(()=>{if(!x||!de.current)return;const Te=de.current;Te.style.height="",Te.scrollHeight>Te.clientHeight&&(Te.style.height=`${Te.scrollHeight}px`)},[t,$e,x]);const Le=b!=null&&le>b,Be=w===32?16:20,ze=Ae("text-field",`text-field--s${w}`,v==="display"?"text-field--display":"",A?"text-field--full-width":"",y?"text-field--disabled":"",C?"text-field--readonly":"",f?"text-field--error":"",D?"text-field--has-left-icon":"",N||k?"text-field--has-right-icon":"",G),Ve={id:ue,...je?{}:he?{value:t}:{defaultValue:a},ref:Ne,placeholder:_e,name:r,disabled:y,readOnly:C,autoFocus:K,maxLength:b,list:P,inputMode:Z,autoComplete:I,"aria-label":!i&&u?u:void 0,"aria-required":d,"aria-invalid":!!f,"aria-describedby":[_||f?te:null,c].filter(Boolean).join(" ")||void 0,role:R?"combobox":void 0,"aria-autocomplete":R?"list":void 0,"aria-haspopup":R?"listbox":void 0,"aria-expanded":R?V:void 0,"aria-controls":V?ee.listId:void 0,"aria-activedescendant":V&&ee.activeIdx>=0?`${ee.listId}-option-${ee.activeIdx}`:void 0,onChange:Te=>{const Ke=Te.target;he||De(Ke.value.length),l?.(Ke.value),R&&ee.handleInput(),je&&queueMicrotask(()=>{const ke=we.current??"";Ke.value!==ke&&(Ke.value=ke)})},onCompositionStart:R?ee.handleCompositionStart:void 0,onCompositionEnd:R?ee.handleCompositionEnd:void 0,onFocus:(Te=>{T?.(Te),R&&ee.handleFocus()}),onBlur:(Te=>{F?.(Te),R&&ee.handleBlur()}),onKeyDown:(Te=>{const Ke=(Te.key==="Tab"&&!Te.shiftKey||Te.key===" ")&&!Te.nativeEvent.isComposing;if(p&&Ke&&!C&&!y&&!(Te.currentTarget.value??"").trim()){Te.preventDefault();const ke=Te.currentTarget;he||(ke.value=p,De(p.length)),l?.(p);return}R&&Te.key==="Enter"&&!Te.nativeEvent.isComposing&&ee.activeIdx>=0?Te.preventDefault():Q&&Te.key==="Enter"&&!Te.nativeEvent.isComposing&&(Te.preventDefault(),Q()),M?.(Te),R&&ee.handleKeyDown(Te)})},ut=k&&!y&&!C&&le>0,et=()=>x?n.jsx("textarea",{...Ve,className:"text-field__input text-field__input--auto body-2",rows:1}):E?n.jsx("textarea",{...Ve,className:"text-field__input text-field__input--textarea body-2",rows:B}):n.jsx("input",{...Ve,type:g,className:"text-field__input body-2"}),Xe=v==="display"&&!x&&!E&&!!_e,yt=()=>n.jsxs(n.Fragment,{children:[et(),Xe&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:_e})]});return n.jsxs("div",{ref:ae,className:ze,children:[i&&n.jsxs("label",{htmlFor:ue,className:"text-field__label caption-1",children:[i,d&&n.jsx("span",{className:"text-field__required",children:"*"})]}),n.jsxs("div",{className:"text-field__wrap",children:[D&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(at,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Be})}),yt(),b!=null&&$&&n.jsxs("span",{className:`text-field__count caption-2${Le?" text-field__count--over":""}`,children:[le,"/",b]}),ut&&n.jsx(be,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:z("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:Te=>{Te.preventDefault()},onClick:()=>{!he&&de.current&&(de.current.value="",De(0)),l?.("")},tabIndex:-1}),N&&!ut&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(at,{icon:N,label:"",className:"",svgClassName:"text-field__icon-svg",size:Be})})]}),!!R&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ee.open&&(t??"").length>0&&ee.filtered.length===0?z("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),V&&(typeof document>"u"?null:pn.createPortal(n.jsx("ul",{id:ee.listId,className:"text-field__suggestions",role:"listbox",style:H??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ee.filtered.map((Te,Ke)=>n.jsx("li",{id:`${ee.listId}-option-${Ke}`,role:"option","aria-selected":Ke===ee.activeIdx,className:`text-field__suggestion body-2${Ke===ee.activeIdx?" is-active":""}`,onMouseDown:ke=>ke.preventDefault(),onClick:()=>{ee.handleSelect(Te),de.current?.focus()},children:typeof Te=="string"?Te:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:Te.label}),Te.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:Te.hint})]})},typeof Te=="string"?`${Te}-${Ke}`:Te.id))}),document.body)),(_||f)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:te,className:"text-field__helper caption-1",role:f?"alert":void 0,children:f||_})})]})}const Du=()=>{};function sn(e){const t=o.useId();if(!("variant"in e)){const{label:b,sub:w,onClick:v,children:A,align:x="horizontal",icon:E,useFullWidth:B=!1}=e,D=N=>{v&&N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),v())};return n.jsxs("div",{className:Ae("panel-row",x==="vertical"?"panel-row--vertical":"",B?"panel-row--label-fixed panel-row--fill":"",v?"panel-row--clickable":""),onClick:v,onKeyDown:v?D:void 0,role:v?"button":void 0,tabIndex:v?0:void 0,children:[E!=null&&n.jsx("div",{className:"panel-row__icon",children:E}),b!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:b}),w&&n.jsx("div",{className:"panel-row__sub caption-1",children:w})]}),n.jsx("div",{className:"panel-row__right",children:A})]})}if(e.variant==="description")return n.jsx("div",{className:"panel-row panel-row--block",children:n.jsx("p",{className:"panel-row__description body-3",children:e.children})});if(e.variant==="empty")return n.jsx("div",{className:"panel-row panel-row--empty body-3",children:e.children});if(e.variant==="loading")return n.jsx("div",{className:"panel-row panel-row--loading",children:n.jsx(pa,{size:28})});if(e.variant==="custom"&&!e.label)return n.jsx("div",{className:"panel-row panel-row--block",children:e.children});const{variant:a,label:r,sub:s,onClick:l,required:i,error:u,align:c="horizontal",useFullWidth:d=!1,icon:h}=e,p=a==="button"?void 0:l;let m=null;const g=a==="toggle"?`panel-toggle-${t}`:void 0,y=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const b=e;m=n.jsx(wu,{checked:b.checked,onChange:b.onChange,id:g})}else if(a==="segmented"){const b=e;m=n.jsx(vn,{options:b.options,value:b.value,onChange:b.onChange,size:b.size??40,ariaLabel:r})}else if(a==="dropdown"){const b=e,w=b.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:b.dropdowns.map((v,A)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(_n,{options:v.options,value:v.value,onChange:v.onChange,placeholder:v.placeholder,block:d,error:!!u,ariaDescribedBy:y,ariaLabel:v.ariaLabel??([r,v.placeholder].filter(Boolean).join(" ")||void 0)})},A))}):n.jsx(_n,{options:b.options??[],value:b.value??"",onChange:b.onChange??Du,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:y});m=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[w,n.jsx("span",{id:y,className:"caption-1 panel-row__error",role:"alert",children:u})]}):w}else if(a==="button"){const b=e;b.buttons?.length?m=n.jsx("div",{className:"panel-row__button-group",children:b.buttons.map((w,v)=>n.jsx(be,{htmlType:"button",size:w.btnSize??40,variant:w.btnVariant??"default",disabled:w.disabled,onClick:w.onClick,children:w.label},v))}):m=n.jsx(be,{htmlType:"button",size:b.btnSize??40,variant:b.btnVariant??"default",disabled:b.disabled,onClick:b.onClick,children:b.buttonLabel})}else if(a==="text"){const b=e;m=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:b.valueColor?{color:b.valueColor}:void 0,children:b.value})}else if(a==="input"){const b=e;m=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(qn,{value:b.value,onChange:b.onChange??Du,onKeyDown:b.onKeyDown,onEnter:b.onEnter,placeholder:b.placeholder,ghostText:b.ghostText,inputMode:b.inputMode,readOnly:b.readOnly,disabled:b.disabled,type:b.type,autoComplete:b.autoComplete,maxLength:b.maxLength,showCount:b.showCount,multiline:b.multiline,rows:b.rows,fullWidth:d,error:u,ariaLabel:r,required:i,ariaDescribedBy:b.helperText?C:void 0}),b.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:b.helperText})]})}else a==="custom"&&(m=e.children);u&&a!=="input"&&a!=="dropdown"&&(m=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[m,n.jsx("span",{id:y,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const f=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=b=>{p&&b.target===b.currentTarget&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),p())};return n.jsxs("div",{className:Ae("panel-row",c==="vertical"?"panel-row--vertical":"",f?"panel-row--label-fixed":"",a==="text"?"panel-row--text":"",p?"panel-row--clickable":""),onClick:p,onKeyDown:p?_:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,children:[h!=null&&n.jsx("div",{className:"panel-row__icon",children:h}),n.jsxs("div",{className:"panel-row__left",children:[g?n.jsxs("label",{htmlFor:g,className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}):n.jsxs("div",{className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}),s&&n.jsx("div",{className:"panel-row__sub caption-1",children:s})]}),n.jsx("div",{className:"panel-row__right",children:m})]})}function Su(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function kv({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:s}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(l=>{const i=e[l],u=l==="left"?r("device.direction.left","\uC88C"):r("device.direction.right","\uC6B0");return n.jsxs("div",{className:"panel-row__device-column",children:[n.jsxs("div",{className:"panel-row__device-head",children:[n.jsx("span",{className:"panel-row__device-side body-2b",children:u}),i&&t&&n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"x",ariaLabel:`${u} ${r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C")}`,showTooltipInfo:r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"),onClick:()=>t(l)})]}),i?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[i.device&&n.jsx(on,{size:"small",variant:ku(i.device),fill:"soft",label:Au(i.device,r)}),Su(i)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:Su(i)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:i.productName||i.brand}),Po(i.wornYear,i.wornMonth,i.wornDay,s.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Po(i.wornYear,i.wornMonth,i.wornDay,s.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},l)})})}function Ja({title:e,titleLevel:t=2,icon:a,disc:r,actions:s,size:l="medium",minHeight:i,maxWidth:u,className:c,scrollable:d,scrollbarGutter:h="auto",compactRows:p=!1,useBorder:m=!0,useBg:g=!0,useRowBorder:y=!0,labelWidth:C,form:f=!1,loading:_,empty:b,children:w}){const v=Ae("panel",`panel--${l}`,f?"panel--form":"",i!==void 0?"panel--fill":"",m?"":"panel--no-border",g?"":"panel--no-bg",y?"":"panel--no-row-border",p?"panel--compact-rows":"",c),A={};i!==void 0&&(A.minHeight=i),u!==void 0&&(A.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(A["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const x=t?`h${t}`:"div";return n.jsxs("div",{className:v,style:Object.keys(A).length?A:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:Ae("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(at,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(x,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),s&&n.jsx("div",{className:"panel__actions",children:s})]}),_?n.jsx(sn,{variant:"loading"}):b!=null&&o.Children.toArray(w).length===0?n.jsx(sn,{variant:"empty",children:b}):d?n.jsx("div",{className:Ae("panel__body--scroll",h==="stable"&&"panel__body--gutter-stable"),children:w}):w]})}function Av({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:s,style:l,children:i}){const u=o.useRef(null),[c,d]=o.useState();o.useEffect(()=>{const p=u.current;if(r===void 0||!p||(d(p.clientWidth),typeof ResizeObserver>"u"))return;const m=new ResizeObserver(([g])=>d(g.contentRect.width));return m.observe(p),()=>m.disconnect()},[r]);const h=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:Ae("panel-grid",t==="columns"&&"panel-grid--columns",s),style:{"--panel-grid-cols":h?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...l},children:i})}function Io({checked:e=!1,onChange:t,disabled:a,indeterminate:r,label:s,size:l="medium",className:i,title:u,ariaLabel:c}){const d=o.useRef(null),h=o.useId(),p=o.useRef(!!r);return p.current=!!r,o.useEffect(()=>{d.current&&(d.current.indeterminate=!!r)}),n.jsxs("label",{className:Ae("checkbox",l==="small"&&"checkbox--small",l==="large"&&"checkbox--large",a&&"checkbox--disabled",i),htmlFor:h,title:u,children:[n.jsx("input",{ref:d,id:h,type:"checkbox",className:"checkbox__input",checked:e,onChange:m=>{t?.(m.target.checked),d.current&&(d.current.indeterminate=p.current)},disabled:a,"aria-label":!s&&c?c:void 0}),n.jsx("span",{className:"checkbox__box"}),s&&n.jsx("span",{className:"checkbox__label body-3",children:s})]})}function ju(e,t){const a=()=>{if(e){const[C,f]=e.split("-");return{y:+C,m:+f-1}}const[g,y]=ur(t).split("-");return{y:+g,m:+y-1}},[r,s]=o.useState(()=>a().y),[l,i]=o.useState(()=>a().m),u=o.useRef(e);o.useEffect(()=>{if(e===u.current)return;u.current=e;const g=a();s(g.y),i(g.m)},[e]);const c=o.useRef({y:r,m:l});o.useEffect(()=>{c.current={y:r,m:l}},[r,l]);const d=o.useCallback(g=>{const y=c.current.y*12+c.current.m+g,C=Math.floor(y/12),f=y-C*12;c.current={y:C,m:f},s(C),i(f)},[]),h=o.useCallback(()=>d(-1),[d]),p=o.useCallback(()=>d(1),[d]),m=o.useCallback((g,y)=>{c.current={y:g,m:y},s(g),i(y)},[]);return{viewY:r,viewM:l,prevMonth:h,nextMonth:p,setViewYM:m}}function vr(e,t){return new Date(e,t+1,0).getDate()}function Nv(e,t){return new Date(e,t,1).getDay()}function Qa(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function Ev(e){if(!e)return"";const[t,a,r]=e.split("-");return`${t}. ${a}. ${r}.`}function Dv(e){const t=e.replace(/\D/g,"");if(t.length!==8)return null;const a=+t.slice(0,4),r=+t.slice(4,6),s=+t.slice(6,8);if(r<1||r>12||s<1||s>31)return null;const l=new Date(a,r-1,s);return l.getFullYear()!==a||l.getMonth()!==r-1||l.getDate()!==s?null:Qa(a,r-1,s)}const Sv=1900;function jv(e,t,a,r,s){const l=r?+r.split("-")[0]:Math.min(Sv,e),i=s?+s.split("-")[0]:Math.max(t+10,e),u=[];for(let c=l;c<=i;c++)u.push({value:String(c),label:a(c)});return u}function Tu(e,t,a,r){const s=[];for(let l=1;l<=12;l++){const i=`${e}-${String(l).padStart(2,"0")}`;a&&i<a.slice(0,7)||r&&i>r.slice(0,7)||s.push({value:String(l),label:t(e,l)})}return s}function Mu({value:e,onChange:t,size:a=48,min:r,max:s,disabled:l,placeholder:i,className:u,today:c}){const{t:d,i18n:h}=xe.useTranslation(),p=i??d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),m=o.useMemo(()=>d("calendar.dow",{returnObjects:!0}),[d]),g=ur(c),{viewY:y,viewM:C,prevMonth:f,nextMonth:_,setViewYM:b}=ju(e,c),w=o.useId(),v=o.useCallback((V,ae)=>{const H=window.innerHeight,q=window.innerWidth,ie=typeof document<"u"?document.getElementById(w):null,Ne=Math.max(ie?.offsetHeight||0,ie?.scrollHeight||0)||300,_e=Math.max(V.width,ie?.offsetWidth||0,260),he=H-V.bottom,je=V.top,$e=he<Ne&&je>he,De=8,le=(we,Le)=>Math.min(Math.max(De,we),Math.max(De,Le));return{position:"fixed",left:le(V.left,q-_e-De),width:V.width,minWidth:260,...$e?{top:"auto",bottom:le(H-V.top+6,H-Ne-De)}:{bottom:"auto",top:le(V.bottom+6,H-Ne-De)},zIndex:za(ae)}},[w]),{open:A,setOpen:x,toggle:E,style:B,triggerRef:D,menuRef:N}=Wa({computeStyle:v,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!A)return;const V=N.current;return(V?.querySelector(".date-picker__day--selected:not(:disabled)")??V?.querySelector(".date-picker__day--today:not(:disabled)")??V?.querySelector(".date-picker__day:not(:disabled)")??V?.querySelector(Nn)??V)?.focus?.(),()=>{const ae=document.activeElement;(!ae||ae===document.body)&&D.current?.focus?.()}},[A,N,D]);const[k,P]=o.useState(1),$=o.useRef(null),G=o.useRef(null);o.useEffect(()=>{if(!A)return;const V=e&&e.slice(0,7)===`${y}-${String(C+1).padStart(2,"0")}`?+e.slice(8):g.slice(0,7)===`${y}-${String(C+1).padStart(2,"0")}`?+g.slice(8):1;P(V)},[A]),o.useEffect(()=>{if(G.current==null)return;const V=G.current;G.current=null,$.current?.querySelector(`[data-day="${V}"]`)?.focus()}),o.useEffect(()=>{P(V=>Math.min(V,vr(y,C)))},[y,C]);const T=o.useCallback(V=>{let ae=Qa(V.getFullYear(),V.getMonth(),V.getDate());r&&ae<r&&(ae=r),s&&ae>s&&(ae=s);const[H,q,ie]=ae.split("-").map(Number);(H!==y||q-1!==C)&&b(H,q-1),P(ie),G.current=ie},[r,s,y,C,b]),F=o.useCallback(V=>{const ae=new Date(y,C,k),H=ie=>{ae.setDate(ae.getDate()+ie),T(ae)},q=ie=>{const Ne=ae.getFullYear()*12+ae.getMonth()+ie,_e=Math.floor(Ne/12),he=Ne-_e*12;T(new Date(_e,he,Math.min(ae.getDate(),vr(_e,he))))};switch(V.key){case"ArrowLeft":H(-1);break;case"ArrowRight":H(1);break;case"ArrowUp":H(-7);break;case"ArrowDown":H(7);break;case"Home":H(-ae.getDay());break;case"End":H(6-ae.getDay());break;case"PageUp":V.shiftKey?q(-12):q(-1);break;case"PageDown":V.shiftKey?q(12):q(1);break;default:return}V.preventDefault()},[y,C,k,T]),M=o.useCallback(V=>{l||(t(Qa(y,C,V)),x(!1))},[y,C,t,x,l]);o.useEffect(()=>{l&&x(!1)},[l,x]);const Q=V=>{const ae=Qa(y,C,V);return!!(r&&ae<r||s&&ae>s)},Z=(()=>{const V=vr(y,C);if(k>=1&&k<=V&&!Q(k))return k;for(let ae=1;ae<=V;ae++)if(!Q(ae))return ae;return-1})(),I=[];for(let V=0;V<Nv(y,C);V++)I.push(null);for(let V=1;V<=vr(y,C);V++)I.push(V);const K=a===64?20:a===40?16:18,L=ql(h.language),W=V=>new Intl.DateTimeFormat(L,{year:"numeric"}).format(new Date(V,0,1)),Y=(V,ae)=>new Intl.DateTimeFormat(L,{month:"long"}).format(new Date(V,ae-1,1)),U=jv(y,+g.slice(0,4),W,r,s),j=Tu(y,Y,r,s),R=V=>{const ae=Tu(V,Y,r,s);if(ae.length===0)return;const H=ae.some(q=>+q.value===C+1);b(V,H?C:+ae[0].value-1)},[z,O]=o.useState(null);o.useEffect(()=>{O(null)},[e]);const ue=o.useCallback(V=>{O(V);const ae=Dv(V);if(!ae||r&&ae<r||s&&ae>s)return;t(ae);const[H,q]=ae.split("-");b(+H,+q-1)},[r,s,t,b]),te=o.useCallback(()=>{O(null)},[]),de=o.useCallback(V=>{V.key==="Enter"?(V.preventDefault(),te(),x(!1)):V.key==="Escape"?(te(),x(!1)):V.key==="ArrowDown"&&!A&&(V.preventDefault(),x(!0))},[te,x,A]),ee=A?pn.createPortal(n.jsxs("div",{ref:N,id:w,className:"date-picker__dropdown",style:B,"data-tooltip-ignore":!0,role:"dialog","aria-label":d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),tabIndex:-1,children:[n.jsxs("div",{className:"date-picker__nav",children:[n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:f,"aria-label":d("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(Ws,{size:16,strokeWidth:2})}),n.jsxs("div",{className:"date-picker__nav-ym",children:[n.jsx(_n,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYear","\uC5F0 \uC120\uD0DD"),options:U,value:String(y),onChange:V=>R(+V),size:40}),n.jsx(_n,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectMonth","\uC6D4 \uC120\uD0DD"),options:j,value:String(C+1),onChange:V=>b(y,+V-1),size:40})]}),n.jsx("button",{type:"button",className:"date-picker__nav-btn",onClick:_,"aria-label":d("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(Hs,{size:16,strokeWidth:2})})]}),n.jsxs("div",{className:"date-picker__grid",ref:$,onKeyDown:F,children:[m.map(V=>n.jsx("div",{className:"date-picker__dow caption-1",children:V},V)),I.map((V,ae)=>{if(V===null)return n.jsx("div",{},`e${ae}`);const H=Qa(y,C,V),q=H===e,ie=H===g,Ne=Q(V),_e=ae%7;return n.jsx("button",{type:"button",disabled:Ne,"data-day":V,tabIndex:V===Z?0:-1,"aria-current":ie?"date":void 0,onClick:()=>!Ne&&M(V),className:Ae("date-picker__day caption-1",q&&"date-picker__day--selected",ie&&!q&&"date-picker__day--today",Ne&&"date-picker__day--disabled",_e===0&&"date-picker__day--sun",_e===6&&"date-picker__day--sat"),children:V},V)})]})]}),document.body):null;return n.jsxs("div",{className:Ae("date-picker",`date-picker--s${a}`,A&&"date-picker--open",u),children:[n.jsxs("div",{className:"date-picker__field",children:[n.jsx("input",{ref:D,type:"text",className:"date-picker__trigger body-2",value:z??Ev(e),placeholder:p,onChange:V=>ue(V.target.value),onClick:()=>!l&&!A&&E(),onKeyDown:de,onBlur:te,disabled:l,"aria-haspopup":"dialog","aria-expanded":A,inputMode:"numeric",autoComplete:"off"}),n.jsx("button",{type:"button",className:"date-picker__icon-btn",onClick:()=>!l&&E(),disabled:l,tabIndex:-1,"aria-label":p,"aria-haspopup":"dialog","aria-expanded":A,children:n.jsx(Js,{size:K,className:"date-picker__icon",strokeWidth:1.5})})]}),ee]})}const Lu=["personal","sensitive","marketing"];function Tv({takenKinds:e,busy:t,today:a,onClose:r,onSubmit:s,className:l}){const{t:i}=xe.useTranslation(),[u]=o.useState(()=>ur(a)),[c,d]=o.useState([]),[h,p]=o.useState("paper"),[m,g]=o.useState("self"),[y,C]=o.useState(u),[f,_]=o.useState(""),b=Lu.filter(v=>!e.includes(v)),w={personal:i("customers.consent.kind.personal","\uC77C\uBC18 \uAC1C\uC778\uC815\uBCF4"),sensitive:i("customers.consent.kind.sensitive","\uBBFC\uAC10\uC815\uBCF4(\uCCAD\uB825\xB7\uC9C4\uB2E8)"),marketing:i("customers.consent.kind.marketing","\uAD11\uACE0\uC131 \uC815\uBCF4 \uC218\uC2E0")};return n.jsx(Rn,{title:i("customers.consent.record","\uB3D9\uC758 \uBC1B\uAE30"),closeDisabled:t,onClose:r,className:l,footer:()=>n.jsx(be,{htmlType:"button",size:48,variant:"main",disabled:t||c.length===0,label:i("customers.consent.submit","\uC800\uC7A5\uD558\uAE30"),onClick:()=>s({kinds:c,method:h,source:m,consentedAt:y||null,note:f.trim()||null})}),children:n.jsxs(Ja,{useBorder:!1,useRowBorder:!1,labelWidth:96,children:[n.jsx(sn,{variant:"custom",useFullWidth:!0,label:i("customers.consent.kinds","\uBC1B\uC740 \uAC08\uB798"),children:n.jsxs("div",{className:"consent-record-popup__kinds",children:[b.map(v=>n.jsx(Io,{checked:c.includes(v),disabled:t,label:w[v],onChange:A=>d(x=>A?[...x,v]:x.filter(E=>E!==v))},v)),b.length===0&&n.jsx("p",{className:"body-3 consent-record-popup__none",children:i("customers.consent.allTaken","\uC138 \uAC08\uB798\uB97C \uC774\uBBF8 \uB2E4 \uBC1B\uC558\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uBC1B\uC73C\uB824\uBA74 \uBA3C\uC800 \uCCA0\uD68C\uD558\uC138\uC694.")})]})}),n.jsx(sn,{variant:"custom",useFullWidth:!0,label:i("customers.consent.methodTitle","\uBC1B\uC740 \uBC29\uBC95"),children:n.jsx(vn,{size:40,fullWidth:!0,ariaLabel:i("customers.consent.methodTitle","\uBC1B\uC740 \uBC29\uBC95"),options:[{key:"paper",label:i("customers.consent.method.paper","\uC11C\uBA74")},{key:"verbal",label:i("customers.consent.method.verbal","\uAD6C\uB450")},{key:"electronic",label:i("customers.consent.method.electronic","\uC804\uC790")}],value:h,onChange:v=>p(String(v))})}),n.jsx(sn,{variant:"custom",useFullWidth:!0,label:i("customers.consent.sourceTitle","\uC218\uC9D1 \uCD9C\uCC98"),children:n.jsx(vn,{size:40,fullWidth:!0,ariaLabel:i("customers.consent.sourceTitle","\uC218\uC9D1 \uCD9C\uCC98"),options:[{key:"self",label:i("customers.consent.source.self","\uBCF8\uC778")},{key:"guardian",label:i("customers.consent.source.guardian","\uBCF4\uD638\uC790")},{key:"referral",label:i("customers.consent.source.referral","\uC758\uB8B0\uAE30\uAD00")}],value:m,onChange:v=>g(String(v))})}),n.jsx(sn,{variant:"custom",useFullWidth:!0,label:i("customers.consent.day","\uBC1B\uC740 \uB0A0"),children:n.jsx(Mu,{size:48,value:y,max:u,today:a,onChange:v=>C(v??"")})}),n.jsx(sn,{variant:"custom",useFullWidth:!0,label:i("customers.consent.note","\uBA54\uBAA8"),children:n.jsx(qn,{size:48,fullWidth:!0,value:f,onChange:_,disabled:t,ariaLabel:i("customers.consent.note","\uBA54\uBAA8"),placeholder:i("customers.consent.notePlaceholder","\uC758\uB8B0\uAE30\uAD00 \uC774\uB984 \uB4F1 \u2014 \uBBFC\uAC10\uD55C \uB0B4\uC6A9\uC740 \uC801\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4")})})]})})}function Oo({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:s,className:l=""}){const{t:i}=xe.useTranslation(),u=r??i("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=s??i("common.nextPage","\uB2E4\uC74C \uD398\uC774\uC9C0"),d=Math.max(1,t),h=()=>a(Math.max(1,Math.min(d,e-1))),p=()=>a(Math.min(d,e+1));return n.jsxs("div",{className:Ae("pagination",l),children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-left",ariaLabel:u,disabled:e<=1,onClick:h}),n.jsxs("span",{className:"pagination__info body-3","aria-live":"polite","aria-atomic":"true",children:[Math.min(Math.max(1,e),d)," / ",d]}),n.jsx(be,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-right",ariaLabel:c,disabled:e>=t,onClick:p})]})}function zo({count:e,search:t,segment:a,filters:r,pageSize:s,pagination:l,actions:i,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),h=!!(t||r?.length||s||l||i);return n.jsxs("div",{className:Ae("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,m)=>n.jsx(vn,{size:40,...p},p.ariaLabel??m))]}),h&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(qn,{className:"toolbar__search",size:40,value:t.value,onChange:t.onChange,placeholder:t.placeholder??c("common.search","\uAC80\uC0C9"),ariaLabel:t.placeholder??c("common.search","\uAC80\uC0C9"),autoFocus:t.autoFocus,clearable:!0}),r?.map((p,m)=>n.jsx(_n,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},m)),(s||l)&&n.jsxs("div",{className:"toolbar__pager",children:[s&&n.jsx(_n,{size:40,options:s.options,value:s.value,onChange:s.onChange,ariaLabel:s.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),l&&n.jsx(Oo,{page:l.page,totalPages:l.total,onChange:l.onChange,prevLabel:l.prevLabel,nextLabel:l.nextLabel})]}),i]})})]})}function $u(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map($u).join(""):""}function Mv(e){let t=e.replace(/\r\n/g,`
825
825
  `).replace(/\r/g,`
@@ -827,10 +827,10 @@ ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(
827
827
  `).map(l=>l.replace(/\t/g," ")),r=a.filter(l=>l.trim().length>0),s=r.length>0?Math.min(...r.map(l=>l.match(/^ */)?.[0].length??0)):0;return a.map(l=>l.slice(s)).join(`
828
828
  `)}const Lv=new Set(["pnpm","npm","yarn","node","git","curl","docker","cat","ls","cd","rm","mv","cp","echo","export"]),$v=/^(?:const|let|var|function|return|if|else|for|while|switch|case|break|import|from|export|class|new|try|catch|finally|throw|await|async|null|true|false|this|typeof|instanceof)\b/;function Rv(e,t){let a=e;const r=[],s=/^(?:sh|bash|zsh|shell|console)$/.test(t.toLowerCase()),l=(i,u)=>r.push({type:i,content:u});for(;a.length>0;){const i=a.match(/^\s+/);if(i){l("whitespace",i[0]),a=a.slice(i[0].length);continue}if(!s&&a.startsWith("//")){const y=a.indexOf(`
829
829
  `),C=y===-1?a:a.slice(0,y);l("comment",C),a=a.slice(C.length);continue}if(s&&a.startsWith("#")){const y=a.indexOf(`
830
- `),C=y===-1?a:a.slice(0,y);l("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){l("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){l("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){l("number",d[0]),a=a.slice(d[0].length);continue}const h=a.match($v);if(h){l("keyword",h[0]),a=a.slice(h[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const y=p[0];l(s&&Lv.has(y)?"command":"identifier",y),a=a.slice(y.length);continue}const m=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(m){l("operator",m[0]),a=a.slice(m[0].length);continue}const g=a.match(/^[()[\]{};.,]/);if(g){l("punctuation",g[0]),a=a.slice(1);continue}l("other",a[0]),a=a.slice(1)}return r}function Pv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:s="default",className:l=""}){const{t:i}=xe.useTranslation(),[u,c]=o.useState(!1),d=Mv($u(e)),h=o.useRef(null);o.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=async()=>{try{if(!await Wf(d))return;c(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>c(!1),2e3)}catch{}},m=Rv(d,t),g=s==="small"?"caption-1":"body-3";return n.jsxs("div",{className:Ae("code-box",s==="small"?"code-box--small":"",l),children:[(a||r)&&n.jsxs("div",{className:"code-box__header",role:"toolbar","aria-label":i("common.codeBlock","\uCF54\uB4DC \uBE14\uB85D"),children:[n.jsx("div",{className:"code-box__title caption-1",children:a}),r&&n.jsx(be,{htmlType:"button",className:"code-box__copy",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:u?"check":"copy",onClick:p,ariaLabel:u?i("common.copied","\uBCF5\uC0AC\uB428"):i("common.copyCode","\uCF54\uB4DC \uBCF5\uC0AC")})]}),n.jsx("pre",{className:"code-box__inner","data-lang":t,children:n.jsx("code",{children:m.map((y,C)=>n.jsx("span",{className:`code-token ${y.type} ${g}`,children:y.content},C))})})]})}function Fv({count:e,actions:t,onClear:a,clearLabel:r,visible:s,content:l,max:i}){const{t:u}=xe.useTranslation(),c=s!==void 0?s:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),h=o.useRef(null),p=o.useRef(null),m=o.useRef(null),g=o.useRef(c);o.useLayoutEffect(()=>{const b=p.current,w=g.current;if(g.current=c,c&&!w){const v=typeof document<"u"?document.activeElement:null;m.current=v&&v!==document.body&&!b?.contains(v)?v:null}else!c&&w&&b&&b.contains(document.activeElement)&&hr(b,m.current)},[c]);const[y,C]=o.useState(!1),f=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const b=h.current;if(!b)return;const w=D=>{f.current=D,C(D)},v=()=>{const D=b.firstElementChild??b,N=Array.from(D.children);if(N.length<2){w(!1);return}const k=N[0].offsetTop,P=N.some(M=>M.offsetTop!==k);if(!f.current){_.current=b.clientWidth,P&&w(!0);return}if(P)return;const $=N[0],G=N[N.length-1],T=G.offsetLeft+G.offsetWidth-$.offsetLeft,F=_.current;(F==null||T<=F)&&w(!1)};if(v(),typeof ResizeObserver>"u")return;const A=new ResizeObserver(v);A.observe(b);const x=b.parentElement;let E=x?.clientWidth??0;const B=new ResizeObserver(()=>{const D=x?.clientWidth??0;D!==E&&(E=D,_.current=null,v())});return x&&B.observe(x),()=>{A.disconnect(),B.disconnect()}},[l,e]),n.jsxs("div",{ref:p,className:`bulk-bar ${c?"bulk-bar--visible":""}`,inert:!c||void 0,"aria-hidden":c?void 0:!0,children:[n.jsx("span",{ref:h,className:"bulk-bar__count body-2",role:"status",children:l??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),i!==void 0&&n.jsx(on,{size:"small",fill:"soft",variant:"main",label:`${e} / ${i}`,"aria-label":u("common.selectedOfMax",{count:e,max:i,defaultValue:`\uCD5C\uB300 ${i}\uAC1C \uC911 ${e}\uAC1C`})}),n.jsxs("div",{className:`bulk-bar__actions${y?" bulk-bar__actions--stacked":""}`,children:[n.jsx(be,{htmlType:"button",size:40,label:d,onClick:a}),t.map((b,w)=>n.jsx(be,{htmlType:"button",size:40,variant:b.variant??"default",icon:b.icon,label:b.label,onClick:b.onClick},w))]})]})}const Iv=[{key:"edit",icon:"edit-2",closeFirst:!0},{key:"duplicate",icon:"copy",closeFirst:!1},{key:"publish",icon:"book-marked",closeFirst:!1},{key:"copyLink",icon:"link",closeFirst:!1},{key:"remove",icon:"trash-2",closeFirst:!0}];function Ov(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:Ae("item-actions",a),children:Iv.map(({key:r,icon:s,closeFirst:l})=>{const i=e[r];if(!i)return null;const u=r==="publish"?i.published?i.unpublish:i.publish:i;return n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:s,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{l&&t(),u.onClick()}},r)})})}function zv({items:e,className:t,ariaLabel:a="\uC54C\uB9BC \uAE00",titleLevel:r=4,targetBytes:s}){const l=r?`h${r}`:"div";return n.jsx("div",{className:`notify-text-preview${t?` ${t}`:""}`,role:"group","aria-label":a,children:e.map(i=>{const u=s===void 0?$l(i.sms):$l(i.sms,s),c=u.type==="LMS";return n.jsxs("section",{className:"notify-text-preview__item",children:[n.jsxs("header",{className:"notify-text-preview__head",children:[n.jsx(l,{className:"notify-text-preview__name h5b",children:i.name}),i.meta&&Object.keys(i.meta).length>0?n.jsx("dl",{className:"notify-text-preview__meta caption-1",children:Object.entries(i.meta).map(([d,h])=>n.jsxs("div",{className:"notify-text-preview__meta-row",children:[n.jsx("dt",{children:d}),n.jsx("dd",{children:h})]},d))}):null]}),n.jsxs("div",{className:"notify-text-preview__body",children:[n.jsxs("div",{className:"notify-text-preview__col",children:[n.jsxs("div",{className:"notify-text-preview__col-head caption-1",children:[n.jsx("span",{children:"\uBB38\uC790"}),n.jsxs("span",{className:`notify-text-preview__bytes${c?" is-over":u.overTarget?" is-over-target":""}`,title:u.over?`${u.limit}\uBC14\uC774\uD2B8\uB97C \uB118\uC5C8\uB2E4 \u2014 \uBCF4\uB0BC \uB54C \uC798\uB9B0\uB2E4`:c?`${Ml}\uBC14\uC774\uD2B8\uB97C \uB118\uC5B4 \uC7A5\uBB38\uC774\uB2E4 \u2014 \uD55C \uD1B5 \uAC12\uC774 \uB2E8\uBB38\uC758 \uB450 \uBC30 \uBC18\uC774\uB2E4`:u.overTarget?`\uACA8\uB204\uB294 ${u.target}\uBC14\uC774\uD2B8\uB97C \uB118\uC5C8\uB2E4 \u2014 \uD55C \uAE00\uC790\uB9CC \uB298\uC5B4\uB3C4 ${Ml}\uC744 \uB118\uC5B4 \uC7A5\uBB38\uC774 \uB41C\uB2E4`:void 0,children:[u.bytes,u.target!==null?` / \uBAA9\uD45C ${u.target}`:"","\uBC14\uC774\uD2B8 \xB7 ",c?"\uC7A5\uBB38":"\uB2E8\uBB38",u.over?" \xB7 \uD55C\uACC4 \uB118\uC74C":c?" \xB7 \uAC12\uC774 \uB450 \uBC30 \uBC18":u.overTarget?" \xB7 \uBAA9\uD45C \uB118\uC74C":""]})]}),n.jsx("pre",{className:"notify-text-preview__text",children:i.sms})]}),i.ata?n.jsxs("div",{className:"notify-text-preview__col",children:[n.jsx("div",{className:"notify-text-preview__col-head caption-1",children:n.jsx("span",{children:"\uC54C\uB9BC\uD1A1"})}),n.jsx("pre",{className:"notify-text-preview__text",children:i.ata})]}):null]})]},i.name)})})}function Wv({src:e,alt:t,className:a,style:r,tone:s,textColor:l}){const i=!s&&!!l,u=Xy(e,i),c="bl"+o.useId().replace(/[^a-zA-Z0-9]/g,"");return s?n.jsx("span",{className:Ae("brand-logo","brand-logo--tone",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-src":`url("${e}")`,"--brand-logo-tone":s},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):i&&u?n.jsx("span",{className:Ae("brand-logo","brand-logo--inline",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-text-color":l},dangerouslySetInnerHTML:{__html:Yy(Ky(u),c)}}):n.jsx("img",{src:e,alt:t,className:Ae("brand-logo",a),style:r,draggable:!1})}function Ru({children:e,className:t}){const a=o.useRef(null),[r,s]=o.useState(null);return o.useEffect(()=>{s(a.current?.parentElement??null)},[]),o.useEffect(()=>{const l=a.current;if(!l||!r)return;const i=()=>{const c=typeof window<"u"&&window.getComputedStyle(l).position==="absolute"?Math.ceil(l.getBoundingClientRect().width):0;c>0?r.style.setProperty("--section-head-float-w",`${c}px`):r.style.removeProperty("--section-head-float-w")};if(i(),typeof ResizeObserver>"u")return()=>{r.style.removeProperty("--section-head-float-w")};const u=new ResizeObserver(()=>i());return u.observe(l),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:Ae("section-head-float",t),children:e})}function Wo({items:e,className:t}){return n.jsx("div",{className:se(t?`chart-section__legend ${t}`:"chart-section__legend"),children:e.map((a,r)=>n.jsxs("span",{className:se("chart-section__legend-item"),children:[n.jsx("span",{className:se("chart-section__legend-dot"),style:{background:a.color}}),a.label]},r))})}function er({label:e,children:t}){return e?n.jsxs("div",{className:se("chart-section__total chart-section__total--stacked"),children:[n.jsx("span",{className:se("chart-section__total__label body-3"),children:e}),n.jsx("span",{className:se("chart-section__total__value"),children:t})]}):n.jsx("div",{className:se("chart-section__total"),children:t})}function Ho({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:s,headRight:l,headFloat:i,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:h,ariaLabel:p,tooltip:m,totalNum:g,totalUnit:y,totalLabel:C,subRow:f,subRowAlign:_="start",className:b,inGrid:w=!1,children:v}){const{t:A}=xe.useTranslation(),x=o.useRef(null),{anchorRect:E,openAt:B,close:D}=Oa(),N=o.useCallback(()=>{m&&x.current&&B(x.current)},[m,B]),[k,P]=o.useState(!1);Fo(()=>{const j=x.current;if(!j||!u)return;const R=O=>P(O>0&&O<d);if(R(j.clientWidth),typeof ResizeObserver>"u")return;const z=new ResizeObserver(O=>R(O[0].contentRect.width));return z.observe(j),()=>z.disconnect()},[u,d]);const[$,G]=o.useState(null),T=o.useCallback(()=>G(null),[]),F=o.useCallback(j=>{const R=j.currentTarget.getBoundingClientRect();G(z=>z?null:{left:R.left,right:R.right,top:R.top,bottom:R.bottom,width:R.width,height:R.height,x:R.x,y:R.y})},[]),M=!!u&&k;o.useEffect(()=>{M||G(null)},[M]);const Q=u?[...u.options.map(j=>({label:j.label,icon:j.icon,selected:j.key===u.value,disabled:j.disabled,onClick:()=>u.onChange(j.key),closeOnSelect:!0})),...(c??[]).map((j,R)=>R===0?{...j,separatorBefore:!0}:j)]:[],Z=o.useCallback(j=>{if(!h)return;const R=j.target;R&&typeof R.closest=="function"&&R.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),I=o.useCallback(j=>{h&&j.target===j.currentTarget&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),h())},[h]),K=typeof l=="function"?l({collapsed:M}):l,L=g!=null||C?n.jsxs(er,{label:C,children:[g!=null&&n.jsx("span",{className:se("chart-section__total__num h0"),children:g}),y&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:y})]}):null,W=K||u?n.jsxs("div",{className:se("chart-section__head-right"),children:[u&&(M?n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??A("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??A("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!$,onClick:F}):n.jsx(vn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(j=>({key:j.key,label:j.label,disabled:j.disabled})),value:u.value,onChange:u.onChange})),K]}):null,Y=o.useId(),U=a?`h${a}`:"div";return n.jsxs("section",{ref:x,className:se(["chart-section",w&&"chart-section--grid",h&&"chart-section--clickable",b].filter(Boolean).join(" ")),onClick:h?Z:void 0,onKeyDown:h?I:void 0,onPointerEnter:m?N:void 0,onPointerLeave:m?D:void 0,onFocus:m?N:void 0,onBlur:m?D:void 0,role:h?"button":void 0,tabIndex:h?0:void 0,"aria-label":h?p??(typeof e=="string"?e:void 0):void 0,"aria-labelledby":!h&&e!=null?Y:void 0,children:[m&&E&&n.jsx(Tn,{anchorRect:{left:E.left,top:E.top+21,right:E.right,bottom:E.bottom,width:E.width,height:E.height},text:m}),i&&n.jsx(Ru,{children:i}),n.jsxs("div",{className:se("chart-section__head"),children:[n.jsxs("div",{className:se("chart-section__title-row"),children:[r&&n.jsx(at,{icon:r,label:typeof e=="string"?e:void 0,className:se("chart-section__icon")}),n.jsx(U,{id:Y,className:se(["chart-section__title",t].filter(Boolean).join(" ")),children:e})]}),W,s&&n.jsx("div",{className:se("chart-section__disc body-3"),children:s})]}),(L||f)&&n.jsxs("div",{className:se(["chart-section__sub-row",_!=="start"&&`chart-section__sub-row--${_}`].filter(Boolean).join(" ")),children:[L,f]}),v,$&&n.jsx(wn,{anchorRect:$,onClose:T,ariaLabel:u?.ariaLabel??A("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:[{items:Q}],onClose:T,size:"small"})})]})}const tr=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,Vo=e=>tr(e.getFullYear(),e.getMonth()+1);function ga(e){const t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;const a=Number(t[2]);return a>=1&&a<=12?{year:Number(t[1]),month1:a}:null}const qo=(e,t)=>`${e}#${t}`;function Dn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Hv(){const e=ca();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<Dn(t,a)){const i=new Date(t,a,0);t=i.getFullYear(),a=i.getMonth(),r=i.getDate()}const s=Math.floor((r-Dn(t,a))/7),l=tr(t,a+1);return{monthKey:l,value:qo(l,s)}}function Vv(e){const t=ca(),a=Vo(t),r=(c,d)=>tr(c,d+1),s=new Map;s.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());s.has(d)||s.set(d,[]),s.get(d).push(c)}for(const[c,d]of[...s.entries()]){const h=ga(c);if(!h)continue;const p=h.year,m=h.month1-1,g=Dn(p,m);if(!(c===a&&t.getDate()<g)&&!d.some(f=>f.date.getDate()<g))continue;const y=new Date(p,m,0),C=r(y.getFullYear(),y.getMonth());s.has(C)||s.set(C,[])}const l=new Map;for(const[c,d]of s){const h=ga(c);if(!h)continue;const p=h.year,m=h.month1-1,g=new Date(p,m+1,0).getDate(),y=d.reduce((v,A)=>Math.max(v,A.parts?.length??0,A.partsB?.length??0),0),C=d.some(v=>v.partsB),f=new Array(g+1).fill(0),_=new Array(g+1).fill(0),b=Array.from({length:g+1},()=>new Array(y).fill(0)),w=Array.from({length:g+1},()=>new Array(y).fill(0));for(const v of d){const A=v.date.getDate();if(f[A]+=v.a,_[A]+=v.b,v.parts)for(let x=0;x<y;x++)b[A][x]+=v.parts[x]??0;if(v.partsB)for(let x=0;x<y;x++)w[A][x]+=v.partsB[x]??0}l.set(c,{year:p,month:m,daysInMonth:g,partsLen:y,hasPartsB:C,dayA:f,dayB:_,dayParts:b,dayPartsB:w})}const i=(c,d,h)=>new Date(c,d,h).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),u={};for(const[c,d]of l){const{year:h,month:p,daysInMonth:m,dayA:g,dayB:y,dayParts:C,dayPartsB:f}=d,_=h===t.getFullYear()&&p===t.getMonth(),b=t.getDate(),w=l.get(r(p===11?h+1:h,(p+1)%12)),v=d.partsLen,A=[];for(let E=1;E<=m;E++){const B=_&&E>b;A.push({label:String(E),...B&&g[E]===0&&y[E]===0?{future:!0}:{},a:B&&g[E]===0&&y[E]===0?-1:g[E],b:y[E],...v?{parts:C[E]}:{},...v&&d.hasPartsB?{partsB:f[E]}:{}})}const x=[];for(let E=Dn(h,p);E<=m;E+=7){const B=Math.max(0,E+6-m),D=B&&w?Math.max(v,w.partsLen):v,N=d.hasPartsB||!!(B&&w?.hasPartsB);let k=0,P=0;const $=new Array(D).fill(0),G=new Array(D).fill(0);for(let F=E;F<=Math.min(E+6,m);F++){k+=g[F],P+=y[F];for(let M=0;M<v;M++)$[M]+=C[F][M],G[M]+=f[F][M]}if(B&&w)for(let F=1;F<=B&&!i(w.year,w.month,F);F++){k+=w.dayA[F],P+=w.dayB[F];for(let M=0;M<w.partsLen;M++)$[M]+=w.dayParts[F][M],G[M]+=w.dayPartsB[F][M]}const T=B?`${(p+1)%12+1}/${B}`:`${E+6}`;x.push({label:`${x.length+1}\uC8FC`,sublabel:`[${E}\uC77C~${T}\uC77C]`,a:k,b:P,...D?{parts:$}:{},...D&&N?{partsB:G}:{}})}u[c]={weekly:x,daily:A}}return u}function Pu(){const e=ca(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let s=2024;s<=t;s++){const l=s===t?a:12;for(let i=1;i<=l;i++)r.push({value:tr(s,i),year:s,month:i})}return r.reverse()}Pu();function qv(){return Pu()}function Fu(e,t){const a=e("calendar.weekOrdinal",{returnObjects:!0,defaultValue:[]}),r=Array.isArray(a)&&typeof a[t]=="string"?a[t]:null;return e("calendar.weekLabel",{ord:r??String(t+1)})}function Iu(e){const{t,i18n:a}=xe.useTranslation(),[r,s]=o.useState("week"),l=o.useMemo(()=>qv().filter(D=>D.value in e),[e]),i=o.useMemo(()=>{const D=[];for(const N of l){const k=new Date(N.year,N.month,0).getDate(),P=Dn(N.year,N.month-1),$=Math.ceil((k-P+1)/7);for(let G=$-1;G>=0;G--)D.push({value:qo(N.value,G),monthKey:N.value,year:N.year,month:N.month,week:G})}return D},[l]),u=o.useCallback(D=>`${io(t,a.language,D.year,D.month)} ${Fu(t,D.week)}`,[t]),c=o.useMemo(()=>l.map(D=>({value:D.value,label:io(t,a.language,D.year,D.month)})),[t,a.language,l]),d=o.useMemo(()=>i.map(D=>({value:D.value,label:u(D)})),[i,u]),h=o.useMemo(()=>Hv(),[e]),p=o.useMemo(()=>l.find(D=>D.value===h.monthKey)?.value??l[0]?.value??"",[l,h]),m=o.useMemo(()=>i.find(D=>D.value===h.value)?.value??i[0]?.value??"",[i,h]),[g,y]=o.useState(""),[C,f]=o.useState("");o.useEffect(()=>{l.find(D=>D.value===g)||y(p)},[l,g,p]),o.useEffect(()=>{i.find(D=>D.value===C)||f(m)},[i,C,m]);const _=r==="month"?c:d,b=r==="month"?g:C,w=r==="month"?y:f,v=o.useMemo(()=>{const D=t("calendar.dow",{returnObjects:!0});return Array.isArray(D)?D:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),A=_.findIndex(D=>D.value===b),x=o.useCallback(()=>{const D=_.findIndex(N=>N.value===b);D<_.length-1&&w(_[D+1].value)},[_,b,w]),E=o.useCallback(()=>{const D=_.findIndex(N=>N.value===b);D>0&&w(_[D-1].value)},[_,b,w]),B=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:s,range:b,setRange:w,activeOptions:_,activeIdx:A,handlePrev:x,handleNext:E,periodOptions:B,monthRange:g,weekRange:C,weekRanges:i,DOW:v}}const Et=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function Pn(e,t=!0){return e.future===!0||t&&e.a===-1}function Uv({data:e,colorA:t,colorB:a,labelA:r,labelB:s,barWidth:l=10,barGap:i=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:h,seriesLabels:p,rateLabels:m,grouped:g=!1,baseline:y,focusableBars:C=!1}){const f=!a,_=!!(h&&h.length>0),b=y,w=o.useMemo(()=>_?Math.max(0,...e.filter(I=>!Pn(I,b==null)).map(I=>g?Math.max(0,...(I.parts??[]).map(Et)):(I.parts??[]).reduce((K,L)=>K+Math.max(0,Et(L)),0))):Math.max(0,...e.filter(I=>!Pn(I,b==null)).flatMap(I=>f?[Et(I.a)]:[Et(I.a),Et(I.b)])),[e,f,_,g]),v=o.useMemo(()=>{if(b==null)return 0;const I=e.filter(K=>!Pn(K,b==null)).flatMap(K=>_?(K.parts??[]).map(Et):f?[Et(K.a)]:[Et(K.a),Et(K.b)]);return Math.max(0,...I.map(K=>Math.abs(K-b)))},[e,b,_,f]),A=o.useMemo(()=>{const I=b!=null?v:w;return c??(d?I>0?I:10:Math.ceil(I/10)*10||10)},[w,v,b,c,d]),x=u,E=_?g?Math.max(1,h.length):1:f?1:2,B={"--bar-width":`${o.useMemo(()=>{const I=Math.max(1,e.length);return Math.max(2,Math.min(l,Math.round(120/(I*E)+6)))},[e.length,E,l])}px`},D={"--bar-group-gap":`${Math.max(0,i)}px`},N=o.useMemo(()=>{const I=Math.round(A/2);return b!=null?[b+A,...I!==A?[b+I]:[],b,...I!==A?[b-I]:[],b-A]:I!==A?[A,I,0]:[A,0]},[A,b]),k=I=>b!=null?1-(I-(b-A))/(2*A):1-I/A,[P,$]=o.useState(null),G=o.useCallback(()=>$(null),[]),T=o.useCallback((I,K)=>{const L=[I.label,I.sublabel].filter(Boolean).join(" ");let W;if(_&&g&&I.rawPartsB)W=(p??[]).map((Y,U)=>{const j=I.rawPartsB[U]??0;return{text:j>0?`${Y}: ${K[U]??0}% (${I.rawParts?.[U]??0}/${j})`:`${Y}: -`,color:(h??[])[U]}});else if(_&&g)W=(p??[]).map((Y,U)=>({text:`${Y}: ${Q(K[U]??0)}`,color:(h??[])[U]}));else if(_){const Y=(p??[]).map((j,R)=>({text:`${j}: ${K[R]??0}`,color:(h??[])[R]})),U=Y.filter((j,R)=>(K[R]??0)>0);W=U.length?U:Y}else m&&!f?W=[{text:`${r} ${Et(I.a)}%`,color:t},{text:`${s} ${Et(I.b)}%`,color:a}]:m&&I.rawB!==void 0?W=[{text:`${m.total} ${I.rawB}`},{text:`${m.done} ${I.rawA??0}`,color:t}]:f?W=[{text:`${r}: ${Et(I.a)}`,color:t}]:W=[{text:`${r}: ${Et(I.a)}`,color:t},{text:`${s}: ${Et(I.b)}`,color:a}];return{title:L,items:W}},[_,g,p,h,m,f,r,s,t,a,b]),F=o.useCallback((I,K,L)=>{const W=I.getBoundingClientRect(),{title:Y,items:U}=T(K,L);$({rect:{left:W.left,top:W.top,right:W.right,bottom:W.bottom,width:W.width,height:W.height},title:Y,items:U})},[T]),M=o.useCallback((I,K)=>{const{title:L,items:W}=T(I,K);return[L,...W.map(Y=>Y.text)].filter(Boolean).join(", ")},[T]),Q=I=>b!=null&&I>b?`+${I}`:`${I}`,Z=P!=null;return o.useEffect(()=>{if(!Z)return;const I=()=>$(null),K=L=>{const W=L.target;W&&typeof W.closest=="function"&&W.closest(".bar-chart__col")||$(null)};return window.addEventListener("scroll",I,!0),document.addEventListener("pointerdown",K,!0),()=>{window.removeEventListener("scroll",I,!0),document.removeEventListener("pointerdown",K,!0)}},[Z]),n.jsxs("div",{className:se("bar-chart__wrap"),style:D,children:[n.jsx("div",{className:se("bar-chart__inner"),children:n.jsx("div",{className:se("bar-chart__scroll"),children:n.jsxs("div",{className:se("bar-chart__area"),children:[n.jsxs("div",{className:se("bar-chart__plot"),style:{height:x},children:[N.slice(0,-1).map((I,K)=>n.jsx("div",{className:se(`bar-chart__gridline${b!=null&&I===b?" bar-chart__gridline--baseline":""}`),style:{top:k(I)*x},children:n.jsx("span",{className:se("bar-chart__gridline__label caption-1"),children:I})},K)),e.map((I,K)=>{const L=Pn(I,b==null),W=x/2,Y=z=>b!=null?Math.min(W,Math.abs(Et(z)-b)/A*W):Math.min(x,Math.max(0,Et(z)/A*x)),U=L?0:Y(I.a),j=L?0:Y(I.b),R=(I.parts??[]).map(Et);return n.jsx("div",{className:se(`bar-chart__col${g&&_?" bar-chart__col--group":""}`),style:{cursor:L?"default":"pointer"},tabIndex:C&&!L?0:void 0,role:C&&!L?"img":void 0,"aria-label":C&&!L?M(I,R):void 0,onMouseEnter:L?void 0:z=>F(z.currentTarget,I,R),onFocus:L||!C?void 0:z=>F(z.currentTarget,I,R),onBlur:C?G:void 0,onMouseLeave:G,children:!L&&(_&&g?(h??[]).map((z,O)=>{const ue=R[O]??0;if(b==null)return n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:Y(ue),background:z}},O);const te=Et(ue)<b;return n.jsxs("div",{className:se("bar-chart__slot"),style:B,children:[n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--up"),children:!te&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full"),style:{height:Y(ue),background:z}})}),n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--down"),children:te&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(ue),background:z}})})]},O)}):_?n.jsx("div",{className:se("bar-chart__stack"),style:B,children:(()=>{const z=R.reduce((ue,te,de)=>te>0?de:ue,-1);let O=x;return R.map((ue,te)=>{if(ue<=0)return null;const de=Math.min(O,ue/A*x);return O-=de,n.jsx("div",{className:se("bar-chart__stack-segment"),style:{height:de,background:(h??[])[te],borderRadius:te===z?"6px 6px 0 0":void 0}},te)})})()}):b!=null?n.jsx(n.Fragment,{children:[{v:Et(I.a),c:t},...f?[]:[{v:Et(I.b),c:a}]].map(({v:z,c:O},ue)=>n.jsxs("div",{className:se("bar-chart__slot"),style:B,children:[n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--up"),children:z>=b&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full"),style:{height:Y(z),background:O}})}),n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--down"),children:z<b&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(z),background:O}})})]},ue))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:U,background:t}}),!f&&n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:j,background:a}})]}))},K)})]}),n.jsx("div",{className:se("bar-chart__x-axis"),children:e.map((I,K)=>{const L=Pn(I,b==null);return n.jsxs("span",{className:se(`bar-chart__x-axis__label${L?" bar-chart__x-axis__label--future":""}`),children:[n.jsxs("span",{className:se("caption-1 bar-chart__x-axis__main"),children:[I.isToday&&n.jsx("span",{className:se("bar-chart__x-axis__today-dot"),style:{background:t}}),I.label]}),I.sublabel&&n.jsx("span",{className:"caption-1",children:I.sublabel})]},K)})})]})})}),P&&n.jsx(Xn,{anchorRect:P.rect,title:P.title,items:P.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Ou({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:s,setRange:l,handlePrev:i,handleNext:u,periodOptions:c,period:d,setPeriod:h}=e,p=d==="week"?t("calendar.prevWeek","\uC774\uC804 \uC8FC"):t("calendar.prevMonth","\uC774\uC804 \uB2EC"),m=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:se("chart-section__controls"),children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:i}),n.jsx(_n,{value:s,onChange:l,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:m,showTooltipInfo:m,disabled:r<=0,onClick:u}),n.jsx(vn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:g=>h(g),size:40})]})}function Uo(e,t,a,r=!0){const s=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(l,i)=>{const u=new Date(t);u.setDate(t.getDate()+i);const c=(e[Vo(u)]?.daily??[])[u.getDate()-1],d=c!=null&&Pn(c,r)||u>s;return{dt:u,entry:c,isFuture:d}})}function Gv(e,t,a,r=!0){const{period:s,monthRange:l,weekRange:i,weekRanges:u,DOW:c}=t,d=ca(),h=d.getFullYear(),p=d.getMonth()+1,m=d.getDate();if(s==="month"){const C=e[l]??{weekly:[],daily:[]},f=ga(l),_=f?f.year:null,b=f?f.month1:null,w=_&&b?Dn(_,b-1):1;return C.weekly.map((v,A)=>{const x=A+1;let E=v.label,B=!1,D=!1;if(_&&b){const N=w+A*7,k=new Date(_,b-1,N+6),P=k.getMonth()+1,$=k.getDate(),G=P===b?`${$}`:`${P}/${$}`;E=a("manager.chart.weekRange",{start:N,end:G});const T=new Date(h,p-1,m).getTime();B=T>=new Date(_,b-1,N).getTime()&&T<=k.getTime(),D=_>h||_===h&&(b>p||b===p&&N>m)}return{...v,label:E,sublabel:Fu(a,x-1),isToday:B,future:v.future===!0||D||void 0,a:D?-1:v.a,b:D?0:v.b}})}const g=u.find(C=>C.value===i);if(!g)return[];const y=new Date(g.year,g.month-1,Dn(g.year,g.month-1)+g.week*7);return Uo(e,y,d,r).map(({dt:C,entry:f,isFuture:_})=>{const b=C.getMonth()+1,w=C.getDate(),v=C.getFullYear();return{label:b===g.month&&v===g.year?`${w}`:`${b}/${w}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:f&&f.a>0?f.a:0,b:_?0:f&&f.b>0?f.b:0,isToday:v===h&&b===p&&w===m,...f?.parts?{parts:_?f.parts.map(()=>0):f.parts}:{},...f?.partsB?{partsB:_?f.partsB.map(()=>0):f.partsB}:{}}})}const Kv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Yv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:s,data:l,colorA:i,colorB:u,labelAKey:c,labelBKey:d,showTotal:h=!1,totalUnitKey:p,totalLabelKey:m,control:g,hideControls:y=!1,rate:C=!1,rateAgg:f="dayMean",tightMax:_=!1,avgMode:b=!1,totalFormat:w,series:v,seriesMode:A="stack",loading:x=!1,onDetail:E,headExtra:B,headSegment:D,icon:N,disc:k,onClick:P,cardAriaLabel:$,cardTooltip:G,detailSize:T=32,barGap:F,baseline:M,className:Q,inGrid:Z=!1}){const{t:I}=xe.useTranslation(),K=Kv[t],L=Iu(l),W=g??L,Y=o.useMemo(()=>Gv(l,W,I,M==null),[l,W,I,M]),U=A==="group"&&!!v&&v.length>0;F!=null&&!U&&Bt("bar-chart-bargap-without-group","[BarChart] barGap \uC740 seriesMode='group' + series \uC5D0\uC11C\uB9CC \uC4F0\uC778\uB2E4 \u2014 \uADF8 \uBC16\uC5D0\uC11C\uB294 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4.");const j=o.useMemo(()=>{if(!C)return Y;const ee=W.period==="month"?ga(W.monthRange):null,V=ca(),ae=v?.length??0,H=q=>{const ie=[],Ne=[],_e=[];for(let he=0;he<ae;he++){let je=0,$e=0,De=0;for(const le of q){const we=Et(le.a[he]),Le=Et(le.b[he]);Le<=0||(je+=we,$e+=Le,De+=we/Le*100)}ie.push(f==="weighted"?$e>0?Math.round(je/$e*100):0:q.length?Math.round(De/q.length):0),Ne.push(je),_e.push($e)}return{pct:ie,ra:Ne,rb:_e}};return Y.map((q,ie)=>{let Ne=q.a===-1?-1:q.b>0?Math.round(q.a/q.b*100):0;if(ee&&!Pn(q)){const he=ee.year,je=ee.month1-1,$e=Uo(l,new Date(he,je,Dn(he,je)+ie*7),V).filter(De=>!De.isFuture);if(f==="weighted"){let De=0,le=0;for(const{entry:we}of $e)we&&we.b>0&&(De+=we.a,le+=we.b);Ne=le>0?Math.round(De/le*100):0}else Ne=$e.length?Math.round($e.reduce((De,{entry:le})=>De+(le&&le.b>0?le.a/le.b*100:0),0)/$e.length):0}let _e=null;if(U&&!Pn(q)){let he;if(ee){const $e=ee.year,De=ee.month1-1;he=Uo(l,new Date($e,De,Dn($e,De)+ie*7),V).filter(le=>!le.isFuture).map(({entry:le})=>({a:le?.parts??[],b:le?.partsB??[]}))}else he=[{a:q.parts??[],b:q.partsB??[]}];const je=H(he);_e={parts:je.pct,rawParts:je.ra,rawPartsB:je.rb}}return{...q,a:Ne,b:q.a===-1?0:d&&q.parts&&q.parts[1]>0?Math.round(q.parts[0]/q.parts[1]*100):0,rawA:q.a===-1?-1:q.a,rawB:q.b,..._e??{}}})},[Y,C,f,d,W.period,W.monthRange,l,U,v?.length]),R=o.useMemo(()=>{if(C||b){const V=(W.period==="week"?Y:l[W.monthRange]?.daily??[]).filter(H=>H.a!==-1);if(V.length===0)return 0;if(C&&f==="weighted"){let H=0,q=0;for(const ie of V)ie.b>0&&(H+=ie.a,q+=ie.b);return q>0?Math.round(H/q*100):0}const ae=C?V.reduce((H,q)=>H+(q.b>0?q.a/q.b*100:0),0):V.reduce((H,q)=>H+(q.a>0?q.a:0),0);return Math.round(ae/V.length)}const ee=W.period==="month"?l[W.monthRange]?.daily??[]:j;return M!=null?ee.reduce((V,ae)=>V+(Pn(ae,!1)?0:Et(ae.a)+(d?Et(ae.b):0)),0):ee.reduce((V,ae)=>V+(ae.a>0?ae.a:0)+(d&&ae.b>0?ae.b:0),0)},[j,Y,C,f,b,M,d,W.period,W.monthRange,l]),z=v&&v.length>0?v.map(ee=>({color:ee.color,label:ee.label})):[{color:i,label:I(c)},...d?[{color:u,label:I(d)}]:[]],O=t==="small",ue=[O?"chart-section--compact":t==="large"?"chart-section--full":void 0,Q].filter(Boolean).join(" ")||void 0,te=r?I(r):"",de=te?I("trainingStatus.detailFor",{name:te,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):I("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Ho,{className:ue,inGrid:Z,icon:N,disc:k,onClick:P,ariaLabel:$,tooltip:G,headSegment:D,headMenuItems:E?[{label:de,icon:"list",onClick:E,closeOnSelect:!0}]:void 0,title:I(r),titleLevel:s,titleClassName:O?"h5 chart-section-title--small":void 0,headRight:O?B??void 0:({collapsed:ee})=>n.jsxs(n.Fragment,{children:[!y&&n.jsx(Ou,{control:W}),B,E&&!ee&&n.jsx("span",{className:se("bar-chart__detail-btn"),children:n.jsx(be,{htmlType:"button",size:T,type:"dot",icon:"list",ariaLabel:de,showTooltipInfo:de,onClick:E})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||b||m&&w?n.jsx(er,{label:O?void 0:`${I(W.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${I(m??c)}`,children:w?(w(R).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ee,V)=>/\d/.test(ee)?n.jsx("span",{className:se("chart-section__total__num h0"),children:ee},V):n.jsx("span",{className:se("chart-section__total__unit h5"),children:ee},V)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:R}),p&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(p)})]})}):n.jsxs(er,{children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:R}),n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(c)}),p&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(p)})]}):n.jsx("span",{}),n.jsx(Wo,{items:z,className:"caption-1"})]}),children:x?n.jsx("div",{className:se("bar-chart__wrap bar-chart__loading"),"aria-busy":"true",children:n.jsx("div",{className:se("bar-chart__inner"),children:n.jsxs("div",{className:se("bar-chart__area bar-chart__area--loading"),children:[n.jsx("div",{className:se("bar-chart__plot bar-chart__plot--loading"),style:{height:K.height},children:n.jsx(pa,{size:32})}),n.jsx("div",{className:se("bar-chart__x-axis"),"aria-hidden":"true",children:n.jsxs("span",{className:se("bar-chart__x-axis__label"),children:[n.jsx("span",{className:se("caption-1 bar-chart__x-axis__main"),children:"\xA0"}),j.some(ee=>!!ee.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Uv,{focusableBars:e,data:j,colorA:i,colorB:d?u:void 0,labelA:I(c),labelB:d?I(d):void 0,barWidth:a??K.barWidth,barGap:F,baseline:M,height:K.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:v?.map(ee=>ee.color),seriesLabels:v?.map(ee=>ee.label),rateLabels:C?{total:I("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:I("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:U})})}const zu=120,Zv={left:38,right:16,top:26,bottom:24};function Xv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:s,height:l=156,fallbackWidth:i=320,insets:u,overlay:c,ariaLabel:d,className:h}){const[p,m]=o.useState(null),[g,y]=o.useState(null);o.useEffect(()=>{if(!g)return;const M=Z=>m(Math.round(Z)||null);if(M(g.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Q=new ResizeObserver(([Z])=>M(Z.contentRect.width));return Q.observe(g),()=>{Q.disconnect()}},[g]);const{payload:C,anchorRect:f,openAfterDelay:_,close:b}=Hy(zu),w=o.useCallback((M,Q)=>{M&&_(M,Q.getBoundingClientRect())},[_]),v=p??i,A=l,{left:x,right:E,top:B,bottom:D}={...Zv,...u},[N,k]=t,P=M=>k===N?x:x+(v-x-E)*(M-N)/(k-N),$=M=>B+(A-B-D)*(100-M)/100,G={x:P,y:$,plot:{left:x,right:v-E,top:B,bottom:A-D,width:Math.max(0,v-x-E),height:Math.max(0,A-B-D)}},T=e.filter(M=>!M.hollow),F=s??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:y,className:Ae("line-chart",h),viewBox:`0 0 ${v} ${A}`,role:"img","aria-label":d??e.map(M=>M.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map(M=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:x,x2:v-E,y1:$(M),y2:$(M)}),n.jsxs("text",{className:"line-chart__tick",x:x-6,y:$(M)+4,textAnchor:"end",children:[M,"%"]})]},M)),c?.(G),a.map(M=>n.jsx("text",{className:"line-chart__tick",x:P(M.x),y:A-5,textAnchor:"middle",children:M.label},M.x)),T.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:F,points:T.map(M=>`${P(M.x)},${$(M.pct)}`).join(" ")}),e.map(M=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Q=>w(M.description,Q.currentTarget),onPointerLeave:b,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:P(M.x),cy:$(M.pct),r:12}),n.jsx("circle",{className:Ae("line-chart__dot-main",M.hollow&&"is-hollow"),cx:P(M.x),cy:$(M.pct),r:4,stroke:F,fill:M.hollow?void 0:F})]},M.x))]}),C!=null&&n.jsx(wn,{anchorRect:f,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Jv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:s,tipGroups:l,start:i,className:u}){return n.jsxs("div",{className:Ae("game-intro",u),children:[e!=null&&n.jsx("span",{className:"game-intro__icon","aria-hidden":"true",style:{"--game-intro-icon":`${t}px`},children:e}),n.jsx("h2",{className:Ae("game-intro__title",r),children:a}),s!=null&&n.jsx("p",{className:"game-intro__description body-3",children:s}),l?.map((c,d)=>n.jsxs("div",{className:"game-intro__tips",children:[c.title!=null&&n.jsx("span",{className:"game-intro__tips-title body-3",children:c.title}),c.tips.map((h,p)=>n.jsxs("span",{className:"game-intro__tip body-3",children:[h.icon!=null&&n.jsx("span",{"aria-hidden":"true",children:h.icon}),n.jsx("span",{children:h.text})]},p))]},d)),i&&n.jsx(be,{htmlType:"button",className:i.className,variant:"main",color:i.color,size:48,width:"100%",disabled:i.disabled,onClick:i.onClick,children:i.label})]})}const Wu=(e,t,a)=>{const r=new Date(Date.UTC(e,t,a));return`${r.getUTCFullYear()}-${String(r.getUTCMonth()+1).padStart(2,"0")}-${String(r.getUTCDate()).padStart(2,"0")}`},Hu=(e,t,a,r)=>({from:Ul(e,t,a),to:new Date(Ul(e,t,a+r).getTime()-1),fromYmd:Wu(e,t,a),toYmd:Wu(e,t,a+r-1)});function Qv(e,t=0){if(e.period==="month"){const s=ga(e.monthRange),l=ca(),i=s?s.year:l.getFullYear(),u=(s?s.month1:l.getMonth()+1)-1+t,c=new Date(Date.UTC(i,u+1,0)).getUTCDate();return Hu(i,u,1,c)}const a=e.weekRanges.find(s=>s.value===e.weekRange);if(!a){const s=new Date,l=Pa();return{from:s,to:s,fromYmd:l,toYmd:l}}const r=Dn(a.year,a.month-1);return Hu(a.year,a.month-1,r+(a.week+t)*7,7)}const Go={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function Vu(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function qu({done:e,total:t,segments:a,color:r="var(--color-main)",size:s="medium",strokeWidth:l,label:i="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof s=="number"?s:Go[s].diameter,h=l??(typeof s=="number"?12:Go[s].strokeWidth),p=d/2,m=(d-h)/2,g=2*Math.PI*m;if(a&&a.length>0){const _=a.reduce((b,w)=>{const v=b.length>0?b[b.length-1].acc:0,A=Number.isFinite(w.ratio)?w.ratio:0,x=Math.max(0,Math.min(A,1-v));return b.push({color:w.color,rotate:-90+v*360,dash:g*x,acc:v+x}),b},[]);return n.jsx("div",{className:"ring-chart",style:{width:d,height:d},children:n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),_.map((b,w)=>b.dash>0&&n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:b.color,strokeWidth:h,strokeDasharray:`${b.dash} ${g}`,strokeLinecap:"round",transform:`rotate(${b.rotate} ${p} ${p})`},w))]})})}const y=(t??0)>0?Math.min((e??0)/t,1):0,C=g*y,f=g-C;return n.jsxs("div",{className:"ring-chart",style:{width:d,height:d},children:[n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),y>0&&n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:r,strokeWidth:h,strokeDasharray:`${C} ${f}`,strokeLinecap:y<.02||y>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":s==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:Vu(y)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||s==="medium"?" ring-chart__label--tight":""}`,children:i})]})]})}function e4({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:s,totalLabelKey:l,legend:i,loading:u,className:c,inGrid:d=!1,onClick:h,ariaLabel:p,tooltip:m,...g}){const{t:y}=xe.useTranslation();if(!e)return n.jsx(qu,{...g});const C=(g.total??0)>0?Vu(Math.min((g.done??0)/g.total,1)):0,f=g.size==="small",_=typeof g.size=="number"?g.size:Go[g.size??"medium"].diameter,b=g.size==="large",w=[c,f?"chart-section--compact":b?"chart-section--full":""].filter(Boolean).join(" ")||void 0,v=r&&n.jsx("span",{className:se("chart-section-icon"),children:n.jsx(at,{icon:r,className:se("chart-section-icon-inner")})});return n.jsx(Ho,{className:w,inGrid:d,onClick:h,ariaLabel:p,tooltip:m,title:y(e),titleLevel:t,titleClassName:f?"h5 chart-section-title--small":void 0,headRight:v||(f?void 0:a),subRow:(s||i)&&n.jsxs(n.Fragment,{children:[s?n.jsxs(er,{label:!f&&l?y(l):void 0,children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:C}),n.jsx("span",{className:se("chart-section__total__unit h5"),children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Wo,{items:i})]}),children:u?n.jsx("div",{className:se("ring-chart-section-body ring-chart-section-body--offset"),children:n.jsx("div",{className:"ring-chart ring-chart--loading",style:{width:_,height:_},"aria-busy":"true",children:n.jsx(pa,{size:32})})}):n.jsx("div",{className:se("ring-chart-section-body ring-chart-section-body--offset"),children:n.jsx(qu,{...g,hideCenter:g.hideCenter??f})})})}function t4({label:e,value:t,change:a,changeType:r,icon:s,tooltip:l,onClick:i,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:h,close:p}=Oa(),m=o.useCallback(()=>{l&&c.current&&h(c.current)},[l,h]),g=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),y=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(f=>{i&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i())},[i]);return n.jsxs("div",{ref:c,className:se(`stat-chart__card${i?" stat-chart__card--clickable":""}`),onClick:i,onKeyDown:i?C:void 0,onPointerEnter:m,onPointerLeave:p,onFocus:m,onBlur:p,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":i?[e,t,y].filter(f=>f!==void 0&&f!=="").join(" "):void 0,children:[l&&d&&n.jsx(Tn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:l}),n.jsxs("div",{className:se("stat-chart__card__label-row"),children:[n.jsx("span",{className:se("stat-chart__card__label h5"),children:e}),s&&n.jsx("span",{className:se("stat-chart__card__icon"),children:n.jsx(at,{icon:s,className:se("stat-chart__card__icon-inner")})})]}),n.jsxs("div",{className:se("stat-chart__card__content"),children:[n.jsxs("div",{className:se("stat-chart__card__left"),children:[n.jsx("div",{className:se("stat-chart__card__value h2"),children:t}),y&&n.jsx("div",{className:se(`stat-chart__card__change stat-chart__card__change--${g??"neutral"} caption-1`),children:y})]}),u&&n.jsx("div",{className:se("stat-chart__card__body"),children:u})]})]})}function Uu({value:e,onChange:t,min:a=0,max:r=100,step:s=1,orientation:l="horizontal",size:i=24,disabled:u=!1,ariaLabel:c,length:d,className:h,label:p,formatValue:m,labelPos:g,labelAlign:y="right",showMinMax:C=!1,minLabel:f,maxLabel:_,showBgTick:b=!1,showFillTick:w=!1,tickStep:v,tickShape:A="dot"}){t&&!c&&Bt("Slider:unnamed","[ihab/Slider] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. label prop \uC740 \uAC12 \uD45C\uAE30 \uBC29\uC2DD\uC774\uC9C0 \uC774\uB984\uC774 \uC544\uB2D9\uB2C8\uB2E4.");const x=Math.min(r,Math.max(a,e)),E=r>a?(x-a)/(r-a):0,B=l==="vertical",D=!t,N=Y=>t?.(Number(Y.target.value)),k=typeof d=="number"?`${d}px`:d,P={"--slider-ratio":String(E),"--slider-thumb":`${i}px`,...k?B?{height:k}:{width:k}:{}},$=v??s,G=(b||w)&&$>0&&r>a?Math.floor((r-a)/$+1e-6):0;if(G>0&&G<=100){const Y=A!=="dash",U=ue=>Y?`radial-gradient(circle, ${ue} 0.5px, transparent 1px)`:B?`linear-gradient(to bottom, transparent calc(50% - 2px), ${ue} calc(50% - 2px), ${ue} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${ue} calc(50% - 2px), ${ue} calc(50% + 2px), transparent calc(50% + 2px))`,j=Y?"2px":"4px",R=[],z=[],O=[];for(let ue=0;ue<=G;ue++){const te=ue*$/(r-a);if(te>1+1e-6)break;const de=`${((B?1-te:te)*100).toFixed(4)}%`,ee=te<=E+1e-6;if(ee?!w:!b)continue;const V=ee?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";R.push(U(V)),z.push(B?`${j} var(--slider-thumb)`:`var(--slider-thumb) ${j}`),O.push(B?`center ${de}`:`${de} center`)}R.push(B?"linear-gradient(to top, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))":"linear-gradient(to right, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))"),z.push("100% 100%"),O.push("0 0"),P.backgroundImage=R.join(", "),P.backgroundSize=z.join(", "),P.backgroundPosition=O.join(", "),P.backgroundRepeat="no-repeat"}const T=m?m(x):p==="percent"?`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`:p==="count"?`${x} / ${r}`:x===a&&f?f:x===r&&_?_:void 0,F=n.jsx("input",{type:"range",className:Ae("slider",`slider--${l}`,D&&"slider--static",!p&&!C&&h),min:a,max:r,step:s,value:x,disabled:u,readOnly:D,tabIndex:D?-1:void 0,"aria-label":c,"aria-valuetext":T,"aria-orientation":l,onChange:N,style:P});if(!p&&!C)return F;const M=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:f??a}),Q=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),Z=C?n.jsxs("div",{className:Ae("slider-track-group",`slider-track-group--${l}`,!p&&h),children:[B?Q:M,F,B?M:Q]}):F;if(!p)return Z;const I=g??(B?"bottom":"right"),K=`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`,L=m?m(x):p==="percent"?K:p==="count"?`${x} / ${r}`:String(x),W=n.jsx("span",{className:"slider-wrap__value body-3b",children:L});return n.jsxs("div",{className:Ae("slider-wrap",`slider-wrap--${l}`,`slider-wrap--label-${I}`,`slider-wrap--align-${y}`,h),children:[Z,W]})}const n4=.86,a4=250,Ko=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Yo=(e,t,a,r)=>{const s=Ko(e,t,a,r);return`${s<0?"-":"+"}${Math.abs(s)} dB`};function Zo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:s,labelPos:l,labelAlign:i="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:h=25,className:p,ariaLabel:m}){const g=o.useRef(null),y=o.useRef(null),C=o.useRef(null),f=o.useRef(null),[_,b]=o.useState(null);o.useEffect(()=>{const x=F=>{const M=Yo(F,c,d,h);C.current&&(C.current.textContent=M);const Q=g.current;Q&&(Q.setAttribute("aria-valuenow",String(Ko(F,c,d,h))),Q.setAttribute("aria-valuetext",M))},E=e??G1(t)??(_&&_.el===t?_.node:null),B=y.current;if(!E||!B){B?.style.setProperty("--meter-level","0"),x(u);let F=!1;return!e&&t&&sr(t).then(M=>{!F&&M&&b({el:t,node:M})}),()=>{F=!0}}ao();const D=new Float32Array(E.fftSize);let N=0,k=0,P=0,$=0,G=null;const T=F=>{const M=K1(E,D);N=M>N?M:N*n4;const Q=N>1e-5?20*Math.log10(N):-1/0,Z=Math.max(u,Q),I=Z-c,K=Math.min(1,Math.max(0,(I-d)/(h-d)));if(B.style.setProperty("--meter-level",K.toFixed(3)),k+=Z,P+=1,F-$>=a4){const L=k/P;G=G==null?L:G*.6+L*.4,x(G),k=0,P=0,$=F}f.current=requestAnimationFrame(T)};return f.current=requestAnimationFrame(T),()=>{f.current!=null&&cancelAnimationFrame(f.current),f.current=null}},[e,t,_,u,c,d,h]);const w=typeof r=="number"?`${r}px`:r,v=n.jsx("div",{className:"audio-meter__track",style:w?a==="vertical"?{height:w}:{width:w}:{},children:n.jsx("div",{ref:y,className:"audio-meter__fill"})}),A=l??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:g,className:Ae("audio-meter",`audio-meter--${a}`,s&&`audio-meter--label-${A}`,s&&`audio-meter--align-${i}`,p),role:"meter","aria-label":m,"aria-valuemin":d,"aria-valuemax":h,"aria-valuenow":Ko(u,c,d,h),"aria-valuetext":Yo(u,c,d,h),children:[v,s&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Yo(u,c,d,h)})]})}const Gu=260;function Ku({message:e,position:t,duration:a,onClose:r}){const[s,l]=o.useState(!1),[i,u]=o.useState(!1),c=o.useRef(i),d=o.useRef(s);o.useEffect(()=>{c.current=i},[i]),o.useEffect(()=>{d.current=s},[s]);const h=o.useRef(null),p=o.useRef(""),m=o.useRef(r);o.useEffect(()=>{m.current=r});const g=a,y=o.useRef(null),C=o.useRef(0),f=o.useRef(0),_=o.useRef(!1),b=o.useRef(null),w=o.useRef(null),v=o.useRef(null),A=o.useRef(null),x=o.useRef(()=>{});x.current=D=>{D<0||(C.current=Date.now(),f.current=D,y.current=setTimeout(()=>{y.current=null,l(!1),b.current=setTimeout(()=>{u(!1);try{m.current()}catch{}},Gu)},D))};const E=o.useCallback(()=>{_.current||!y.current||(_.current=!0,clearTimeout(y.current),y.current=null,f.current=Math.max(0,f.current-(Date.now()-C.current)))},[]),B=o.useCallback(()=>{_.current&&(_.current=!1,x.current(f.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(y.current&&(clearTimeout(y.current),y.current=null),b.current&&(clearTimeout(b.current),b.current=null)),e){if(d.current)return g>0&&!y.current&&(_.current?f.current=g:x.current(g)),p.current=e,()=>{y.current&&(clearTimeout(y.current),y.current=null),b.current&&(clearTimeout(b.current),b.current=null)};const D=()=>{const N=h.current;if(N)try{N.classList.remove("is-visible"),N.style.transition="none",t==="top"?N.style.transform="translateX(-50%) translateY(-16px)":N.style.transform="translateX(-50%) translateY(16px)",N.style.opacity="0",N.offsetWidth,N.style.transition="",N.classList.add("is-visible"),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null;try{N.style.opacity="",N.style.transform="",N.style.transition=""}catch{}},60)}catch{}};c.current?(D(),l(!0)):(u(!0),w.current=requestAnimationFrame(()=>{v.current=requestAnimationFrame(()=>{D(),l(!0)})})),g>0&&(_.current=!1,x.current(g))}else l(!1),b.current=setTimeout(()=>u(!1),Gu);return p.current=e,()=>{y.current&&clearTimeout(y.current),b.current&&clearTimeout(b.current),w.current&&cancelAnimationFrame(w.current),v.current&&cancelAnimationFrame(v.current),A.current&&clearTimeout(A.current),y.current=null,b.current=null,w.current=null,v.current=null,A.current=null}},[e,g,t]),{mounted:i,showing:s,popupRef:h,pause:E,resume:B}}function ya({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:s=2e3}){const{mounted:l,showing:i,popupRef:u,pause:c,resume:d}=Ku({message:e,position:t,duration:s,onClose:r}),h=o.useRef(null),[p,m]=o.useState(!1);if(o.useEffect(()=>{i?m(!0):l||m(!1)},[i,l]),!l)return null;const g=a==="notice"||a==="warning"?a:"normal",y=n.jsx("div",{ref:u,className:`toast toast--${t} ${i?"is-visible":""}`,role:"status","aria-live":"polite",onPointerEnter:C=>{h.current=C.pointerType},onMouseEnter:()=>{h.current!=="touch"&&c()},onMouseLeave:d,onFocusCapture:c,onBlurCapture:d,children:n.jsx("div",{className:`toast__inner toast__inner--${g} body-2`,"aria-hidden":p||i?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?pn.createPortal(y,document.body):y}const r4=24;function o4({value:e,max:t=100,size:a=8,color:r,trackColor:s,label:l,formatValue:i,labelPos:u,labelAlign:c="right",ariaLabel:d,className:h}){const p=Number.isFinite(t)&&t>0?t:1,m=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),g=m/p*100,y=Number.isFinite(t)&&t>0?t:0,C=u??(a>=r4?"inside":"bottom"),f=C==="center"?"inside":C,_=f==="inside"&&(c==="left"?g>=15:c==="center"?g>=50:g>=85),b={};return r&&(b["--progress-bar-fill"]=r),s&&(b["--progress-bar-track"]=s),n.jsxs("div",{className:Ae("progress-bar",`progress-bar--${a}`,`progress-bar--label-${f}`,l&&`progress-bar--align-${c}`,l&&_&&"progress-bar--label-on-fill",h),style:b,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":y,"aria-valuetext":l?i?i(m):l==="percent"?void 0:l==="raw"?String(m):`${m} / ${y}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${g}%`}})}),l&&n.jsx("span",{className:"progress-bar__label caption-1b",children:i?i(m):l==="percent"?`${Math.round(g)}%`:l==="raw"?String(m):`${m} / ${y}`})]})}const Yu={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},s4="rgba(255, 255, 255, 0.16)";function Zu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:s,variant:l="numbered",announce:i=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=yn("(max-width: 767px)");if(!Number.isInteger(e)||e<=0)return null;const h=Number.isInteger(t)?Math.max(0,Math.min(t,e-1)):0,p=u??c("progress.steps",{current:h+1,total:e,defaultValue:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"}),m={};if(a&&(m["--pi-inactive-bg"]=a),r&&(m["--pi-inactive-color"]=r),s&&(a||(m["--pi-inactive-bg"]=s4),r||(m["--pi-inactive-color"]="var(--color-white)")),l==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:m,role:i?"status":"img","aria-label":i?void 0:p,children:[i&&n.jsx("span",{style:Yu,children:p}),Array.from({length:e}).map((y,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<h?" done":C===h?" active":""}`},C))]});const g=i?n.jsx("span",{role:"status",style:Yu,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:m,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[h+1," / ",e]})}),g]}):n.jsxs(n.Fragment,{children:[g,n.jsx("div",{className:"progress-indicator",style:m,role:"list","aria-label":p,children:Array.from({length:e}).map((y,C)=>n.jsx("span",{role:"listitem","aria-current":C===h?"step":void 0,className:`progress-indicator-dot ${C<h?" done":C===h?" active":""} body-3`,children:C+1},C))})]})}function l4(e){if(!e)return[];const t=[];let a=0,r="";for(const s of e.trim()){if(s==="("?a++:s===")"&&a--,/\s/.test(s)&&a===0){r&&(t.push(r),r="");continue}r+=s}return r&&t.push(r),t}function i4(e,t,a=0){const r=Array.from({length:Math.max(0,t)},()=>0);for(const s of e){let l=0;for(const i of s){if(l>=r.length)break;const u=Xu(i.span),c=Math.min(u,r.length-l);if(c===1)r[l]=Math.max(r[l],i.width);else{const d=Math.max(0,(i.width-a*(c-1))/c);for(let h=l;h<l+c;h++)r[h]=Math.max(r[h],d)}l+=c}}return r}function Xu(e){const t=typeof e=="number"?e:parseInt(String(e??""),10);return Number.isFinite(t)&&t>=1?Math.floor(t):1}function u4(e,t){const a=/span\s+(\d+)/.exec(`${e??""} ${t??""}`);return a?Xu(parseInt(a[1],10)):1}function c4(e,t){const{isFixed:a,floorOf:r,containerWidth:s}=t,l=e.reduce((p,m,g)=>p+(a(g)?m:0),0),i=e.reduce((p,m,g)=>p+(a(g)?0:m),0),u=s-l;if(!(s>0&&i>0&&u>0))return[...e];const c=u/i,d=e.map((p,m)=>a(m)?p:Math.max(r(m),Math.round(p*c))),h=Math.round(u-d.reduce((p,m,g)=>p+(a(g)?0:m),0));if(h!==0){let p=-1;d.forEach((m,g)=>{!a(g)&&(p<0||m>d[p])&&(p=g)}),p>=0&&(d[p]=Math.max(r(p),d[p]+h))}return d}const d4=16;function p4(e,t=d4){return e.map(a=>{const r=a.sortable&&!a.sorted;return Math.max(a.declaredMin,Math.ceil(a.headWidth+(r?t:0)))})}function h4({children:e,className:t,style:a,span:r,rowLabel:s,onRowClick:l}){const i=r&&r>1?{gridColumn:`span ${r}`,...a}:a;return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:i,"aria-colspan":r&&r>1?r:void 0,children:s&&l?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":s,children:e}):e})}function Xo({variant:e="default",children:t,className:a,draggable:r,onClick:s,onMouseEnter:l,onMouseLeave:i,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:h,describedBy:p,rowHasButton:m}){const g=o.useCallback(y=>{s&&y.target===y.currentTarget&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),s())},[s]);return e==="loading"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--loading",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row__full-cell",children:n.jsx(pa,{size:28})})})}):e==="empty"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--empty body-3",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row__full-cell",children:t})})}):n.jsxs("div",{role:"presentation",className:"table-row-wrap",children:[n.jsx("div",{className:a?`table-row ${a}`:"table-row",draggable:r,onClick:s,onKeyDown:s?g:void 0,onMouseEnter:l,onMouseLeave:i,onDragStart:u,onDragEnd:c,role:"row",tabIndex:s&&!m?0:void 0,"aria-describedby":s&&!m?p:void 0,children:t}),d&&n.jsx("div",{role:"row",className:"table-row-expand",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row-expand__cell",children:d})})]})}function m4({dir:e}){return n.jsx(e==="asc"?el:Qs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function C4({children:e,onClick:t,className:a,sortDir:r,ariaSort:s,onResizeStart:l}){const i=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(m4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":s,className:Ae("table-field body-3",a,r?"table-field--sorted":"",l?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:i}):i,l&&n.jsx("span",{className:"table-field__resizer",onPointerDown:l,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Ju(e){return e&&e!=="left"?`table-col--${e}`:void 0}function Jo({fields:e=[],sort:t,sortable:a=!0,headerGroups:r,items:s=[],renderRow:l,onRowClick:i,isRowClickable:u,onRowMouseEnter:c,onRowMouseLeave:d,onRowDragStart:h,onRowDragEnd:p,draggingId:m,gridTemplateColumns:g,mobileGridTemplateColumns:y,resizable:C=!0,resizeMode:f="grow",resizeStorageKey:_,size:b="small",title:w,icon:v,count:A,collapsed:x=!1,onToggleCollapse:E,headerActions:B,empty:D,loading:N,dragOver:k=!1,onDragOver:P,onDragLeave:$,onDrop:G,renderExpandedRow:T,expandedId:F}){const{t:M}=xe.useTranslation(),Q=o.useId(),Z=`table-title-${Q}`,I=`table-row-hint-${Q}`,[K,L]=o.useState(null),W=o.useCallback((re,ve)=>{const Ie=e[ve];if(!Ie)return;if(Ie.sortValue)return Ie.sortValue(re);if(Ie.sortKey)return re[Ie.sortKey];const We=l(re)[ve]?.content;return typeof We=="string"||typeof We=="number"?We:void 0},[e,l]),Y=!t&&a&&!e.some(re=>re.sortDir!==void 0||re.onClick),U=o.useCallback(re=>{const ve=e[re];if(!ve||ve.sortable===!1)return!1;if(ve.sortValue||ve.sortKey)return!0;const Ie=s[0];return Ie!==void 0&&W(Ie,re)!==void 0},[e,s,W]),j=o.useMemo(()=>t?e.map(re=>{if(!re.sortKey||re.sortDir!==void 0)return re;const ve=t.field(String(re.label??""),re.sortKey);return{...re,sortDir:ve.sortDir,onClick:re.onClick??ve.onClick}}):Y?e.map((re,ve)=>U(ve)?{...re,sortDir:K?.index===ve?K.asc?"asc":"desc":null,onClick:()=>L(Ie=>Ie?.index===ve?{index:ve,asc:!Ie.asc}:{index:ve,asc:!0})}:re):e,[e,t,Y,K,U]),R=o.useMemo(()=>{if(!Y||!K)return s;const{index:re,asc:ve}=K;return[...s].sort((Ie,We)=>fr(W(Ie,re),W(We,re),ve))},[s,Y,K,W]),z=yn("(max-width: 767px)"),O=y&&z?y:null,ue=C&&!z,te=o.useRef(ue);te.current=ue;const de=48,ee=40,V=o.useRef(()=>de),ae=_?`table-cols:${_}`:null,H=o.useRef(null),q=o.useRef(null),ie=o.useRef(null),Ne=o.useRef(null),[_e,he]=o.useState(!1),[je,$e]=o.useState(0),De=o.useCallback(()=>{const re=ie.current;if(!re)return;const ve=Ne.current,Ie=H.current;if(ve&&(ve.style.minWidth="",Ie)){const We=Ie.scrollWidth,Qe=te.current?ee:0;ve.style.minWidth=We>re.clientWidth+1?`${We+Qe}px`:""}he(re.scrollWidth>re.clientWidth+1),$e(re.clientWidth)},[]),le=o.useCallback((re,ve)=>{const Ie=re.current;Ie&&q.current&&q.current.unobserve(Ie),re.current=ve,ve?(!q.current&&typeof ResizeObserver<"u"&&(q.current=new ResizeObserver(()=>De())),q.current?.observe(ve)):!ie.current&&!Ne.current&&(q.current?.disconnect(),q.current=null),De()},[De]),we=o.useCallback(re=>le(ie,re),[le]),Le=o.useCallback(re=>le(Ne,re),[le]);o.useEffect(()=>{De()}),o.useEffect(()=>{if(typeof window>"u")return;const re=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>De()):null;return window.addEventListener("resize",De),()=>{re!=null&&cancelAnimationFrame(re),window.removeEventListener("resize",De)}},[De]);const Be=o.useRef(()=>!1),ze=o.useRef([]),Ve=o.useRef(null),ut=re=>{if(!re||typeof window>"u")return null;try{const ve=JSON.parse(window.localStorage.getItem(re)??"null");return Array.isArray(ve)&&ve.length>0&&ve.every(Ie=>typeof Ie=="number"&&Number.isFinite(Ie)&&Ie>0)?ve:null}catch{return null}},[et,Xe]=o.useState(()=>ut(ae)),[yt,Te]=o.useState(ae),[Ke,ke]=o.useState(()=>ut(ae)!==null);if(yt!==ae){Te(ae);const re=ut(ae);Xe(re),ke(re!==null)}const qe=o.useRef(et);o.useEffect(()=>{qe.current=et},[et]);const Je=o.useCallback(re=>{const ve=Ve.current;if(!ve)return;const Ie=qe.current;if(Ie){const We=[...Ie],Qe=()=>de;if(ve.next!=null&&ve.startWNext!=null){const st=re.clientX-ve.startX,Tt=Math.max(Qe()-ve.startW,Math.min(ve.startWNext-Qe(),st));We[ve.index]=ve.startW+Tt,We[ve.next]=ve.startWNext-Tt}else We[ve.index]=Math.max(Qe(),ve.startW+(re.clientX-ve.startX));qe.current=We,Xe(We)}},[]),tt=o.useCallback(()=>{if(Ve.current=null,window.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),document.body.style.cursor="",document.body.style.userSelect="",ae&&qe.current)try{window.localStorage.setItem(ae,JSON.stringify(qe.current))}catch{}},[Je,ae]),xt=o.useCallback((re,ve)=>{ve.preventDefault(),ve.stopPropagation();const Ie=H.current;if(!Ie)return;const We=Array.from(Ie.children).map(st=>st.getBoundingClientRect().width),Qe=f==="fit"?j.findIndex((st,Tt)=>Tt>re&&st.resizable!==!1):-1;Ve.current=Qe>=0?{index:re,startX:ve.clientX,startW:We[re],next:Qe,startWNext:We[Qe]}:{index:re,startX:ve.clientX,startW:We[re]},qe.current=We,Xe(We),ke(!0),window.addEventListener("pointermove",Je),window.addEventListener("pointerup",tt),window.addEventListener("pointercancel",tt),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Je,tt,f,j]),wt=o.useCallback(()=>{const re=H.current,ve=re?.closest(".table-wrap");if(!re||!ve)return null;const Ie=ve.style.getPropertyValue("--table-grid-cols");ve.style.setProperty("--table-grid-cols",j.map(()=>"max-content").join(" "));const We=Array.from(ve.querySelectorAll(".table-row")).filter(St=>!St.classList.contains("table-row--loading")&&!St.classList.contains("table-row--empty")),Qe=St=>Array.from(St.children).map(Rt=>{const Wt=window.getComputedStyle(Rt);return{width:Rt.getBoundingClientRect().width,span:u4(Wt.gridColumnStart,Wt.gridColumnEnd)}}),st=parseFloat(window.getComputedStyle(re).columnGap)||0,Tt=We.map(Qe),ln=Qe(re),un=i4([ln,...Tt],j.length,st),$t=p4(j.map((St,Rt)=>({declaredMin:V.current(Rt),headWidth:ln[Rt]?.width??0,sortable:St.sortDir!==void 0||!!St.onClick,sorted:!!St.sortDir}))),Ot=St=>$t[St]??V.current(St),cn=j.map((St,Rt)=>{const Wt=un[Rt],Kt=Be.current(Rt)?parseFloat(ze.current[Rt]):NaN;return Number.isFinite(Kt)&&Math.ceil(Wt)>Kt&&Bt(`table-fixed-col-overflow:${Rt}:${Kt}`,`[ihabdevteam-core] Table \uC758 ${Rt+1}\uBC88\uC9F8 \uC5F4\uC744 ${Kt}px \uB85C \uC815\uD574 \uB450\uC5C8\uB294\uB370 \uC548\uC758 \uB0B4\uC6A9\uC740 ${Math.ceil(Wt)}px \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 \u2014 \uADF8\uB9CC\uD07C \uC798\uB824 \uB098\uAC11\uB2C8\uB2E4. gridTemplateColumns(\uB610\uB294 fields[].width)\uC758 \uADF8 \uC5F4\uC744 ${Math.ceil(Wt)}px \uC774\uC0C1\uC73C\uB85C \uB298\uB9AC\uC138\uC694.`),Number.isFinite(Kt)?Kt:Math.max(V.current(Rt),Math.ceil(Wt))}),Pt=window.getComputedStyle(re),kn=(parseFloat(Pt.paddingLeft)||0)+(parseFloat(Pt.paddingRight)||0),Jt=ve.clientWidth-kn;return Ie?ve.style.setProperty("--table-grid-cols",Ie):ve.style.removeProperty("--table-grid-cols"),c4(cn,{isFixed:St=>Be.current(St),floorOf:Ot,containerWidth:Jt})},[j,f]),Dt=(re,ve)=>re!==null&&re.length===ve.length&&re.every((Ie,We)=>Ie===ve[We]),rt=o.useRef(wt);o.useEffect(()=>{rt.current=wt});const[nt,kt]=o.useState(0),At=R.length>0,Lt=`${ae??""}|${nt}|${j.length}|${je}`,jt=!Ke&&ue&&ae!==null&&!N?`${Lt}|${At?1:0}`:null,vt=o.useRef(null);o.useEffect(()=>{if(jt===null||!At||vt.current===Lt)return;const re=rt.current();re&&(vt.current=Lt,Xe(ve=>Dt(ve,re)?ve:re))},[jt]);const ot=o.useCallback(()=>{if(ae)try{window.localStorage.removeItem(ae)}catch{}ke(!1);const re=rt.current();Xe(re),qe.current=re,kt(ve=>ve+1)},[ae]);o.useEffect(()=>()=>{Ve.current&&(window.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),document.body.style.cursor="",document.body.style.userSelect="")},[Je,tt]);const ct=j.length>0&&j.every(re=>re.width!=null)?j.map(re=>typeof re.width=="number"?`${re.width}px`:String(re.width)).join(" "):null;j.some(re=>re.width!=null)&&!ct&&Bt(`table-field-width:${j.map(re=>re.width==null?"-":"w").join("")}`,"[ihabdevteam-core] Table \uC758 fields \uC911 \uC77C\uBD80\uC5D0\uB9CC width \uAC00 \uC788\uC2B5\uB2C8\uB2E4. **\uBAA8\uB4E0 \uC5F4\uC5D0 \uC801\uC5B4\uC57C** \uC4F0\uC785\uB2C8\uB2E4 \u2014 \uC9C0\uAE08\uC740 gridTemplateColumns \uB97C \uC501\uB2C8\uB2E4. \uD55C \uC5F4\uB9CC \uACE0\uC815\uD558\uACE0 \uC2F6\uC73C\uBA74 \uB098\uBA38\uC9C0\uC5D0 `minmax(0, 1fr)` \uCC98\uB7FC \uC801\uC5B4 \uC8FC\uC138\uC694."),ct&&g&&Bt("table-field-width-conflict","[ihabdevteam-core] Table \uC5D0 fields[].width \uC640 gridTemplateColumns \uAC00 \uB458 \uB2E4 \uC788\uC2B5\uB2C8\uB2E4. gridTemplateColumns \uAC00 \uC774\uAE41\uB2C8\uB2E4 \u2014 \uD55C\uCABD\uB9CC \uB450\uC138\uC694.");const dt=g??ct??void 0,_t=l4(dt),Ce=_t.filter(re=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(re));Ce.length>0&&Bt(`table-content-track:${g}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Ce.join(", ")})\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uBA38\uB9AC\uC640 \uBAB8\uD1B5\uC740 \uC11C\uB85C \uB2E4\uB978 \uACA9\uC790\uB77C \uADF8 \uD2B8\uB799\uC774 \uAC01\uC790 \uB2E4\uB974\uAC8C \uD480\uB824 \uC5F4\uC774 \uC5B4\uAE0B\uB0A9\uB2C8\uB2E4. px \uC774\uB098 fr \uC744 \uC4F0\uC138\uC694. (\uBC1B\uC740 \uAC12: ${g})`);const Pe=j.findIndex(re=>!!re.sortDir);j.filter(re=>!!re.sortDir).length>1&&Bt("table-multi-sort","[ihabdevteam-core] Table \uC758 fields \uC5D0 sortDir \uC774 \uB458 \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4. aria-sort \uB294 \uD45C \uD558\uB098\uC5D0 \uD55C \uCE78\uB9CC \uAC00\uC9C8 \uC218 \uC788\uC5B4 \uCCAB \uCE78\uB9CC \uBC29\uD5A5\uC73C\uB85C \uC54C\uB9AC\uACE0 \uB098\uBA38\uC9C0\uB294 none \uC73C\uB85C \uB461\uB2C8\uB2E4.");const ye=re=>re===Pe?j[re].sortDir==="asc"?"ascending":"descending":j[re].onClick?"none":void 0,Ye=re=>/^\d+(\.\d+)?px$/.test(_t[re]??""),bt=re=>{const ve=_t[re]??"",Ie=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(ve)??/^(\d+(?:\.\d+)?)px$/.exec(ve);return Ie?parseFloat(Ie[1]):de};Be.current=Ye,V.current=bt,ze.current=_t;const Nt=re=>f==="fit"&&!Ye(re)?"fr":"px",mt=et&&et.length===j.length&&!z,gt=O??(mt?j.map((re,ve)=>re.resizable===!1&&_t[ve]?_t[ve]:`${et[ve]}${Nt(ve)}`).join(" "):dt),Me=gt?{"--table-grid-cols":gt}:void 0,lt=w!==void 0;return n.jsxs("div",{ref:we,className:`table-wrap table-wrap--${b}${ue?" table-wrap--resizable":""}${k?" table-wrap--dragover":""}${x?" table-wrap--collapsed":""}`,style:Me,onDragOver:P,onDragLeave:$,onDrop:G,tabIndex:_e?0:void 0,role:_e?"region":void 0,"aria-label":_e?typeof w=="string"?w:M("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:I,className:"table-row-hint",children:M("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:Le,role:"table","aria-labelledby":lt&&typeof w=="string"?Z:void 0,className:"table body-2",children:[lt&&n.jsxs("div",{className:Ae("table-header",E&&"table-header--clickable"),onClick:E,role:"caption",children:[E&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:x?"chevron-right":"chevron-down",ariaLabel:x?M("common.expand","\uD3BC\uCE58\uAE30"):M("common.collapse","\uC811\uAE30"),ariaExpanded:!x,className:"table-header__chevron"}),v&&n.jsx(at,{icon:v,label:typeof w=="string"?w:void 0,className:"table-header__icon"}),n.jsx("span",{id:Z,className:"table-header__title h5b",children:w}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),B&&n.jsx("span",{className:"table-header__actions",onClick:re=>re.stopPropagation(),children:B})]}),!x&&n.jsxs(n.Fragment,{children:[r&&r.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:r.map((re,ve)=>n.jsx("div",{role:"columnheader","aria-colspan":re.span,className:Ae("table-field body-3",re.className),style:{gridColumn:`span ${re.span}`},children:re.label},ve))}),n.jsxs("div",{role:"presentation",className:Ae("table-fields-strip",ue&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:H,children:j.map((re,ve)=>n.jsx(C4,{onClick:re.onClick,className:Ae(re.className,Ju(re.align)),sortDir:re.sortDir,ariaSort:ye(ve),onResizeStart:ue&&ve<j.length-1&&re.resizable!==!1&&(f!=="fit"||j.some((Ie,We)=>We>ve&&Ie.resizable!==!1))?Ie=>xt(ve,Ie):void 0,children:re.label},ve))}),ue&&n.jsx("div",{className:"table-fields__reset-dock",children:n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:ot})})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:N?n.jsx(Xo,{variant:"loading",colSpan:j.length||void 0}):R.length===0&&D?n.jsx(Xo,{variant:"empty",colSpan:j.length||void 0,children:D}):R.map((re,ve)=>{const Ie=m!=null&&re.id===m,We=!!i&&(u?u(re):!0),Qe=F!=null&&re.id!=null&&(F instanceof Set?F.has(re.id)||[...F].some(st=>String(st)===String(re.id)):String(re.id)===String(F));return n.jsx(Xo,{className:`${We?" table-row--clickable":""}${h?" table-row--draggable":""}${Ie?" table-row--dragging":""}`.trim(),draggable:!!h,onClick:We?()=>i(re):void 0,colSpan:j.length||void 0,rowHasButton:l(re).some(st=>!!st.rowLabel),describedBy:I,onMouseEnter:c?st=>c(re,st):void 0,onMouseLeave:d?st=>d(re,st):void 0,onDragStart:h?st=>h(re,st):void 0,onDragEnd:p?st=>p(re,st):void 0,expandedContent:Qe&&T?T(re):void 0,children:l(re).map((st,Tt)=>n.jsx(h4,{className:Ae(st.className,Ju(j[Tt]?.align)),style:st.style,span:st.span,rowLabel:We?st.rowLabel:void 0,onRowClick:We?()=>i(re):void 0,children:st.content},Tt))},re.id!=null?`${typeof re.id}:${re.id}`:`__idx:${ve}`)})})]})]})]})}function Qu(e,t){return t!=="wornAt"?String(e[t]??""):Bv(e.wornYear,e.wornMonth,e.wornDay)}function f4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:s,onRelease:l,onAdd:i}){const{t:u,i18n:c}=xe.useTranslation(),d=f=>f==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:h,field:p}=Ly(),m=o.useMemo(()=>{if(!h)return e;const{key:f,asc:_}=h;return[...e].sort((b,w)=>{if(f==="worn"){const v=Number(w.worn)-Number(b.worn);return _?v:-v}return fr(Qu(b,f),Qu(w,f),_)})},[e,h]),{pageRows:g,pageSizeProps:y,paginationProps:C}=My(m,h);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(zo,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:y,pagination:C,actions:i&&n.jsx(be,{htmlType:"button",size:40,type:"bar",variant:"main",icon:"plus",label:u("customers.device.addButton","\uAE30\uAE30 \uCD94\uAC00"),onClick:i})}),n.jsx(Jo,{loading:t,resizable:!0,resizeMode:"fit",resizeStorageKey:"customer-device-history-v2",fields:[{...p(u("customers.device.wearingNow","\uCC29\uC6A9"),"worn"),resizable:!1},p(u("device.direction.label","\uBC29\uD5A5"),"side"),p(u("device.deviceType","\uC885\uB958"),"device"),p(u("device.brand","\uBE0C\uB79C\uB4DC"),"brand"),p(u("device.fitType","\uCC29\uC6A9\uD615\uD0DC"),"fitType"),p(u("device.productName","\uC81C\uD488\uBA85"),"productName"),p(u("device.wornDate","\uCC29\uC6A9\uC77C"),"wornAt"),...r?[{label:"",resizable:!1}]:[]],items:g.map((f,_)=>({id:f.id??`${f.side}-${_}`,row:f})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:f})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(Io,{checked:f.worn,disabled:f.worn?!l:!s,ariaLabel:f.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?s?.(f):l?.(f)}})})},{content:n.jsx("span",{children:d(f.side)})},{content:f.device?n.jsx(on,{size:"small",variant:ku(f.device),fill:"soft",label:Au(f.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:f.brand})},{content:n.jsx("span",{children:f.fitType||"-"})},{content:n.jsx("span",{children:f.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Po(f.wornYear,f.wornMonth,f.wornDay,c.language)||"-"})},...r?[{content:n.jsx("span",{className:"dlp-row-actions",children:n.jsx(be,{htmlType:"button",size:28,type:"bar",variant:"transparent-gray",label:u("common.delete","\uC0AD\uC81C"),onClick:_=>{_?.stopPropagation(),r(f)}})})}]:[]],onRowClick:({row:f})=>a(f),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function ec(e,t){return e?{role:t?.role??"button",tabIndex:0,...t?.selected===void 0?{}:{"aria-selected":t.selected},onKeyDown:a=>{a.target===a.currentTarget&&(a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),e(a)))}}:{}}function b4(e,t){return new Date(e,t+1,0).getDate()}function g4(e,t){return new Date(e,t,1).getDay()}function y4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:s}){const{t:l,i18n:i}=xe.useTranslation(),u=o.useMemo(()=>l("calendar.dow",{returnObjects:!0}),[l]),c=ur(s),[d,h]=o.useState(()=>Number(c.slice(0,4))),[p,m]=o.useState(()=>Number(c.slice(5,7))-1),[g,y]=o.useState(null),C=o.useRef(null),f=o.useMemo(()=>{const x={};return e.forEach(E=>{x[E.date]||(x[E.date]=[]),x[E.date].push(E)}),x},[e]),_=o.useMemo(()=>{const x=b4(d,p),E=g4(d,p),B=[];for(let D=0;D<E;D++)B.push(null);for(let D=1;D<=x;D++)B.push(D);for(;B.length<35;)B.push(null);return B},[d,p]),b=o.useCallback(()=>{p===0?(h(x=>x-1),m(11)):m(x=>x-1)},[p]),w=o.useCallback(()=>{p===11?(h(x=>x+1),m(0)):m(x=>x+1)},[p]),v=x=>`${d}-${String(p+1).padStart(2,"0")}-${String(x).padStart(2,"0")}`,A=x=>v(x)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:b,"aria-label":l("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(at,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:io(l,i.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:w,"aria-label":l("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(at,{icon:"chevron-right",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsxs("div",{className:"calendar-nav__legend",children:[n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--main"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.visited","\uBC29\uBB38")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--sub"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.scheduled","\uC608\uC57D")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--disabled"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(x=>n.jsx("div",{className:"calendar-day-header body-3",children:x},x)),_.map((x,E)=>{if(x===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${E}`);const B=x,D=v(B),N=f[D]??[],k=Vl(D,i.language),P=g===D;return n.jsxs("div",{className:`calendar-cell${A(B)?" today":""}${P?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?l("calendar.addOnDate",{date:D}):void 0,"aria-current":A(B)?"date":void 0,onClick:r?()=>r(D):void 0,onKeyDown:r?$=>{$.target===$.currentTarget&&($.key!=="Enter"&&$.key!==" "||($.preventDefault(),r(D)))}:void 0,onDragOver:a?$=>{$.preventDefault(),y(D)}:void 0,onDragLeave:a?$=>{$.currentTarget.contains($.relatedTarget)||y(null)}:void 0,onDrop:a?$=>{$.preventDefault(),C.current!=null&&(a(C.current,D),C.current=null),y(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:B}),N.length>0&&(()=>{const $=[{key:"visited",label:l("calendar.legend.visited","\uBC29\uBB38"),count:N.filter(T=>(T.status??"visited")==="visited").length},{key:"scheduled",label:l("calendar.legend.scheduled","\uC608\uC57D"),count:N.filter(T=>T.status==="scheduled").length},{key:"noVisit",label:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:N.filter(T=>T.status==="noVisit").length}].filter(T=>T.count>0),G=$.length===1&&$[0].key==="visited"?l("calendar.visitCount",{count:N.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):$.map(T=>l("calendar.statusCount",{label:T.label,count:T.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${k} ${G}`,children:[$.map(T=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${T.key}`,"aria-hidden":"true"},T.key)),N.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:N.map(($,G)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${$.status==="noVisit"?" calendar-visit-badge--no-visit":$.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?T=>{C.current=$.id,T.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,y(null)}:void 0,onClick:t?T=>{T.stopPropagation(),t($)}:void 0,...ec(t?()=>t($):void 0),"aria-label":[k,$.time?Yl($.time,l):null,$.customer,l($.status==="noVisit"?"calendar.legend.noVisit":$.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[$.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Yl($.time,l)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:$.customer}),$.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},$.id??G))})]},B)})]})]})}const v4={page:"h3",pagePopup:"h4",popup:"h5"};function va({type:e="page",title:t,headingLevel:a=2,icon:r,action:s,disc:l,children:i,inGrid:u=!1,className:c,style:d}){const h=v4[e],p=t||l||s||r,m=a?`h${a}`:"div";return n.jsxs("div",{className:Ae("section",`section--${e}`,u&&"section--in-grid",c),style:d,children:[p&&n.jsxs("div",{className:"section__header",children:[n.jsxs("div",{className:"section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(m,{className:`section__title ${h}`,children:t}),l&&n.jsx("div",{className:"section__disc body-3",children:l})]})]}),s&&n.jsx("div",{className:"section__action",children:s})]}),i]})}let Qo=null,tc=!1;function nc(){if(tc||typeof document>"u")return;tc=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(Qo="keyboard")},!0);const e=()=>{Qo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}nc();function _r(){return nc(),Qo==="keyboard"}const xr=20;function _4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:s,renderPopup:l,completedIds:i,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:h,onRemove:p,onMore:m,sectionType:g="page"}=e||{},[,y]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],f=C.length,[_,b]=o.useState(Math.min(f,xr)),w=o.useMemo(()=>Array.isArray(s)?[...s,a?.label].filter(Boolean).join(" \xB7 "):[s||"",a?.label].filter(Boolean).join(" \xB7 "),[s,a?.label]);o.useEffect(()=>{b(Math.min(f,xr))},[f]),Oi("speechear.data.updated",()=>y(E=>E+1));const v=o.useRef(null),A=o.useRef(null);function x(){const E=document.activeElement;A.current=_r()&&E&&E.closest?.(".training-block__more")?_:null,b(B=>Math.min(f,B+xr))}return o.useEffect(()=>{const E=A.current;if(E==null)return;A.current=null;const B=document.activeElement;B&&B!==document.body||v.current?.querySelectorAll(".training-block-button")[E]?.focus()},[_]),n.jsxs(va,{type:g,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:v,children:(C||[]).slice(0,_).map((E,B)=>{const D=E;return n.jsx($o,{index:B,type:a,trainingData:D,depth:w,renderPopup:l,completedIds:i,selectedIds:u,size:d,useDescriptionTooltip:h,onRemove:typeof p=="function"&&u!=null&&D?.id!=null&&u.has(String(D.id))?()=>p(D):void 0,onComplete:typeof c=="function"&&D?.id!=null?()=>c(String(D.id)):void 0,onMore:typeof m=="function"?N=>m(D,N):void 0},D?.id!=null?`${a?.key||"t"}-${String(D.id)}`:`${a?.key||"t"}-${B}`)})}),f>xr&&_<f&&n.jsx("div",{className:"training-block__more",children:n.jsx(be,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:x,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function x4(e){let t=0;const a=r=>{Array.isArray(r)?r.forEach(a):r!=null&&r!==!1&&r!==!0&&r!==""&&t++};return a(e),t}function w4({gap:e=10,count:t,className:a,children:r}){const s=o.useRef(null),[l,i]=o.useState({width:0,card:0}),u=t??x4(r);o.useLayoutEffect(()=>{const m=s.current;if(!m)return;const g=()=>{const C=m.style.maxWidth;m.style.maxWidth="none";const f=m.clientWidth;m.style.maxWidth=C;const _=m.firstElementChild?.offsetWidth??0;i(b=>b.width===f&&b.card===_?b:{width:f,card:_})};if(g(),typeof ResizeObserver>"u")return;const y=new ResizeObserver(g);return y.observe(m),()=>y.disconnect()},[u,e]);const c=l.card>0?l.card:0,d=c>0?vf(l.width,c,e):0,h=d>0?_f(u,d):0,p={"--block-grid-gap":`${e}px`,...h>0?{"--block-grid-cols":h,"--block-grid-card":`${c}px`}:{}};return n.jsx("div",{ref:s,className:Ae("training-block-grid",h>0&&"training-block-grid--measured",a),style:p,"data-cols":h>0?h:void 0,children:r})}function es(e){const t=o.useRef(null),a=o.useRef(e);a.current=e;const[r,s]=o.useState({url:e,loading:!!e,failed:!1}),l=r.url===e?r:{loading:!!e,failed:!1};o.useEffect(()=>{const c=t.current;s({url:e,failed:!1,loading:!!e&&!(c?.complete&&c.naturalWidth>0)})},[e]);const i=o.useCallback(()=>{a.current===e&&s({url:e,loading:!1,failed:!1})},[e]),u=o.useCallback(()=>{a.current===e&&s({url:e,loading:!1,failed:!0})},[e]);return{imgRef:t,loading:l.loading,failed:l.failed,hasImage:!!e&&!l.failed,onLoad:i,onError:u}}var B4='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><g opacity=".3"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';const k4=B4,ts=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:s=!1,onSelect:l,flipDelay:i=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},h){const{t:p}=xe.useTranslation(),m=e.word||e.title||"",g=t||!m,y=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",f=e.colloquialLabel||"",[_,b]=o.useState({label:m,subLabel:C,colloquialLabel:f,homonum:e.homonum});m&&(_.label!==m||_.subLabel!==C||_.colloquialLabel!==f||!Object.is(_.homonum,e.homonum))&&b({label:m,subLabel:C,colloquialLabel:f,homonum:e.homonum});const w=o.useRef(null),v=yn("(max-width: 767px)"),[A,x]=o.useState(!1),[E,B]=o.useState(!1),D=`${typeof y=="string"?y:y?.src??""}\0${m}`,[N,k]=o.useState({for:"",url:""}),P=N.for===D?N.url:"",$=zl(),G=e.textOnly??(!e.image&&!!_.label&&!!$&&$.entries.length>0&&!$.byWord.has(_.label)),T=G?"":ua()?.(_.label,_.homonum)??e.image??"",{imgRef:F,loading:M,hasImage:Q,onLoad:Z,onError:I}=es(T);o.useEffect(()=>{let O=!1;return(async()=>{if(y){if(typeof y=="string"){if(y.startsWith("http")||y.includes("/")){k({for:D,url:y});return}}else if(typeof y=="object"&&!Array.isArray(y)){const te=y.src;if(te){k({for:D,url:te});return}}}const ue=Sa();if(ue&&m)try{const te=await Promise.resolve(ue(m));!O&&te&&k({for:D,url:te})}catch{}})(),()=>{O=!0}},[y,m,D]);const K=o.useRef(!0),L=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,L.current&&yr(L.current),L.current=null;try{w.current?.pause()}catch{}w.current=null}),[]);const W=o.useCallback(()=>new Promise(O=>{if(typeof window<"u"&&window.speechSynthesis&&m){x(!0),window.speechSynthesis.cancel();const ue=new SpeechSynthesisUtterance(m);ue.lang="ko-KR",ue.onend=()=>{x(!1);try{a?.()}catch{}O()},ue.onerror=()=>{x(!1),O()},window.speechSynthesis.speak(ue)}else O()}),[m,a]),Y=o.useCallback(O=>{const ue=Ka(O,te=>{if(x(!1),te)try{a?.()}catch{}});return w.current=ue.el,ue.done},[a]),U=o.useCallback(async()=>{if(t||!K.current)return;const O=()=>{L.current===O&&(L.current=null);try{w.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1)},ue=Ga(O);L.current=O;try{window.speechSynthesis?.cancel()}catch{}try{if(P&&(x(!0),await Y(P)))return;const te=or();if(te&&m)try{B(!0);const de=await Promise.resolve(te(m));if(!K.current||L.current!==O||(B(!1),de&&(x(!0),await Y(de))))return}catch{}if(!K.current||L.current!==O)return;await W()}finally{L.current===O&&B(!1),ue(),L.current===O&&(L.current=null)}},[t,P,m,Y,W]);o.useImperativeHandle(h,()=>({play:()=>U()}),[U]);const j=O=>O.stopPropagation(),R=o.useCallback(O=>{if(O.stopPropagation(),!t){if(A){try{w.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1);return}U()}},[t,A,U]),z=Ae("training-word-card",t?"training-word-card--disabled":"",g?"training-word-card--flipped":"",r?"training-word-card--selectable":"",s?"training-word-card--selected":"");return n.jsx("div",{className:z,onClick:r&&!t?l:void 0,role:r?"button":void 0,"aria-pressed":r?s:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" "||O.key==="Spacebar")&&(O.preventDefault(),l?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:g?"0ms":`${i}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[s&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:j,children:n.jsx(En,{size:40,position:"inline",animate:!0,icon:d!=null?void 0:"check",number:d??void 0,"aria-label":d!=null?p("training.nthSelected",{n:d}):p("training.selected","\uC120\uD0DD\uB428")})}),n.jsx("div",{className:"training-word-card__image-wrap",children:G?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):Q?n.jsxs(n.Fragment,{children:[M&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:F,className:"training-word-card__image",src:T,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:M?0:1},onLoad:Z,onError:I})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!G&&n.jsx("div",{className:"training-word-card__word",children:_.label}),_.subLabel&&n.jsxs("div",{className:"training-word-card__pronunciation",children:["[",_.subLabel,"]"]}),_.colloquialLabel&&n.jsxs("div",{className:"training-word-card__colloquial caption-1",children:["[",_.colloquialLabel,"]"]})]}),!c&&n.jsx("div",{className:"training-word-card__bottom",onClick:r?j:void 0,children:n.jsx(be,{htmlType:"button",size:v?40:48,type:v?"dot":"bar",icon:A?"pause":"play",label:v?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:A,loading:E,onClick:R,disabled:t,ariaLabel:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30")})})]}),n.jsx("div",{className:"training-word-card__back","aria-hidden":"true",children:n.jsx("span",{className:"training-word-card__disabled-symbol",style:{"--disabled-symbol-src":`url("${k4}")`}})})]})})});function wr(e){return String(e)}const Br=["o","triangle","x"];function ac(e,t){return e===t?null:t}const rc={o:"circle",triangle:"triangle",x:"x"},oc={o:"main",triangle:"warn",x:"danger"};function A4(e){let t=0,a=0,r=0;for(const l of Object.values(e))l==="o"?t++:l==="triangle"?a++:l==="x"&&r++;const s=t+a+r;return{marked:s,o:t,triangle:a,x:r,rate:s===0?null:(t+a*.5)/s}}function ns(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function sc(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function N4(e,t){return!t&&e>0}const ea={landscape:{width:1123,height:794,printSize:"A4 landscape",printW:"297mm",printH:"210mm"},portrait:{width:794,height:1123,printSize:"A4 portrait",printW:"210mm",printH:"297mm"}};function E4(e="landscape"){Bt("print-word-table-deprecated","[printWordTable] @deprecated \u2014 WordTablePopup renderButtons \uC758 print(\uB610\uB294 useWordTablePrint().print)\uB97C \uC4F0\uC138\uC694. \uC804\uC5ED \uC778\uC1C4\uB294 \uD654\uBA74\uC758 \uBAA8\uB4E0 \uB2E8\uC5B4\uD45C\uB97C \uD568\uAED8 \uCC0D\uC2B5\uB2C8\uB2E4.");const{printSize:t,printW:a,printH:r}=ea[e],s=document.createElement("style");s.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(s);const l=()=>{document.head.removeChild(s),window.removeEventListener("afterprint",l)};window.addEventListener("afterprint",l),window.print()}function D4(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let s=0;s<e.length;s+=a)r.push(e.slice(s,s+a));return r}const S4={landscape:{1:{cols:1,rows:1},2:{cols:2,rows:1},3:{cols:3,rows:1},4:{cols:2,rows:2},5:{cols:3,rows:2},6:{cols:3,rows:2},7:{cols:4,rows:2},8:{cols:4,rows:2},9:{cols:5,rows:2},10:{cols:5,rows:2},11:{cols:4,rows:3},12:{cols:4,rows:3},13:{cols:5,rows:3},14:{cols:5,rows:3},15:{cols:5,rows:3},16:{cols:6,rows:3}},portrait:{1:{cols:1,rows:1},2:{cols:1,rows:2},3:{cols:1,rows:3},4:{cols:1,rows:4},5:{cols:1,rows:5},6:{cols:2,rows:3},7:{cols:2,rows:4},8:{cols:2,rows:4},9:{cols:2,rows:5},10:{cols:2,rows:5},11:{cols:3,rows:4},12:{cols:3,rows:4},13:{cols:4,rows:4},14:{cols:4,rows:4},15:{cols:4,rows:4},16:{cols:4,rows:4}}};function lc(e,t){const a=S4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),s=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let l,i;return e==="landscape"?(i=s,l=Math.ceil(r/i)):(l=s,i=Math.ceil(r/l)),(e==="landscape"?l<i:i<l)&&([l,i]=[i,l]),{cols:l,rows:i}}function j4(e,t){const a=lc(e==="landscape"?"portrait":"landscape",t),r=Math.max(1,Math.ceil(t));if(r<=1)return a;const s=ea[e],l=e==="landscape"?s.width/2:s.width,i=e==="landscape"?s.height:s.height/2,u=(m,g)=>Math.min(l/m/pc,i/g/hc),c=Math.max(0,a.cols*a.rows-r),d=u(a.cols,a.rows);let h=a,p=d;for(let m=1;m<=r;m++){const g=Math.ceil(r/m);if(m*g-r>c)continue;const y=u(m,g);y>p&&(h={cols:m,rows:g},p=y)}return p>d*1.05?h:a}const T4={show:"word-table__content--cut-show",dashed:"",corner:"word-table__content--cut-corner",hide:""},ic={\uBA85:"\uBA85\uC0AC",\uB3D9:"\uB3D9\uC0AC",\uD615:"\uD615\uC6A9\uC0AC",\uBD80:"\uBD80\uC0AC",\uC218:"\uC218\uC0AC",\uAD00:"\uAD00\uD615\uC0AC",\uAC10:"\uAC10\uD0C4\uC0AC",\uC870:"\uC870\uC0AC",\uC811:"\uC811\uC0AC",\uC758:"\uC758\uC874\uBA85\uC0AC",\uB300:"\uB300\uBA85\uC0AC",\uBCF4\uB3D9:"\uBCF4\uC870\uB3D9\uC0AC",\uBCF4\uD615:"\uBCF4\uC870\uD615\uC6A9\uC0AC"},uc={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},as={\uBA85:"noun",\uB3D9:"verb",\uD615:"adjective",\uBD80:"adverb",\uC218:"numeral",\uAD00:"determiner",\uAC10:"interjection",\uC870:"particle",\uC811:"affix",\uC758:"dependentNoun",\uB300:"pronoun",\uBCF4\uB3D9:"auxVerb",\uBCF4\uD615:"auxAdjective"},rs={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function cc(e){return Object.fromEntries(Object.entries(ic).map(([t,a])=>[t,as[t]?e(`wordTable.pos.${as[t]}`,{defaultValue:a}):a]))}function dc(e){return Object.fromEntries(Object.entries(uc).map(([t,a])=>[t,rs[t]?e(`wordSearch.filter.type.${rs[t]}`,{defaultValue:a}):a]))}const M4={pos:as,wordType:rs};function os(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function ss(e,t,a,r){if(r!=="dashed")return{};const s=e%t,l=Math.floor(e/t),i=s<t-1,u=l<a-1;if(!i&&!u)return{};const c="#ddd",d=g=>`repeating-linear-gradient(to ${g}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,h=[],p=[],m=[];return i&&(h.push(d("bottom")),p.push("1px 100%"),m.push("right center")),u&&(h.push(d("right")),p.push("100% 1px"),m.push("center bottom")),{backgroundImage:h.join(", "),backgroundSize:p.join(", "),backgroundPosition:m.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const pc=280,L4=240,$4=280,hc=400,R4=120,P4=280;function mc(e,t){const a=o.useRef(null),[r,s]=o.useState(1),[l,i]=o.useState(0),u=o.useCallback((c,d)=>{if(!(c>0))return;const h=c/e,p=t&&d>0?d/t:1/0,m=Math.min(1,h,p);s(m),i(Math.max(0,(c-e*m)/2))},[e,t]);return o.useEffect(()=>{const c=a.current;if(!c)return;const d=t?c.parentElement??c:c;if(u(d.clientWidth,d.clientHeight),typeof ResizeObserver>"u")return;const h=new ResizeObserver(([p])=>u(p.contentRect.width,p.contentRect.height));return h.observe(d),()=>h.disconnect()},[u,t]),{scalerRef:a,scale:r,offset:l}}const F4=24,I4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},O4=400,Cc=8;function ls({label:e,subLabel:t,colloquialLabel:a,captionLabel:r,captionBadge:s,homonum:l,showWord:i=!0,showImage:u=!0,showPronunciation:c=!0,showColloquial:d=!0,showCaption:h=!0,buttonSize:p=40,wordInfo:m,outerScale:g=1}){const{t:y}=xe.useTranslation(),C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),[b,w]=o.useState(1),[v,A]=o.useState(!1),[x,E]=o.useState(!1),[B,D]=o.useState({for:"",url:""}),[N,k]=o.useState(null),P=t&&t.length>0?t:q1()?.(e,l)??"",$=ua()?.(e,l)??"",{imgRef:G,loading:T,failed:F,onLoad:M,onError:Q}=es($),Z=o.useCallback(()=>k(f.current?.getBoundingClientRect()??null),[]),I=o.useCallback(()=>k(null),[]),K=_o(!!N,ee=>{ee?Z():I()},f),L=o.useMemo(()=>{if(!m)return null;const ee=[];return m.grade&&ee.push(y("wordTable.info.grade",{n:m.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),m.syllables&&ee.push(y("wordTable.info.syllables",{n:m.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),m.pos&&ee.push(y("wordTable.info.pos",{v:os(m.pos,cc(y)),defaultValue:"\uD488\uC0AC: {{v}}"})),m.wordType&&ee.push(y("wordTable.info.wordType",{v:os(m.wordType,dc(y)),defaultValue:"\uC720\uD615: {{v}}"})),ee.length?ee:null},[m,y]),W=P||e,Y=B.for===W?B.url:"";o.useEffect(()=>{const ee=Sa(),V=P||e;if(!ee||!V)return;let ae=!1;return Promise.resolve(ee(V)).then(H=>{!ae&&H&&D({for:V,url:H})}),()=>{ae=!0}},[P,e]);const U=o.useRef(null),j=o.useRef(null);o.useEffect(()=>()=>{_.current?.pause(),j.current?.()},[]);const R=o.useRef(null);o.useEffect(()=>()=>{R.current&&(R.current.cancelled=!0)},[]);const z=o.useCallback(ee=>{if(ee.stopPropagation(),v||x){U.current?.();return}if(!Y){const ae=or(),H=P||e;if(!ae||!H)return;const q={cancelled:!1,stop:null};R.current=q;const ie=()=>{q.cancelled=!0,q.stop?.(),E(!1),A(!1),j.current?.()};U.current=ie,j.current=Ga(ie),E(!0),Promise.resolve().then(()=>ae(H)).then(Ne=>{if(q.cancelled)return;if(!Ne){ie();return}D({for:H,url:Ne});const _e=Ka(Ne,()=>{A(!1),j.current?.()});_.current=_e.el,q.stop=_e.stop,E(!1),A(!0)}).catch(()=>{ie()});return}A(!0);const V=Ka(Y,()=>{A(!1),j.current?.()});_.current=V.el,U.current=V.stop,j.current=Ga(V.stop)},[v,x,Y,P,e]),O=u&&!!$&&!F,ue=O&&i?pc:O?$4:L4,te=O&&i?hc:O?P4:R4;o.useEffect(()=>{const ee=C.current;if(!ee||typeof ResizeObserver>"u")return;const V=new ResizeObserver(([ae])=>{const{width:H,height:q}=ae.contentRect;w(Math.min(H/ue,q/te))});return V.observe(ee),()=>V.disconnect()},[ue,te]);const de=p*g<F4;return n.jsxs("div",{ref:C,className:Ae("word-table-cell",de&&"word-table-cell--tap-too-small",O?"word-table-cell--with-image":""),"data-ref-w":ue,"data-ref-h":te,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${b})`},children:[O&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[T&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:G,className:"word-table-cell__image",src:$,alt:e,draggable:!1,style:{opacity:T?0:1},onLoad:M,onError:Q})]}),h&&(s||r)&&n.jsxs("span",{className:"word-table-cell__caption",children:[s&&n.jsx(on,{fill:"soft",size:"small",label:s}),r&&n.jsx("span",{className:"word-table-cell__caption-tail h5",children:r})]}),i&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),c&&P&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",P,"]"]}),d&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__side",children:[n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":Y,children:[n.jsx("span",{"data-play-state":"play",style:{display:v?"none":void 0},children:n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,loading:x,showTooltipInfo:x?y("common.loading","\uBD88\uB7EC\uC624\uB294 \uC911"):y("common.play","\uC7AC\uC0DD"),ariaLabel:e?y("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):y("common.play","\uC7AC\uC0DD"),onClick:z})}),n.jsx("span",{"data-play-state":"pause",style:{display:v?void 0:"none"},children:n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:y("common.pause","\uBA48\uCDA4"),ariaLabel:e?y("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):y("common.pause","\uBA48\uCDA4"),onClick:z})})]}),m&&n.jsxs("div",{ref:f,className:"word-table-cell__info-button",onPointerEnter:ee=>{ma(ee)||Z()},onPointerLeave:ee=>{ma(ee)||I()},onFocus:()=>{Ca()||Z()},onBlur:I,children:[n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:y("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:ee=>{ee.stopPropagation(),K.touchPress()}}),N&&L&&n.jsx(Xn,{anchorRect:N,items:L,showIndex:!1})]})]})]})}function _a({title:e,titleIcon:t,disc:a,className:r,orientation:s="landscape",contentTypes:l=["image","word","standardPron"],baseItem:i,baseContentTypes:u,cutLine:c="show",showOutline:d=!0,showDivLine:h=!0,items:p,editCells:m,count:g,activeCell:y=null,onActivateCell:C,onRemoveCell:f,onRemoveItem:_,onReorder:b,onCopyItem:w,indexOffset:v=0,totalCount:A,renderCellAction:x,showFillerAdd:E=!1,addableCount:B,contentRef:D,buttonSize:N=40,brand:k,code:P,pageNumber:$,pageNumberPosition:G="right",fitHeight:T=!1,scoring:F=!1,marks:M,onMarkClick:Q,scoreIndexOffset:Z=0}){const I=o.useCallback((Ce,Pe)=>{Q?.(Z+Ce,Pe)},[Q,Z]),K=(Ce,Pe)=>{const ye=Ce.filter(Boolean).join(" / ");return ye?Pe?W("wordPrint.removePairFor",{name:ye,defaultValue:`${ye} \uB300\uB9BD\uC30D \uBE7C\uAE30`}):W("wordPrint.removeWordFor",{name:ye,defaultValue:`${ye} \uBE7C\uAE30`}):Pe?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30")},L=(Ce,Pe)=>{const ye=M?.[wr(Z+Ce)]??null;return n.jsx("div",{className:Ae("word-table-cell__score",ye?"word-table-cell__score--marked":""),style:ct>1?{transform:`translateX(-50%) scale(${ct})`,transformOrigin:"bottom center"}:void 0,children:Br.map(Ye=>n.jsx("span",{className:Ae("word-table-cell__score-slot",ye===Ye?"word-table-cell__score-slot--on":""),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",shape:"pill",icon:rc[Ye],variant:ye===Ye?oc[Ye]:"default",selected:ye===Ye,useBorder:!1,...ot?{}:{tabIndex:-1,role:"img"},showTooltipInfo:W(`wordTable.scoring.markName.${Ye}`,{defaultValue:Ye}),ariaLabel:W(`wordTable.scoring.${Ye}`,{word:Pe,defaultValue:`${Pe} ${Ye}`}),onClick:ot?bt=>{bt.stopPropagation(),I(Ce,Ye)}:void 0})},Ye))})},{t:W}=xe.useTranslation(),Y=m!==void 0,U=e!=null||!!t||!!a,j=yn("(max-width: 767px)"),R=o.useRef(null),[z,O]=o.useState(null),ue=p?.length??0,te=A??ue,[de,ee]=o.useState(null),[V,ae]=o.useState(""),H=o.useRef(null),q=o.useRef(null),ie=o.useRef(null),Ne=o.useRef(null),_e=o.useCallback(Ce=>{q.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce)},[D]),he=o.useCallback((Ce,Pe)=>{H.current=v+Pe,b?.(Ce,Pe),ae(W("wordTable.reorder.moved",{n:v+Pe+1,total:te,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[b,W,te,v]);o.useEffect(()=>{const Ce=H.current;Ce!=null&&(H.current=null,(q.current?.closest(".word-table-block__pages")??q.current)?.querySelector(`[data-wordtable-index="${Ce}"] .word-table__card-handle button`)?.focus())}),o.useEffect(()=>()=>{Ne.current?.()},[]);const je=o.useCallback((Ce,Pe)=>{if(!b||!Ce.altKey||Ce.ctrlKey||Ce.metaKey)return;const ye=Ce.key==="ArrowRight";if(!ye&&Ce.key!=="ArrowLeft")return;Ce.preventDefault();const Ye=Pe+(ye?1:-1),bt=v+Ye;bt<0||bt>=te||he(Pe,Ye)},[b,te,v,he]),$e=o.useCallback((Ce,Pe)=>{if(!b||Ce.pointerType==="mouse")return;const ye=Ce.target.closest?.("button");if(ye&&!ye.closest(".word-table__card-handle"))return;Ne.current?.();const Ye={x:Ce.clientX,y:Ce.clientY};let bt=!1;const Nt=We=>{bt&&We.cancelable&&We.preventDefault()};let mt=null,gt=null;const Me=()=>{const We=gt;if(!We)return;const Qe=document.elementFromPoint?.(We.x,We.y)?.closest?.("[data-wordtable-cell]"),st=Qe?Number(Qe.dataset.wordtableCell):NaN,Tt=Number.isInteger(st)?st:null;ie.current=Tt,O(ln=>ln===Tt?ln:Tt)},lt=We=>{if(!bt){(Math.abs(We.clientX-Ye.x)>Cc||Math.abs(We.clientY-Ye.y)>Cc)&&Ie();return}if(gt={x:We.clientX,y:We.clientY},typeof requestAnimationFrame>"u"){Me();return}mt===null&&(mt=requestAnimationFrame(()=>{mt=null,Me()}))},re=()=>{mt!==null&&(cancelAnimationFrame(mt),mt=null,Me());const We=ie.current,Qe=bt;Ie(),Qe&&We!=null&&We!==Pe&&he(Pe,We)},ve=setTimeout(()=>{bt=!0,ee(Pe),ie.current=Pe,O(Pe),window.addEventListener("touchmove",Nt,{passive:!1})},O4);function Ie(){clearTimeout(ve),window.removeEventListener("pointermove",lt),window.removeEventListener("pointerup",re),window.removeEventListener("pointercancel",re),window.removeEventListener("touchmove",Nt),bt=!1,mt!==null&&(cancelAnimationFrame(mt),mt=null),ie.current=null,Ne.current=null,ee(null),O(null)}Ne.current=Ie,window.addEventListener("pointermove",lt),window.addEventListener("pointerup",re),window.addEventListener("pointercancel",re)},[b,he]),{width:De,height:le}=ea[s],we=typeof T=="number"?T:T&&typeof T=="object"?j?T.narrow:T.wide:null,{scalerRef:Le,scale:Be,offset:ze}=mc(De,T?le:void 0),Ve=Y?m?.length??0:p?.length??0,ut=Math.max(g??Ve,1),et=!Y&&!!i,Xe=j4(s,ut),yt=lc(s,ut),Te=et?Xe.cols:yt.cols,Ke=et?Xe.rows:yt.rows,ke=et&&s==="landscape"?Xe.cols*2:Te,qe=et&&s==="portrait"?Xe.rows*2:Ke,Je=Ce=>({word:Ce.length===0||Ce.includes("word"),image:Ce.length===0||Ce.includes("image"),pron:Ce.length===0||Ce.includes("standardPron"),colloq:Ce.length===0||Ce.includes("colloquialPron"),caption:Ce.length===0||Ce.includes("caption")}),tt=Je(l),xt=o.useMemo(()=>{const Ce=(p??[]).map(ye=>ye.id),Pe=Ce.every(ye=>typeof ye=="string"&&ye.length>0)&&new Set(Ce).size===Ce.length;return!Pe&&Ce.length>0&&Bt("wordTable.cellKeyFallback","[ihab/core] WordTable: items \uC758 id \uAC00 \uACB9\uCE58\uAC70\uB098 \uBE44\uC5B4 \uC788\uC5B4 \uCE78\uC744 \uC790\uB9AC \uBC88\uD638\uB85C \uC13C\uB2E4. \uCE78\uC744 \uBE7C\uAC70\uB098 \uB354\uD560 \uB54C \uB4A4 \uCE78\uB4E4\uC774 \uD1B5\uC9F8\uB85C \uB2E4\uC2DC \uADF8\uB824\uC9C4\uB2E4(\uC18C\uB9AC \uC8FC\uC18C\uB97C \uB2E4\uC2DC \uBC1B\uC544 \uC628\uB2E4). id \uB97C \uD45C \uC548\uC5D0\uC11C \uD558\uB098\uBFD0\uC778 \uAC12\uC73C\uB85C \uC9C0\uC5B4 \uC8FC\uBA74 \uADF8 \uAC12\uC774 \uC0AC\uB77C\uC9C4\uB2E4."),Pe?Ce:null},[p]),wt=Je(u??l),Dt=Y?(m??[]).some(Ce=>Ce!==null&&Ce.length>1):(p??[]).some(Ce=>(Ce.words??[]).length>1),rt=!!k?.show,nt=!!k?.show&&k?.top!==!1,kt=!!k?.show&&k?.bottom!==!1,At=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",Lt=se(Ae("word-table__content",T4[c],d&&"word-table__content--outline",h&&Dt&&"word-table__content--div-line",!rt&&$&&G!=="none"&&"word-table__content--page-number",nt&&"word-table__content--brand-top",kt&&"word-table__content--brand-bottom")),jt={transform:`scale(${1/Be})`,transformOrigin:"center center"},vt=N*Br.length+4*(Br.length-1),ot=!!Q,ct=ot?Math.max(1,Math.min(1/Be,De/ke/vt)):1,dt=n.jsxs("div",{ref:Le,className:"word-table__scaler",style:{height:le*Be},children:[n.jsx("div",{className:Ae("word-table",F&&!ot&&"word-table--score-readonly",!U&&r),style:{width:De,height:le,transform:`scale(${Be})`,transformOrigin:"top left",marginLeft:ze},children:n.jsxs("div",{ref:_e,className:Lt,style:{gridTemplateColumns:`repeat(${ke}, 1fr)`,gridTemplateRows:`repeat(${qe}, 1fr)`},children:[Y?n.jsx(n.Fragment,{children:(m??[]).map((Ce,Pe)=>n.jsx("div",{className:se(Ae("word-table__edit-cell",Ce?"word-table__edit-cell--filled":"word-table__edit-cell--empty",y===Pe?"word-table__edit-cell--active":"")),style:ss(Pe,ke,qe,c),children:Ce?n.jsxs(n.Fragment,{children:[Ce.map((ye,Ye)=>n.jsxs(o.Fragment,{children:[Ye>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:ye.word,subLabel:ye.pronunciation,colloquialLabel:ye.colloquialPronunciation,homonum:ye.homonum,showWord:tt.word,showImage:tt.image,showPronunciation:tt.pron,showColloquial:tt.colloq,showCaption:tt.caption,buttonSize:N})]},Ye)),F&&L(Pe,Ce.map(ye=>ye.word).join(" / ")),f&&n.jsx("div",{className:se("word-table__card-close"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:Ce.length>1?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:K(Ce.map(ye=>ye.word),Ce.length>1),onClick:()=>f(Pe)})})]}):C&&n.jsx("div",{style:jt,children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C(Pe)})})},Pe))}):n.jsxs(n.Fragment,{children:[et&&i&&n.jsx("div",{className:se("word-table__card word-table__card--base"),style:{gridColumn:`1 / span ${Xe.cols}`,gridRow:`1 / span ${Xe.rows}`,...ss(0,s==="landscape"?2:1,s==="landscape"?1:2,c)},children:(i.words??[]).map((Ce,Pe)=>n.jsxs(o.Fragment,{children:[Pe>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:Ce.label,subLabel:Ce.subLabel,colloquialLabel:Ce.colloquialLabel,captionLabel:Ce.captionLabel,captionBadge:Ce.captionBadge,homonum:Ce.homonum,showWord:wt.word,showImage:wt.image,showPronunciation:wt.pron,showColloquial:wt.colloq,showCaption:wt.caption,buttonSize:N,wordInfo:Ce.grade||Ce.syllables!=null||Ce.pos||Ce.wordType?{grade:Ce.grade,syllables:Ce.syllables,pos:Ce.pos,wordType:Ce.wordType}:void 0})]},Pe))}),(p??[]).map((Ce,Pe)=>n.jsxs("div",{"data-wordtable-cell":b?Pe:void 0,"data-wordtable-index":b?v+Pe:void 0,className:se(`word-table__card${b?" word-table__card--draggable":""}${z===Pe?" word-table__card--drag-over":""}${de===Pe?" word-table__card--dragging":""}`),style:ss(Pe,Te,Ke,c),draggable:!!b,onPointerDown:b?ye=>$e(ye,Pe):void 0,onKeyDown:b?ye=>je(ye,Pe):void 0,onDragStart:b?()=>{R.current=Pe}:void 0,onDragOver:b?ye=>{ye.preventDefault(),O(Pe)}:void 0,onDragLeave:b?()=>O(null):void 0,onDrop:b?ye=>{ye.preventDefault(),R.current!==null&&R.current!==Pe&&b(R.current,Pe),R.current=null,O(null)}:void 0,onDragEnd:b?()=>{R.current=null,O(null)}:void 0,children:[(Ce.words??[]).map((ye,Ye)=>n.jsxs(o.Fragment,{children:[Ye>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:ye.label,subLabel:ye.subLabel,colloquialLabel:ye.colloquialLabel,captionLabel:ye.captionLabel,captionBadge:ye.captionBadge,homonum:ye.homonum,showWord:tt.word,showImage:tt.image,showPronunciation:tt.pron,showColloquial:tt.colloq,showCaption:tt.caption,buttonSize:N,wordInfo:ye.grade||ye.syllables!=null||ye.pos||ye.wordType?{grade:ye.grade,syllables:ye.syllables,pos:ye.pos,wordType:ye.wordType}:void 0})]},Ye)),F&&L(Pe,(Ce.words??[]).map(ye=>ye.label).join(" / ")),(x||_||w||b)&&n.jsxs("div",{className:se("word-table__card-actions"),children:[_&&n.jsx("div",{className:se("word-table__card-close"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(Ce.words??[]).length>1?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:K((Ce.words??[]).map(ye=>ye.label),(Ce.words??[]).length>1),onClick:()=>_(Ce.id)})}),w&&n.jsx("div",{className:se("word-table__card-copy"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"copy",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:W("wordTable.copyItem","\uD55C \uCE78 \uB354"),ariaLabel:W("wordTable.copyItemAria",{n:v+Pe+1,defaultValue:"{{n}}\uBC88 \uCE78 \uB0B1\uB9D0\uC744 \uD55C \uCE78 \uB354"}),onClick:()=>w(Ce.id,v+Pe)})}),x?.(Pe,Ce),b&&n.jsx("div",{className:se("word-table__card-handle"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:W("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:W("wordTable.reorder.handle",{word:(Ce.words??[]).map(ye=>ye.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})})]})]},xt?xt[Pe]:Pe)),Array.from({length:Math.max(0,Te*Ke-(p?.length??0))}).map((Ce,Pe)=>{const ye=(p?.length??0)+Pe<(B??ut);return n.jsx("div",{className:se("word-table__card word-table__card--filler"),children:E&&C&&ye&&n.jsx("div",{style:jt,children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C((p?.length??0)+Pe)})})},`filler-${Pe}`)})]}),nt&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--top",children:[n.jsx("img",{className:"word-table__brand-logo",src:k?.topLogo?.src??gr,alt:k?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const Ce=[k?.title&&n.jsx("span",{className:"word-table__paper-title",children:k.title},"t"),k?.owner&&n.jsx("span",{className:"word-table__owner",children:k.owner},"o"),P&&n.jsx("span",{className:"word-table__code",children:P},"c")].filter(Boolean);return Ce.length===0?null:n.jsx("span",{className:"word-table__ident",children:Ce.map((Pe,ye)=>n.jsxs(o.Fragment,{children:[ye>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),Pe]},ye))})})()]})}),kt&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--bottom",children:[n.jsxs("span",{className:"word-table__brand-by",children:[k?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:k.bottomLogo.src,alt:k.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:At})]}),n.jsxs("span",{className:"word-table__band-end",children:[k?.link&&n.jsx("span",{className:"word-table__link",children:k.link}),$&&G!=="none"&&n.jsx("span",{className:"word-table__page-count",children:W("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})]})}),!rt&&$&&G!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${G}`,children:W("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})}),b&&n.jsx("span",{role:"status",style:I4,children:V})]}),_t=we==null?dt:n.jsx("div",{className:"word-table__frame",style:{height:we},children:dt});return U?n.jsx(va,{type:"page",icon:t,title:e,disc:a,className:Ae(se("word-table__section"),r),children:_t}):_t}function z4(e,t,a){const r=[];for(const s of e??[]){if(s.type==="note"||s.type==="input")continue;const l=s.displayLabel??s.label,i=W4(s,t?.[s.label],a);i!==null&&r.push(`${l} ${i}`)}return r.join(" \xB7 ")}function W4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(s=>s!==Bn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(s=>H4(e,s)).join(", ")}function H4(e,t){const a=[...e.items??[],...(e.groups??[]).flat()];for(const r of a)if(r!=null){if(typeof r=="string"){if(r===t)return r;continue}if(r.value===t)return r.displayLabel??r.labels?.join(" ")??r.value}return t}function Fn({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:s=!1,defaultCollapsed:l=!1,collapsed:i,onCollapsedChange:u,footer:c,sections:d,selected:h={},onSelect:p,align:m,sectionAlign:g,className:y}){const C=(m??(g==="vertical"?"newline":"inline"))==="inline",{t:f}=xe.useTranslation(),[_,b]=o.useState(l),w=i??_,v=()=>{const k=!w;b(k),u?.(k)},A=k=>{if(!s)return;const P=k.target;!P||typeof P.closest!="function"||P.closest(".filter-panel__collapse-toggle")||P.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||v()},x=o.useMemo(()=>r!==void 0||!w?"":z4(d,h,f("common.all","\uC804\uCCB4")),[r,w,d,h,f]),E=r??(x?n.jsx("span",{className:"filter-panel__header-summary body-3",children:x}):null),B=e||a||r||s,D=o.useId(),N=t?`h${t}`:"span";return n.jsxs("div",{className:Ae("filter-panel",s?"filter-panel--collapsible":"",w?"filter-panel--collapsed":"",y),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?D:void 0,children:[B&&n.jsxs("div",{className:"filter-panel__header",onClick:s?A:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(N,{id:D,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[w?E:a,s&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:w?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:w?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),showTooltipInfo:w?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),"aria-expanded":!w,onClick:v})]})]}),!w&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Ae("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(k=>{const P=h[k.label],$=P===void 0||(Array.isArray(P)?P.length===0:!1),G=(k.items??[]).filter(F=>F!=null);k.allOption&&G.some(F=>(typeof F=="string"?F:F.value)===Bn)&&Bt(`filter-panel-all-value:${k.label}`,`[FilterPanel] '${k.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${Bn}' \uC778 \uBCF4\uAE30\uAC00 \uD568\uAED8 \uC788\uB2E4 \u2014 \uB450 \uC120\uD0DD\uC774 \uAD6C\uBCC4\uB418\uC9C0 \uC54A\uB294\uB2E4. \uBCF4\uAE30 \uAC12\uC744 \uBC14\uAFD4\uB77C.`);const T=F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"&&!!F.disabled,Z=typeof F!="string"?F.labels:void 0,I=typeof F!="string"?F.displayLabel:void 0,K=typeof F!="string"?F.tooltip:void 0,L=typeof F!="string"?F.descriptionTooltip:void 0,W=typeof F!="string"?F.shape:void 0,Y=Array.isArray(P)?P.includes(M):P===M;return n.jsx(be,{htmlType:"button",size:"keyboard",label:Z??I??M,type:k.itemType??(Z?"bar":M.length===1?"dot":void 0),selected:Y,disabled:Q,shape:W,showTooltipInfo:!!K,tooltipInfoText:K,tooltipDescription:L,onClick:()=>p?.(M,k.label)},M)};return n.jsxs(o.Fragment,{children:[k.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:k.groupLabel}),k.groupAction]}),n.jsxs("div",{className:Ae("filter-panel__section",k.layout==="row"?"filter-panel__section--row":"",k.block?"filter-panel__section--block":""),children:[n.jsxs("div",{className:"filter-panel__section-label-row",children:[n.jsx("span",{className:"filter-panel__section-label body-3",children:k.displayLabel??k.label}),k.labelAction??(k.labelInfo?n.jsx(Ua,{...k.labelInfo}):null)]}),k.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:k.content}):k.type==="input"?n.jsx(qn,{className:"filter-panel__textfield",placeholder:k.placeholder,ariaLabel:k.displayLabel??k.label,value:h[k.label]??"",onChange:F=>p?.(F,k.label),error:k.error}):!k.multiple&&k.display==="segmented"?n.jsx(vn,{ariaLabel:k.displayLabel??k.label,options:[...k.allOption?[{key:Bn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"?F.displayLabel:void 0,Z=typeof F!="string"?F.disabled:void 0;return{key:M,label:Q??M,disabled:Z}})],value:$&&k.allOption?Bn:h[k.label]??"",onChange:F=>p?.(F,k.label),size:32}):!k.multiple&&k.display==="dropdown"?n.jsx(_n,{className:"filter-panel__dropdown",ariaLabel:typeof k.label=="string"?k.label:void 0,size:40,options:[...k.allOption?[{value:Bn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"?F.displayLabel:void 0,Z=typeof F!="string"?F.disabled:void 0;return{value:M,label:Q??M,disabled:Z}})],value:$&&k.allOption?Bn:h[k.label],onChange:F=>p?.(F,k.label)}):n.jsxs("div",{className:k.groups?"filter-panel__item-groups":"filter-panel__items",children:[k.allOption&&!k.groups&&n.jsx(be,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(Bn,k.label)}),k.groups?k.groups.map((F,M)=>n.jsxs("div",{className:"filter-panel__item-group",children:[M===0&&k.allOption&&n.jsx(be,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(Bn,k.label)}),F.filter(Q=>Q!=null).map(T)]},M)):G.map(T)]})]})]},k.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const V4=[1,2,3,4,5,6,7,8,9,10,11,12],q4=[8,6,4,2,1],fn="show",Sn="hide",fc=["image","word","caption","standardPron"];function bc(e){return e.some(t=>(t.words??[]).some(a=>!!a.captionBadge||!!a.captionLabel))}function gc(e,t){return{label:e("wordTable.filter.composition","\uAD6C\uC131"),items:[{value:"image",disabled:!t.hasImage,displayLabel:e("wordTable.filter.image","\uC774\uBBF8\uC9C0")},{value:"word",displayLabel:e("wordTable.filter.word","\uB2E8\uC5B4")},{value:"caption",disabled:!t.hasCaption,displayLabel:e("wordTable.filter.caption","\uC720\uD615")},{value:"standardPron",displayLabel:e("wordTable.filter.standardPron","\uD45C\uC900 \uBC1C\uC74C")},{value:"colloquialPron",disabled:!t.hasColloquial,displayLabel:e("wordTable.filter.colloquialPron","\uAD6C\uC5B4\uCCB4 \uBC1C\uC74C")}],multiple:!0,allOption:!0}}function yc(e){return{label:e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5"),items:[{value:"landscape",displayLabel:e("wordTable.filter.landscape","\uAC00\uB85C")},{value:"portrait",displayLabel:e("wordTable.filter.portrait","\uC138\uB85C")}],display:"segmented"}}function vc(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function _c(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function xc(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function wc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:"dashed",displayLabel:e("wordTable.filter.dotted","\uC810\uC120")},{value:"corner",displayLabel:e("wordTable.filter.corner","\uCF54\uB108")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function Bc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function kc(e,t){const a=Math.max(1,Math.min(t.itemCount,t.max??t.itemCount));return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[a,...q4.filter(r=>r<a)].map(r=>({value:`${r}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:r})})),display:"segmented"}}function Ac(e,t){return e>=t?Number.POSITIVE_INFINITY:e}function U4(e){return{label:e("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638"),items:[{value:"left",displayLabel:e("wordTable.filter.pageNumberLeft","\uC67C\uCABD")},{value:"center",displayLabel:e("wordTable.filter.pageNumberCenter","\uC911\uC559")},{value:"right",displayLabel:e("wordTable.filter.pageNumberRight","\uC624\uB978\uCABD")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function Nc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function Ec(e,t){return{[e("wordTable.filter.composition","\uAD6C\uC131")]:t.contentTypes,[e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")]:t.orientation,[e("wordTable.filter.border","\uC678\uACFD\uC120")]:t.showOutline?fn:Sn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?fn:Sn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?fn:Sn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?fn:Sn}:{}}}function Dc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===Bn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(s=>s.includes(t)?s.filter(l=>l!==t):[...s,t]),!0):a===e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")?(r.setOrientation(t==="landscape"?"landscape":"portrait"),!0):a===e("wordTable.filter.border","\uC678\uACFD\uC120")?(r.setShowOutline(t===fn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===fn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===fn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===fn),!0):!1}function G4(e){return"sections"in e}function is(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c};if(G4(e))return n.jsx(Fn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:e.sections,selected:e.selected,onSelect:e.onSelect,...d,align:"inline"});const{hasImage:h,hasColloquial:p,hasCaption:m,contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,setters:b,showCutLine:w=!1,showDivLine2:v=!1,middleSections:A=[],extraSelected:x={},onExtraSelect:E,showPaperBands:B=!1,showTopInfo:D=!0,showBottomInfo:N=!0}=e,k=[gc(t,{hasImage:h,hasColloquial:p,hasCaption:m??!1}),yc(t),...A,vc(t),...w?[wc(t)]:[],...v?[Bc(t)]:[],...B?[_c(t),xc(t)]:[]],P={...Ec(t,{contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,showTopInfo:D,showBottomInfo:N}),...x},$=(G,T)=>{Dc(t,G,T,b)||E?.(G,T)};return n.jsx(Fn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:k,selected:P,onSelect:$,...d,sectionAlign:"horizontal"})}function us(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function K4(e){return us(e).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cs(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let kr=null,xa=null;function Y4(e,t,a,r="",s=""){if(e.length===0||xa&&xa.iframe.isConnected&&Date.now()-xa.at<1e4)return;const l=r?cs(r):"";kr?.();let i=null;if(l){const d=document.title;document.title=l,i=()=>{document.title=d,window.removeEventListener("afterprint",i),kr===i&&(kr=null)},kr=i,window.addEventListener("afterprint",i)}const u=document.createElement("iframe");u.style.cssText="position:fixed;left:-10000px;top:0;width:1200px;height:900px;border:0;",document.body.appendChild(u);const c=u.contentDocument;if(!c){u.remove();return}xa={iframe:u,at:Date.now()},c.open(),c.write(ds(e,t,a,!0,l,s)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{i?.(),setTimeout(()=>{u.remove(),xa?.iframe===u&&(xa=null)},0)})}function ds(e,t,a,r=!1,s="",l=""){s=s?cs(s):"";const i=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(m=>m.cssText)}catch{return[]}}).join(`
830
+ `),C=y===-1?a:a.slice(0,y);l("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){l("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){l("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){l("number",d[0]),a=a.slice(d[0].length);continue}const h=a.match($v);if(h){l("keyword",h[0]),a=a.slice(h[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const y=p[0];l(s&&Lv.has(y)?"command":"identifier",y),a=a.slice(y.length);continue}const m=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(m){l("operator",m[0]),a=a.slice(m[0].length);continue}const g=a.match(/^[()[\]{};.,]/);if(g){l("punctuation",g[0]),a=a.slice(1);continue}l("other",a[0]),a=a.slice(1)}return r}function Pv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:s="default",className:l=""}){const{t:i}=xe.useTranslation(),[u,c]=o.useState(!1),d=Mv($u(e)),h=o.useRef(null);o.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=async()=>{try{if(!await Wf(d))return;c(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>c(!1),2e3)}catch{}},m=Rv(d,t),g=s==="small"?"caption-1":"body-3";return n.jsxs("div",{className:Ae("code-box",s==="small"?"code-box--small":"",l),children:[(a||r)&&n.jsxs("div",{className:"code-box__header",role:"toolbar","aria-label":i("common.codeBlock","\uCF54\uB4DC \uBE14\uB85D"),children:[n.jsx("div",{className:"code-box__title caption-1",children:a}),r&&n.jsx(be,{htmlType:"button",className:"code-box__copy",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:u?"check":"copy",onClick:p,ariaLabel:u?i("common.copied","\uBCF5\uC0AC\uB428"):i("common.copyCode","\uCF54\uB4DC \uBCF5\uC0AC")})]}),n.jsx("pre",{className:"code-box__inner","data-lang":t,children:n.jsx("code",{children:m.map((y,C)=>n.jsx("span",{className:`code-token ${y.type} ${g}`,children:y.content},C))})})]})}function Fv({count:e,actions:t,onClear:a,clearLabel:r,visible:s,content:l,max:i}){const{t:u}=xe.useTranslation(),c=s!==void 0?s:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),h=o.useRef(null),p=o.useRef(null),m=o.useRef(null),g=o.useRef(c);o.useLayoutEffect(()=>{const b=p.current,w=g.current;if(g.current=c,c&&!w){const v=typeof document<"u"?document.activeElement:null;m.current=v&&v!==document.body&&!b?.contains(v)?v:null}else!c&&w&&b&&b.contains(document.activeElement)&&hr(b,m.current)},[c]);const[y,C]=o.useState(!1),f=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const b=h.current;if(!b)return;const w=D=>{f.current=D,C(D)},v=()=>{const D=b.firstElementChild??b,N=Array.from(D.children);if(N.length<2){w(!1);return}const k=N[0].offsetTop,P=N.some(M=>M.offsetTop!==k);if(!f.current){_.current=b.clientWidth,P&&w(!0);return}if(P)return;const $=N[0],G=N[N.length-1],T=G.offsetLeft+G.offsetWidth-$.offsetLeft,F=_.current;(F==null||T<=F)&&w(!1)};if(v(),typeof ResizeObserver>"u")return;const A=new ResizeObserver(v);A.observe(b);const x=b.parentElement;let E=x?.clientWidth??0;const B=new ResizeObserver(()=>{const D=x?.clientWidth??0;D!==E&&(E=D,_.current=null,v())});return x&&B.observe(x),()=>{A.disconnect(),B.disconnect()}},[l,e]),n.jsxs("div",{ref:p,className:`bulk-bar ${c?"bulk-bar--visible":""}`,inert:!c||void 0,"aria-hidden":c?void 0:!0,children:[n.jsx("span",{ref:h,className:"bulk-bar__count body-2",role:"status",children:l??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),i!==void 0&&n.jsx(on,{size:"small",fill:"soft",variant:"main",label:`${e} / ${i}`,"aria-label":u("common.selectedOfMax",{count:e,max:i,defaultValue:`\uCD5C\uB300 ${i}\uAC1C \uC911 ${e}\uAC1C`})}),n.jsxs("div",{className:`bulk-bar__actions${y?" bulk-bar__actions--stacked":""}`,children:[n.jsx(be,{htmlType:"button",size:40,label:d,onClick:a}),t.map((b,w)=>n.jsx(be,{htmlType:"button",size:40,variant:b.variant??"default",icon:b.icon,label:b.label,onClick:b.onClick},w))]})]})}const Iv=[{key:"edit",icon:"edit-2",closeFirst:!0},{key:"duplicate",icon:"copy",closeFirst:!1},{key:"publish",icon:"book-marked",closeFirst:!1},{key:"copyLink",icon:"link",closeFirst:!1},{key:"remove",icon:"trash-2",closeFirst:!0}];function Ov(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:Ae("item-actions",a),children:Iv.map(({key:r,icon:s,closeFirst:l})=>{const i=e[r];if(!i)return null;const u=r==="publish"?i.published?i.unpublish:i.publish:i;return n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:s,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{l&&t(),u.onClick()}},r)})})}function zv({items:e,className:t,ariaLabel:a="\uC54C\uB9BC \uAE00",titleLevel:r=4,targetBytes:s}){const l=r?`h${r}`:"div";return n.jsx("div",{className:`notify-text-preview${t?` ${t}`:""}`,role:"group","aria-label":a,children:e.map(i=>{const u=s===void 0?$l(i.sms):$l(i.sms,s),c=u.type==="LMS";return n.jsxs("section",{className:"notify-text-preview__item",children:[n.jsxs("header",{className:"notify-text-preview__head",children:[n.jsx(l,{className:"notify-text-preview__name h5b",children:i.name}),i.meta&&Object.keys(i.meta).length>0?n.jsx("dl",{className:"notify-text-preview__meta caption-1",children:Object.entries(i.meta).map(([d,h])=>n.jsxs("div",{className:"notify-text-preview__meta-row",children:[n.jsx("dt",{children:d}),n.jsx("dd",{children:h})]},d))}):null]}),n.jsxs("div",{className:"notify-text-preview__body",children:[n.jsxs("div",{className:"notify-text-preview__col",children:[n.jsxs("div",{className:"notify-text-preview__col-head caption-1",children:[n.jsx("span",{children:"\uBB38\uC790"}),n.jsxs("span",{className:`notify-text-preview__bytes${c?" is-over":u.overTarget?" is-over-target":""}`,title:u.over?`${u.limit}\uBC14\uC774\uD2B8\uB97C \uB118\uC5C8\uB2E4 \u2014 \uBCF4\uB0BC \uB54C \uC798\uB9B0\uB2E4`:c?`${Ml}\uBC14\uC774\uD2B8\uB97C \uB118\uC5B4 \uC7A5\uBB38\uC774\uB2E4 \u2014 \uD55C \uD1B5 \uAC12\uC774 \uB2E8\uBB38\uC758 \uB450 \uBC30 \uBC18\uC774\uB2E4`:u.overTarget?`\uACA8\uB204\uB294 ${u.target}\uBC14\uC774\uD2B8\uB97C \uB118\uC5C8\uB2E4 \u2014 \uD55C \uAE00\uC790\uB9CC \uB298\uC5B4\uB3C4 ${Ml}\uC744 \uB118\uC5B4 \uC7A5\uBB38\uC774 \uB41C\uB2E4`:void 0,children:[u.bytes,u.target!==null?` / \uBAA9\uD45C ${u.target}`:"","\uBC14\uC774\uD2B8 \xB7 ",c?"\uC7A5\uBB38":"\uB2E8\uBB38",u.over?" \xB7 \uD55C\uACC4 \uB118\uC74C":c?" \xB7 \uAC12\uC774 \uB450 \uBC30 \uBC18":u.overTarget?" \xB7 \uBAA9\uD45C \uB118\uC74C":""]})]}),n.jsx("pre",{className:"notify-text-preview__text",children:i.sms})]}),i.ata?n.jsxs("div",{className:"notify-text-preview__col",children:[n.jsx("div",{className:"notify-text-preview__col-head caption-1",children:n.jsx("span",{children:"\uC54C\uB9BC\uD1A1"})}),n.jsx("pre",{className:"notify-text-preview__text",children:i.ata})]}):null]})]},i.name)})})}function Wv({src:e,alt:t,className:a,style:r,tone:s,textColor:l}){const i=!s&&!!l,u=Xy(e,i),c="bl"+o.useId().replace(/[^a-zA-Z0-9]/g,"");return s?n.jsx("span",{className:Ae("brand-logo","brand-logo--tone",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-src":`url("${e}")`,"--brand-logo-tone":s},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):i&&u?n.jsx("span",{className:Ae("brand-logo","brand-logo--inline",a),role:t?"img":void 0,"aria-label":t||void 0,"aria-hidden":t?void 0:!0,style:{...r,"--brand-logo-text-color":l},dangerouslySetInnerHTML:{__html:Yy(Ky(u),c)}}):n.jsx("img",{src:e,alt:t,className:Ae("brand-logo",a),style:r,draggable:!1})}function Ru({children:e,className:t}){const a=o.useRef(null),[r,s]=o.useState(null);return o.useEffect(()=>{s(a.current?.parentElement??null)},[]),o.useEffect(()=>{const l=a.current;if(!l||!r)return;const i=()=>{const c=typeof window<"u"&&window.getComputedStyle(l).position==="absolute"?Math.ceil(l.getBoundingClientRect().width):0;c>0?r.style.setProperty("--section-head-float-w",`${c}px`):r.style.removeProperty("--section-head-float-w")};if(i(),typeof ResizeObserver>"u")return()=>{r.style.removeProperty("--section-head-float-w")};const u=new ResizeObserver(()=>i());return u.observe(l),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:Ae("section-head-float",t),children:e})}function Wo({items:e,className:t}){return n.jsx("div",{className:se(t?`chart-section__legend ${t}`:"chart-section__legend"),children:e.map((a,r)=>n.jsxs("span",{className:se("chart-section__legend-item"),children:[n.jsx("span",{className:se("chart-section__legend-dot"),style:{background:a.color}}),a.label]},r))})}function er({label:e,children:t}){return e?n.jsxs("div",{className:se("chart-section__total chart-section__total--stacked"),children:[n.jsx("span",{className:se("chart-section__total__label body-3"),children:e}),n.jsx("span",{className:se("chart-section__total__value"),children:t})]}):n.jsx("div",{className:se("chart-section__total"),children:t})}function Ho({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:s,headRight:l,headFloat:i,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:h,ariaLabel:p,tooltip:m,totalNum:g,totalUnit:y,totalLabel:C,subRow:f,subRowAlign:_="start",className:b,inGrid:w=!1,children:v}){const{t:A}=xe.useTranslation(),x=o.useRef(null),{anchorRect:E,openAt:B,close:D}=Oa(),N=o.useCallback(()=>{m&&x.current&&B(x.current)},[m,B]),[k,P]=o.useState(!1);Fo(()=>{const j=x.current;if(!j||!u)return;const R=O=>P(O>0&&O<d);if(R(j.clientWidth),typeof ResizeObserver>"u")return;const z=new ResizeObserver(O=>R(O[0].contentRect.width));return z.observe(j),()=>z.disconnect()},[u,d]);const[$,G]=o.useState(null),T=o.useCallback(()=>G(null),[]),F=o.useCallback(j=>{const R=j.currentTarget.getBoundingClientRect();G(z=>z?null:{left:R.left,right:R.right,top:R.top,bottom:R.bottom,width:R.width,height:R.height,x:R.x,y:R.y})},[]),M=!!u&&k;o.useEffect(()=>{M||G(null)},[M]);const Q=u?[...u.options.map(j=>({label:j.label,icon:j.icon,selected:j.key===u.value,disabled:j.disabled,onClick:()=>u.onChange(j.key),closeOnSelect:!0})),...(c??[]).map((j,R)=>R===0?{...j,separatorBefore:!0}:j)]:[],Z=o.useCallback(j=>{if(!h)return;const R=j.target;R&&typeof R.closest=="function"&&R.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),I=o.useCallback(j=>{h&&j.target===j.currentTarget&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),h())},[h]),K=typeof l=="function"?l({collapsed:M}):l,L=g!=null||C?n.jsxs(er,{label:C,children:[g!=null&&n.jsx("span",{className:se("chart-section__total__num h0"),children:g}),y&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:y})]}):null,W=K||u?n.jsxs("div",{className:se("chart-section__head-right"),children:[u&&(M?n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??A("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??A("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!$,onClick:F}):n.jsx(vn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(j=>({key:j.key,label:j.label,disabled:j.disabled})),value:u.value,onChange:u.onChange})),K]}):null,Y=o.useId(),U=a?`h${a}`:"div";return n.jsxs("section",{ref:x,className:se(["chart-section",w&&"chart-section--grid",h&&"chart-section--clickable",b].filter(Boolean).join(" ")),onClick:h?Z:void 0,onKeyDown:h?I:void 0,onPointerEnter:m?N:void 0,onPointerLeave:m?D:void 0,onFocus:m?N:void 0,onBlur:m?D:void 0,role:h?"button":void 0,tabIndex:h?0:void 0,"aria-label":h?p??(typeof e=="string"?e:void 0):void 0,"aria-labelledby":!h&&e!=null?Y:void 0,children:[m&&E&&n.jsx(Tn,{anchorRect:{left:E.left,top:E.top+21,right:E.right,bottom:E.bottom,width:E.width,height:E.height},text:m}),i&&n.jsx(Ru,{children:i}),n.jsxs("div",{className:se("chart-section__head"),children:[n.jsxs("div",{className:se("chart-section__title-row"),children:[r&&n.jsx(at,{icon:r,label:typeof e=="string"?e:void 0,className:se("chart-section__icon")}),n.jsx(U,{id:Y,className:se(["chart-section__title",t].filter(Boolean).join(" ")),children:e})]}),W,s&&n.jsx("div",{className:se("chart-section__disc body-3"),children:s})]}),(L||f)&&n.jsxs("div",{className:se(["chart-section__sub-row",_!=="start"&&`chart-section__sub-row--${_}`].filter(Boolean).join(" ")),children:[L,f]}),v,$&&n.jsx(wn,{anchorRect:$,onClose:T,ariaLabel:u?.ariaLabel??A("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:[{items:Q}],onClose:T,size:"small"})})]})}const tr=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,Vo=e=>tr(e.getFullYear(),e.getMonth()+1);function ga(e){const t=/^(\d{4})-(\d{2})$/.exec(e);if(!t)return null;const a=Number(t[2]);return a>=1&&a<=12?{year:Number(t[1]),month1:a}:null}const qo=(e,t)=>`${e}#${t}`;function Dn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Hv(){const e=ca();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<Dn(t,a)){const i=new Date(t,a,0);t=i.getFullYear(),a=i.getMonth(),r=i.getDate()}const s=Math.floor((r-Dn(t,a))/7),l=tr(t,a+1);return{monthKey:l,value:qo(l,s)}}function Vv(e){const t=ca(),a=Vo(t),r=(c,d)=>tr(c,d+1),s=new Map;s.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());s.has(d)||s.set(d,[]),s.get(d).push(c)}for(const[c,d]of[...s.entries()]){const h=ga(c);if(!h)continue;const p=h.year,m=h.month1-1,g=Dn(p,m);if(!(c===a&&t.getDate()<g)&&!d.some(f=>f.date.getDate()<g))continue;const y=new Date(p,m,0),C=r(y.getFullYear(),y.getMonth());s.has(C)||s.set(C,[])}const l=new Map;for(const[c,d]of s){const h=ga(c);if(!h)continue;const p=h.year,m=h.month1-1,g=new Date(p,m+1,0).getDate(),y=d.reduce((v,A)=>Math.max(v,A.parts?.length??0,A.partsB?.length??0),0),C=d.some(v=>v.partsB),f=new Array(g+1).fill(0),_=new Array(g+1).fill(0),b=Array.from({length:g+1},()=>new Array(y).fill(0)),w=Array.from({length:g+1},()=>new Array(y).fill(0));for(const v of d){const A=v.date.getDate();if(f[A]+=v.a,_[A]+=v.b,v.parts)for(let x=0;x<y;x++)b[A][x]+=v.parts[x]??0;if(v.partsB)for(let x=0;x<y;x++)w[A][x]+=v.partsB[x]??0}l.set(c,{year:p,month:m,daysInMonth:g,partsLen:y,hasPartsB:C,dayA:f,dayB:_,dayParts:b,dayPartsB:w})}const i=(c,d,h)=>new Date(c,d,h).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),u={};for(const[c,d]of l){const{year:h,month:p,daysInMonth:m,dayA:g,dayB:y,dayParts:C,dayPartsB:f}=d,_=h===t.getFullYear()&&p===t.getMonth(),b=t.getDate(),w=l.get(r(p===11?h+1:h,(p+1)%12)),v=d.partsLen,A=[];for(let E=1;E<=m;E++){const B=_&&E>b;A.push({label:String(E),...B&&g[E]===0&&y[E]===0?{future:!0}:{},a:B&&g[E]===0&&y[E]===0?-1:g[E],b:y[E],...v?{parts:C[E]}:{},...v&&d.hasPartsB?{partsB:f[E]}:{}})}const x=[];for(let E=Dn(h,p);E<=m;E+=7){const B=Math.max(0,E+6-m),D=B&&w?Math.max(v,w.partsLen):v,N=d.hasPartsB||!!(B&&w?.hasPartsB);let k=0,P=0;const $=new Array(D).fill(0),G=new Array(D).fill(0);for(let F=E;F<=Math.min(E+6,m);F++){k+=g[F],P+=y[F];for(let M=0;M<v;M++)$[M]+=C[F][M],G[M]+=f[F][M]}if(B&&w)for(let F=1;F<=B&&!i(w.year,w.month,F);F++){k+=w.dayA[F],P+=w.dayB[F];for(let M=0;M<w.partsLen;M++)$[M]+=w.dayParts[F][M],G[M]+=w.dayPartsB[F][M]}const T=B?`${(p+1)%12+1}/${B}`:`${E+6}`;x.push({label:`${x.length+1}\uC8FC`,sublabel:`[${E}\uC77C~${T}\uC77C]`,a:k,b:P,...D?{parts:$}:{},...D&&N?{partsB:G}:{}})}u[c]={weekly:x,daily:A}}return u}function Pu(){const e=ca(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let s=2024;s<=t;s++){const l=s===t?a:12;for(let i=1;i<=l;i++)r.push({value:tr(s,i),year:s,month:i})}return r.reverse()}Pu();function qv(){return Pu()}function Fu(e,t){const a=e("calendar.weekOrdinal",{returnObjects:!0,defaultValue:[]}),r=Array.isArray(a)&&typeof a[t]=="string"?a[t]:null;return e("calendar.weekLabel",{ord:r??String(t+1)})}function Iu(e){const{t,i18n:a}=xe.useTranslation(),[r,s]=o.useState("week"),l=o.useMemo(()=>qv().filter(D=>D.value in e),[e]),i=o.useMemo(()=>{const D=[];for(const N of l){const k=new Date(N.year,N.month,0).getDate(),P=Dn(N.year,N.month-1),$=Math.ceil((k-P+1)/7);for(let G=$-1;G>=0;G--)D.push({value:qo(N.value,G),monthKey:N.value,year:N.year,month:N.month,week:G})}return D},[l]),u=o.useCallback(D=>`${io(t,a.language,D.year,D.month)} ${Fu(t,D.week)}`,[t]),c=o.useMemo(()=>l.map(D=>({value:D.value,label:io(t,a.language,D.year,D.month)})),[t,a.language,l]),d=o.useMemo(()=>i.map(D=>({value:D.value,label:u(D)})),[i,u]),h=o.useMemo(()=>Hv(),[e]),p=o.useMemo(()=>l.find(D=>D.value===h.monthKey)?.value??l[0]?.value??"",[l,h]),m=o.useMemo(()=>i.find(D=>D.value===h.value)?.value??i[0]?.value??"",[i,h]),[g,y]=o.useState(""),[C,f]=o.useState("");o.useEffect(()=>{l.find(D=>D.value===g)||y(p)},[l,g,p]),o.useEffect(()=>{i.find(D=>D.value===C)||f(m)},[i,C,m]);const _=r==="month"?c:d,b=r==="month"?g:C,w=r==="month"?y:f,v=o.useMemo(()=>{const D=t("calendar.dow",{returnObjects:!0});return Array.isArray(D)?D:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),A=_.findIndex(D=>D.value===b),x=o.useCallback(()=>{const D=_.findIndex(N=>N.value===b);D<_.length-1&&w(_[D+1].value)},[_,b,w]),E=o.useCallback(()=>{const D=_.findIndex(N=>N.value===b);D>0&&w(_[D-1].value)},[_,b,w]),B=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:s,range:b,setRange:w,activeOptions:_,activeIdx:A,handlePrev:x,handleNext:E,periodOptions:B,monthRange:g,weekRange:C,weekRanges:i,DOW:v}}const Et=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function Pn(e,t=!0){return e.future===!0||t&&e.a===-1}function Uv({data:e,colorA:t,colorB:a,labelA:r,labelB:s,barWidth:l=10,barGap:i=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:h,seriesLabels:p,rateLabels:m,grouped:g=!1,baseline:y,focusableBars:C=!1}){const f=!a,_=!!(h&&h.length>0),b=y,w=o.useMemo(()=>_?Math.max(0,...e.filter(I=>!Pn(I,b==null)).map(I=>g?Math.max(0,...(I.parts??[]).map(Et)):(I.parts??[]).reduce((K,L)=>K+Math.max(0,Et(L)),0))):Math.max(0,...e.filter(I=>!Pn(I,b==null)).flatMap(I=>f?[Et(I.a)]:[Et(I.a),Et(I.b)])),[e,f,_,g]),v=o.useMemo(()=>{if(b==null)return 0;const I=e.filter(K=>!Pn(K,b==null)).flatMap(K=>_?(K.parts??[]).map(Et):f?[Et(K.a)]:[Et(K.a),Et(K.b)]);return Math.max(0,...I.map(K=>Math.abs(K-b)))},[e,b,_,f]),A=o.useMemo(()=>{const I=b!=null?v:w;return c??(d?I>0?I:10:Math.ceil(I/10)*10||10)},[w,v,b,c,d]),x=u,E=_?g?Math.max(1,h.length):1:f?1:2,B={"--bar-width":`${o.useMemo(()=>{const I=Math.max(1,e.length);return Math.max(2,Math.min(l,Math.round(120/(I*E)+6)))},[e.length,E,l])}px`},D={"--bar-group-gap":`${Math.max(0,i)}px`},N=o.useMemo(()=>{const I=Math.round(A/2);return b!=null?[b+A,...I!==A?[b+I]:[],b,...I!==A?[b-I]:[],b-A]:I!==A?[A,I,0]:[A,0]},[A,b]),k=I=>b!=null?1-(I-(b-A))/(2*A):1-I/A,[P,$]=o.useState(null),G=o.useCallback(()=>$(null),[]),T=o.useCallback((I,K)=>{const L=[I.label,I.sublabel].filter(Boolean).join(" ");let W;if(_&&g&&I.rawPartsB)W=(p??[]).map((Y,U)=>{const j=I.rawPartsB[U]??0;return{text:j>0?`${Y}: ${K[U]??0}% (${I.rawParts?.[U]??0}/${j})`:`${Y}: -`,color:(h??[])[U]}});else if(_&&g)W=(p??[]).map((Y,U)=>({text:`${Y}: ${Q(K[U]??0)}`,color:(h??[])[U]}));else if(_){const Y=(p??[]).map((j,R)=>({text:`${j}: ${K[R]??0}`,color:(h??[])[R]})),U=Y.filter((j,R)=>(K[R]??0)>0);W=U.length?U:Y}else m&&!f?W=[{text:`${r} ${Et(I.a)}%`,color:t},{text:`${s} ${Et(I.b)}%`,color:a}]:m&&I.rawB!==void 0?W=[{text:`${m.total} ${I.rawB}`},{text:`${m.done} ${I.rawA??0}`,color:t}]:f?W=[{text:`${r}: ${Et(I.a)}`,color:t}]:W=[{text:`${r}: ${Et(I.a)}`,color:t},{text:`${s}: ${Et(I.b)}`,color:a}];return{title:L,items:W}},[_,g,p,h,m,f,r,s,t,a,b]),F=o.useCallback((I,K,L)=>{const W=I.getBoundingClientRect(),{title:Y,items:U}=T(K,L);$({rect:{left:W.left,top:W.top,right:W.right,bottom:W.bottom,width:W.width,height:W.height},title:Y,items:U})},[T]),M=o.useCallback((I,K)=>{const{title:L,items:W}=T(I,K);return[L,...W.map(Y=>Y.text)].filter(Boolean).join(", ")},[T]),Q=I=>b!=null&&I>b?`+${I}`:`${I}`,Z=P!=null;return o.useEffect(()=>{if(!Z)return;const I=()=>$(null),K=L=>{const W=L.target;W&&typeof W.closest=="function"&&W.closest(".bar-chart__col")||$(null)};return window.addEventListener("scroll",I,!0),document.addEventListener("pointerdown",K,!0),()=>{window.removeEventListener("scroll",I,!0),document.removeEventListener("pointerdown",K,!0)}},[Z]),n.jsxs("div",{className:se("bar-chart__wrap"),style:D,children:[n.jsx("div",{className:se("bar-chart__inner"),children:n.jsx("div",{className:se("bar-chart__scroll"),children:n.jsxs("div",{className:se("bar-chart__area"),children:[n.jsxs("div",{className:se("bar-chart__plot"),style:{height:x},children:[N.slice(0,-1).map((I,K)=>n.jsx("div",{className:se(`bar-chart__gridline${b!=null&&I===b?" bar-chart__gridline--baseline":""}`),style:{top:k(I)*x},children:n.jsx("span",{className:se("bar-chart__gridline__label caption-1"),children:I})},K)),e.map((I,K)=>{const L=Pn(I,b==null),W=x/2,Y=z=>b!=null?Math.min(W,Math.abs(Et(z)-b)/A*W):Math.min(x,Math.max(0,Et(z)/A*x)),U=L?0:Y(I.a),j=L?0:Y(I.b),R=(I.parts??[]).map(Et);return n.jsx("div",{className:se(`bar-chart__col${g&&_?" bar-chart__col--group":""}`),style:{cursor:L?"default":"pointer"},tabIndex:C&&!L?0:void 0,role:C&&!L?"img":void 0,"aria-label":C&&!L?M(I,R):void 0,onMouseEnter:L?void 0:z=>F(z.currentTarget,I,R),onFocus:L||!C?void 0:z=>F(z.currentTarget,I,R),onBlur:C?G:void 0,onMouseLeave:G,children:!L&&(_&&g?(h??[]).map((z,O)=>{const ue=R[O]??0;if(b==null)return n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:Y(ue),background:z}},O);const te=Et(ue)<b;return n.jsxs("div",{className:se("bar-chart__slot"),style:B,children:[n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--up"),children:!te&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full"),style:{height:Y(ue),background:z}})}),n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--down"),children:te&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(ue),background:z}})})]},O)}):_?n.jsx("div",{className:se("bar-chart__stack"),style:B,children:(()=>{const z=R.reduce((ue,te,de)=>te>0?de:ue,-1);let O=x;return R.map((ue,te)=>{if(ue<=0)return null;const de=Math.min(O,ue/A*x);return O-=de,n.jsx("div",{className:se("bar-chart__stack-segment"),style:{height:de,background:(h??[])[te],borderRadius:te===z?"6px 6px 0 0":void 0}},te)})})()}):b!=null?n.jsx(n.Fragment,{children:[{v:Et(I.a),c:t},...f?[]:[{v:Et(I.b),c:a}]].map(({v:z,c:O},ue)=>n.jsxs("div",{className:se("bar-chart__slot"),style:B,children:[n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--up"),children:z>=b&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full"),style:{height:Y(z),background:O}})}),n.jsx("div",{className:se("bar-chart__slot__half bar-chart__slot__half--down"),children:z<b&&n.jsx("div",{className:se("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(z),background:O}})})]},ue))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:U,background:t}}),!f&&n.jsx("div",{className:se("bar-chart__bar"),style:{...B,height:j,background:a}})]}))},K)})]}),n.jsx("div",{className:se("bar-chart__x-axis"),children:e.map((I,K)=>{const L=Pn(I,b==null);return n.jsxs("span",{className:se(`bar-chart__x-axis__label${L?" bar-chart__x-axis__label--future":""}`),children:[n.jsxs("span",{className:se("caption-1 bar-chart__x-axis__main"),children:[I.isToday&&n.jsx("span",{className:se("bar-chart__x-axis__today-dot"),style:{background:t}}),I.label]}),I.sublabel&&n.jsx("span",{className:"caption-1",children:I.sublabel})]},K)})})]})})}),P&&n.jsx(Xn,{anchorRect:P.rect,title:P.title,items:P.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Ou({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:s,setRange:l,handlePrev:i,handleNext:u,periodOptions:c,period:d,setPeriod:h}=e,p=d==="week"?t("calendar.prevWeek","\uC774\uC804 \uC8FC"):t("calendar.prevMonth","\uC774\uC804 \uB2EC"),m=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:se("chart-section__controls"),children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:i}),n.jsx(_n,{value:s,onChange:l,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(be,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:m,showTooltipInfo:m,disabled:r<=0,onClick:u}),n.jsx(vn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:g=>h(g),size:40})]})}function Uo(e,t,a,r=!0){const s=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(l,i)=>{const u=new Date(t);u.setDate(t.getDate()+i);const c=(e[Vo(u)]?.daily??[])[u.getDate()-1],d=c!=null&&Pn(c,r)||u>s;return{dt:u,entry:c,isFuture:d}})}function Gv(e,t,a,r=!0){const{period:s,monthRange:l,weekRange:i,weekRanges:u,DOW:c}=t,d=ca(),h=d.getFullYear(),p=d.getMonth()+1,m=d.getDate();if(s==="month"){const C=e[l]??{weekly:[],daily:[]},f=ga(l),_=f?f.year:null,b=f?f.month1:null,w=_&&b?Dn(_,b-1):1;return C.weekly.map((v,A)=>{const x=A+1;let E=v.label,B=!1,D=!1;if(_&&b){const N=w+A*7,k=new Date(_,b-1,N+6),P=k.getMonth()+1,$=k.getDate(),G=P===b?`${$}`:`${P}/${$}`;E=a("manager.chart.weekRange",{start:N,end:G});const T=new Date(h,p-1,m).getTime();B=T>=new Date(_,b-1,N).getTime()&&T<=k.getTime(),D=_>h||_===h&&(b>p||b===p&&N>m)}return{...v,label:E,sublabel:Fu(a,x-1),isToday:B,future:v.future===!0||D||void 0,a:D?-1:v.a,b:D?0:v.b}})}const g=u.find(C=>C.value===i);if(!g)return[];const y=new Date(g.year,g.month-1,Dn(g.year,g.month-1)+g.week*7);return Uo(e,y,d,r).map(({dt:C,entry:f,isFuture:_})=>{const b=C.getMonth()+1,w=C.getDate(),v=C.getFullYear();return{label:b===g.month&&v===g.year?`${w}`:`${b}/${w}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:f&&f.a>0?f.a:0,b:_?0:f&&f.b>0?f.b:0,isToday:v===h&&b===p&&w===m,...f?.parts?{parts:_?f.parts.map(()=>0):f.parts}:{},...f?.partsB?{partsB:_?f.partsB.map(()=>0):f.partsB}:{}}})}const Kv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Yv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:s,data:l,colorA:i,colorB:u,labelAKey:c,labelBKey:d,showTotal:h=!1,totalUnitKey:p,totalLabelKey:m,control:g,hideControls:y=!1,rate:C=!1,rateAgg:f="dayMean",tightMax:_=!1,avgMode:b=!1,totalFormat:w,series:v,seriesMode:A="stack",loading:x=!1,onDetail:E,headExtra:B,headSegment:D,icon:N,disc:k,onClick:P,cardAriaLabel:$,cardTooltip:G,detailSize:T=32,barGap:F,baseline:M,className:Q,inGrid:Z=!1}){const{t:I}=xe.useTranslation(),K=Kv[t],L=Iu(l),W=g??L,Y=o.useMemo(()=>Gv(l,W,I,M==null),[l,W,I,M]),U=A==="group"&&!!v&&v.length>0;F!=null&&!U&&Bt("bar-chart-bargap-without-group","[BarChart] barGap \uC740 seriesMode='group' + series \uC5D0\uC11C\uB9CC \uC4F0\uC778\uB2E4 \u2014 \uADF8 \uBC16\uC5D0\uC11C\uB294 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4.");const j=o.useMemo(()=>{if(!C)return Y;const ee=W.period==="month"?ga(W.monthRange):null,V=ca(),ae=v?.length??0,H=q=>{const ie=[],Ne=[],_e=[];for(let he=0;he<ae;he++){let je=0,$e=0,De=0;for(const le of q){const we=Et(le.a[he]),Le=Et(le.b[he]);Le<=0||(je+=we,$e+=Le,De+=we/Le*100)}ie.push(f==="weighted"?$e>0?Math.round(je/$e*100):0:q.length?Math.round(De/q.length):0),Ne.push(je),_e.push($e)}return{pct:ie,ra:Ne,rb:_e}};return Y.map((q,ie)=>{let Ne=q.a===-1?-1:q.b>0?Math.round(q.a/q.b*100):0;if(ee&&!Pn(q)){const he=ee.year,je=ee.month1-1,$e=Uo(l,new Date(he,je,Dn(he,je)+ie*7),V).filter(De=>!De.isFuture);if(f==="weighted"){let De=0,le=0;for(const{entry:we}of $e)we&&we.b>0&&(De+=we.a,le+=we.b);Ne=le>0?Math.round(De/le*100):0}else Ne=$e.length?Math.round($e.reduce((De,{entry:le})=>De+(le&&le.b>0?le.a/le.b*100:0),0)/$e.length):0}let _e=null;if(U&&!Pn(q)){let he;if(ee){const $e=ee.year,De=ee.month1-1;he=Uo(l,new Date($e,De,Dn($e,De)+ie*7),V).filter(le=>!le.isFuture).map(({entry:le})=>({a:le?.parts??[],b:le?.partsB??[]}))}else he=[{a:q.parts??[],b:q.partsB??[]}];const je=H(he);_e={parts:je.pct,rawParts:je.ra,rawPartsB:je.rb}}return{...q,a:Ne,b:q.a===-1?0:d&&q.parts&&q.parts[1]>0?Math.round(q.parts[0]/q.parts[1]*100):0,rawA:q.a===-1?-1:q.a,rawB:q.b,..._e??{}}})},[Y,C,f,d,W.period,W.monthRange,l,U,v?.length]),R=o.useMemo(()=>{if(C||b){const V=(W.period==="week"?Y:l[W.monthRange]?.daily??[]).filter(H=>H.a!==-1);if(V.length===0)return 0;if(C&&f==="weighted"){let H=0,q=0;for(const ie of V)ie.b>0&&(H+=ie.a,q+=ie.b);return q>0?Math.round(H/q*100):0}const ae=C?V.reduce((H,q)=>H+(q.b>0?q.a/q.b*100:0),0):V.reduce((H,q)=>H+(q.a>0?q.a:0),0);return Math.round(ae/V.length)}const ee=W.period==="month"?l[W.monthRange]?.daily??[]:j;return M!=null?ee.reduce((V,ae)=>V+(Pn(ae,!1)?0:Et(ae.a)+(d?Et(ae.b):0)),0):ee.reduce((V,ae)=>V+(ae.a>0?ae.a:0)+(d&&ae.b>0?ae.b:0),0)},[j,Y,C,f,b,M,d,W.period,W.monthRange,l]),z=v&&v.length>0?v.map(ee=>({color:ee.color,label:ee.label})):[{color:i,label:I(c)},...d?[{color:u,label:I(d)}]:[]],O=t==="small",ue=[O?"chart-section--compact":t==="large"?"chart-section--full":void 0,Q].filter(Boolean).join(" ")||void 0,te=r?I(r):"",de=te?I("trainingStatus.detailFor",{name:te,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):I("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Ho,{className:ue,inGrid:Z,icon:N,disc:k,onClick:P,ariaLabel:$,tooltip:G,headSegment:D,headMenuItems:E?[{label:de,icon:"list",onClick:E,closeOnSelect:!0}]:void 0,title:I(r),titleLevel:s,titleClassName:O?"h5 chart-section-title--small":void 0,headRight:O?B??void 0:({collapsed:ee})=>n.jsxs(n.Fragment,{children:[!y&&n.jsx(Ou,{control:W}),B,E&&!ee&&n.jsx("span",{className:se("bar-chart__detail-btn"),children:n.jsx(be,{htmlType:"button",size:T,type:"dot",icon:"list",ariaLabel:de,showTooltipInfo:de,onClick:E})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||b||m&&w?n.jsx(er,{label:O?void 0:`${I(W.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${I(m??c)}`,children:w?(w(R).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ee,V)=>/\d/.test(ee)?n.jsx("span",{className:se("chart-section__total__num h0"),children:ee},V):n.jsx("span",{className:se("chart-section__total__unit h5"),children:ee},V)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:R}),p&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(p)})]})}):n.jsxs(er,{children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:R}),n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(c)}),p&&n.jsx("span",{className:se("chart-section__total__unit h5"),children:I(p)})]}):n.jsx("span",{}),n.jsx(Wo,{items:z,className:"caption-1"})]}),children:x?n.jsx("div",{className:se("bar-chart__wrap bar-chart__loading"),"aria-busy":"true",children:n.jsx("div",{className:se("bar-chart__inner"),children:n.jsxs("div",{className:se("bar-chart__area bar-chart__area--loading"),children:[n.jsx("div",{className:se("bar-chart__plot bar-chart__plot--loading"),style:{height:K.height},children:n.jsx(pa,{size:32})}),n.jsx("div",{className:se("bar-chart__x-axis"),"aria-hidden":"true",children:n.jsxs("span",{className:se("bar-chart__x-axis__label"),children:[n.jsx("span",{className:se("caption-1 bar-chart__x-axis__main"),children:"\xA0"}),j.some(ee=>!!ee.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Uv,{focusableBars:e,data:j,colorA:i,colorB:d?u:void 0,labelA:I(c),labelB:d?I(d):void 0,barWidth:a??K.barWidth,barGap:F,baseline:M,height:K.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:v?.map(ee=>ee.color),seriesLabels:v?.map(ee=>ee.label),rateLabels:C?{total:I("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:I("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:U})})}const zu=120,Zv={left:38,right:16,top:26,bottom:24};function Xv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:s,height:l=156,fallbackWidth:i=320,insets:u,overlay:c,ariaLabel:d,className:h}){const[p,m]=o.useState(null),[g,y]=o.useState(null);o.useEffect(()=>{if(!g)return;const M=Z=>m(Math.round(Z)||null);if(M(g.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Q=new ResizeObserver(([Z])=>M(Z.contentRect.width));return Q.observe(g),()=>{Q.disconnect()}},[g]);const{payload:C,anchorRect:f,openAfterDelay:_,close:b}=Hy(zu),w=o.useCallback((M,Q)=>{M&&_(M,Q.getBoundingClientRect())},[_]),v=p??i,A=l,{left:x,right:E,top:B,bottom:D}={...Zv,...u},[N,k]=t,P=M=>k===N?x:x+(v-x-E)*(M-N)/(k-N),$=M=>B+(A-B-D)*(100-M)/100,G={x:P,y:$,plot:{left:x,right:v-E,top:B,bottom:A-D,width:Math.max(0,v-x-E),height:Math.max(0,A-B-D)}},T=e.filter(M=>!M.hollow),F=s??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:y,className:Ae("line-chart",h),viewBox:`0 0 ${v} ${A}`,role:"img","aria-label":d??e.map(M=>M.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map(M=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:x,x2:v-E,y1:$(M),y2:$(M)}),n.jsxs("text",{className:"line-chart__tick",x:x-6,y:$(M)+4,textAnchor:"end",children:[M,"%"]})]},M)),c?.(G),a.map(M=>n.jsx("text",{className:"line-chart__tick",x:P(M.x),y:A-5,textAnchor:"middle",children:M.label},M.x)),T.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:F,points:T.map(M=>`${P(M.x)},${$(M.pct)}`).join(" ")}),e.map(M=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Q=>w(M.description,Q.currentTarget),onPointerLeave:b,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:P(M.x),cy:$(M.pct),r:12}),n.jsx("circle",{className:Ae("line-chart__dot-main",M.hollow&&"is-hollow"),cx:P(M.x),cy:$(M.pct),r:4,stroke:F,fill:M.hollow?void 0:F})]},M.x))]}),C!=null&&n.jsx(wn,{anchorRect:f,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Jv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:s,tipGroups:l,start:i,className:u}){return n.jsxs("div",{className:Ae("game-intro",u),children:[e!=null&&n.jsx("span",{className:"game-intro__icon","aria-hidden":"true",style:{"--game-intro-icon":`${t}px`},children:e}),n.jsx("h2",{className:Ae("game-intro__title",r),children:a}),s!=null&&n.jsx("p",{className:"game-intro__description body-3",children:s}),l?.map((c,d)=>n.jsxs("div",{className:"game-intro__tips",children:[c.title!=null&&n.jsx("span",{className:"game-intro__tips-title body-3",children:c.title}),c.tips.map((h,p)=>n.jsxs("span",{className:"game-intro__tip body-3",children:[h.icon!=null&&n.jsx("span",{"aria-hidden":"true",children:h.icon}),n.jsx("span",{children:h.text})]},p))]},d)),i&&n.jsx(be,{htmlType:"button",className:i.className,variant:"main",color:i.color,size:48,width:"100%",disabled:i.disabled,onClick:i.onClick,children:i.label})]})}const Wu=(e,t,a)=>{const r=new Date(Date.UTC(e,t,a));return`${r.getUTCFullYear()}-${String(r.getUTCMonth()+1).padStart(2,"0")}-${String(r.getUTCDate()).padStart(2,"0")}`},Hu=(e,t,a,r)=>({from:Ul(e,t,a),to:new Date(Ul(e,t,a+r).getTime()-1),fromYmd:Wu(e,t,a),toYmd:Wu(e,t,a+r-1)});function Qv(e,t=0){if(e.period==="month"){const s=ga(e.monthRange),l=ca(),i=s?s.year:l.getFullYear(),u=(s?s.month1:l.getMonth()+1)-1+t,c=new Date(Date.UTC(i,u+1,0)).getUTCDate();return Hu(i,u,1,c)}const a=e.weekRanges.find(s=>s.value===e.weekRange);if(!a){const s=new Date,l=Pa();return{from:s,to:s,fromYmd:l,toYmd:l}}const r=Dn(a.year,a.month-1);return Hu(a.year,a.month-1,r+(a.week+t)*7,7)}const Go={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function Vu(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function qu({done:e,total:t,segments:a,color:r="var(--color-main)",size:s="medium",strokeWidth:l,label:i="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof s=="number"?s:Go[s].diameter,h=l??(typeof s=="number"?12:Go[s].strokeWidth),p=d/2,m=(d-h)/2,g=2*Math.PI*m;if(a&&a.length>0){const _=a.reduce((b,w)=>{const v=b.length>0?b[b.length-1].acc:0,A=Number.isFinite(w.ratio)?w.ratio:0,x=Math.max(0,Math.min(A,1-v));return b.push({color:w.color,rotate:-90+v*360,dash:g*x,acc:v+x}),b},[]);return n.jsx("div",{className:"ring-chart",style:{width:d,height:d},children:n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),_.map((b,w)=>b.dash>0&&n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:b.color,strokeWidth:h,strokeDasharray:`${b.dash} ${g}`,strokeLinecap:"round",transform:`rotate(${b.rotate} ${p} ${p})`},w))]})})}const y=(t??0)>0?Math.min((e??0)/t,1):0,C=g*y,f=g-C;return n.jsxs("div",{className:"ring-chart",style:{width:d,height:d},children:[n.jsxs("svg",{width:d,height:d,viewBox:`0 0 ${d} ${d}`,"aria-hidden":"true",children:[n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),y>0&&n.jsx("circle",{cx:p,cy:p,r:m,fill:"none",stroke:r,strokeWidth:h,strokeDasharray:`${C} ${f}`,strokeLinecap:y<.02||y>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":s==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:Vu(y)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||s==="medium"?" ring-chart__label--tight":""}`,children:i})]})]})}function e4({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:s,totalLabelKey:l,legend:i,loading:u,className:c,inGrid:d=!1,onClick:h,ariaLabel:p,tooltip:m,...g}){const{t:y}=xe.useTranslation();if(!e)return n.jsx(qu,{...g});const C=(g.total??0)>0?Vu(Math.min((g.done??0)/g.total,1)):0,f=g.size==="small",_=typeof g.size=="number"?g.size:Go[g.size??"medium"].diameter,b=g.size==="large",w=[c,f?"chart-section--compact":b?"chart-section--full":""].filter(Boolean).join(" ")||void 0,v=r&&n.jsx("span",{className:se("chart-section-icon"),children:n.jsx(at,{icon:r,className:se("chart-section-icon-inner")})});return n.jsx(Ho,{className:w,inGrid:d,onClick:h,ariaLabel:p,tooltip:m,title:y(e),titleLevel:t,titleClassName:f?"h5 chart-section-title--small":void 0,headRight:v||(f?void 0:a),subRow:(s||i)&&n.jsxs(n.Fragment,{children:[s?n.jsxs(er,{label:!f&&l?y(l):void 0,children:[n.jsx("span",{className:se("chart-section__total__num h0"),children:C}),n.jsx("span",{className:se("chart-section__total__unit h5"),children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Wo,{items:i})]}),children:u?n.jsx("div",{className:se("ring-chart-section-body ring-chart-section-body--offset"),children:n.jsx("div",{className:"ring-chart ring-chart--loading",style:{width:_,height:_},"aria-busy":"true",children:n.jsx(pa,{size:32})})}):n.jsx("div",{className:se("ring-chart-section-body ring-chart-section-body--offset"),children:n.jsx(qu,{...g,hideCenter:g.hideCenter??f})})})}function t4({label:e,value:t,change:a,changeType:r,icon:s,tooltip:l,onClick:i,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:h,close:p}=Oa(),m=o.useCallback(()=>{l&&c.current&&h(c.current)},[l,h]),g=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),y=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(f=>{i&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i())},[i]);return n.jsxs("div",{ref:c,className:se(`stat-chart__card${i?" stat-chart__card--clickable":""}`),onClick:i,onKeyDown:i?C:void 0,onPointerEnter:m,onPointerLeave:p,onFocus:m,onBlur:p,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":i?[e,t,y].filter(f=>f!==void 0&&f!=="").join(" "):void 0,children:[l&&d&&n.jsx(Tn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:l}),n.jsxs("div",{className:se("stat-chart__card__label-row"),children:[n.jsx("span",{className:se("stat-chart__card__label h5"),children:e}),s&&n.jsx("span",{className:se("stat-chart__card__icon"),children:n.jsx(at,{icon:s,className:se("stat-chart__card__icon-inner")})})]}),n.jsxs("div",{className:se("stat-chart__card__content"),children:[n.jsxs("div",{className:se("stat-chart__card__left"),children:[n.jsx("div",{className:se("stat-chart__card__value h2"),children:t}),y&&n.jsx("div",{className:se(`stat-chart__card__change stat-chart__card__change--${g??"neutral"} caption-1`),children:y})]}),u&&n.jsx("div",{className:se("stat-chart__card__body"),children:u})]})]})}function Uu({value:e,onChange:t,min:a=0,max:r=100,step:s=1,orientation:l="horizontal",size:i=24,disabled:u=!1,ariaLabel:c,length:d,className:h,label:p,formatValue:m,labelPos:g,labelAlign:y="right",showMinMax:C=!1,minLabel:f,maxLabel:_,showBgTick:b=!1,showFillTick:w=!1,tickStep:v,tickShape:A="dot"}){t&&!c&&Bt("Slider:unnamed","[ihab/Slider] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. label prop \uC740 \uAC12 \uD45C\uAE30 \uBC29\uC2DD\uC774\uC9C0 \uC774\uB984\uC774 \uC544\uB2D9\uB2C8\uB2E4.");const x=Math.min(r,Math.max(a,e)),E=r>a?(x-a)/(r-a):0,B=l==="vertical",D=!t,N=Y=>t?.(Number(Y.target.value)),k=typeof d=="number"?`${d}px`:d,P={"--slider-ratio":String(E),"--slider-thumb":`${i}px`,...k?B?{height:k}:{width:k}:{}},$=v??s,G=(b||w)&&$>0&&r>a?Math.floor((r-a)/$+1e-6):0;if(G>0&&G<=100){const Y=A!=="dash",U=ue=>Y?`radial-gradient(circle, ${ue} 0.5px, transparent 1px)`:B?`linear-gradient(to bottom, transparent calc(50% - 2px), ${ue} calc(50% - 2px), ${ue} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${ue} calc(50% - 2px), ${ue} calc(50% + 2px), transparent calc(50% + 2px))`,j=Y?"2px":"4px",R=[],z=[],O=[];for(let ue=0;ue<=G;ue++){const te=ue*$/(r-a);if(te>1+1e-6)break;const de=`${((B?1-te:te)*100).toFixed(4)}%`,ee=te<=E+1e-6;if(ee?!w:!b)continue;const V=ee?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";R.push(U(V)),z.push(B?`${j} var(--slider-thumb)`:`var(--slider-thumb) ${j}`),O.push(B?`center ${de}`:`${de} center`)}R.push(B?"linear-gradient(to top, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))":"linear-gradient(to right, var(--slider-fill-color) var(--slider-fill), var(--color-darkWhite) var(--slider-fill))"),z.push("100% 100%"),O.push("0 0"),P.backgroundImage=R.join(", "),P.backgroundSize=z.join(", "),P.backgroundPosition=O.join(", "),P.backgroundRepeat="no-repeat"}const T=m?m(x):p==="percent"?`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`:p==="count"?`${x} / ${r}`:x===a&&f?f:x===r&&_?_:void 0,F=n.jsx("input",{type:"range",className:Ae("slider",`slider--${l}`,D&&"slider--static",!p&&!C&&h),min:a,max:r,step:s,value:x,disabled:u,readOnly:D,tabIndex:D?-1:void 0,"aria-label":c,"aria-valuetext":T,"aria-orientation":l,onChange:N,style:P});if(!p&&!C)return F;const M=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:f??a}),Q=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),Z=C?n.jsxs("div",{className:Ae("slider-track-group",`slider-track-group--${l}`,!p&&h),children:[B?Q:M,F,B?M:Q]}):F;if(!p)return Z;const I=g??(B?"bottom":"right"),K=`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`,L=m?m(x):p==="percent"?K:p==="count"?`${x} / ${r}`:String(x),W=n.jsx("span",{className:"slider-wrap__value body-3b",children:L});return n.jsxs("div",{className:Ae("slider-wrap",`slider-wrap--${l}`,`slider-wrap--label-${I}`,`slider-wrap--align-${y}`,h),children:[Z,W]})}const n4=.86,a4=250,Ko=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Yo=(e,t,a,r)=>{const s=Ko(e,t,a,r);return`${s<0?"-":"+"}${Math.abs(s)} dB`};function Zo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:s,labelPos:l,labelAlign:i="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:h=25,className:p,ariaLabel:m}){const g=o.useRef(null),y=o.useRef(null),C=o.useRef(null),f=o.useRef(null),[_,b]=o.useState(null);o.useEffect(()=>{const x=F=>{const M=Yo(F,c,d,h);C.current&&(C.current.textContent=M);const Q=g.current;Q&&(Q.setAttribute("aria-valuenow",String(Ko(F,c,d,h))),Q.setAttribute("aria-valuetext",M))},E=e??G1(t)??(_&&_.el===t?_.node:null),B=y.current;if(!E||!B){B?.style.setProperty("--meter-level","0"),x(u);let F=!1;return!e&&t&&sr(t).then(M=>{!F&&M&&b({el:t,node:M})}),()=>{F=!0}}ao();const D=new Float32Array(E.fftSize);let N=0,k=0,P=0,$=0,G=null;const T=F=>{const M=K1(E,D);N=M>N?M:N*n4;const Q=N>1e-5?20*Math.log10(N):-1/0,Z=Math.max(u,Q),I=Z-c,K=Math.min(1,Math.max(0,(I-d)/(h-d)));if(B.style.setProperty("--meter-level",K.toFixed(3)),k+=Z,P+=1,F-$>=a4){const L=k/P;G=G==null?L:G*.6+L*.4,x(G),k=0,P=0,$=F}f.current=requestAnimationFrame(T)};return f.current=requestAnimationFrame(T),()=>{f.current!=null&&cancelAnimationFrame(f.current),f.current=null}},[e,t,_,u,c,d,h]);const w=typeof r=="number"?`${r}px`:r,v=n.jsx("div",{className:"audio-meter__track",style:w?a==="vertical"?{height:w}:{width:w}:{},children:n.jsx("div",{ref:y,className:"audio-meter__fill"})}),A=l??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:g,className:Ae("audio-meter",`audio-meter--${a}`,s&&`audio-meter--label-${A}`,s&&`audio-meter--align-${i}`,p),role:"meter","aria-label":m,"aria-valuemin":d,"aria-valuemax":h,"aria-valuenow":Ko(u,c,d,h),"aria-valuetext":Yo(u,c,d,h),children:[v,s&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Yo(u,c,d,h)})]})}const Gu=260;function Ku({message:e,position:t,duration:a,onClose:r}){const[s,l]=o.useState(!1),[i,u]=o.useState(!1),c=o.useRef(i),d=o.useRef(s);o.useEffect(()=>{c.current=i},[i]),o.useEffect(()=>{d.current=s},[s]);const h=o.useRef(null),p=o.useRef(""),m=o.useRef(r);o.useEffect(()=>{m.current=r});const g=a,y=o.useRef(null),C=o.useRef(0),f=o.useRef(0),_=o.useRef(!1),b=o.useRef(null),w=o.useRef(null),v=o.useRef(null),A=o.useRef(null),x=o.useRef(()=>{});x.current=D=>{D<0||(C.current=Date.now(),f.current=D,y.current=setTimeout(()=>{y.current=null,l(!1),b.current=setTimeout(()=>{u(!1);try{m.current()}catch{}},Gu)},D))};const E=o.useCallback(()=>{_.current||!y.current||(_.current=!0,clearTimeout(y.current),y.current=null,f.current=Math.max(0,f.current-(Date.now()-C.current)))},[]),B=o.useCallback(()=>{_.current&&(_.current=!1,x.current(f.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(y.current&&(clearTimeout(y.current),y.current=null),b.current&&(clearTimeout(b.current),b.current=null)),e){if(d.current)return g>0&&!y.current&&(_.current?f.current=g:x.current(g)),p.current=e,()=>{y.current&&(clearTimeout(y.current),y.current=null),b.current&&(clearTimeout(b.current),b.current=null)};const D=()=>{const N=h.current;if(N)try{N.classList.remove("is-visible"),N.style.transition="none",t==="top"?N.style.transform="translateX(-50%) translateY(-16px)":N.style.transform="translateX(-50%) translateY(16px)",N.style.opacity="0",N.offsetWidth,N.style.transition="",N.classList.add("is-visible"),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null;try{N.style.opacity="",N.style.transform="",N.style.transition=""}catch{}},60)}catch{}};c.current?(D(),l(!0)):(u(!0),w.current=requestAnimationFrame(()=>{v.current=requestAnimationFrame(()=>{D(),l(!0)})})),g>0&&(_.current=!1,x.current(g))}else l(!1),b.current=setTimeout(()=>u(!1),Gu);return p.current=e,()=>{y.current&&clearTimeout(y.current),b.current&&clearTimeout(b.current),w.current&&cancelAnimationFrame(w.current),v.current&&cancelAnimationFrame(v.current),A.current&&clearTimeout(A.current),y.current=null,b.current=null,w.current=null,v.current=null,A.current=null}},[e,g,t]),{mounted:i,showing:s,popupRef:h,pause:E,resume:B}}function ya({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:s=2e3}){const{mounted:l,showing:i,popupRef:u,pause:c,resume:d}=Ku({message:e,position:t,duration:s,onClose:r}),h=o.useRef(null),[p,m]=o.useState(!1);if(o.useEffect(()=>{i?m(!0):l||m(!1)},[i,l]),!l)return null;const g=a==="notice"||a==="warning"?a:"normal",y=n.jsx("div",{ref:u,className:`toast toast--${t} ${i?"is-visible":""}`,role:"status","aria-live":"polite",onPointerEnter:C=>{h.current=C.pointerType},onMouseEnter:()=>{h.current!=="touch"&&c()},onMouseLeave:d,onFocusCapture:c,onBlurCapture:d,children:n.jsx("div",{className:`toast__inner toast__inner--${g} body-2`,"aria-hidden":p||i?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?pn.createPortal(y,document.body):y}const r4=24;function o4({value:e,max:t=100,size:a=8,color:r,trackColor:s,label:l,formatValue:i,labelPos:u,labelAlign:c="right",ariaLabel:d,className:h}){const p=Number.isFinite(t)&&t>0?t:1,m=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),g=m/p*100,y=Number.isFinite(t)&&t>0?t:0,C=u??(a>=r4?"inside":"bottom"),f=C==="center"?"inside":C,_=f==="inside"&&(c==="left"?g>=15:c==="center"?g>=50:g>=85),b={};return r&&(b["--progress-bar-fill"]=r),s&&(b["--progress-bar-track"]=s),n.jsxs("div",{className:Ae("progress-bar",`progress-bar--${a}`,`progress-bar--label-${f}`,l&&`progress-bar--align-${c}`,l&&_&&"progress-bar--label-on-fill",h),style:b,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":y,"aria-valuetext":l?i?i(m):l==="percent"?void 0:l==="raw"?String(m):`${m} / ${y}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${g}%`}})}),l&&n.jsx("span",{className:"progress-bar__label caption-1b",children:i?i(m):l==="percent"?`${Math.round(g)}%`:l==="raw"?String(m):`${m} / ${y}`})]})}const Yu={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},s4="rgba(255, 255, 255, 0.16)";function Zu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:s,variant:l="numbered",announce:i=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=yn("(max-width: 767px)");if(!Number.isInteger(e)||e<=0)return null;const h=Number.isInteger(t)?Math.max(0,Math.min(t,e-1)):0,p=u??c("progress.steps",{current:h+1,total:e,defaultValue:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"}),m={};if(a&&(m["--pi-inactive-bg"]=a),r&&(m["--pi-inactive-color"]=r),s&&(a||(m["--pi-inactive-bg"]=s4),r||(m["--pi-inactive-color"]="var(--color-white)")),l==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:m,role:i?"status":"img","aria-label":i?void 0:p,children:[i&&n.jsx("span",{style:Yu,children:p}),Array.from({length:e}).map((y,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<h?" done":C===h?" active":""}`},C))]});const g=i?n.jsx("span",{role:"status",style:Yu,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:m,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[h+1," / ",e]})}),g]}):n.jsxs(n.Fragment,{children:[g,n.jsx("div",{className:"progress-indicator",style:m,role:"list","aria-label":p,children:Array.from({length:e}).map((y,C)=>n.jsx("span",{role:"listitem","aria-current":C===h?"step":void 0,className:`progress-indicator-dot ${C<h?" done":C===h?" active":""} body-3`,children:C+1},C))})]})}function l4(e){if(!e)return[];const t=[];let a=0,r="";for(const s of e.trim()){if(s==="("?a++:s===")"&&a--,/\s/.test(s)&&a===0){r&&(t.push(r),r="");continue}r+=s}return r&&t.push(r),t}function i4(e,t,a=0){const r=Array.from({length:Math.max(0,t)},()=>0);for(const s of e){let l=0;for(const i of s){if(l>=r.length)break;const u=Xu(i.span),c=Math.min(u,r.length-l);if(c===1)r[l]=Math.max(r[l],i.width);else{const d=Math.max(0,(i.width-a*(c-1))/c);for(let h=l;h<l+c;h++)r[h]=Math.max(r[h],d)}l+=c}}return r}function Xu(e){const t=typeof e=="number"?e:parseInt(String(e??""),10);return Number.isFinite(t)&&t>=1?Math.floor(t):1}function u4(e,t){const a=/span\s+(\d+)/.exec(`${e??""} ${t??""}`);return a?Xu(parseInt(a[1],10)):1}function c4(e,t){const{isFixed:a,floorOf:r,containerWidth:s}=t,l=e.reduce((p,m,g)=>p+(a(g)?m:0),0),i=e.reduce((p,m,g)=>p+(a(g)?0:m),0),u=s-l;if(!(s>0&&i>0&&u>0))return[...e];const c=u/i,d=e.map((p,m)=>a(m)?p:Math.max(r(m),Math.round(p*c))),h=Math.round(u-d.reduce((p,m,g)=>p+(a(g)?0:m),0));if(h!==0){let p=-1;d.forEach((m,g)=>{!a(g)&&(p<0||m>d[p])&&(p=g)}),p>=0&&(d[p]=Math.max(r(p),d[p]+h))}return d}const d4=16;function p4(e,t=d4){return e.map(a=>{const r=a.sortable&&!a.sorted;return Math.max(a.declaredMin,Math.ceil(a.headWidth+(r?t:0)))})}function h4({children:e,className:t,style:a,span:r,rowLabel:s,onRowClick:l}){const i=r&&r>1?{gridColumn:`span ${r}`,...a}:a;return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:i,"aria-colspan":r&&r>1?r:void 0,children:s&&l?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":s,children:e}):e})}function Xo({variant:e="default",children:t,className:a,draggable:r,onClick:s,onMouseEnter:l,onMouseLeave:i,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:h,describedBy:p,rowHasButton:m}){const g=o.useCallback(y=>{s&&y.target===y.currentTarget&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),s())},[s]);return e==="loading"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--loading",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row__full-cell",children:n.jsx(pa,{size:28})})})}):e==="empty"?n.jsx("div",{role:"presentation",className:"table-row-wrap",children:n.jsx("div",{role:"row",className:"table-row table-row--empty body-3",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row__full-cell",children:t})})}):n.jsxs("div",{role:"presentation",className:"table-row-wrap",children:[n.jsx("div",{className:a?`table-row ${a}`:"table-row",draggable:r,onClick:s,onKeyDown:s?g:void 0,onMouseEnter:l,onMouseLeave:i,onDragStart:u,onDragEnd:c,role:"row",tabIndex:s&&!m?0:void 0,"aria-describedby":s&&!m?p:void 0,children:t}),d&&n.jsx("div",{role:"row",className:"table-row-expand",children:n.jsx("div",{role:"cell","aria-colspan":h,className:"table-row-expand__cell",children:d})})]})}function m4({dir:e}){return n.jsx(e==="asc"?el:Qs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function C4({children:e,onClick:t,className:a,sortDir:r,ariaSort:s,onResizeStart:l}){const i=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(m4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":s,className:Ae("table-field body-3",a,r?"table-field--sorted":"",l?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:i}):i,l&&n.jsx("span",{className:"table-field__resizer",onPointerDown:l,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Ju(e){return e&&e!=="left"?`table-col--${e}`:void 0}function Jo({fields:e=[],sort:t,sortable:a=!0,headerGroups:r,items:s=[],renderRow:l,onRowClick:i,isRowClickable:u,onRowMouseEnter:c,onRowMouseLeave:d,onRowDragStart:h,onRowDragEnd:p,draggingId:m,gridTemplateColumns:g,mobileGridTemplateColumns:y,resizable:C=!0,resizeMode:f="grow",resizeStorageKey:_,size:b="small",title:w,icon:v,count:A,collapsed:x=!1,onToggleCollapse:E,headerActions:B,empty:D,loading:N,dragOver:k=!1,onDragOver:P,onDragLeave:$,onDrop:G,renderExpandedRow:T,expandedId:F}){const{t:M}=xe.useTranslation(),Q=o.useId(),Z=`table-title-${Q}`,I=`table-row-hint-${Q}`,[K,L]=o.useState(null),W=o.useCallback((re,ve)=>{const Ie=e[ve];if(!Ie)return;if(Ie.sortValue)return Ie.sortValue(re);if(Ie.sortKey)return re[Ie.sortKey];const We=l(re)[ve]?.content;return typeof We=="string"||typeof We=="number"?We:void 0},[e,l]),Y=!t&&a&&!e.some(re=>re.sortDir!==void 0||re.onClick),U=o.useCallback(re=>{const ve=e[re];if(!ve||ve.sortable===!1)return!1;if(ve.sortValue||ve.sortKey)return!0;const Ie=s[0];return Ie!==void 0&&W(Ie,re)!==void 0},[e,s,W]),j=o.useMemo(()=>t?e.map(re=>{if(!re.sortKey||re.sortDir!==void 0)return re;const ve=t.field(String(re.label??""),re.sortKey);return{...re,sortDir:ve.sortDir,onClick:re.onClick??ve.onClick}}):Y?e.map((re,ve)=>U(ve)?{...re,sortDir:K?.index===ve?K.asc?"asc":"desc":null,onClick:()=>L(Ie=>Ie?.index===ve?{index:ve,asc:!Ie.asc}:{index:ve,asc:!0})}:re):e,[e,t,Y,K,U]),R=o.useMemo(()=>{if(!Y||!K)return s;const{index:re,asc:ve}=K;return[...s].sort((Ie,We)=>fr(W(Ie,re),W(We,re),ve))},[s,Y,K,W]),z=yn("(max-width: 767px)"),O=y&&z?y:null,ue=C&&!z,te=o.useRef(ue);te.current=ue;const de=48,ee=40,V=o.useRef(()=>de),ae=_?`table-cols:${_}`:null,H=o.useRef(null),q=o.useRef(null),ie=o.useRef(null),Ne=o.useRef(null),[_e,he]=o.useState(!1),[je,$e]=o.useState(0),De=o.useCallback(()=>{const re=ie.current;if(!re)return;const ve=Ne.current,Ie=H.current;if(ve&&(ve.style.minWidth="",Ie)){const We=Ie.scrollWidth,Qe=te.current?ee:0;ve.style.minWidth=We>re.clientWidth+1?`${We+Qe}px`:""}he(re.scrollWidth>re.clientWidth+1),$e(re.clientWidth)},[]),le=o.useCallback((re,ve)=>{const Ie=re.current;Ie&&q.current&&q.current.unobserve(Ie),re.current=ve,ve?(!q.current&&typeof ResizeObserver<"u"&&(q.current=new ResizeObserver(()=>De())),q.current?.observe(ve)):!ie.current&&!Ne.current&&(q.current?.disconnect(),q.current=null),De()},[De]),we=o.useCallback(re=>le(ie,re),[le]),Le=o.useCallback(re=>le(Ne,re),[le]);o.useEffect(()=>{De()}),o.useEffect(()=>{if(typeof window>"u")return;const re=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>De()):null;return window.addEventListener("resize",De),()=>{re!=null&&cancelAnimationFrame(re),window.removeEventListener("resize",De)}},[De]);const Be=o.useRef(()=>!1),ze=o.useRef([]),Ve=o.useRef(null),ut=re=>{if(!re||typeof window>"u")return null;try{const ve=JSON.parse(window.localStorage.getItem(re)??"null");return Array.isArray(ve)&&ve.length>0&&ve.every(Ie=>typeof Ie=="number"&&Number.isFinite(Ie)&&Ie>0)?ve:null}catch{return null}},[et,Xe]=o.useState(()=>ut(ae)),[yt,Te]=o.useState(ae),[Ke,ke]=o.useState(()=>ut(ae)!==null);if(yt!==ae){Te(ae);const re=ut(ae);Xe(re),ke(re!==null)}const qe=o.useRef(et);o.useEffect(()=>{qe.current=et},[et]);const Je=o.useCallback(re=>{const ve=Ve.current;if(!ve)return;const Ie=qe.current;if(Ie){const We=[...Ie],Qe=()=>de;if(ve.next!=null&&ve.startWNext!=null){const st=re.clientX-ve.startX,Tt=Math.max(Qe()-ve.startW,Math.min(ve.startWNext-Qe(),st));We[ve.index]=ve.startW+Tt,We[ve.next]=ve.startWNext-Tt}else We[ve.index]=Math.max(Qe(),ve.startW+(re.clientX-ve.startX));qe.current=We,Xe(We)}},[]),tt=o.useCallback(()=>{if(Ve.current=null,window.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),document.body.style.cursor="",document.body.style.userSelect="",ae&&qe.current)try{window.localStorage.setItem(ae,JSON.stringify(qe.current))}catch{}},[Je,ae]),xt=o.useCallback((re,ve)=>{ve.preventDefault(),ve.stopPropagation();const Ie=H.current;if(!Ie)return;const We=Array.from(Ie.children).map(st=>st.getBoundingClientRect().width),Qe=f==="fit"?j.findIndex((st,Tt)=>Tt>re&&st.resizable!==!1):-1;Ve.current=Qe>=0?{index:re,startX:ve.clientX,startW:We[re],next:Qe,startWNext:We[Qe]}:{index:re,startX:ve.clientX,startW:We[re]},qe.current=We,Xe(We),ke(!0),window.addEventListener("pointermove",Je),window.addEventListener("pointerup",tt),window.addEventListener("pointercancel",tt),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Je,tt,f,j]),wt=o.useCallback(()=>{const re=H.current,ve=re?.closest(".table-wrap");if(!re||!ve)return null;const Ie=ve.style.getPropertyValue("--table-grid-cols");ve.style.setProperty("--table-grid-cols",j.map(()=>"max-content").join(" "));const We=Array.from(ve.querySelectorAll(".table-row")).filter(St=>!St.classList.contains("table-row--loading")&&!St.classList.contains("table-row--empty")),Qe=St=>Array.from(St.children).map(Rt=>{const Wt=window.getComputedStyle(Rt);return{width:Rt.getBoundingClientRect().width,span:u4(Wt.gridColumnStart,Wt.gridColumnEnd)}}),st=parseFloat(window.getComputedStyle(re).columnGap)||0,Tt=We.map(Qe),ln=Qe(re),un=i4([ln,...Tt],j.length,st),$t=p4(j.map((St,Rt)=>({declaredMin:V.current(Rt),headWidth:ln[Rt]?.width??0,sortable:St.sortDir!==void 0||!!St.onClick,sorted:!!St.sortDir}))),Ot=St=>$t[St]??V.current(St),cn=j.map((St,Rt)=>{const Wt=un[Rt],Kt=Be.current(Rt)?parseFloat(ze.current[Rt]):NaN;return Number.isFinite(Kt)&&Math.ceil(Wt)>Kt&&Bt(`table-fixed-col-overflow:${Rt}:${Kt}`,`[ihabdevteam-core] Table \uC758 ${Rt+1}\uBC88\uC9F8 \uC5F4\uC744 ${Kt}px \uB85C \uC815\uD574 \uB450\uC5C8\uB294\uB370 \uC548\uC758 \uB0B4\uC6A9\uC740 ${Math.ceil(Wt)}px \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 \u2014 \uADF8\uB9CC\uD07C \uC798\uB824 \uB098\uAC11\uB2C8\uB2E4. gridTemplateColumns(\uB610\uB294 fields[].width)\uC758 \uADF8 \uC5F4\uC744 ${Math.ceil(Wt)}px \uC774\uC0C1\uC73C\uB85C \uB298\uB9AC\uC138\uC694.`),Number.isFinite(Kt)?Kt:Math.max(V.current(Rt),Math.ceil(Wt))}),Pt=window.getComputedStyle(re),kn=(parseFloat(Pt.paddingLeft)||0)+(parseFloat(Pt.paddingRight)||0),Jt=ve.clientWidth-kn;return Ie?ve.style.setProperty("--table-grid-cols",Ie):ve.style.removeProperty("--table-grid-cols"),c4(cn,{isFixed:St=>Be.current(St),floorOf:Ot,containerWidth:Jt})},[j,f]),Dt=(re,ve)=>re!==null&&re.length===ve.length&&re.every((Ie,We)=>Ie===ve[We]),rt=o.useRef(wt);o.useEffect(()=>{rt.current=wt});const[nt,kt]=o.useState(0),At=R.length>0,Lt=`${ae??""}|${nt}|${j.length}|${je}`,jt=!Ke&&ue&&ae!==null&&!N?`${Lt}|${At?1:0}`:null,vt=o.useRef(null);o.useEffect(()=>{if(jt===null||!At||vt.current===Lt)return;const re=rt.current();re&&(vt.current=Lt,Xe(ve=>Dt(ve,re)?ve:re))},[jt]);const ot=o.useCallback(()=>{if(ae)try{window.localStorage.removeItem(ae)}catch{}ke(!1);const re=rt.current();Xe(re),qe.current=re,kt(ve=>ve+1)},[ae]);o.useEffect(()=>()=>{Ve.current&&(window.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),document.body.style.cursor="",document.body.style.userSelect="")},[Je,tt]);const ct=j.length>0&&j.every(re=>re.width!=null)?j.map(re=>typeof re.width=="number"?`${re.width}px`:String(re.width)).join(" "):null;j.some(re=>re.width!=null)&&!ct&&Bt(`table-field-width:${j.map(re=>re.width==null?"-":"w").join("")}`,"[ihabdevteam-core] Table \uC758 fields \uC911 \uC77C\uBD80\uC5D0\uB9CC width \uAC00 \uC788\uC2B5\uB2C8\uB2E4. **\uBAA8\uB4E0 \uC5F4\uC5D0 \uC801\uC5B4\uC57C** \uC4F0\uC785\uB2C8\uB2E4 \u2014 \uC9C0\uAE08\uC740 gridTemplateColumns \uB97C \uC501\uB2C8\uB2E4. \uD55C \uC5F4\uB9CC \uACE0\uC815\uD558\uACE0 \uC2F6\uC73C\uBA74 \uB098\uBA38\uC9C0\uC5D0 `minmax(0, 1fr)` \uCC98\uB7FC \uC801\uC5B4 \uC8FC\uC138\uC694."),ct&&g&&Bt("table-field-width-conflict","[ihabdevteam-core] Table \uC5D0 fields[].width \uC640 gridTemplateColumns \uAC00 \uB458 \uB2E4 \uC788\uC2B5\uB2C8\uB2E4. gridTemplateColumns \uAC00 \uC774\uAE41\uB2C8\uB2E4 \u2014 \uD55C\uCABD\uB9CC \uB450\uC138\uC694.");const dt=g??ct??void 0,_t=l4(dt),Ce=_t.filter(re=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(re));Ce.length>0&&Bt(`table-content-track:${g}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Ce.join(", ")})\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uBA38\uB9AC\uC640 \uBAB8\uD1B5\uC740 \uC11C\uB85C \uB2E4\uB978 \uACA9\uC790\uB77C \uADF8 \uD2B8\uB799\uC774 \uAC01\uC790 \uB2E4\uB974\uAC8C \uD480\uB824 \uC5F4\uC774 \uC5B4\uAE0B\uB0A9\uB2C8\uB2E4. px \uC774\uB098 fr \uC744 \uC4F0\uC138\uC694. (\uBC1B\uC740 \uAC12: ${g})`);const Pe=j.findIndex(re=>!!re.sortDir);j.filter(re=>!!re.sortDir).length>1&&Bt("table-multi-sort","[ihabdevteam-core] Table \uC758 fields \uC5D0 sortDir \uC774 \uB458 \uC774\uC0C1 \uC788\uC2B5\uB2C8\uB2E4. aria-sort \uB294 \uD45C \uD558\uB098\uC5D0 \uD55C \uCE78\uB9CC \uAC00\uC9C8 \uC218 \uC788\uC5B4 \uCCAB \uCE78\uB9CC \uBC29\uD5A5\uC73C\uB85C \uC54C\uB9AC\uACE0 \uB098\uBA38\uC9C0\uB294 none \uC73C\uB85C \uB461\uB2C8\uB2E4.");const ye=re=>re===Pe?j[re].sortDir==="asc"?"ascending":"descending":j[re].onClick?"none":void 0,Ye=re=>/^\d+(\.\d+)?px$/.test(_t[re]??""),bt=re=>{const ve=_t[re]??"",Ie=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(ve)??/^(\d+(?:\.\d+)?)px$/.exec(ve);return Ie?parseFloat(Ie[1]):de};Be.current=Ye,V.current=bt,ze.current=_t;const Nt=re=>f==="fit"&&!Ye(re)?"fr":"px",mt=et&&et.length===j.length&&!z,gt=O??(mt?j.map((re,ve)=>re.resizable===!1&&_t[ve]?_t[ve]:`${et[ve]}${Nt(ve)}`).join(" "):dt),Me=gt?{"--table-grid-cols":gt}:void 0,lt=w!==void 0;return n.jsxs("div",{ref:we,className:`table-wrap table-wrap--${b}${ue?" table-wrap--resizable":""}${k?" table-wrap--dragover":""}${x?" table-wrap--collapsed":""}`,style:Me,onDragOver:P,onDragLeave:$,onDrop:G,tabIndex:_e?0:void 0,role:_e?"region":void 0,"aria-label":_e?typeof w=="string"?w:M("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:I,className:"table-row-hint",children:M("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:Le,role:"table","aria-labelledby":lt&&typeof w=="string"?Z:void 0,className:"table body-2",children:[lt&&n.jsxs("div",{className:Ae("table-header",E&&"table-header--clickable"),onClick:E,role:"caption",children:[E&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:x?"chevron-right":"chevron-down",ariaLabel:x?M("common.expand","\uD3BC\uCE58\uAE30"):M("common.collapse","\uC811\uAE30"),ariaExpanded:!x,className:"table-header__chevron"}),v&&n.jsx(at,{icon:v,label:typeof w=="string"?w:void 0,className:"table-header__icon"}),n.jsx("span",{id:Z,className:"table-header__title h5b",children:w}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),B&&n.jsx("span",{className:"table-header__actions",onClick:re=>re.stopPropagation(),children:B})]}),!x&&n.jsxs(n.Fragment,{children:[r&&r.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:r.map((re,ve)=>n.jsx("div",{role:"columnheader","aria-colspan":re.span,className:Ae("table-field body-3",re.className),style:{gridColumn:`span ${re.span}`},children:re.label},ve))}),n.jsxs("div",{role:"presentation",className:Ae("table-fields-strip",ue&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:H,children:j.map((re,ve)=>n.jsx(C4,{onClick:re.onClick,className:Ae(re.className,Ju(re.align)),sortDir:re.sortDir,ariaSort:ye(ve),onResizeStart:ue&&ve<j.length-1&&re.resizable!==!1&&(f!=="fit"||j.some((Ie,We)=>We>ve&&Ie.resizable!==!1))?Ie=>xt(ve,Ie):void 0,children:re.label},ve))}),ue&&n.jsx("div",{className:"table-fields__reset-dock",children:n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:ot})})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:N?n.jsx(Xo,{variant:"loading",colSpan:j.length||void 0}):R.length===0&&D?n.jsx(Xo,{variant:"empty",colSpan:j.length||void 0,children:D}):R.map((re,ve)=>{const Ie=m!=null&&re.id===m,We=!!i&&(u?u(re):!0),Qe=F!=null&&re.id!=null&&(F instanceof Set?F.has(re.id)||[...F].some(st=>String(st)===String(re.id)):String(re.id)===String(F));return n.jsx(Xo,{className:`${We?" table-row--clickable":""}${h?" table-row--draggable":""}${Ie?" table-row--dragging":""}`.trim(),draggable:!!h,onClick:We?()=>i(re):void 0,colSpan:j.length||void 0,rowHasButton:l(re).some(st=>!!st.rowLabel),describedBy:I,onMouseEnter:c?st=>c(re,st):void 0,onMouseLeave:d?st=>d(re,st):void 0,onDragStart:h?st=>h(re,st):void 0,onDragEnd:p?st=>p(re,st):void 0,expandedContent:Qe&&T?T(re):void 0,children:l(re).map((st,Tt)=>n.jsx(h4,{className:Ae(st.className,Ju(j[Tt]?.align)),style:st.style,span:st.span,rowLabel:We?st.rowLabel:void 0,onRowClick:We?()=>i(re):void 0,children:st.content},Tt))},re.id!=null?`${typeof re.id}:${re.id}`:`__idx:${ve}`)})})]})]})]})}function Qu(e,t){return t!=="wornAt"?String(e[t]??""):Bv(e.wornYear,e.wornMonth,e.wornDay)}function f4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:s,onRelease:l,onAdd:i}){const{t:u,i18n:c}=xe.useTranslation(),d=f=>f==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:h,field:p}=Ly(),m=o.useMemo(()=>{if(!h)return e;const{key:f,asc:_}=h;return[...e].sort((b,w)=>{if(f==="worn"){const v=Number(w.worn)-Number(b.worn);return _?v:-v}return fr(Qu(b,f),Qu(w,f),_)})},[e,h]),{pageRows:g,pageSizeProps:y,paginationProps:C}=My(m,h);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(zo,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:y,pagination:C,actions:i&&n.jsx(be,{htmlType:"button",size:40,type:"bar",variant:"main",icon:"plus",label:u("customers.device.addButton","\uAE30\uAE30 \uCD94\uAC00"),onClick:i})}),n.jsx(Jo,{loading:t,resizable:!0,resizeMode:"fit",resizeStorageKey:"customer-device-history-v2",fields:[{...p(u("customers.device.wearingNow","\uCC29\uC6A9"),"worn"),resizable:!1},p(u("device.direction.label","\uBC29\uD5A5"),"side"),p(u("device.deviceType","\uC885\uB958"),"device"),p(u("device.brand","\uBE0C\uB79C\uB4DC"),"brand"),p(u("device.fitType","\uCC29\uC6A9\uD615\uD0DC"),"fitType"),p(u("device.productName","\uC81C\uD488\uBA85"),"productName"),p(u("device.wornDate","\uCC29\uC6A9\uC77C"),"wornAt"),...r?[{label:"",resizable:!1}]:[]],items:g.map((f,_)=>({id:f.id??`${f.side}-${_}`,row:f})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:f})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(Io,{checked:f.worn,disabled:f.worn?!l:!s,ariaLabel:f.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?s?.(f):l?.(f)}})})},{content:n.jsx("span",{children:d(f.side)})},{content:f.device?n.jsx(on,{size:"small",variant:ku(f.device),fill:"soft",label:Au(f.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:f.brand})},{content:n.jsx("span",{children:f.fitType||"-"})},{content:n.jsx("span",{children:f.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Po(f.wornYear,f.wornMonth,f.wornDay,c.language)||"-"})},...r?[{content:n.jsx("span",{className:"dlp-row-actions",children:n.jsx(be,{htmlType:"button",size:28,type:"bar",variant:"transparent-gray",label:u("common.delete","\uC0AD\uC81C"),onClick:_=>{_?.stopPropagation(),r(f)}})})}]:[]],onRowClick:({row:f})=>a(f),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function ec(e,t){return e?{role:t?.role??"button",tabIndex:0,...t?.selected===void 0?{}:{"aria-selected":t.selected},onKeyDown:a=>{a.target===a.currentTarget&&(a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),e(a)))}}:{}}function b4(e,t){return new Date(e,t+1,0).getDate()}function g4(e,t){return new Date(e,t,1).getDay()}function y4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:s}){const{t:l,i18n:i}=xe.useTranslation(),u=o.useMemo(()=>l("calendar.dow",{returnObjects:!0}),[l]),c=ur(s),[d,h]=o.useState(()=>Number(c.slice(0,4))),[p,m]=o.useState(()=>Number(c.slice(5,7))-1),[g,y]=o.useState(null),C=o.useRef(null),f=o.useMemo(()=>{const x={};return e.forEach(E=>{x[E.date]||(x[E.date]=[]),x[E.date].push(E)}),x},[e]),_=o.useMemo(()=>{const x=b4(d,p),E=g4(d,p),B=[];for(let D=0;D<E;D++)B.push(null);for(let D=1;D<=x;D++)B.push(D);for(;B.length<35;)B.push(null);return B},[d,p]),b=o.useCallback(()=>{p===0?(h(x=>x-1),m(11)):m(x=>x-1)},[p]),w=o.useCallback(()=>{p===11?(h(x=>x+1),m(0)):m(x=>x+1)},[p]),v=x=>`${d}-${String(p+1).padStart(2,"0")}-${String(x).padStart(2,"0")}`,A=x=>v(x)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:b,"aria-label":l("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(at,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:io(l,i.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:w,"aria-label":l("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(at,{icon:"chevron-right",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsxs("div",{className:"calendar-nav__legend",children:[n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--main"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.visited","\uBC29\uBB38")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--sub"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.scheduled","\uC608\uC57D")}),n.jsx("span",{className:"calendar-nav__legend-dot calendar-nav__legend-dot--disabled"}),n.jsx("span",{className:"caption-1",children:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(x=>n.jsx("div",{className:"calendar-day-header body-3",children:x},x)),_.map((x,E)=>{if(x===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${E}`);const B=x,D=v(B),N=f[D]??[],k=Vl(D,i.language),P=g===D;return n.jsxs("div",{className:`calendar-cell${A(B)?" today":""}${P?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?l("calendar.addOnDate",{date:D}):void 0,"aria-current":A(B)?"date":void 0,onClick:r?()=>r(D):void 0,onKeyDown:r?$=>{$.target===$.currentTarget&&($.key!=="Enter"&&$.key!==" "||($.preventDefault(),r(D)))}:void 0,onDragOver:a?$=>{$.preventDefault(),y(D)}:void 0,onDragLeave:a?$=>{$.currentTarget.contains($.relatedTarget)||y(null)}:void 0,onDrop:a?$=>{$.preventDefault(),C.current!=null&&(a(C.current,D),C.current=null),y(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:B}),N.length>0&&(()=>{const $=[{key:"visited",label:l("calendar.legend.visited","\uBC29\uBB38"),count:N.filter(T=>(T.status??"visited")==="visited").length},{key:"scheduled",label:l("calendar.legend.scheduled","\uC608\uC57D"),count:N.filter(T=>T.status==="scheduled").length},{key:"noVisit",label:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:N.filter(T=>T.status==="noVisit").length}].filter(T=>T.count>0),G=$.length===1&&$[0].key==="visited"?l("calendar.visitCount",{count:N.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):$.map(T=>l("calendar.statusCount",{label:T.label,count:T.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${k} ${G}`,children:[$.map(T=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${T.key}`,"aria-hidden":"true"},T.key)),N.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:N.map(($,G)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${$.status==="noVisit"?" calendar-visit-badge--no-visit":$.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?T=>{C.current=$.id,T.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,y(null)}:void 0,onClick:t?T=>{T.stopPropagation(),t($)}:void 0,...ec(t?()=>t($):void 0),"aria-label":[k,$.time?Yl($.time,l):null,$.customer,l($.status==="noVisit"?"calendar.legend.noVisit":$.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[$.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Yl($.time,l)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:$.customer}),$.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},$.id??G))})]},B)})]})]})}const v4={page:"h3",pagePopup:"h4",popup:"h5"};function va({type:e="page",title:t,headingLevel:a=2,icon:r,action:s,disc:l,children:i,inGrid:u=!1,className:c,style:d}){const h=v4[e],p=t||l||s||r,m=a?`h${a}`:"div";return n.jsxs("div",{className:Ae("section",`section--${e}`,u&&"section--in-grid",c),style:d,children:[p&&n.jsxs("div",{className:"section__header",children:[n.jsxs("div",{className:"section__title-row",children:[r&&n.jsx(at,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(m,{className:`section__title ${h}`,children:t}),l&&n.jsx("div",{className:"section__disc body-3",children:l})]})]}),s&&n.jsx("div",{className:"section__action",children:s})]}),i]})}let Qo=null,tc=!1;function nc(){if(tc||typeof document>"u")return;tc=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(Qo="keyboard")},!0);const e=()=>{Qo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}nc();function _r(){return nc(),Qo==="keyboard"}const xr=20;function _4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:s,renderPopup:l,completedIds:i,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:h,onRemove:p,onMore:m,sectionType:g="page"}=e||{},[,y]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],f=C.length,[_,b]=o.useState(Math.min(f,xr)),w=o.useMemo(()=>Array.isArray(s)?[...s,a?.label].filter(Boolean).join(" \xB7 "):[s||"",a?.label].filter(Boolean).join(" \xB7 "),[s,a?.label]);o.useEffect(()=>{b(Math.min(f,xr))},[f]),Oi("speechear.data.updated",()=>y(E=>E+1));const v=o.useRef(null),A=o.useRef(null);function x(){const E=document.activeElement;A.current=_r()&&E&&E.closest?.(".training-block__more")?_:null,b(B=>Math.min(f,B+xr))}return o.useEffect(()=>{const E=A.current;if(E==null)return;A.current=null;const B=document.activeElement;B&&B!==document.body||v.current?.querySelectorAll(".training-block-button")[E]?.focus()},[_]),n.jsxs(va,{type:g,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:v,children:(C||[]).slice(0,_).map((E,B)=>{const D=E;return n.jsx($o,{index:B,type:a,trainingData:D,depth:w,renderPopup:l,completedIds:i,selectedIds:u,size:d,useDescriptionTooltip:h,onRemove:typeof p=="function"&&u!=null&&D?.id!=null&&u.has(String(D.id))?()=>p(D):void 0,onComplete:typeof c=="function"&&D?.id!=null?()=>c(String(D.id)):void 0,onMore:typeof m=="function"?N=>m(D,N):void 0},D?.id!=null?`${a?.key||"t"}-${String(D.id)}`:`${a?.key||"t"}-${B}`)})}),f>xr&&_<f&&n.jsx("div",{className:"training-block__more",children:n.jsx(be,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:x,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function x4(e){let t=0;const a=r=>{Array.isArray(r)?r.forEach(a):r!=null&&r!==!1&&r!==!0&&r!==""&&t++};return a(e),t}function w4({gap:e=10,count:t,className:a,children:r}){const s=o.useRef(null),[l,i]=o.useState({width:0,card:0}),u=t??x4(r);o.useLayoutEffect(()=>{const m=s.current;if(!m)return;const g=()=>{const C=m.style.maxWidth;m.style.maxWidth="none";const f=m.clientWidth;m.style.maxWidth=C;const _=m.firstElementChild?.offsetWidth??0;i(b=>b.width===f&&b.card===_?b:{width:f,card:_})};if(g(),typeof ResizeObserver>"u")return;const y=new ResizeObserver(g);return y.observe(m),()=>y.disconnect()},[u,e]);const c=l.card>0?l.card:0,d=c>0?vf(l.width,c,e):0,h=d>0?_f(u,d):0,p={"--block-grid-gap":`${e}px`,...h>0?{"--block-grid-cols":h,"--block-grid-card":`${c}px`}:{}};return n.jsx("div",{ref:s,className:Ae("training-block-grid",h>0&&"training-block-grid--measured",a),style:p,"data-cols":h>0?h:void 0,children:r})}function es(e){const t=o.useRef(null),a=o.useRef(e);a.current=e;const[r,s]=o.useState({url:e,loading:!!e,failed:!1}),l=r.url===e?r:{loading:!!e,failed:!1};o.useEffect(()=>{const c=t.current;s({url:e,failed:!1,loading:!!e&&!(c?.complete&&c.naturalWidth>0)})},[e]);const i=o.useCallback(()=>{a.current===e&&s({url:e,loading:!1,failed:!1})},[e]),u=o.useCallback(()=>{a.current===e&&s({url:e,loading:!1,failed:!0})},[e]);return{imgRef:t,loading:l.loading,failed:l.failed,hasImage:!!e&&!l.failed,onLoad:i,onError:u}}var B4='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><g opacity=".3"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';const k4=B4,ts=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:s=!1,onSelect:l,flipDelay:i=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},h){const{t:p}=xe.useTranslation(),m=e.word||e.title||"",g=t||!m,y=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",f=e.colloquialLabel||"",[_,b]=o.useState({label:m,subLabel:C,colloquialLabel:f,homonum:e.homonum});m&&(_.label!==m||_.subLabel!==C||_.colloquialLabel!==f||!Object.is(_.homonum,e.homonum))&&b({label:m,subLabel:C,colloquialLabel:f,homonum:e.homonum});const w=o.useRef(null),v=yn("(max-width: 767px)"),[A,x]=o.useState(!1),[E,B]=o.useState(!1),D=`${typeof y=="string"?y:y?.src??""}\0${m}`,[N,k]=o.useState({for:"",url:""}),P=N.for===D?N.url:"",$=zl(),G=e.textOnly??(!e.image&&!!_.label&&!!$&&$.entries.length>0&&!$.byWord.has(_.label)),T=G?"":ua()?.(_.label,_.homonum)??e.image??"",{imgRef:F,loading:M,hasImage:Q,onLoad:Z,onError:I}=es(T);o.useEffect(()=>{let O=!1;return(async()=>{if(y){if(typeof y=="string"){if(y.startsWith("http")||y.includes("/")){k({for:D,url:y});return}}else if(typeof y=="object"&&!Array.isArray(y)){const te=y.src;if(te){k({for:D,url:te});return}}}const ue=Sa();if(ue&&m)try{const te=await Promise.resolve(ue(m));!O&&te&&k({for:D,url:te})}catch{}})(),()=>{O=!0}},[y,m,D]);const K=o.useRef(!0),L=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,L.current&&yr(L.current),L.current=null;try{w.current?.pause()}catch{}w.current=null}),[]);const W=o.useCallback(()=>new Promise(O=>{if(typeof window<"u"&&window.speechSynthesis&&m){x(!0),window.speechSynthesis.cancel();const ue=new SpeechSynthesisUtterance(m);ue.lang="ko-KR",ue.onend=()=>{x(!1);try{a?.()}catch{}O()},ue.onerror=()=>{x(!1),O()},window.speechSynthesis.speak(ue)}else O()}),[m,a]),Y=o.useCallback(O=>{const ue=Ka(O,te=>{if(x(!1),te)try{a?.()}catch{}});return w.current=ue.el,ue.done},[a]),U=o.useCallback(async()=>{if(t||!K.current)return;const O=()=>{L.current===O&&(L.current=null);try{w.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1)},ue=Ga(O);L.current=O;try{window.speechSynthesis?.cancel()}catch{}try{if(P&&(x(!0),await Y(P)))return;const te=or();if(te&&m)try{B(!0);const de=await Promise.resolve(te(m));if(!K.current||L.current!==O||(B(!1),de&&(x(!0),await Y(de))))return}catch{}if(!K.current||L.current!==O)return;await W()}finally{L.current===O&&B(!1),ue(),L.current===O&&(L.current=null)}},[t,P,m,Y,W]);o.useImperativeHandle(h,()=>({play:()=>U()}),[U]);const j=O=>O.stopPropagation(),R=o.useCallback(O=>{if(O.stopPropagation(),!t){if(A){try{w.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1);return}U()}},[t,A,U]),z=Ae("training-word-card",t?"training-word-card--disabled":"",g?"training-word-card--flipped":"",r?"training-word-card--selectable":"",s?"training-word-card--selected":"");return n.jsx("div",{className:z,onClick:r&&!t?l:void 0,role:r?"button":void 0,"aria-pressed":r?s:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" "||O.key==="Spacebar")&&(O.preventDefault(),l?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:g?"0ms":`${i}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[s&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:j,children:n.jsx(En,{size:40,position:"inline",animate:!0,icon:d!=null?void 0:"check",number:d??void 0,"aria-label":d!=null?p("training.nthSelected",{n:d}):p("training.selected","\uC120\uD0DD\uB428")})}),n.jsx("div",{className:"training-word-card__image-wrap",children:G?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):Q?n.jsxs(n.Fragment,{children:[M&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:F,className:"training-word-card__image",src:T,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:M?0:1},onLoad:Z,onError:I})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!G&&n.jsx("div",{className:"training-word-card__word",children:_.label}),_.subLabel&&n.jsxs("div",{className:"training-word-card__pronunciation",children:["[",_.subLabel,"]"]}),_.colloquialLabel&&n.jsxs("div",{className:"training-word-card__colloquial caption-1",children:["[",_.colloquialLabel,"]"]})]}),!c&&n.jsx("div",{className:"training-word-card__bottom",onClick:r?j:void 0,children:n.jsx(be,{htmlType:"button",size:v?40:48,type:v?"dot":"bar",icon:A?"pause":"play",label:v?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:A,loading:E,onClick:R,disabled:t,ariaLabel:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30")})})]}),n.jsx("div",{className:"training-word-card__back","aria-hidden":"true",children:n.jsx("span",{className:"training-word-card__disabled-symbol",style:{"--disabled-symbol-src":`url("${k4}")`}})})]})})});function wr(e){return String(e)}const Br=["o","triangle","x"];function ac(e,t){return e===t?null:t}const rc={o:"circle",triangle:"triangle",x:"x"},oc={o:"main",triangle:"warn",x:"danger"};function A4(e){let t=0,a=0,r=0;for(const l of Object.values(e))l==="o"?t++:l==="triangle"?a++:l==="x"&&r++;const s=t+a+r;return{marked:s,o:t,triangle:a,x:r,rate:s===0?null:(t+a*.5)/s}}function ns(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function sc(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function N4(e,t){return!t&&e>0}const ea={landscape:{width:1123,height:794,printSize:"A4 landscape",printW:"297mm",printH:"210mm"},portrait:{width:794,height:1123,printSize:"A4 portrait",printW:"210mm",printH:"297mm"}};function E4(e="landscape"){Bt("print-word-table-deprecated","[printWordTable] @deprecated \u2014 WordTablePopup renderButtons \uC758 print(\uB610\uB294 useWordTablePrint().print)\uB97C \uC4F0\uC138\uC694. \uC804\uC5ED \uC778\uC1C4\uB294 \uD654\uBA74\uC758 \uBAA8\uB4E0 \uB2E8\uC5B4\uD45C\uB97C \uD568\uAED8 \uCC0D\uC2B5\uB2C8\uB2E4.");const{printSize:t,printW:a,printH:r}=ea[e],s=document.createElement("style");s.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(s);const l=()=>{document.head.removeChild(s),window.removeEventListener("afterprint",l)};window.addEventListener("afterprint",l),window.print()}function D4(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let s=0;s<e.length;s+=a)r.push(e.slice(s,s+a));return r}const S4={landscape:{1:{cols:1,rows:1},2:{cols:2,rows:1},3:{cols:3,rows:1},4:{cols:2,rows:2},5:{cols:3,rows:2},6:{cols:3,rows:2},7:{cols:4,rows:2},8:{cols:4,rows:2},9:{cols:5,rows:2},10:{cols:5,rows:2},11:{cols:4,rows:3},12:{cols:4,rows:3},13:{cols:5,rows:3},14:{cols:5,rows:3},15:{cols:5,rows:3},16:{cols:6,rows:3}},portrait:{1:{cols:1,rows:1},2:{cols:1,rows:2},3:{cols:1,rows:3},4:{cols:1,rows:4},5:{cols:1,rows:5},6:{cols:2,rows:3},7:{cols:2,rows:4},8:{cols:2,rows:4},9:{cols:2,rows:5},10:{cols:2,rows:5},11:{cols:3,rows:4},12:{cols:3,rows:4},13:{cols:4,rows:4},14:{cols:4,rows:4},15:{cols:4,rows:4},16:{cols:4,rows:4}}};function lc(e,t){const a=S4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),s=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let l,i;return e==="landscape"?(i=s,l=Math.ceil(r/i)):(l=s,i=Math.ceil(r/l)),(e==="landscape"?l<i:i<l)&&([l,i]=[i,l]),{cols:l,rows:i}}function j4(e,t){const a=lc(e==="landscape"?"portrait":"landscape",t),r=Math.max(1,Math.ceil(t));if(r<=1)return a;const s=ea[e],l=e==="landscape"?s.width/2:s.width,i=e==="landscape"?s.height:s.height/2,u=(m,g)=>Math.min(l/m/pc,i/g/hc),c=Math.max(0,a.cols*a.rows-r),d=u(a.cols,a.rows);let h=a,p=d;for(let m=1;m<=r;m++){const g=Math.ceil(r/m);if(m*g-r>c)continue;const y=u(m,g);y>p&&(h={cols:m,rows:g},p=y)}return p>d*1.05?h:a}const T4={show:"word-table__content--cut-show",dashed:"",corner:"word-table__content--cut-corner",hide:""},ic={\uBA85:"\uBA85\uC0AC",\uB3D9:"\uB3D9\uC0AC",\uD615:"\uD615\uC6A9\uC0AC",\uBD80:"\uBD80\uC0AC",\uC218:"\uC218\uC0AC",\uAD00:"\uAD00\uD615\uC0AC",\uAC10:"\uAC10\uD0C4\uC0AC",\uC870:"\uC870\uC0AC",\uC811:"\uC811\uC0AC",\uC758:"\uC758\uC874\uBA85\uC0AC",\uB300:"\uB300\uBA85\uC0AC",\uBCF4\uB3D9:"\uBCF4\uC870\uB3D9\uC0AC",\uBCF4\uD615:"\uBCF4\uC870\uD615\uC6A9\uC0AC"},uc={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},as={\uBA85:"noun",\uB3D9:"verb",\uD615:"adjective",\uBD80:"adverb",\uC218:"numeral",\uAD00:"determiner",\uAC10:"interjection",\uC870:"particle",\uC811:"affix",\uC758:"dependentNoun",\uB300:"pronoun",\uBCF4\uB3D9:"auxVerb",\uBCF4\uD615:"auxAdjective"},rs={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function cc(e){return Object.fromEntries(Object.entries(ic).map(([t,a])=>[t,as[t]?e(`wordTable.pos.${as[t]}`,{defaultValue:a}):a]))}function dc(e){return Object.fromEntries(Object.entries(uc).map(([t,a])=>[t,rs[t]?e(`wordSearch.filter.type.${rs[t]}`,{defaultValue:a}):a]))}const M4={pos:as,wordType:rs};function os(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function ss(e,t,a,r){if(r!=="dashed")return{};const s=e%t,l=Math.floor(e/t),i=s<t-1,u=l<a-1;if(!i&&!u)return{};const c="#ddd",d=g=>`repeating-linear-gradient(to ${g}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,h=[],p=[],m=[];return i&&(h.push(d("bottom")),p.push("1px 100%"),m.push("right center")),u&&(h.push(d("right")),p.push("100% 1px"),m.push("center bottom")),{backgroundImage:h.join(", "),backgroundSize:p.join(", "),backgroundPosition:m.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const pc=280,L4=240,$4=280,hc=400,R4=120,P4=280;function mc(e,t){const a=o.useRef(null),[r,s]=o.useState(1),[l,i]=o.useState(0),u=o.useCallback((c,d)=>{if(!(c>0))return;const h=c/e,p=t&&d>0?d/t:1/0,m=Math.min(1,h,p);s(m),i(Math.max(0,(c-e*m)/2))},[e,t]);return o.useEffect(()=>{const c=a.current;if(!c)return;const d=t?c.parentElement??c:c;if(u(d.clientWidth,d.clientHeight),typeof ResizeObserver>"u")return;const h=new ResizeObserver(([p])=>u(p.contentRect.width,p.contentRect.height));return h.observe(d),()=>h.disconnect()},[u,t]),{scalerRef:a,scale:r,offset:l}}const F4=24,I4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},O4=400,Cc=8;function z4(e){return e<=1?"100%":`repeat(${e}, calc((100% - ${e-1} * var(--wt-cell-gap, 0px)) / ${e}))`}function ls({label:e,subLabel:t,colloquialLabel:a,captionLabel:r,captionBadge:s,homonum:l,showWord:i=!0,showImage:u=!0,showPronunciation:c=!0,showColloquial:d=!0,showCaption:h=!0,buttonSize:p=40,wordInfo:m,outerScale:g=1}){const{t:y}=xe.useTranslation(),C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),[b,w]=o.useState(1),[v,A]=o.useState(!1),[x,E]=o.useState(!1),[B,D]=o.useState({for:"",url:""}),[N,k]=o.useState(null),P=t&&t.length>0?t:q1()?.(e,l)??"",$=ua()?.(e,l)??"",{imgRef:G,loading:T,failed:F,onLoad:M,onError:Q}=es($),Z=o.useCallback(()=>k(f.current?.getBoundingClientRect()??null),[]),I=o.useCallback(()=>k(null),[]),K=_o(!!N,ee=>{ee?Z():I()},f),L=o.useMemo(()=>{if(!m)return null;const ee=[];return m.grade&&ee.push(y("wordTable.info.grade",{n:m.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),m.syllables&&ee.push(y("wordTable.info.syllables",{n:m.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),m.pos&&ee.push(y("wordTable.info.pos",{v:os(m.pos,cc(y)),defaultValue:"\uD488\uC0AC: {{v}}"})),m.wordType&&ee.push(y("wordTable.info.wordType",{v:os(m.wordType,dc(y)),defaultValue:"\uC720\uD615: {{v}}"})),ee.length?ee:null},[m,y]),W=P||e,Y=B.for===W?B.url:"";o.useEffect(()=>{const ee=Sa(),V=P||e;if(!ee||!V)return;let ae=!1;return Promise.resolve(ee(V)).then(H=>{!ae&&H&&D({for:V,url:H})}),()=>{ae=!0}},[P,e]);const U=o.useRef(null),j=o.useRef(null);o.useEffect(()=>()=>{_.current?.pause(),j.current?.()},[]);const R=o.useRef(null);o.useEffect(()=>()=>{R.current&&(R.current.cancelled=!0)},[]);const z=o.useCallback(ee=>{if(ee.stopPropagation(),v||x){U.current?.();return}if(!Y){const ae=or(),H=P||e;if(!ae||!H)return;const q={cancelled:!1,stop:null};R.current=q;const ie=()=>{q.cancelled=!0,q.stop?.(),E(!1),A(!1),j.current?.()};U.current=ie,j.current=Ga(ie),E(!0),Promise.resolve().then(()=>ae(H)).then(Ne=>{if(q.cancelled)return;if(!Ne){ie();return}D({for:H,url:Ne});const _e=Ka(Ne,()=>{A(!1),j.current?.()});_.current=_e.el,q.stop=_e.stop,E(!1),A(!0)}).catch(()=>{ie()});return}A(!0);const V=Ka(Y,()=>{A(!1),j.current?.()});_.current=V.el,U.current=V.stop,j.current=Ga(V.stop)},[v,x,Y,P,e]),O=u&&!!$&&!F,ue=O&&i?pc:O?$4:L4,te=O&&i?hc:O?P4:R4;o.useEffect(()=>{const ee=C.current;if(!ee||typeof ResizeObserver>"u")return;const V=new ResizeObserver(([ae])=>{const{width:H,height:q}=ae.contentRect;w(Math.min(H/ue,q/te))});return V.observe(ee),()=>V.disconnect()},[ue,te]);const de=p*g<F4;return n.jsxs("div",{ref:C,className:Ae("word-table-cell",de&&"word-table-cell--tap-too-small",O?"word-table-cell--with-image":""),"data-ref-w":ue,"data-ref-h":te,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${b})`},children:[O&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[T&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:G,className:"word-table-cell__image",src:$,alt:e,draggable:!1,style:{opacity:T?0:1},onLoad:M,onError:Q})]}),h&&(s||r)&&n.jsxs("span",{className:"word-table-cell__caption",children:[s&&n.jsx(on,{fill:"soft",size:"small",label:s}),r&&n.jsx("span",{className:"word-table-cell__caption-tail h5",children:r})]}),i&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),c&&P&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",P,"]"]}),d&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__side",children:[n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":Y,children:[n.jsx("span",{"data-play-state":"play",style:{display:v?"none":void 0},children:n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,loading:x,showTooltipInfo:x?y("common.loading","\uBD88\uB7EC\uC624\uB294 \uC911"):y("common.play","\uC7AC\uC0DD"),ariaLabel:e?y("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):y("common.play","\uC7AC\uC0DD"),onClick:z})}),n.jsx("span",{"data-play-state":"pause",style:{display:v?void 0:"none"},children:n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:y("common.pause","\uBA48\uCDA4"),ariaLabel:e?y("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):y("common.pause","\uBA48\uCDA4"),onClick:z})})]}),m&&n.jsxs("div",{ref:f,className:"word-table-cell__info-button",onPointerEnter:ee=>{ma(ee)||Z()},onPointerLeave:ee=>{ma(ee)||I()},onFocus:()=>{Ca()||Z()},onBlur:I,children:[n.jsx(be,{htmlType:"button",size:p,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:y("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:ee=>{ee.stopPropagation(),K.touchPress()}}),N&&L&&n.jsx(Xn,{anchorRect:N,items:L,showIndex:!1})]})]})]})}function _a({title:e,titleIcon:t,disc:a,className:r,orientation:s="landscape",contentTypes:l=["image","word","standardPron"],baseItem:i,baseContentTypes:u,cutLine:c="show",showOutline:d=!0,showDivLine:h=!0,items:p,editCells:m,count:g,activeCell:y=null,onActivateCell:C,onRemoveCell:f,onRemoveItem:_,onReorder:b,onCopyItem:w,indexOffset:v=0,totalCount:A,renderCellAction:x,showFillerAdd:E=!1,addableCount:B,contentRef:D,buttonSize:N=40,brand:k,code:P,pageNumber:$,pageNumberPosition:G="right",fitHeight:T=!1,scoring:F=!1,marks:M,onMarkClick:Q,scoreIndexOffset:Z=0}){const I=o.useCallback((Ce,Pe)=>{Q?.(Z+Ce,Pe)},[Q,Z]),K=(Ce,Pe)=>{const ye=Ce.filter(Boolean).join(" / ");return ye?Pe?W("wordPrint.removePairFor",{name:ye,defaultValue:`${ye} \uB300\uB9BD\uC30D \uBE7C\uAE30`}):W("wordPrint.removeWordFor",{name:ye,defaultValue:`${ye} \uBE7C\uAE30`}):Pe?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30")},L=(Ce,Pe)=>{const ye=M?.[wr(Z+Ce)]??null;return n.jsx("div",{className:Ae("word-table-cell__score",ye?"word-table-cell__score--marked":""),style:ct>1?{transform:`translateX(-50%) scale(${ct})`,transformOrigin:"bottom center"}:void 0,children:Br.map(Ye=>n.jsx("span",{className:Ae("word-table-cell__score-slot",ye===Ye?"word-table-cell__score-slot--on":""),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",shape:"pill",icon:rc[Ye],variant:ye===Ye?oc[Ye]:"default",selected:ye===Ye,useBorder:!1,...ot?{}:{tabIndex:-1,role:"img"},showTooltipInfo:W(`wordTable.scoring.markName.${Ye}`,{defaultValue:Ye}),ariaLabel:W(`wordTable.scoring.${Ye}`,{word:Pe,defaultValue:`${Pe} ${Ye}`}),onClick:ot?bt=>{bt.stopPropagation(),I(Ce,Ye)}:void 0})},Ye))})},{t:W}=xe.useTranslation(),Y=m!==void 0,U=e!=null||!!t||!!a,j=yn("(max-width: 767px)"),R=o.useRef(null),[z,O]=o.useState(null),ue=p?.length??0,te=A??ue,[de,ee]=o.useState(null),[V,ae]=o.useState(""),H=o.useRef(null),q=o.useRef(null),ie=o.useRef(null),Ne=o.useRef(null),_e=o.useCallback(Ce=>{q.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce)},[D]),he=o.useCallback((Ce,Pe)=>{H.current=v+Pe,b?.(Ce,Pe),ae(W("wordTable.reorder.moved",{n:v+Pe+1,total:te,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[b,W,te,v]);o.useEffect(()=>{const Ce=H.current;Ce!=null&&(H.current=null,(q.current?.closest(".word-table-block__pages")??q.current)?.querySelector(`[data-wordtable-index="${Ce}"] .word-table__card-handle button`)?.focus())}),o.useEffect(()=>()=>{Ne.current?.()},[]);const je=o.useCallback((Ce,Pe)=>{if(!b||!Ce.altKey||Ce.ctrlKey||Ce.metaKey)return;const ye=Ce.key==="ArrowRight";if(!ye&&Ce.key!=="ArrowLeft")return;Ce.preventDefault();const Ye=Pe+(ye?1:-1),bt=v+Ye;bt<0||bt>=te||he(Pe,Ye)},[b,te,v,he]),$e=o.useCallback((Ce,Pe)=>{if(!b||Ce.pointerType==="mouse")return;const ye=Ce.target.closest?.("button");if(ye&&!ye.closest(".word-table__card-handle"))return;Ne.current?.();const Ye={x:Ce.clientX,y:Ce.clientY};let bt=!1;const Nt=We=>{bt&&We.cancelable&&We.preventDefault()};let mt=null,gt=null;const Me=()=>{const We=gt;if(!We)return;const Qe=document.elementFromPoint?.(We.x,We.y)?.closest?.("[data-wordtable-cell]"),st=Qe?Number(Qe.dataset.wordtableCell):NaN,Tt=Number.isInteger(st)?st:null;ie.current=Tt,O(ln=>ln===Tt?ln:Tt)},lt=We=>{if(!bt){(Math.abs(We.clientX-Ye.x)>Cc||Math.abs(We.clientY-Ye.y)>Cc)&&Ie();return}if(gt={x:We.clientX,y:We.clientY},typeof requestAnimationFrame>"u"){Me();return}mt===null&&(mt=requestAnimationFrame(()=>{mt=null,Me()}))},re=()=>{mt!==null&&(cancelAnimationFrame(mt),mt=null,Me());const We=ie.current,Qe=bt;Ie(),Qe&&We!=null&&We!==Pe&&he(Pe,We)},ve=setTimeout(()=>{bt=!0,ee(Pe),ie.current=Pe,O(Pe),window.addEventListener("touchmove",Nt,{passive:!1})},O4);function Ie(){clearTimeout(ve),window.removeEventListener("pointermove",lt),window.removeEventListener("pointerup",re),window.removeEventListener("pointercancel",re),window.removeEventListener("touchmove",Nt),bt=!1,mt!==null&&(cancelAnimationFrame(mt),mt=null),ie.current=null,Ne.current=null,ee(null),O(null)}Ne.current=Ie,window.addEventListener("pointermove",lt),window.addEventListener("pointerup",re),window.addEventListener("pointercancel",re)},[b,he]),{width:De,height:le}=ea[s],we=typeof T=="number"?T:T&&typeof T=="object"?j?T.narrow:T.wide:null,{scalerRef:Le,scale:Be,offset:ze}=mc(De,T?le:void 0),Ve=Y?m?.length??0:p?.length??0,ut=Math.max(g??Ve,1),et=!Y&&!!i,Xe=j4(s,ut),yt=lc(s,ut),Te=et?Xe.cols:yt.cols,Ke=et?Xe.rows:yt.rows,ke=et&&s==="landscape"?Xe.cols*2:Te,qe=et&&s==="portrait"?Xe.rows*2:Ke,Je=Ce=>({word:Ce.length===0||Ce.includes("word"),image:Ce.length===0||Ce.includes("image"),pron:Ce.length===0||Ce.includes("standardPron"),colloq:Ce.length===0||Ce.includes("colloquialPron"),caption:Ce.length===0||Ce.includes("caption")}),tt=Je(l),xt=o.useMemo(()=>{const Ce=(p??[]).map(ye=>ye.id),Pe=Ce.every(ye=>typeof ye=="string"&&ye.length>0)&&new Set(Ce).size===Ce.length;return!Pe&&Ce.length>0&&Bt("wordTable.cellKeyFallback","[ihab/core] WordTable: items \uC758 id \uAC00 \uACB9\uCE58\uAC70\uB098 \uBE44\uC5B4 \uC788\uC5B4 \uCE78\uC744 \uC790\uB9AC \uBC88\uD638\uB85C \uC13C\uB2E4. \uCE78\uC744 \uBE7C\uAC70\uB098 \uB354\uD560 \uB54C \uB4A4 \uCE78\uB4E4\uC774 \uD1B5\uC9F8\uB85C \uB2E4\uC2DC \uADF8\uB824\uC9C4\uB2E4(\uC18C\uB9AC \uC8FC\uC18C\uB97C \uB2E4\uC2DC \uBC1B\uC544 \uC628\uB2E4). id \uB97C \uD45C \uC548\uC5D0\uC11C \uD558\uB098\uBFD0\uC778 \uAC12\uC73C\uB85C \uC9C0\uC5B4 \uC8FC\uBA74 \uADF8 \uAC12\uC774 \uC0AC\uB77C\uC9C4\uB2E4."),Pe?Ce:null},[p]),wt=Je(u??l),Dt=Y?(m??[]).some(Ce=>Ce!==null&&Ce.length>1):(p??[]).some(Ce=>(Ce.words??[]).length>1),rt=!!k?.show,nt=!!k?.show&&k?.top!==!1,kt=!!k?.show&&k?.bottom!==!1,At=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",Lt=se(Ae("word-table__content",T4[c],d&&"word-table__content--outline",h&&Dt&&"word-table__content--div-line",!rt&&$&&G!=="none"&&"word-table__content--page-number",nt&&"word-table__content--brand-top",kt&&"word-table__content--brand-bottom")),jt={transform:`scale(${1/Be})`,transformOrigin:"center center"},vt=N*Br.length+4*(Br.length-1),ot=!!Q,ct=ot?Math.max(1,Math.min(1/Be,De/ke/vt)):1,dt=n.jsxs("div",{ref:Le,className:"word-table__scaler",style:{height:le*Be},children:[n.jsx("div",{className:Ae("word-table",F&&!ot&&"word-table--score-readonly",!U&&r),style:{width:De,height:le,transform:`scale(${Be})`,transformOrigin:"top left",marginLeft:ze},children:n.jsxs("div",{ref:_e,className:Lt,style:{gridTemplateColumns:`repeat(${ke}, 1fr)`,gridTemplateRows:z4(qe)},children:[Y?n.jsx(n.Fragment,{children:(m??[]).map((Ce,Pe)=>n.jsx("div",{className:se(Ae("word-table__edit-cell",Ce?"word-table__edit-cell--filled":"word-table__edit-cell--empty",y===Pe?"word-table__edit-cell--active":"")),style:ss(Pe,ke,qe,c),children:Ce?n.jsxs(n.Fragment,{children:[Ce.map((ye,Ye)=>n.jsxs(o.Fragment,{children:[Ye>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:ye.word,subLabel:ye.pronunciation,colloquialLabel:ye.colloquialPronunciation,homonum:ye.homonum,showWord:tt.word,showImage:tt.image,showPronunciation:tt.pron,showColloquial:tt.colloq,showCaption:tt.caption,buttonSize:N})]},Ye)),F&&L(Pe,Ce.map(ye=>ye.word).join(" / ")),f&&n.jsx("div",{className:se("word-table__card-close"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:Ce.length>1?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:K(Ce.map(ye=>ye.word),Ce.length>1),onClick:()=>f(Pe)})})]}):C&&n.jsx("div",{className:se("word-table__card-add"),style:jt,children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C(Pe)})})},Pe))}):n.jsxs(n.Fragment,{children:[et&&i&&n.jsx("div",{className:se("word-table__card word-table__card--base"),style:{gridColumn:`1 / span ${Xe.cols}`,gridRow:`1 / span ${Xe.rows}`,...ss(0,s==="landscape"?2:1,s==="landscape"?1:2,c)},children:(i.words??[]).map((Ce,Pe)=>n.jsxs(o.Fragment,{children:[Pe>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:Ce.label,subLabel:Ce.subLabel,colloquialLabel:Ce.colloquialLabel,captionLabel:Ce.captionLabel,captionBadge:Ce.captionBadge,homonum:Ce.homonum,showWord:wt.word,showImage:wt.image,showPronunciation:wt.pron,showColloquial:wt.colloq,showCaption:wt.caption,buttonSize:N,wordInfo:Ce.grade||Ce.syllables!=null||Ce.pos||Ce.wordType?{grade:Ce.grade,syllables:Ce.syllables,pos:Ce.pos,wordType:Ce.wordType}:void 0})]},Pe))}),(p??[]).map((Ce,Pe)=>n.jsxs("div",{"data-wordtable-cell":b?Pe:void 0,"data-wordtable-index":b?v+Pe:void 0,className:se(`word-table__card${b?" word-table__card--draggable":""}${z===Pe?" word-table__card--drag-over":""}${de===Pe?" word-table__card--dragging":""}`),style:ss(Pe,Te,Ke,c),draggable:!!b,onPointerDown:b?ye=>$e(ye,Pe):void 0,onKeyDown:b?ye=>je(ye,Pe):void 0,onDragStart:b?()=>{R.current=Pe}:void 0,onDragOver:b?ye=>{ye.preventDefault(),O(Pe)}:void 0,onDragLeave:b?()=>O(null):void 0,onDrop:b?ye=>{ye.preventDefault(),R.current!==null&&R.current!==Pe&&b(R.current,Pe),R.current=null,O(null)}:void 0,onDragEnd:b?()=>{R.current=null,O(null)}:void 0,children:[(Ce.words??[]).map((ye,Ye)=>n.jsxs(o.Fragment,{children:[Ye>0&&n.jsx("div",{className:se("word-table__pair-divider")}),n.jsx(ls,{outerScale:Be,label:ye.label,subLabel:ye.subLabel,colloquialLabel:ye.colloquialLabel,captionLabel:ye.captionLabel,captionBadge:ye.captionBadge,homonum:ye.homonum,showWord:tt.word,showImage:tt.image,showPronunciation:tt.pron,showColloquial:tt.colloq,showCaption:tt.caption,buttonSize:N,wordInfo:ye.grade||ye.syllables!=null||ye.pos||ye.wordType?{grade:ye.grade,syllables:ye.syllables,pos:ye.pos,wordType:ye.wordType}:void 0})]},Ye)),F&&L(Pe,(Ce.words??[]).map(ye=>ye.label).join(" / ")),(x||_||w||b)&&n.jsxs("div",{className:se("word-table__card-actions"),children:[_&&n.jsx("div",{className:se("word-table__card-close"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(Ce.words??[]).length>1?W("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):W("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:K((Ce.words??[]).map(ye=>ye.label),(Ce.words??[]).length>1),onClick:()=>_(Ce.id)})}),w&&n.jsx("div",{className:se("word-table__card-copy"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"copy",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:W("wordTable.copyItem","\uD55C \uCE78 \uB354"),ariaLabel:W("wordTable.copyItemAria",{n:v+Pe+1,defaultValue:"{{n}}\uBC88 \uCE78 \uB0B1\uB9D0\uC744 \uD55C \uCE78 \uB354"}),onClick:()=>w(Ce.id,v+Pe)})}),x?.(Pe,Ce),b&&n.jsx("div",{className:se("word-table__card-handle"),children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:W("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:W("wordTable.reorder.handle",{word:(Ce.words??[]).map(ye=>ye.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})})]})]},xt?xt[Pe]:Pe)),Array.from({length:Math.max(0,Te*Ke-(p?.length??0))}).map((Ce,Pe)=>{const ye=(p?.length??0)+Pe<(B??ut);return n.jsx("div",{className:se("word-table__card word-table__card--filler"),children:E&&C&&ye&&n.jsx("div",{className:se("word-table__card-add"),style:jt,children:n.jsx(be,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:W("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C((p?.length??0)+Pe)})})},`filler-${Pe}`)})]}),nt&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--top",children:[n.jsx("img",{className:"word-table__brand-logo",src:k?.topLogo?.src??gr,alt:k?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const Ce=[k?.title&&n.jsx("span",{className:"word-table__paper-title",children:k.title},"t"),k?.owner&&n.jsx("span",{className:"word-table__owner",children:k.owner},"o"),P&&n.jsx("span",{className:"word-table__code",children:P},"c")].filter(Boolean);return Ce.length===0?null:n.jsx("span",{className:"word-table__ident",children:Ce.map((Pe,ye)=>n.jsxs(o.Fragment,{children:[ye>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),Pe]},ye))})})()]})}),kt&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"word-table__band word-table__band--bottom",children:[n.jsxs("span",{className:"word-table__brand-by",children:[k?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:k.bottomLogo.src,alt:k.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:At})]}),n.jsxs("span",{className:"word-table__band-end",children:[k?.link&&n.jsx("span",{className:"word-table__link",children:k.link}),$&&G!=="none"&&n.jsx("span",{className:"word-table__page-count",children:W("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})]})}),!rt&&$&&G!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${G}`,children:W("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})}),b&&n.jsx("span",{role:"status",style:I4,children:V})]}),_t=we==null?dt:n.jsx("div",{className:"word-table__frame",style:{height:we},children:dt});return U?n.jsx(va,{type:"page",icon:t,title:e,disc:a,className:Ae(se("word-table__section"),r),children:_t}):_t}function W4(e,t,a){const r=[];for(const s of e??[]){if(s.type==="note"||s.type==="input")continue;const l=s.displayLabel??s.label,i=H4(s,t?.[s.label],a);i!==null&&r.push(`${l} ${i}`)}return r.join(" \xB7 ")}function H4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(s=>s!==Bn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(s=>V4(e,s)).join(", ")}function V4(e,t){const a=[...e.items??[],...(e.groups??[]).flat()];for(const r of a)if(r!=null){if(typeof r=="string"){if(r===t)return r;continue}if(r.value===t)return r.displayLabel??r.labels?.join(" ")??r.value}return t}function Fn({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:s=!1,defaultCollapsed:l=!1,collapsed:i,onCollapsedChange:u,footer:c,sections:d,selected:h={},onSelect:p,align:m,sectionAlign:g,className:y}){const C=(m??(g==="vertical"?"newline":"inline"))==="inline",{t:f}=xe.useTranslation(),[_,b]=o.useState(l),w=i??_,v=()=>{const k=!w;b(k),u?.(k)},A=k=>{if(!s)return;const P=k.target;!P||typeof P.closest!="function"||P.closest(".filter-panel__collapse-toggle")||P.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||v()},x=o.useMemo(()=>r!==void 0||!w?"":W4(d,h,f("common.all","\uC804\uCCB4")),[r,w,d,h,f]),E=r??(x?n.jsx("span",{className:"filter-panel__header-summary body-3",children:x}):null),B=e||a||r||s,D=o.useId(),N=t?`h${t}`:"span";return n.jsxs("div",{className:Ae("filter-panel",s?"filter-panel--collapsible":"",w?"filter-panel--collapsed":"",y),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?D:void 0,children:[B&&n.jsxs("div",{className:"filter-panel__header",onClick:s?A:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(N,{id:D,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[w?E:a,s&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:w?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:w?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),showTooltipInfo:w?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),"aria-expanded":!w,onClick:v})]})]}),!w&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Ae("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(k=>{const P=h[k.label],$=P===void 0||(Array.isArray(P)?P.length===0:!1),G=(k.items??[]).filter(F=>F!=null);k.allOption&&G.some(F=>(typeof F=="string"?F:F.value)===Bn)&&Bt(`filter-panel-all-value:${k.label}`,`[FilterPanel] '${k.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${Bn}' \uC778 \uBCF4\uAE30\uAC00 \uD568\uAED8 \uC788\uB2E4 \u2014 \uB450 \uC120\uD0DD\uC774 \uAD6C\uBCC4\uB418\uC9C0 \uC54A\uB294\uB2E4. \uBCF4\uAE30 \uAC12\uC744 \uBC14\uAFD4\uB77C.`);const T=F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"&&!!F.disabled,Z=typeof F!="string"?F.labels:void 0,I=typeof F!="string"?F.displayLabel:void 0,K=typeof F!="string"?F.tooltip:void 0,L=typeof F!="string"?F.descriptionTooltip:void 0,W=typeof F!="string"?F.shape:void 0,Y=Array.isArray(P)?P.includes(M):P===M;return n.jsx(be,{htmlType:"button",size:"keyboard",label:Z??I??M,type:k.itemType??(Z?"bar":M.length===1?"dot":void 0),selected:Y,disabled:Q,shape:W,showTooltipInfo:!!K,tooltipInfoText:K,tooltipDescription:L,onClick:()=>p?.(M,k.label)},M)};return n.jsxs(o.Fragment,{children:[k.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:k.groupLabel}),k.groupAction]}),n.jsxs("div",{className:Ae("filter-panel__section",k.layout==="row"?"filter-panel__section--row":"",k.block?"filter-panel__section--block":""),children:[n.jsxs("div",{className:"filter-panel__section-label-row",children:[n.jsx("span",{className:"filter-panel__section-label body-3",children:k.displayLabel??k.label}),k.labelAction??(k.labelInfo?n.jsx(Ua,{...k.labelInfo}):null)]}),k.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:k.content}):k.type==="input"?n.jsx(qn,{className:"filter-panel__textfield",placeholder:k.placeholder,ariaLabel:k.displayLabel??k.label,value:h[k.label]??"",onChange:F=>p?.(F,k.label),error:k.error}):!k.multiple&&k.display==="segmented"?n.jsx(vn,{ariaLabel:k.displayLabel??k.label,options:[...k.allOption?[{key:Bn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"?F.displayLabel:void 0,Z=typeof F!="string"?F.disabled:void 0;return{key:M,label:Q??M,disabled:Z}})],value:$&&k.allOption?Bn:h[k.label]??"",onChange:F=>p?.(F,k.label),size:32}):!k.multiple&&k.display==="dropdown"?n.jsx(_n,{className:"filter-panel__dropdown",ariaLabel:typeof k.label=="string"?k.label:void 0,size:40,options:[...k.allOption?[{value:Bn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(F=>{const M=typeof F=="string"?F:F.value,Q=typeof F!="string"?F.displayLabel:void 0,Z=typeof F!="string"?F.disabled:void 0;return{value:M,label:Q??M,disabled:Z}})],value:$&&k.allOption?Bn:h[k.label],onChange:F=>p?.(F,k.label)}):n.jsxs("div",{className:k.groups?"filter-panel__item-groups":"filter-panel__items",children:[k.allOption&&!k.groups&&n.jsx(be,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(Bn,k.label)}),k.groups?k.groups.map((F,M)=>n.jsxs("div",{className:"filter-panel__item-group",children:[M===0&&k.allOption&&n.jsx(be,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(Bn,k.label)}),F.filter(Q=>Q!=null).map(T)]},M)):G.map(T)]})]})]},k.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const q4=[1,2,3,4,5,6,7,8,9,10,11,12],U4=[8,6,4,2,1],fn="show",Sn="hide",fc=["image","word","caption","standardPron"];function bc(e){return e.some(t=>(t.words??[]).some(a=>!!a.captionBadge||!!a.captionLabel))}function gc(e,t){return{label:e("wordTable.filter.composition","\uAD6C\uC131"),items:[{value:"image",disabled:!t.hasImage,displayLabel:e("wordTable.filter.image","\uC774\uBBF8\uC9C0")},{value:"word",displayLabel:e("wordTable.filter.word","\uB2E8\uC5B4")},{value:"caption",disabled:!t.hasCaption,displayLabel:e("wordTable.filter.caption","\uC720\uD615")},{value:"standardPron",displayLabel:e("wordTable.filter.standardPron","\uD45C\uC900 \uBC1C\uC74C")},{value:"colloquialPron",disabled:!t.hasColloquial,displayLabel:e("wordTable.filter.colloquialPron","\uAD6C\uC5B4\uCCB4 \uBC1C\uC74C")}],multiple:!0,allOption:!0}}function yc(e){return{label:e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5"),items:[{value:"landscape",displayLabel:e("wordTable.filter.landscape","\uAC00\uB85C")},{value:"portrait",displayLabel:e("wordTable.filter.portrait","\uC138\uB85C")}],display:"segmented"}}function vc(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function _c(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function xc(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function wc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:"dashed",displayLabel:e("wordTable.filter.dotted","\uC810\uC120")},{value:"corner",displayLabel:e("wordTable.filter.corner","\uCF54\uB108")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function Bc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:fn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function kc(e,t){const a=Math.max(1,Math.min(t.itemCount,t.max??t.itemCount));return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[a,...U4.filter(r=>r<a)].map(r=>({value:`${r}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:r})})),display:"segmented"}}function Ac(e,t){return e>=t?Number.POSITIVE_INFINITY:e}function G4(e){return{label:e("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638"),items:[{value:"left",displayLabel:e("wordTable.filter.pageNumberLeft","\uC67C\uCABD")},{value:"center",displayLabel:e("wordTable.filter.pageNumberCenter","\uC911\uC559")},{value:"right",displayLabel:e("wordTable.filter.pageNumberRight","\uC624\uB978\uCABD")},{value:Sn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function Nc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function Ec(e,t){return{[e("wordTable.filter.composition","\uAD6C\uC131")]:t.contentTypes,[e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")]:t.orientation,[e("wordTable.filter.border","\uC678\uACFD\uC120")]:t.showOutline?fn:Sn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?fn:Sn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?fn:Sn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?fn:Sn}:{}}}function Dc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===Bn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(s=>s.includes(t)?s.filter(l=>l!==t):[...s,t]),!0):a===e("wordTable.filter.paperOrientation","\uC6A9\uC9C0 \uBC29\uD5A5")?(r.setOrientation(t==="landscape"?"landscape":"portrait"),!0):a===e("wordTable.filter.border","\uC678\uACFD\uC120")?(r.setShowOutline(t===fn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===fn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===fn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===fn),!0):!1}function K4(e){return"sections"in e}function is(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c};if(K4(e))return n.jsx(Fn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:e.sections,selected:e.selected,onSelect:e.onSelect,...d,align:"inline"});const{hasImage:h,hasColloquial:p,hasCaption:m,contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,setters:b,showCutLine:w=!1,showDivLine2:v=!1,middleSections:A=[],extraSelected:x={},onExtraSelect:E,showPaperBands:B=!1,showTopInfo:D=!0,showBottomInfo:N=!0}=e,k=[gc(t,{hasImage:h,hasColloquial:p,hasCaption:m??!1}),yc(t),...A,vc(t),...w?[wc(t)]:[],...v?[Bc(t)]:[],...B?[_c(t),xc(t)]:[]],P={...Ec(t,{contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,showTopInfo:D,showBottomInfo:N}),...x},$=(G,T)=>{Dc(t,G,T,b)||E?.(G,T)};return n.jsx(Fn,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:k,selected:P,onSelect:$,...d,sectionAlign:"horizontal"})}function us(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Y4(e){return us(e).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cs(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let kr=null,xa=null;function Z4(e,t,a,r="",s=""){if(e.length===0||xa&&xa.iframe.isConnected&&Date.now()-xa.at<1e4)return;const l=r?cs(r):"";kr?.();let i=null;if(l){const d=document.title;document.title=l,i=()=>{document.title=d,window.removeEventListener("afterprint",i),kr===i&&(kr=null)},kr=i,window.addEventListener("afterprint",i)}const u=document.createElement("iframe");u.style.cssText="position:fixed;left:-10000px;top:0;width:1200px;height:900px;border:0;",document.body.appendChild(u);const c=u.contentDocument;if(!c){u.remove();return}xa={iframe:u,at:Date.now()},c.open(),c.write(ds(e,t,a,!0,l,s)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{i?.(),setTimeout(()=>{u.remove(),xa?.iframe===u&&(xa=null)},0)})}function ds(e,t,a,r=!1,s="",l=""){s=s?cs(s):"";const i=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(m=>m.cssText)}catch{return[]}}).join(`
831
831
  `),u="light",c=(()=>{try{return document.documentElement.lang||""}catch{return""}})(),d=l?`<div class="paper-head">${us(l)}</div>`:"",h=e.map(p=>{const m=p.cloneNode(!0);return m.querySelectorAll('[data-play-state="play"]').forEach(g=>g.style.display=""),m.querySelectorAll('[data-play-state="pause"]').forEach(g=>g.style.display="none"),m.querySelectorAll(".word-table-cell__score-slot:not(.word-table-cell__score-slot--on)").forEach(g=>g.remove()),m.querySelectorAll(".word-table-cell__spinner").forEach(g=>g.remove()),m.querySelectorAll("img").forEach(g=>{g.style.opacity==="0"&&(g.setAttribute("onload","this.style.opacity=''"),g.setAttribute("onerror","this.style.visibility='hidden'"))}),`<div class="paper-wrap">${d}${m.outerHTML}</div>`}).join(`
832
832
  `);return`<!DOCTYPE html>
833
- <html${c?` lang="${K4(c)}"`:""} data-theme="${u}">
833
+ <html${c?` lang="${Y4(c)}"`:""} data-theme="${u}">
834
834
  <head>
835
835
  <meta charset="utf-8">
836
836
  ${s?`<title>${us(s)}</title>`:""}
@@ -867,6 +867,7 @@ ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(
867
867
  /* \uB9CC\uB4DC\uB294 \uB3D9\uC548\uB9CC \uC4F0\uB294 \uC190\uC7A1\uC774\uB4E4 \u2014 \uC885\uC774\uC5D0\uB294 \uC548 \uB098\uAC04\uB2E4(renderCellAction \uC774 \uC5B9\uC740 \uAC83\uB3C4 \uC774 \uC904 \uC548\uC5D0 \uC788\uB2E4).
868
868
  **\uC5EC\uAE30\uB294 \uD15C\uD50C\uB9BF \uAE00 \uC548\uC774\uB2E4** \u2014 \uD651\uB530\uC634\uD45C \uB300\uC2E0 \uC5ED\uB530\uC634\uD45C\uB97C \uC4F0\uBA74 \uAE00\uC774 \uAC70\uAE30\uC11C \uB04A\uAE34\uB2E4. */
869
869
  .word-table__card-close,
870
+ .word-table__card-add,
870
871
  .word-table__card-actions { display: none; }
871
872
  /* \uBA38\uB9AC\uAE00\uC740 \uACA9\uC790 \uC704\uC5D0 \uC5B9\uD78C\uB2E4. \uC6A9\uC9C0 \uC548\uCABD \uC5EC\uBC31(57px)\uC744 \uC774\uBBF8 .paper-wrap \uC774 \uAC16\uACE0 \uC788\uC5B4
872
873
  \uC5EC\uAE30\uC11C\uB294 \uC544\uB798 \uAC04\uACA9\uB9CC \uC900\uB2E4. \uACA9\uC790\uB294 \uC81C \uB192\uC774\uB97C \uC2A4\uC2A4\uB85C \uC7A1\uC73C\uBBC0\uB85C \uBC00\uB824\uB3C4 \uC798\uB9AC\uC9C0 \uC54A\uB294\uB2E4. */
@@ -1034,17 +1035,17 @@ ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(
1034
1035
  `:""}
1035
1036
  <\/script>
1036
1037
  </body>
1037
- </html>`}const Z4=1e3;function ps({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:s,header:l=""}){const{t:i}=xe.useTranslation(),u=o.useCallback(()=>{Y4(e(),t,a,r,l)},[e,t,a,r,l]),c=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=window.open("","_blank");if(!p){s?.();return}p.document.write(ds(h,t,a,!1,r,l)),p.document.close()},[e,t,a,r,s,l]),d=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=ds(h,t,a,!1,r,l),m=new Blob([p],{type:"text/html;charset=utf-8"}),g=URL.createObjectURL(m),y=(r?cs(r):"")||i("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:g,download:`${y}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(g),Z4)},[e,t,a,r,l,i]);return{print:u,openNewWindow:c,downloadHtml:d}}function Sc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,s=t?.maxItemsPerPage,[l,i]=o.useState("landscape"),[u,c]=o.useState([...fc]),[d,h]=o.useState("show"),[p,m]=o.useState(!0),[g,y]=o.useState(!0),[C,f]=o.useState(!0),[_,b]=o.useState(!0),[w,v]=o.useState(8),[A,x]=o.useState("right"),E=e.length,B=e.some(K=>(K.words??[]).length>1),D=e.some(K=>(K.words??[]).some(L=>!!L.colloquialLabel)),N=bc(e),k=Math.max(1,Math.min(Math.max(E,1),s??Math.max(E,1))),P=Math.min(w,k),$=o.useMemo(()=>D4(e,P),[e,P]),G=$.length>1,T=P,[F,M]=o.useState(!1);o.useEffect(()=>{let K=!1;if(!ua()){M(!1);return}return Promise.all(e.flatMap(L=>(L.words??[]).map(W=>Tl(W.label,W.homonum)))).then(L=>{K||M(L.some(Boolean))},()=>{}),()=>{K=!0}},[e]);const Q=o.useMemo(()=>[gc(a,{hasImage:F,hasColloquial:D,hasCaption:N}),yc(a),...E>0?[kc(a,{hasPairs:B,itemCount:E,max:s})]:[],vc(a),...T>1?[wc(a)]:[],...B?[Bc(a)]:[],...r?[_c(a),xc(a)]:[]],[a,F,D,N,E,B,G,T,r,s]),Z={...Ec(a,{contentTypes:u,orientation:l,showOutline:p,cutLine:d,showDivLine:_,showTopInfo:g,showBottomInfo:C}),...E>0?{[a(B?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${P}\uAC1C`}:{},...G?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:A}:{}},I=o.useCallback((K,L)=>{Dc(a,K,L,{setContentTypes:c,setOrientation:i,setShowOutline:m,setCutLine:h,setShowDivLine:b,setShowTopInfo:y,setShowBottomInfo:f})||(L===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||L===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?v(Ac(parseInt(K),E)):L===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&x(Nc(K)))},[a,E]);return{settings:{orientation:l,contentTypes:u,cutLine:d,showOutline:p,showDivLine:_,count:T,showTopInfo:g,showBottomInfo:C},filterSections:Q,filterSelected:Z,handleSelect:I,pages:$,isPaginated:G,pageNumberPosition:A}}function X4({items:e,words:t,baseItem:a,baseContentTypes:r,maxItemsPerPage:s,title:l,subtitle:i,emptyText:u,buttons:c,renderButtons:d,renderFooter:h,footerClassName:p,footerLayout:m,printFileName:g,showSettings:y,autoPrint:C,className:f,onClose:_,scoring:b=!1,onScoreChange:w,printHeader:v,brand:A,code:x,beforeClose:E}){const{t:B}=xe.useTranslation(),D=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(q=>typeof q=="string"&&q.length>0).map((q,ie)=>({id:`${q}-${ie}`,words:[{label:q}]})),[e,t]),{settings:N,filterSections:k,filterSelected:P,handleSelect:$,pages:G,isPaginated:T,pageNumberPosition:F}=Sc(D,{paperBands:!!A?.show,maxItemsPerPage:s}),M=o.useMemo(()=>sc(G.map(q=>q.length)),[G]),[Q,Z]=o.useState({}),I=o.useCallback((q,ie)=>{Z(Ne=>({...Ne,[wr(q)]:ac(Ne[wr(q)]??null,ie)}))},[]),K=o.useRef(w);o.useEffect(()=>{K.current=w});const L=o.useRef(Q);o.useEffect(()=>{L.current!==Q&&(L.current=Q,K.current?.(ns(Q)))},[Q]);const W=o.useMemo(()=>ns(Q),[Q]),Y=o.useRef(null),{toastMessage:U,toastKey:j,showWarning:R,clearToast:z}=Ui("warning"),O=o.useRef([]),ue=o.useCallback(()=>T?O.current.filter(q=>q!==null):Y.current?[Y.current]:[],[T]),{print:te,openNewWindow:de}=ps({getElements:ue,paperW:ea[N.orientation].width,paperH:ea[N.orientation].height,fileName:g??"",header:v??"",onPopupBlocked:()=>R(B("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}),ee=o.useMemo(()=>h?void 0:d?d({print:te,openNewWindow:de}):g?[{label:B("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>de()},{label:B("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>te()},...c??[]]:c,[h,d,g,c,B,te,de]),V=o.useMemo(()=>h?h({print:te,openNewWindow:de}):void 0,[h,te,de]),ae=o.useRef(!1),H=o.useRef(te);return o.useEffect(()=>{H.current=te},[te]),o.useEffect(()=>{if(!C||ae.current)return;const q=window.setTimeout(()=>{ae.current=!0,H.current()},100);return()=>window.clearTimeout(q)},[C]),n.jsxs(Rn,{title:l??B("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:i,size:"large",className:Ae("word-table-popup",f),buttons:ee,footer:V,footerClassName:p,footerLayout:m,beforeClose:E,onClose:_,children:[D.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[y&&n.jsx(is,{sections:k,selected:P,onSelect:$}),T?n.jsx("div",{className:"word-table-popup__pages",children:G.map((q,ie)=>n.jsx(_a,{items:q,orientation:N.orientation,contentTypes:N.contentTypes,baseItem:a,baseContentTypes:r,cutLine:N.cutLine,showOutline:N.showOutline,showDivLine:N.showDivLine,count:N.count,contentRef:Ne=>{O.current[ie]=Ne},pageNumber:{current:ie+1,total:G.length},pageNumberPosition:F,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x,scoring:b,scoreIndexOffset:M[ie],marks:W,onMarkClick:I},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(_a,{items:D,orientation:N.orientation,contentTypes:N.contentTypes,baseItem:a,baseContentTypes:r,cutLine:N.cutLine,showOutline:N.showOutline,showDivLine:N.showDivLine,count:N.count,contentRef:Y,fitHeight:!0,scoring:b,marks:W,onMarkClick:I,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:u??B("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ya,{message:U,position:"top",onClose:z},j)]})}const J4=new Set(["x","triangle"]);function Q4(e,t){const a=[];for(let r=0;r<e.length;r++){const s=t[String(r)];s&&J4.has(s)&&a.push(e[r])}return a}const e_=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function jc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const l=Math.floor(a);if(l===0)return{base:t,round:1};const i=(l===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${l}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:i?t.slice(0,i.index).trim():t,round:l+1}}let r=t,s=1;for(;;){const l=e_.exec(r);if(!l)break;s=Math.max(s,(l[1]?Number(l[1]):1)+1),r=r.slice(0,l.index).trim()}return{base:r,round:s}}function t_(e,t){const[,a,r]=uo(t).split("-"),s=`${a}.${r}`,{base:l,round:i}=jc(typeof e=="string"?{name:e}:e),u=i>=2?`${i}\uCC28 `:"";return`${l||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${s}`}function n_(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:jc(e).round}}function a_(e,t){const a={};for(const[r,s]of Object.entries(t)){if(s!=="o"&&s!=="triangle"&&s!=="x")continue;const l=Number(r),i=e[l];i&&(a[r]=i)}return a}function r_(e){return e.map(t=>t.label).join(" / ")}function o_(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function Tc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function s_(e,t,a){const r=Kl(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function Mc(e,t,a){return a===0?0:(e+t*.5)/a}function l_(e){const t=new Map,a=[...e].sort((s,l)=>s.scoredAt.localeCompare(l.scoredAt));for(const s of a)for(const[l,i]of Object.entries(s.marks)){const u=s.labels?.[l];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:i,latestAt:s.scoredAt};if(i==="o")c.o++;else if(i==="triangle")c.triangle++;else if(i==="x")c.x++;else continue;c.latest=i,c.latestAt=s.scoredAt,t.set(u,c)}const r=[];for(const[s,l]of t){const i=l.o+l.triangle+l.x;r.push({label:Tc(s),key:s,tried:i,o:l.o,triangle:l.triangle,x:l.x,rate:Mc(l.o,l.triangle,i),latest:l.latest,latestAt:l.latestAt})}return r.sort((s,l)=>s.rate-l.rate||l.tried-s.tried||Cn(s.label,l.label)||Cn(s.key??s.label,l.key??l.label)),r}function i_(e){const t=new Map;for(const r of e){const s=r.tableId??`name:${r.tableName}`,l=t.get(s)??{tableName:r.tableName,tableId:r.tableId,rows:[]};l.rows.push(r),t.set(s,l)}const a=[];for(const r of t.values()){const s=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,l=r.rows.filter(u=>s(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(l.length===0)continue;const i=l.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,h=c.filter(p=>p==="triangle").length;return Mc(d,h,s(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:i,times:l.map(u=>u.scoredAt),delta:i.length>=2?i[i.length-1]-i[0]:null})}return a.sort((r,s)=>(s.times[s.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function u_(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function c_(e,t){if(e==null||t==null||e===""||t==="")return 0;if(typeof e=="number"&&typeof t=="number")return e-t;const a=String(e),r=String(t);return+(a>r)-+(a<r)}function d_(e){const t=new Map;let a=0,r=0;const s=e.map((i,u)=>({r:i,at:u})).sort((i,u)=>i.r.answeredAt.localeCompare(u.r.answeredAt)||c_(i.r.id,u.r.id)||i.at-u.at).map(i=>i.r);for(const i of s){if(i.isCorrect==null)continue;const u=i.itemTitle?.trim();if(!u){r++;continue}a++;const c=i.itemId?.trim()||u,d=`${i.trainingType}|${c}`,h=t.get(d)??{trainingType:i.trainingType,itemId:c,title:u,tried:0,wrong:0,latestCorrect:i.isCorrect,latestAt:i.answeredAt,lastSelected:i.selected,setIds:[]};if(h.tried++,i.isCorrect||h.wrong++,h.title=u,h.latestCorrect=i.isCorrect,h.latestAt=i.answeredAt,h.lastSelected=i.selected,i.setId){const p=h.setIds.indexOf(i.setId);p>0&&h.setIds.splice(p,1),p!==0&&h.setIds.unshift(i.setId)}t.set(d,h)}const l=[...t.entries()].map(([i,u])=>({key:i,trainingType:u.trainingType,itemId:u.itemId,title:u.title,tried:u.tried,wrong:u.wrong,rate:u.tried===0?0:(u.tried-u.wrong)/u.tried,latestCorrect:u.latestCorrect,latestAt:u.latestAt,lastSelected:u.lastSelected,setIds:u.setIds}));return l.sort((i,u)=>i.rate-u.rate||u.tried-i.tried||Cn(i.title,u.title)),{items:l,counted:a,skippedNoTitle:r}}function p_(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function h_(e){const t=new Map;for(const r of e){const s=t.get(r.trainingType)??[];s.push(r),t.set(r.trainingType,s)}const a=[...t.entries()].map(([r,s])=>({trainingType:r,items:s,pending:s.filter(l=>!l.latestCorrect).length}));return a.sort((r,s)=>s.pending-r.pending||r.trainingType.localeCompare(s.trainingType)),a}const hs=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function m_(e){const t=new Map;let a=0;for(const l of e){if(l.latestCorrect)continue;const i=l.setIds[0];if(!i){a++;continue}const u=`${l.trainingType}|${i}`,c=t.get(u)??{setId:i,trainingType:l.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(l,i)=>i.pending-l.pending||l.trainingType.localeCompare(i.trainingType)||l.setId.localeCompare(i.setId),s=[...t.values()];return{sentence:s.filter(l=>hs.includes(l.trainingType)).sort(r),word:s.filter(l=>!hs.includes(l.trainingType)).sort(r),noSet:a}}function C_(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const s=[];for(const l of e){const i=new Set,u=[];for(const c of l.cellLabels)r.has(c)&&!i.has(c)&&(i.add(c),u.push(c));u.length!==0&&s.push({id:l.id,name:l.name,kind:l.kind,covered:u,totalCells:l.cellLabels.length})}return s.sort((l,i)=>i.covered.length-l.covered.length||l.totalCells-i.totalCells||Cn(l.name,i.name)),s.slice(0,Math.max(0,a))}function f_(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function b_(e,t){const a=new Map;for(const s of e)for(const l of s.cells){const i=s.labelOf(l);a.has(i)||a.set(i,l)}const r=[];for(const s of t){const l=a.get(s);l!==void 0&&r.push(l)}return r}function ms(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,s)=>String(a[s]))}function g_(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),s=a%60;return t?t(r,s):r>0&&s>0?ms(Vt.t("customers.duration.minSec",{m:r,s,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s}):r>0?ms(Vt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):ms(Vt.t("customers.duration.sec",{s,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s})}function y_(e,t){const a=[],r=new Set;for(const s of e){const l=t(s);r.has(l)||(r.add(l),a.push({key:l,value:s,pinned:!1}))}return a}function v_(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function __(e,t){return e.filter(a=>a.key!==t)}function x_(e,t,a){const r=e.filter(d=>d.pinned),s=new Set(r.map(d=>d.key)),l=e.length-r.length,i=[],u=new Set(s);for(const d of t){if(i.length>=l)break;const h=a(d);u.has(h)||(u.add(h),i.push({key:h,value:d,pinned:!1}))}const c=[...i];return e.map(d=>d.pinned?d:c.shift()).filter(d=>d!==void 0)}function w_(e){return e.map(t=>t.value)}function B_(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},s=t?.key?` icon-grid-menu__button--${t.key}`:"",l=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${s}`,children:[n.jsx("button",{className:`icon-grid-menu__button${a?" icon-grid-menu__button--selected":""}`,"data-key":t?.key,type:"button",onClick:a?void 0:r,"aria-pressed":a,"aria-labelledby":l,children:n.jsx(at,{icon:t.icon,label:t.label,className:"icon-grid-menu__button-icon",imgClassName:"icon-grid-menu__button-icon-image",maskClassName:"icon-grid-menu__button-icon-mask",svgClassName:"icon-grid-menu__button-icon-svg"})}),n.jsx("span",{id:l,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function k_(e){const{categories:t=[],selected:a,onSelect:r,size:s="medium"}=e||{},l=a!==void 0,[i,u]=o.useState(()=>l?null:(t&&t[0]?.key)??null),c=l?a:i,d=o.useRef(r);o.useEffect(()=>{d.current=r});const h=o.useRef(!1),p=(t&&t[0]?.key)??null;o.useEffect(()=>{if(l||h.current||!p)return;h.current=!0;const g=i??p;i==null&&u(g),d.current?.(g)},[l,p]);const m=o.useCallback(g=>{const y=c===g?null:g;h.current=!0,l||u(y),r?.(y)},[c,l,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${s}`,children:(t||[]).map(g=>n.jsx(B_,{category:g,isSelected:c===g.key,onClick:()=>m(g.key)},g.key))})}function A_({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const s=r==="small"?32:40;return n.jsx("div",{className:`choice-chips choice-chips--${r}`,children:n.jsx("div",{className:"choice-chips__list",children:e.map(l=>n.jsx(be,{htmlType:"button",size:s,type:"bar",label:l.label,selected:t===l.key,className:"choice-chips__button",onClick:()=>a?.(l.key)},l.key))})})}function N_({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",s=a?.tel??"031-380-3724",{t:l}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:l("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
1038
+ </html>`}const X4=1e3;function ps({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:s,header:l=""}){const{t:i}=xe.useTranslation(),u=o.useCallback(()=>{Z4(e(),t,a,r,l)},[e,t,a,r,l]),c=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=window.open("","_blank");if(!p){s?.();return}p.document.write(ds(h,t,a,!1,r,l)),p.document.close()},[e,t,a,r,s,l]),d=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=ds(h,t,a,!1,r,l),m=new Blob([p],{type:"text/html;charset=utf-8"}),g=URL.createObjectURL(m),y=(r?cs(r):"")||i("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:g,download:`${y}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(g),X4)},[e,t,a,r,l,i]);return{print:u,openNewWindow:c,downloadHtml:d}}function Sc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,s=t?.maxItemsPerPage,[l,i]=o.useState("landscape"),[u,c]=o.useState([...fc]),[d,h]=o.useState("show"),[p,m]=o.useState(!0),[g,y]=o.useState(!0),[C,f]=o.useState(!0),[_,b]=o.useState(!0),[w,v]=o.useState(8),[A,x]=o.useState("right"),E=e.length,B=e.some(K=>(K.words??[]).length>1),D=e.some(K=>(K.words??[]).some(L=>!!L.colloquialLabel)),N=bc(e),k=Math.max(1,Math.min(Math.max(E,1),s??Math.max(E,1))),P=Math.min(w,k),$=o.useMemo(()=>D4(e,P),[e,P]),G=$.length>1,T=P,[F,M]=o.useState(!1);o.useEffect(()=>{let K=!1;if(!ua()){M(!1);return}return Promise.all(e.flatMap(L=>(L.words??[]).map(W=>Tl(W.label,W.homonum)))).then(L=>{K||M(L.some(Boolean))},()=>{}),()=>{K=!0}},[e]);const Q=o.useMemo(()=>[gc(a,{hasImage:F,hasColloquial:D,hasCaption:N}),yc(a),...E>0?[kc(a,{hasPairs:B,itemCount:E,max:s})]:[],vc(a),...T>1?[wc(a)]:[],...B?[Bc(a)]:[],...r?[_c(a),xc(a)]:[]],[a,F,D,N,E,B,G,T,r,s]),Z={...Ec(a,{contentTypes:u,orientation:l,showOutline:p,cutLine:d,showDivLine:_,showTopInfo:g,showBottomInfo:C}),...E>0?{[a(B?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${P}\uAC1C`}:{},...G?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:A}:{}},I=o.useCallback((K,L)=>{Dc(a,K,L,{setContentTypes:c,setOrientation:i,setShowOutline:m,setCutLine:h,setShowDivLine:b,setShowTopInfo:y,setShowBottomInfo:f})||(L===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||L===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?v(Ac(parseInt(K),E)):L===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&x(Nc(K)))},[a,E]);return{settings:{orientation:l,contentTypes:u,cutLine:d,showOutline:p,showDivLine:_,count:T,showTopInfo:g,showBottomInfo:C},filterSections:Q,filterSelected:Z,handleSelect:I,pages:$,isPaginated:G,pageNumberPosition:A}}function J4({items:e,words:t,baseItem:a,baseContentTypes:r,maxItemsPerPage:s,title:l,subtitle:i,emptyText:u,buttons:c,renderButtons:d,renderFooter:h,footerClassName:p,footerLayout:m,printFileName:g,showSettings:y,autoPrint:C,className:f,onClose:_,scoring:b=!1,onScoreChange:w,printHeader:v,brand:A,code:x,beforeClose:E}){const{t:B}=xe.useTranslation(),D=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(q=>typeof q=="string"&&q.length>0).map((q,ie)=>({id:`${q}-${ie}`,words:[{label:q}]})),[e,t]),{settings:N,filterSections:k,filterSelected:P,handleSelect:$,pages:G,isPaginated:T,pageNumberPosition:F}=Sc(D,{paperBands:!!A?.show,maxItemsPerPage:s}),M=o.useMemo(()=>sc(G.map(q=>q.length)),[G]),[Q,Z]=o.useState({}),I=o.useCallback((q,ie)=>{Z(Ne=>({...Ne,[wr(q)]:ac(Ne[wr(q)]??null,ie)}))},[]),K=o.useRef(w);o.useEffect(()=>{K.current=w});const L=o.useRef(Q);o.useEffect(()=>{L.current!==Q&&(L.current=Q,K.current?.(ns(Q)))},[Q]);const W=o.useMemo(()=>ns(Q),[Q]),Y=o.useRef(null),{toastMessage:U,toastKey:j,showWarning:R,clearToast:z}=Ui("warning"),O=o.useRef([]),ue=o.useCallback(()=>T?O.current.filter(q=>q!==null):Y.current?[Y.current]:[],[T]),{print:te,openNewWindow:de}=ps({getElements:ue,paperW:ea[N.orientation].width,paperH:ea[N.orientation].height,fileName:g??"",header:v??"",onPopupBlocked:()=>R(B("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}),ee=o.useMemo(()=>h?void 0:d?d({print:te,openNewWindow:de}):g?[{label:B("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>de()},{label:B("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>te()},...c??[]]:c,[h,d,g,c,B,te,de]),V=o.useMemo(()=>h?h({print:te,openNewWindow:de}):void 0,[h,te,de]),ae=o.useRef(!1),H=o.useRef(te);return o.useEffect(()=>{H.current=te},[te]),o.useEffect(()=>{if(!C||ae.current)return;const q=window.setTimeout(()=>{ae.current=!0,H.current()},100);return()=>window.clearTimeout(q)},[C]),n.jsxs(Rn,{title:l??B("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:i,size:"large",className:Ae("word-table-popup",f),buttons:ee,footer:V,footerClassName:p,footerLayout:m,beforeClose:E,onClose:_,children:[D.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[y&&n.jsx(is,{sections:k,selected:P,onSelect:$}),T?n.jsx("div",{className:"word-table-popup__pages",children:G.map((q,ie)=>n.jsx(_a,{items:q,orientation:N.orientation,contentTypes:N.contentTypes,baseItem:a,baseContentTypes:r,cutLine:N.cutLine,showOutline:N.showOutline,showDivLine:N.showDivLine,count:N.count,contentRef:Ne=>{O.current[ie]=Ne},pageNumber:{current:ie+1,total:G.length},pageNumberPosition:F,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x,scoring:b,scoreIndexOffset:M[ie],marks:W,onMarkClick:I},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(_a,{items:D,orientation:N.orientation,contentTypes:N.contentTypes,baseItem:a,baseContentTypes:r,cutLine:N.cutLine,showOutline:N.showOutline,showDivLine:N.showDivLine,count:N.count,contentRef:Y,fitHeight:!0,scoring:b,marks:W,onMarkClick:I,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:u??B("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ya,{message:U,position:"top",onClose:z},j)]})}const Q4=new Set(["x","triangle"]);function e_(e,t){const a=[];for(let r=0;r<e.length;r++){const s=t[String(r)];s&&Q4.has(s)&&a.push(e[r])}return a}const t_=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function jc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const l=Math.floor(a);if(l===0)return{base:t,round:1};const i=(l===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${l}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:i?t.slice(0,i.index).trim():t,round:l+1}}let r=t,s=1;for(;;){const l=t_.exec(r);if(!l)break;s=Math.max(s,(l[1]?Number(l[1]):1)+1),r=r.slice(0,l.index).trim()}return{base:r,round:s}}function n_(e,t){const[,a,r]=uo(t).split("-"),s=`${a}.${r}`,{base:l,round:i}=jc(typeof e=="string"?{name:e}:e),u=i>=2?`${i}\uCC28 `:"";return`${l||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${s}`}function a_(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:jc(e).round}}function r_(e,t){const a={};for(const[r,s]of Object.entries(t)){if(s!=="o"&&s!=="triangle"&&s!=="x")continue;const l=Number(r),i=e[l];i&&(a[r]=i)}return a}function o_(e){return e.map(t=>t.label).join(" / ")}function s_(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function Tc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function l_(e,t,a){const r=Kl(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function Mc(e,t,a){return a===0?0:(e+t*.5)/a}function i_(e){const t=new Map,a=[...e].sort((s,l)=>s.scoredAt.localeCompare(l.scoredAt));for(const s of a)for(const[l,i]of Object.entries(s.marks)){const u=s.labels?.[l];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:i,latestAt:s.scoredAt};if(i==="o")c.o++;else if(i==="triangle")c.triangle++;else if(i==="x")c.x++;else continue;c.latest=i,c.latestAt=s.scoredAt,t.set(u,c)}const r=[];for(const[s,l]of t){const i=l.o+l.triangle+l.x;r.push({label:Tc(s),key:s,tried:i,o:l.o,triangle:l.triangle,x:l.x,rate:Mc(l.o,l.triangle,i),latest:l.latest,latestAt:l.latestAt})}return r.sort((s,l)=>s.rate-l.rate||l.tried-s.tried||Cn(s.label,l.label)||Cn(s.key??s.label,l.key??l.label)),r}function u_(e){const t=new Map;for(const r of e){const s=r.tableId??`name:${r.tableName}`,l=t.get(s)??{tableName:r.tableName,tableId:r.tableId,rows:[]};l.rows.push(r),t.set(s,l)}const a=[];for(const r of t.values()){const s=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,l=r.rows.filter(u=>s(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(l.length===0)continue;const i=l.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,h=c.filter(p=>p==="triangle").length;return Mc(d,h,s(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:i,times:l.map(u=>u.scoredAt),delta:i.length>=2?i[i.length-1]-i[0]:null})}return a.sort((r,s)=>(s.times[s.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function c_(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function d_(e,t){if(e==null||t==null||e===""||t==="")return 0;if(typeof e=="number"&&typeof t=="number")return e-t;const a=String(e),r=String(t);return+(a>r)-+(a<r)}function p_(e){const t=new Map;let a=0,r=0;const s=e.map((i,u)=>({r:i,at:u})).sort((i,u)=>i.r.answeredAt.localeCompare(u.r.answeredAt)||d_(i.r.id,u.r.id)||i.at-u.at).map(i=>i.r);for(const i of s){if(i.isCorrect==null)continue;const u=i.itemTitle?.trim();if(!u){r++;continue}a++;const c=i.itemId?.trim()||u,d=`${i.trainingType}|${c}`,h=t.get(d)??{trainingType:i.trainingType,itemId:c,title:u,tried:0,wrong:0,latestCorrect:i.isCorrect,latestAt:i.answeredAt,lastSelected:i.selected,setIds:[]};if(h.tried++,i.isCorrect||h.wrong++,h.title=u,h.latestCorrect=i.isCorrect,h.latestAt=i.answeredAt,h.lastSelected=i.selected,i.setId){const p=h.setIds.indexOf(i.setId);p>0&&h.setIds.splice(p,1),p!==0&&h.setIds.unshift(i.setId)}t.set(d,h)}const l=[...t.entries()].map(([i,u])=>({key:i,trainingType:u.trainingType,itemId:u.itemId,title:u.title,tried:u.tried,wrong:u.wrong,rate:u.tried===0?0:(u.tried-u.wrong)/u.tried,latestCorrect:u.latestCorrect,latestAt:u.latestAt,lastSelected:u.lastSelected,setIds:u.setIds}));return l.sort((i,u)=>i.rate-u.rate||u.tried-i.tried||Cn(i.title,u.title)),{items:l,counted:a,skippedNoTitle:r}}function h_(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function m_(e){const t=new Map;for(const r of e){const s=t.get(r.trainingType)??[];s.push(r),t.set(r.trainingType,s)}const a=[...t.entries()].map(([r,s])=>({trainingType:r,items:s,pending:s.filter(l=>!l.latestCorrect).length}));return a.sort((r,s)=>s.pending-r.pending||r.trainingType.localeCompare(s.trainingType)),a}const hs=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function C_(e){const t=new Map;let a=0;for(const l of e){if(l.latestCorrect)continue;const i=l.setIds[0];if(!i){a++;continue}const u=`${l.trainingType}|${i}`,c=t.get(u)??{setId:i,trainingType:l.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(l,i)=>i.pending-l.pending||l.trainingType.localeCompare(i.trainingType)||l.setId.localeCompare(i.setId),s=[...t.values()];return{sentence:s.filter(l=>hs.includes(l.trainingType)).sort(r),word:s.filter(l=>!hs.includes(l.trainingType)).sort(r),noSet:a}}function f_(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const s=[];for(const l of e){const i=new Set,u=[];for(const c of l.cellLabels)r.has(c)&&!i.has(c)&&(i.add(c),u.push(c));u.length!==0&&s.push({id:l.id,name:l.name,kind:l.kind,covered:u,totalCells:l.cellLabels.length})}return s.sort((l,i)=>i.covered.length-l.covered.length||l.totalCells-i.totalCells||Cn(l.name,i.name)),s.slice(0,Math.max(0,a))}function b_(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function g_(e,t){const a=new Map;for(const s of e)for(const l of s.cells){const i=s.labelOf(l);a.has(i)||a.set(i,l)}const r=[];for(const s of t){const l=a.get(s);l!==void 0&&r.push(l)}return r}function ms(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,s)=>String(a[s]))}function y_(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),s=a%60;return t?t(r,s):r>0&&s>0?ms(Vt.t("customers.duration.minSec",{m:r,s,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s}):r>0?ms(Vt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):ms(Vt.t("customers.duration.sec",{s,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s})}function v_(e,t){const a=[],r=new Set;for(const s of e){const l=t(s);r.has(l)||(r.add(l),a.push({key:l,value:s,pinned:!1}))}return a}function __(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function x_(e,t){return e.filter(a=>a.key!==t)}function w_(e,t,a){const r=e.filter(d=>d.pinned),s=new Set(r.map(d=>d.key)),l=e.length-r.length,i=[],u=new Set(s);for(const d of t){if(i.length>=l)break;const h=a(d);u.has(h)||(u.add(h),i.push({key:h,value:d,pinned:!1}))}const c=[...i];return e.map(d=>d.pinned?d:c.shift()).filter(d=>d!==void 0)}function B_(e){return e.map(t=>t.value)}function k_(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},s=t?.key?` icon-grid-menu__button--${t.key}`:"",l=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${s}`,children:[n.jsx("button",{className:`icon-grid-menu__button${a?" icon-grid-menu__button--selected":""}`,"data-key":t?.key,type:"button",onClick:a?void 0:r,"aria-pressed":a,"aria-labelledby":l,children:n.jsx(at,{icon:t.icon,label:t.label,className:"icon-grid-menu__button-icon",imgClassName:"icon-grid-menu__button-icon-image",maskClassName:"icon-grid-menu__button-icon-mask",svgClassName:"icon-grid-menu__button-icon-svg"})}),n.jsx("span",{id:l,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function A_(e){const{categories:t=[],selected:a,onSelect:r,size:s="medium"}=e||{},l=a!==void 0,[i,u]=o.useState(()=>l?null:(t&&t[0]?.key)??null),c=l?a:i,d=o.useRef(r);o.useEffect(()=>{d.current=r});const h=o.useRef(!1),p=(t&&t[0]?.key)??null;o.useEffect(()=>{if(l||h.current||!p)return;h.current=!0;const g=i??p;i==null&&u(g),d.current?.(g)},[l,p]);const m=o.useCallback(g=>{const y=c===g?null:g;h.current=!0,l||u(y),r?.(y)},[c,l,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${s}`,children:(t||[]).map(g=>n.jsx(k_,{category:g,isSelected:c===g.key,onClick:()=>m(g.key)},g.key))})}function N_({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const s=r==="small"?32:40;return n.jsx("div",{className:`choice-chips choice-chips--${r}`,children:n.jsx("div",{className:"choice-chips__list",children:e.map(l=>n.jsx(be,{htmlType:"button",size:s,type:"bar",label:l.label,selected:t===l.key,className:"choice-chips__button",onClick:()=>a?.(l.key)},l.key))})})}function E_({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",s=a?.tel??"031-380-3724",{t:l}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:l("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
1038
1039
  \uC2E0\uB8B0\uB97C \uC313\uACE0
1039
1040
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`).split(`
1040
- `).map((i,u,c)=>n.jsxs(o.Fragment,{children:[i,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:l("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{e&&(i.preventDefault(),e())},children:l("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{t&&(i.preventDefault(),t())},children:l("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Lo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",s]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function E_({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:s,className:l,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),h=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,m]=o.useState(!1),g=o.useId(),y=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Zn(()=>{const v=document.getElementById(g);v&&v.contains(document.activeElement)&&y.current?.focus(),m(!1)}),b=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,w=v=>{v.matches&&m(!1)};return b&&(b.matches&&m(!1),b.addEventListener?.("change",w)),()=>{_(),b?.removeEventListener?.("change",w)}},[p,g]);const C=i?`${i} landing-header__inner`:"landing-header__inner",f=(_,b)=>u?u(_,{onClick:b}):n.jsx("a",{href:_.href,onClick:b,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:l?`landing-header ${l}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,b)=>n.jsx("span",{children:f(_)},`${b}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[s,r.length>0&&n.jsx("button",{ref:y,type:"button",onClick:()=>m(_=>!_),"aria-expanded":p,"aria-controls":g,"aria-label":p?h.close:h.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:g,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,b)=>n.jsx("span",{className:"landing-header__drawer-item",children:f(_,()=>m(!1))},`${b}:${_.href}`))})})]})}function D_({children:e,action:t,onClick:a,className:r}){const s=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:s,onClick:a,...ec(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function S_({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),s=o.useRef(null),l=o.useCallback(()=>{const C=t.current,f=C.phase!=="sound"&&C.at>0;s.current=f?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=s.current;return s.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,f,_=0)=>{if(!(C>0))return Promise.resolve(!0);const b=a.current;return t.current={phase:f,at:Date.now()-Math.max(0,_)},new Promise(w=>{const v=setTimeout(()=>{r.current===v&&(r.current=null),w(!!e.current&&b===a.current)},C);r.current=v})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),h=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),m=o.useCallback(()=>a.current,[]),g=o.useCallback(C=>C===a.current,[]),y=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:m,isCurrent:g,abort:u,waitPad:c,enterSound:d,leave:h,pause:l,resume:i,__bumpGenerationForTest:y}),[p,m,g,u,c,d,h,l,i,y])}const wa=9,j_=e=>Math.round(Math.min(wa,Math.max(0,e))/wa*100),T_=e=>e/100*wa,nr=2,Lc=.1,M_=e=>Math.min(nr,Math.max(0,e)),L_=.1,$_=e=>Math.round(e*1e6)/1e6;function ar(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return M_(t);const a=Math.min(wa,Math.max(0,Number(e.level)||0))/wa,r=Number(e.mainVolume);return r>0?a>0?$_(Math.min(nr,Math.max(L_,a/r))):0:1}const $c=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Rc(e){return $c(e)}function Cs(e){return $c(e)*ar(e)}function fs(e,t=z1()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,Cs(e)/a)}function ta(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=ar({level:a.level,mainVolume:a.mainVolume})),a}const na={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},bs=o.createContext(null);function Ar(){return o.useContext(bs)}const gs=e=>`${O1()}/${e}`,Pc=e=>Array.from({length:10},(t,a)=>gs(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),Nr={get defaultNoise(){return gs("noise1.mp3")},get street(){return Pc("noise2")},get restaurant(){return Pc("noise3")},get buzz(){return gs("noise4.mp3")}};function R_(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return Nr.defaultNoise;case"street":return Nr.street[t];case"restaurant":return Nr.restaurant[t];case"buzz":return Nr.buzz;default:return null}}function P_({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const s=o.useRef(e?.registerAnalyser);s.current=e?.registerAnalyser;const l=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),h=o.useRef(null),p=o.useRef(null),m=o.useRef(0),g=o.useRef(null),y=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),g.current!==null&&(clearTimeout(g.current),g.current=null)},[]),f=o.useCallback((A,x=250)=>{const E=l.current;if(!E)return;const B=d.current;if(B){d.current=null;try{E.pause()}catch{}E.src=B,E.load()}if(!E.src)return;m.current+=1,C();try{ao(),sr(E).then(P=>{if(l.current===E)try{s.current?.("noise",P)}catch{}})}catch{}const D=E.paused?0:lr(E);E.paused&&Hn(E,0),E.play().catch(()=>{});const N=performance.now(),k=()=>{const P=Math.min(1,(performance.now()-N)/x);try{Hn(E,D+(A-D)*P)}catch{}P<1?p.current=requestAnimationFrame(k):p.current=null};p.current=requestAnimationFrame(k)},[C]),_=o.useCallback((A=250,x)=>{const E=l.current;if(!E||E.paused){x?.();return}const B=++m.current;C();const D=performance.now(),N=lr(E),k=()=>{const P=Math.min(1,(performance.now()-D)/A);try{Hn(E,N*(1-P))}catch{}if(P<1)p.current=requestAnimationFrame(k);else{p.current=null,g.current!==null&&(clearTimeout(g.current),g.current=null);try{E.pause()}catch{}x?.()}};p.current=requestAnimationFrame(k),g.current=setTimeout(()=>{if(g.current=null,m.current===B){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{E.paused||(Hn(E,0),E.pause(),x?.())}catch{}}},A+150)},[C]);o.useEffect(()=>{const A=document.createElement("audio");return A.loop=!0,A.crossOrigin="anonymous",l.current=A,()=>{C();try{A.pause(),A.removeAttribute("src"),A.load()}catch{}l.current=null,c.current=null,d.current=null}},[C]);const b=e?fs(e.settings):0,w=!!e?.settings.enabled&&b>0;o.useEffect(()=>{if(!w)return;let A=0;const x=setInterval(()=>{const E=l.current;if(!E||E.paused){A=0;return}const B=t.current;if(B&&!B.paused&&!B.ended||y()||a.current==="playing"){A=0;return}A+=1,A>=2&&(A=0,_())},400);return()=>clearInterval(x)},[_,w,t,a,y]),o.useEffect(()=>{const A=()=>{const x=l.current;if(document.hidden){if(x&&!x.paused){C();try{x.pause()}catch{}}return}if(!x||!x.paused)return;const E=t.current,B=!!E&&!E.paused&&!E.ended||y()||a.current==="playing",D=h.current;B&&D?.enabled&&D.volume>0&&f(D.volume)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[C,f,t,a,y]),o.useEffect(()=>{h.current=e?{enabled:e.settings.enabled,volume:b,type:e.settings.type}:null},[e,e?.settings.enabled,b,e?.settings.type]);const v=o.useRef(null);return o.useEffect(()=>()=>{v.current?.(),v.current=null},[]),o.useEffect(()=>{const A=e?.settings,x=l.current;if(!x)return;const E=A?fs(A):0;if(!A||!A.enabled||E===0){_();return}if(c.current!==A.type){const B=R_(A.type);B&&(c.current=A.type,u(B),d.current=B,_(150,()=>{if(d.current!==B)return;d.current=null,x.src=B,x.load();const D=t.current;if(D&&!D.paused||y()){v.current?.();const N=()=>{x.removeEventListener("canplay",N),v.current===k&&(v.current=null);const P=t.current,$=h.current;(P&&!P.paused&&!P.ended||y())&&$?.enabled&&$.volume>0&&f($.volume)},k=()=>x.removeEventListener("canplay",N);v.current=k,x.addEventListener("canplay",N)}}))}else{const B=t.current,D=!!B&&!B.paused&&!B.ended||y()||a.current==="playing";if(D&&d.current)f(E);else if(D&&x.paused&&x.src)f(E);else if(!x.paused)if(!D)_();else{C();const N=lr(x),k=performance.now(),P=()=>{const $=Math.min(1,(performance.now()-k)/150);try{Hn(x,N+(E-N)*$)}catch{}$<1?p.current=requestAnimationFrame(P):p.current=null};p.current=requestAnimationFrame(P)}}},[e?.settings,e?.settings.enabled,b,e?.settings.type,C,f,_,t,a,h,y]),o.useEffect(()=>{const A=l.current;if(A)try{A.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:l,activeNoiseUrl:i,noiseSettingsRef:h,cancelNoiseFade:C,fadeInNoise:f,fadeOutNoise:_}}function F_({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:s,setProgress:l,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:h,onDoneRef:p,handleEndRef:m}){const g=o.useRef(null),y=o.useRef(0),C=o.useRef(null),f=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{f.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const b=(A,x=1)=>{try{const E=(A||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(A||"").length);return Math.max(700,Math.round(E*300/Math.max(.25,x)))}catch{return 1200}},w=o.useCallback(A=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const x=window.speechSynthesis,E=++f.current;try{try{x.cancel()}catch{}const B=A??e,D=Array.isArray(B)?B.filter(T=>!!T):[B||""];D.length===0&&D.push("");const N=Math.max(.3,Math.min(3,t));y.current=D.reduce((T,F)=>T+b(F,N||1),0),g.current=performance.now(),l(0),i("playing"),u("playMode");const k=h.current;k?.enabled&&(k?.volume??0)>0&&c(k.volume);const P=()=>{try{const T=g.current||performance.now(),F=performance.now()-T,M=y.current||1200,Q=Math.min(1,F/M);try{r.current&&(r.current.style.left=`${Q*100}%`),s.current&&s.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(P))}catch{}},$=()=>{if(E===f.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),l(1),i("stopped");try{m.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},G=T=>{const F=new SpeechSynthesisUtterance(D[T]);try{F.rate=N}catch{}try{F.volume=Math.max(0,Math.min(1,a))}catch{}F.onend=()=>{if(E===f.current){if(T<D.length-1){try{G(T+1)}catch{$()}return}$()}},F.onerror=()=>{$()},F.onstart=()=>{if(!(T>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(P)}catch{}},_.current=!0,x.speak(F)};try{G(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,s,l,i,u,h,p,m]),v=o.useCallback(()=>{f.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),g.current=null}catch{}i("stopped"),u("active"),l(0)},[d,i,u,l]);return{startTTS:w,stopTTS:v}}const I_=.01,O_=.3;async function z_(e,t,a,r=!1){let s=null;try{const l=window.AudioContext||window.webkitAudioContext;s=new l;const i=await s.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const g=Math.floor(O_*i.sampleRate),y=Math.min(u.length,g);for(;c<y&&Math.abs(u[c])<=I_;)c++;c>=y&&(c=0)}const d=u.length-c,h=a&&a>0?Math.min(d,Math.floor(a*i.sampleRate)):d,p=Math.max(t,h),m=Math.floor(p/t)||1;return new Array(t).fill(0).map((g,y)=>{const C=c+y*m,f=Math.min(C+m,c+p,u.length);let _=0;for(let b=C;b<f;b++){const w=Math.abs(u[b]);w>_&&(_=w)}return _})}catch{return null}finally{try{s?.close?.()}catch{}}}async function Fc(e,t,a,r=!1){try{const s=await fetch(e);if(s.ok===!1)return null;const l=await s.arrayBuffer();return await z_(l,t,a,r)}catch(s){try{const l=Ol(s)}catch{}return null}}const ys=45,W_=74,H_=2;function Er(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Dr(e){return Er(e)/45}const V_=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Ic=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Oc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Ic(t),s=Ic(a),l=[];let i=0;return e.forEach((u,c)=>{for(const[d,h]of[["lead",r],["sound",V_(u)],["tail",s]])l.push({kind:d,track:c,startMs:i,durMs:h}),i+=h}),{segments:l,totalMs:i,trackCount:e.length}}function zc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,s,l]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:s,tail:l,totalMs:r.durMs+s.durMs+l.durMs}}function q_(e,t){const a=zc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],s=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+s)/a.totalMs))}function U_(e,t,a){const r=Math.max(0,Math.floor(a)),s=zc(e,t);if(!s||r===0||!(s.totalMs>0)||s.lead.durMs===0&&s.tail.durMs===0||!(s.sound.durMs>0))return{lead:0,sound:r,tail:0};const l=Math.round(s.lead.durMs/s.totalMs*r),i=Math.round(s.tail.durMs/s.totalMs*r),u=Math.max(1,r-l-i),c=l+u+i-r;return{lead:Math.max(0,l-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function G_({currentTime:e,sources:t,index:a,audioDuration:r}){const s=a||0,l=Array.isArray(t)&&t.length>0?t[s]:void 0,i=l?l.duration||r||0:r||0;if(!(i>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/i))}function K_({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:s,tailMs:l}){const i=Oc({durationsSec:[r],leadInMs:s,tailMs:l});return q_(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Y_({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return U_(Oc({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function Z_(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function X_({ended:e,completedByEnd:t}){return!!e||!!t}function J_(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Q_(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function ex(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],s=[];for(const l of r)if(l){if(typeof l=="object"&&l!==null&&"src"in l&&l.src){const i=l;s.push({code:i.code??null,src:i.src});continue}if(typeof l=="string"&&(l.startsWith("http")||l.includes("/"))){s.push({code:null,src:l});continue}if(typeof l=="string"||typeof l=="number"){const i=String(l),u=a(i,t);u&&s.push({code:i,resolvedPath:u})}}return s}function tx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Wc(a)!==Wc(t):!0}function Wc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const Hc=4,nx=Dr(Hc/ys);function ax(e){const{src:t,segments:a,progress:r=0,waveProgressRef:s,noiseSrc:l,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:h,showSoundWaveForm:p=!0,leadInMs:m=0,tailMs:g=0,trackDurationSec:y=0}=e,C=o.useRef(null),f=o.useRef(null),[_,b]=o.useState(null),[w,v]=o.useState(!1),[A,x]=o.useState(null),[E,B]=o.useState(2),[D,N]=o.useState(0),[k,P]=o.useState(null),[$,G]=o.useState(!1),[T,F]=o.useState(!1),M=3,Q=3,Z=1,I=300,K=o.useRef(0),L=o.useCallback(()=>{const _e=C.current,he=f&&f.current?f.current:_e?_e.closest(".audio-player__wave"):null,je=he?he.getBoundingClientRect():_e?_e.getBoundingClientRect():null,$e=je?je.width:0,De=je?Math.max(100,je.width):320,le=je?je.height:0,we=Math.max(Z,Math.min(I,Math.floor((De+Q)/(M+Q)))),Le=we*M,Be=Math.max(0,we-1),ze=Math.max(0,Be>0?(De-Le)/Be:Q);return{bars:we,gap:ze,height:le,width:$e}},[]),W=o.useRef(void 0),Y=o.useRef(null),U=o.useCallback(async(_e,he,{quiet:je=!1}={})=>{const $e=++K.current,De=()=>K.current===$e;try{if(je||v(!1),W.current=_e,!_e){De()&&b(null);return}let le=he;if(!le)try{for(let Be=0;Be<4&&!(C.current||f.current);Be++)await new Promise(ze=>requestAnimationFrame(ze));await new Promise(Be=>requestAnimationFrame(Be));const Le=L();Le.height>0&&N(Le.height),le=Le.bars,B(Le.gap)}catch{le=120}Y.current=le;const we=await Fc(_e,le);if(!De())return;if(!we){b(null),v(!1);return}b(we),x(le),v(!0)}catch{if(!De())return;b(null),v(!1)}},[v,b,N,B,x,L]);o.useEffect(()=>{const _e=f.current;if(!_e||typeof ResizeObserver>"u")return;let he=null;const je=new ResizeObserver(()=>{he!==null&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;try{const $e=L();if($e.width<=0||($e.height>0&&N($e.height),Y.current===null||$e.bars===Y.current))return;const De=W.current;B($e.gap),De?U(De,$e.bars,{quiet:!0}).catch(()=>{}):Y.current=$e.bars}catch{}})});return je.observe(_e),()=>{je.disconnect(),he!==null&&cancelAnimationFrame(he)}},[L,U]),o.useEffect(()=>{const _e=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;U(typeof _e=="string"?_e:void 0).catch(()=>{}),F(!1)},[t,a,U]),o.useEffect(()=>{let _e=!1;if(G(!1),P(null),!l||!A)return;const he=c>0?c*(u||1):void 0;return Fc(l,A,he,!0).then(je=>{_e||(P(je),je||G(!0))}).catch(()=>{_e||(P(null),G(!0))}),()=>{_e=!0}},[l,A,c,u]);const j=Math.max(0,Math.min(1,d)),R=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),z=A||40,O=o.useMemo(()=>Y_({bars:z,trackDurationSec:y,leadInMs:m,tailMs:g}),[z,y,m,g]),ue=o.useMemo(()=>Array.from({length:z}).map((_e,he)=>{const je=he>=O.lead&&he<O.lead+O.sound,$e=O.sound>0&&je?Math.min(z-1,Math.round((he-O.lead)/O.sound*z)):-1,De=je?_&&_[$e]!=null?_[$e]:null:_?0:null,le=De==null?null:Math.min(1,De/R*j),we=le!=null&&D>0&&Er(le)<=Hc,Le=le==null?.15:we?0:Dr(le),Be=we,ze=z>1?he/(z-1):0;return n.jsx("div",{className:Be?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":Le,"--i":he,"--mix":ze}},he)}),[z,_,R,j,D,O]),te={"--progress":String(Math.max(0,Math.min(1,r)))},de=o.useMemo(()=>k&&k.length&&Math.max(...k.map(_e=>Number.isFinite(_e)?Math.abs(_e):0))||1,[k]),ee=j*Math.max(0,i),V=!l||!k||!k.length?1:Math.max(1,ee),ae={"--bar-gap":`${E}px`,"--wave-h":`${Er(V)}px`,"--wave-h1":`${ys}px`},H=w&&(l?!!k||$:!0);o.useEffect(()=>{H&&F(!0)},[H]);const q=T?w:H;o.useEffect(()=>{h?.(q)},[q,h]);const ie=A||40,Ne=o.useMemo(()=>Array.from({length:ie}).map((_e,he)=>{const je=k&&k[he]!=null?k[he]:null,$e=je==null?0:Math.abs(je)/de*ee,De=Math.max(nx,Dr($e)),le=ie>1?he/(ie-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":De,"--i":he,"--mix":le}},he)}),[ie,k,de,ee,D]);return n.jsxs("div",{className:"audio-player__wave",ref:f,style:ae,children:[l&&n.jsx("div",{className:`audio-player__wave-noise ${H?"is-ready":""}`,"aria-hidden":"true",children:Ne}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${q?"is-ready":""}`,ref:C,children:ue}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${q?"is-ready":""}`,ref:s,style:te,children:ue})]})]})}const Vc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function vs(e,t){return new Promise((a,r)=>{const s=document.createElement("audio");let l=!1;const i=()=>{try{s.removeAttribute("src"),s.load()}catch{}},u=()=>{if(l)return;l=!0;const d=isFinite(s.duration)&&s.duration||0;i(),a(d)},c=d=>{l||(l=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};s.addEventListener("loadedmetadata",u),s.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),s.src=e})}const rx=2e3;function qc(e,t=rx){return new Promise(a=>{let r=!1;const s=()=>{r||(r=!0,a())};e.addEventListener("canplay",s,{once:!0}),e.addEventListener("error",s,{once:!0}),setTimeout(s,t)})}function ox({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),s=o.useRef([]),l=o.useCallback(c=>{if(r.current=c,!c||!s.current.length)return;const d=s.current;s.current=[];for(const h of d)h(!0)},[]),i=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(h),s.current=s.current.filter(m=>m!==d),c(p)},h=setTimeout(()=>d(!0),a);s.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=s.current;s.current=[];for(const d of c)d(!1)},[]),{onReadyChange:l,waitForReady:u,markNotReady:i}}function sx(){const e=o.useRef([]),t=o.useCallback(s=>(e.current.push(s),s),[]),a=o.useCallback(s=>{const l=new Set([...s].filter(Boolean));e.current=e.current.filter(i=>{if(l.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const s of e.current)try{URL.revokeObjectURL(s)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function lx({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),s=o.useCallback(()=>r(null),[]),l=o.useCallback(()=>{try{const i=t.current?.getBoundingClientRect();if(!i)return;r({left:i.left,right:i.right,width:i.width,height:i.height,x:i.x,top:i.top+e,bottom:i.bottom+e,y:i.y+e,toJSON:i.toJSON.bind(i)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a,s]),{ref:t,rect:a,show:l,hide:s}}function ix(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const ux=400,cx=2e3,Uc=5;function dx({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:s,sequencer:l,leadInMs:i=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),h=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),m=o.useCallback(()=>{if(c.current!==null)return;let y=0;const C=()=>{if(On){const f=typeof performance<"u"&&performance.now?performance.now():Date.now();if(y>0&&f-y>ux){const _=h.current===null||f-h.current>cx;if(h.current=f,_&&d.current<Uc){d.current+=1;const b=d.current;let w=null;try{w=typeof document<"u"?document.visibilityState:null}catch{}Bt(`progress-ticker-slow-frames#${b}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(f-y)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,w==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",b>=Uc?`(${b}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${b}\uBC88\uC9F8)`)}}y=f}try{const f=e.current,_=Array.isArray(r.current)?r.current[s.current||0]:void 0,b=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,w=b?0:ix(f),v=t.current,A=(i||0)>0||(u||0)>0,x=A&&(l?.positionRef.current?.phase??"sound")!=="sound";if(w===null&&!x)try{v&&v.style.visibility!=="hidden"&&(v.style.visibility="hidden")}catch{}else{const E=b?_.duration:w||0;On&&x&&!(E>0)&&Bt("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const B=A?K_({phase:l?.positionRef.current?.phase??"sound",phaseElapsedMs:l?.positionRef.current?Math.max(0,Date.now()-l.positionRef.current.at):0,currentTime:f&&typeof f.currentTime=="number"?f.currentTime:0,trackDurationSec:E,leadInMs:i||0,tailMs:u||0}):G_({currentTime:f&&typeof f.currentTime=="number"?f.currentTime:0,sources:r.current,index:s.current,audioDuration:w??0});try{v&&(v.style.visibility&&(v.style.visibility=""),v.style.left=`${B*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(B))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,s,l,i,u]),g=o.useCallback(y=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${y*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(y))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:m,stop:p,settleTo:g}}function _s({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:s=!1,ttsText:l=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:h=0}){const{t:p}=xe.useTranslation(),m=e,g=Ar(),y=o.useRef(g?.registerAnalyser);o.useEffect(()=>{y.current=g?.registerAnalyser});const C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),b=sx(),w=o.useRef(null),v=o.useRef(!1),A=o.useRef(null),{ref:x,rect:E,show:B,hide:D}=lx();o.useEffect(()=>()=>{y.current?.("main",null),y.current?.("noise",null)},[]);const[N,k]=o.useState(!1),[P,$]=o.useState("idle"),[G,T]=o.useState("stopped"),F=o.useRef("stopped");o.useEffect(()=>{F.current=G},[G]);const[M,Q]=o.useState(0),[Z,I]=o.useState("active"),K=o.useRef(!1);o.useEffect(()=>{if(Z!=="playMode"||!K.current)return;K.current=!1;const X=typeof document<"u"?document.activeElement:null;if(X&&X!==document.body)return;const ce=_.current?.querySelectorAll("button")[1];try{ce?.focus()}catch{}},[Z]);const[L,W]=o.useState(null),[Y,U]=o.useState(null),[j,R]=o.useState(0),[z,O]=o.useState(!1),[ue,te]=o.useState(0),de=g?.playbackRate??1,ee=g?.mainVolume??1,V=g?Cs(g.settings):0,ae=g?Rc(g.settings):ee,[H,q]=o.useState("idle"),[ie,Ne]=o.useState(""),[_e]=o.useState("top"),he=o.useRef(null),je=o.useRef(0),$e=o.useRef(null),De=o.useRef(!0),le=S_({mountedRef:De}),we=o.useRef(null),Le=o.useRef(d),Be=o.useRef(h);o.useEffect(()=>{Le.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Be.current=Math.max(0,h||0)},[h]);const{start:ze,stop:Ve,settleTo:ut}=dx({audioRef:C,fillRef:f,waveProgressRef:$e,sourcesRef:he,currentIndexRef:je,sequencer:le,leadInMs:d,tailMs:h}),{onReadyChange:et,waitForReady:Xe,markNotReady:yt}=ox({showSoundWaveForm:u,showNoiseWaveForm:c}),Te=o.useRef(null),Ke=o.useRef(s),ke=o.useRef(r),qe=o.useRef(null),Je=o.useRef(!1),[tt,xt]=o.useState(!1),wt=o.useCallback(X=>{Je.current=X,xt(X)},[]),Dt=o.useRef(null),{activeNoiseUrl:rt,noiseSettingsRef:nt,fadeInNoise:kt,fadeOutNoise:At}=P_({noisePlayer:g,audioRef:C,playbackStateRef:F,sequencer:le}),{startTTS:Lt,stopTTS:jt}=F_({ttsText:l,playbackRate:de,mainVolume:ae,fillRef:f,waveProgressRef:$e,setProgress:Q,setPlaybackState:T,setStateLocal:I,fadeInNoise:kt,fadeOutNoise:At,noiseSettingsRef:nt,onDoneRef:ke,handleEndRef:Dt});o.useEffect(()=>{Pe.current=jt});const vt=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Ne(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}Lt(X);return}Nt("tts"),Lt(X)},ot=Array.isArray(t)?t.filter(Boolean):t?[t]:[],ct=(!ot||ot.length===0)&&!!l,dt=Array.isArray(L)&&L.length>0?L:Array.isArray(Y)&&Y.length>0?Y:null,_t=Math.max(Array.isArray(dt)?dt.length:0,ot.length);o.useEffect(()=>(De.current=!0,()=>{De.current=!1}),[]);const Ce=()=>{le.abort()},Pe=o.useRef(null),ye=o.useRef(null),Ye=o.useRef(null),bt=o.useRef(null);bt.current||(bt.current=()=>{Ye.current=null;const X=C.current;if(ye.current==="audio"&&X&&(!X.paused||le.isRunning())){Ce();try{X.pause()}catch{}De.current&&(T("paused"),Ve(),At())}else if(ye.current==="tts")try{Pe.current?.()}catch{}});const Nt=X=>{ye.current=X,Ye.current=Ga(bt.current)},mt=()=>{Ye.current?.(),Ye.current=null};o.useEffect(()=>()=>{bt.current&&yr(bt.current)},[]);const gt=o.useRef(de);o.useEffect(()=>{gt.current=de||1},[de]);const Me=o.useCallback(X=>{const ce=gt.current||1;try{X.defaultPlaybackRate=ce}catch{}try{X.playbackRate=ce}catch{}},[]),lt=o.useCallback((X,ce)=>{if(!tx(X,ce)){try{X.currentTime=0}catch{}Me(X);return}X.src=ce,Me(X),X.load(),Me(X)},[Me]),re=o.useCallback(()=>{qe.current&&(clearTimeout(qe.current),qe.current=null),q("idle")},[]),ve=o.useCallback(async(X,ce=3,Ee=50,He=0)=>{re();const Ge=le.generation(),Ze=!!X&&X.currentTime>0&&!X.ended,Ct=Math.max(0,Le.current-Math.max(0,He));if(Ct>0&&!Ze){Nt("audio"),ze(),T("playing");const ft=nt.current;if(ft?.enabled&&(ft.volume??0)>0)try{kt(ft.volume)}catch{}if(!await le.waitPad(Ct,"lead",He)||!De.current||!le.isCurrent(Ge))return!1}le.enterSound();for(let ft=0;ft<ce;ft++){if(!De.current||!le.isCurrent(Ge))return!1;try{return Nt("audio"),await X.play(),!0}catch(ge){if((ge instanceof Error||typeof ge=="object"&&ge&&"name"in ge?ge.name:void 0)==="AbortError"){if(!le.isCurrent(Ge))return!1;await new Promise(S=>setTimeout(S,Ee));continue}try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,ze,le,kt,nt,re]),Ie=o.useCallback(X=>{const ce=le.generation(),Ee=Math.max(0,Be.current-Math.max(0,X));ze();const He=nt.current;if(He?.enabled&&(He.volume??0)>0)try{kt(He.volume)}catch{}const Ge=()=>{try{we.current?.()}catch{}};if(Ee<=0){le.leave(),Ge();return}le.waitPad(Ee,"tail",X).then(Ze=>{le.leave(),Ze&&le.isCurrent(ce)&&Ge()}).catch(()=>{})},[le,ze,kt,nt]),We=o.useCallback(()=>{const X=C.current;if(!X)return;const ce=()=>{T("playing"),I("playMode"),O(!0),ze();try{ao(),sr(X).then(Ze=>{if(De.current)try{y.current?.("main",Ze)}catch{}})}catch{}const Ge=nt.current;Ge?.enabled&&(Ge?.volume??0)>0&&kt(Ge.volume)},Ee=()=>{X_({ended:!!X?.ended,completedByEnd:Je.current})||(T("paused"),Ve(),At())},He=()=>{const Ge=()=>{try{const Ze=he.current,Ct=Z_(Ze,je.current);if(Ct!==null){je.current=Ct,R(Ct),O(!0);const ft=Ze?.[Ct]&&Ze[Ct].src;if(ft&&X){lt(X,ft),ve(X).catch(()=>{});return}}}catch{}T("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}Ve(),O(!1),At();try{!Ke.current&&Dt.current&&Dt.current()}catch{}};if(we.current=Ge,Be.current>0){ze(),le.waitPad(Be.current,"tail").then(Ze=>{le.leave(),Ze&&Ge()}).catch(()=>{});return}Ge()};return X.addEventListener("play",ce),X.addEventListener("pause",Ee),X.addEventListener("ended",He),()=>{try{X.removeEventListener("play",ce),X.removeEventListener("pause",Ee),X.removeEventListener("ended",He),Ve()}catch{}}},[kt,At,ve,nt,ze,Ve,le]);o.useEffect(()=>We(),[We]),o.useEffect(()=>{Ke.current=s},[s]),o.useEffect(()=>{ke.current=r},[r]),o.useEffect(()=>{if(s||Z!=="active")return;const X=A.current;if(!X)return;let ce=null;const Ee=requestAnimationFrame(()=>{try{const He=X.getTotalLength();if(!He)return;const Ge=He*.2;X.style.strokeDasharray=`${He-Ge} ${Ge}`;const Ze="triFlow_"+Math.random().toString(36).slice(2);ce=document.createElement("style"),ce.textContent=`@keyframes ${Ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${He}}}`,document.head.appendChild(ce),X.style.animation=`${Ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(Ee),ce?.remove()}},[Z,s]),o.useEffect(()=>{he.current=L},[L]),o.useEffect(()=>{je.current=j},[j]),o.useEffect(()=>{const X=_.current,ce=w.current;if(!X||!ce)return;let Ee=null;const He=32,Ge=60,Ze=()=>{try{const ft=Array.from(X.querySelectorAll(":scope > .button"));let ge=0;ft.forEach(fe=>{if(fe===ce)return;const Fe=fe.getBoundingClientRect();ge+=Fe.width});const S=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(S-ge-8)),me=_t;if(!me||J<=0){Array.from(ce.children).forEach(fe=>{try{fe.style.width=""}catch{}});return}let ne=Math.floor(J/me);ne>Ge&&(ne=Ge),ne<He&&(ne=Math.max(He,Math.floor(J/me))),Array.from(ce.querySelectorAll(".button")).forEach(fe=>{try{fe.style.width=`${ne}px`}catch{}})}catch{}},Ct=requestAnimationFrame(Ze);try{Ee=new ResizeObserver(()=>{requestAnimationFrame(Ze)}),Ee.observe(X),Ee.observe(ce),window.addEventListener("resize",Ze)}catch{}return()=>{try{cancelAnimationFrame(Ct)}catch{}try{Ee&&(Ee.disconnect(),Ee=null)}catch{}try{window.removeEventListener("resize",Ze)}catch{}}},[L,Y,_t]),o.useEffect(()=>()=>{try{Te.current&&(clearTimeout(Te.current),Te.current=null),qe.current&&(clearTimeout(qe.current),qe.current=null)}catch{}},[]);const Qe=(X,ce)=>{W(X),te(ce),yt(),U(J_(X)),he.current=X},st=()=>{I("playMode"),R(0),O(!0)},Tt=async(X,ce)=>{wt(!1),v.current=!1,lt(X,ce),await qc(X),await Xe()!==!1&&(k(!1),st(),await ve(X))},ln=async(X,ce=!1)=>{const Ee=C.current;k(!0),$("measuring_duration");try{const He=await vs(X,{timeoutMs:1e4,rejectOnError:!0});Qe([{src:X,objectUrl:null,duration:He}],He),$("ready"),ce&&Ee&&await Tt(Ee,X)}finally{v.current=!1,k(!1)}},un=async(X,ce=!1)=>{const Ee=C.current;k(!0),$("measuring_duration");try{const He=await Promise.all(X.map(Ze=>vs(Ze,{timeoutMs:1e4})));if(!De.current)return;const Ge=X.map((Ze,Ct)=>({src:Ze,objectUrl:null,duration:He[Ct]||0}));Qe(Ge,Q_(Ge)),$("ready"),ce&&Ee&&Ge.length>0&&await Tt(Ee,Ge[0].src)}finally{v.current=!1,k(!1)}},$t=async(X=!1,ce=!0)=>{const Ee=C.current,He=t?Array.isArray(t)?t:[t]:[];if(!He||He.length===0||!He.some(Boolean))return!1;if(v.current)return null;v.current=!0,ce&&k(!0),$("resolving");try{const Ge=ex(t,a,Bl),Ze=[];let Ct=0;for(const ft of Ge){let ge=ft.src??null,S=null;if(!ge&&ft.resolvedPath){try{$("getting_signed_url"),ge=await kl(ft.resolvedPath)}catch{ge=null}if(!De.current)return!1;if(!ge)try{$("downloading");const me=await Al(ft.resolvedPath);if(!De.current)return!1;if(me){const ne=me instanceof Blob?me:new Blob([me]);S=b.track(URL.createObjectURL(ne)),ge=S}}catch{$("error");try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),I("active")}catch{}}}if(!ge)continue;let J=0;try{$("measuring_duration"),J=await vs(ge,{timeoutMs:3e3})}catch{J=0}if(!De.current){if(S)try{URL.revokeObjectURL(S)}catch{}for(const me of Ze)if(me.objectUrl)try{URL.revokeObjectURL(me.objectUrl)}catch{}return!1}Ct+=J||0,Ze.push({...ft,src:ge,objectUrl:S,duration:J})}if(Qe(Ze,Ct),Ze.length>0&&X&&Ee){const ft=Ze[0];wt(!1);try{b.keepOnly(Ze.map(ge=>ge.objectUrl))}catch{}if($("ready"),v.current=!1,ft.src&&Ee)try{if(lt(Ee,ft.src),await qc(Ee),await Xe()===!1)return!1;ce&&k(!1),st(),Ee&&await ve(Ee)}catch{ce&&k(!1)}else ce&&k(!1);I("playMode"),R(0),O(!0)}return Ze.length>0}finally{v.current=!1,ce&&k(!1),$(Ge=>Ge==="ready"?"ready":"idle")}},Ot=async X=>{const ce=le.isRunning();if(X.paused&&!ce){if(Je.current){await Pt();return}const Ee=le.resume();if(Ee){if(T("playing"),Ee.phase==="tail"){Ie(Ee.elapsed);return}await ve(X,3,50,Ee.elapsed);return}await ve(X),T("playing")}else le.pause(),Ce(),X.pause(),T("paused"),ce&&(Ve(),At())},cn=async()=>{const X=C.current;if(!(!X&&!ct)){if(ct){const ce=window.speechSynthesis;if(Z==="active"){const Ee=Sa(),He=Array.isArray(l)?l.filter(Boolean):l?[l]:[];if(Ee&&He.length>0){if(v.current)return;I("load"),k(!0),$("synthesizing"),v.current=!0;try{const Ge=await Promise.all(He.map(Ze=>Promise.resolve(Ee(Ze))));Ge.length>1?await un(Ge,!0):await ln(Ge[0],!0)}catch{v.current=!1,k(!1),I("active"),vt(He.length>0?He:void 0)}return}vt(He.length>0?He:void 0);return}if(Z==="playMode"){const Ee=!!ce&&(ce.speaking||ce.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!Ee){await Ot(X);return}try{if(ce&&ce.paused)try{Nt("tts"),ce.resume(),T("playing")}catch{}else try{ce.pause(),T("paused")}catch{}}catch{}}return}if(Z==="active"){if(s&&Array.isArray(he.current)&&he.current.length>0){const Ee=he.current[0];try{if(Ee.src&&X)try{lt(X,Ee.src),st(),X&&await ve(X)}catch{}st();return}catch{}}I("load");let ce;try{ce=await $t(!0)}catch{ce=!1}if(ce===!1&&De.current){try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}I("active")}return}if(Z!=="load"&&(Z==="playMode"||Z==="active"))try{X&&await Ot(X)}catch(ce){(ce instanceof Error||typeof ce=="object"&&ce&&"name"in ce)&&ce.name}}},Pt=async()=>{const X=C.current;if(X)try{const ce=he.current;if(Array.isArray(ce)&&ce.length>1){await bn(0);return}wt(!1);try{X.currentTime=0}catch{}X&&await ve(X),T("playing"),I("playMode")}catch{}},kn=()=>{Ce(),mt(),Pe.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}At(),T("stopped"),I("active"),Q(0),O(!1)},Jt=async(X,{sameSegment:ce=!1}={})=>{Ce();const Ee=le.generation(),He=C.current,Ge=he.current?.[X]?.src;try{if(wt(!1),R(X),O(!0),je.current=X,!Ge||!He||(ce||yt(),lt(He,Ge),!ce&&await Xe()===!1)||!le.isCurrent(Ee)||(await ve(He),!le.isCurrent(Ee)))return;T("playing"),I("playMode")}catch{}},St=async()=>{const X=he.current,ce=je.current||0;if(!X||ce<=0){await Pt();return}await Jt(ce-1)},Rt=async()=>{const X=he.current,ce=je.current||0;if(!X||ce>=X.length-1){kn();return}await Jt(ce+1)},Wt=()=>{if(Je.current)return;const X=200,ce=340;wt(!0),Ce(),mt();try{Q(1)}catch{}ut(1);try{q("hold")}catch{}try{const Ee=C.current,He=ct&&!!Ee?.src;if(!ct||He){if(Ee){Ee.pause();try{Ee.currentTime=0}catch{}}}else jt();At()}catch{}try{T("stopped")}catch{}if(O(!1),!Ke.current)try{qe.current&&(clearTimeout(qe.current),qe.current=null),qe.current=setTimeout(()=>{try{q("out")}catch{}qe.current=setTimeout(()=>{try{typeof ke.current=="function"&&ke.current(!0)}catch{}try{q("idle")}catch{}qe.current=null},ce)},X)}catch{}};o.useEffect(()=>{Dt.current=Wt});const Kt=o.useCallback(()=>Ne(""),[]),bn=async X=>{(he.current||[])[X]&&await Jt(X,{sameSegment:X===je.current})},Ut=G==="playing",Qt=o.useMemo(()=>{if(!Y||Y.length<=1)return Y;const X=Y[j];return X?[X]:Y},[Y,j]),dn=s===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Me(X)}catch{}},[de,Me]);const gn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ce=Math.max(0,Math.min(1,ae)),Ee=gn.current,He=()=>{Ee.raf!==null&&(cancelAnimationFrame(Ee.raf),Ee.raf=null),Ee.timer!==null&&(clearTimeout(Ee.timer),Ee.timer=null)};He();const Ge=lr(X);if(X.paused||Math.abs(Ge-ce)<.001||typeof requestAnimationFrame!="function"){try{Hn(X,ce)}catch{}return}const Ze=performance.now(),Ct=()=>{const ft=Math.min(1,(performance.now()-Ze)/150);try{Hn(X,Ge+(ce-Ge)*ft)}catch{}Ee.raf=ft<1?requestAnimationFrame(Ct):null};return Ee.raf=requestAnimationFrame(Ct),Ee.timer=setTimeout(()=>{He();try{Hn(X,ce)}catch{}},200),He},[ae]);const Ht=H==="hold",An=H==="out",pe=Z==="playMode"&&!N&&!tt||Ht||An,Se=G!=="stopped"||Ht||An,Re=G==="paused",Ue=Math.max(0,Math.min(100,(M||0)*100)),Oe=Ae("audio-player__fill",pe?"is-visible":"",Se?"is-expanded":"",Re?"is-paused":"",An?"is-out":"");return n.jsxs("div",{className:`audio-player ${dn?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof m=="string"?m:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${Ut?"is-playing":""} ${N?"is-loading":""} ${Z!=="default"?"is-revealed":""}`,children:[N?n.jsxs("div",{className:"audio-player__loading",role:Vc[P]?"status":void 0,"aria-live":Vc[P]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p("training.audioStatus.preparing",{defaultValue:"\uC18C\uB9AC\uB97C \uC900\uBE44\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026"})})]}):null,Z==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:dn,onClick:()=>{K.current=_r(),D(),cn()},"aria-label":typeof m=="string"?m:p("training.listen","\uB4E3\uAE30"),onMouseEnter:B,onMouseLeave:D,onFocus:B,onBlur:D,children:n.jsx("span",{ref:x,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:A,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,E&&n.jsx(Tn,{anchorRect:E,text:typeof m=="string"&&m?m:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${Z==="playMode"||Ut?"is-visible":""}`,inert:!(Z==="playMode"||Ut)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:St,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:Ut?"pause":"play",onClick:cn,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":Ut,width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:kn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:Z!=="playMode"}),_t>1?n.jsx("div",{ref:w,className:"audio-player__source-buttons",children:Array.from({length:_t}).map((X,ce)=>n.jsx(be,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ce+1),onClick:()=>{try{bn(ce)}catch{}},ariaLabel:p("training.sourcePlay",{n:ce+1}),variant:"transparent-white",selected:z&&j===ce,disabled:Z!=="playMode"||!(Array.isArray(L)&&L[ce]),showTooltipInfo:!0},ce))}):null,!Array.isArray(L)||L.length<=1?n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Pt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}):null,n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Rt,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:Wt,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:Z!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Oe,ref:f,style:{left:`${Ue}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(ax,{segments:Qt,progress:M,totalDuration:ue,waveProgressRef:$e,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:L?.[j]?.duration??0,noiseSrc:c&&g?.settings.enabled&&V>0?rt:null,noiseRatio:g?ar(g.settings):0,noiseSpeed:g?.settings.speed??1,mainVolume:ee,onReadyChange:et})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(at,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(ya,{message:ie,position:_e,onClose:Kt})]})}function Sr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:s=null,onClose:l,closeOnOutsideClick:i=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:h,decrease:p,canIncrease:m,canDecrease:g,fontSize:y,lineHeight:C}=Ii({storageKey:"tooltip-fontScale"}),f=o.useCallback(()=>d(A=>A==="dark"?"light":"dark"),[]),_=o.useCallback(A=>{try{A.stopPropagation()}catch{}try{typeof l=="function"&&l()}catch{}},[l]),b=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],w={fontSize:`${y}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},v=n.jsxs("div",{className:se(`text-box-tooltip__root ${c==="dark"?"is-dark":""}`),children:[n.jsxs("div",{className:se("text-box-tooltip__box"),children:[r&&n.jsx("div",{className:se("text-box-tooltip__label body-2b"),children:r}),n.jsx("div",{className:se("text-box-tooltip__text body-1"),style:w,children:b.map((A,x)=>n.jsxs("div",{className:se("text-box-tooltip__line"),children:[b.length>1?n.jsx("div",{className:se("text-box-tooltip__marker"),children:n.jsx("span",{className:se("text-box-tooltip__line-number button-1"),children:x+1})}):null,n.jsx("span",{className:se("text-box-tooltip__line-text"),children:A})]},x))})]}),n.jsxs("div",{className:se("text-box-tooltip__buttons"),children:[n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!g}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:h,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!m}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:f,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return s?n.jsx(wn,{anchorRect:s,className:se(`text-box-tooltip ${c==="dark"?"is-dark":""}`),onClose:l,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:v}):n.jsx("div",{className:se(`text-box-tooltip ${c==="dark"?"is-dark":""}`),children:v})}function Gc({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(at,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Kc(e,t,a){const r=o.useRef(t),s=o.useRef(a);o.useEffect(()=>{r.current=t,s.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let l=null,i=10;const u=()=>{l=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(Nn)).find(h=>!h.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(l=requestAnimationFrame(u))};return l=requestAnimationFrame(u),()=>{l!==null&&cancelAnimationFrame(l);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip__content")){const d=s.current();if(d)try{d.focus()}catch{}}}},[e])}function Yc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:s=!1,onPreviewTextBtn:l,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:h=!1}){const{t:p}=xe.useTranslation(),m=yn("(max-width: 767px)"),g=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),y=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[f,_]=o.useState(!1),[b,w]=o.useState(null),[v,A]=o.useState(null);Kc(f&&!!b,()=>{if(typeof document>"u")return null;const N=Array.from(document.querySelectorAll(".tooltip__content"));for(let k=N.length-1;k>=0;k--)if(N[k].querySelector(".text-box-tooltip__root"))return N[k];return null},()=>C.current?.querySelector("button")??null);const x=o.useRef(l);o.useEffect(()=>{x.current=l});const E=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(N=>typeof N=="string"||typeof N=="number")?i.join(""):"",[i]),B=o.useCallback(()=>{_(!1),w(null),A(null)},[]);o.useEffect(()=>{if(!f)return;let N;try{typeof x.current=="function"&&(N=x.current())}catch{}if(N===!1){B();return}A(typeof N<"u"&&N!==null?N:null)},[E]);const D=o.useCallback(()=>{let N;try{typeof l=="function"&&(N=l())}catch{}if(N!==!1){if(A(typeof N<"u"&&N!==null?N:i),!C.current){_(k=>!k);return}if(f)_(!1),w(null),A(null);else{const k=C.current.getBoundingClientRect();w(k),_(!0)}}},[l,i,f]);return n.jsxs("div",{className:y,children:[n.jsx("p",{className:g,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),s||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(be,{htmlType:"button",size:32,type:m?"dot":"bar",icon:"play-circle",label:m?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:h,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||h,onDisabledClick:h&&r!=="disabled"?()=>{}:void 0}),s&&n.jsx("div",{ref:C,children:n.jsx(be,{htmlType:"button",size:32,type:m?"dot":"bar",icon:"eye",label:m?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:D,className:f?"is-selected":void 0,"aria-expanded":f,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof l!="function"})})]}),f&&n.jsx(Sr,{text:v??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:b,onClose:B,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function xs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function aa({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:s={},children:l,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:h}=xe.useTranslation(),[p,m]=o.useState(()=>xs(e,t));o.useEffect(()=>{const x=xs(e,t);if(x!==p){const E=setTimeout(()=>m(x),0);return()=>clearTimeout(E)}},[e,t,p]);const g=o.useCallback((...x)=>{xs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...x)},[e,t,p,u]),[y,C]=o.useState(!1),[f,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),b=o.useCallback(x=>{if(!x)return null;try{const E=x;if(typeof x=="object"&&(E.currentTarget||E.target)&&(E.nativeEvent||E.type)){const N=E.currentTarget??E.target;if(N&&typeof N.getBoundingClientRect=="function")return N.getBoundingClientRect()}if(x instanceof DOMRect)return x;const B=x;if(B&&typeof B.getBoundingClientRect=="function")return B.getBoundingClientRect();const D=x?.current;return D&&typeof D.getBoundingClientRect=="function"?D.getBoundingClientRect():null}catch{return null}},[]),w=o.useCallback((x,{text:E="",label:B="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:D=!1,alignX:N="center",alignY:k="top"}={})=>{const P=b(x);_({text:E,label:B,anchorRect:P,backdrop:D,alignX:N,alignY:k}),C(!0)},[b]),v=o.useCallback(()=>{C(!1),_(x=>({...x,anchorRect:null}))},[]),A=o.Children.map(l,x=>{if(o.isValidElement(x)){const E=x;if(typeof E.type=="string")return E;const B=E.props??{},D=typeof B.onDone=="function"?B.onDone:g,N=typeof B.disabled=="boolean";let k=p==="disabled";return N&&(k=!!B.disabled),o.cloneElement(E,{onDone:D,disabled:k,showTooltip:w,hideTooltip:v})}return x});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx(Gc,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Yc,{state:p,title:r,...s,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),A]}),y?n.jsx(wn,{anchorRect:f.anchorRect,backdrop:f.backdrop,onClose:v,ariaLabel:h("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(Sr,{text:f.text,onClose:v})}):null]})}function Zc({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[s,l]=o.useState("disabled"),[i,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",i)}catch{}},[i]);const c=()=>u($=>$==="dark"?"light":"dark"),{increase:d,decrease:h,canIncrease:p,canDecrease:m,fontSize:g,lineHeight:y}=Ii({storageKey:"textbox_fontScale"}),[C,f]=o.useState(""),_=o.useRef(null),b=o.useRef(!1),w=o.useCallback(()=>{b.current=_r()&&!!_.current&&_.current.contains(document.activeElement),l("active")},[]),v=o.useCallback(()=>f(""),[]),A=$=>{try{f($)}catch{}},x=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const $=setTimeout(()=>l(t),0);return()=>clearTimeout($)}},[t]);const E=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[B,D]=o.useState(E);B!==E&&(D(E),l("disabled"));const N=t==="disabled"?s:t,k=N==="disabled"?"training-text-box--disabled":N==="active"?"training-text-box--active":N==="done"?"training-text-box--done":"",P=o.useMemo(()=>({fontSize:`${g}px`,lineHeight:`${y}px`}),[g,y]);return o.useEffect(()=>{if(N==="disabled"||!b.current)return;b.current=!1;const $=document.activeElement;$&&$!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[N]),n.jsxs("div",{ref:_,className:`training-text-box ${k} ${N!=="disabled"&&i==="dark"?"is-dark":""}`,children:[N==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(be,{htmlType:"button",size:48,type:"bar",onClick:w,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":N==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:P,children:E})}),N!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":N==="disabled",children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:h,onDisabledClick:()=>A(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!m,useBorder:!1,showTooltipInfo:!0,...!x&&{width:"60px"}}),n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>A(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!x&&{width:"60px"}}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:i==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:i==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(ya,{message:C,position:"top",onClose:v})]})}function ra(e){return e==="active"||e==="done"}function ws({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,useTitleFaded:l,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:h,multiSelect:p=!1,correctCount:m=0,useDisabledCovered:g=!1,choiceIcons:y,shuffleChoices:C=!0}){const{t:f}=xe.useTranslation(),_=s??f("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),b=typeof e=="number"?e:-1,w=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",v=Array.isArray(h)&&h.length?h:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,A=d?d.join("||"):"",x=h?h.join("||"):"",[E,B]=o.useState(()=>Array.isArray(v)?C?$a(v):v.slice():void 0);o.useEffect(()=>{Array.isArray(v)&&v.length?B(C?$a(v):v.slice()):B(void 0)},[c,A,x,C]);const[D,N]=o.useState(null),[k,P]=o.useState(()=>new Set);o.useEffect(()=>{N(null),P(new Set)},[x,c,A]);const $=o.useRef(void 0);o.useEffect(()=>{const F=$.current;typeof F=="number"&&typeof t=="number"&&typeof e=="number"&&F>=e&&t<e&&(N(null),P(new Set)),$.current=t},[t,e]);const G=o.useCallback(F=>{if(!ra(w))return;const M=E?.[F];if(M==null)return;const Q=M;if(p){const Z=new Set(k);Z.has(Q)?Z.delete(Q):Z.add(Q),P(Z),typeof u=="function"&&u({selectedValues:[...Z],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...Z],__ts:Date.now()})}else N(Q),typeof u=="function"&&u({selectedIndex:F,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:F,selectedValue:Q,__ts:Date.now()})},[E,w,p,u,k]),T=`training-step__buttons${Array.isArray(E)&&E.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:l,children:n.jsx("div",{className:T,children:Array.isArray(E)&&E.length>0?E.map((F,M)=>n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:()=>G(M),ariaLabel:String(F),label:F,useLabel:!0,icon:y?y[String(F)]:void 0,variant:"default",disabled:w==="disabled",selected:p?k.has(F):D===F,useDisabledCovered:g,minWidth:0},String(F))):null})})}function Bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),h=s??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",g=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",y=u&&typeof u=="object"?u.choices:void 0,[C,f]=o.useState(c??null),_=`${String(g)}\0${JSON.stringify(y??null)}`,[b,w]=o.useState(_);b!==_&&(w(_),c==null&&f(null));const[v,A]=o.useState(c);Object.is(v,c)||(A(c),f(c??null));const x=o.useRef(void 0);o.useEffect(()=>{const N=x.current;typeof N=="number"&&typeof t=="number"&&typeof e=="number"&&N>=e&&t<e&&c==null&&f(null),x.current=t},[t,e,c]);const E=o.useCallback(N=>{const k=typeof N=="object"&&N!==null?Object.assign({},N,{__ts:Date.now()}):{value:N,__ts:Date.now()};typeof i=="function"&&i(k),ra(m)&&typeof l=="function"&&l(k)},[i,m,l]),B=o.useCallback(()=>{ra(m)&&(f(!1),E(!1))},[E,m]),D=o.useCallback(()=>{ra(m)&&(f(!0),E(!0))},[E,m]);return n.jsxs(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:h,onDone:l,useTitleFaded:!1,children:[n.jsx(Zc,{context:u,state:m}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(y)&&y.length>0?y.slice(0,6).map((N,k)=>n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:()=>{ra(m)&&(f(k),E&&E(k))},disabled:m==="disabled",ariaLabel:String(N),label:N,variant:m,selected:C===k},k)):n.jsxs(n.Fragment,{children:[n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:B,disabled:m==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:D,disabled:m==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function ks({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:s,btnLabel:l,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:h,disabled:p,_pageIndex:m,showSoundWaveForm:g,showNoiseWaveForm:y,leadInMs:C,tailMs:f}){const{t:_}=xe.useTranslation(),b=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),w=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,title:b,onDone:s,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:h},children:n.jsx(_s,{soundSrc:i,ttsText:i?null:d??b,bucketPath:u,btnLabel:l||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:w,className:"training-step__listen-sticky",showSoundWaveForm:g,showNoiseWaveForm:y,leadInMs:C,tailMs:f},`audio-p${m??0}-s${e}`)})}const px=[];function As({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u=px}){const{t:c}=xe.useTranslation(),d=s??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),h=U=>typeof U=="string"?U:U&&(U.context||U.sentence||U.question||"")||"",[p,m]=o.useState(Array.isArray(u)?u:[]),[g,y]=o.useState(()=>(p||[]).map((U,j)=>({id:j,text:h(U)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),f=C!=="disabled",_=o.useRef(void 0),b=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const U=Array.isArray(u)?u:[];m(U);const j=(R=>{const z=(R||[]).map((de,ee)=>({id:ee,text:h(de)}));if(z.length<=1)return z;const O=(de,ee)=>{if(de.length!==ee.length)return!1;for(let V=0;V<de.length;V++)if(de[V].text!==ee[V].text)return!1;return!0};let ue=$a(z),te=0;for(;O(ue,z)&&te<20;)ue=$a(z),te+=1;return ue})(U);y(j);try{if(typeof i=="function"){const R=j.filter((z,O)=>z.text===h(U[O])).length;i({shuffled:j,score:R,total:(U||[]).length,initial:!0,__ts:Date.now()})}if(typeof l=="function"&&C==="active"){const R=j.filter((z,O)=>z.text===h(U[O])).length;b.current=u,l({shuffled:j,score:R,total:(U||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||b.current===u||(b.current=u,typeof l!="function"))return;const U=Array.isArray(u)?u:[],j=g.filter((R,z)=>R.text===h(U[z])).length;l({shuffled:g,score:j,total:U.length,initial:!0,__ts:Date.now()})},[C,u]);const w=(U,j)=>{const R=[...g],z=U+j;if(z<0||z>=R.length)return;const O=R[z];R[z]=R[U],R[U]=O,Q(R);try{if(typeof l=="function"&&C==="active"){const ue=R.filter((te,de)=>te.text===h(p[de])).length;l({shuffled:R,score:ue,total:(p||[]).length,__ts:Date.now()})}}catch{}},[v,A]=o.useState(null),x=o.useRef(null),E=o.useRef(null),B=o.useRef(null),D=o.useRef(null),N=o.useRef(null),k=o.useRef({x:0,y:0}),P=o.useRef(null),$=o.useRef({dx:0,dy:0}),G=()=>{if(P.current!==null)return;const U=()=>{if(!x.current){P.current=null;return}P.current=requestAnimationFrame(U);const j=k.current,R=$.current||{dx:0,dy:0};x.current&&(x.current.style.transform=`translate3d(${j.x-R.dx}px, ${j.y-R.dy}px, 0)`)};P.current=requestAnimationFrame(U)},T=o.useRef(new Map),F=o.useRef(new Map),M=()=>{const U=new Map;return T.current.forEach((j,R)=>{j&&j.getBoundingClientRect&&U.set(R,j.getBoundingClientRect())}),U},Q=U=>{const j=M();y(U);try{if(typeof i=="function"){const R=U.filter((z,O)=>z.text===h(p[O])).length;i({shuffled:U,score:R,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const R=M();U.forEach(z=>{const O=j.get(z.id),ue=R.get(z.id),te=T.current.get(z.id);if(!te||!O||!ue)return;const de=O.top-ue.top;de&&(te.style.transition="none",te.style.transform=`translateY(${de}px)`,requestAnimationFrame(()=>{te.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",te.style.transform="";const ee=()=>{te.style.transition="",te.removeEventListener("transitionend",ee)};te.addEventListener("transitionend",ee)}))})})},Z=(U,j)=>{try{try{j.dataTransfer?.setData("text/plain",String(U))}catch{}try{j.dataTransfer&&(j.dataTransfer.effectAllowed="move")}catch{}try{const R=document.createElement("div");R.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(R),j.dataTransfer?.setDragImage(R,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(R)}catch{}})}catch{}}catch{}A(U);try{const R=g[U],z=document.createElement("div");z.className="order-list__dragging-object order-list__dragging-object--visible",z.textContent=R&&R.text?R.text:"",document.body.appendChild(z),x.current=z;const O=T.current.get(R.id);let ue=j.clientX||0,te=j.clientY||0;try{if(O&&O.getBoundingClientRect){const q=O.getBoundingClientRect();ue=q.left+q.width/2,te=q.top+q.height/2}}catch{}const de=z.getBoundingClientRect(),ee=de.width/2,V=de.height/2;$.current={dx:ee,dy:V},z.style.transition="none",k.current={x:ue,y:te},z.style.transform=`translate3d(${ue-ee}px, ${te-V}px, 0)`,requestAnimationFrame(()=>{try{z.style.transition=""}catch{}G()});const ae=q=>{const ie=q;k.current={x:ie.clientX,y:ie.clientY},G()};B.current=ae,document.addEventListener("mousemove",ae);const H=q=>{const ie=q;k.current={x:ie.clientX,y:ie.clientY},G()};E.current=H,document.addEventListener("dragover",H);try{j.dataTransfer?.setData("text/plain",String(U));try{j.dataTransfer?.setData("application/json",JSON.stringify({idx:U}))}catch{}}catch{}}catch{}},I=(U,j)=>{j.preventDefault();try{j.dataTransfer&&(j.dataTransfer.dropEffect="move")}catch{}try{N.current!==null&&(clearTimeout(N.current),N.current=null);const R=j.currentTarget&&j.currentTarget.closest?j.currentTarget.closest(".order-list__item"):null;if(R&&D.current!==R){if(D.current)try{D.current.classList.remove("drag-over")}catch{}try{R.classList.add("drag-over")}catch{}D.current=R}}catch{}},K=(U,j)=>{j.preventDefault();const R=j.dataTransfer?.getData("text/plain")||"",z=R?parseInt(R,10):v,O=U;if(typeof z!="number"||isNaN(z)||z===O){A(null),Y(),L();return}const ue=Nf(g,z,O);Q(ue),A(null),L();try{if(typeof l=="function"&&C==="active"){const te=ue.filter((de,ee)=>de.text===h(p[ee])).length;l({shuffled:ue,score:te,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const te=document.querySelectorAll(".order-list .order-list__item")[O];if(!te)return;const de=te.querySelector(".order-list__slot")||te;try{de.classList.add("pulse"),de.offsetHeight,de.classList.add("to-dark");const ee=()=>{de.classList.remove("pulse","to-dark"),de.removeEventListener("transitionend",ee)};de.addEventListener("transitionend",ee)}catch{}})}catch{}Y()},L=()=>{if(x.current){try{document.body.removeChild(x.current)}catch{}x.current=null}E.current&&(document.removeEventListener("dragover",E.current),E.current=null),B.current&&(document.removeEventListener("mousemove",B.current),B.current=null),P.current!==null&&(cancelAnimationFrame(P.current),P.current=null)},W=()=>{A(null),Y(),L()};o.useEffect(()=>()=>L(),[]);const Y=()=>{try{if(N.current!==null&&(clearTimeout(N.current),N.current=null),D.current){try{D.current.classList.remove("drag-over")}catch{}D.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(U=>U.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const U=Math.max(1,(g||[]).length);g.forEach((j,R)=>{const z=F.current.get(j.id);if(!z)return;let O=50;U>1&&(O=Math.round(R/(U-1)*100));try{z.style.setProperty("--marker-pos",O+"%")}catch{}})}catch{}},[g]),o.useEffect(()=>()=>{L(),N.current!==null&&(clearTimeout(N.current),N.current=null)},[]),n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:g.map((U,j)=>{const R=Math.max(1,(g||[]).length),z=R>1?Math.round(j/(R-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":z+"%"},ref:O=>{const ue=F.current;O?ue.set(U.id,O):ue.delete(U.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:j+1})}):null,n.jsxs("div",{ref:O=>{const ue=T.current;O?ue.set(U.id,O):ue.delete(U.id)},className:`order-list__draggable ${v===j?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:f,onDragStart:f?O=>Z(j,O):void 0,onDragEnter:f?O=>I(j,O):void 0,onDragOver:f?O=>I(j,O):void 0,onDragLeave:f?()=>{try{N.current!==null&&clearTimeout(N.current),N.current=setTimeout(()=>{try{const O=document.querySelectorAll(".order-list .order-list__item");O&&O[j]&&(O[j].classList.remove("drag-over"),D.current===O[j]&&(D.current=null))}catch{}},80)}catch{}}:void 0,onDrop:f?O=>K(j,O):void 0,onDragEnd:f?W:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:U.text}),f?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:()=>w(j,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:j===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:()=>w(j,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:j===g.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},U.id)})})})}const hx=8e3;function mx(e,t){return new Promise(a=>{let r=!1;const s=()=>{r||(r=!0,a())};e.then(s,s),setTimeout(s,t)})}function Xc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:h=!1,maxCards:p,playAllGapMs:m=0}){const{t:g}=xe.useTranslation(),y=s??g("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),f=p??3,_=(C||[]).slice(0,f);(C||[]).length>f&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${f} shown`);const b=typeof e=="number"?e:-1,w=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",[v,A]=o.useState(null),x=o.useRef([]),[E,B]=o.useState(!1),D=o.useRef(null),N=o.useRef(!0);o.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]);const k=o.useMemo(()=>C.map(M=>M?.id??M?.word??"").join("|"),[C]);o.useEffect(()=>{A(null)},[k]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&A(null),P.current=t},[t,e]);const $=o.useCallback((M,Q)=>{if(c)return;const Z={item:M,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(w==="active"&&typeof l=="function")try{l(Z)}catch{}},[c,i,w,l]),G=o.useRef(m);o.useEffect(()=>{G.current=Math.max(0,m||0)},[m]);const T=o.useCallback(async()=>{if(E||w==="disabled")return;B(!0);let M=!1;const Q=new Promise(Z=>{D.current=()=>{M=!0,Z()}});try{for(let Z=0;Z<_.length&&!(!N.current||M);Z++){const I=x.current[Z];if(!I)continue;await Promise.race([mx(I.play(),hx),Q]);const K=Math.max(0,G.current||0);K>0&&Z<_.length-1&&!M&&N.current&&await Promise.race([new Promise(L=>{setTimeout(L,K)}),Q])}}finally{D.current=null,B(!1)}},[E,w,_.length]),F=o.useCallback((M,Q)=>{if(!ra(w))return;A(Q);const Z={selectedValue:M.word||M.title||"",selectedIndex:Q,item:M,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(typeof l=="function")try{l(Z)}catch{}},[i,w,l]);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:y,onDone:l,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:T,playAllActive:E},children:n.jsx("div",{className:"training-step__cards",onClickCapture:M=>{const Q=D.current;if(!Q)return;const Z=M.target;Z&&typeof Z.closest=="function"&&Z.closest(".training-word-card__bottom")&&Q()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:g("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((M,Q)=>n.jsx(ts,{ref:Z=>{x.current[Q]=Z},item:M,disabled:w==="disabled",onPlayDone:()=>$(M,Q),selectable:c,selected:c&&v===Q,onSelect:c?()=>F(M,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:h},M&&M.id||Q))})})}const Cx=160;function fx(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Jc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}fx(Vt.t.bind(Vt)),Jc(Vt.t.bind(Vt));const jr="none",bx=.5,gx=1.5,yx=.25;function Ns({title:e,valueLabel:t,value:a,min:r,max:s,step:l,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(sn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Uu,{value:a,onChange:d,min:r,max:s,step:l,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:se("noise-settings-tooltip__slider-input")}),n.jsx("div",{className:se(Ae("noise-settings-tooltip__value","button-1",c?"noise-settings-tooltip__value--disabled":"")),children:t})]})}function Qc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),s=yn("(max-width: 767px)")?40:24,l=Ar(),i=ar(l?.settings??na),u=l?.settings.type??"defaultNoise",c=l?.settings.enabled??!0,d=l?.playbackRate??1,h=l?.mainVolume??1,p=Math.round(h*100),m=o.useCallback(_=>{try{l?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[l]),g=o.useCallback(_=>{try{l?.setPlaybackRate(_)}catch{}},[l]),y=o.useCallback(_=>{const b=Math.min(nr,Math.max(0,Math.round(_*10)/10));try{l?.setSettings({noiseRatio:b})}catch{}},[l]),C=o.useCallback(_=>{try{_===jr?l?.setSettings({enabled:!1}):l?.setSettings({type:_,enabled:!0})}catch{}},[l]),f=[{key:jr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Jc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(wn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:se("noise-settings-tooltip__header"),children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Ja,{className:se("noise-settings-tooltip"),useBorder:!1,labelWidth:72,children:[n.jsx(Ns,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:s,onChange:m}),n.jsx(Ns,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:bx,max:gx,step:yx,size:s,onChange:g}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(sn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(vn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:f,value:c?u:jr,onChange:C})}),n.jsx(Ns,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:nr,step:Lc,size:s,disabled:!c,onChange:y})]}),a&&n.jsx("div",{className:se("noise-settings-tooltip__width-ghost"),"aria-hidden":"true",inert:!0,children:n.jsx(sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(vn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:f,value:jr,onChange:()=>{}})})})]})})}function ed({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:s=0,stepCount:l=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:h}=xe.useTranslation(),[p,m]=o.useState(!1),[g,y]=o.useState(null),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),w=Ar(),v=u>0,A=v&&i<u-1,x=!v||i>=u-1,E=s===Math.max(0,l);o.useEffect(()=>{e||(m(!1),y(null))},[e]);const B=o.useCallback(()=>{m(!1),y(null)},[]),D=o.useCallback(()=>{if(p){m(!1),y(null);return}const Q=_?.current?.getBoundingClientRect();Q&&y(Q),t?.(),m(!0)},[p,t]),N=o.useCallback(()=>{if(p){m(!1),y(null);return}const Q=b?.current?.getBoundingClientRect();Q&&y(Q),t?.(),m(!0)},[p,t]),k=yn("(max-width: 767px)"),P=o.useRef(null),[$,G]=o.useState(null),T=o.useCallback(()=>{f(Q=>{const Z=!Q;return G(Z?P.current?.getBoundingClientRect()??null:null),Z})},[]),F=o.useCallback(()=>{f(!1),G(null)},[]);o.useEffect(()=>{c&&(f(!1),G(null))},[c]);const M=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:h("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(Zo,{analyser:w?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:h("training.meter.noise","\uC18C\uC74C")}),n.jsx(Zo,{analyser:w?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.noise","\uC18C\uC74C")})]})]});return Kc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings-tooltip__header")?.closest(".tooltip__content")??null:null,()=>[_.current,b.current].map(Q=>Q?.querySelector("button")??null).find(Q=>!!Q&&Q.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:h("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:b,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:N,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:P,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:T,selected:C,"aria-expanded":k?C:void 0,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!k&&n.jsx("div",{className:"pp-bottom__meters",children:M})]}),e&&C&&k&&$&&n.jsx(wn,{anchorRect:$,onClose:F,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:M})}),n.jsxs("div",{className:"pp-bottom__right",children:[x&&n.jsx(be,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:h("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:h("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!E}),A&&n.jsx(be,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:h("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:h("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!E})]}),e&&p&&n.jsx(Qc,{anchorRect:g,onClose:B,hideNoiseRows:d})]})}function td({title:e,subtitle:t,desc:a,depth:r,icon:s,wrapperStyle:l,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:h,onBack:p,onClose:m}){const{t:g}=xe.useTranslation(),y=yn("(max-width: 767px)"),C=Number.isInteger(h)?h:u||0,f=Number.isInteger(d)?d:c||0,_=p||m,b=Array.isArray(r)?y?r[r.length-1]:r.join(" / "):r,w=typeof e=="string"?e.trim():e,v=typeof t=="string"?t.trim():t,A=!!(w||v),x=A?w||v:g("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),E=b||(w?t:void 0),B=y&&typeof E=="string"&&(E.includes(" \xB7 ")||E.includes(" / "))?E.split(/\s[·/]\s/).pop():E,D=o.useMemo(()=>{const N=l&&typeof l=="object"?{...l}:{};return!("width"in N)&&!("height"in N)&&(N.width="40px",N.height="40px"),N},[l]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(be,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:g("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:s?n.jsx(bu,{icon:s,label:e,tooltip:i,wrapperStyle:D}):null}),n.jsxs("div",{className:"pp-title__text",children:[B?n.jsx("span",{className:"pp-title__depth caption-1",children:B}):null,n.jsx("span",{className:`pp-title__title h2${A?"":" pp-title__title--empty"}`,children:x}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Zu,{max:Math.max(0,f??0),index:Math.max(0,C??0)})]})}function vx(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function _x(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const nd=(e,t)=>{if(!t)return t;const a=typeof Vt?.t=="function"?Vt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function ad(e,t,a){const r=e,s=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",l=Zl().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=l?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:s,label:r?.title||s,depth:t,icon:l?.icon,wrapperStyle:l?.color?{"--t-item-fg":l.color}:void 0,iconTooltip:[l?nd(`topic.${l.key}`,l.label):void 0,i?nd(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function Es(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function rd(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,s=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(s).toISOString()}:{}}}function xx(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function wx({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:s=[],emptyMessage:l,buildResults:i,metaPatch:u}){const c=ad(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},h=t?.id||t?.title||s.length;return{id:`${e}:${h}`,meta:{...c,...d},pages:s,emptyMessage:l,buildResults:i}}function Bx(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function kx(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function Ax(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function od(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function Nx(e,t,a,r){return od(e,t*a+r)}function Ex({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const s=e;if(Array.isArray(s.selectedValues))return r.every(l=>s.selectedValues.includes(l))&&s.selectedValues.every(l=>r.includes(l));if(typeof s.correct=="boolean")return s.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(s=>String(s)===String(a[t]));if(typeof t<"u")return r.some(s=>String(s)===String(t))}}function Dx(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const sd=o.createContext(null);function Sx(){const e=o.useContext(sd);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function jx({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,choices:l=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,h=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,m]=o.useState(()=>l.map(()=>null)),g=JSON.stringify(l),y=l.length;o.useEffect(()=>{m(Array.from({length:y},()=>null))},[g]);const C=o.useRef(void 0);o.useEffect(()=>{const w=C.current;typeof w=="number"&&typeof t=="number"&&typeof e=="number"&&w>=e&&t<e&&m(Array.from({length:y},()=>null)),C.current=t},[t,e,y]);const f=o.useMemo(()=>p.filter(w=>w!==null).length+1,[p]),_=o.useCallback(w=>{if(!ra(h))return;const v=p;let A;if(v[w]!=null){const E=v[w];A=v.map(B=>B!==null&&B>=E?null:B)}else A=[...v],A[w]=f;m(A);const x={selectedOrder:A,words:l,__ts:Date.now()};try{typeof u=="function"&&u(x)}catch{}if(v[w]==null&&A.length>0&&A.every(E=>E!==null))try{typeof i=="function"&&i(x)}catch{}},[h,p,f,u,i,l]),b=s??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:b,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:l.map((w,v)=>n.jsx(ts,{item:{word:w},disabled:h==="disabled",selectable:!0,selected:p[v]!==null,orderRank:p[v],onSelect:()=>_(v),flipDelay:v*120,hideLabel:!1,hideAudio:!0},`${w}-${v}`))})})}function Tr(e){return null}Tr.__isTrainingPage=!0;function Ba(e,t){const a=Sx();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function ld({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i}=Ba(e,t);return n.jsx(ks,{...a,index:r,stepIndex:s,isLast:l,onDone:i})}function id({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(ws,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function ud({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(Bs,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function cd({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(As,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function dd({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(Xc,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function Tx({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(jx,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}const pd=3e4,Mx=/^(https?:|blob:|data:audio|\/|\.\/)/;function hd(e){return typeof e=="string"&&Mx.test(e)?e:null}const Lx=e=>typeof e=="string"&&e.trim()!==""?e:null,Ds=Symbol("timed-out");function $x(e,t){if(t<=0)return Promise.resolve(Ds);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(Ds),t)})]).finally(()=>clearTimeout(a))}function Rx(e){return e?Sa()||or()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function Px(e,t){const a=[],r=hd(t);r&&a.push({kind:"raw",resolve:async()=>r});const s=(e??"").trim();if(!s)return a;for(const[l,i]of[["urlResolver",Sa()],["fallbackUrlResolver",or()]])i&&a.push({kind:l,resolve:async u=>{let c;try{c=await $x(i(s),u)}catch(h){return Bt(`question-sound-threw-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,h),null}return c===Ds?(Bt(`question-sound-slow-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 ${pd}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):Lx(c)||(Bt(`question-sound-empty-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function Fx(){return Date.now()+pd}const Ix=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function Ox(e){Bt("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Mr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const s of r){if(typeof s=="string"&&s.trim().length)return s.trim();if(typeof s=="number"||typeof s=="boolean")return String(s)}}}return null}function zx(e){return Mr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function Wx(e){return hd(Mr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function md(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Mr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function Cd(e){const{score:t,contextsLength:a,results:r=[],subtitle:s,onReplay:l,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),h=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const N=a??0;if(t!=null&&N>0&&t/N>.5){const k=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(k)}},[t,a]);const m=o.useCallback(N=>{const k=md(N),P=Mr(N?.wording,N?.label);return k===!0?{variant:"main",label:P??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:k===!1?{variant:"danger",label:P??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:P??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),g=a??0,y=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),f=o.useRef(null),[_,b]=o.useState(null),w=o.useCallback(()=>{f.current?.(),f.current=null,b(null)},[]);o.useEffect(()=>w,[w]);const v=o.useRef(0),A=(N,k)=>{if(!On)return;const P=Math.round(performance.now()-v.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${P}ms ${N}`,k??"")},x=o.useRef(0),E=o.useCallback((N,k,P)=>{w();const $=++x.current,G=()=>x.current===$;v.current=On?performance.now():0,A(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${N}`,{text:k,rawUrl:P}),b(N),f.current=()=>{A("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),x.current++,Qr()};const T=Z=>{A("\uD2BC\uB2E4",Z);const I=Ka(Z,K=>{A(`\uB05D\uB0AC\uB2E4 \u2014 ${K?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:G()}),K&&G()&&(f.current=null,b(null))});return f.current=()=>{A("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),x.current++,I.stop(),Qr()},I.done},F=Px(k,P);A("\uCC28\uB840",F.map(Z=>Z.kind));const M=F[0]?.kind==="raw",Q=M?T(P):Promise.resolve(!1);(async()=>{if(await Q||!G())return;const Z=Fx(),I=M?F.slice(1):F;for(let K=0;K<I.length;K++){if(!G())return;A(`${I[K].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const L=await I[K].resolve(Ix(Z,I.length-K));if(A(`${I[K].kind} \uAC00 \uB2F5\uD588\uB2E4`,L),!G()||L&&(await T(L)||!G()))return}G()&&(A("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),Ox(k),f.current=()=>{x.current++,Qr()},A("\uB0AD\uB3C5\uD55C\uB2E4"),L1(k,{onEnd:()=>{G()&&(f.current=null,b(null))}}))})()},[w]),B=o.useMemo(()=>C.map(N=>{const k=N??{},P=zx(k)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:$,label:G}=m(k),T=Array.isArray(k.corrects)?k.corrects:[],F=T.length?T.join(", "):k.answer!=null&&k.answer!==""?String(k.answer):null,M=typeof k.selectedText=="string"?k.selectedText:null,Q=md(k)===!0,Z=Wx(k),I=!!Z||Rx(P);return{problem:P,variant:$,label:G,answer:F,selectedText:M,isCorrect:Q,sound:Z,canHear:I}}),[C,m,d]),D=o.useMemo(()=>B.some(N=>N.answer!==null||N.selectedText!==null),[B]);return n.jsx(Rn,{onClose:i,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:N,closeWithAnimation:k})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:h,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(be,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>N(l)}),n.jsx(be,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:k,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?h:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),s&&n.jsx("p",{className:"trp-result__subtitle body-3",children:s}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:y,total:g}),children:[n.jsx("span",{className:"trp-score__big",children:y}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:g})]})})]}),B.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${D?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),D&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),B.map((N,k)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(k+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:N.problem}),N.canHear&&n.jsx(be,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===k?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===k?d("training.result.replaySoundStop",{no:k+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:k+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===k?w():E(k,N.problem,N.sound)})]}),D&&n.jsxs("div",{className:"trp-row__answers",children:[N.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:N.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${N.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${N.isCorrect?"is-correct":"is-wrong"}`,children:N.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(on,{variant:N.variant,label:N.label,fill:"soft",minWidth:80})})]},k))]})})]})})}const Ss=new Set;function Hx(e){o.useEffect(()=>{if(!e||Ss.has(e))return;Ss.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,s=0,l=0;const i=()=>{const h=Date.now();a==null&&(a=h),r==null&&(r=h)},u=()=>{r!=null&&(s+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const h=s-l;if(h<1e3||l===0&&s<5e3)return;const p=Date.now(),m=p-h;l=s,Sf({trainingType:e,startedAt:new Date(m).toISOString(),endedAt:new Date(p).toISOString()})},d=()=>{t()?i():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),Ss.delete(e)}},[e])}function Lr(e,t){return e&&e.id||`page-${t??0}`}function $r(e,t){return e&&e.key||`step-${t??0}`}function Rr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function Vx(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const qx=300,Ux=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},In=Object.freeze({}),fd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function js(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,s=Array.isArray(a)?a.filter(l=>l?.correct===!0||l?.isCorrect===!0||l?.score===1||l?.heard===!0||l?.judgement===!0).length:null;return{results:a,correct:r!=null?s:null,total:r}}const Gx=e=>n.jsx(Cd,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function Kx(e){const{scenario:t,title:a,subTitle:r,depth:s,icon:l,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:h,stepCount:p,onBack:m,onComplete:g,onRoundFinished:y,onNext:C,onSettings:f,useNoiseSetting:_=!0,children:b,ariaLabel:w,label:v,buildResults:A,onResult:x,typeKey:E,entryPoint:B,dailyTotal:D,itemRef:N,renderResultPopup:k,noiseOverride:P,hideNoiseRows:$=!1}=e;Hx(E&&!fd.has(E)?E:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:T}=xe.useTranslation(),F=x,M=!!t,Q=t?.id||null,Z=t?.meta||{},I=Array.isArray(t?.pages)?t.pages:[],K=Array.isArray(b)||o.isValidElement(b)&&typeof b!="function"?o.Children.toArray(b).filter(o.isValidElement):[],L=K.length>0,W=pe=>pe===Tr||pe?.__isTrainingPage===!0,Y=L&&K.some(pe=>W(pe.type)),U=Y?K.filter(pe=>W(pe.type)).map((pe,Se)=>{const Re=pe.props||{};return{id:`children-page-${Se}`,steps:o.Children.toArray(Re.children).filter(o.isValidElement),pageTop:Re.pageTop||Re.top||null,pageBottom:Re.pageBottom||Re.bottom||null}}):[{id:"children-page-0",steps:K}],j=L&&!M&&typeof b!="function",R=j?Math.max(1,U.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const pe=document.body;return pe.dataset.ihabTrainingPopupCount=String(Number(pe.dataset.ihabTrainingPopupCount||"0")+1),pe.classList.add("ihab-training-popup-open"),()=>{const Se=Number(pe.dataset.ihabTrainingPopupCount||"1")-1;Se>0?pe.dataset.ihabTrainingPopupCount=String(Se):(delete pe.dataset.ihabTrainingPopupCount,pe.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return pv()},[]);const[z,O]=o.useState({...na,enabled:!1}),ue=o.useRef(z);o.useEffect(()=>{ue.current=z},[z]);const te=o.useRef(P),de=o.useRef(!1),ee=o.useRef(null);o.useEffect(()=>{let pe=!1;const Se=Re=>{if(pe)return;de.current=!0;const Ue=Re?ta({...na,enabled:!1},Re):{...na},Oe=ee.current;ee.current=null;const X=Oe?ta(Ue,Oe):Ue;ue.current=X,O(X),Oe&&!te.current&&po(X),dr(X);const ce=te.current;if(ce){const Ee=typeof ce=="function"?ce(X):ce,He=ta(X,Ee);ue.current=He,O(He),dr(He)}};return zf().then(Re=>{if(pe){const Ue=ee.current;if(ee.current=null,Ue&&!te.current){const Oe=Re?ta({...na,enabled:!1},Re):{...na};po(ta(Oe,Ue))}return}Se(Re)}),()=>{pe=!0}},[]);const[V,ae]=o.useState(null),[H,q]=o.useState(null),ie=o.useCallback((pe,Se)=>{pe==="main"?ae(Se):q(Se)},[]),Ne=o.useRef(null),_e=o.useRef(null),he=o.useCallback(()=>{_e.current!==null&&(clearTimeout(_e.current),_e.current=null);const pe=Ne.current;Ne.current=null,pe&&po(pe)},[]);o.useEffect(()=>{if(typeof window>"u")return;const pe=()=>{document.visibilityState==="hidden"&&he()};return window.addEventListener("pagehide",he),document.addEventListener("visibilitychange",pe),()=>{window.removeEventListener("pagehide",he),document.removeEventListener("visibilitychange",pe),he()}},[he]);const je=o.useCallback(pe=>{const Se=ta(ue.current,pe);if(ue.current=Se,O(Se),!de.current){ee.current={...ee.current??{},...pe},dr(Se);return}te.current||(Ne.current=Se,_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(he,qx)),dr(Se)},[he]),$e=z.mainSpeed,De=z.mainVolume,le=o.useCallback(pe=>je({mainSpeed:pe}),[je]),we=o.useCallback(pe=>je({mainVolume:pe}),[je]),Le=o.useMemo(()=>({settings:z,setSettings:je,registerAnalyser:ie,mainAnalyser:V,noiseAnalyser:H,playbackRate:$e,setPlaybackRate:le,mainVolume:De,setMainVolume:we}),[z,je,ie,V,H,$e,le,De,we]),Be=o.useRef(null),[ze,Ve]=o.useState(0),ut=o.useRef([]),[et,Xe]=o.useState("center"),[yt,Te]=o.useState(!1),Ke=o.useRef(!1),ke=o.useRef(null),qe=o.useCallback(pe=>{Ke.current||(Ke.current=!0,Te(!0),ke.current=setTimeout(()=>{try{pe()}catch{Ke.current=!1,Te(!1)}},Ux()?0:Cx))},[]);o.useEffect(()=>()=>{ke.current&&clearTimeout(ke.current)},[]);const Je=o.useRef(m);o.useEffect(()=>{Je.current=m});const tt=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const pe=Be.current,Se=tt.current;if(bo(pe,Se),pe){const Re=Array.from(pe.querySelectorAll(Nn)).filter(Ue=>!Ue.closest('[aria-hidden="true"]'))[0];if(Re)try{Re.focus()}catch{}}return()=>{const Re=document.activeElement;if(!Re||Re===document.body||pe&&pe.contains(Re))try{go(Se)?.focus?.()}catch{}}},[]),o.useEffect(()=>Zn(()=>qe(()=>{const pe=Je.current;typeof pe=="function"&&pe()})),[qe]),Co(Be,!0);const[xt,wt]=o.useState(!1),Dt=o.useRef(!1),[rt,nt]=o.useState(null),kt=o.useRef(0),At=o.useRef(0),Lt=()=>{kt.current+=1,At.current+=1,nt(null)},[jt,vt]=o.useState(""),[ot,ct]=o.useState(()=>Rr()),dt=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!M&&!j||(ct(Rr()),Lt())},[M,Q,j]),o.useEffect(()=>{j&&ct(pe=>{const Se=Math.max(0,Math.min(pe.pageIndex,Math.max(0,R-1)));return Se!==pe.pageIndex?{...pe,pageIndex:Se,stepIndex:0}:pe})},[j,R]);const _t=j?Math.max(0,Math.min(ot.pageIndex,R-1)):0,Ce=j?U[_t]:null,Pe=j&&Ce&&Array.isArray(Ce.steps)?Ce.steps:[],ye=M?ot.pageIndex:j?_t:typeof c=="number"?c:0,Ye=M?I[Math.max(0,Math.min(ot.pageIndex,Math.max(0,I.length-1)))]:null,bt=M&&Ye&&Array.isArray(Ye.steps)?Ye.steps:[],Nt=M?bt.length:j?Pe.length:typeof p=="number"?p:0,mt=M||j?Math.max(0,Math.min(ot.stepIndex,Math.max(0,Nt))):typeof h=="number"?h:0,gt=M?I.length:j?R:typeof d=="number"?d:0;o.useEffect(()=>{if(!M&&!j)return;const pe=M?Lr(Ye,ye):Ce?.id||`children-page-${ye??0}`,Se=new Date().toISOString();for(let Re=0;Re<=mt;Re+=1){const Ue=M?$r(bt[Re],Re):`step-${Re}`,Oe=ve(pe,Ue);re.current.has(Oe)||re.current.set(Oe,Se)}},[M,j,ye,mt,Ce?.id]),o.useLayoutEffect(()=>{const pe=dt.current;if(typeof ye=="number"&&pe!==null&&ye!==pe&&ye>pe)try{vt(T("training.problemNotice",{n:ye+1}))}catch{}dt.current=typeof ye=="number"?ye:dt.current},[ye,c,T]),o.useLayoutEffect(()=>{const pe=Be.current;if(!pe)return;const Se=()=>pe.querySelector(".page-popup__scroll");let Re=null,Ue=null,Oe=null;const X=Ze=>{const Ct=Se();if(!Ct)return;const ft=Ct.scrollHeight<=Ct.clientHeight;if(Xe(ft?"center":"top"),Ze&&!Dt.current){Dt.current=!0;try{wt(!0)}catch{}try{He.disconnect()}catch{}}},ce=()=>{Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Ue!==null&&clearTimeout(Ue),Ue=setTimeout(()=>X(!0),60)})},Ee=()=>{Oe!==null&&cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>X(!1))};ce(),window.addEventListener("resize",Ee);const He=new MutationObserver(ce);He.observe(pe,{childList:!0,subtree:!0,attributes:!0});const Ge=setTimeout(()=>{Dt.current||X(!0)},400);return()=>{window.removeEventListener("resize",Ee),Re!==null&&cancelAnimationFrame(Re),Ue!==null&&clearTimeout(Ue),Oe!==null&&cancelAnimationFrame(Oe),clearTimeout(Ge);try{He.disconnect()}catch{}}},[Be]);const Me=o.useCallback(pe=>{Be.current&&(Be.current._childOnNext=pe)},[]),lt=o.useCallback(pe=>{Be.current&&(Be.current._childOnResult=pe)},[]),re=o.useRef(new Map),ve=(pe,Se)=>`${pe}\0${Se}`,Ie=o.useCallback((pe,Se,Re)=>{ct(Ue=>{const Oe=Ue.answersByPage[pe]||{},X=Oe[Se],ce=Es(Re),Ee=Es(X);if(X&&Ee>ce)return Ue;const He=rd(Re,re.current.get(ve(pe,Se)),ce);return{...Ue,answersByPage:{...Ue.answersByPage,[pe]:{...Oe,[Se]:He}}}})},[ct]),We=o.useCallback((pe,Se,Re)=>{const Ue=Lr(Ye,ye),Oe=$r(pe,Se);Ie(Ue,Oe,Re)},[Ye,ye,Ie]),Qe=o.useCallback((pe,Se,Re)=>{const Ue=Lr(Ye,ye),Oe=$r(pe,Se);Ie(Ue,Oe,Re),!Re?.allowChange&&pe?.autoAdvance!==!1&&ct(X=>({...X,stepIndex:Math.max(X.stepIndex,Se+1)}))},[Ye,ye,Ie,ct]),st=o.useCallback((pe,Se)=>{const Re=Ce?.id||`children-page-${ye??0}`,Ue=typeof Se=="number"?Se:mt??0,Oe=`step-${Ue}`;Ie(Re,Oe,pe),pe?.allowChange||ct(X=>({...X,stepIndex:Math.max(X.stepIndex,Ue+1)}))},[Ce,ye,mt,Ie,ct]),Tt=o.useCallback((pe,Se)=>{const Re=Ce?.id||`children-page-${ye??0}`,Ue=`step-${typeof Se=="number"?Se:mt??0}`;Ie(Re,Ue,pe)},[Ce,ye,mt,Ie]),ln=j?{currentPageIndex:ye??0,currentStepIndex:mt??0,totalStepsInPage:Pe.length,handleStepDone:st,handleStepChange:Tt}:null,un=async()=>{const pe=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:I,flowState:ot,answersByPage:ot.answersByPage})):null;return typeof F=="function"&&await Promise.resolve(F(pe))||pe},$t=async()=>{const pe=Ce?.id||`children-page-${ot.pageIndex}`,Se=ot.answersByPage[pe]||{},Re=Y?(()=>{const X={};let ce=0;return U.forEach(Ee=>{const He=ot.answersByPage[Ee.id]||{},Ge=Array.isArray(Ee.steps)?Ee.steps.length:0;for(let Ze=0;Ze<Ge;Ze+=1){const Ct=He[`step-${Ze}`];typeof Ct<"u"&&(X[`step-${ce+Ze}`]=Ct)}ce+=Ge}),X})():Se;if(typeof A=="function"){const X=await Promise.resolve(A(Re,{pageAnswers:Se,answersByPage:ot.answersByPage,pages:U,currentPageId:pe}));return typeof F=="function"&&await Promise.resolve(F(X))||X}const Ue=Object.entries(Se).map(([X,ce],Ee)=>({index:Ee,key:X,payload:ce})),Oe={results:Ue,answers:Ue,score:0};return typeof F=="function"&&await Promise.resolve(F(Oe))||Oe},Ot=()=>{const pe=++kt.current,Se=()=>pe!==kt.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if(M){const Oe=un();nt(In);const X=Oe;Promise.resolve(X).then(ce=>{Se()||nt(ce||{isEmpty:!0})}).catch(ce=>{!Se()&&nt({isEmpty:!0})});return}if(j){const Oe=$t();nt(In);const X=Oe;Promise.resolve(X).then(ce=>{Se()||nt(ce||{isEmpty:!0})}).catch(ce=>{!Se()&&nt({isEmpty:!0})});return}const Re=Be.current&&Be.current._childOnResult,Ue=Oe=>{try{return Oe?Oe():void 0}catch{return}};if(typeof Re=="function"){const Oe=Ue(Re);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?nt(Oe):nt(Oe&&typeof Oe.then=="function"?In:{});const X=()=>{Se()||nt(ce=>ce===In?{}:ce)};Promise.resolve(Oe).then(ce=>{ce&&!Se()?nt(ce):X()}).catch(ce=>{X()});return}if(typeof F=="function"){const Oe=Ue(F);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?nt(Oe):nt(Oe&&typeof Oe.then=="function"?In:{});const X=()=>{Se()||nt(ce=>ce===In?{}:ce)};Promise.resolve(Oe).then(ce=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}ce&&!Se()?nt(ce):X()}).catch(ce=>{console.error("viewResults external handler failed",ce),X()});return}},cn=()=>{if(M){if(typeof ye=="number"&&typeof gt=="number"&&ye<gt-1){ct(Se=>({...Se,pageIndex:Se.pageIndex+1,stepIndex:0}));return}return Ot()}if(j){const Se=Pe.length;if(typeof mt=="number"&&mt<Se-1){ct(Re=>({...Re,stepIndex:Re.stepIndex+1}));return}if(typeof ye=="number"&&typeof gt=="number"&&ye<gt-1){ct(Re=>({...Re,pageIndex:Re.pageIndex+1,stepIndex:0}));return}return Ot()}if(typeof C=="function"){try{C()}catch{}return}const pe=Be.current&&Be.current._childOnNext;if(typeof pe=="function"){try{pe()}catch{}return}},Pt=M?Z.title||Z.label||w||T("common.popup","\uD31D\uC5C5"):a||v||(Array.isArray(s)?s[s.length-1]:void 0)||w||T("common.popup","\uD31D\uC5C5"),kn=w||Pt,Jt=M?Z.title??Z.label??Pt:a??v??Pt,St=(pe,Se)=>{const Re=Lr(Ye,ye),Ue=$r(pe,Se),Oe=ot.answersByPage[Re]?.[Ue],X=Vx(pe,{page:Ye,pageIndex:ye,step:pe,stepIndex:Se,storedPayload:Oe,answersByPage:ot.answersByPage,flowState:ot}),ce={key:Ue,index:Se,stepIndex:mt,isLast:Se===bt.length-1};switch(pe?.type){case"listen":return n.jsx(ks,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee)});case"confirm":return n.jsx(ws,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});case"confirmWithText":return n.jsx(Bs,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});case"orderList":return n.jsx(As,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});default:return null}},Rt=o.useRef(void 0);o.useEffect(()=>{const pe=Rt.current;if(Rt.current=ye,pe===void 0||pe===ye||!_r())return;const Se=Be.current;if(!Se)return;const Re=document.activeElement;if(!(!Re||Re===document.body||!Se.contains(Re)||Re.disabled===!0))return;const Ue=Se.querySelector(`.training-steps ${Nn.split(", ").join(", .training-steps ")}`)??Array.from(Se.querySelectorAll(Nn)).find(Oe=>!Oe.closest('[aria-hidden="true"]'));try{Ue?.focus()}catch{}},[ye]);const Wt=M?I.length>0?n.jsx("div",{className:"training-steps",children:bt.map((pe,Se)=>St(pe,Se))},`replay-${ze}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||T("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Kt=j?n.jsxs(sd.Provider,{value:ln,children:[Ce?.pageTop?n.jsx("div",{className:"training-page-top",children:Ce.pageTop}):null,n.jsx("div",{className:"training-steps",children:Pe.map((pe,Se)=>{const Re=pe;return o.cloneElement(Re,{...Re.props,_stepIndex:Se,_totalSteps:Pe.length,_stepKey:`step-${Se}`,_pageIndex:ye})})},`replay-${ze}`),Ce?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Ce.pageBottom}):null]}):null,bn=o.useRef(-1),Ut=o.useCallback(()=>{if(!E)return;const pe=rt,{results:Se,correct:Re,total:Ue}=js(rt),Oe={correct:Re,total:Ue,attempt:ut.current.length+1,previousAttempts:[...ut.current]};if(bn.current===At.current)return Oe;bn.current=At.current,jf({items:Of(Se),category:fd.has(E)?"sentence":"word",trainingType:E,entryPoint:B??"sentence",itemRef:N??null,correct:Re,total:Ue,score:typeof pe?.score=="number"?pe.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:D??null});try{y?.(Oe)}catch{}return Oe},[E,B,D,N,rt,y]);o.useEffect(()=>{!rt||rt===In||rt?.isEmpty||(js(rt).total??0)>0&&Ut()},[rt,Ut]);const Qt=o.useCallback(()=>{const pe=Ut();Lt(),qe(()=>{typeof g=="function"&&g(pe),typeof m=="function"&&m()})},[g,m,Ut,nt,qe]),dn=o.useCallback(()=>vt(""),[vt]),gn=o.useCallback(()=>{qe(()=>{typeof m=="function"&&m()})},[m,qe]),Ht=n.jsxs("div",{className:`page-popup${yt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":kn,children:[n.jsxs("div",{ref:Be,className:`page-popup__panel ${xt?"":"page-popup__panel--measuring"} ${et==="center"?"page-popup__panel--center":et==="top"?"page-popup__panel--top":""}`,children:[n.jsx(td,{title:Jt,subtitle:M?Z.subtitle||Z.label:Array.isArray(s)?s.join(" / "):void 0,desc:M?void 0:r,depth:M?Z.depth:s,icon:M?Z.icon:l,wrapperStyle:M?Z.wrapperStyle:i,iconTooltip:M?Z.iconTooltip:u,progressMax:gt,progressIndex:ye,pageIndex:ye,pageCount:gt,onBack:gn,onClose:gn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${et==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:j?Kt:M?Wt:typeof b=="function"?b({registerOnNext:Me,registerOnResult:lt,panelRef:Be,setResultOverlay:nt}):b})}),n.jsx(ed,{onSettings:f,onNext:cn,onResult:Ot,useNoiseSettingBtn:!!(M?Z.useNoiseSetting??!0:_),stepIndex:mt,stepCount:Nt,pageIndex:ye,pageCount:gt,resultOpen:!!(rt&&!rt.isEmpty),hideNoiseRows:$})]}),rt&&!rt.isEmpty&&(k??Gx)({score:rt.score,results:rt.results||rt.answers||[],contextsLength:rt.results?rt.results.length:rt.answers?rt.answers.length:0,onReplay:()=>{if(G.current=Date.now(),rt!==In){const{correct:pe,total:Se}=js(rt);ut.current.push({correct:pe,total:Se})}if(Lt(),Ve(pe=>pe+1),M){if(ct(Rr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(j){ct(Rr());return}try{const pe=Be.current&&Be.current._childOnResult;typeof pe=="function"&&pe({replay:!0})}catch{}},onClose:Qt,pending:rt===In}),rt?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(be,{htmlType:"button",variant:"main",size:48,onClick:Qt,label:T("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ya,{message:jt,position:"top",onClose:dn})]}),An=n.jsx(bs.Provider,{value:Le,children:Ht});return typeof document<"u"&&document.body?pn.createPortal(An,document.body):An}const Un=Kx;Un.Page=Tr,Un.ListenStep=ld,Un.ConfirmStep=id,Un.ConfirmWithTextStep=ud,Un.OrderListStep=cd,Un.CardStep=dd,Un.CardOrderStep=Tx;function Yx({label:e,homonum:t}){const a=ua()?.(e,t)??"",{imgRef:r,loading:s,hasImage:l,onLoad:i,onError:u}=es(a);return l?n.jsxs("div",{className:se("word-image-tooltip__cell"),children:[s&&n.jsx("div",{className:se("word-image-tooltip__spinner")}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:s?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:se("word-image-tooltip__cell word-image-tooltip__cell--text h3"),children:n.jsx("span",{children:e})})}function bd({words:e,anchorRect:t}){const a=o.useRef(null),[r,s]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:l,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-l/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-l-8)),s({left:c,top:d})},[t]),!t||e.length===0?null:pn.createPortal(n.jsx("div",{ref:a,className:se("word-image-tooltip"),style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:se("word-image-tooltip__cells"),children:e.map(l=>n.jsx(Yx,{label:l.label,homonum:l.homonum},`${l.label}_${l.homonum??1}`))})}),document.body)}function Zx({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:s,groups:l,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:h,onPrintEmpty:p,className:m,emptyHint:g,showEmptyText:y=!0,sectionType:C="page",disc:f}){const{t:_,i18n:b}=xe.useTranslation(),w=b.language?.startsWith("ko")??!1,{anchorRect:v,openAt:A,close:x}=Oa(),[E,B]=o.useState(null),D=o.useCallback(()=>{x(),B(null)},[x]);Wy(D,!!E);const N=(r??"").trim(),k=/^[^,[\]\s]+$/.test(N)?N:"",P=k.length>0,$=r===void 0&&t===void 0,G=P?"match":$?"original":"ganada",[T,F]=o.useState(()=>G),[M,Q]=o.useState("50"),[Z,I]=o.useState(1),[K,L]=o.useState(P);K!==P&&(L(P),F(G));const W=T==="match"&&!P||T==="original"&&!$?G:T,Y=o.useMemo(()=>[...P?[{value:"match",label:_("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...$?[{value:"original",label:_("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:_("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:_("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:_("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:_("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:_("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:_("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[_,P,$]),U=o.useMemo(()=>["10","25","50","100"].map(le=>({value:le,label:_("wordSearch.pageSize",{count:Number(le),defaultValue:`${le}\uAC1C\uC529 \uBCF4\uAE30`})})),[_]),j=le=>le.words?.[0],R=o.useMemo(()=>{const le=[...k].length,we=hf(k),Le=new Map;return Be=>{let ze=Le.get(Be);return ze===void 0&&(ze=we((Be.words?.[0]?.label??"").slice(0,le))?0:1,Le.set(Be,ze)),ze}},[k]),z=o.useCallback((le,we)=>{const Le=Ve=>j(Ve)?.label??"",Be=Ve=>j(Ve)?.syllables??[...Le(Ve)].length,ze=Ve=>(Ve.words??[]).reduce((ut,et)=>{const Xe=parseInt(et.grade??"",10);return Number.isFinite(Xe)&&Xe<ut?Xe:ut},999);switch(W){case"match":return R(le)-R(we)||Cn(Le(le),Le(we));case"ganada":return Cn(Le(le),Le(we));case"ganada_desc":return Cn(Le(we),Le(le));case"syllable":return Be(le)-Be(we)||Cn(Le(le),Le(we));case"syllable_desc":return Be(we)-Be(le)||Cn(Le(le),Le(we));case"grade":return ze(le)-ze(we)||Cn(Le(le),Le(we));case"grade_desc":return ze(we)-ze(le)||Cn(Le(le),Le(we));default:return 0}},[W,R]),O=o.useMemo(()=>s.slice().sort(z),[s,z]),ue=Number(M)||10,te=o.useMemo(()=>(l??[]).flatMap(le=>le.items.slice().sort(z).map(we=>({item:we,label:le.label}))),[l,z]),de=l?te.length:O.length,ee=Math.max(1,Math.ceil(de/ue)),V=Math.min(Z,ee),ae=o.useMemo(()=>O.slice((V-1)*ue,V*ue),[O,V,ue]),H=o.useId(),q=o.useMemo(()=>{if(!l)return null;const le=te.slice((V-1)*ue,V*ue),we=new Map;for(const{item:Le,label:Be}of le)we.has(Be)||we.set(Be,[]),we.get(Be).push(Le);return[...we.entries()].map(([Le,Be])=>({label:Le,items:Be}))},[l,te,V,ue]);o.useEffect(()=>{I(1)},[T,M,de,r]);const ie=de>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(_n,{size:40,options:Y,value:W,onChange:F,ariaLabel:_("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(_n,{size:40,options:U,value:M,onChange:Q,ariaLabel:_("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(Oo,{page:V,totalPages:ee,onChange:I})]}):void 0,Ne=le=>{u&&u(le)},_e=t!==void 0&&a?n.jsxs(n.Fragment,{children:[_("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),_("wordSearch.resultTitleSuffix",{unit:w?Bf(a):a})]}):void 0,he=t!==void 0&&t>0&&c!==void 0&&a?_("wordSearch.resultDisc",{unit:w?Af(a):a,max:c,selected:i.length}):void 0,je=f??he,$e=l?l.length===0:s.length===0,De=$e&&!y&&!g;return n.jsxs(va,{type:C,className:Ae("word-search-result-block",m),children:[n.jsxs("div",{className:Ae("word-search-result-block__inner",De&&"word-search-result-block__inner--head-only"),children:[(_e||ie||je)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(at,{icon:e,className:"word-search-result-block__head-icon"}),_e&&n.jsx("span",{className:"word-search-result-block__title h3",children:_e})]}),ie&&n.jsx("div",{className:"word-search-result-block__head-actions",children:ie}),je&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:je})]}),$e&&(y||g)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[y&&n.jsx("p",{className:"word-search-result-block__empty body-3",children:_("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),g&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:g})]}),l?(q??[]).map(le=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${H}-${le.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${H}-${le.label}`,children:le.label}),n.jsx("div",{className:"word-search-result-block__items",children:le.items.map(we=>{const Le=i.includes(we.id);return n.jsx("div",{onMouseEnter:Be=>{A(Be.currentTarget),B(we.words??[])},onMouseLeave:D,children:n.jsx(be,{htmlType:"button",size:"word",align:"grid",label:(we.words??[]).map(Be=>Be.label),subLabel:(we.words??[]).some(Be=>Be.subLabel)?(we.words??[]).map(Be=>Be.subLabel):void 0,selected:Le,onClick:()=>Ne(we.id),minWidth:200})},we.id)})})]},le.label)):n.jsx("div",{className:"word-search-result-block__items",children:ae.map(le=>{const we=i.includes(le.id);return n.jsx("div",{onMouseEnter:Le=>{A(Le.currentTarget),B(le.words??[])},onMouseLeave:D,children:n.jsx(be,{htmlType:"button",size:"word",align:"grid",label:(le.words??[]).map(Le=>Le.label),subLabel:(le.words??[]).some(Le=>Le.subLabel)?(le.words??[]).map(Le=>Le.subLabel):void 0,selected:we,onClick:()=>Ne(le.id),minWidth:200})},le.id)})}),E&&v&&n.jsx(bd,{words:E,anchorRect:v})]}),(d||h)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:_("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:i.length===0,onClick:i.length===0?void 0:d}),h&&n.jsx("div",{onClick:i.length===0?p:void 0,children:n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:h})})]})]})}function Xx(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,s=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:s}})}function Jx({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:s=4,minCount:l=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:h,title:p,titleIcon:m,disc:g,showInfoButton:y=!0,onClearPhoneme:C,onSearch:f,onSearchEmpty:_,searchDisabled:b=!1,searchLabel:w,searchChecking:v=!1,pairMode:A=!1,sectionType:x="page",beforeSearchContent:E,beforeContent:B,afterContent:D,hideCountControl:N=!1,ordinal:k=!1}){const{t:P}=xe.useTranslation(),$=o.useMemo(()=>P("wordPairs.infoNotes",{returnObjects:!0}),[P]),G=o.useMemo(()=>Array.from({length:s-l+1},(j,R)=>{const z=l+R;return{key:String(z),label:P("wordPairs.count",{n:z})}}),[P,s,l]),T=o.useMemo(()=>P("wordPairs.ordinals",{returnObjects:!0}),[P]),F=o.useCallback(j=>k?P("wordPairs.phonemeOrdinalLabel",{ordinal:T[j-1]??j}):a===1?P("wordPairs.phonemeSingleLabel","\uC74C\uC808"):P("wordPairs.phonemeN",{n:j}),[k,T,a,P]),M=o.useCallback(j=>k?P("wordPairs.phonemeContrastOrdinalLabel",{ordinal:T[j-1]??j}):a===1?P("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):P("wordPairs.phonemeContrast",{n:j}),[k,T,a,P]),Q=o.useCallback((j,R)=>R?n.jsxs(n.Fragment,{children:[j,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):j,[]),{anchorRect:Z,toggleAt:I,close:K}=Oa(),L=o.useCallback(j=>r(Number(j)),[r]),W=yn("(max-width: 767px)"),Y=o.useCallback(j=>Xx(j,e).map(({label:R,value:z,displayLabel:O})=>{const ue=!!z&&z!=="\uC5C6\uC74C";return n.jsxs("span",{className:Ae("phoneme-select-block__cell-jamo-part",z?"":"phoneme-select-block__cell-jamo-part--empty",ue?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${z==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:z==="\uC5C6\uC74C"?"x":z||d}),ue&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:O??R})]},R)}),[e,d]),U=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:40,type:W?"dot":void 0,icon:"info",label:W?void 0:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:Z?"is-selected":void 0,"aria-expanded":!!Z,"aria-haspopup":"dialog",onClick:j=>I(j.currentTarget)})}),Z&&n.jsx(Xn,{title:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:$,anchorRect:Z,onClose:K})]});return n.jsxs(va,{type:x,title:p,icon:m,disc:g,action:y?U:void 0,className:Ae("phoneme-select-block",h),children:[B,!N&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(vn,{options:G,value:String(a),onChange:L,size:40,ariaLabel:P("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:A?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(z)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:F(R+1)})]},R)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:P("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(z)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R)})})]}):t.map((j,R)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(j)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:F(R+1)})]},R))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:A?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2]??{};return n.jsx(Fn,{title:Q(F(R+1),R===0),sections:u?u(z,R*2):i,selected:z,onSelect:c?.(R*2),align:"newline"},R)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2+1]??{};return n.jsx(Fn,{title:M(R+1),sections:u?u(z,R*2+1):i,selected:z,onSelect:c?.(R*2+1),align:"newline"},R)})})]}):t.map((j,R)=>n.jsx(Fn,{title:Q(F(R+1),R===0),sections:u?u(j,R):i,selected:j,onSelect:c?.(R),align:"newline"},R))})}),E&&n.jsx("div",{className:"phoneme-select-block__before-search",children:E}),(C||f||v)&&(()=>{const j=t.every(R=>{const z=uf(R);return Object.entries(z).every(([O,ue])=>!ue||O==="coda"&&ue===Rl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:j?_:void 0,children:[C&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:P("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:j,onClick:j?void 0:C}),f?n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:v?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:w??P("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:j||b||v,onDisabledClick:v?()=>{}:void 0,"aria-busy":v||void 0,onClick:f}):v?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:w??P("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),D]})}function Qx({title:e,sections:t,selected:a,onSelect:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:h}){const{t:p}=xe.useTranslation();return n.jsx(Fn,{className:h,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function ew({title:e,headerAction:t,sections:a,selected:r,onSelect:s,className:l}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(Fn,{className:l,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:s,align:"newline"})}function tw({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:s,positionCount:l,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:h}=xe.useTranslation(),p={searchMode:h("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:h("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:h("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:h("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:h("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:h("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:h("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:h("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:h("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:h("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:h("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},m=f=>h("wordPairs.count",{n:f}),g=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ua,{title:h("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[h("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),h("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),h("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Ua,{items:h("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[m(1),m(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ua,{title:h("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[h("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),h("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],y={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:m(l),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(f,_)=>{_===p.searchMode?a(f===p.explicit?"explicit":f===p.pick?"pick":"include"):_===p.phonemeOrder?s(f===p.orderMatch?"ordered":"unordered"):_===p.count?i(f===m(2)?2:1):_===p.inputMode&&c(f===p.pronInput?"phoneme":"word")};return n.jsx(Fn,{className:d,title:e??h("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:g,selected:y,onSelect:C,align:"inline"})}function nw(e){const{title:t,items:a,columns:r,resizeStorageKey:s,gridTemplateColumns:l,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:h=!0,selectedId:p,selectedIds:m,onSelect:g,onClose:y,pageSizeOptions:C=[10,25,50,100],initialPageSize:f,emptyText:_,noMatchText:b,countLabel:w,topContent:v,className:A=""}=e,{t:x}=xe.useTranslation(),E=u??x("common.search","\uAC80\uC0C9"),B=_??x("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),D=b??x("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[N,k]=o.useState(""),[P,$]=o.useState(d??r[0]?.key??""),[G,T]=o.useState(h),[F,M]=o.useState(String(f??C[0]??10)),[Q,Z]=o.useState(1);o.useEffect(()=>{Z(1)},[N,F]);const I=c!==null,K=o.useCallback((te,de)=>{if(!de)return!0;const ee=de.toLowerCase();return r.some(V=>{const ae=te[V.key];return ae==null?!1:String(ae).toLowerCase().includes(ee)})},[r]),L=c??K,W=o.useMemo(()=>{const te=I?a.filter(de=>L(de,N)):a;return P?[...te].sort((de,ee)=>{const V=de[P],ae=ee[P];return V===ae?0:fr(V,ae,G)}):te},[a,N,P,G,I,L]),Y=Math.max(1,Math.ceil(W.length/Number(F)));Q>Y&&Z(Y);const U=Math.min(Q,Y),j=W.slice((U-1)*Number(F),U*Number(F)),R=o.useCallback(te=>{P===te?T(de=>!de):($(te),T(!0)),Z(1)},[P]),z=o.useMemo(()=>{if(typeof w=="function"){const te=W.length,de=w(te);if(typeof de=="string"){const ee=de.lastIndexOf(String(te));if(ee>=0)return{prefix:de.slice(0,ee),suffix:de.slice(ee+String(te).length)}}return{label:de}}if(typeof w=="string"&&w.includes("{n}")){const[te,de]=w.split("{n}");return{prefix:te,suffix:de}}return{prefix:x("common.totalCountPrefix","\uCD1D "),suffix:x("common.totalCountSuffix","\uAC1C")}},[w,W.length,x]),O=o.useMemo(()=>r.map(te=>({label:te.label,onClick:te.sortable!==!1?()=>R(te.key):void 0,className:te.className,sortDir:te.sortable!==!1&&P===te.key?G?"asc":"desc":null})),[r,P,G,R]),ue=o.useMemo(()=>C.map(te=>({value:String(te),label:x("common.pageSizeLabel",{n:te})})),[C,x]);return n.jsxs(Rn,{className:`popup-list ${A}`,title:t,onClose:y,children:[v,"label"in z&&n.jsx("p",{className:"toolbar__count body-1",children:z.label}),n.jsx(zo,{count:"label"in z?void 0:{value:W.length,prefix:z.prefix,suffix:z.suffix},search:I?{value:N,onChange:k,placeholder:E}:void 0,pageSize:{options:ue,value:F,onChange:M},pagination:{page:U,total:Y,onChange:Z}}),n.jsx(Jo,{size:"medium",gridTemplateColumns:l,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:s,fields:O,items:j,onRowClick:g,renderRow:te=>{const de=m!=null?te.id!=null&&m.has(te.id):p!=null&&te.id===p;return r.map(ee=>({content:ee.render?ee.render(te):te[ee.key]??"",className:Ae(ee.className,de&&"popup-list__row--selected")}))},empty:I&&N!==""&&a.length>0?D:B})]})}function gd(e){const{title:t,message:a,topContent:r,details:s,children:l,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:h="main",confirmDisabled:p=!1,onConfirm:m,closeOnConfirm:g=!0,onClose:y,inline:C,size:f="small",className:_,initialFocus:b="close"}=e,{t:w}=xe.useTranslation(),v=o.useRef(null);o.useEffect(()=>{if(C||b==="close")return;const N=v.current?.closest(".popup-panel"),k=Array.from(N?.querySelectorAll(".popup-footer--buttons button")??[]),P=b==="confirm"?k[k.length-1]:c?void 0:k[d?1:0];P&&!P.disabled&&P.focus()},[]);const A=o.useRef(!1),[x,E]=o.useState(!1),B=N=>{let k=!1;return{close:()=>{k=!0,N()},didClose:()=>k}},D=async N=>{if(A.current)return;A.current=!0;const k=typeof document<"u"?document.activeElement:null;E(!0);let P=!1;try{P=await N()}catch($){typeof console<"u"&&console.error($)}finally{P||(A.current=!1,E(!1),requestAnimationFrame(()=>{const $=document.activeElement;(!$||$===document.body)&&k?.isConnected&&k.focus()}))}};return n.jsxs(Rn,{title:t,onClose:y,closeDisabled:x,inline:C,size:f,className:Ae("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||x,onClick:async({closeWithAnimation:N})=>{await D(async()=>{const k=B(N);await d.onClick(k.close);const P=d.closeOnClick??!0;return P&&N(),P||k.didClose()})}}]:[],...c?[]:[{label:u??w("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:x,onClick:({closeWithAnimation:N})=>N()}],{label:i??w("common.confirm","\uD655\uC778"),variant:h,disabled:p||x,onClick:async({closeWithAnimation:N})=>{await D(async()=>{const k=B(N);return await m(k.close),g&&N(),g||k.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),s&&s.length>0&&n.jsx(Ja,{children:s.map((N,k)=>n.jsx(sn,{label:N.label,children:n.jsx("span",{className:"panel-row__text body-2",children:N.value})},k))}),n.jsx("p",{ref:v,className:"body-2 confirm-popup__message",children:a}),l]})}function aw(e,t,a={}){const{t:r}=xe.useTranslation(),[s,l]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(l(!0),!1):!0,[e]),d=s?n.jsx(gd,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{l(!1),t()},onClose:()=>l(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function rw({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,s]=o.useState(""),[l,i]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),h=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async y=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),y()}catch(f){c(Ol(f)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),m=o.useCallback((y,C)=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&p(C)},[p]),g=y=>{s(y.target.value),c(null)};return n.jsx(Rn,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:l,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:l,onClick:({closeWithAnimation:y})=>y()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||l,onClick:({closeWithAnimation:y})=>{p(y)}}],children:({closeWithAnimation:y})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?h:void 0,"aria-describedby":u?h:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:g,onKeyDown:C=>m(C,y),disabled:l,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:h,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const yd=["var(--color-main)","var(--color-sub)"],ow=2e3;function sw(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function Ts({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:s,trigger:l=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),f=t-C,_=(b,w)=>Array.from({length:b}).map((v,A)=>{const x=6+Math.random()*12,E=Math.round(Math.min(18,x*Math.min(1.5,1+r*.4))),B=yd[Math.floor(Math.random()*yd.length)],D=Math.random()*300,N=(360+Math.random()*260)*r*1.2,k=(w==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,P=Math.cos(k)*N,$=Math.sin(k)*N*1.35,G=Math.random()*720-360,T=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),F=Math.random()>.7?"50%":"3px";return{id:`${w}-${A}`,side:w,size:E,color:B,delay:D,vx:P,vy:$,angularVel:G,life:T,borderRadius:F}});return[..._(C,"left"),..._(f,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),h=o.useRef(s);o.useEffect(()=>{h.current=s},[s]);const p=o.useRef(null),m=o.useRef(null),g=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&m.current==null&&(m.current=g()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const K=setTimeout(()=>h.current?.(),0);return()=>clearTimeout(K)}const C=1200,f=performance.now(),_=m.current&&m.current!==document.body?m.current.getBoundingClientRect():null,b=Math.max(60,(window.innerHeight||800)*.05),w=K=>Math.max(40,(K||window.innerWidth)*.02),v=_?.width||window.innerWidth||375,A=_?.height||window.innerHeight||812,x=K=>{const L=[...K].sort((W,Y)=>W-Y);return L[Math.floor(L.length/2)]||1},E=x(i.map(K=>Math.abs(K.vy))),B=x(i.map(K=>Math.abs(K.vx))),D=Math.sqrt(2*C*(A*.72+b))/E,N=E*D/C,k=v*.5/(B*N),P=(K,L,W)=>Math.min(W,Math.max(L,K)),$=P(D,.8,2.4),G=P(k,.7,2.2),T=a>0?a/ow:1,F=i.map(K=>({...K,life:K.life*T,vx:K.vx*G,vy:K.vy*$,startTime:f+K.delay,ended:!1})),M=_?{x:_.left-w(_.width),y:_.top+_.height+b}:{x:-w(window.innerWidth),y:window.innerHeight+b},Q=_?{x:_.left+_.width+w(_.width),y:_.top+_.height+b}:{x:window.innerWidth+w(window.innerWidth),y:window.innerHeight+b},Z=K=>{let L=!1;for(const W of F){const Y=c.current[W.id];if(!Y||!Y)continue;if(K<W.startTime){Y.style.display="none",L=!0;continue}if(!W._inited){const V=W.side==="left"?M.x:Q.x,ae=W.side==="left"?M.y:Q.y;Y.style.left=`${V}px`,Y.style.top=`${ae}px`,Y.style.transform="translate3d(0px, 0px, 0)",Y.style.display="block",Y.style.zIndex="100000",typeof W.color=="string"&&W.color.startsWith("var(")&&(Y.style.background=sw(Y,W.color)??"#FF0060"),W._inited=!0}const U=(K-W.startTime)/1e3;if(U<0)continue;const j=W.life/1e3;if(U>=j){Y.style.opacity="0",Y.style.display="none",W.ended=!0;continue}L=!0;const R=W.side==="left"?M.x:Q.x,z=W.side==="left"?M.y:Q.y,O=R+W.vx*U,ue=z+W.vy*U+.5*C*U*U,te=(W.angularVel||0)*U,de=O-R,ee=ue-z;Y.style.transform=`translate3d(${de}px, ${ee}px, 0) rotate(${te}deg)`,Y.style.opacity=`${Math.max(0,1-U/j)}`}L?d.current=requestAnimationFrame(Z):h.current?.()};d.current=requestAnimationFrame(Z);const I=setTimeout(()=>{try{if((m.current?m.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const K=document.createElement("div");K.className="party-container",K.style.position="fixed",K.style.inset="0",K.style.pointerEvents="none",K.style.overflow="visible",K.style.zIndex="2147483647";for(const L of i){const W=document.createElement("span");W.className=`confetti confetti--${L.side}`,W.setAttribute("aria-hidden","true"),W.style.display="none",W.style.position="fixed",W.style.left="0px",W.style.top="0px",W.style.width=`${L.size}px`,W.style.height=`${Math.max(4,L.size*.6)}px`,W.style.background=L.color,W.style.borderRadius=L.borderRadius,W.style.transform="translate3d(0,0,0)",W.style.opacity="0",K.appendChild(W),c.current[L.id]=W}(document.body||m.current).appendChild(K),p.current=K}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(I),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,l,i]),!e)return null;const y=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:f=>{c.current[C.id]=f},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${l}`))});return typeof document<"u"?pn.createPortal(y,m.current||document.body):y}const Ms=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function lw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const l=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Ms(u.count),strength:Ms(u.strength),duration:Ms(u.duration)}))};return window.addEventListener("party:trigger",l),()=>window.removeEventListener("party:trigger",l)},[]);const s=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(Ts,{active:t,trigger:e}),a&&n.jsx(Ts,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:s})]})}function iw({title:e,sub:t,rightAction:a,titleAction:r,badge:s,badgeVariant:l="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:h}=xe.useTranslation();Ey(typeof e=="string"?e:i??null);const p=c??h("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(be,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),s&&n.jsx("div",{className:"page-title__badge",children:n.jsx(on,{label:s,size:"small",variant:l,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function uw(e){return e??""}const vd=o.createContext({words:[],loading:!1});function cw(){return o.useContext(vd)}function dw({words:e,loading:t,error:a,statusMessage:r,localVersion:s,remoteVersion:l,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const h=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:s,remoteVersion:l,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,s,l,i,u,c]);return n.jsx(vd.Provider,{value:h,children:d})}function pw({items:e,actions:t,columns:a,flat:r=!1,className:s,style:l}){const i=a??e.length;return n.jsx("section",{className:Ae("summary-strip",r&&"summary-strip--flat",s),style:{"--summary-strip-cols":String(i),...l},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const hw=(e,t)=>`${e} / ${t}`;function mw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:s=hw,pageWidth:l,pageHeight:i,margin:u,className:c,style:d}){const{t:h}=xe.useTranslation(),p=o.useRef(null),m=o.useRef(null),g=o.useRef(null),y=o.useRef(null),[C,f]=o.useState(null),[_,b]=o.useState(!1);o.useEffect(()=>{const T=p.current;if(!T)return;const F=()=>b(T.scrollWidth>T.clientWidth+1);if(F(),typeof ResizeObserver>"u")return;const M=new ResizeObserver(F);return M.observe(T),()=>M.disconnect()},[C]);const w=e.map(T=>`${T.id}\0${T.section??""}\0${T.group??""}`).join(""),v=C&&C.shape===w?C.pages:null,[A,x]=o.useState(0);o.useEffect(()=>{const T=y.current;if(!T||typeof ResizeObserver>"u")return;const F=new ResizeObserver(()=>x(T.offsetHeight));return F.observe(T),()=>F.disconnect()},[]);const[E,B]=o.useState(0);o.useEffect(()=>{const T=m.current;if(!T||typeof ResizeObserver>"u")return;let F=null;const M=typeof requestAnimationFrame=="function"?I=>requestAnimationFrame(I):I=>setTimeout(I,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:I=>clearTimeout(I),Z=new ResizeObserver(()=>{F==null&&(F=M(()=>{F=null,B(I=>I+1)}))});return Array.from(T.children).forEach(I=>Z.observe(I)),()=>{Z.disconnect(),F!=null&&Q(F)}},[w]),o.useLayoutEffect(()=>{const T=m.current,F=y.current;if(!T||!F)return;const M=j=>j.getBoundingClientRect().height||j.offsetHeight,Q=new Map;g.current?.querySelectorAll("[data-chrome-section]").forEach(j=>{Q.set(j.dataset.chromeSection??"",M(j))});const Z=j=>M(F)-(Q.get(j??"")??0),I=Array.from(T.children).map(j=>M(j)),K=[];e.forEach((j,R)=>{const z=K[K.length-1],O=z?e[z[0]]:void 0;O&&j.group!=null&&O.group===j.group&&O.section===j.section?z.push(R):K.push([R])});const L=[];let W=[],Y=0;const U=()=>{W.length&&L.push(W),W=[],Y=0};K.forEach(j=>{const R=j.reduce((O,ue)=>O+I[ue],0),z=Z(e[j[0]].section);W.length&&e[W[0]].section!==e[j[0]].section&&U(),R>z?j.forEach(O=>{W.length&&Y+I[O]>z+.01&&U(),W.push(O),Y+=I[O]}):(W.length&&Y+R>z+.01&&U(),j.forEach(O=>W.push(O)),Y+=R)}),U(),f(j=>j&&j.shape===w&&JSON.stringify(j.pages)===JSON.stringify(L)?j:{shape:w,pages:L})},[w,A,l,i,u,E]);const D=Lo,N=D,k=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:N,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),P=(T,F,M)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:M!=null&&t?.[M]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:k}),n.jsx("span",{className:"report-doc__page-no",children:s(T,F)})]})}),$=Array.from(new Set(e.map(T=>T.section??""))),G={...l?{"--report-page-w":l}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:Ae("report-doc",c),style:G,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?h("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:y,className:"report-doc__ruler"}),n.jsx("div",{ref:g,children:$.map(T=>{const F=P(1,1,T||void 0);return n.jsxs("div",{"data-chrome-section":T,children:[F.header,F.footer]},T)})}),n.jsx("div",{ref:m,className:"report-doc__measure-blocks",children:e.map(T=>n.jsx("div",{children:T.content},T.id))})]}),v&&n.jsx("div",{className:"report-doc__pages",children:v.map((T,F)=>{const{header:M,footer:Q}=P(F+1,v.length,e[T[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[M,T.map(Z=>n.jsx("div",{children:e[Z].content},e[Z].id)),Q]},F)})})]})}function Cw({title:e,fields:t,columns:a=4,className:r,style:s}){return n.jsxs("div",{className:Ae("report-info",r),style:{"--report-info-cols":String(a),...s},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((l,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:l.label}),n.jsx("span",{className:"report-info__value",children:l.value})]},i))})]})}const oa=new Map;let Pr=null;const fw=12;function bw(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function Fr(){const e=new Map;for(const t of oa.keys()){if(!t.isConnected)continue;const a=bw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,s)=>r.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const s=r.getBoundingClientRect().height;s>0&&(a+=s+fw)}}}function gw(e){return typeof window>"u"?()=>{}:(oa.set(e,(oa.get(e)??0)+1),oa.get(e)===1&&typeof ResizeObserver<"u"&&(Pr??(Pr=new ResizeObserver(()=>Fr())),Pr.observe(e)),Fr(),()=>{const t=(oa.get(e)??1)-1;if(t>0){oa.set(e,t),Fr();return}oa.delete(e),Pr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Fr()})}function yw({title:e,message:t,actionLabel:a,onAction:r,icon:s,onClose:l,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),h=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,m=p?.parentElement?.closest(".update-alert-stack")??p,g=m?gw(m):null;return()=>{g?.(),h.current&&p&&p.contains(document.activeElement)&&hr(p)}},[]),n.jsxs("div",{ref:d,className:Ae("update-alert",i),role:"alert",children:[l&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{h.current=!0,l()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:s??n.jsx(qs,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(be,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function vw({title:e,titleLevel:t=3,description:a,topActions:r,children:s,footerLeft:l,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:h,onDragEnd:p,className:m}){const g=t?`h${t}`:"div",y=l!=null||i!=null,C=s!=null&&s!==!1,f=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:Ae("training-card",c?"training-card--clickable":"",m),onClick:c,onKeyDown:c?f:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:h,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(g,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:s}),y&&n.jsxs("div",{className:"training-card__footer",children:[l!=null&&n.jsx("div",{className:"training-card__footer-left",children:l}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function _w({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:s,beforeSort:l,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:h=!1,onDragOver:p,onDragLeave:m,onDrop:g,children:y,className:C}){const{t:f}=xe.useTranslation(),_=o.useId(),b=t?`h${t}`:"span",w=s!=null,v=Ae("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",w&&"training-card-group--collapsible",C);return n.jsxs("div",{className:v,onDragOver:p,onDragLeave:m,onDrop:g,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[w&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?f("common.expandFor",{name:e}):f("common.collapseFor",{name:e}):r?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:s}),typeof e=="string"?n.jsx(b,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(l!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:A=>A.stopPropagation(),children:[l,i&&n.jsx(_n,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?f("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:y}))]})}const xw="speechear:saved_word_tables";function ww(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function Bw(){try{const e=localStorage.getItem(xw);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(ww):[]}catch{return[]}}function _d(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Ls(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function kw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let s=2;t.has(r);s++)r=`${a.id}~${s}`;return t.add(r),r===a.id?a:{...a,id:r}})}function Aw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:s,filterDefaultCollapsed:l,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:h,baseItem:p,baseContentTypes:m,cellCapacity:g,maxItemsPerPage:y,items:C,onSaveComplete:f,onLoad:_,onRemoveItem:b,onCopyItem:w,onReset:v,resetLabel:A,saveButtonLabel:x,secondarySaveButtonLabel:E,onReorder:B,showCellCount:D,onAddItem:N,className:k,renderSavePopup:P,renderWordSearch:$,hideControls:G,saveOnly:T,tableName:F,nameValue:M,onNameChange:Q,descriptionValue:Z,onDescriptionChange:I,namePlaceholder:K,descriptionPlaceholder:L,existingNames:W,editingName:Y,onCancel:U,initialItemsPerPage:j,renderCellAction:R,actionsLeftExtra:z}){const{t:O}=xe.useTranslation(),ue=A??O("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),te=C===void 0,de=!!Q,[ee,V]=o.useState([]),ae=(M??"").trim(),H=ae||(K??"").trim(),q=(Z??"").trim()||(L??"").trim(),ie=(W??[]).map(ne=>ne.trim().toLowerCase()),Ne=[Y?.trim().toLowerCase(),...ee].filter(ne=>!!ne),_e=[...ie];for(const ne of Ne){const fe=_e.indexOf(ne);fe!==-1&&_e.splice(fe,1)}const he=ae!==""&&_e.includes(ae.toLowerCase()),[je,$e]=o.useState(Array(4).fill(null)),[De,le]=o.useState(4),[we,Le]=o.useState(null),Be=je.slice(0,De),ze=!!d?.show,[Ve,ut]=o.useState(!0),[et,Xe]=o.useState(!0),yt=d&&{...d,top:Ve,bottom:et},[Te,Ke]=o.useState("landscape"),[ke,qe]=o.useState([...fc]),[Je,tt]=o.useState("show"),[xt,wt]=o.useState(!0),[Dt,rt]=o.useState(!0),nt=o.useRef(null),kt=o.useRef([]),[At,Lt]=o.useState(j==="all"?Number.POSITIVE_INFINITY:j??8),[jt,vt]=o.useState("right"),[ot,ct]=o.useState(!1),[dt,_t]=o.useState(!1),{toastMessage:Ce,toastType:Pe,showWarning:ye,clearToast:Ye}=Ui("warning"),bt=o.useCallback(()=>Le(null),[Le]);N&&!te&&!D&&!g&&Bt("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 cellCapacity \uB098 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.'),p&&te&&Bt("word-table-block-base-item-in-edit","[WordTableBlock] baseItem \uC740 \uD45C\uC2DC \uBAA8\uB4DC(items \uB97C \uC8FC\uB294 \uAF34)\uC5D0\uC11C\uB9CC \uAC78\uB9B0\uB2E4 \u2014 \uD3B8\uC9D1 \uACA9\uC790\uC5D0\uB294 \uC11C\uC9C0 \uC54A\uB294\uB2E4.");const[Nt,mt]=o.useState(()=>Math.max(C?.length??1,1)),gt=Math.max(g??0,C?.length??0,1),Me=te?De:D?Math.max(Nt,C?.length??1,1):gt,{width:lt,height:re}=ea[Te],ve=!te&&!D,Ie=Math.max(1,Math.min(gt,y??gt)),We=Math.min(At,Ie),Qe=ve?We:Me,st=Math.ceil((C?.length??0)/Math.max(1,Qe)),Tt=(C?.length??0)<gt?Math.floor((C?.length??0)/Math.max(1,Qe))+1:0,ln=ve?Math.max(1,st,Tt):0,un=ve?Array.from({length:ln},(ne,fe)=>(C??[]).slice(fe*Qe,(fe+1)*Qe)):null,$t=!!un&&un.length>1,Ot=te?Be.some(ne=>ne!==null&&ne.length>1):(C??[]).some(ne=>(ne.words??[]).length>1),cn=F?.trim()||`${Kl(Pa())} ${Ot?O("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):O("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Pt=o.useCallback(()=>$t?kt.current.filter(ne=>ne!==null):nt.current?[nt.current]:[],[$t]),{print:kn,openNewWindow:Jt,downloadHtml:St}=ps({getElements:Pt,paperW:lt,paperH:re,fileName:cn,onPopupBlocked:()=>{ye(O("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),Rt=ne=>{le(ne),$e(fe=>fe.length>=ne?fe:[...fe,...Array(ne-fe.length).fill(null)]),Le(null)},Wt=ne=>{$e(fe=>{const Fe=[...fe];return Fe[ne]=null,Fe}),we===ne&&Le(null)},Kt=ne=>{if(we===null)return;const fe=we;$e(it=>{const pt=[...it];return pt[fe]=ne.length>0?ne:null,pt});const Fe=Be.findIndex((it,pt)=>pt>fe&&it===null);Le(Fe!==-1?Fe:null)},bn=te?Be.some(ne=>ne?.some(fe=>!!fe.colloquialPronunciation)):(C??[]).some(ne=>(ne.words??[]).some(fe=>!!fe.colloquialLabel)),Ut=!te&&bc([...p?[p]:[],...C??[]]),Qt=o.useMemo(()=>ua()?te?je.slice(0,De).flatMap(ne=>(ne??[]).map(fe=>[fe.word,fe.homonum])):(ne=>ne.flatMap(fe=>(fe.words??[]).map(Fe=>[Fe.label,Fe.homonum])))([...p?[p]:[],...C??[]]):[],[te,je,De,C,p]),[dn,gn]=o.useState(!1);o.useEffect(()=>{if(Qt.length===0)return;let ne=!1;return Promise.all(Qt.map(([fe,Fe])=>Tl(fe,Fe))).then(fe=>{ne||gn(fe.some(Boolean))},()=>{}),()=>{ne=!0}},[Qt]);const Ht=Qt.length>0&&dn,An=o.useMemo(()=>[...te||D?[{label:O("wordTable.filter.columns","\uCE78 \uC218"),items:V4.map(ne=>({value:`${ne}\uCE78`,displayLabel:O("wordTable.filter.column",{count:ne})})),display:"segmented"}]:[],...ve&&(C?.length??0)>0?[kc(O,{hasPairs:Ot,itemCount:gt,max:y})]:[],...$t?[U4(O)]:[]],[O,te,D,ve,C?.length,Ot,gt,y,$t]),pe={...te||D?{[O("wordTable.filter.columns","\uCE78 \uC218")]:`${Me}\uCE78`}:{},...ve&&(C?.length??0)>0?{[O(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${We}\uAC1C`}:{},...$t?{[O("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:jt}:{}},Se=(ne,fe)=>{fe===O("wordTable.filter.columns","\uCE78 \uC218")?te?Rt(parseInt(ne)):mt(parseInt(ne)):fe===O(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?Lt(Ac(parseInt(ne),gt)):fe===O("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&vt(Nc(ne))},Re=te?kw(Be.filter(ne=>ne!==null&&ne.length>0).map(ne=>({id:Ls(ne),words:ne.map(_d)}))):C??[],Ue=()=>{te&&$e(ne=>ne.length>De?ne.slice(0,De):ne)},Oe=(ne=!1)=>{if(_t(ne),de&&f){const fe=H.trim().toLowerCase();fe&&V(Fe=>Fe.includes(fe)?Fe:[...Fe,fe]),f(H,Re,q||void 0,ne),Ue();return}if(T&&f){f("",Re,void 0,ne),Ue();return}if(f){ct(!0);return}St()},[X,ce]=o.useState(!1),[Ee,He]=o.useState(""),Ge=Ee.trim(),Ze=Ge!==""&&ie.includes(Ge.toLowerCase()),Ct=()=>{He(H?O("wordTable.save.copyName",{name:H,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),ce(!0)},ft=()=>{!Ge||Ze||!f||(f(Ge,Re,q||void 0,!0),Ue(),ce(!1))},ge=Re.length===0,S=ge||de&&(H===""||he),J=()=>{if(ge){ye(O("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(de&&H===""){ye(O("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}de&&he&&ye(O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},me=n.jsx(_a,{items:Re,orientation:Te,contentTypes:ke,baseItem:p,baseContentTypes:m,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Me});return n.jsxs(n.Fragment,{children:[n.jsxs(va,{type:"page",icon:t,title:e,disc:a,className:Ae("word-table-block",k),children:[X&&n.jsx(Rn,{size:"small",title:E??O("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>ce(!1),footer:({closeWithAnimation:ne})=>n.jsxs(n.Fragment,{children:[n.jsx(be,{htmlType:"button",size:48,type:"bar",label:O("common.cancel","\uCDE8\uC18C"),onClick:ne}),n.jsx(be,{htmlType:"button",size:48,type:"bar",variant:"main",label:O("common.save","\uC800\uC7A5"),disabled:!Ge||Ze,onClick:ft})]}),children:n.jsx(qn,{label:O("wordTable.save.nameLabel","\uC774\uB984"),value:Ee,onChange:He,placeholder:O("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:ft,error:Ze?O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),ot&&f&&P?.({defaultName:typeof e=="string"?e:O("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:me,previewW:lt,previewH:re,items:Re,existingNames:Bw().map(ne=>ne.name),saveAsNew:dt,onSave:(ne,fe)=>{f(ne,Re,fe,dt),Ue(),ct(!1)},onCancel:()=>ct(!1)}),(te||N)&&we!==null&&$?.({cellIndex:we,onConfirm:te?Kt:ne=>{if(N){const fe=ne[0];if(fe){const Fe=new Set((C??[]).map(pt=>pt.id));let it=Ls([fe]);for(let pt=2;Fe.has(it);pt++)it=`${Ls([fe])}~${pt}`;N({id:it,words:[_d(fe)]})}}Le(null)},onClose:bt}),!G&&n.jsx(is,{title:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:Ht,hasColloquial:bn,hasCaption:Ut,contentTypes:ke,orientation:Te,showOutline:xt,cutLine:Je,showDivLine:Dt,setters:{setContentTypes:qe,setOrientation:Ke,setShowOutline:wt,setCutLine:tt,setShowDivLine:rt,setShowTopInfo:ut,setShowBottomInfo:Xe},showCutLine:(ve?Qe:Me)>1,showDivLine2:Ot,middleSections:An,extraSelected:pe,onExtraSelect:Se,showPaperBands:ze,showTopInfo:Ve,showBottomInfo:et}),$t&&un?n.jsx("div",{className:"word-table-block__pages",children:un.map((ne,fe)=>n.jsx(_a,{orientation:Te,contentTypes:ke,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Qe,items:ne,baseItem:p,baseContentTypes:m,onRemoveItem:b,onCopyItem:w,onReorder:B&&((Fe,it)=>B(Fe+fe*Qe,it+fe*Qe)),indexOffset:fe*Qe,totalCount:C?.length??0,renderCellAction:R&&((Fe,it)=>R(Fe+fe*Qe,it)),showFillerAdd:!!N,onActivateCell:N?(Fe=>Le(Fe+fe*Qe)):void 0,addableCount:Math.max(0,Math.min(Qe,gt-fe*Qe)),brand:yt,code:h,contentRef:Fe=>{kt.current[fe]=Fe},pageNumber:{current:fe+1,total:un.length},pageNumberPosition:jt},fe))}):n.jsx(_a,{orientation:Te,contentTypes:ke,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Me,items:te?void 0:C??[],baseItem:te?void 0:p,baseContentTypes:m,editCells:te?Be:void 0,activeCell:we,onActivateCell:te||N?Le:void 0,onRemoveCell:te?Wt:void 0,onRemoveItem:te?void 0:b,onCopyItem:te?void 0:w,onReorder:te?void 0:B,renderCellAction:te?void 0:R,brand:yt,code:h,showFillerAdd:!!N,contentRef:nt}),!G&&!T&&z!=null&&n.jsx("div",{className:"word-table-block__table-actions",children:z}),de&&!G&&n.jsxs(Ja,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(sn,{variant:"custom",label:O("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(qn,{required:!0,value:M??"",onChange:Q,placeholder:K?K+O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):O("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:O("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:he?O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ne=>{(ne.key==="Tab"&&!ne.shiftKey||ne.key===" ")&&!(M??"").trim()&&(K??"").trim()&&(ne.preventDefault(),Q?.(K??""))}})}),n.jsx(sn,{variant:"custom",label:O("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(qn,{value:Z??"",onChange:I,placeholder:L?L+O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):O("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:O("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ne=>{(ne.key==="Tab"&&!ne.shiftKey||ne.key===" ")&&!(Z??"").trim()&&(L??"").trim()&&(ne.preventDefault(),I?.(L??""))}})})]})]}),!G&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!T&&_&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:O("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:_}),!T&&v&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:ue,onClick:v}),!T&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:O("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Jt})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[U&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:O("common.cancel","\uCDE8\uC18C"),onClick:U}),!T&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:O("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:kn}),E&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:E,onClick:()=>de?Ct():Oe(!0),disabled:ge,onDisabledClick:()=>{ye(O("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",label:x??O("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>Oe(!1),disabled:S,onDisabledClick:J})]})]}),n.jsx(ya,{message:Ce,type:Pe,onClose:Ye})]})}const Nw=8;function xd({items:e,className:t}){const{t:a}=xe.useTranslation(),r=e.length,s=r<=3?1:2,l=Nw,i=r>l,u=e.slice(0,i?l-1:l),c=r-u.length,d=Math.ceil(Math.min(r,l)/s)||1,h=s*d;return n.jsx("div",{className:Ae("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:Array.from({length:h},(p,m)=>{if(i&&m===l-1)return n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--more",children:n.jsx("span",{className:"word-table-thumb__more body-3",children:a("wordTable.thumbMore",{count:c,defaultValue:"+{{count}}"})})},m);const g=u[m];return g?n.jsx("div",{className:"word-table-thumb__cell",children:(g.words?.length?g.words:[{label:g.id}]).map((y,C)=>n.jsxs(o.Fragment,{children:[C>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:y.label})]},C))},m):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},m)})})}function Ew({items:e,name:t,description:a,createdAt:r,code:s,published:l,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:h,publishedAt:p,likeCount:m,downloadCount:g,onPublisherClick:y,selected:C,onClick:f,onMore:_,titleNode:b,className:w}){const{t:v}=xe.useTranslation(),A=b!=null,x=h!=null||p!=null||m!=null||g!=null,E=B=>{B.target===B.currentTarget&&!A&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f?.())};return n.jsxs("div",{className:Ae("word-table-button",C?"word-table-button--selected":"",x?"":"word-table-button--no-footer",w),role:"button",tabIndex:0,"aria-label":s?`${t} (${s})`:t,onClick:A?void 0:f,onKeyDown:E,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":v("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(xd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[b??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!A&&n.jsx(be,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:v("common.moreFor",{name:t}),onClick:B=>{B.stopPropagation(),_(B)}})]}),(s||r||l||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?Gl(r,v):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(l||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[l&&n.jsx(on,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??v("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(on,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??v("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),s&&n.jsx("span",{className:"word-table-button__code caption-1",children:s})]})]}),x&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[h&&(y?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":v("wordTable.publisherFilter",{name:h,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:B=>{B.stopPropagation(),y()},children:h}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:h})),p&&n.jsx("span",{className:"training-card__date body-4",children:Gl(p,v)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[m!=null&&n.jsx(on,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(m),"aria-label":v("common.likeCount",{count:m,defaultValue:`\uC88B\uC544\uC694 ${m}`})}),g!=null&&n.jsx(on,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(g),"aria-label":v("common.downloadCount",{count:g,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${g}`})})]})]})]})}/**
1041
+ `).map((i,u,c)=>n.jsxs(o.Fragment,{children:[i,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:l("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:l("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:l("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{e&&(i.preventDefault(),e())},children:l("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{t&&(i.preventDefault(),t())},children:l("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Lo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:l("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:l("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",s]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function D_({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:s,className:l,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),h=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,m]=o.useState(!1),g=o.useId(),y=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Zn(()=>{const v=document.getElementById(g);v&&v.contains(document.activeElement)&&y.current?.focus(),m(!1)}),b=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,w=v=>{v.matches&&m(!1)};return b&&(b.matches&&m(!1),b.addEventListener?.("change",w)),()=>{_(),b?.removeEventListener?.("change",w)}},[p,g]);const C=i?`${i} landing-header__inner`:"landing-header__inner",f=(_,b)=>u?u(_,{onClick:b}):n.jsx("a",{href:_.href,onClick:b,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:l?`landing-header ${l}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,b)=>n.jsx("span",{children:f(_)},`${b}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[s,r.length>0&&n.jsx("button",{ref:y,type:"button",onClick:()=>m(_=>!_),"aria-expanded":p,"aria-controls":g,"aria-label":p?h.close:h.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:g,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,b)=>n.jsx("span",{className:"landing-header__drawer-item",children:f(_,()=>m(!1))},`${b}:${_.href}`))})})]})}function S_({children:e,action:t,onClick:a,className:r}){const s=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:s,onClick:a,...ec(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function j_({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),s=o.useRef(null),l=o.useCallback(()=>{const C=t.current,f=C.phase!=="sound"&&C.at>0;s.current=f?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=s.current;return s.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,f,_=0)=>{if(!(C>0))return Promise.resolve(!0);const b=a.current;return t.current={phase:f,at:Date.now()-Math.max(0,_)},new Promise(w=>{const v=setTimeout(()=>{r.current===v&&(r.current=null),w(!!e.current&&b===a.current)},C);r.current=v})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),h=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),m=o.useCallback(()=>a.current,[]),g=o.useCallback(C=>C===a.current,[]),y=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:m,isCurrent:g,abort:u,waitPad:c,enterSound:d,leave:h,pause:l,resume:i,__bumpGenerationForTest:y}),[p,m,g,u,c,d,h,l,i,y])}const wa=9,T_=e=>Math.round(Math.min(wa,Math.max(0,e))/wa*100),M_=e=>e/100*wa,nr=2,Lc=.1,L_=e=>Math.min(nr,Math.max(0,e)),$_=.1,R_=e=>Math.round(e*1e6)/1e6;function ar(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return L_(t);const a=Math.min(wa,Math.max(0,Number(e.level)||0))/wa,r=Number(e.mainVolume);return r>0?a>0?R_(Math.min(nr,Math.max($_,a/r))):0:1}const $c=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Rc(e){return $c(e)}function Cs(e){return $c(e)*ar(e)}function fs(e,t=z1()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,Cs(e)/a)}function ta(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=ar({level:a.level,mainVolume:a.mainVolume})),a}const na={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},bs=o.createContext(null);function Ar(){return o.useContext(bs)}const gs=e=>`${O1()}/${e}`,Pc=e=>Array.from({length:10},(t,a)=>gs(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),Nr={get defaultNoise(){return gs("noise1.mp3")},get street(){return Pc("noise2")},get restaurant(){return Pc("noise3")},get buzz(){return gs("noise4.mp3")}};function P_(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return Nr.defaultNoise;case"street":return Nr.street[t];case"restaurant":return Nr.restaurant[t];case"buzz":return Nr.buzz;default:return null}}function F_({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const s=o.useRef(e?.registerAnalyser);s.current=e?.registerAnalyser;const l=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),h=o.useRef(null),p=o.useRef(null),m=o.useRef(0),g=o.useRef(null),y=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),g.current!==null&&(clearTimeout(g.current),g.current=null)},[]),f=o.useCallback((A,x=250)=>{const E=l.current;if(!E)return;const B=d.current;if(B){d.current=null;try{E.pause()}catch{}E.src=B,E.load()}if(!E.src)return;m.current+=1,C();try{ao(),sr(E).then(P=>{if(l.current===E)try{s.current?.("noise",P)}catch{}})}catch{}const D=E.paused?0:lr(E);E.paused&&Hn(E,0),E.play().catch(()=>{});const N=performance.now(),k=()=>{const P=Math.min(1,(performance.now()-N)/x);try{Hn(E,D+(A-D)*P)}catch{}P<1?p.current=requestAnimationFrame(k):p.current=null};p.current=requestAnimationFrame(k)},[C]),_=o.useCallback((A=250,x)=>{const E=l.current;if(!E||E.paused){x?.();return}const B=++m.current;C();const D=performance.now(),N=lr(E),k=()=>{const P=Math.min(1,(performance.now()-D)/A);try{Hn(E,N*(1-P))}catch{}if(P<1)p.current=requestAnimationFrame(k);else{p.current=null,g.current!==null&&(clearTimeout(g.current),g.current=null);try{E.pause()}catch{}x?.()}};p.current=requestAnimationFrame(k),g.current=setTimeout(()=>{if(g.current=null,m.current===B){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{E.paused||(Hn(E,0),E.pause(),x?.())}catch{}}},A+150)},[C]);o.useEffect(()=>{const A=document.createElement("audio");return A.loop=!0,A.crossOrigin="anonymous",l.current=A,()=>{C();try{A.pause(),A.removeAttribute("src"),A.load()}catch{}l.current=null,c.current=null,d.current=null}},[C]);const b=e?fs(e.settings):0,w=!!e?.settings.enabled&&b>0;o.useEffect(()=>{if(!w)return;let A=0;const x=setInterval(()=>{const E=l.current;if(!E||E.paused){A=0;return}const B=t.current;if(B&&!B.paused&&!B.ended||y()||a.current==="playing"){A=0;return}A+=1,A>=2&&(A=0,_())},400);return()=>clearInterval(x)},[_,w,t,a,y]),o.useEffect(()=>{const A=()=>{const x=l.current;if(document.hidden){if(x&&!x.paused){C();try{x.pause()}catch{}}return}if(!x||!x.paused)return;const E=t.current,B=!!E&&!E.paused&&!E.ended||y()||a.current==="playing",D=h.current;B&&D?.enabled&&D.volume>0&&f(D.volume)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[C,f,t,a,y]),o.useEffect(()=>{h.current=e?{enabled:e.settings.enabled,volume:b,type:e.settings.type}:null},[e,e?.settings.enabled,b,e?.settings.type]);const v=o.useRef(null);return o.useEffect(()=>()=>{v.current?.(),v.current=null},[]),o.useEffect(()=>{const A=e?.settings,x=l.current;if(!x)return;const E=A?fs(A):0;if(!A||!A.enabled||E===0){_();return}if(c.current!==A.type){const B=P_(A.type);B&&(c.current=A.type,u(B),d.current=B,_(150,()=>{if(d.current!==B)return;d.current=null,x.src=B,x.load();const D=t.current;if(D&&!D.paused||y()){v.current?.();const N=()=>{x.removeEventListener("canplay",N),v.current===k&&(v.current=null);const P=t.current,$=h.current;(P&&!P.paused&&!P.ended||y())&&$?.enabled&&$.volume>0&&f($.volume)},k=()=>x.removeEventListener("canplay",N);v.current=k,x.addEventListener("canplay",N)}}))}else{const B=t.current,D=!!B&&!B.paused&&!B.ended||y()||a.current==="playing";if(D&&d.current)f(E);else if(D&&x.paused&&x.src)f(E);else if(!x.paused)if(!D)_();else{C();const N=lr(x),k=performance.now(),P=()=>{const $=Math.min(1,(performance.now()-k)/150);try{Hn(x,N+(E-N)*$)}catch{}$<1?p.current=requestAnimationFrame(P):p.current=null};p.current=requestAnimationFrame(P)}}},[e?.settings,e?.settings.enabled,b,e?.settings.type,C,f,_,t,a,h,y]),o.useEffect(()=>{const A=l.current;if(A)try{A.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:l,activeNoiseUrl:i,noiseSettingsRef:h,cancelNoiseFade:C,fadeInNoise:f,fadeOutNoise:_}}function I_({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:s,setProgress:l,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:h,onDoneRef:p,handleEndRef:m}){const g=o.useRef(null),y=o.useRef(0),C=o.useRef(null),f=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{f.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const b=(A,x=1)=>{try{const E=(A||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(A||"").length);return Math.max(700,Math.round(E*300/Math.max(.25,x)))}catch{return 1200}},w=o.useCallback(A=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const x=window.speechSynthesis,E=++f.current;try{try{x.cancel()}catch{}const B=A??e,D=Array.isArray(B)?B.filter(T=>!!T):[B||""];D.length===0&&D.push("");const N=Math.max(.3,Math.min(3,t));y.current=D.reduce((T,F)=>T+b(F,N||1),0),g.current=performance.now(),l(0),i("playing"),u("playMode");const k=h.current;k?.enabled&&(k?.volume??0)>0&&c(k.volume);const P=()=>{try{const T=g.current||performance.now(),F=performance.now()-T,M=y.current||1200,Q=Math.min(1,F/M);try{r.current&&(r.current.style.left=`${Q*100}%`),s.current&&s.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(P))}catch{}},$=()=>{if(E===f.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),l(1),i("stopped");try{m.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},G=T=>{const F=new SpeechSynthesisUtterance(D[T]);try{F.rate=N}catch{}try{F.volume=Math.max(0,Math.min(1,a))}catch{}F.onend=()=>{if(E===f.current){if(T<D.length-1){try{G(T+1)}catch{$()}return}$()}},F.onerror=()=>{$()},F.onstart=()=>{if(!(T>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(P)}catch{}},_.current=!0,x.speak(F)};try{G(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,s,l,i,u,h,p,m]),v=o.useCallback(()=>{f.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),g.current=null}catch{}i("stopped"),u("active"),l(0)},[d,i,u,l]);return{startTTS:w,stopTTS:v}}const O_=.01,z_=.3;async function W_(e,t,a,r=!1){let s=null;try{const l=window.AudioContext||window.webkitAudioContext;s=new l;const i=await s.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const g=Math.floor(z_*i.sampleRate),y=Math.min(u.length,g);for(;c<y&&Math.abs(u[c])<=O_;)c++;c>=y&&(c=0)}const d=u.length-c,h=a&&a>0?Math.min(d,Math.floor(a*i.sampleRate)):d,p=Math.max(t,h),m=Math.floor(p/t)||1;return new Array(t).fill(0).map((g,y)=>{const C=c+y*m,f=Math.min(C+m,c+p,u.length);let _=0;for(let b=C;b<f;b++){const w=Math.abs(u[b]);w>_&&(_=w)}return _})}catch{return null}finally{try{s?.close?.()}catch{}}}async function Fc(e,t,a,r=!1){try{const s=await fetch(e);if(s.ok===!1)return null;const l=await s.arrayBuffer();return await W_(l,t,a,r)}catch(s){try{const l=Ol(s)}catch{}return null}}const ys=45,H_=74,V_=2;function Er(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Dr(e){return Er(e)/45}const q_=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Ic=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Oc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Ic(t),s=Ic(a),l=[];let i=0;return e.forEach((u,c)=>{for(const[d,h]of[["lead",r],["sound",q_(u)],["tail",s]])l.push({kind:d,track:c,startMs:i,durMs:h}),i+=h}),{segments:l,totalMs:i,trackCount:e.length}}function zc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,s,l]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:s,tail:l,totalMs:r.durMs+s.durMs+l.durMs}}function U_(e,t){const a=zc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],s=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+s)/a.totalMs))}function G_(e,t,a){const r=Math.max(0,Math.floor(a)),s=zc(e,t);if(!s||r===0||!(s.totalMs>0)||s.lead.durMs===0&&s.tail.durMs===0||!(s.sound.durMs>0))return{lead:0,sound:r,tail:0};const l=Math.round(s.lead.durMs/s.totalMs*r),i=Math.round(s.tail.durMs/s.totalMs*r),u=Math.max(1,r-l-i),c=l+u+i-r;return{lead:Math.max(0,l-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function K_({currentTime:e,sources:t,index:a,audioDuration:r}){const s=a||0,l=Array.isArray(t)&&t.length>0?t[s]:void 0,i=l?l.duration||r||0:r||0;if(!(i>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/i))}function Y_({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:s,tailMs:l}){const i=Oc({durationsSec:[r],leadInMs:s,tailMs:l});return U_(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Z_({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return G_(Oc({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function X_(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function J_({ended:e,completedByEnd:t}){return!!e||!!t}function Q_(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function ex(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function tx(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],s=[];for(const l of r)if(l){if(typeof l=="object"&&l!==null&&"src"in l&&l.src){const i=l;s.push({code:i.code??null,src:i.src});continue}if(typeof l=="string"&&(l.startsWith("http")||l.includes("/"))){s.push({code:null,src:l});continue}if(typeof l=="string"||typeof l=="number"){const i=String(l),u=a(i,t);u&&s.push({code:i,resolvedPath:u})}}return s}function nx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Wc(a)!==Wc(t):!0}function Wc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const Hc=4,ax=Dr(Hc/ys);function rx(e){const{src:t,segments:a,progress:r=0,waveProgressRef:s,noiseSrc:l,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:h,showSoundWaveForm:p=!0,leadInMs:m=0,tailMs:g=0,trackDurationSec:y=0}=e,C=o.useRef(null),f=o.useRef(null),[_,b]=o.useState(null),[w,v]=o.useState(!1),[A,x]=o.useState(null),[E,B]=o.useState(2),[D,N]=o.useState(0),[k,P]=o.useState(null),[$,G]=o.useState(!1),[T,F]=o.useState(!1),M=3,Q=3,Z=1,I=300,K=o.useRef(0),L=o.useCallback(()=>{const _e=C.current,he=f&&f.current?f.current:_e?_e.closest(".audio-player__wave"):null,je=he?he.getBoundingClientRect():_e?_e.getBoundingClientRect():null,$e=je?je.width:0,De=je?Math.max(100,je.width):320,le=je?je.height:0,we=Math.max(Z,Math.min(I,Math.floor((De+Q)/(M+Q)))),Le=we*M,Be=Math.max(0,we-1),ze=Math.max(0,Be>0?(De-Le)/Be:Q);return{bars:we,gap:ze,height:le,width:$e}},[]),W=o.useRef(void 0),Y=o.useRef(null),U=o.useCallback(async(_e,he,{quiet:je=!1}={})=>{const $e=++K.current,De=()=>K.current===$e;try{if(je||v(!1),W.current=_e,!_e){De()&&b(null);return}let le=he;if(!le)try{for(let Be=0;Be<4&&!(C.current||f.current);Be++)await new Promise(ze=>requestAnimationFrame(ze));await new Promise(Be=>requestAnimationFrame(Be));const Le=L();Le.height>0&&N(Le.height),le=Le.bars,B(Le.gap)}catch{le=120}Y.current=le;const we=await Fc(_e,le);if(!De())return;if(!we){b(null),v(!1);return}b(we),x(le),v(!0)}catch{if(!De())return;b(null),v(!1)}},[v,b,N,B,x,L]);o.useEffect(()=>{const _e=f.current;if(!_e||typeof ResizeObserver>"u")return;let he=null;const je=new ResizeObserver(()=>{he!==null&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;try{const $e=L();if($e.width<=0||($e.height>0&&N($e.height),Y.current===null||$e.bars===Y.current))return;const De=W.current;B($e.gap),De?U(De,$e.bars,{quiet:!0}).catch(()=>{}):Y.current=$e.bars}catch{}})});return je.observe(_e),()=>{je.disconnect(),he!==null&&cancelAnimationFrame(he)}},[L,U]),o.useEffect(()=>{const _e=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;U(typeof _e=="string"?_e:void 0).catch(()=>{}),F(!1)},[t,a,U]),o.useEffect(()=>{let _e=!1;if(G(!1),P(null),!l||!A)return;const he=c>0?c*(u||1):void 0;return Fc(l,A,he,!0).then(je=>{_e||(P(je),je||G(!0))}).catch(()=>{_e||(P(null),G(!0))}),()=>{_e=!0}},[l,A,c,u]);const j=Math.max(0,Math.min(1,d)),R=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),z=A||40,O=o.useMemo(()=>Z_({bars:z,trackDurationSec:y,leadInMs:m,tailMs:g}),[z,y,m,g]),ue=o.useMemo(()=>Array.from({length:z}).map((_e,he)=>{const je=he>=O.lead&&he<O.lead+O.sound,$e=O.sound>0&&je?Math.min(z-1,Math.round((he-O.lead)/O.sound*z)):-1,De=je?_&&_[$e]!=null?_[$e]:null:_?0:null,le=De==null?null:Math.min(1,De/R*j),we=le!=null&&D>0&&Er(le)<=Hc,Le=le==null?.15:we?0:Dr(le),Be=we,ze=z>1?he/(z-1):0;return n.jsx("div",{className:Be?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":Le,"--i":he,"--mix":ze}},he)}),[z,_,R,j,D,O]),te={"--progress":String(Math.max(0,Math.min(1,r)))},de=o.useMemo(()=>k&&k.length&&Math.max(...k.map(_e=>Number.isFinite(_e)?Math.abs(_e):0))||1,[k]),ee=j*Math.max(0,i),V=!l||!k||!k.length?1:Math.max(1,ee),ae={"--bar-gap":`${E}px`,"--wave-h":`${Er(V)}px`,"--wave-h1":`${ys}px`},H=w&&(l?!!k||$:!0);o.useEffect(()=>{H&&F(!0)},[H]);const q=T?w:H;o.useEffect(()=>{h?.(q)},[q,h]);const ie=A||40,Ne=o.useMemo(()=>Array.from({length:ie}).map((_e,he)=>{const je=k&&k[he]!=null?k[he]:null,$e=je==null?0:Math.abs(je)/de*ee,De=Math.max(ax,Dr($e)),le=ie>1?he/(ie-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":De,"--i":he,"--mix":le}},he)}),[ie,k,de,ee,D]);return n.jsxs("div",{className:"audio-player__wave",ref:f,style:ae,children:[l&&n.jsx("div",{className:`audio-player__wave-noise ${H?"is-ready":""}`,"aria-hidden":"true",children:Ne}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${q?"is-ready":""}`,ref:C,children:ue}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${q?"is-ready":""}`,ref:s,style:te,children:ue})]})]})}const Vc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function vs(e,t){return new Promise((a,r)=>{const s=document.createElement("audio");let l=!1;const i=()=>{try{s.removeAttribute("src"),s.load()}catch{}},u=()=>{if(l)return;l=!0;const d=isFinite(s.duration)&&s.duration||0;i(),a(d)},c=d=>{l||(l=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};s.addEventListener("loadedmetadata",u),s.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),s.src=e})}const ox=2e3;function qc(e,t=ox){return new Promise(a=>{let r=!1;const s=()=>{r||(r=!0,a())};e.addEventListener("canplay",s,{once:!0}),e.addEventListener("error",s,{once:!0}),setTimeout(s,t)})}function sx({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),s=o.useRef([]),l=o.useCallback(c=>{if(r.current=c,!c||!s.current.length)return;const d=s.current;s.current=[];for(const h of d)h(!0)},[]),i=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(h),s.current=s.current.filter(m=>m!==d),c(p)},h=setTimeout(()=>d(!0),a);s.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=s.current;s.current=[];for(const d of c)d(!1)},[]),{onReadyChange:l,waitForReady:u,markNotReady:i}}function lx(){const e=o.useRef([]),t=o.useCallback(s=>(e.current.push(s),s),[]),a=o.useCallback(s=>{const l=new Set([...s].filter(Boolean));e.current=e.current.filter(i=>{if(l.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const s of e.current)try{URL.revokeObjectURL(s)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function ix({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),s=o.useCallback(()=>r(null),[]),l=o.useCallback(()=>{try{const i=t.current?.getBoundingClientRect();if(!i)return;r({left:i.left,right:i.right,width:i.width,height:i.height,x:i.x,top:i.top+e,bottom:i.bottom+e,y:i.y+e,toJSON:i.toJSON.bind(i)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a,s]),{ref:t,rect:a,show:l,hide:s}}function ux(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const cx=400,dx=2e3,Uc=5;function px({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:s,sequencer:l,leadInMs:i=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),h=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),m=o.useCallback(()=>{if(c.current!==null)return;let y=0;const C=()=>{if(On){const f=typeof performance<"u"&&performance.now?performance.now():Date.now();if(y>0&&f-y>cx){const _=h.current===null||f-h.current>dx;if(h.current=f,_&&d.current<Uc){d.current+=1;const b=d.current;let w=null;try{w=typeof document<"u"?document.visibilityState:null}catch{}Bt(`progress-ticker-slow-frames#${b}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(f-y)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,w==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",b>=Uc?`(${b}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${b}\uBC88\uC9F8)`)}}y=f}try{const f=e.current,_=Array.isArray(r.current)?r.current[s.current||0]:void 0,b=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,w=b?0:ux(f),v=t.current,A=(i||0)>0||(u||0)>0,x=A&&(l?.positionRef.current?.phase??"sound")!=="sound";if(w===null&&!x)try{v&&v.style.visibility!=="hidden"&&(v.style.visibility="hidden")}catch{}else{const E=b?_.duration:w||0;On&&x&&!(E>0)&&Bt("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const B=A?Y_({phase:l?.positionRef.current?.phase??"sound",phaseElapsedMs:l?.positionRef.current?Math.max(0,Date.now()-l.positionRef.current.at):0,currentTime:f&&typeof f.currentTime=="number"?f.currentTime:0,trackDurationSec:E,leadInMs:i||0,tailMs:u||0}):K_({currentTime:f&&typeof f.currentTime=="number"?f.currentTime:0,sources:r.current,index:s.current,audioDuration:w??0});try{v&&(v.style.visibility&&(v.style.visibility=""),v.style.left=`${B*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(B))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,s,l,i,u]),g=o.useCallback(y=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${y*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(y))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:m,stop:p,settleTo:g}}function _s({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:s=!1,ttsText:l=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:h=0}){const{t:p}=xe.useTranslation(),m=e,g=Ar(),y=o.useRef(g?.registerAnalyser);o.useEffect(()=>{y.current=g?.registerAnalyser});const C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),b=lx(),w=o.useRef(null),v=o.useRef(!1),A=o.useRef(null),{ref:x,rect:E,show:B,hide:D}=ix();o.useEffect(()=>()=>{y.current?.("main",null),y.current?.("noise",null)},[]);const[N,k]=o.useState(!1),[P,$]=o.useState("idle"),[G,T]=o.useState("stopped"),F=o.useRef("stopped");o.useEffect(()=>{F.current=G},[G]);const[M,Q]=o.useState(0),[Z,I]=o.useState("active"),K=o.useRef(!1);o.useEffect(()=>{if(Z!=="playMode"||!K.current)return;K.current=!1;const X=typeof document<"u"?document.activeElement:null;if(X&&X!==document.body)return;const ce=_.current?.querySelectorAll("button")[1];try{ce?.focus()}catch{}},[Z]);const[L,W]=o.useState(null),[Y,U]=o.useState(null),[j,R]=o.useState(0),[z,O]=o.useState(!1),[ue,te]=o.useState(0),de=g?.playbackRate??1,ee=g?.mainVolume??1,V=g?Cs(g.settings):0,ae=g?Rc(g.settings):ee,[H,q]=o.useState("idle"),[ie,Ne]=o.useState(""),[_e]=o.useState("top"),he=o.useRef(null),je=o.useRef(0),$e=o.useRef(null),De=o.useRef(!0),le=j_({mountedRef:De}),we=o.useRef(null),Le=o.useRef(d),Be=o.useRef(h);o.useEffect(()=>{Le.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Be.current=Math.max(0,h||0)},[h]);const{start:ze,stop:Ve,settleTo:ut}=px({audioRef:C,fillRef:f,waveProgressRef:$e,sourcesRef:he,currentIndexRef:je,sequencer:le,leadInMs:d,tailMs:h}),{onReadyChange:et,waitForReady:Xe,markNotReady:yt}=sx({showSoundWaveForm:u,showNoiseWaveForm:c}),Te=o.useRef(null),Ke=o.useRef(s),ke=o.useRef(r),qe=o.useRef(null),Je=o.useRef(!1),[tt,xt]=o.useState(!1),wt=o.useCallback(X=>{Je.current=X,xt(X)},[]),Dt=o.useRef(null),{activeNoiseUrl:rt,noiseSettingsRef:nt,fadeInNoise:kt,fadeOutNoise:At}=F_({noisePlayer:g,audioRef:C,playbackStateRef:F,sequencer:le}),{startTTS:Lt,stopTTS:jt}=I_({ttsText:l,playbackRate:de,mainVolume:ae,fillRef:f,waveProgressRef:$e,setProgress:Q,setPlaybackState:T,setStateLocal:I,fadeInNoise:kt,fadeOutNoise:At,noiseSettingsRef:nt,onDoneRef:ke,handleEndRef:Dt});o.useEffect(()=>{Pe.current=jt});const vt=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Ne(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}Lt(X);return}Nt("tts"),Lt(X)},ot=Array.isArray(t)?t.filter(Boolean):t?[t]:[],ct=(!ot||ot.length===0)&&!!l,dt=Array.isArray(L)&&L.length>0?L:Array.isArray(Y)&&Y.length>0?Y:null,_t=Math.max(Array.isArray(dt)?dt.length:0,ot.length);o.useEffect(()=>(De.current=!0,()=>{De.current=!1}),[]);const Ce=()=>{le.abort()},Pe=o.useRef(null),ye=o.useRef(null),Ye=o.useRef(null),bt=o.useRef(null);bt.current||(bt.current=()=>{Ye.current=null;const X=C.current;if(ye.current==="audio"&&X&&(!X.paused||le.isRunning())){Ce();try{X.pause()}catch{}De.current&&(T("paused"),Ve(),At())}else if(ye.current==="tts")try{Pe.current?.()}catch{}});const Nt=X=>{ye.current=X,Ye.current=Ga(bt.current)},mt=()=>{Ye.current?.(),Ye.current=null};o.useEffect(()=>()=>{bt.current&&yr(bt.current)},[]);const gt=o.useRef(de);o.useEffect(()=>{gt.current=de||1},[de]);const Me=o.useCallback(X=>{const ce=gt.current||1;try{X.defaultPlaybackRate=ce}catch{}try{X.playbackRate=ce}catch{}},[]),lt=o.useCallback((X,ce)=>{if(!nx(X,ce)){try{X.currentTime=0}catch{}Me(X);return}X.src=ce,Me(X),X.load(),Me(X)},[Me]),re=o.useCallback(()=>{qe.current&&(clearTimeout(qe.current),qe.current=null),q("idle")},[]),ve=o.useCallback(async(X,ce=3,Ee=50,He=0)=>{re();const Ge=le.generation(),Ze=!!X&&X.currentTime>0&&!X.ended,Ct=Math.max(0,Le.current-Math.max(0,He));if(Ct>0&&!Ze){Nt("audio"),ze(),T("playing");const ft=nt.current;if(ft?.enabled&&(ft.volume??0)>0)try{kt(ft.volume)}catch{}if(!await le.waitPad(Ct,"lead",He)||!De.current||!le.isCurrent(Ge))return!1}le.enterSound();for(let ft=0;ft<ce;ft++){if(!De.current||!le.isCurrent(Ge))return!1;try{return Nt("audio"),await X.play(),!0}catch(ge){if((ge instanceof Error||typeof ge=="object"&&ge&&"name"in ge?ge.name:void 0)==="AbortError"){if(!le.isCurrent(Ge))return!1;await new Promise(S=>setTimeout(S,Ee));continue}try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,ze,le,kt,nt,re]),Ie=o.useCallback(X=>{const ce=le.generation(),Ee=Math.max(0,Be.current-Math.max(0,X));ze();const He=nt.current;if(He?.enabled&&(He.volume??0)>0)try{kt(He.volume)}catch{}const Ge=()=>{try{we.current?.()}catch{}};if(Ee<=0){le.leave(),Ge();return}le.waitPad(Ee,"tail",X).then(Ze=>{le.leave(),Ze&&le.isCurrent(ce)&&Ge()}).catch(()=>{})},[le,ze,kt,nt]),We=o.useCallback(()=>{const X=C.current;if(!X)return;const ce=()=>{T("playing"),I("playMode"),O(!0),ze();try{ao(),sr(X).then(Ze=>{if(De.current)try{y.current?.("main",Ze)}catch{}})}catch{}const Ge=nt.current;Ge?.enabled&&(Ge?.volume??0)>0&&kt(Ge.volume)},Ee=()=>{J_({ended:!!X?.ended,completedByEnd:Je.current})||(T("paused"),Ve(),At())},He=()=>{const Ge=()=>{try{const Ze=he.current,Ct=X_(Ze,je.current);if(Ct!==null){je.current=Ct,R(Ct),O(!0);const ft=Ze?.[Ct]&&Ze[Ct].src;if(ft&&X){lt(X,ft),ve(X).catch(()=>{});return}}}catch{}T("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}Ve(),O(!1),At();try{!Ke.current&&Dt.current&&Dt.current()}catch{}};if(we.current=Ge,Be.current>0){ze(),le.waitPad(Be.current,"tail").then(Ze=>{le.leave(),Ze&&Ge()}).catch(()=>{});return}Ge()};return X.addEventListener("play",ce),X.addEventListener("pause",Ee),X.addEventListener("ended",He),()=>{try{X.removeEventListener("play",ce),X.removeEventListener("pause",Ee),X.removeEventListener("ended",He),Ve()}catch{}}},[kt,At,ve,nt,ze,Ve,le]);o.useEffect(()=>We(),[We]),o.useEffect(()=>{Ke.current=s},[s]),o.useEffect(()=>{ke.current=r},[r]),o.useEffect(()=>{if(s||Z!=="active")return;const X=A.current;if(!X)return;let ce=null;const Ee=requestAnimationFrame(()=>{try{const He=X.getTotalLength();if(!He)return;const Ge=He*.2;X.style.strokeDasharray=`${He-Ge} ${Ge}`;const Ze="triFlow_"+Math.random().toString(36).slice(2);ce=document.createElement("style"),ce.textContent=`@keyframes ${Ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${He}}}`,document.head.appendChild(ce),X.style.animation=`${Ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(Ee),ce?.remove()}},[Z,s]),o.useEffect(()=>{he.current=L},[L]),o.useEffect(()=>{je.current=j},[j]),o.useEffect(()=>{const X=_.current,ce=w.current;if(!X||!ce)return;let Ee=null;const He=32,Ge=60,Ze=()=>{try{const ft=Array.from(X.querySelectorAll(":scope > .button"));let ge=0;ft.forEach(fe=>{if(fe===ce)return;const Fe=fe.getBoundingClientRect();ge+=Fe.width});const S=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(S-ge-8)),me=_t;if(!me||J<=0){Array.from(ce.children).forEach(fe=>{try{fe.style.width=""}catch{}});return}let ne=Math.floor(J/me);ne>Ge&&(ne=Ge),ne<He&&(ne=Math.max(He,Math.floor(J/me))),Array.from(ce.querySelectorAll(".button")).forEach(fe=>{try{fe.style.width=`${ne}px`}catch{}})}catch{}},Ct=requestAnimationFrame(Ze);try{Ee=new ResizeObserver(()=>{requestAnimationFrame(Ze)}),Ee.observe(X),Ee.observe(ce),window.addEventListener("resize",Ze)}catch{}return()=>{try{cancelAnimationFrame(Ct)}catch{}try{Ee&&(Ee.disconnect(),Ee=null)}catch{}try{window.removeEventListener("resize",Ze)}catch{}}},[L,Y,_t]),o.useEffect(()=>()=>{try{Te.current&&(clearTimeout(Te.current),Te.current=null),qe.current&&(clearTimeout(qe.current),qe.current=null)}catch{}},[]);const Qe=(X,ce)=>{W(X),te(ce),yt(),U(Q_(X)),he.current=X},st=()=>{I("playMode"),R(0),O(!0)},Tt=async(X,ce)=>{wt(!1),v.current=!1,lt(X,ce),await qc(X),await Xe()!==!1&&(k(!1),st(),await ve(X))},ln=async(X,ce=!1)=>{const Ee=C.current;k(!0),$("measuring_duration");try{const He=await vs(X,{timeoutMs:1e4,rejectOnError:!0});Qe([{src:X,objectUrl:null,duration:He}],He),$("ready"),ce&&Ee&&await Tt(Ee,X)}finally{v.current=!1,k(!1)}},un=async(X,ce=!1)=>{const Ee=C.current;k(!0),$("measuring_duration");try{const He=await Promise.all(X.map(Ze=>vs(Ze,{timeoutMs:1e4})));if(!De.current)return;const Ge=X.map((Ze,Ct)=>({src:Ze,objectUrl:null,duration:He[Ct]||0}));Qe(Ge,ex(Ge)),$("ready"),ce&&Ee&&Ge.length>0&&await Tt(Ee,Ge[0].src)}finally{v.current=!1,k(!1)}},$t=async(X=!1,ce=!0)=>{const Ee=C.current,He=t?Array.isArray(t)?t:[t]:[];if(!He||He.length===0||!He.some(Boolean))return!1;if(v.current)return null;v.current=!0,ce&&k(!0),$("resolving");try{const Ge=tx(t,a,Bl),Ze=[];let Ct=0;for(const ft of Ge){let ge=ft.src??null,S=null;if(!ge&&ft.resolvedPath){try{$("getting_signed_url"),ge=await kl(ft.resolvedPath)}catch{ge=null}if(!De.current)return!1;if(!ge)try{$("downloading");const me=await Al(ft.resolvedPath);if(!De.current)return!1;if(me){const ne=me instanceof Blob?me:new Blob([me]);S=b.track(URL.createObjectURL(ne)),ge=S}}catch{$("error");try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),I("active")}catch{}}}if(!ge)continue;let J=0;try{$("measuring_duration"),J=await vs(ge,{timeoutMs:3e3})}catch{J=0}if(!De.current){if(S)try{URL.revokeObjectURL(S)}catch{}for(const me of Ze)if(me.objectUrl)try{URL.revokeObjectURL(me.objectUrl)}catch{}return!1}Ct+=J||0,Ze.push({...ft,src:ge,objectUrl:S,duration:J})}if(Qe(Ze,Ct),Ze.length>0&&X&&Ee){const ft=Ze[0];wt(!1);try{b.keepOnly(Ze.map(ge=>ge.objectUrl))}catch{}if($("ready"),v.current=!1,ft.src&&Ee)try{if(lt(Ee,ft.src),await qc(Ee),await Xe()===!1)return!1;ce&&k(!1),st(),Ee&&await ve(Ee)}catch{ce&&k(!1)}else ce&&k(!1);I("playMode"),R(0),O(!0)}return Ze.length>0}finally{v.current=!1,ce&&k(!1),$(Ge=>Ge==="ready"?"ready":"idle")}},Ot=async X=>{const ce=le.isRunning();if(X.paused&&!ce){if(Je.current){await Pt();return}const Ee=le.resume();if(Ee){if(T("playing"),Ee.phase==="tail"){Ie(Ee.elapsed);return}await ve(X,3,50,Ee.elapsed);return}await ve(X),T("playing")}else le.pause(),Ce(),X.pause(),T("paused"),ce&&(Ve(),At())},cn=async()=>{const X=C.current;if(!(!X&&!ct)){if(ct){const ce=window.speechSynthesis;if(Z==="active"){const Ee=Sa(),He=Array.isArray(l)?l.filter(Boolean):l?[l]:[];if(Ee&&He.length>0){if(v.current)return;I("load"),k(!0),$("synthesizing"),v.current=!0;try{const Ge=await Promise.all(He.map(Ze=>Promise.resolve(Ee(Ze))));Ge.length>1?await un(Ge,!0):await ln(Ge[0],!0)}catch{v.current=!1,k(!1),I("active"),vt(He.length>0?He:void 0)}return}vt(He.length>0?He:void 0);return}if(Z==="playMode"){const Ee=!!ce&&(ce.speaking||ce.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!Ee){await Ot(X);return}try{if(ce&&ce.paused)try{Nt("tts"),ce.resume(),T("playing")}catch{}else try{ce.pause(),T("paused")}catch{}}catch{}}return}if(Z==="active"){if(s&&Array.isArray(he.current)&&he.current.length>0){const Ee=he.current[0];try{if(Ee.src&&X)try{lt(X,Ee.src),st(),X&&await ve(X)}catch{}st();return}catch{}}I("load");let ce;try{ce=await $t(!0)}catch{ce=!1}if(ce===!1&&De.current){try{Ne(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}I("active")}return}if(Z!=="load"&&(Z==="playMode"||Z==="active"))try{X&&await Ot(X)}catch(ce){(ce instanceof Error||typeof ce=="object"&&ce&&"name"in ce)&&ce.name}}},Pt=async()=>{const X=C.current;if(X)try{const ce=he.current;if(Array.isArray(ce)&&ce.length>1){await bn(0);return}wt(!1);try{X.currentTime=0}catch{}X&&await ve(X),T("playing"),I("playMode")}catch{}},kn=()=>{Ce(),mt(),Pe.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}At(),T("stopped"),I("active"),Q(0),O(!1)},Jt=async(X,{sameSegment:ce=!1}={})=>{Ce();const Ee=le.generation(),He=C.current,Ge=he.current?.[X]?.src;try{if(wt(!1),R(X),O(!0),je.current=X,!Ge||!He||(ce||yt(),lt(He,Ge),!ce&&await Xe()===!1)||!le.isCurrent(Ee)||(await ve(He),!le.isCurrent(Ee)))return;T("playing"),I("playMode")}catch{}},St=async()=>{const X=he.current,ce=je.current||0;if(!X||ce<=0){await Pt();return}await Jt(ce-1)},Rt=async()=>{const X=he.current,ce=je.current||0;if(!X||ce>=X.length-1){kn();return}await Jt(ce+1)},Wt=()=>{if(Je.current)return;const X=200,ce=340;wt(!0),Ce(),mt();try{Q(1)}catch{}ut(1);try{q("hold")}catch{}try{const Ee=C.current,He=ct&&!!Ee?.src;if(!ct||He){if(Ee){Ee.pause();try{Ee.currentTime=0}catch{}}}else jt();At()}catch{}try{T("stopped")}catch{}if(O(!1),!Ke.current)try{qe.current&&(clearTimeout(qe.current),qe.current=null),qe.current=setTimeout(()=>{try{q("out")}catch{}qe.current=setTimeout(()=>{try{typeof ke.current=="function"&&ke.current(!0)}catch{}try{q("idle")}catch{}qe.current=null},ce)},X)}catch{}};o.useEffect(()=>{Dt.current=Wt});const Kt=o.useCallback(()=>Ne(""),[]),bn=async X=>{(he.current||[])[X]&&await Jt(X,{sameSegment:X===je.current})},Ut=G==="playing",Qt=o.useMemo(()=>{if(!Y||Y.length<=1)return Y;const X=Y[j];return X?[X]:Y},[Y,j]),dn=s===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Me(X)}catch{}},[de,Me]);const gn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ce=Math.max(0,Math.min(1,ae)),Ee=gn.current,He=()=>{Ee.raf!==null&&(cancelAnimationFrame(Ee.raf),Ee.raf=null),Ee.timer!==null&&(clearTimeout(Ee.timer),Ee.timer=null)};He();const Ge=lr(X);if(X.paused||Math.abs(Ge-ce)<.001||typeof requestAnimationFrame!="function"){try{Hn(X,ce)}catch{}return}const Ze=performance.now(),Ct=()=>{const ft=Math.min(1,(performance.now()-Ze)/150);try{Hn(X,Ge+(ce-Ge)*ft)}catch{}Ee.raf=ft<1?requestAnimationFrame(Ct):null};return Ee.raf=requestAnimationFrame(Ct),Ee.timer=setTimeout(()=>{He();try{Hn(X,ce)}catch{}},200),He},[ae]);const Ht=H==="hold",An=H==="out",pe=Z==="playMode"&&!N&&!tt||Ht||An,Se=G!=="stopped"||Ht||An,Re=G==="paused",Ue=Math.max(0,Math.min(100,(M||0)*100)),Oe=Ae("audio-player__fill",pe?"is-visible":"",Se?"is-expanded":"",Re?"is-paused":"",An?"is-out":"");return n.jsxs("div",{className:`audio-player ${dn?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof m=="string"?m:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${Ut?"is-playing":""} ${N?"is-loading":""} ${Z!=="default"?"is-revealed":""}`,children:[N?n.jsxs("div",{className:"audio-player__loading",role:Vc[P]?"status":void 0,"aria-live":Vc[P]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p("training.audioStatus.preparing",{defaultValue:"\uC18C\uB9AC\uB97C \uC900\uBE44\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026"})})]}):null,Z==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:dn,onClick:()=>{K.current=_r(),D(),cn()},"aria-label":typeof m=="string"?m:p("training.listen","\uB4E3\uAE30"),onMouseEnter:B,onMouseLeave:D,onFocus:B,onBlur:D,children:n.jsx("span",{ref:x,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:A,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,E&&n.jsx(Tn,{anchorRect:E,text:typeof m=="string"&&m?m:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${Z==="playMode"||Ut?"is-visible":""}`,inert:!(Z==="playMode"||Ut)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:St,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:Ut?"pause":"play",onClick:cn,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":Ut,width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:kn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:Z!=="playMode"}),_t>1?n.jsx("div",{ref:w,className:"audio-player__source-buttons",children:Array.from({length:_t}).map((X,ce)=>n.jsx(be,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ce+1),onClick:()=>{try{bn(ce)}catch{}},ariaLabel:p("training.sourcePlay",{n:ce+1}),variant:"transparent-white",selected:z&&j===ce,disabled:Z!=="playMode"||!(Array.isArray(L)&&L[ce]),showTooltipInfo:!0},ce))}):null,!Array.isArray(L)||L.length<=1?n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Pt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}):null,n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Rt,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:Z!=="playMode"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:Wt,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:Z!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Oe,ref:f,style:{left:`${Ue}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(rx,{segments:Qt,progress:M,totalDuration:ue,waveProgressRef:$e,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:L?.[j]?.duration??0,noiseSrc:c&&g?.settings.enabled&&V>0?rt:null,noiseRatio:g?ar(g.settings):0,noiseSpeed:g?.settings.speed??1,mainVolume:ee,onReadyChange:et})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(at,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(ya,{message:ie,position:_e,onClose:Kt})]})}function Sr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:s=null,onClose:l,closeOnOutsideClick:i=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:h,decrease:p,canIncrease:m,canDecrease:g,fontSize:y,lineHeight:C}=Ii({storageKey:"tooltip-fontScale"}),f=o.useCallback(()=>d(A=>A==="dark"?"light":"dark"),[]),_=o.useCallback(A=>{try{A.stopPropagation()}catch{}try{typeof l=="function"&&l()}catch{}},[l]),b=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],w={fontSize:`${y}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},v=n.jsxs("div",{className:se(`text-box-tooltip__root ${c==="dark"?"is-dark":""}`),children:[n.jsxs("div",{className:se("text-box-tooltip__box"),children:[r&&n.jsx("div",{className:se("text-box-tooltip__label body-2b"),children:r}),n.jsx("div",{className:se("text-box-tooltip__text body-1"),style:w,children:b.map((A,x)=>n.jsxs("div",{className:se("text-box-tooltip__line"),children:[b.length>1?n.jsx("div",{className:se("text-box-tooltip__marker"),children:n.jsx("span",{className:se("text-box-tooltip__line-number button-1"),children:x+1})}):null,n.jsx("span",{className:se("text-box-tooltip__line-text"),children:A})]},x))})]}),n.jsxs("div",{className:se("text-box-tooltip__buttons"),children:[n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!g}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:h,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!m}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:f,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return s?n.jsx(wn,{anchorRect:s,className:se(`text-box-tooltip ${c==="dark"?"is-dark":""}`),onClose:l,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:v}):n.jsx("div",{className:se(`text-box-tooltip ${c==="dark"?"is-dark":""}`),children:v})}function Gc({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(at,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Kc(e,t,a){const r=o.useRef(t),s=o.useRef(a);o.useEffect(()=>{r.current=t,s.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let l=null,i=10;const u=()=>{l=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(Nn)).find(h=>!h.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(l=requestAnimationFrame(u))};return l=requestAnimationFrame(u),()=>{l!==null&&cancelAnimationFrame(l);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip__content")){const d=s.current();if(d)try{d.focus()}catch{}}}},[e])}function Yc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:s=!1,onPreviewTextBtn:l,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:h=!1}){const{t:p}=xe.useTranslation(),m=yn("(max-width: 767px)"),g=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),y=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[f,_]=o.useState(!1),[b,w]=o.useState(null),[v,A]=o.useState(null);Kc(f&&!!b,()=>{if(typeof document>"u")return null;const N=Array.from(document.querySelectorAll(".tooltip__content"));for(let k=N.length-1;k>=0;k--)if(N[k].querySelector(".text-box-tooltip__root"))return N[k];return null},()=>C.current?.querySelector("button")??null);const x=o.useRef(l);o.useEffect(()=>{x.current=l});const E=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(N=>typeof N=="string"||typeof N=="number")?i.join(""):"",[i]),B=o.useCallback(()=>{_(!1),w(null),A(null)},[]);o.useEffect(()=>{if(!f)return;let N;try{typeof x.current=="function"&&(N=x.current())}catch{}if(N===!1){B();return}A(typeof N<"u"&&N!==null?N:null)},[E]);const D=o.useCallback(()=>{let N;try{typeof l=="function"&&(N=l())}catch{}if(N!==!1){if(A(typeof N<"u"&&N!==null?N:i),!C.current){_(k=>!k);return}if(f)_(!1),w(null),A(null);else{const k=C.current.getBoundingClientRect();w(k),_(!0)}}},[l,i,f]);return n.jsxs("div",{className:y,children:[n.jsx("p",{className:g,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),s||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(be,{htmlType:"button",size:32,type:m?"dot":"bar",icon:"play-circle",label:m?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:h,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||h,onDisabledClick:h&&r!=="disabled"?()=>{}:void 0}),s&&n.jsx("div",{ref:C,children:n.jsx(be,{htmlType:"button",size:32,type:m?"dot":"bar",icon:"eye",label:m?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:D,className:f?"is-selected":void 0,"aria-expanded":f,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof l!="function"})})]}),f&&n.jsx(Sr,{text:v??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:b,onClose:B,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function xs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function aa({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:s={},children:l,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:h}=xe.useTranslation(),[p,m]=o.useState(()=>xs(e,t));o.useEffect(()=>{const x=xs(e,t);if(x!==p){const E=setTimeout(()=>m(x),0);return()=>clearTimeout(E)}},[e,t,p]);const g=o.useCallback((...x)=>{xs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...x)},[e,t,p,u]),[y,C]=o.useState(!1),[f,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),b=o.useCallback(x=>{if(!x)return null;try{const E=x;if(typeof x=="object"&&(E.currentTarget||E.target)&&(E.nativeEvent||E.type)){const N=E.currentTarget??E.target;if(N&&typeof N.getBoundingClientRect=="function")return N.getBoundingClientRect()}if(x instanceof DOMRect)return x;const B=x;if(B&&typeof B.getBoundingClientRect=="function")return B.getBoundingClientRect();const D=x?.current;return D&&typeof D.getBoundingClientRect=="function"?D.getBoundingClientRect():null}catch{return null}},[]),w=o.useCallback((x,{text:E="",label:B="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:D=!1,alignX:N="center",alignY:k="top"}={})=>{const P=b(x);_({text:E,label:B,anchorRect:P,backdrop:D,alignX:N,alignY:k}),C(!0)},[b]),v=o.useCallback(()=>{C(!1),_(x=>({...x,anchorRect:null}))},[]),A=o.Children.map(l,x=>{if(o.isValidElement(x)){const E=x;if(typeof E.type=="string")return E;const B=E.props??{},D=typeof B.onDone=="function"?B.onDone:g,N=typeof B.disabled=="boolean";let k=p==="disabled";return N&&(k=!!B.disabled),o.cloneElement(E,{onDone:D,disabled:k,showTooltip:w,hideTooltip:v})}return x});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx(Gc,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Yc,{state:p,title:r,...s,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),A]}),y?n.jsx(wn,{anchorRect:f.anchorRect,backdrop:f.backdrop,onClose:v,ariaLabel:h("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(Sr,{text:f.text,onClose:v})}):null]})}function Zc({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[s,l]=o.useState("disabled"),[i,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",i)}catch{}},[i]);const c=()=>u($=>$==="dark"?"light":"dark"),{increase:d,decrease:h,canIncrease:p,canDecrease:m,fontSize:g,lineHeight:y}=Ii({storageKey:"textbox_fontScale"}),[C,f]=o.useState(""),_=o.useRef(null),b=o.useRef(!1),w=o.useCallback(()=>{b.current=_r()&&!!_.current&&_.current.contains(document.activeElement),l("active")},[]),v=o.useCallback(()=>f(""),[]),A=$=>{try{f($)}catch{}},x=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const $=setTimeout(()=>l(t),0);return()=>clearTimeout($)}},[t]);const E=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[B,D]=o.useState(E);B!==E&&(D(E),l("disabled"));const N=t==="disabled"?s:t,k=N==="disabled"?"training-text-box--disabled":N==="active"?"training-text-box--active":N==="done"?"training-text-box--done":"",P=o.useMemo(()=>({fontSize:`${g}px`,lineHeight:`${y}px`}),[g,y]);return o.useEffect(()=>{if(N==="disabled"||!b.current)return;b.current=!1;const $=document.activeElement;$&&$!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[N]),n.jsxs("div",{ref:_,className:`training-text-box ${k} ${N!=="disabled"&&i==="dark"?"is-dark":""}`,children:[N==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(be,{htmlType:"button",size:48,type:"bar",onClick:w,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":N==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:P,children:E})}),N!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":N==="disabled",children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:h,onDisabledClick:()=>A(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!m,useBorder:!1,showTooltipInfo:!0,...!x&&{width:"60px"}}),n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>A(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!x&&{width:"60px"}}),n.jsx(be,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:i==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:i==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(ya,{message:C,position:"top",onClose:v})]})}function ra(e){return e==="active"||e==="done"}function ws({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,useTitleFaded:l,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:h,multiSelect:p=!1,correctCount:m=0,useDisabledCovered:g=!1,choiceIcons:y,shuffleChoices:C=!0}){const{t:f}=xe.useTranslation(),_=s??f("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),b=typeof e=="number"?e:-1,w=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",v=Array.isArray(h)&&h.length?h:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,A=d?d.join("||"):"",x=h?h.join("||"):"",[E,B]=o.useState(()=>Array.isArray(v)?C?$a(v):v.slice():void 0);o.useEffect(()=>{Array.isArray(v)&&v.length?B(C?$a(v):v.slice()):B(void 0)},[c,A,x,C]);const[D,N]=o.useState(null),[k,P]=o.useState(()=>new Set);o.useEffect(()=>{N(null),P(new Set)},[x,c,A]);const $=o.useRef(void 0);o.useEffect(()=>{const F=$.current;typeof F=="number"&&typeof t=="number"&&typeof e=="number"&&F>=e&&t<e&&(N(null),P(new Set)),$.current=t},[t,e]);const G=o.useCallback(F=>{if(!ra(w))return;const M=E?.[F];if(M==null)return;const Q=M;if(p){const Z=new Set(k);Z.has(Q)?Z.delete(Q):Z.add(Q),P(Z),typeof u=="function"&&u({selectedValues:[...Z],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...Z],__ts:Date.now()})}else N(Q),typeof u=="function"&&u({selectedIndex:F,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:F,selectedValue:Q,__ts:Date.now()})},[E,w,p,u,k]),T=`training-step__buttons${Array.isArray(E)&&E.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:l,children:n.jsx("div",{className:T,children:Array.isArray(E)&&E.length>0?E.map((F,M)=>n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:()=>G(M),ariaLabel:String(F),label:F,useLabel:!0,icon:y?y[String(F)]:void 0,variant:"default",disabled:w==="disabled",selected:p?k.has(F):D===F,useDisabledCovered:g,minWidth:0},String(F))):null})})}function Bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),h=s??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",g=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",y=u&&typeof u=="object"?u.choices:void 0,[C,f]=o.useState(c??null),_=`${String(g)}\0${JSON.stringify(y??null)}`,[b,w]=o.useState(_);b!==_&&(w(_),c==null&&f(null));const[v,A]=o.useState(c);Object.is(v,c)||(A(c),f(c??null));const x=o.useRef(void 0);o.useEffect(()=>{const N=x.current;typeof N=="number"&&typeof t=="number"&&typeof e=="number"&&N>=e&&t<e&&c==null&&f(null),x.current=t},[t,e,c]);const E=o.useCallback(N=>{const k=typeof N=="object"&&N!==null?Object.assign({},N,{__ts:Date.now()}):{value:N,__ts:Date.now()};typeof i=="function"&&i(k),ra(m)&&typeof l=="function"&&l(k)},[i,m,l]),B=o.useCallback(()=>{ra(m)&&(f(!1),E(!1))},[E,m]),D=o.useCallback(()=>{ra(m)&&(f(!0),E(!0))},[E,m]);return n.jsxs(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:h,onDone:l,useTitleFaded:!1,children:[n.jsx(Zc,{context:u,state:m}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(y)&&y.length>0?y.slice(0,6).map((N,k)=>n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:()=>{ra(m)&&(f(k),E&&E(k))},disabled:m==="disabled",ariaLabel:String(N),label:N,variant:m,selected:C===k},k)):n.jsxs(n.Fragment,{children:[n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:B,disabled:m==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(be,{htmlType:"button",size:56,type:"bar",onClick:D,disabled:m==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function ks({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:s,btnLabel:l,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:h,disabled:p,_pageIndex:m,showSoundWaveForm:g,showNoiseWaveForm:y,leadInMs:C,tailMs:f}){const{t:_}=xe.useTranslation(),b=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),w=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,title:b,onDone:s,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:h},children:n.jsx(_s,{soundSrc:i,ttsText:i?null:d??b,bucketPath:u,btnLabel:l||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:w,className:"training-step__listen-sticky",showSoundWaveForm:g,showNoiseWaveForm:y,leadInMs:C,tailMs:f},`audio-p${m??0}-s${e}`)})}const hx=[];function As({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u=hx}){const{t:c}=xe.useTranslation(),d=s??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),h=U=>typeof U=="string"?U:U&&(U.context||U.sentence||U.question||"")||"",[p,m]=o.useState(Array.isArray(u)?u:[]),[g,y]=o.useState(()=>(p||[]).map((U,j)=>({id:j,text:h(U)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),f=C!=="disabled",_=o.useRef(void 0),b=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const U=Array.isArray(u)?u:[];m(U);const j=(R=>{const z=(R||[]).map((de,ee)=>({id:ee,text:h(de)}));if(z.length<=1)return z;const O=(de,ee)=>{if(de.length!==ee.length)return!1;for(let V=0;V<de.length;V++)if(de[V].text!==ee[V].text)return!1;return!0};let ue=$a(z),te=0;for(;O(ue,z)&&te<20;)ue=$a(z),te+=1;return ue})(U);y(j);try{if(typeof i=="function"){const R=j.filter((z,O)=>z.text===h(U[O])).length;i({shuffled:j,score:R,total:(U||[]).length,initial:!0,__ts:Date.now()})}if(typeof l=="function"&&C==="active"){const R=j.filter((z,O)=>z.text===h(U[O])).length;b.current=u,l({shuffled:j,score:R,total:(U||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||b.current===u||(b.current=u,typeof l!="function"))return;const U=Array.isArray(u)?u:[],j=g.filter((R,z)=>R.text===h(U[z])).length;l({shuffled:g,score:j,total:U.length,initial:!0,__ts:Date.now()})},[C,u]);const w=(U,j)=>{const R=[...g],z=U+j;if(z<0||z>=R.length)return;const O=R[z];R[z]=R[U],R[U]=O,Q(R);try{if(typeof l=="function"&&C==="active"){const ue=R.filter((te,de)=>te.text===h(p[de])).length;l({shuffled:R,score:ue,total:(p||[]).length,__ts:Date.now()})}}catch{}},[v,A]=o.useState(null),x=o.useRef(null),E=o.useRef(null),B=o.useRef(null),D=o.useRef(null),N=o.useRef(null),k=o.useRef({x:0,y:0}),P=o.useRef(null),$=o.useRef({dx:0,dy:0}),G=()=>{if(P.current!==null)return;const U=()=>{if(!x.current){P.current=null;return}P.current=requestAnimationFrame(U);const j=k.current,R=$.current||{dx:0,dy:0};x.current&&(x.current.style.transform=`translate3d(${j.x-R.dx}px, ${j.y-R.dy}px, 0)`)};P.current=requestAnimationFrame(U)},T=o.useRef(new Map),F=o.useRef(new Map),M=()=>{const U=new Map;return T.current.forEach((j,R)=>{j&&j.getBoundingClientRect&&U.set(R,j.getBoundingClientRect())}),U},Q=U=>{const j=M();y(U);try{if(typeof i=="function"){const R=U.filter((z,O)=>z.text===h(p[O])).length;i({shuffled:U,score:R,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const R=M();U.forEach(z=>{const O=j.get(z.id),ue=R.get(z.id),te=T.current.get(z.id);if(!te||!O||!ue)return;const de=O.top-ue.top;de&&(te.style.transition="none",te.style.transform=`translateY(${de}px)`,requestAnimationFrame(()=>{te.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",te.style.transform="";const ee=()=>{te.style.transition="",te.removeEventListener("transitionend",ee)};te.addEventListener("transitionend",ee)}))})})},Z=(U,j)=>{try{try{j.dataTransfer?.setData("text/plain",String(U))}catch{}try{j.dataTransfer&&(j.dataTransfer.effectAllowed="move")}catch{}try{const R=document.createElement("div");R.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(R),j.dataTransfer?.setDragImage(R,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(R)}catch{}})}catch{}}catch{}A(U);try{const R=g[U],z=document.createElement("div");z.className="order-list__dragging-object order-list__dragging-object--visible",z.textContent=R&&R.text?R.text:"",document.body.appendChild(z),x.current=z;const O=T.current.get(R.id);let ue=j.clientX||0,te=j.clientY||0;try{if(O&&O.getBoundingClientRect){const q=O.getBoundingClientRect();ue=q.left+q.width/2,te=q.top+q.height/2}}catch{}const de=z.getBoundingClientRect(),ee=de.width/2,V=de.height/2;$.current={dx:ee,dy:V},z.style.transition="none",k.current={x:ue,y:te},z.style.transform=`translate3d(${ue-ee}px, ${te-V}px, 0)`,requestAnimationFrame(()=>{try{z.style.transition=""}catch{}G()});const ae=q=>{const ie=q;k.current={x:ie.clientX,y:ie.clientY},G()};B.current=ae,document.addEventListener("mousemove",ae);const H=q=>{const ie=q;k.current={x:ie.clientX,y:ie.clientY},G()};E.current=H,document.addEventListener("dragover",H);try{j.dataTransfer?.setData("text/plain",String(U));try{j.dataTransfer?.setData("application/json",JSON.stringify({idx:U}))}catch{}}catch{}}catch{}},I=(U,j)=>{j.preventDefault();try{j.dataTransfer&&(j.dataTransfer.dropEffect="move")}catch{}try{N.current!==null&&(clearTimeout(N.current),N.current=null);const R=j.currentTarget&&j.currentTarget.closest?j.currentTarget.closest(".order-list__item"):null;if(R&&D.current!==R){if(D.current)try{D.current.classList.remove("drag-over")}catch{}try{R.classList.add("drag-over")}catch{}D.current=R}}catch{}},K=(U,j)=>{j.preventDefault();const R=j.dataTransfer?.getData("text/plain")||"",z=R?parseInt(R,10):v,O=U;if(typeof z!="number"||isNaN(z)||z===O){A(null),Y(),L();return}const ue=Nf(g,z,O);Q(ue),A(null),L();try{if(typeof l=="function"&&C==="active"){const te=ue.filter((de,ee)=>de.text===h(p[ee])).length;l({shuffled:ue,score:te,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const te=document.querySelectorAll(".order-list .order-list__item")[O];if(!te)return;const de=te.querySelector(".order-list__slot")||te;try{de.classList.add("pulse"),de.offsetHeight,de.classList.add("to-dark");const ee=()=>{de.classList.remove("pulse","to-dark"),de.removeEventListener("transitionend",ee)};de.addEventListener("transitionend",ee)}catch{}})}catch{}Y()},L=()=>{if(x.current){try{document.body.removeChild(x.current)}catch{}x.current=null}E.current&&(document.removeEventListener("dragover",E.current),E.current=null),B.current&&(document.removeEventListener("mousemove",B.current),B.current=null),P.current!==null&&(cancelAnimationFrame(P.current),P.current=null)},W=()=>{A(null),Y(),L()};o.useEffect(()=>()=>L(),[]);const Y=()=>{try{if(N.current!==null&&(clearTimeout(N.current),N.current=null),D.current){try{D.current.classList.remove("drag-over")}catch{}D.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(U=>U.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const U=Math.max(1,(g||[]).length);g.forEach((j,R)=>{const z=F.current.get(j.id);if(!z)return;let O=50;U>1&&(O=Math.round(R/(U-1)*100));try{z.style.setProperty("--marker-pos",O+"%")}catch{}})}catch{}},[g]),o.useEffect(()=>()=>{L(),N.current!==null&&(clearTimeout(N.current),N.current=null)},[]),n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:g.map((U,j)=>{const R=Math.max(1,(g||[]).length),z=R>1?Math.round(j/(R-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":z+"%"},ref:O=>{const ue=F.current;O?ue.set(U.id,O):ue.delete(U.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:j+1})}):null,n.jsxs("div",{ref:O=>{const ue=T.current;O?ue.set(U.id,O):ue.delete(U.id)},className:`order-list__draggable ${v===j?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:f,onDragStart:f?O=>Z(j,O):void 0,onDragEnter:f?O=>I(j,O):void 0,onDragOver:f?O=>I(j,O):void 0,onDragLeave:f?()=>{try{N.current!==null&&clearTimeout(N.current),N.current=setTimeout(()=>{try{const O=document.querySelectorAll(".order-list .order-list__item");O&&O[j]&&(O[j].classList.remove("drag-over"),D.current===O[j]&&(D.current=null))}catch{}},80)}catch{}}:void 0,onDrop:f?O=>K(j,O):void 0,onDragEnd:f?W:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:U.text}),f?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:()=>w(j,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:j===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(be,{htmlType:"button",size:32,type:"dot",onClick:()=>w(j,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:j===g.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},U.id)})})})}const mx=8e3;function Cx(e,t){return new Promise(a=>{let r=!1;const s=()=>{r||(r=!0,a())};e.then(s,s),setTimeout(s,t)})}function Xc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,onDone:l,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:h=!1,maxCards:p,playAllGapMs:m=0}){const{t:g}=xe.useTranslation(),y=s??g("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),f=p??3,_=(C||[]).slice(0,f);(C||[]).length>f&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${f} shown`);const b=typeof e=="number"?e:-1,w=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",[v,A]=o.useState(null),x=o.useRef([]),[E,B]=o.useState(!1),D=o.useRef(null),N=o.useRef(!0);o.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]);const k=o.useMemo(()=>C.map(M=>M?.id??M?.word??"").join("|"),[C]);o.useEffect(()=>{A(null)},[k]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&A(null),P.current=t},[t,e]);const $=o.useCallback((M,Q)=>{if(c)return;const Z={item:M,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(w==="active"&&typeof l=="function")try{l(Z)}catch{}},[c,i,w,l]),G=o.useRef(m);o.useEffect(()=>{G.current=Math.max(0,m||0)},[m]);const T=o.useCallback(async()=>{if(E||w==="disabled")return;B(!0);let M=!1;const Q=new Promise(Z=>{D.current=()=>{M=!0,Z()}});try{for(let Z=0;Z<_.length&&!(!N.current||M);Z++){const I=x.current[Z];if(!I)continue;await Promise.race([Cx(I.play(),mx),Q]);const K=Math.max(0,G.current||0);K>0&&Z<_.length-1&&!M&&N.current&&await Promise.race([new Promise(L=>{setTimeout(L,K)}),Q])}}finally{D.current=null,B(!1)}},[E,w,_.length]),F=o.useCallback((M,Q)=>{if(!ra(w))return;A(Q);const Z={selectedValue:M.word||M.title||"",selectedIndex:Q,item:M,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(typeof l=="function")try{l(Z)}catch{}},[i,w,l]);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:y,onDone:l,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:T,playAllActive:E},children:n.jsx("div",{className:"training-step__cards",onClickCapture:M=>{const Q=D.current;if(!Q)return;const Z=M.target;Z&&typeof Z.closest=="function"&&Z.closest(".training-word-card__bottom")&&Q()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:g("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((M,Q)=>n.jsx(ts,{ref:Z=>{x.current[Q]=Z},item:M,disabled:w==="disabled",onPlayDone:()=>$(M,Q),selectable:c,selected:c&&v===Q,onSelect:c?()=>F(M,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:h},M&&M.id||Q))})})}const fx=160;function bx(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Jc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}bx(Vt.t.bind(Vt)),Jc(Vt.t.bind(Vt));const jr="none",gx=.5,yx=1.5,vx=.25;function Ns({title:e,valueLabel:t,value:a,min:r,max:s,step:l,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(sn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Uu,{value:a,onChange:d,min:r,max:s,step:l,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:se("noise-settings-tooltip__slider-input")}),n.jsx("div",{className:se(Ae("noise-settings-tooltip__value","button-1",c?"noise-settings-tooltip__value--disabled":"")),children:t})]})}function Qc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),s=yn("(max-width: 767px)")?40:24,l=Ar(),i=ar(l?.settings??na),u=l?.settings.type??"defaultNoise",c=l?.settings.enabled??!0,d=l?.playbackRate??1,h=l?.mainVolume??1,p=Math.round(h*100),m=o.useCallback(_=>{try{l?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[l]),g=o.useCallback(_=>{try{l?.setPlaybackRate(_)}catch{}},[l]),y=o.useCallback(_=>{const b=Math.min(nr,Math.max(0,Math.round(_*10)/10));try{l?.setSettings({noiseRatio:b})}catch{}},[l]),C=o.useCallback(_=>{try{_===jr?l?.setSettings({enabled:!1}):l?.setSettings({type:_,enabled:!0})}catch{}},[l]),f=[{key:jr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Jc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(wn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:se("noise-settings-tooltip__header"),children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(be,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Ja,{className:se("noise-settings-tooltip"),useBorder:!1,labelWidth:72,children:[n.jsx(Ns,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:s,onChange:m}),n.jsx(Ns,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:gx,max:yx,step:vx,size:s,onChange:g}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(sn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(vn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:f,value:c?u:jr,onChange:C})}),n.jsx(Ns,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:nr,step:Lc,size:s,disabled:!c,onChange:y})]}),a&&n.jsx("div",{className:se("noise-settings-tooltip__width-ghost"),"aria-hidden":"true",inert:!0,children:n.jsx(sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(vn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:f,value:jr,onChange:()=>{}})})})]})})}function ed({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:s=0,stepCount:l=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:h}=xe.useTranslation(),[p,m]=o.useState(!1),[g,y]=o.useState(null),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),w=Ar(),v=u>0,A=v&&i<u-1,x=!v||i>=u-1,E=s===Math.max(0,l);o.useEffect(()=>{e||(m(!1),y(null))},[e]);const B=o.useCallback(()=>{m(!1),y(null)},[]),D=o.useCallback(()=>{if(p){m(!1),y(null);return}const Q=_?.current?.getBoundingClientRect();Q&&y(Q),t?.(),m(!0)},[p,t]),N=o.useCallback(()=>{if(p){m(!1),y(null);return}const Q=b?.current?.getBoundingClientRect();Q&&y(Q),t?.(),m(!0)},[p,t]),k=yn("(max-width: 767px)"),P=o.useRef(null),[$,G]=o.useState(null),T=o.useCallback(()=>{f(Q=>{const Z=!Q;return G(Z?P.current?.getBoundingClientRect()??null:null),Z})},[]),F=o.useCallback(()=>{f(!1),G(null)},[]);o.useEffect(()=>{c&&(f(!1),G(null))},[c]);const M=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:h("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(Zo,{analyser:w?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:h("training.meter.noise","\uC18C\uC74C")}),n.jsx(Zo,{analyser:w?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.noise","\uC18C\uC74C")})]})]});return Kc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings-tooltip__header")?.closest(".tooltip__content")??null:null,()=>[_.current,b.current].map(Q=>Q?.querySelector("button")??null).find(Q=>!!Q&&Q.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:h("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:b,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:N,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:P,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:T,selected:C,"aria-expanded":k?C:void 0,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!k&&n.jsx("div",{className:"pp-bottom__meters",children:M})]}),e&&C&&k&&$&&n.jsx(wn,{anchorRect:$,onClose:F,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:M})}),n.jsxs("div",{className:"pp-bottom__right",children:[x&&n.jsx(be,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:h("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:h("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!E}),A&&n.jsx(be,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:h("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:h("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!E})]}),e&&p&&n.jsx(Qc,{anchorRect:g,onClose:B,hideNoiseRows:d})]})}function td({title:e,subtitle:t,desc:a,depth:r,icon:s,wrapperStyle:l,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:h,onBack:p,onClose:m}){const{t:g}=xe.useTranslation(),y=yn("(max-width: 767px)"),C=Number.isInteger(h)?h:u||0,f=Number.isInteger(d)?d:c||0,_=p||m,b=Array.isArray(r)?y?r[r.length-1]:r.join(" / "):r,w=typeof e=="string"?e.trim():e,v=typeof t=="string"?t.trim():t,A=!!(w||v),x=A?w||v:g("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),E=b||(w?t:void 0),B=y&&typeof E=="string"&&(E.includes(" \xB7 ")||E.includes(" / "))?E.split(/\s[·/]\s/).pop():E,D=o.useMemo(()=>{const N=l&&typeof l=="object"?{...l}:{};return!("width"in N)&&!("height"in N)&&(N.width="40px",N.height="40px"),N},[l]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(be,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:g("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:s?n.jsx(bu,{icon:s,label:e,tooltip:i,wrapperStyle:D}):null}),n.jsxs("div",{className:"pp-title__text",children:[B?n.jsx("span",{className:"pp-title__depth caption-1",children:B}):null,n.jsx("span",{className:`pp-title__title h2${A?"":" pp-title__title--empty"}`,children:x}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Zu,{max:Math.max(0,f??0),index:Math.max(0,C??0)})]})}function _x(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function xx(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const nd=(e,t)=>{if(!t)return t;const a=typeof Vt?.t=="function"?Vt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function ad(e,t,a){const r=e,s=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",l=Zl().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=l?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:s,label:r?.title||s,depth:t,icon:l?.icon,wrapperStyle:l?.color?{"--t-item-fg":l.color}:void 0,iconTooltip:[l?nd(`topic.${l.key}`,l.label):void 0,i?nd(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function Es(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function rd(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,s=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(s).toISOString()}:{}}}function wx(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function Bx({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:s=[],emptyMessage:l,buildResults:i,metaPatch:u}){const c=ad(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},h=t?.id||t?.title||s.length;return{id:`${e}:${h}`,meta:{...c,...d},pages:s,emptyMessage:l,buildResults:i}}function kx(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function Ax(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function Nx(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function od(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function Ex(e,t,a,r){return od(e,t*a+r)}function Dx({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const s=e;if(Array.isArray(s.selectedValues))return r.every(l=>s.selectedValues.includes(l))&&s.selectedValues.every(l=>r.includes(l));if(typeof s.correct=="boolean")return s.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(s=>String(s)===String(a[t]));if(typeof t<"u")return r.some(s=>String(s)===String(t))}}function Sx(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const sd=o.createContext(null);function jx(){const e=o.useContext(sd);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function Tx({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:s,choices:l=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,h=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,m]=o.useState(()=>l.map(()=>null)),g=JSON.stringify(l),y=l.length;o.useEffect(()=>{m(Array.from({length:y},()=>null))},[g]);const C=o.useRef(void 0);o.useEffect(()=>{const w=C.current;typeof w=="number"&&typeof t=="number"&&typeof e=="number"&&w>=e&&t<e&&m(Array.from({length:y},()=>null)),C.current=t},[t,e,y]);const f=o.useMemo(()=>p.filter(w=>w!==null).length+1,[p]),_=o.useCallback(w=>{if(!ra(h))return;const v=p;let A;if(v[w]!=null){const E=v[w];A=v.map(B=>B!==null&&B>=E?null:B)}else A=[...v],A[w]=f;m(A);const x={selectedOrder:A,words:l,__ts:Date.now()};try{typeof u=="function"&&u(x)}catch{}if(v[w]==null&&A.length>0&&A.every(E=>E!==null))try{typeof i=="function"&&i(x)}catch{}},[h,p,f,u,i,l]),b=s??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:b,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:l.map((w,v)=>n.jsx(ts,{item:{word:w},disabled:h==="disabled",selectable:!0,selected:p[v]!==null,orderRank:p[v],onSelect:()=>_(v),flipDelay:v*120,hideLabel:!1,hideAudio:!0},`${w}-${v}`))})})}function Tr(e){return null}Tr.__isTrainingPage=!0;function Ba(e,t){const a=jx();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function ld({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i}=Ba(e,t);return n.jsx(ks,{...a,index:r,stepIndex:s,isLast:l,onDone:i})}function id({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(ws,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function ud({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(Bs,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function cd({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(As,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function dd({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(Xc,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}function Mx({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:s,isLast:l,onDone:i,onChange:u}=Ba(e,t);return n.jsx(Tx,{...a,index:r,stepIndex:s,isLast:l,onDone:i,onChange:u})}const pd=3e4,Lx=/^(https?:|blob:|data:audio|\/|\.\/)/;function hd(e){return typeof e=="string"&&Lx.test(e)?e:null}const $x=e=>typeof e=="string"&&e.trim()!==""?e:null,Ds=Symbol("timed-out");function Rx(e,t){if(t<=0)return Promise.resolve(Ds);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(Ds),t)})]).finally(()=>clearTimeout(a))}function Px(e){return e?Sa()||or()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function Fx(e,t){const a=[],r=hd(t);r&&a.push({kind:"raw",resolve:async()=>r});const s=(e??"").trim();if(!s)return a;for(const[l,i]of[["urlResolver",Sa()],["fallbackUrlResolver",or()]])i&&a.push({kind:l,resolve:async u=>{let c;try{c=await Rx(i(s),u)}catch(h){return Bt(`question-sound-threw-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,h),null}return c===Ds?(Bt(`question-sound-slow-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 ${pd}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):$x(c)||(Bt(`question-sound-empty-${l}`,`[core] configureTTS \uC758 ${l} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function Ix(){return Date.now()+pd}const Ox=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function zx(e){Bt("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Mr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const s of r){if(typeof s=="string"&&s.trim().length)return s.trim();if(typeof s=="number"||typeof s=="boolean")return String(s)}}}return null}function Wx(e){return Mr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function Hx(e){return hd(Mr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function md(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Mr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function Cd(e){const{score:t,contextsLength:a,results:r=[],subtitle:s,onReplay:l,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),h=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const N=a??0;if(t!=null&&N>0&&t/N>.5){const k=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(k)}},[t,a]);const m=o.useCallback(N=>{const k=md(N),P=Mr(N?.wording,N?.label);return k===!0?{variant:"main",label:P??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:k===!1?{variant:"danger",label:P??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:P??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),g=a??0,y=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),f=o.useRef(null),[_,b]=o.useState(null),w=o.useCallback(()=>{f.current?.(),f.current=null,b(null)},[]);o.useEffect(()=>w,[w]);const v=o.useRef(0),A=(N,k)=>{if(!On)return;const P=Math.round(performance.now()-v.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${P}ms ${N}`,k??"")},x=o.useRef(0),E=o.useCallback((N,k,P)=>{w();const $=++x.current,G=()=>x.current===$;v.current=On?performance.now():0,A(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${N}`,{text:k,rawUrl:P}),b(N),f.current=()=>{A("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),x.current++,Qr()};const T=Z=>{A("\uD2BC\uB2E4",Z);const I=Ka(Z,K=>{A(`\uB05D\uB0AC\uB2E4 \u2014 ${K?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:G()}),K&&G()&&(f.current=null,b(null))});return f.current=()=>{A("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),x.current++,I.stop(),Qr()},I.done},F=Fx(k,P);A("\uCC28\uB840",F.map(Z=>Z.kind));const M=F[0]?.kind==="raw",Q=M?T(P):Promise.resolve(!1);(async()=>{if(await Q||!G())return;const Z=Ix(),I=M?F.slice(1):F;for(let K=0;K<I.length;K++){if(!G())return;A(`${I[K].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const L=await I[K].resolve(Ox(Z,I.length-K));if(A(`${I[K].kind} \uAC00 \uB2F5\uD588\uB2E4`,L),!G()||L&&(await T(L)||!G()))return}G()&&(A("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),zx(k),f.current=()=>{x.current++,Qr()},A("\uB0AD\uB3C5\uD55C\uB2E4"),L1(k,{onEnd:()=>{G()&&(f.current=null,b(null))}}))})()},[w]),B=o.useMemo(()=>C.map(N=>{const k=N??{},P=Wx(k)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:$,label:G}=m(k),T=Array.isArray(k.corrects)?k.corrects:[],F=T.length?T.join(", "):k.answer!=null&&k.answer!==""?String(k.answer):null,M=typeof k.selectedText=="string"?k.selectedText:null,Q=md(k)===!0,Z=Hx(k),I=!!Z||Px(P);return{problem:P,variant:$,label:G,answer:F,selectedText:M,isCorrect:Q,sound:Z,canHear:I}}),[C,m,d]),D=o.useMemo(()=>B.some(N=>N.answer!==null||N.selectedText!==null),[B]);return n.jsx(Rn,{onClose:i,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:N,closeWithAnimation:k})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:h,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(be,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>N(l)}),n.jsx(be,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:k,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?h:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),s&&n.jsx("p",{className:"trp-result__subtitle body-3",children:s}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:y,total:g}),children:[n.jsx("span",{className:"trp-score__big",children:y}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:g})]})})]}),B.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${D?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),D&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),B.map((N,k)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(k+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:N.problem}),N.canHear&&n.jsx(be,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===k?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===k?d("training.result.replaySoundStop",{no:k+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:k+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===k?w():E(k,N.problem,N.sound)})]}),D&&n.jsxs("div",{className:"trp-row__answers",children:[N.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:N.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${N.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${N.isCorrect?"is-correct":"is-wrong"}`,children:N.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(on,{variant:N.variant,label:N.label,fill:"soft",minWidth:80})})]},k))]})})]})})}const Ss=new Set;function Vx(e){o.useEffect(()=>{if(!e||Ss.has(e))return;Ss.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,s=0,l=0;const i=()=>{const h=Date.now();a==null&&(a=h),r==null&&(r=h)},u=()=>{r!=null&&(s+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const h=s-l;if(h<1e3||l===0&&s<5e3)return;const p=Date.now(),m=p-h;l=s,Sf({trainingType:e,startedAt:new Date(m).toISOString(),endedAt:new Date(p).toISOString()})},d=()=>{t()?i():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),Ss.delete(e)}},[e])}function Lr(e,t){return e&&e.id||`page-${t??0}`}function $r(e,t){return e&&e.key||`step-${t??0}`}function Rr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function qx(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const Ux=300,Gx=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},In=Object.freeze({}),fd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function js(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,s=Array.isArray(a)?a.filter(l=>l?.correct===!0||l?.isCorrect===!0||l?.score===1||l?.heard===!0||l?.judgement===!0).length:null;return{results:a,correct:r!=null?s:null,total:r}}const Kx=e=>n.jsx(Cd,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function Yx(e){const{scenario:t,title:a,subTitle:r,depth:s,icon:l,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:h,stepCount:p,onBack:m,onComplete:g,onRoundFinished:y,onNext:C,onSettings:f,useNoiseSetting:_=!0,children:b,ariaLabel:w,label:v,buildResults:A,onResult:x,typeKey:E,entryPoint:B,dailyTotal:D,itemRef:N,renderResultPopup:k,noiseOverride:P,hideNoiseRows:$=!1}=e;Vx(E&&!fd.has(E)?E:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:T}=xe.useTranslation(),F=x,M=!!t,Q=t?.id||null,Z=t?.meta||{},I=Array.isArray(t?.pages)?t.pages:[],K=Array.isArray(b)||o.isValidElement(b)&&typeof b!="function"?o.Children.toArray(b).filter(o.isValidElement):[],L=K.length>0,W=pe=>pe===Tr||pe?.__isTrainingPage===!0,Y=L&&K.some(pe=>W(pe.type)),U=Y?K.filter(pe=>W(pe.type)).map((pe,Se)=>{const Re=pe.props||{};return{id:`children-page-${Se}`,steps:o.Children.toArray(Re.children).filter(o.isValidElement),pageTop:Re.pageTop||Re.top||null,pageBottom:Re.pageBottom||Re.bottom||null}}):[{id:"children-page-0",steps:K}],j=L&&!M&&typeof b!="function",R=j?Math.max(1,U.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const pe=document.body;return pe.dataset.ihabTrainingPopupCount=String(Number(pe.dataset.ihabTrainingPopupCount||"0")+1),pe.classList.add("ihab-training-popup-open"),()=>{const Se=Number(pe.dataset.ihabTrainingPopupCount||"1")-1;Se>0?pe.dataset.ihabTrainingPopupCount=String(Se):(delete pe.dataset.ihabTrainingPopupCount,pe.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return pv()},[]);const[z,O]=o.useState({...na,enabled:!1}),ue=o.useRef(z);o.useEffect(()=>{ue.current=z},[z]);const te=o.useRef(P),de=o.useRef(!1),ee=o.useRef(null);o.useEffect(()=>{let pe=!1;const Se=Re=>{if(pe)return;de.current=!0;const Ue=Re?ta({...na,enabled:!1},Re):{...na},Oe=ee.current;ee.current=null;const X=Oe?ta(Ue,Oe):Ue;ue.current=X,O(X),Oe&&!te.current&&po(X),dr(X);const ce=te.current;if(ce){const Ee=typeof ce=="function"?ce(X):ce,He=ta(X,Ee);ue.current=He,O(He),dr(He)}};return zf().then(Re=>{if(pe){const Ue=ee.current;if(ee.current=null,Ue&&!te.current){const Oe=Re?ta({...na,enabled:!1},Re):{...na};po(ta(Oe,Ue))}return}Se(Re)}),()=>{pe=!0}},[]);const[V,ae]=o.useState(null),[H,q]=o.useState(null),ie=o.useCallback((pe,Se)=>{pe==="main"?ae(Se):q(Se)},[]),Ne=o.useRef(null),_e=o.useRef(null),he=o.useCallback(()=>{_e.current!==null&&(clearTimeout(_e.current),_e.current=null);const pe=Ne.current;Ne.current=null,pe&&po(pe)},[]);o.useEffect(()=>{if(typeof window>"u")return;const pe=()=>{document.visibilityState==="hidden"&&he()};return window.addEventListener("pagehide",he),document.addEventListener("visibilitychange",pe),()=>{window.removeEventListener("pagehide",he),document.removeEventListener("visibilitychange",pe),he()}},[he]);const je=o.useCallback(pe=>{const Se=ta(ue.current,pe);if(ue.current=Se,O(Se),!de.current){ee.current={...ee.current??{},...pe},dr(Se);return}te.current||(Ne.current=Se,_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(he,Ux)),dr(Se)},[he]),$e=z.mainSpeed,De=z.mainVolume,le=o.useCallback(pe=>je({mainSpeed:pe}),[je]),we=o.useCallback(pe=>je({mainVolume:pe}),[je]),Le=o.useMemo(()=>({settings:z,setSettings:je,registerAnalyser:ie,mainAnalyser:V,noiseAnalyser:H,playbackRate:$e,setPlaybackRate:le,mainVolume:De,setMainVolume:we}),[z,je,ie,V,H,$e,le,De,we]),Be=o.useRef(null),[ze,Ve]=o.useState(0),ut=o.useRef([]),[et,Xe]=o.useState("center"),[yt,Te]=o.useState(!1),Ke=o.useRef(!1),ke=o.useRef(null),qe=o.useCallback(pe=>{Ke.current||(Ke.current=!0,Te(!0),ke.current=setTimeout(()=>{try{pe()}catch{Ke.current=!1,Te(!1)}},Gx()?0:fx))},[]);o.useEffect(()=>()=>{ke.current&&clearTimeout(ke.current)},[]);const Je=o.useRef(m);o.useEffect(()=>{Je.current=m});const tt=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const pe=Be.current,Se=tt.current;if(bo(pe,Se),pe){const Re=Array.from(pe.querySelectorAll(Nn)).filter(Ue=>!Ue.closest('[aria-hidden="true"]'))[0];if(Re)try{Re.focus()}catch{}}return()=>{const Re=document.activeElement;if(!Re||Re===document.body||pe&&pe.contains(Re))try{go(Se)?.focus?.()}catch{}}},[]),o.useEffect(()=>Zn(()=>qe(()=>{const pe=Je.current;typeof pe=="function"&&pe()})),[qe]),Co(Be,!0);const[xt,wt]=o.useState(!1),Dt=o.useRef(!1),[rt,nt]=o.useState(null),kt=o.useRef(0),At=o.useRef(0),Lt=()=>{kt.current+=1,At.current+=1,nt(null)},[jt,vt]=o.useState(""),[ot,ct]=o.useState(()=>Rr()),dt=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!M&&!j||(ct(Rr()),Lt())},[M,Q,j]),o.useEffect(()=>{j&&ct(pe=>{const Se=Math.max(0,Math.min(pe.pageIndex,Math.max(0,R-1)));return Se!==pe.pageIndex?{...pe,pageIndex:Se,stepIndex:0}:pe})},[j,R]);const _t=j?Math.max(0,Math.min(ot.pageIndex,R-1)):0,Ce=j?U[_t]:null,Pe=j&&Ce&&Array.isArray(Ce.steps)?Ce.steps:[],ye=M?ot.pageIndex:j?_t:typeof c=="number"?c:0,Ye=M?I[Math.max(0,Math.min(ot.pageIndex,Math.max(0,I.length-1)))]:null,bt=M&&Ye&&Array.isArray(Ye.steps)?Ye.steps:[],Nt=M?bt.length:j?Pe.length:typeof p=="number"?p:0,mt=M||j?Math.max(0,Math.min(ot.stepIndex,Math.max(0,Nt))):typeof h=="number"?h:0,gt=M?I.length:j?R:typeof d=="number"?d:0;o.useEffect(()=>{if(!M&&!j)return;const pe=M?Lr(Ye,ye):Ce?.id||`children-page-${ye??0}`,Se=new Date().toISOString();for(let Re=0;Re<=mt;Re+=1){const Ue=M?$r(bt[Re],Re):`step-${Re}`,Oe=ve(pe,Ue);re.current.has(Oe)||re.current.set(Oe,Se)}},[M,j,ye,mt,Ce?.id]),o.useLayoutEffect(()=>{const pe=dt.current;if(typeof ye=="number"&&pe!==null&&ye!==pe&&ye>pe)try{vt(T("training.problemNotice",{n:ye+1}))}catch{}dt.current=typeof ye=="number"?ye:dt.current},[ye,c,T]),o.useLayoutEffect(()=>{const pe=Be.current;if(!pe)return;const Se=()=>pe.querySelector(".page-popup__scroll");let Re=null,Ue=null,Oe=null;const X=Ze=>{const Ct=Se();if(!Ct)return;const ft=Ct.scrollHeight<=Ct.clientHeight;if(Xe(ft?"center":"top"),Ze&&!Dt.current){Dt.current=!0;try{wt(!0)}catch{}try{He.disconnect()}catch{}}},ce=()=>{Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Ue!==null&&clearTimeout(Ue),Ue=setTimeout(()=>X(!0),60)})},Ee=()=>{Oe!==null&&cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>X(!1))};ce(),window.addEventListener("resize",Ee);const He=new MutationObserver(ce);He.observe(pe,{childList:!0,subtree:!0,attributes:!0});const Ge=setTimeout(()=>{Dt.current||X(!0)},400);return()=>{window.removeEventListener("resize",Ee),Re!==null&&cancelAnimationFrame(Re),Ue!==null&&clearTimeout(Ue),Oe!==null&&cancelAnimationFrame(Oe),clearTimeout(Ge);try{He.disconnect()}catch{}}},[Be]);const Me=o.useCallback(pe=>{Be.current&&(Be.current._childOnNext=pe)},[]),lt=o.useCallback(pe=>{Be.current&&(Be.current._childOnResult=pe)},[]),re=o.useRef(new Map),ve=(pe,Se)=>`${pe}\0${Se}`,Ie=o.useCallback((pe,Se,Re)=>{ct(Ue=>{const Oe=Ue.answersByPage[pe]||{},X=Oe[Se],ce=Es(Re),Ee=Es(X);if(X&&Ee>ce)return Ue;const He=rd(Re,re.current.get(ve(pe,Se)),ce);return{...Ue,answersByPage:{...Ue.answersByPage,[pe]:{...Oe,[Se]:He}}}})},[ct]),We=o.useCallback((pe,Se,Re)=>{const Ue=Lr(Ye,ye),Oe=$r(pe,Se);Ie(Ue,Oe,Re)},[Ye,ye,Ie]),Qe=o.useCallback((pe,Se,Re)=>{const Ue=Lr(Ye,ye),Oe=$r(pe,Se);Ie(Ue,Oe,Re),!Re?.allowChange&&pe?.autoAdvance!==!1&&ct(X=>({...X,stepIndex:Math.max(X.stepIndex,Se+1)}))},[Ye,ye,Ie,ct]),st=o.useCallback((pe,Se)=>{const Re=Ce?.id||`children-page-${ye??0}`,Ue=typeof Se=="number"?Se:mt??0,Oe=`step-${Ue}`;Ie(Re,Oe,pe),pe?.allowChange||ct(X=>({...X,stepIndex:Math.max(X.stepIndex,Ue+1)}))},[Ce,ye,mt,Ie,ct]),Tt=o.useCallback((pe,Se)=>{const Re=Ce?.id||`children-page-${ye??0}`,Ue=`step-${typeof Se=="number"?Se:mt??0}`;Ie(Re,Ue,pe)},[Ce,ye,mt,Ie]),ln=j?{currentPageIndex:ye??0,currentStepIndex:mt??0,totalStepsInPage:Pe.length,handleStepDone:st,handleStepChange:Tt}:null,un=async()=>{const pe=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:I,flowState:ot,answersByPage:ot.answersByPage})):null;return typeof F=="function"&&await Promise.resolve(F(pe))||pe},$t=async()=>{const pe=Ce?.id||`children-page-${ot.pageIndex}`,Se=ot.answersByPage[pe]||{},Re=Y?(()=>{const X={};let ce=0;return U.forEach(Ee=>{const He=ot.answersByPage[Ee.id]||{},Ge=Array.isArray(Ee.steps)?Ee.steps.length:0;for(let Ze=0;Ze<Ge;Ze+=1){const Ct=He[`step-${Ze}`];typeof Ct<"u"&&(X[`step-${ce+Ze}`]=Ct)}ce+=Ge}),X})():Se;if(typeof A=="function"){const X=await Promise.resolve(A(Re,{pageAnswers:Se,answersByPage:ot.answersByPage,pages:U,currentPageId:pe}));return typeof F=="function"&&await Promise.resolve(F(X))||X}const Ue=Object.entries(Se).map(([X,ce],Ee)=>({index:Ee,key:X,payload:ce})),Oe={results:Ue,answers:Ue,score:0};return typeof F=="function"&&await Promise.resolve(F(Oe))||Oe},Ot=()=>{const pe=++kt.current,Se=()=>pe!==kt.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if(M){const Oe=un();nt(In);const X=Oe;Promise.resolve(X).then(ce=>{Se()||nt(ce||{isEmpty:!0})}).catch(ce=>{!Se()&&nt({isEmpty:!0})});return}if(j){const Oe=$t();nt(In);const X=Oe;Promise.resolve(X).then(ce=>{Se()||nt(ce||{isEmpty:!0})}).catch(ce=>{!Se()&&nt({isEmpty:!0})});return}const Re=Be.current&&Be.current._childOnResult,Ue=Oe=>{try{return Oe?Oe():void 0}catch{return}};if(typeof Re=="function"){const Oe=Ue(Re);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?nt(Oe):nt(Oe&&typeof Oe.then=="function"?In:{});const X=()=>{Se()||nt(ce=>ce===In?{}:ce)};Promise.resolve(Oe).then(ce=>{ce&&!Se()?nt(ce):X()}).catch(ce=>{X()});return}if(typeof F=="function"){const Oe=Ue(F);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?nt(Oe):nt(Oe&&typeof Oe.then=="function"?In:{});const X=()=>{Se()||nt(ce=>ce===In?{}:ce)};Promise.resolve(Oe).then(ce=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:jn&&jn.tagName.toUpperCase()==="SCRIPT"&&jn.src||new URL("components.cjs.js",document.baseURI).href}catch{}ce&&!Se()?nt(ce):X()}).catch(ce=>{console.error("viewResults external handler failed",ce),X()});return}},cn=()=>{if(M){if(typeof ye=="number"&&typeof gt=="number"&&ye<gt-1){ct(Se=>({...Se,pageIndex:Se.pageIndex+1,stepIndex:0}));return}return Ot()}if(j){const Se=Pe.length;if(typeof mt=="number"&&mt<Se-1){ct(Re=>({...Re,stepIndex:Re.stepIndex+1}));return}if(typeof ye=="number"&&typeof gt=="number"&&ye<gt-1){ct(Re=>({...Re,pageIndex:Re.pageIndex+1,stepIndex:0}));return}return Ot()}if(typeof C=="function"){try{C()}catch{}return}const pe=Be.current&&Be.current._childOnNext;if(typeof pe=="function"){try{pe()}catch{}return}},Pt=M?Z.title||Z.label||w||T("common.popup","\uD31D\uC5C5"):a||v||(Array.isArray(s)?s[s.length-1]:void 0)||w||T("common.popup","\uD31D\uC5C5"),kn=w||Pt,Jt=M?Z.title??Z.label??Pt:a??v??Pt,St=(pe,Se)=>{const Re=Lr(Ye,ye),Ue=$r(pe,Se),Oe=ot.answersByPage[Re]?.[Ue],X=qx(pe,{page:Ye,pageIndex:ye,step:pe,stepIndex:Se,storedPayload:Oe,answersByPage:ot.answersByPage,flowState:ot}),ce={key:Ue,index:Se,stepIndex:mt,isLast:Se===bt.length-1};switch(pe?.type){case"listen":return n.jsx(ks,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee)});case"confirm":return n.jsx(ws,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});case"confirmWithText":return n.jsx(Bs,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});case"orderList":return n.jsx(As,{...ce,...X,onDone:Ee=>Qe(pe,Se,Ee),onChange:Ee=>We(pe,Se,Ee)});default:return null}},Rt=o.useRef(void 0);o.useEffect(()=>{const pe=Rt.current;if(Rt.current=ye,pe===void 0||pe===ye||!_r())return;const Se=Be.current;if(!Se)return;const Re=document.activeElement;if(!(!Re||Re===document.body||!Se.contains(Re)||Re.disabled===!0))return;const Ue=Se.querySelector(`.training-steps ${Nn.split(", ").join(", .training-steps ")}`)??Array.from(Se.querySelectorAll(Nn)).find(Oe=>!Oe.closest('[aria-hidden="true"]'));try{Ue?.focus()}catch{}},[ye]);const Wt=M?I.length>0?n.jsx("div",{className:"training-steps",children:bt.map((pe,Se)=>St(pe,Se))},`replay-${ze}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||T("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Kt=j?n.jsxs(sd.Provider,{value:ln,children:[Ce?.pageTop?n.jsx("div",{className:"training-page-top",children:Ce.pageTop}):null,n.jsx("div",{className:"training-steps",children:Pe.map((pe,Se)=>{const Re=pe;return o.cloneElement(Re,{...Re.props,_stepIndex:Se,_totalSteps:Pe.length,_stepKey:`step-${Se}`,_pageIndex:ye})})},`replay-${ze}`),Ce?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Ce.pageBottom}):null]}):null,bn=o.useRef(-1),Ut=o.useCallback(()=>{if(!E)return;const pe=rt,{results:Se,correct:Re,total:Ue}=js(rt),Oe={correct:Re,total:Ue,attempt:ut.current.length+1,previousAttempts:[...ut.current]};if(bn.current===At.current)return Oe;bn.current=At.current,jf({items:Of(Se),category:fd.has(E)?"sentence":"word",trainingType:E,entryPoint:B??"sentence",itemRef:N??null,correct:Re,total:Ue,score:typeof pe?.score=="number"?pe.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:D??null});try{y?.(Oe)}catch{}return Oe},[E,B,D,N,rt,y]);o.useEffect(()=>{!rt||rt===In||rt?.isEmpty||(js(rt).total??0)>0&&Ut()},[rt,Ut]);const Qt=o.useCallback(()=>{const pe=Ut();Lt(),qe(()=>{typeof g=="function"&&g(pe),typeof m=="function"&&m()})},[g,m,Ut,nt,qe]),dn=o.useCallback(()=>vt(""),[vt]),gn=o.useCallback(()=>{qe(()=>{typeof m=="function"&&m()})},[m,qe]),Ht=n.jsxs("div",{className:`page-popup${yt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":kn,children:[n.jsxs("div",{ref:Be,className:`page-popup__panel ${xt?"":"page-popup__panel--measuring"} ${et==="center"?"page-popup__panel--center":et==="top"?"page-popup__panel--top":""}`,children:[n.jsx(td,{title:Jt,subtitle:M?Z.subtitle||Z.label:Array.isArray(s)?s.join(" / "):void 0,desc:M?void 0:r,depth:M?Z.depth:s,icon:M?Z.icon:l,wrapperStyle:M?Z.wrapperStyle:i,iconTooltip:M?Z.iconTooltip:u,progressMax:gt,progressIndex:ye,pageIndex:ye,pageCount:gt,onBack:gn,onClose:gn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${et==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:j?Kt:M?Wt:typeof b=="function"?b({registerOnNext:Me,registerOnResult:lt,panelRef:Be,setResultOverlay:nt}):b})}),n.jsx(ed,{onSettings:f,onNext:cn,onResult:Ot,useNoiseSettingBtn:!!(M?Z.useNoiseSetting??!0:_),stepIndex:mt,stepCount:Nt,pageIndex:ye,pageCount:gt,resultOpen:!!(rt&&!rt.isEmpty),hideNoiseRows:$})]}),rt&&!rt.isEmpty&&(k??Kx)({score:rt.score,results:rt.results||rt.answers||[],contextsLength:rt.results?rt.results.length:rt.answers?rt.answers.length:0,onReplay:()=>{if(G.current=Date.now(),rt!==In){const{correct:pe,total:Se}=js(rt);ut.current.push({correct:pe,total:Se})}if(Lt(),Ve(pe=>pe+1),M){if(ct(Rr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(j){ct(Rr());return}try{const pe=Be.current&&Be.current._childOnResult;typeof pe=="function"&&pe({replay:!0})}catch{}},onClose:Qt,pending:rt===In}),rt?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(be,{htmlType:"button",variant:"main",size:48,onClick:Qt,label:T("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ya,{message:jt,position:"top",onClose:dn})]}),An=n.jsx(bs.Provider,{value:Le,children:Ht});return typeof document<"u"&&document.body?pn.createPortal(An,document.body):An}const Un=Yx;Un.Page=Tr,Un.ListenStep=ld,Un.ConfirmStep=id,Un.ConfirmWithTextStep=ud,Un.OrderListStep=cd,Un.CardStep=dd,Un.CardOrderStep=Mx;function Zx({label:e,homonum:t}){const a=ua()?.(e,t)??"",{imgRef:r,loading:s,hasImage:l,onLoad:i,onError:u}=es(a);return l?n.jsxs("div",{className:se("word-image-tooltip__cell"),children:[s&&n.jsx("div",{className:se("word-image-tooltip__spinner")}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:s?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:se("word-image-tooltip__cell word-image-tooltip__cell--text h3"),children:n.jsx("span",{children:e})})}function bd({words:e,anchorRect:t}){const a=o.useRef(null),[r,s]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:l,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-l/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-l-8)),s({left:c,top:d})},[t]),!t||e.length===0?null:pn.createPortal(n.jsx("div",{ref:a,className:se("word-image-tooltip"),style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:se("word-image-tooltip__cells"),children:e.map(l=>n.jsx(Zx,{label:l.label,homonum:l.homonum},`${l.label}_${l.homonum??1}`))})}),document.body)}function Xx({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:s,groups:l,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:h,onPrintEmpty:p,className:m,emptyHint:g,showEmptyText:y=!0,sectionType:C="page",disc:f}){const{t:_,i18n:b}=xe.useTranslation(),w=b.language?.startsWith("ko")??!1,{anchorRect:v,openAt:A,close:x}=Oa(),[E,B]=o.useState(null),D=o.useCallback(()=>{x(),B(null)},[x]);Wy(D,!!E);const N=(r??"").trim(),k=/^[^,[\]\s]+$/.test(N)?N:"",P=k.length>0,$=r===void 0&&t===void 0,G=P?"match":$?"original":"ganada",[T,F]=o.useState(()=>G),[M,Q]=o.useState("50"),[Z,I]=o.useState(1),[K,L]=o.useState(P);K!==P&&(L(P),F(G));const W=T==="match"&&!P||T==="original"&&!$?G:T,Y=o.useMemo(()=>[...P?[{value:"match",label:_("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...$?[{value:"original",label:_("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:_("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:_("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:_("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:_("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:_("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:_("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[_,P,$]),U=o.useMemo(()=>["10","25","50","100"].map(le=>({value:le,label:_("wordSearch.pageSize",{count:Number(le),defaultValue:`${le}\uAC1C\uC529 \uBCF4\uAE30`})})),[_]),j=le=>le.words?.[0],R=o.useMemo(()=>{const le=[...k].length,we=hf(k),Le=new Map;return Be=>{let ze=Le.get(Be);return ze===void 0&&(ze=we((Be.words?.[0]?.label??"").slice(0,le))?0:1,Le.set(Be,ze)),ze}},[k]),z=o.useCallback((le,we)=>{const Le=Ve=>j(Ve)?.label??"",Be=Ve=>j(Ve)?.syllables??[...Le(Ve)].length,ze=Ve=>(Ve.words??[]).reduce((ut,et)=>{const Xe=parseInt(et.grade??"",10);return Number.isFinite(Xe)&&Xe<ut?Xe:ut},999);switch(W){case"match":return R(le)-R(we)||Cn(Le(le),Le(we));case"ganada":return Cn(Le(le),Le(we));case"ganada_desc":return Cn(Le(we),Le(le));case"syllable":return Be(le)-Be(we)||Cn(Le(le),Le(we));case"syllable_desc":return Be(we)-Be(le)||Cn(Le(le),Le(we));case"grade":return ze(le)-ze(we)||Cn(Le(le),Le(we));case"grade_desc":return ze(we)-ze(le)||Cn(Le(le),Le(we));default:return 0}},[W,R]),O=o.useMemo(()=>s.slice().sort(z),[s,z]),ue=Number(M)||10,te=o.useMemo(()=>(l??[]).flatMap(le=>le.items.slice().sort(z).map(we=>({item:we,label:le.label}))),[l,z]),de=l?te.length:O.length,ee=Math.max(1,Math.ceil(de/ue)),V=Math.min(Z,ee),ae=o.useMemo(()=>O.slice((V-1)*ue,V*ue),[O,V,ue]),H=o.useId(),q=o.useMemo(()=>{if(!l)return null;const le=te.slice((V-1)*ue,V*ue),we=new Map;for(const{item:Le,label:Be}of le)we.has(Be)||we.set(Be,[]),we.get(Be).push(Le);return[...we.entries()].map(([Le,Be])=>({label:Le,items:Be}))},[l,te,V,ue]);o.useEffect(()=>{I(1)},[T,M,de,r]);const ie=de>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(_n,{size:40,options:Y,value:W,onChange:F,ariaLabel:_("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(_n,{size:40,options:U,value:M,onChange:Q,ariaLabel:_("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(Oo,{page:V,totalPages:ee,onChange:I})]}):void 0,Ne=le=>{u&&u(le)},_e=t!==void 0&&a?n.jsxs(n.Fragment,{children:[_("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),_("wordSearch.resultTitleSuffix",{unit:w?Bf(a):a})]}):void 0,he=t!==void 0&&t>0&&c!==void 0&&a?_("wordSearch.resultDisc",{unit:w?Af(a):a,max:c,selected:i.length}):void 0,je=f??he,$e=l?l.length===0:s.length===0,De=$e&&!y&&!g;return n.jsxs(va,{type:C,className:Ae("word-search-result-block",m),children:[n.jsxs("div",{className:Ae("word-search-result-block__inner",De&&"word-search-result-block__inner--head-only"),children:[(_e||ie||je)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(at,{icon:e,className:"word-search-result-block__head-icon"}),_e&&n.jsx("span",{className:"word-search-result-block__title h3",children:_e})]}),ie&&n.jsx("div",{className:"word-search-result-block__head-actions",children:ie}),je&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:je})]}),$e&&(y||g)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[y&&n.jsx("p",{className:"word-search-result-block__empty body-3",children:_("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),g&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:g})]}),l?(q??[]).map(le=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${H}-${le.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${H}-${le.label}`,children:le.label}),n.jsx("div",{className:"word-search-result-block__items",children:le.items.map(we=>{const Le=i.includes(we.id);return n.jsx("div",{onMouseEnter:Be=>{A(Be.currentTarget),B(we.words??[])},onMouseLeave:D,children:n.jsx(be,{htmlType:"button",size:"word",align:"grid",label:(we.words??[]).map(Be=>Be.label),subLabel:(we.words??[]).some(Be=>Be.subLabel)?(we.words??[]).map(Be=>Be.subLabel):void 0,selected:Le,onClick:()=>Ne(we.id),minWidth:200})},we.id)})})]},le.label)):n.jsx("div",{className:"word-search-result-block__items",children:ae.map(le=>{const we=i.includes(le.id);return n.jsx("div",{onMouseEnter:Le=>{A(Le.currentTarget),B(le.words??[])},onMouseLeave:D,children:n.jsx(be,{htmlType:"button",size:"word",align:"grid",label:(le.words??[]).map(Le=>Le.label),subLabel:(le.words??[]).some(Le=>Le.subLabel)?(le.words??[]).map(Le=>Le.subLabel):void 0,selected:we,onClick:()=>Ne(le.id),minWidth:200})},le.id)})}),E&&v&&n.jsx(bd,{words:E,anchorRect:v})]}),(d||h)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:_("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:i.length===0,onClick:i.length===0?void 0:d}),h&&n.jsx("div",{onClick:i.length===0?p:void 0,children:n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:h})})]})]})}function Jx(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,s=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:s}})}function Qx({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:s=4,minCount:l=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:h,title:p,titleIcon:m,disc:g,showInfoButton:y=!0,onClearPhoneme:C,onSearch:f,onSearchEmpty:_,searchDisabled:b=!1,searchLabel:w,searchChecking:v=!1,pairMode:A=!1,sectionType:x="page",beforeSearchContent:E,beforeContent:B,afterContent:D,hideCountControl:N=!1,ordinal:k=!1}){const{t:P}=xe.useTranslation(),$=o.useMemo(()=>P("wordPairs.infoNotes",{returnObjects:!0}),[P]),G=o.useMemo(()=>Array.from({length:s-l+1},(j,R)=>{const z=l+R;return{key:String(z),label:P("wordPairs.count",{n:z})}}),[P,s,l]),T=o.useMemo(()=>P("wordPairs.ordinals",{returnObjects:!0}),[P]),F=o.useCallback(j=>k?P("wordPairs.phonemeOrdinalLabel",{ordinal:T[j-1]??j}):a===1?P("wordPairs.phonemeSingleLabel","\uC74C\uC808"):P("wordPairs.phonemeN",{n:j}),[k,T,a,P]),M=o.useCallback(j=>k?P("wordPairs.phonemeContrastOrdinalLabel",{ordinal:T[j-1]??j}):a===1?P("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):P("wordPairs.phonemeContrast",{n:j}),[k,T,a,P]),Q=o.useCallback((j,R)=>R?n.jsxs(n.Fragment,{children:[j,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):j,[]),{anchorRect:Z,toggleAt:I,close:K}=Oa(),L=o.useCallback(j=>r(Number(j)),[r]),W=yn("(max-width: 767px)"),Y=o.useCallback(j=>Jx(j,e).map(({label:R,value:z,displayLabel:O})=>{const ue=!!z&&z!=="\uC5C6\uC74C";return n.jsxs("span",{className:Ae("phoneme-select-block__cell-jamo-part",z?"":"phoneme-select-block__cell-jamo-part--empty",ue?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${z==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:z==="\uC5C6\uC74C"?"x":z||d}),ue&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:O??R})]},R)}),[e,d]),U=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(be,{htmlType:"button",size:40,type:W?"dot":void 0,icon:"info",label:W?void 0:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:Z?"is-selected":void 0,"aria-expanded":!!Z,"aria-haspopup":"dialog",onClick:j=>I(j.currentTarget)})}),Z&&n.jsx(Xn,{title:P("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:$,anchorRect:Z,onClose:K})]});return n.jsxs(va,{type:x,title:p,icon:m,disc:g,action:y?U:void 0,className:Ae("phoneme-select-block",h),children:[B,!N&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(vn,{options:G,value:String(a),onChange:L,size:40,ariaLabel:P("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:A?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(z)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:F(R+1)})]},R)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:P("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(z)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R)})})]}):t.map((j,R)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:Y(j)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:F(R+1)})]},R))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:A?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2]??{};return n.jsx(Fn,{title:Q(F(R+1),R===0),sections:u?u(z,R*2):i,selected:z,onSelect:c?.(R*2),align:"newline"},R)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((j,R)=>{const z=t[R*2+1]??{};return n.jsx(Fn,{title:M(R+1),sections:u?u(z,R*2+1):i,selected:z,onSelect:c?.(R*2+1),align:"newline"},R)})})]}):t.map((j,R)=>n.jsx(Fn,{title:Q(F(R+1),R===0),sections:u?u(j,R):i,selected:j,onSelect:c?.(R),align:"newline"},R))})}),E&&n.jsx("div",{className:"phoneme-select-block__before-search",children:E}),(C||f||v)&&(()=>{const j=t.every(R=>{const z=uf(R);return Object.entries(z).every(([O,ue])=>!ue||O==="coda"&&ue===Rl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:j?_:void 0,children:[C&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:P("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:j,onClick:j?void 0:C}),f?n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:v?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:w??P("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:j||b||v,onDisabledClick:v?()=>{}:void 0,"aria-busy":v||void 0,onClick:f}):v?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:w??P("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),D]})}function ew({title:e,sections:t,selected:a,onSelect:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:h}){const{t:p}=xe.useTranslation();return n.jsx(Fn,{className:h,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function tw({title:e,headerAction:t,sections:a,selected:r,onSelect:s,className:l}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(Fn,{className:l,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:s,align:"newline"})}function nw({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:s,positionCount:l,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:h}=xe.useTranslation(),p={searchMode:h("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:h("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:h("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:h("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:h("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:h("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:h("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:h("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:h("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:h("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:h("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},m=f=>h("wordPairs.count",{n:f}),g=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ua,{title:h("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[h("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),h("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),h("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Ua,{items:h("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[m(1),m(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ua,{title:h("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[h("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),h("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],y={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:m(l),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(f,_)=>{_===p.searchMode?a(f===p.explicit?"explicit":f===p.pick?"pick":"include"):_===p.phonemeOrder?s(f===p.orderMatch?"ordered":"unordered"):_===p.count?i(f===m(2)?2:1):_===p.inputMode&&c(f===p.pronInput?"phoneme":"word")};return n.jsx(Fn,{className:d,title:e??h("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:g,selected:y,onSelect:C,align:"inline"})}function aw(e){const{title:t,items:a,columns:r,resizeStorageKey:s,gridTemplateColumns:l,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:h=!0,selectedId:p,selectedIds:m,onSelect:g,onClose:y,pageSizeOptions:C=[10,25,50,100],initialPageSize:f,emptyText:_,noMatchText:b,countLabel:w,topContent:v,className:A=""}=e,{t:x}=xe.useTranslation(),E=u??x("common.search","\uAC80\uC0C9"),B=_??x("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),D=b??x("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[N,k]=o.useState(""),[P,$]=o.useState(d??r[0]?.key??""),[G,T]=o.useState(h),[F,M]=o.useState(String(f??C[0]??10)),[Q,Z]=o.useState(1);o.useEffect(()=>{Z(1)},[N,F]);const I=c!==null,K=o.useCallback((te,de)=>{if(!de)return!0;const ee=de.toLowerCase();return r.some(V=>{const ae=te[V.key];return ae==null?!1:String(ae).toLowerCase().includes(ee)})},[r]),L=c??K,W=o.useMemo(()=>{const te=I?a.filter(de=>L(de,N)):a;return P?[...te].sort((de,ee)=>{const V=de[P],ae=ee[P];return V===ae?0:fr(V,ae,G)}):te},[a,N,P,G,I,L]),Y=Math.max(1,Math.ceil(W.length/Number(F)));Q>Y&&Z(Y);const U=Math.min(Q,Y),j=W.slice((U-1)*Number(F),U*Number(F)),R=o.useCallback(te=>{P===te?T(de=>!de):($(te),T(!0)),Z(1)},[P]),z=o.useMemo(()=>{if(typeof w=="function"){const te=W.length,de=w(te);if(typeof de=="string"){const ee=de.lastIndexOf(String(te));if(ee>=0)return{prefix:de.slice(0,ee),suffix:de.slice(ee+String(te).length)}}return{label:de}}if(typeof w=="string"&&w.includes("{n}")){const[te,de]=w.split("{n}");return{prefix:te,suffix:de}}return{prefix:x("common.totalCountPrefix","\uCD1D "),suffix:x("common.totalCountSuffix","\uAC1C")}},[w,W.length,x]),O=o.useMemo(()=>r.map(te=>({label:te.label,onClick:te.sortable!==!1?()=>R(te.key):void 0,className:te.className,sortDir:te.sortable!==!1&&P===te.key?G?"asc":"desc":null})),[r,P,G,R]),ue=o.useMemo(()=>C.map(te=>({value:String(te),label:x("common.pageSizeLabel",{n:te})})),[C,x]);return n.jsxs(Rn,{className:`popup-list ${A}`,title:t,onClose:y,children:[v,"label"in z&&n.jsx("p",{className:"toolbar__count body-1",children:z.label}),n.jsx(zo,{count:"label"in z?void 0:{value:W.length,prefix:z.prefix,suffix:z.suffix},search:I?{value:N,onChange:k,placeholder:E}:void 0,pageSize:{options:ue,value:F,onChange:M},pagination:{page:U,total:Y,onChange:Z}}),n.jsx(Jo,{size:"medium",gridTemplateColumns:l,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:s,fields:O,items:j,onRowClick:g,renderRow:te=>{const de=m!=null?te.id!=null&&m.has(te.id):p!=null&&te.id===p;return r.map(ee=>({content:ee.render?ee.render(te):te[ee.key]??"",className:Ae(ee.className,de&&"popup-list__row--selected")}))},empty:I&&N!==""&&a.length>0?D:B})]})}function gd(e){const{title:t,message:a,topContent:r,details:s,children:l,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:h="main",confirmDisabled:p=!1,onConfirm:m,closeOnConfirm:g=!0,onClose:y,inline:C,size:f="small",className:_,initialFocus:b="close"}=e,{t:w}=xe.useTranslation(),v=o.useRef(null);o.useEffect(()=>{if(C||b==="close")return;const N=v.current?.closest(".popup-panel"),k=Array.from(N?.querySelectorAll(".popup-footer--buttons button")??[]),P=b==="confirm"?k[k.length-1]:c?void 0:k[d?1:0];P&&!P.disabled&&P.focus()},[]);const A=o.useRef(!1),[x,E]=o.useState(!1),B=N=>{let k=!1;return{close:()=>{k=!0,N()},didClose:()=>k}},D=async N=>{if(A.current)return;A.current=!0;const k=typeof document<"u"?document.activeElement:null;E(!0);let P=!1;try{P=await N()}catch($){typeof console<"u"&&console.error($)}finally{P||(A.current=!1,E(!1),requestAnimationFrame(()=>{const $=document.activeElement;(!$||$===document.body)&&k?.isConnected&&k.focus()}))}};return n.jsxs(Rn,{title:t,onClose:y,closeDisabled:x,inline:C,size:f,className:Ae("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||x,onClick:async({closeWithAnimation:N})=>{await D(async()=>{const k=B(N);await d.onClick(k.close);const P=d.closeOnClick??!0;return P&&N(),P||k.didClose()})}}]:[],...c?[]:[{label:u??w("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:x,onClick:({closeWithAnimation:N})=>N()}],{label:i??w("common.confirm","\uD655\uC778"),variant:h,disabled:p||x,onClick:async({closeWithAnimation:N})=>{await D(async()=>{const k=B(N);return await m(k.close),g&&N(),g||k.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),s&&s.length>0&&n.jsx(Ja,{children:s.map((N,k)=>n.jsx(sn,{label:N.label,children:n.jsx("span",{className:"panel-row__text body-2",children:N.value})},k))}),n.jsx("p",{ref:v,className:"body-2 confirm-popup__message",children:a}),l]})}function rw(e,t,a={}){const{t:r}=xe.useTranslation(),[s,l]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(l(!0),!1):!0,[e]),d=s?n.jsx(gd,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{l(!1),t()},onClose:()=>l(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function ow({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,s]=o.useState(""),[l,i]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),h=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async y=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),y()}catch(f){c(Ol(f)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),m=o.useCallback((y,C)=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&p(C)},[p]),g=y=>{s(y.target.value),c(null)};return n.jsx(Rn,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:l,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:l,onClick:({closeWithAnimation:y})=>y()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||l,onClick:({closeWithAnimation:y})=>{p(y)}}],children:({closeWithAnimation:y})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?h:void 0,"aria-describedby":u?h:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:g,onKeyDown:C=>m(C,y),disabled:l,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:h,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const yd=["var(--color-main)","var(--color-sub)"],sw=2e3;function lw(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function Ts({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:s,trigger:l=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),f=t-C,_=(b,w)=>Array.from({length:b}).map((v,A)=>{const x=6+Math.random()*12,E=Math.round(Math.min(18,x*Math.min(1.5,1+r*.4))),B=yd[Math.floor(Math.random()*yd.length)],D=Math.random()*300,N=(360+Math.random()*260)*r*1.2,k=(w==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,P=Math.cos(k)*N,$=Math.sin(k)*N*1.35,G=Math.random()*720-360,T=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),F=Math.random()>.7?"50%":"3px";return{id:`${w}-${A}`,side:w,size:E,color:B,delay:D,vx:P,vy:$,angularVel:G,life:T,borderRadius:F}});return[..._(C,"left"),..._(f,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),h=o.useRef(s);o.useEffect(()=>{h.current=s},[s]);const p=o.useRef(null),m=o.useRef(null),g=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&m.current==null&&(m.current=g()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const K=setTimeout(()=>h.current?.(),0);return()=>clearTimeout(K)}const C=1200,f=performance.now(),_=m.current&&m.current!==document.body?m.current.getBoundingClientRect():null,b=Math.max(60,(window.innerHeight||800)*.05),w=K=>Math.max(40,(K||window.innerWidth)*.02),v=_?.width||window.innerWidth||375,A=_?.height||window.innerHeight||812,x=K=>{const L=[...K].sort((W,Y)=>W-Y);return L[Math.floor(L.length/2)]||1},E=x(i.map(K=>Math.abs(K.vy))),B=x(i.map(K=>Math.abs(K.vx))),D=Math.sqrt(2*C*(A*.72+b))/E,N=E*D/C,k=v*.5/(B*N),P=(K,L,W)=>Math.min(W,Math.max(L,K)),$=P(D,.8,2.4),G=P(k,.7,2.2),T=a>0?a/sw:1,F=i.map(K=>({...K,life:K.life*T,vx:K.vx*G,vy:K.vy*$,startTime:f+K.delay,ended:!1})),M=_?{x:_.left-w(_.width),y:_.top+_.height+b}:{x:-w(window.innerWidth),y:window.innerHeight+b},Q=_?{x:_.left+_.width+w(_.width),y:_.top+_.height+b}:{x:window.innerWidth+w(window.innerWidth),y:window.innerHeight+b},Z=K=>{let L=!1;for(const W of F){const Y=c.current[W.id];if(!Y||!Y)continue;if(K<W.startTime){Y.style.display="none",L=!0;continue}if(!W._inited){const V=W.side==="left"?M.x:Q.x,ae=W.side==="left"?M.y:Q.y;Y.style.left=`${V}px`,Y.style.top=`${ae}px`,Y.style.transform="translate3d(0px, 0px, 0)",Y.style.display="block",Y.style.zIndex="100000",typeof W.color=="string"&&W.color.startsWith("var(")&&(Y.style.background=lw(Y,W.color)??"#FF0060"),W._inited=!0}const U=(K-W.startTime)/1e3;if(U<0)continue;const j=W.life/1e3;if(U>=j){Y.style.opacity="0",Y.style.display="none",W.ended=!0;continue}L=!0;const R=W.side==="left"?M.x:Q.x,z=W.side==="left"?M.y:Q.y,O=R+W.vx*U,ue=z+W.vy*U+.5*C*U*U,te=(W.angularVel||0)*U,de=O-R,ee=ue-z;Y.style.transform=`translate3d(${de}px, ${ee}px, 0) rotate(${te}deg)`,Y.style.opacity=`${Math.max(0,1-U/j)}`}L?d.current=requestAnimationFrame(Z):h.current?.()};d.current=requestAnimationFrame(Z);const I=setTimeout(()=>{try{if((m.current?m.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const K=document.createElement("div");K.className="party-container",K.style.position="fixed",K.style.inset="0",K.style.pointerEvents="none",K.style.overflow="visible",K.style.zIndex="2147483647";for(const L of i){const W=document.createElement("span");W.className=`confetti confetti--${L.side}`,W.setAttribute("aria-hidden","true"),W.style.display="none",W.style.position="fixed",W.style.left="0px",W.style.top="0px",W.style.width=`${L.size}px`,W.style.height=`${Math.max(4,L.size*.6)}px`,W.style.background=L.color,W.style.borderRadius=L.borderRadius,W.style.transform="translate3d(0,0,0)",W.style.opacity="0",K.appendChild(W),c.current[L.id]=W}(document.body||m.current).appendChild(K),p.current=K}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(I),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,l,i]),!e)return null;const y=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:f=>{c.current[C.id]=f},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${l}`))});return typeof document<"u"?pn.createPortal(y,m.current||document.body):y}const Ms=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function iw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const l=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Ms(u.count),strength:Ms(u.strength),duration:Ms(u.duration)}))};return window.addEventListener("party:trigger",l),()=>window.removeEventListener("party:trigger",l)},[]);const s=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(Ts,{active:t,trigger:e}),a&&n.jsx(Ts,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:s})]})}function uw({title:e,sub:t,rightAction:a,titleAction:r,badge:s,badgeVariant:l="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:h}=xe.useTranslation();Ey(typeof e=="string"?e:i??null);const p=c??h("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(be,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),s&&n.jsx("div",{className:"page-title__badge",children:n.jsx(on,{label:s,size:"small",variant:l,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function cw(e){return e??""}const vd=o.createContext({words:[],loading:!1});function dw(){return o.useContext(vd)}function pw({words:e,loading:t,error:a,statusMessage:r,localVersion:s,remoteVersion:l,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const h=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:s,remoteVersion:l,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,s,l,i,u,c]);return n.jsx(vd.Provider,{value:h,children:d})}function hw({items:e,actions:t,columns:a,flat:r=!1,className:s,style:l}){const i=a??e.length;return n.jsx("section",{className:Ae("summary-strip",r&&"summary-strip--flat",s),style:{"--summary-strip-cols":String(i),...l},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const mw=(e,t)=>`${e} / ${t}`;function Cw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:s=mw,pageWidth:l,pageHeight:i,margin:u,className:c,style:d}){const{t:h}=xe.useTranslation(),p=o.useRef(null),m=o.useRef(null),g=o.useRef(null),y=o.useRef(null),[C,f]=o.useState(null),[_,b]=o.useState(!1);o.useEffect(()=>{const T=p.current;if(!T)return;const F=()=>b(T.scrollWidth>T.clientWidth+1);if(F(),typeof ResizeObserver>"u")return;const M=new ResizeObserver(F);return M.observe(T),()=>M.disconnect()},[C]);const w=e.map(T=>`${T.id}\0${T.section??""}\0${T.group??""}`).join(""),v=C&&C.shape===w?C.pages:null,[A,x]=o.useState(0);o.useEffect(()=>{const T=y.current;if(!T||typeof ResizeObserver>"u")return;const F=new ResizeObserver(()=>x(T.offsetHeight));return F.observe(T),()=>F.disconnect()},[]);const[E,B]=o.useState(0);o.useEffect(()=>{const T=m.current;if(!T||typeof ResizeObserver>"u")return;let F=null;const M=typeof requestAnimationFrame=="function"?I=>requestAnimationFrame(I):I=>setTimeout(I,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:I=>clearTimeout(I),Z=new ResizeObserver(()=>{F==null&&(F=M(()=>{F=null,B(I=>I+1)}))});return Array.from(T.children).forEach(I=>Z.observe(I)),()=>{Z.disconnect(),F!=null&&Q(F)}},[w]),o.useLayoutEffect(()=>{const T=m.current,F=y.current;if(!T||!F)return;const M=j=>j.getBoundingClientRect().height||j.offsetHeight,Q=new Map;g.current?.querySelectorAll("[data-chrome-section]").forEach(j=>{Q.set(j.dataset.chromeSection??"",M(j))});const Z=j=>M(F)-(Q.get(j??"")??0),I=Array.from(T.children).map(j=>M(j)),K=[];e.forEach((j,R)=>{const z=K[K.length-1],O=z?e[z[0]]:void 0;O&&j.group!=null&&O.group===j.group&&O.section===j.section?z.push(R):K.push([R])});const L=[];let W=[],Y=0;const U=()=>{W.length&&L.push(W),W=[],Y=0};K.forEach(j=>{const R=j.reduce((O,ue)=>O+I[ue],0),z=Z(e[j[0]].section);W.length&&e[W[0]].section!==e[j[0]].section&&U(),R>z?j.forEach(O=>{W.length&&Y+I[O]>z+.01&&U(),W.push(O),Y+=I[O]}):(W.length&&Y+R>z+.01&&U(),j.forEach(O=>W.push(O)),Y+=R)}),U(),f(j=>j&&j.shape===w&&JSON.stringify(j.pages)===JSON.stringify(L)?j:{shape:w,pages:L})},[w,A,l,i,u,E]);const D=Lo,N=D,k=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:N,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),P=(T,F,M)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:M!=null&&t?.[M]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:k}),n.jsx("span",{className:"report-doc__page-no",children:s(T,F)})]})}),$=Array.from(new Set(e.map(T=>T.section??""))),G={...l?{"--report-page-w":l}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:Ae("report-doc",c),style:G,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?h("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:y,className:"report-doc__ruler"}),n.jsx("div",{ref:g,children:$.map(T=>{const F=P(1,1,T||void 0);return n.jsxs("div",{"data-chrome-section":T,children:[F.header,F.footer]},T)})}),n.jsx("div",{ref:m,className:"report-doc__measure-blocks",children:e.map(T=>n.jsx("div",{children:T.content},T.id))})]}),v&&n.jsx("div",{className:"report-doc__pages",children:v.map((T,F)=>{const{header:M,footer:Q}=P(F+1,v.length,e[T[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[M,T.map(Z=>n.jsx("div",{children:e[Z].content},e[Z].id)),Q]},F)})})]})}function fw({title:e,fields:t,columns:a=4,className:r,style:s}){return n.jsxs("div",{className:Ae("report-info",r),style:{"--report-info-cols":String(a),...s},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((l,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:l.label}),n.jsx("span",{className:"report-info__value",children:l.value})]},i))})]})}const oa=new Map;let Pr=null;const bw=12;function gw(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function Fr(){const e=new Map;for(const t of oa.keys()){if(!t.isConnected)continue;const a=gw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,s)=>r.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const s=r.getBoundingClientRect().height;s>0&&(a+=s+bw)}}}function yw(e){return typeof window>"u"?()=>{}:(oa.set(e,(oa.get(e)??0)+1),oa.get(e)===1&&typeof ResizeObserver<"u"&&(Pr??(Pr=new ResizeObserver(()=>Fr())),Pr.observe(e)),Fr(),()=>{const t=(oa.get(e)??1)-1;if(t>0){oa.set(e,t),Fr();return}oa.delete(e),Pr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Fr()})}function vw({title:e,message:t,actionLabel:a,onAction:r,icon:s,onClose:l,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),h=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,m=p?.parentElement?.closest(".update-alert-stack")??p,g=m?yw(m):null;return()=>{g?.(),h.current&&p&&p.contains(document.activeElement)&&hr(p)}},[]),n.jsxs("div",{ref:d,className:Ae("update-alert",i),role:"alert",children:[l&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{h.current=!0,l()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:s??n.jsx(qs,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(be,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function _w({title:e,titleLevel:t=3,description:a,topActions:r,children:s,footerLeft:l,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:h,onDragEnd:p,className:m}){const g=t?`h${t}`:"div",y=l!=null||i!=null,C=s!=null&&s!==!1,f=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:Ae("training-card",c?"training-card--clickable":"",m),onClick:c,onKeyDown:c?f:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:h,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(g,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:s}),y&&n.jsxs("div",{className:"training-card__footer",children:[l!=null&&n.jsx("div",{className:"training-card__footer-left",children:l}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function xw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:s,beforeSort:l,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:h=!1,onDragOver:p,onDragLeave:m,onDrop:g,children:y,className:C}){const{t:f}=xe.useTranslation(),_=o.useId(),b=t?`h${t}`:"span",w=s!=null,v=Ae("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",w&&"training-card-group--collapsible",C);return n.jsxs("div",{className:v,onDragOver:p,onDragLeave:m,onDrop:g,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[w&&n.jsx(be,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?f("common.expandFor",{name:e}):f("common.collapseFor",{name:e}):r?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:s}),typeof e=="string"?n.jsx(b,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(l!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:A=>A.stopPropagation(),children:[l,i&&n.jsx(_n,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?f("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:y}))]})}const ww="speechear:saved_word_tables";function Bw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function kw(){try{const e=localStorage.getItem(ww);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(Bw):[]}catch{return[]}}function _d(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Ls(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function Aw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let s=2;t.has(r);s++)r=`${a.id}~${s}`;return t.add(r),r===a.id?a:{...a,id:r}})}function Nw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:s,filterDefaultCollapsed:l,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:h,baseItem:p,baseContentTypes:m,cellCapacity:g,maxItemsPerPage:y,items:C,onSaveComplete:f,onLoad:_,onRemoveItem:b,onCopyItem:w,onReset:v,resetLabel:A,saveButtonLabel:x,secondarySaveButtonLabel:E,onReorder:B,showCellCount:D,onAddItem:N,className:k,renderSavePopup:P,renderWordSearch:$,hideControls:G,saveOnly:T,tableName:F,nameValue:M,onNameChange:Q,descriptionValue:Z,onDescriptionChange:I,namePlaceholder:K,descriptionPlaceholder:L,existingNames:W,editingName:Y,onCancel:U,initialItemsPerPage:j,renderCellAction:R,actionsLeftExtra:z}){const{t:O}=xe.useTranslation(),ue=A??O("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),te=C===void 0,de=!!Q,[ee,V]=o.useState([]),ae=(M??"").trim(),H=ae||(K??"").trim(),q=(Z??"").trim()||(L??"").trim(),ie=(W??[]).map(ne=>ne.trim().toLowerCase()),Ne=[Y?.trim().toLowerCase(),...ee].filter(ne=>!!ne),_e=[...ie];for(const ne of Ne){const fe=_e.indexOf(ne);fe!==-1&&_e.splice(fe,1)}const he=ae!==""&&_e.includes(ae.toLowerCase()),[je,$e]=o.useState(Array(4).fill(null)),[De,le]=o.useState(4),[we,Le]=o.useState(null),Be=je.slice(0,De),ze=!!d?.show,[Ve,ut]=o.useState(!0),[et,Xe]=o.useState(!0),yt=d&&{...d,top:Ve,bottom:et},[Te,Ke]=o.useState("landscape"),[ke,qe]=o.useState([...fc]),[Je,tt]=o.useState("show"),[xt,wt]=o.useState(!0),[Dt,rt]=o.useState(!0),nt=o.useRef(null),kt=o.useRef([]),[At,Lt]=o.useState(j==="all"?Number.POSITIVE_INFINITY:j??8),[jt,vt]=o.useState("right"),[ot,ct]=o.useState(!1),[dt,_t]=o.useState(!1),{toastMessage:Ce,toastType:Pe,showWarning:ye,clearToast:Ye}=Ui("warning"),bt=o.useCallback(()=>Le(null),[Le]);N&&!te&&!D&&!g&&Bt("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 cellCapacity \uB098 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.'),p&&te&&Bt("word-table-block-base-item-in-edit","[WordTableBlock] baseItem \uC740 \uD45C\uC2DC \uBAA8\uB4DC(items \uB97C \uC8FC\uB294 \uAF34)\uC5D0\uC11C\uB9CC \uAC78\uB9B0\uB2E4 \u2014 \uD3B8\uC9D1 \uACA9\uC790\uC5D0\uB294 \uC11C\uC9C0 \uC54A\uB294\uB2E4.");const[Nt,mt]=o.useState(()=>Math.max(C?.length??1,1)),gt=Math.max(g??0,C?.length??0,1),Me=te?De:D?Math.max(Nt,C?.length??1,1):gt,{width:lt,height:re}=ea[Te],ve=!te&&!D,Ie=Math.max(1,Math.min(gt,y??gt)),We=Math.min(At,Ie),Qe=ve?We:Me,st=Math.ceil((C?.length??0)/Math.max(1,Qe)),Tt=(C?.length??0)<gt?Math.floor((C?.length??0)/Math.max(1,Qe))+1:0,ln=ve?Math.max(1,st,Tt):0,un=ve?Array.from({length:ln},(ne,fe)=>(C??[]).slice(fe*Qe,(fe+1)*Qe)):null,$t=!!un&&un.length>1,Ot=te?Be.some(ne=>ne!==null&&ne.length>1):(C??[]).some(ne=>(ne.words??[]).length>1),cn=F?.trim()||`${Kl(Pa())} ${Ot?O("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):O("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Pt=o.useCallback(()=>$t?kt.current.filter(ne=>ne!==null):nt.current?[nt.current]:[],[$t]),{print:kn,openNewWindow:Jt,downloadHtml:St}=ps({getElements:Pt,paperW:lt,paperH:re,fileName:cn,onPopupBlocked:()=>{ye(O("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),Rt=ne=>{le(ne),$e(fe=>fe.length>=ne?fe:[...fe,...Array(ne-fe.length).fill(null)]),Le(null)},Wt=ne=>{$e(fe=>{const Fe=[...fe];return Fe[ne]=null,Fe}),we===ne&&Le(null)},Kt=ne=>{if(we===null)return;const fe=we;$e(it=>{const pt=[...it];return pt[fe]=ne.length>0?ne:null,pt});const Fe=Be.findIndex((it,pt)=>pt>fe&&it===null);Le(Fe!==-1?Fe:null)},bn=te?Be.some(ne=>ne?.some(fe=>!!fe.colloquialPronunciation)):(C??[]).some(ne=>(ne.words??[]).some(fe=>!!fe.colloquialLabel)),Ut=!te&&bc([...p?[p]:[],...C??[]]),Qt=o.useMemo(()=>ua()?te?je.slice(0,De).flatMap(ne=>(ne??[]).map(fe=>[fe.word,fe.homonum])):(ne=>ne.flatMap(fe=>(fe.words??[]).map(Fe=>[Fe.label,Fe.homonum])))([...p?[p]:[],...C??[]]):[],[te,je,De,C,p]),[dn,gn]=o.useState(!1);o.useEffect(()=>{if(Qt.length===0)return;let ne=!1;return Promise.all(Qt.map(([fe,Fe])=>Tl(fe,Fe))).then(fe=>{ne||gn(fe.some(Boolean))},()=>{}),()=>{ne=!0}},[Qt]);const Ht=Qt.length>0&&dn,An=o.useMemo(()=>[...te||D?[{label:O("wordTable.filter.columns","\uCE78 \uC218"),items:q4.map(ne=>({value:`${ne}\uCE78`,displayLabel:O("wordTable.filter.column",{count:ne})})),display:"segmented"}]:[],...ve&&(C?.length??0)>0?[kc(O,{hasPairs:Ot,itemCount:gt,max:y})]:[],...$t?[G4(O)]:[]],[O,te,D,ve,C?.length,Ot,gt,y,$t]),pe={...te||D?{[O("wordTable.filter.columns","\uCE78 \uC218")]:`${Me}\uCE78`}:{},...ve&&(C?.length??0)>0?{[O(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${We}\uAC1C`}:{},...$t?{[O("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:jt}:{}},Se=(ne,fe)=>{fe===O("wordTable.filter.columns","\uCE78 \uC218")?te?Rt(parseInt(ne)):mt(parseInt(ne)):fe===O(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?Lt(Ac(parseInt(ne),gt)):fe===O("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&vt(Nc(ne))},Re=te?Aw(Be.filter(ne=>ne!==null&&ne.length>0).map(ne=>({id:Ls(ne),words:ne.map(_d)}))):C??[],Ue=()=>{te&&$e(ne=>ne.length>De?ne.slice(0,De):ne)},Oe=(ne=!1)=>{if(_t(ne),de&&f){const fe=H.trim().toLowerCase();fe&&V(Fe=>Fe.includes(fe)?Fe:[...Fe,fe]),f(H,Re,q||void 0,ne),Ue();return}if(T&&f){f("",Re,void 0,ne),Ue();return}if(f){ct(!0);return}St()},[X,ce]=o.useState(!1),[Ee,He]=o.useState(""),Ge=Ee.trim(),Ze=Ge!==""&&ie.includes(Ge.toLowerCase()),Ct=()=>{He(H?O("wordTable.save.copyName",{name:H,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),ce(!0)},ft=()=>{!Ge||Ze||!f||(f(Ge,Re,q||void 0,!0),Ue(),ce(!1))},ge=Re.length===0,S=ge||de&&(H===""||he),J=()=>{if(ge){ye(O("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(de&&H===""){ye(O("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}de&&he&&ye(O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},me=n.jsx(_a,{items:Re,orientation:Te,contentTypes:ke,baseItem:p,baseContentTypes:m,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Me});return n.jsxs(n.Fragment,{children:[n.jsxs(va,{type:"page",icon:t,title:e,disc:a,className:Ae("word-table-block",k),children:[X&&n.jsx(Rn,{size:"small",title:E??O("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>ce(!1),footer:({closeWithAnimation:ne})=>n.jsxs(n.Fragment,{children:[n.jsx(be,{htmlType:"button",size:48,type:"bar",label:O("common.cancel","\uCDE8\uC18C"),onClick:ne}),n.jsx(be,{htmlType:"button",size:48,type:"bar",variant:"main",label:O("common.save","\uC800\uC7A5"),disabled:!Ge||Ze,onClick:ft})]}),children:n.jsx(qn,{label:O("wordTable.save.nameLabel","\uC774\uB984"),value:Ee,onChange:He,placeholder:O("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:ft,error:Ze?O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),ot&&f&&P?.({defaultName:typeof e=="string"?e:O("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:me,previewW:lt,previewH:re,items:Re,existingNames:kw().map(ne=>ne.name),saveAsNew:dt,onSave:(ne,fe)=>{f(ne,Re,fe,dt),Ue(),ct(!1)},onCancel:()=>ct(!1)}),(te||N)&&we!==null&&$?.({cellIndex:we,onConfirm:te?Kt:ne=>{if(N){const fe=ne[0];if(fe){const Fe=new Set((C??[]).map(pt=>pt.id));let it=Ls([fe]);for(let pt=2;Fe.has(it);pt++)it=`${Ls([fe])}~${pt}`;N({id:it,words:[_d(fe)]})}}Le(null)},onClose:bt}),!G&&n.jsx(is,{title:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:Ht,hasColloquial:bn,hasCaption:Ut,contentTypes:ke,orientation:Te,showOutline:xt,cutLine:Je,showDivLine:Dt,setters:{setContentTypes:qe,setOrientation:Ke,setShowOutline:wt,setCutLine:tt,setShowDivLine:rt,setShowTopInfo:ut,setShowBottomInfo:Xe},showCutLine:(ve?Qe:Me)>1,showDivLine2:Ot,middleSections:An,extraSelected:pe,onExtraSelect:Se,showPaperBands:ze,showTopInfo:Ve,showBottomInfo:et}),$t&&un?n.jsx("div",{className:"word-table-block__pages",children:un.map((ne,fe)=>n.jsx(_a,{orientation:Te,contentTypes:ke,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Qe,items:ne,baseItem:p,baseContentTypes:m,onRemoveItem:b,onCopyItem:w,onReorder:B&&((Fe,it)=>B(Fe+fe*Qe,it+fe*Qe)),indexOffset:fe*Qe,totalCount:C?.length??0,renderCellAction:R&&((Fe,it)=>R(Fe+fe*Qe,it)),showFillerAdd:!!N,onActivateCell:N?(Fe=>Le(Fe+fe*Qe)):void 0,addableCount:Math.max(0,Math.min(Qe,gt-fe*Qe)),brand:yt,code:h,contentRef:Fe=>{kt.current[fe]=Fe},pageNumber:{current:fe+1,total:un.length},pageNumberPosition:jt},fe))}):n.jsx(_a,{orientation:Te,contentTypes:ke,cutLine:Je,showOutline:xt,showDivLine:Dt,count:Me,items:te?void 0:C??[],baseItem:te?void 0:p,baseContentTypes:m,editCells:te?Be:void 0,activeCell:we,onActivateCell:te||N?Le:void 0,onRemoveCell:te?Wt:void 0,onRemoveItem:te?void 0:b,onCopyItem:te?void 0:w,onReorder:te?void 0:B,renderCellAction:te?void 0:R,brand:yt,code:h,showFillerAdd:!!N,contentRef:nt}),!G&&!T&&z!=null&&n.jsx("div",{className:"word-table-block__table-actions",children:z}),de&&!G&&n.jsxs(Ja,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(sn,{variant:"custom",label:O("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(qn,{required:!0,value:M??"",onChange:Q,placeholder:K?K+O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):O("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:O("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:he?O("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ne=>{(ne.key==="Tab"&&!ne.shiftKey||ne.key===" ")&&!(M??"").trim()&&(K??"").trim()&&(ne.preventDefault(),Q?.(K??""))}})}),n.jsx(sn,{variant:"custom",label:O("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(qn,{value:Z??"",onChange:I,placeholder:L?L+O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):O("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:O("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ne=>{(ne.key==="Tab"&&!ne.shiftKey||ne.key===" ")&&!(Z??"").trim()&&(L??"").trim()&&(ne.preventDefault(),I?.(L??""))}})})]})]}),!G&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!T&&_&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:O("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:_}),!T&&v&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:ue,onClick:v}),!T&&n.jsx(be,{htmlType:"button",size:40,type:"bar",label:O("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Jt})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[U&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:O("common.cancel","\uCDE8\uC18C"),onClick:U}),!T&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:O("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:kn}),E&&n.jsx(be,{htmlType:"button",size:"56",type:"bar",label:E,onClick:()=>de?Ct():Oe(!0),disabled:ge,onDisabledClick:()=>{ye(O("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(be,{htmlType:"button",size:"56",type:"bar",variant:"main",label:x??O("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>Oe(!1),disabled:S,onDisabledClick:J})]})]}),n.jsx(ya,{message:Ce,type:Pe,onClose:Ye})]})}const Ew=8;function xd({items:e,className:t}){const{t:a}=xe.useTranslation(),r=e.length,s=r<=3?1:2,l=Ew,i=r>l,u=e.slice(0,i?l-1:l),c=r-u.length,d=Math.ceil(Math.min(r,l)/s)||1,h=s*d;return n.jsx("div",{className:Ae("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${s}, 1fr)`},children:Array.from({length:h},(p,m)=>{if(i&&m===l-1)return n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--more",children:n.jsx("span",{className:"word-table-thumb__more body-3",children:a("wordTable.thumbMore",{count:c,defaultValue:"+{{count}}"})})},m);const g=u[m];return g?n.jsx("div",{className:"word-table-thumb__cell",children:(g.words?.length?g.words:[{label:g.id}]).map((y,C)=>n.jsxs(o.Fragment,{children:[C>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:y.label})]},C))},m):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},m)})})}function Dw({items:e,name:t,description:a,createdAt:r,code:s,published:l,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:h,publishedAt:p,likeCount:m,downloadCount:g,onPublisherClick:y,selected:C,onClick:f,onMore:_,titleNode:b,className:w}){const{t:v}=xe.useTranslation(),A=b!=null,x=h!=null||p!=null||m!=null||g!=null,E=B=>{B.target===B.currentTarget&&!A&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),f?.())};return n.jsxs("div",{className:Ae("word-table-button",C?"word-table-button--selected":"",x?"":"word-table-button--no-footer",w),role:"button",tabIndex:0,"aria-label":s?`${t} (${s})`:t,onClick:A?void 0:f,onKeyDown:E,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":v("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(xd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[b??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!A&&n.jsx(be,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:v("common.moreFor",{name:t}),onClick:B=>{B.stopPropagation(),_(B)}})]}),(s||r||l||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?Gl(r,v):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(l||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[l&&n.jsx(on,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??v("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(on,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??v("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),s&&n.jsx("span",{className:"word-table-button__code caption-1",children:s})]})]}),x&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[h&&(y?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":v("wordTable.publisherFilter",{name:h,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:B=>{B.stopPropagation(),y()},children:h}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:h})),p&&n.jsx("span",{className:"training-card__date body-4",children:Gl(p,v)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[m!=null&&n.jsx(on,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(m),"aria-label":v("common.likeCount",{count:m,defaultValue:`\uC88B\uC544\uC694 ${m}`})}),g!=null&&n.jsx(on,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(g),"aria-label":v("common.downloadCount",{count:g,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${g}`})})]})]})]})}/**
1041
1042
  * @license lucide-react v1.38.0 - ISC
1042
1043
  *
1043
1044
  * This source code is licensed under the ISC license.
1044
1045
  * See the LICENSE file in the root directory of this source tree.
1045
- */const Dw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Sw=oe("image",Dw);/**
1046
+ */const Sw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],jw=oe("image",Sw);/**
1046
1047
  * @license lucide-react v1.38.0 - ISC
1047
1048
  *
1048
1049
  * This source code is licensed under the ISC license.
1049
1050
  * See the LICENSE file in the root directory of this source tree.
1050
- */const jw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tw=oe("circle-x",jw);function Mw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function $s({icon:e,label:t,state:a,pct:r,subText:s}){const{t:l}=xe.useTranslation(),i=a==="done",u=a==="pending",c=a==="error",d=i?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${i?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:i?n.jsx(Ys,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(Tw,{size:22,color:"white",strokeWidth:2.5}):n.jsx("span",{className:`wdup-phase-card__icon-inner${u?" wdup-phase-card__icon-inner--pending":""}`,children:e})}),n.jsxs("div",{className:"wdup-phase-card__body",children:[n.jsxs("div",{className:"wdup-phase-card__top",children:[n.jsx("span",{className:`wdup-phase-card__label body-2${u?" wdup-phase-card__label--pending":""}`,children:t}),i?n.jsx(on,{variant:"sub",fill:"soft",size:"small",label:l("common.done","\uC644\uB8CC")}):c?n.jsx(on,{variant:"danger",fill:"soft",size:"small",label:l("common.failed","\uC2E4\uD328")}):(s||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[s,s&&r!==void 0?` \xB7 ${r}%`:r!==void 0?`${r}%`:""]})]}),!u&&n.jsx("div",{className:"wdup-bar",children:n.jsx("div",{className:`wdup-bar__fill${i?" wdup-bar__fill--done":c?" wdup-bar__fill--error":""}${a==="active"&&r===void 0?" wdup-bar__fill--indeterminate":""}`,style:{width:r!==void 0||i||c?`${c?100:d}%`:void 0}})})]})]})}function Lw({title:e,progress:t,onDone:a,onRetry:r,onClose:s,inline:l}){const{t:i}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:h,imageDone:p,imageTotal:m,pairPercent:g}=t,y=Mw(u),C=u==="done",f=!!c;function _(E){return f&&y===E?"error":y>E?"done":y===E?"active":"pending"}const b=_(1),w=_(2),v=_(3),A=u==="image-match"&&m?Math.round((p??0)/m*100):void 0,x=o.useMemo(()=>{if(w!=="done"){if(u==="image-list")return i("wordData.checkingPage",{page:h??1});if(u==="image-match"&&m)return i("wordData.imageCount",{done:ho(p),total:ho(m)})}},[w,u,h,m,p,i]);return n.jsx(Rn,{inline:l,className:"popup--word-data-update",title:e,footer:f&&r?n.jsx(be,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):f?n.jsx(be,{htmlType:"button",size:56,variant:"main",onClick:s??a,children:i("common.close","\uB2EB\uAE30")}):n.jsx(be,{htmlType:"button",size:56,variant:"main",disabled:!C,onClick:a,children:i("common.done","\uC644\uB8CC")}),children:n.jsxs("div",{className:"wdup-cards",children:[n.jsx($s,{icon:n.jsx(Vs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:b,subText:b==="active"?i("wordData.downloadingCount",{n:ho(d),count:d}):void 0}),n.jsx($s,{icon:n.jsx(Sw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:w,pct:A,subText:x}),n.jsx($s,{icon:n.jsx(Gs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:v,pct:v==="active"?g??0:void 0,subText:void 0})]})})}function $w({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,s]=o.useState(null),[l,i]=o.useState(null),u=g=>{let y=null;g==="noise"?y={score:3,contextsLength:5,results:[{sentence:"\uBB38\uC7A5 A",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 B",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 C",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 D",judgement:null,wording:"\uC548 \uD568",useAnswer:!1},{sentence:"\uBB38\uC7A5 E",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1}]}:g==="short"?y={score:2,contextsLength:3,results:[{sentence:"\uBE44\uBE54\uBC25 \uC124\uBA85",answer:"\uBE44\uBE54\uBC25",selected:"\uBE44\uBE54\uBC25",selectedText:"\uBE44\uBE54\uBC25",correct:!0},{sentence:"\uBCF4\uC308 \uC124\uBA85",answer:"\uBCF4\uC308",selected:"\uC871\uBC1C",selectedText:"\uC871\uBC1C",correct:!1},{sentence:"\uCE7C\uAD6D\uC218 \uC124\uBA85",answer:"\uCE7C\uAD6D\uC218",selected:void 0,selectedText:void 0,correct:void 0}]}:g==="long"?y={score:4,contextsLength:4,results:[{sentence:"\uAE34 \uC774\uC57C\uAE30 1",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",correct:!0},{sentence:"\uAE34 \uC774\uC57C\uAE30 2",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 2",selectedText:"\uC120\uD0DD \uD14D\uC2A4\uD2B8 2",correct:!1},{sentence:"\uAE34 \uC774\uC57C\uAE30 3",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 3",selectedText:void 0,correct:void 0},{sentence:"\uAE34 \uC774\uC57C\uAE30 4",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",correct:!0}]}:g==="order"&&(y={score:1,contextsLength:2,results:[{sentence:"\uC21C\uC11C \uBB38\uC81C 1",answer:"1,2,3",selectedText:"1,2,3",correct:!0},{sentence:"\uC21C\uC11C \uBB38\uC81C 2",answer:"A,B,C",selectedText:"B,A,C",correct:!1}]}),i(y),s(g)},c=o.useCallback(()=>{s(null),i(null)},[]),d=o.useCallback(()=>u("noise"),[]),h=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),m=o.useCallback(()=>u("order"),[]);return e?n.jsxs("div",{className:"debug-result-launcher",children:[n.jsxs("div",{className:"debug-buttons",children:[n.jsx("button",{type:"button",className:"debug-button",onClick:d,children:a("debug.showResult",{type:"Noise",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:h,children:a("debug.showResult",{type:"ShortStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:p,children:a("debug.showResult",{type:"LongStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:m,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&l?t?.({score:l.score,contextsLength:l.contextsLength,results:l.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=t2,exports.ActionCard=hy,exports.Alert=V2,exports.AppHeader=l2,exports.AudioMeter=Zo,exports.AudioPlayer=_s,exports.Avatar=X2,exports.Badge=on,exports.BarChart=Yv,exports.BarChartControls=Ou,exports.Board=Cv,exports.BottomNav=Zi,exports.BrandIdentity=tu,exports.BrandLogo=Wv,exports.Breadcrumb=ev,exports.BulkBar=Fv,exports.Button=be,exports.CONSENT_KINDS=Lu,exports.CORE_VERSION=ay,exports.Calendar=y4,exports.CardStep=dd,exports.ChartLegend=Wo,exports.ChartSection=Ho,exports.ChartTotal=er,exports.Checkbox=Io,exports.ChoiceChips=A_,exports.CircleBadge=En,exports.CodeBox=Pv,exports.ColorPicker=ov,exports.CompanyMeta=_v,exports.ConfirmPopup=gd,exports.ConfirmStep=id,exports.ConfirmWithTextStep=ud,exports.ConsentRecordPopup=Tv,exports.ContrastFilterPanel=tw,exports.CoreScope=my,exports.CountTile=dv,exports.CouponInputPopup=rw,exports.DEFAULT_NOISE_SETTINGS=na,exports.DatePicker=Mu,exports.DebugResultLauncher=$w,exports.DescriptionTooltip=Xn,exports.DeviceSideTable=f4,exports.Dialog=mv,exports.Divider=z2,exports.Dropdown=_n,exports.EffectPartyPopper=Ts,exports.EffectPartyPopperHost=lw,exports.EmptyState=dy,exports.ErrorState=py,exports.FILTER_ALL_VALUE=Bn,exports.FileUpload=Q2,exports.FilterPanel=Fn,exports.FilterSectionInfo=Ua,exports.Footer=N_,exports.GameIntro=Jv,exports.Header=nu,exports.Icon=at,exports.IconGridMenu=k_,exports.IconRenderer=at,exports.InfoTooltip=Tn,exports.ItemActions=Ov,exports.LEVEL_MAX=wa,exports.LINE_CHART_HOVER_DELAY_MS=zu,exports.LandingBottomSticky=D_,exports.LandingHeader=E_,exports.LineChart=Xv,exports.ListPopup=nw,exports.ListenStep=ld,exports.Loader=pa,exports.MARKS=Br,exports.MARK_ICON=rc,exports.MARK_VARIANT=oc,exports.MediaQueryOverrideContext=oi,exports.MenuTooltip=Ha,exports.NOISE_RATIO_MAX=nr,exports.NOISE_RATIO_STEP=Lc,exports.NoisePlayerContext=bs,exports.NoiseSettingsTooltip=Qc,exports.NoticeBox=fy,exports.NotifyTextPreview=zv,exports.OrderListStep=cd,exports.PASS_CARD_BG_VARS=Qn,exports.POS_LABEL=ic,exports.PROMO_BANNER_BG_COMPONENTS=Fi,exports.PROMO_BANNER_BG_OPTIONS=Ay,exports.PROMO_BANNER_BG_VARS=Ia,exports.Page=Tr,exports.PageTitle=iw,exports.Pagination=Oo,exports.Panel=Ja,exports.PanelGrid=Av,exports.PanelRow=sn,exports.PanelRowDevice=kv,exports.PassCard=pu,exports.PassCardBg=P2,exports.PassCardBgIHAB=F2,exports.PassCardBgLeftColorGrid=I2,exports.PassCardBgTwoCircle=lu,exports.PaymentPlan=R2,exports.PersonCard=fv,exports.PhonemeFilterPanel=ew,exports.PhonemeSelectBlock=Jx,exports.Popup=Rn,exports.ProgressBar=o4,exports.ProgressIndicator=Zu,exports.PromoBanner=Jy,exports.PromoBannerBgDark=wi,exports.PromoBannerBgDeep=bi,exports.PromoBannerBgDiagonal=Ni,exports.PromoBannerBgDots=Di,exports.PromoBannerBgInstagram=Pi,exports.PromoBannerBgMain=di,exports.PromoBannerBgNaver=$i,exports.PromoBannerBgOutline=ji,exports.PromoBannerBgRadial=ki,exports.PromoBannerBgSoft=hi,exports.PromoBannerBgSoftSub=yi,exports.PromoBannerBgSub=Ci,exports.PromoBannerBgSuccess=Mi,exports.PromoBannerBgWarm=_i,exports.PublicationCard=gv,exports.Radio=fu,exports.RadioGroup=W2,exports.Rating=nv,exports.ReportDocument=mw,exports.ReportInfoPanel=Cw,exports.RingChart=e4,exports.SENTENCE_TRAINING_TYPES=hs,exports.SearchSummary=G2,exports.Section=va,exports.SectionHeadFloat=Ru,exports.SectionHeader=vv,exports.SegmentedControl=vn,exports.ShortcutBadge=Cu,exports.SideNav=eu,exports.Slider=Uu,exports.SoundCompass=O2,exports.SplashLogo=yv,exports.StatChart=t4,exports.SummaryStrip=pw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=gu,exports.Table=Jo,exports.TableFilterPanel=is,exports.Tabs=K2,exports.TextBoxTooltip=Sr,exports.TextField=qn,exports.Timeline=bv,exports.Toast=ya,exports.Toggle=wu,exports.Toolbar=zo,exports.Tooltip=wn,exports.TooltipInfo=Tn,exports.TooltipTextBox=Sr,exports.TopBanner=Qy,exports.TrainingBlock=_4,exports.TrainingBlockButton=$o,exports.TrainingBlockGrid=w4,exports.TrainingCard=vw,exports.TrainingCardGroup=_w,exports.TrainingPagePopup=Un,exports.TrainingPagePopupBottom=ed,exports.TrainingPagePopupTitle=td,exports.TrainingResultPopup=Cd,exports.TrainingStep=aa,exports.TrainingStepAudioPlayer=_s,exports.TrainingStepBullet=Gc,exports.TrainingStepCard=Xc,exports.TrainingStepConfirm=ws,exports.TrainingStepConfirmWithText=Bs,exports.TrainingStepListen=ks,exports.TrainingStepOrderList=As,exports.TrainingStepTextBox=Zc,exports.TrainingStepTitle=Yc,exports.TrainingTooltip=yu,exports.TrainingWordCard=ts,exports.UpdateAlert=yw,exports.WAVE_A_MAX=H_,exports.WAVE_H1_PX=ys,exports.WAVE_HMAX_PX=W_,exports.WORD_LABEL_I18N_KEYS=M4,exports.WORD_TABLE_PAPER=ea,exports.WORD_TYPE_LABEL=uc,exports.WordDataProvider=dw,exports.WordDataUpdatePopup=Lw,exports.WordImageTooltip=bd,exports.WordSearchFilterPanel=Qx,exports.WordSearchResultBlock=Zx,exports.WordTable=_a,exports.WordTableBlock=Aw,exports.WordTableButton=Ew,exports.WordTablePopup=X4,exports.WordTableThumbnail=xd,exports.buildMonthChartData=Vv,exports.cellKey=o_,exports.cellLabel=r_,exports.cellsForLabels=b_,exports.clearPassCardBgTheme=$n,exports.clearPromoBannerBgTheme=Xt,exports.closeTrainingPopup=vx,exports.companyTypeLabel=uw,exports.createTrainingScenario=wx,exports.cx=Ae,exports.deriveNoiseContexts=Dx,exports.derivePassCard=ru,exports.draftValues=w_,exports.effectiveNoiseVolume=Cs,exports.effectiveSpeechVolume=Rc,exports.expandSlashLabel=os,exports.formatDuration=g_,exports.getControlDateRange=Qv,exports.getPayloadTimestamp=Es,exports.getPromoBannerBgTheme=wo,exports.getSelectedFromPayload=kx,exports.getSelectedText=Ax,exports.getStepPayload=od,exports.getSteppedPayload=Nx,exports.injectPassCardBgTheme=Ln,exports.injectPromoBannerBgTheme=Zt,exports.isSelectionCorrect=Ex,exports.labelOfCellKey=Tc,exports.labelsForSave=a_,exports.levelToPct=j_,exports.markAfterClick=ac,exports.marksForSave=ns,exports.mergeNoiseSettings=ta,exports.missesByType=h_,exports.monthKeyOf=tr,exports.monthKeyOfDate=Vo,exports.nextFocus=u_,exports.nextMisses=p_,exports.noiseElementVolume=fs,exports.noiseRatioOf=ar,exports.pageStartIndexes=sc,exports.parseMonthKey=ga,exports.passCardBgIhabTheme=hu,exports.passCardBgLeftColorGridTheme=mu,exports.passCardBgTwoCircleTheme=su,exports.pctToLevel=T_,exports.posLabels=cc,exports.printWordTable=E4,exports.promoBannerBgDarkTheme=xi,exports.promoBannerBgDeepTheme=fi,exports.promoBannerBgDiagonalTheme=Ai,exports.promoBannerBgDotsTheme=Ei,exports.promoBannerBgInstagramTheme=Ri,exports.promoBannerBgMainTheme=ci,exports.promoBannerBgNaverTheme=Li,exports.promoBannerBgOutlineTheme=Si,exports.promoBannerBgRadialTheme=Bi,exports.promoBannerBgSoftSubTheme=gi,exports.promoBannerBgSoftTheme=pi,exports.promoBannerBgSubTheme=mi,exports.promoBannerBgSuccessTheme=Ti,exports.promoBannerBgWarmTheme=vi,exports.recommendTables=C_,exports.regenerateUnpinned=x_,exports.removeItem=__,exports.resolveTrainingItems=xx,exports.resolveTrainingPopupMeta=ad,exports.reviewCells=Q4,exports.reviewMeta=n_,exports.reviewSetPlan=m_,exports.reviewTableName=t_,exports.scoreKey=wr,exports.scoreSheetHeader=s_,exports.shouldConfirmDiscard=N4,exports.splitTrainingVariants=_x,exports.summarize=A4,exports.summarizeMisses=d_,exports.tableTrends=i_,exports.toDraft=y_,exports.toTrainingText=Bx,exports.togglePin=v_,exports.uncoveredLabels=f_,exports.useAnchoredMenu=Wa,exports.useBarChartControl=Iu,exports.useCalendarMonth=ju,exports.useComboboxSuggestions=Eu,exports.useDiscardGuard=aw,exports.useFitScale=mc,exports.useNoisePlayer=Ar,exports.useSoundCompassExam=Vy,exports.useToastLifecycle=Ku,exports.useWordData=cw,exports.useWordTableDisplaySettings=Sc,exports.useWordTablePrint=ps,exports.waveBarPx=Er,exports.waveBarVal=Dr,exports.weakItems=l_,exports.weekValueOf=qo,exports.withStepTimes=rd,exports.wordTypeLabels=dc;
1051
+ */const Tw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Mw=oe("circle-x",Tw);function Lw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function $s({icon:e,label:t,state:a,pct:r,subText:s}){const{t:l}=xe.useTranslation(),i=a==="done",u=a==="pending",c=a==="error",d=i?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${i?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:i?n.jsx(Ys,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(Mw,{size:22,color:"white",strokeWidth:2.5}):n.jsx("span",{className:`wdup-phase-card__icon-inner${u?" wdup-phase-card__icon-inner--pending":""}`,children:e})}),n.jsxs("div",{className:"wdup-phase-card__body",children:[n.jsxs("div",{className:"wdup-phase-card__top",children:[n.jsx("span",{className:`wdup-phase-card__label body-2${u?" wdup-phase-card__label--pending":""}`,children:t}),i?n.jsx(on,{variant:"sub",fill:"soft",size:"small",label:l("common.done","\uC644\uB8CC")}):c?n.jsx(on,{variant:"danger",fill:"soft",size:"small",label:l("common.failed","\uC2E4\uD328")}):(s||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[s,s&&r!==void 0?` \xB7 ${r}%`:r!==void 0?`${r}%`:""]})]}),!u&&n.jsx("div",{className:"wdup-bar",children:n.jsx("div",{className:`wdup-bar__fill${i?" wdup-bar__fill--done":c?" wdup-bar__fill--error":""}${a==="active"&&r===void 0?" wdup-bar__fill--indeterminate":""}`,style:{width:r!==void 0||i||c?`${c?100:d}%`:void 0}})})]})]})}function $w({title:e,progress:t,onDone:a,onRetry:r,onClose:s,inline:l}){const{t:i}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:h,imageDone:p,imageTotal:m,pairPercent:g}=t,y=Lw(u),C=u==="done",f=!!c;function _(E){return f&&y===E?"error":y>E?"done":y===E?"active":"pending"}const b=_(1),w=_(2),v=_(3),A=u==="image-match"&&m?Math.round((p??0)/m*100):void 0,x=o.useMemo(()=>{if(w!=="done"){if(u==="image-list")return i("wordData.checkingPage",{page:h??1});if(u==="image-match"&&m)return i("wordData.imageCount",{done:ho(p),total:ho(m)})}},[w,u,h,m,p,i]);return n.jsx(Rn,{inline:l,className:"popup--word-data-update",title:e,footer:f&&r?n.jsx(be,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):f?n.jsx(be,{htmlType:"button",size:56,variant:"main",onClick:s??a,children:i("common.close","\uB2EB\uAE30")}):n.jsx(be,{htmlType:"button",size:56,variant:"main",disabled:!C,onClick:a,children:i("common.done","\uC644\uB8CC")}),children:n.jsxs("div",{className:"wdup-cards",children:[n.jsx($s,{icon:n.jsx(Vs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:b,subText:b==="active"?i("wordData.downloadingCount",{n:ho(d),count:d}):void 0}),n.jsx($s,{icon:n.jsx(jw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:w,pct:A,subText:x}),n.jsx($s,{icon:n.jsx(Gs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:v,pct:v==="active"?g??0:void 0,subText:void 0})]})})}function Rw({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,s]=o.useState(null),[l,i]=o.useState(null),u=g=>{let y=null;g==="noise"?y={score:3,contextsLength:5,results:[{sentence:"\uBB38\uC7A5 A",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 B",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 C",judgement:!0,wording:"\uC798 \uB4E4\uB9BC",useAnswer:!1},{sentence:"\uBB38\uC7A5 D",judgement:null,wording:"\uC548 \uD568",useAnswer:!1},{sentence:"\uBB38\uC7A5 E",judgement:!1,wording:"\uC548 \uB4E4\uB9BC",useAnswer:!1}]}:g==="short"?y={score:2,contextsLength:3,results:[{sentence:"\uBE44\uBE54\uBC25 \uC124\uBA85",answer:"\uBE44\uBE54\uBC25",selected:"\uBE44\uBE54\uBC25",selectedText:"\uBE44\uBE54\uBC25",correct:!0},{sentence:"\uBCF4\uC308 \uC124\uBA85",answer:"\uBCF4\uC308",selected:"\uC871\uBC1C",selectedText:"\uC871\uBC1C",correct:!1},{sentence:"\uCE7C\uAD6D\uC218 \uC124\uBA85",answer:"\uCE7C\uAD6D\uC218",selected:void 0,selectedText:void 0,correct:void 0}]}:g==="long"?y={score:4,contextsLength:4,results:[{sentence:"\uAE34 \uC774\uC57C\uAE30 1",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 1",correct:!0},{sentence:"\uAE34 \uC774\uC57C\uAE30 2",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 2",selectedText:"\uC120\uD0DD \uD14D\uC2A4\uD2B8 2",correct:!1},{sentence:"\uAE34 \uC774\uC57C\uAE30 3",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 3",selectedText:void 0,correct:void 0},{sentence:"\uAE34 \uC774\uC57C\uAE30 4",answer:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",selectedText:"\uC815\uB2F5 \uD14D\uC2A4\uD2B8 4",correct:!0}]}:g==="order"&&(y={score:1,contextsLength:2,results:[{sentence:"\uC21C\uC11C \uBB38\uC81C 1",answer:"1,2,3",selectedText:"1,2,3",correct:!0},{sentence:"\uC21C\uC11C \uBB38\uC81C 2",answer:"A,B,C",selectedText:"B,A,C",correct:!1}]}),i(y),s(g)},c=o.useCallback(()=>{s(null),i(null)},[]),d=o.useCallback(()=>u("noise"),[]),h=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),m=o.useCallback(()=>u("order"),[]);return e?n.jsxs("div",{className:"debug-result-launcher",children:[n.jsxs("div",{className:"debug-buttons",children:[n.jsx("button",{type:"button",className:"debug-button",onClick:d,children:a("debug.showResult",{type:"Noise",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:h,children:a("debug.showResult",{type:"ShortStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:p,children:a("debug.showResult",{type:"LongStory",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})}),n.jsx("button",{type:"button",className:"debug-button",onClick:m,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&l?t?.({score:l.score,contextsLength:l.contextsLength,results:l.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=t2,exports.ActionCard=hy,exports.Alert=V2,exports.AppHeader=l2,exports.AudioMeter=Zo,exports.AudioPlayer=_s,exports.Avatar=X2,exports.Badge=on,exports.BarChart=Yv,exports.BarChartControls=Ou,exports.Board=Cv,exports.BottomNav=Zi,exports.BrandIdentity=tu,exports.BrandLogo=Wv,exports.Breadcrumb=ev,exports.BulkBar=Fv,exports.Button=be,exports.CONSENT_KINDS=Lu,exports.CORE_VERSION=ay,exports.Calendar=y4,exports.CardStep=dd,exports.ChartLegend=Wo,exports.ChartSection=Ho,exports.ChartTotal=er,exports.Checkbox=Io,exports.ChoiceChips=N_,exports.CircleBadge=En,exports.CodeBox=Pv,exports.ColorPicker=ov,exports.CompanyMeta=_v,exports.ConfirmPopup=gd,exports.ConfirmStep=id,exports.ConfirmWithTextStep=ud,exports.ConsentRecordPopup=Tv,exports.ContrastFilterPanel=nw,exports.CoreScope=my,exports.CountTile=dv,exports.CouponInputPopup=ow,exports.DEFAULT_NOISE_SETTINGS=na,exports.DatePicker=Mu,exports.DebugResultLauncher=Rw,exports.DescriptionTooltip=Xn,exports.DeviceSideTable=f4,exports.Dialog=mv,exports.Divider=z2,exports.Dropdown=_n,exports.EffectPartyPopper=Ts,exports.EffectPartyPopperHost=iw,exports.EmptyState=dy,exports.ErrorState=py,exports.FILTER_ALL_VALUE=Bn,exports.FileUpload=Q2,exports.FilterPanel=Fn,exports.FilterSectionInfo=Ua,exports.Footer=E_,exports.GameIntro=Jv,exports.Header=nu,exports.Icon=at,exports.IconGridMenu=A_,exports.IconRenderer=at,exports.InfoTooltip=Tn,exports.ItemActions=Ov,exports.LEVEL_MAX=wa,exports.LINE_CHART_HOVER_DELAY_MS=zu,exports.LandingBottomSticky=S_,exports.LandingHeader=D_,exports.LineChart=Xv,exports.ListPopup=aw,exports.ListenStep=ld,exports.Loader=pa,exports.MARKS=Br,exports.MARK_ICON=rc,exports.MARK_VARIANT=oc,exports.MediaQueryOverrideContext=oi,exports.MenuTooltip=Ha,exports.NOISE_RATIO_MAX=nr,exports.NOISE_RATIO_STEP=Lc,exports.NoisePlayerContext=bs,exports.NoiseSettingsTooltip=Qc,exports.NoticeBox=fy,exports.NotifyTextPreview=zv,exports.OrderListStep=cd,exports.PASS_CARD_BG_VARS=Qn,exports.POS_LABEL=ic,exports.PROMO_BANNER_BG_COMPONENTS=Fi,exports.PROMO_BANNER_BG_OPTIONS=Ay,exports.PROMO_BANNER_BG_VARS=Ia,exports.Page=Tr,exports.PageTitle=uw,exports.Pagination=Oo,exports.Panel=Ja,exports.PanelGrid=Av,exports.PanelRow=sn,exports.PanelRowDevice=kv,exports.PassCard=pu,exports.PassCardBg=P2,exports.PassCardBgIHAB=F2,exports.PassCardBgLeftColorGrid=I2,exports.PassCardBgTwoCircle=lu,exports.PaymentPlan=R2,exports.PersonCard=fv,exports.PhonemeFilterPanel=tw,exports.PhonemeSelectBlock=Qx,exports.Popup=Rn,exports.ProgressBar=o4,exports.ProgressIndicator=Zu,exports.PromoBanner=Jy,exports.PromoBannerBgDark=wi,exports.PromoBannerBgDeep=bi,exports.PromoBannerBgDiagonal=Ni,exports.PromoBannerBgDots=Di,exports.PromoBannerBgInstagram=Pi,exports.PromoBannerBgMain=di,exports.PromoBannerBgNaver=$i,exports.PromoBannerBgOutline=ji,exports.PromoBannerBgRadial=ki,exports.PromoBannerBgSoft=hi,exports.PromoBannerBgSoftSub=yi,exports.PromoBannerBgSub=Ci,exports.PromoBannerBgSuccess=Mi,exports.PromoBannerBgWarm=_i,exports.PublicationCard=gv,exports.Radio=fu,exports.RadioGroup=W2,exports.Rating=nv,exports.ReportDocument=Cw,exports.ReportInfoPanel=fw,exports.RingChart=e4,exports.SENTENCE_TRAINING_TYPES=hs,exports.SearchSummary=G2,exports.Section=va,exports.SectionHeadFloat=Ru,exports.SectionHeader=vv,exports.SegmentedControl=vn,exports.ShortcutBadge=Cu,exports.SideNav=eu,exports.Slider=Uu,exports.SoundCompass=O2,exports.SplashLogo=yv,exports.StatChart=t4,exports.SummaryStrip=hw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=gu,exports.Table=Jo,exports.TableFilterPanel=is,exports.Tabs=K2,exports.TextBoxTooltip=Sr,exports.TextField=qn,exports.Timeline=bv,exports.Toast=ya,exports.Toggle=wu,exports.Toolbar=zo,exports.Tooltip=wn,exports.TooltipInfo=Tn,exports.TooltipTextBox=Sr,exports.TopBanner=Qy,exports.TrainingBlock=_4,exports.TrainingBlockButton=$o,exports.TrainingBlockGrid=w4,exports.TrainingCard=_w,exports.TrainingCardGroup=xw,exports.TrainingPagePopup=Un,exports.TrainingPagePopupBottom=ed,exports.TrainingPagePopupTitle=td,exports.TrainingResultPopup=Cd,exports.TrainingStep=aa,exports.TrainingStepAudioPlayer=_s,exports.TrainingStepBullet=Gc,exports.TrainingStepCard=Xc,exports.TrainingStepConfirm=ws,exports.TrainingStepConfirmWithText=Bs,exports.TrainingStepListen=ks,exports.TrainingStepOrderList=As,exports.TrainingStepTextBox=Zc,exports.TrainingStepTitle=Yc,exports.TrainingTooltip=yu,exports.TrainingWordCard=ts,exports.UpdateAlert=vw,exports.WAVE_A_MAX=V_,exports.WAVE_H1_PX=ys,exports.WAVE_HMAX_PX=H_,exports.WORD_LABEL_I18N_KEYS=M4,exports.WORD_TABLE_PAPER=ea,exports.WORD_TYPE_LABEL=uc,exports.WordDataProvider=pw,exports.WordDataUpdatePopup=$w,exports.WordImageTooltip=bd,exports.WordSearchFilterPanel=ew,exports.WordSearchResultBlock=Xx,exports.WordTable=_a,exports.WordTableBlock=Nw,exports.WordTableButton=Dw,exports.WordTablePopup=J4,exports.WordTableThumbnail=xd,exports.buildMonthChartData=Vv,exports.cellKey=s_,exports.cellLabel=o_,exports.cellsForLabels=g_,exports.clearPassCardBgTheme=$n,exports.clearPromoBannerBgTheme=Xt,exports.closeTrainingPopup=_x,exports.companyTypeLabel=cw,exports.createTrainingScenario=Bx,exports.cx=Ae,exports.deriveNoiseContexts=Sx,exports.derivePassCard=ru,exports.draftValues=B_,exports.effectiveNoiseVolume=Cs,exports.effectiveSpeechVolume=Rc,exports.expandSlashLabel=os,exports.formatDuration=y_,exports.getControlDateRange=Qv,exports.getPayloadTimestamp=Es,exports.getPromoBannerBgTheme=wo,exports.getSelectedFromPayload=Ax,exports.getSelectedText=Nx,exports.getStepPayload=od,exports.getSteppedPayload=Ex,exports.injectPassCardBgTheme=Ln,exports.injectPromoBannerBgTheme=Zt,exports.isSelectionCorrect=Dx,exports.labelOfCellKey=Tc,exports.labelsForSave=r_,exports.levelToPct=T_,exports.markAfterClick=ac,exports.marksForSave=ns,exports.mergeNoiseSettings=ta,exports.missesByType=m_,exports.monthKeyOf=tr,exports.monthKeyOfDate=Vo,exports.nextFocus=c_,exports.nextMisses=h_,exports.noiseElementVolume=fs,exports.noiseRatioOf=ar,exports.pageStartIndexes=sc,exports.parseMonthKey=ga,exports.passCardBgIhabTheme=hu,exports.passCardBgLeftColorGridTheme=mu,exports.passCardBgTwoCircleTheme=su,exports.pctToLevel=M_,exports.posLabels=cc,exports.printWordTable=E4,exports.promoBannerBgDarkTheme=xi,exports.promoBannerBgDeepTheme=fi,exports.promoBannerBgDiagonalTheme=Ai,exports.promoBannerBgDotsTheme=Ei,exports.promoBannerBgInstagramTheme=Ri,exports.promoBannerBgMainTheme=ci,exports.promoBannerBgNaverTheme=Li,exports.promoBannerBgOutlineTheme=Si,exports.promoBannerBgRadialTheme=Bi,exports.promoBannerBgSoftSubTheme=gi,exports.promoBannerBgSoftTheme=pi,exports.promoBannerBgSubTheme=mi,exports.promoBannerBgSuccessTheme=Ti,exports.promoBannerBgWarmTheme=vi,exports.recommendTables=f_,exports.regenerateUnpinned=w_,exports.removeItem=x_,exports.resolveTrainingItems=wx,exports.resolveTrainingPopupMeta=ad,exports.reviewCells=e_,exports.reviewMeta=a_,exports.reviewSetPlan=C_,exports.reviewTableName=n_,exports.scoreKey=wr,exports.scoreSheetHeader=l_,exports.shouldConfirmDiscard=N4,exports.splitTrainingVariants=xx,exports.summarize=A4,exports.summarizeMisses=p_,exports.tableTrends=u_,exports.toDraft=v_,exports.toTrainingText=kx,exports.togglePin=__,exports.uncoveredLabels=b_,exports.useAnchoredMenu=Wa,exports.useBarChartControl=Iu,exports.useCalendarMonth=ju,exports.useComboboxSuggestions=Eu,exports.useDiscardGuard=rw,exports.useFitScale=mc,exports.useNoisePlayer=Ar,exports.useSoundCompassExam=Vy,exports.useToastLifecycle=Ku,exports.useWordData=dw,exports.useWordTableDisplaySettings=Sc,exports.useWordTablePrint=ps,exports.waveBarPx=Er,exports.waveBarVal=Dr,exports.weakItems=i_,exports.weekValueOf=qo,exports.withStepTimes=rd,exports.wordTypeLabels=dc;