@ihabdevteam/core 0.393.0 → 0.395.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/dist/components.cjs.js +64 -64
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +48 -48
- package/dist/ihabdevteam-core.d.ts +15 -1
- package/dist/packages/core/src/components/Badge.d.ts +14 -0
- package/dist/packages/core/src/components/Badge.js +10 -2
- package/dist/packages/core/src/components/Popup/Popup.css +19 -3
- package/dist/packages/core/src/components/Popup/Popup.js +1 -1
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +1 -1
- package/package.json +1 -1
package/dist/components.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var n=require("react/jsx-runtime"),o=require("react"),Vt=require("i18next"),_e=require("react-i18next"),dn=require("react-dom"),jn=typeof document<"u"?document.currentScript:null;function wd(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var Rs=wd(o);function Be(...e){return e.filter(Boolean).join(" ")}const Ps=new Set,On=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function
|
|
1
|
+
"use strict";var n=require("react/jsx-runtime"),o=require("react"),Vt=require("i18next"),_e=require("react-i18next"),dn=require("react-dom"),jn=typeof document<"u"?document.currentScript:null;function wd(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var Rs=wd(o);function Be(...e){return e.filter(Boolean).join(" ")}const Ps=new Set,On=(()=>{try{const e=globalThis;return e.process!=null&&e.process.env?.NODE_ENV!=="production"}catch{return!1}})();function xt(e,...t){!On||Ps.has(e)||(Ps.add(e),console.warn(...t))}/**
|
|
2
2
|
* @license lucide-react v1.38.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -528,274 +528,274 @@
|
|
|
528
528
|
*
|
|
529
529
|
* This source code is licensed under the ISC license.
|
|
530
530
|
* See the LICENSE file in the root directory of this source tree.
|
|
531
|
-
*/const
|
|
531
|
+
*/const eC=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],tC=re("share-2",eC);/**
|
|
532
532
|
* @license lucide-react v1.38.0 - ISC
|
|
533
533
|
*
|
|
534
534
|
* This source code is licensed under the ISC license.
|
|
535
535
|
* See the LICENSE file in the root directory of this source tree.
|
|
536
|
-
*/const
|
|
536
|
+
*/const nC=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],aC=re("shield-check",nC);/**
|
|
537
537
|
* @license lucide-react v1.38.0 - ISC
|
|
538
538
|
*
|
|
539
539
|
* This source code is licensed under the ISC license.
|
|
540
540
|
* See the LICENSE file in the root directory of this source tree.
|
|
541
|
-
*/const
|
|
541
|
+
*/const rC=[["path",{d:"m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18",key:"uebgi3"}],["path",{d:"M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25",key:"1j7c9p"}],["circle",{cx:"18",cy:"20",r:"2",key:"t9985n"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],oC=re("shopping-cart",rC);/**
|
|
542
542
|
* @license lucide-react v1.38.0 - ISC
|
|
543
543
|
*
|
|
544
544
|
* This source code is licensed under the ISC license.
|
|
545
545
|
* See the LICENSE file in the root directory of this source tree.
|
|
546
|
-
*/const
|
|
546
|
+
*/const sC=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],lC=re("shuffle",sC);/**
|
|
547
547
|
* @license lucide-react v1.38.0 - ISC
|
|
548
548
|
*
|
|
549
549
|
* This source code is licensed under the ISC license.
|
|
550
550
|
* See the LICENSE file in the root directory of this source tree.
|
|
551
|
-
*/const
|
|
551
|
+
*/const iC=[["path",{d:"M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z",key:"15892j"}],["path",{d:"M3 20V4",key:"1ptbpl"}]],uC=re("skip-back",iC);/**
|
|
552
552
|
* @license lucide-react v1.38.0 - ISC
|
|
553
553
|
*
|
|
554
554
|
* This source code is licensed under the ISC license.
|
|
555
555
|
* See the LICENSE file in the root directory of this source tree.
|
|
556
|
-
*/const
|
|
556
|
+
*/const cC=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],dC=re("skip-forward",cC);/**
|
|
557
557
|
* @license lucide-react v1.38.0 - ISC
|
|
558
558
|
*
|
|
559
559
|
* This source code is licensed under the ISC license.
|
|
560
560
|
* See the LICENSE file in the root directory of this source tree.
|
|
561
|
-
*/const
|
|
561
|
+
*/const pC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],hC=re("square",pC);/**
|
|
562
562
|
* @license lucide-react v1.38.0 - ISC
|
|
563
563
|
*
|
|
564
564
|
* This source code is licensed under the ISC license.
|
|
565
565
|
* See the LICENSE file in the root directory of this source tree.
|
|
566
|
-
*/const
|
|
566
|
+
*/const mC=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],CC=re("star",mC);/**
|
|
567
567
|
* @license lucide-react v1.38.0 - ISC
|
|
568
568
|
*
|
|
569
569
|
* This source code is licensed under the ISC license.
|
|
570
570
|
* See the LICENSE file in the root directory of this source tree.
|
|
571
|
-
*/const
|
|
571
|
+
*/const fC=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],bC=re("store",fC);/**
|
|
572
572
|
* @license lucide-react v1.38.0 - ISC
|
|
573
573
|
*
|
|
574
574
|
* This source code is licensed under the ISC license.
|
|
575
575
|
* See the LICENSE file in the root directory of this source tree.
|
|
576
|
-
*/const
|
|
576
|
+
*/const gC=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]],yC=re("sun-medium",gC);/**
|
|
577
577
|
* @license lucide-react v1.38.0 - ISC
|
|
578
578
|
*
|
|
579
579
|
* This source code is licensed under the ISC license.
|
|
580
580
|
* See the LICENSE file in the root directory of this source tree.
|
|
581
|
-
*/const
|
|
581
|
+
*/const vC=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],_C=re("table",vC);/**
|
|
582
582
|
* @license lucide-react v1.38.0 - ISC
|
|
583
583
|
*
|
|
584
584
|
* This source code is licensed under the ISC license.
|
|
585
585
|
* See the LICENSE file in the root directory of this source tree.
|
|
586
|
-
*/const
|
|
586
|
+
*/const xC=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],wC=re("table-2",xC);/**
|
|
587
587
|
* @license lucide-react v1.38.0 - ISC
|
|
588
588
|
*
|
|
589
589
|
* This source code is licensed under the ISC license.
|
|
590
590
|
* See the LICENSE file in the root directory of this source tree.
|
|
591
|
-
*/const
|
|
591
|
+
*/const BC=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],kC=re("tag",BC);/**
|
|
592
592
|
* @license lucide-react v1.38.0 - ISC
|
|
593
593
|
*
|
|
594
594
|
* This source code is licensed under the ISC license.
|
|
595
595
|
* See the LICENSE file in the root directory of this source tree.
|
|
596
|
-
*/const
|
|
596
|
+
*/const AC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],NC=re("terminal",AC);/**
|
|
597
597
|
* @license lucide-react v1.38.0 - ISC
|
|
598
598
|
*
|
|
599
599
|
* This source code is licensed under the ISC license.
|
|
600
600
|
* See the LICENSE file in the root directory of this source tree.
|
|
601
|
-
*/const
|
|
601
|
+
*/const EC=[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]],DC=re("text-cursor-input",EC);/**
|
|
602
602
|
* @license lucide-react v1.38.0 - ISC
|
|
603
603
|
*
|
|
604
604
|
* This source code is licensed under the ISC license.
|
|
605
605
|
* See the LICENSE file in the root directory of this source tree.
|
|
606
|
-
*/const
|
|
606
|
+
*/const SC=[["path",{d:"M15 5h6",key:"1pr8yx"}],["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M3 19h18",key:"awlh7x"}],["path",{d:"m3 12 3.553-7.724a.5.5 0 0 1 .894 0L11 12",key:"6lvno8"}],["path",{d:"M3.92 10h6.16",key:"1tl8ex"}]],jC=re("text-initial",SC);/**
|
|
607
607
|
* @license lucide-react v1.38.0 - ISC
|
|
608
608
|
*
|
|
609
609
|
* This source code is licensed under the ISC license.
|
|
610
610
|
* See the LICENSE file in the root directory of this source tree.
|
|
611
|
-
*/const
|
|
611
|
+
*/const TC=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]],MC=re("ticket",TC);/**
|
|
612
612
|
* @license lucide-react v1.38.0 - ISC
|
|
613
613
|
*
|
|
614
614
|
* This source code is licensed under the ISC license.
|
|
615
615
|
* See the LICENSE file in the root directory of this source tree.
|
|
616
|
-
*/const
|
|
616
|
+
*/const LC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],$C=re("trash-2",LC);/**
|
|
617
617
|
* @license lucide-react v1.38.0 - ISC
|
|
618
618
|
*
|
|
619
619
|
* This source code is licensed under the ISC license.
|
|
620
620
|
* See the LICENSE file in the root directory of this source tree.
|
|
621
|
-
*/const
|
|
621
|
+
*/const RC=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],PC=re("trash",RC);/**
|
|
622
622
|
* @license lucide-react v1.38.0 - ISC
|
|
623
623
|
*
|
|
624
624
|
* This source code is licensed under the ISC license.
|
|
625
625
|
* See the LICENSE file in the root directory of this source tree.
|
|
626
|
-
*/const
|
|
626
|
+
*/const IC=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],FC=re("trending-up",IC);/**
|
|
627
627
|
* @license lucide-react v1.38.0 - ISC
|
|
628
628
|
*
|
|
629
629
|
* This source code is licensed under the ISC license.
|
|
630
630
|
* See the LICENSE file in the root directory of this source tree.
|
|
631
|
-
*/const
|
|
631
|
+
*/const OC=[["path",{d:"M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2",key:"pwuv1l"}],["path",{d:"M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2",key:"1y54w1"}],["path",{d:"M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3",key:"e30mpu"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3",key:"i0yafy"}]],zC=re("trophy",OC);/**
|
|
632
632
|
* @license lucide-react v1.38.0 - ISC
|
|
633
633
|
*
|
|
634
634
|
* This source code is licensed under the ISC license.
|
|
635
635
|
* See the LICENSE file in the root directory of this source tree.
|
|
636
|
-
*/const
|
|
636
|
+
*/const WC=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],HC=re("unlink",WC);/**
|
|
637
637
|
* @license lucide-react v1.38.0 - ISC
|
|
638
638
|
*
|
|
639
639
|
* This source code is licensed under the ISC license.
|
|
640
640
|
* See the LICENSE file in the root directory of this source tree.
|
|
641
|
-
*/const
|
|
641
|
+
*/const VC=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],qC=re("upload",VC);/**
|
|
642
642
|
* @license lucide-react v1.38.0 - ISC
|
|
643
643
|
*
|
|
644
644
|
* This source code is licensed under the ISC license.
|
|
645
645
|
* See the LICENSE file in the root directory of this source tree.
|
|
646
|
-
*/const
|
|
646
|
+
*/const UC=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zr=re("user",UC);/**
|
|
647
647
|
* @license lucide-react v1.38.0 - ISC
|
|
648
648
|
*
|
|
649
649
|
* This source code is licensed under the ISC license.
|
|
650
650
|
* See the LICENSE file in the root directory of this source tree.
|
|
651
|
-
*/const
|
|
651
|
+
*/const GC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],KC=re("user-plus",GC);/**
|
|
652
652
|
* @license lucide-react v1.38.0 - ISC
|
|
653
653
|
*
|
|
654
654
|
* This source code is licensed under the ISC license.
|
|
655
655
|
* See the LICENSE file in the root directory of this source tree.
|
|
656
|
-
*/const
|
|
656
|
+
*/const YC=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],ZC=re("user-round",YC);/**
|
|
657
657
|
* @license lucide-react v1.38.0 - ISC
|
|
658
658
|
*
|
|
659
659
|
* This source code is licensed under the ISC license.
|
|
660
660
|
* See the LICENSE file in the root directory of this source tree.
|
|
661
|
-
*/const
|
|
661
|
+
*/const XC=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],JC=re("user-round-check",XC);/**
|
|
662
662
|
* @license lucide-react v1.38.0 - ISC
|
|
663
663
|
*
|
|
664
664
|
* This source code is licensed under the ISC license.
|
|
665
665
|
* See the LICENSE file in the root directory of this source tree.
|
|
666
|
-
*/const
|
|
666
|
+
*/const QC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],e0=re("users",QC);/**
|
|
667
667
|
* @license lucide-react v1.38.0 - ISC
|
|
668
668
|
*
|
|
669
669
|
* This source code is licensed under the ISC license.
|
|
670
670
|
* See the LICENSE file in the root directory of this source tree.
|
|
671
|
-
*/const
|
|
671
|
+
*/const t0=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],n0=re("users-round",t0);/**
|
|
672
672
|
* @license lucide-react v1.38.0 - ISC
|
|
673
673
|
*
|
|
674
674
|
* This source code is licensed under the ISC license.
|
|
675
675
|
* See the LICENSE file in the root directory of this source tree.
|
|
676
|
-
*/const
|
|
676
|
+
*/const a0=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Zs=re("volume-2",a0);/**
|
|
677
677
|
* @license lucide-react v1.38.0 - ISC
|
|
678
678
|
*
|
|
679
679
|
* This source code is licensed under the ISC license.
|
|
680
680
|
* See the LICENSE file in the root directory of this source tree.
|
|
681
|
-
*/const
|
|
681
|
+
*/const r0=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],o0=re("wrench",r0);/**
|
|
682
682
|
* @license lucide-react v1.38.0 - ISC
|
|
683
683
|
*
|
|
684
684
|
* This source code is licensed under the ISC license.
|
|
685
685
|
* See the LICENSE file in the root directory of this source tree.
|
|
686
|
-
*/const
|
|
686
|
+
*/const s0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xs=re("x",s0);/**
|
|
687
687
|
* @license lucide-react v1.38.0 - ISC
|
|
688
688
|
*
|
|
689
689
|
* This source code is licensed under the ISC license.
|
|
690
690
|
* See the LICENSE file in the root directory of this source tree.
|
|
691
|
-
*/const
|
|
691
|
+
*/const l0=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],i0=re("anchor",l0);/**
|
|
692
692
|
* @license lucide-react v1.38.0 - ISC
|
|
693
693
|
*
|
|
694
694
|
* This source code is licensed under the ISC license.
|
|
695
695
|
* See the LICENSE file in the root directory of this source tree.
|
|
696
|
-
*/const
|
|
696
|
+
*/const u0=[["path",{d:"M19 9V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v3",key:"irtipd"}],["path",{d:"M3 16a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5a2 2 0 0 0-4 0v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V11a2 2 0 0 0-4 0z",key:"1qyhux"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]],c0=re("armchair",u0);/**
|
|
697
697
|
* @license lucide-react v1.38.0 - ISC
|
|
698
698
|
*
|
|
699
699
|
* This source code is licensed under the ISC license.
|
|
700
700
|
* See the LICENSE file in the root directory of this source tree.
|
|
701
|
-
*/const
|
|
701
|
+
*/const d0=[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]],Js=re("calendar",d0);/**
|
|
702
702
|
* @license lucide-react v1.38.0 - ISC
|
|
703
703
|
*
|
|
704
704
|
* This source code is licensed under the ISC license.
|
|
705
705
|
* See the LICENSE file in the root directory of this source tree.
|
|
706
|
-
*/const
|
|
706
|
+
*/const p0=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],h0=re("car",p0);/**
|
|
707
707
|
* @license lucide-react v1.38.0 - ISC
|
|
708
708
|
*
|
|
709
709
|
* This source code is licensed under the ISC license.
|
|
710
710
|
* See the LICENSE file in the root directory of this source tree.
|
|
711
|
-
*/const
|
|
711
|
+
*/const m0=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],C0=re("coffee",m0);/**
|
|
712
712
|
* @license lucide-react v1.38.0 - ISC
|
|
713
713
|
*
|
|
714
714
|
* This source code is licensed under the ISC license.
|
|
715
715
|
* See the LICENSE file in the root directory of this source tree.
|
|
716
|
-
*/const
|
|
716
|
+
*/const f0=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],b0=re("gamepad-2",f0);/**
|
|
717
717
|
* @license lucide-react v1.38.0 - ISC
|
|
718
718
|
*
|
|
719
719
|
* This source code is licensed under the ISC license.
|
|
720
720
|
* See the LICENSE file in the root directory of this source tree.
|
|
721
|
-
*/const
|
|
721
|
+
*/const g0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],y0=re("clock",g0);/**
|
|
722
722
|
* @license lucide-react v1.38.0 - ISC
|
|
723
723
|
*
|
|
724
724
|
* This source code is licensed under the ISC license.
|
|
725
725
|
* See the LICENSE file in the root directory of this source tree.
|
|
726
|
-
*/const
|
|
726
|
+
*/const v0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],_0=re("target",v0);/**
|
|
727
727
|
* @license lucide-react v1.38.0 - ISC
|
|
728
728
|
*
|
|
729
729
|
* This source code is licensed under the ISC license.
|
|
730
730
|
* See the LICENSE file in the root directory of this source tree.
|
|
731
|
-
*/const
|
|
731
|
+
*/const x0=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],w0=re("percent",x0);/**
|
|
732
732
|
* @license lucide-react v1.38.0 - ISC
|
|
733
733
|
*
|
|
734
734
|
* This source code is licensed under the ISC license.
|
|
735
735
|
* See the LICENSE file in the root directory of this source tree.
|
|
736
|
-
*/const
|
|
736
|
+
*/const B0=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],k0=re("inbox",B0);/**
|
|
737
737
|
* @license lucide-react v1.38.0 - ISC
|
|
738
738
|
*
|
|
739
739
|
* This source code is licensed under the ISC license.
|
|
740
740
|
* See the LICENSE file in the root directory of this source tree.
|
|
741
|
-
*/const
|
|
741
|
+
*/const A0=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M8 11h.01",key:"1dfujw"}]],N0=re("message-square-more",A0);/**
|
|
742
742
|
* @license lucide-react v1.38.0 - ISC
|
|
743
743
|
*
|
|
744
744
|
* This source code is licensed under the ISC license.
|
|
745
745
|
* See the LICENSE file in the root directory of this source tree.
|
|
746
|
-
*/const
|
|
746
|
+
*/const E0=[["path",{d:"M5 12h14",key:"1ays0h"}]],D0=re("minus",E0);/**
|
|
747
747
|
* @license lucide-react v1.38.0 - ISC
|
|
748
748
|
*
|
|
749
749
|
* This source code is licensed under the ISC license.
|
|
750
750
|
* See the LICENSE file in the root directory of this source tree.
|
|
751
|
-
*/const
|
|
751
|
+
*/const S0=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],j0=re("sparkles",S0);/**
|
|
752
752
|
* @license lucide-react v1.38.0 - ISC
|
|
753
753
|
*
|
|
754
754
|
* This source code is licensed under the ISC license.
|
|
755
755
|
* See the LICENSE file in the root directory of this source tree.
|
|
756
|
-
*/const
|
|
756
|
+
*/const T0=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],M0=re("type",T0);/**
|
|
757
757
|
* @license lucide-react v1.38.0 - ISC
|
|
758
758
|
*
|
|
759
759
|
* This source code is licensed under the ISC license.
|
|
760
760
|
* See the LICENSE file in the root directory of this source tree.
|
|
761
|
-
*/const
|
|
761
|
+
*/const L0=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}]],$0=re("volume",L0);/**
|
|
762
762
|
* @license lucide-react v1.38.0 - ISC
|
|
763
763
|
*
|
|
764
764
|
* This source code is licensed under the ISC license.
|
|
765
765
|
* See the LICENSE file in the root directory of this source tree.
|
|
766
|
-
*/const
|
|
766
|
+
*/const R0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qs=re("chevron-down",R0);/**
|
|
767
767
|
* @license lucide-react v1.38.0 - ISC
|
|
768
768
|
*
|
|
769
769
|
* This source code is licensed under the ISC license.
|
|
770
770
|
* See the LICENSE file in the root directory of this source tree.
|
|
771
|
-
*/const
|
|
771
|
+
*/const P0=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],el=re("chevron-up",P0);/**
|
|
772
772
|
* @license lucide-react v1.38.0 - ISC
|
|
773
773
|
*
|
|
774
774
|
* This source code is licensed under the ISC license.
|
|
775
775
|
* See the LICENSE file in the root directory of this source tree.
|
|
776
|
-
*/const
|
|
776
|
+
*/const I0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],F0=re("circle",I0);/**
|
|
777
777
|
* @license lucide-react v1.38.0 - ISC
|
|
778
778
|
*
|
|
779
779
|
* This source code is licensed under the ISC license.
|
|
780
780
|
* See the LICENSE file in the root directory of this source tree.
|
|
781
|
-
*/const
|
|
781
|
+
*/const O0=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],z0=re("triangle",O0);/**
|
|
782
782
|
* @license lucide-react v1.38.0 - ISC
|
|
783
783
|
*
|
|
784
784
|
* This source code is licensed under the ISC license.
|
|
785
785
|
* See the LICENSE file in the root directory of this source tree.
|
|
786
|
-
*/const
|
|
786
|
+
*/const W0=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],H0=re("menu",W0);/**
|
|
787
787
|
* @license lucide-react v1.38.0 - ISC
|
|
788
788
|
*
|
|
789
789
|
* This source code is licensed under the ISC license.
|
|
790
790
|
* See the LICENSE file in the root directory of this source tree.
|
|
791
|
-
*/const
|
|
791
|
+
*/const V0=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],q0=re("moon",V0);/**
|
|
792
792
|
* @license lucide-react v1.38.0 - ISC
|
|
793
793
|
*
|
|
794
794
|
* This source code is licensed under the ISC license.
|
|
795
795
|
* See the LICENSE file in the root directory of this source tree.
|
|
796
|
-
*/const
|
|
797
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n1(e,t){return QC(e)||e1(e,t)||a1(e,t)||t1()}function a1(e,t){if(e){if(typeof e=="string")return al(e,t);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?al(e,t):void 0}}const rl=Object.entries,ol=Object.setPrototypeOf,r1=Object.isFrozen,o1=Object.getPrototypeOf,s1=Object.getOwnPropertyDescriptor;let Ft=Object.freeze,zt=Object.seal,sa=Object.create,sl=typeof Reflect<"u"&&Reflect,Hr=sl.apply,Vr=sl.construct;Ft||(Ft=function(t){return t}),zt||(zt=function(t){return t}),Hr||(Hr=function(t,a){for(var r=arguments.length,s=new Array(r>2?r-2:0),l=2;l<r;l++)s[l-2]=arguments[l];return t.apply(a,s)}),Vr||(Vr=function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return new t(...r)});const Gn=It(Array.prototype.forEach),l1=It(Array.prototype.lastIndexOf),ll=It(Array.prototype.pop),ka=It(Array.prototype.push),i1=It(Array.prototype.splice),la=Array.isArray,Aa=It(String.prototype.toLowerCase),qr=It(String.prototype.toString),il=It(String.prototype.match),Na=It(String.prototype.replace),ul=It(String.prototype.indexOf),u1=It(String.prototype.trim),c1=It(Number.prototype.toString),d1=It(Boolean.prototype.toString),cl=typeof BigInt>"u"?null:It(BigInt.prototype.toString),dl=typeof Symbol>"u"?null:It(Symbol.prototype.toString),nn=It(Object.prototype.hasOwnProperty),Ea=It(Object.prototype.toString),Gt=It(RegExp.prototype.test),Kn=p1(TypeError);function It(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return Hr(e,t,r)}}function p1(e){return function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Vr(e,a)}}function mt(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Aa;if(ol&&ol(e,null),!la(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const l=a(s);l!==s&&(r1(t)||(t[r]=l),s=l)}e[s]=!0}return e}function h1(e){for(let t=0;t<e.length;t++)nn(e,t)||(e[t]=null);return e}function pn(e){const t=sa(null);for(const r of rl(e)){var a=n1(r,2);const s=a[0],l=a[1];nn(e,s)&&(la(l)?t[s]=h1(l):l&&typeof l=="object"&&l.constructor===Object?t[s]=pn(l):t[s]=l)}return t}function m1(e){switch(typeof e){case"string":return e;case"number":return c1(e);case"boolean":return d1(e);case"bigint":return cl?cl(e):"0";case"symbol":return dl?dl(e):"Symbol()";case"undefined":return Ea(e);case"function":case"object":{if(e===null)return Ea(e);const t=e,a=_n(t,"toString");if(typeof a=="function"){const r=a(t);return typeof r=="string"?r:Ea(r)}return Ea(e)}default:return Ea(e)}}function _n(e,t){for(;e!==null;){const r=s1(e,t);if(r){if(r.get)return It(r.get);if(typeof r.value=="function")return It(r.value)}e=o1(e)}function a(){return null}return a}function C1(e){try{return Gt(e,""),!0}catch{return!1}}const pl=Ft(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ur=Ft(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gr=Ft(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),f1=Ft(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kr=Ft(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),b1=Ft(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hl=Ft(["#text"]),ml=Ft(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yr=Ft(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Cl=Ft(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rr=Ft(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g1=zt(/{{[\w\W]*|^[\w\W]*}}/g),y1=zt(/<%[\w\W]*|^[\w\W]*%>/g),v1=zt(/\${[\w\W]*/g),_1=zt(/^data-[\-\w.\u00B7-\uFFFF]+$/),x1=zt(/^aria-[\-\w]+$/),fl=zt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),w1=zt(/^(?:\w+script|data):/i),B1=zt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k1=zt(/^html$/i),A1=zt(/^[a-z][.\w]*(-[.\w]+)+$/i),bl=zt(/<[/\w!]/g),gl=zt(/<[/\w]/g),N1=zt(/<\/no(script|embed|frames)/i),E1=zt(/\/>/i),hn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},yl=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],D1=Ft(mt({},yl)),S1=(function(){const e={};return Gn(yl,t=>{e[t]=zt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ft(e)})(),j1=function(){return typeof window>"u"?null:window},T1=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";a&&a.hasAttribute(s)&&(r=a.getAttribute(s));const l="dompurify"+(r?"#"+r:"");try{return t.createPolicy(l,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},vl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},zn=function(t,a,r,s){return nn(t,a)&&la(t[a])?mt(s.base?pn(s.base):{},t[a],s.transform):r},Zr=function(t,a,r){const s=nn(t,a)?t[a]:void 0;return s&&typeof s=="object"?pn(s):r()};function _l(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j1();const t=ge=>_l(ge);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==hn.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const r=a,s=r.currentScript;e.DocumentFragment;const l=e.HTMLTemplateElement,i=e.Node,u=e.Element,c=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,p=e.trustedTypes,m=u.prototype,g=_n(m,"cloneNode"),y=_n(m,"remove"),C=_n(m,"nextSibling"),f=_n(m,"childNodes"),_=_n(m,"parentNode"),b=_n(m,"shadowRoot"),B=_n(m,"attributes"),v=i&&i.prototype?_n(i.prototype,"nodeType"):null,N=i&&i.prototype?_n(i.prototype,"nodeName"):null,x=i&&i.prototype?_n(i.prototype,"ownerDocument"):null,E=function(j){return v?v(j):j.nodeType},w=function(j){return N?N(j):j.nodeName};if(typeof l=="function"){const ge=a.createElement("template");ge.content&&ge.content.ownerDocument&&(a=ge.content.ownerDocument)}let D,A="",k,R=!1,$=0;const G=function(){if($>0)throw Kn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(j){G(),$++;try{return D.createHTML(j)}finally{$--}},P=function(j){G(),$++;try{return D.createScriptURL(j)}finally{$--}},L=function(){return R||(k=T1(p,s),R=!0),k},Q=a,Z=Q.implementation,F=Q.createNodeIterator,K=Q.createDocumentFragment,T=Q.getElementsByTagName,q=r.importNode;let Y=vl();t.isSupported=typeof rl=="function"&&typeof _=="function"&&Z&&Z.createHTMLDocument!==void 0;const U=g1,S=y1,I=v1,O=_1,z=x1,se=w1,te=B1,de=A1;let ee=fl,V=null;const ne=mt({},[...pl,...Ur,...Gr,...Kr,...hl]);let W=null;const H=mt({},[...ml,...Yr,...Cl,...rr]);let ie=Object.seal(sa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,ye=null;const he=Object.seal(sa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Se=!0,$e=!0,Ne=!1,ue=!0,xe=!1,ke=!0,Ee=!1,We=!1,He=null,ot=null,Qe=!1,Je=!1,vt=!1,je=!1,Ye=!0,we=!1;const Ue="user-content-";let qe=!0,pt=!1,_t={},Et=null;const Bt=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let st=null;const tt=mt({},["audio","video","img","source","image","track"]);let kt=null;const At=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jt="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml";let it=gt,ut=!1,ct=null;const ve=mt({},[jt,Mt,gt],qr),Me=Ft(["mi","mo","mn","ms","mtext"]);let Pe=mt({},Me);const Oe=Ft(["annotation-xml"]);let dt=mt({},Oe);const Dt=mt({},["title","style","font","a","script"]);let yt=null;const xt=["application/xhtml+xml","text/html"],Ct="text/html";let Le=null,at=null;const oe=a.createElement("form"),be=function(j){return j instanceof RegExp||j instanceof Function},Ie=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===j)return;(!j||typeof j!="object")&&(j={}),j=pn(j),yt=xt.indexOf(j.PARSER_MEDIA_TYPE)===-1?Ct:j.PARSER_MEDIA_TYPE,Le=yt==="application/xhtml+xml"?qr:Aa,V=zn(j,"ALLOWED_TAGS",ne,{transform:Le}),W=zn(j,"ALLOWED_ATTR",H,{transform:Le}),ct=zn(j,"ALLOWED_NAMESPACES",ve,{transform:qr}),kt=zn(j,"ADD_URI_SAFE_ATTR",At,{transform:Le,base:At}),st=zn(j,"ADD_DATA_URI_TAGS",tt,{transform:Le,base:tt}),Et=zn(j,"FORBID_CONTENTS",Bt,{transform:Le}),Te=zn(j,"FORBID_TAGS",pn({}),{transform:Le}),ye=zn(j,"FORBID_ATTR",pn({}),{transform:Le}),_t=nn(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?pn(j.USE_PROFILES):j.USE_PROFILES:!1,Se=j.ALLOW_ARIA_ATTR!==!1,$e=j.ALLOW_DATA_ATTR!==!1,Ne=j.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=j.SAFE_FOR_TEMPLATES||!1,ke=j.SAFE_FOR_XML!==!1,Ee=j.WHOLE_DOCUMENT||!1,Je=j.RETURN_DOM||!1,vt=j.RETURN_DOM_FRAGMENT||!1,je=j.RETURN_TRUSTED_TYPE||!1,Qe=j.FORCE_BODY||!1,Ye=j.SANITIZE_DOM!==!1,we=j.SANITIZE_NAMED_PROPS||!1,qe=j.KEEP_CONTENT!==!1,pt=j.IN_PLACE||!1,ee=C1(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:fl,it=typeof j.NAMESPACE=="string"?j.NAMESPACE:gt,Pe=Zr(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>mt({},Me)),dt=Zr(j,"HTML_INTEGRATION_POINTS",()=>mt({},Oe));const J=Zr(j,"CUSTOM_ELEMENT_HANDLING",()=>sa(null));if(ie=sa(null),nn(J,"tagNameCheck")&&be(J.tagNameCheck)&&(ie.tagNameCheck=J.tagNameCheck),nn(J,"attributeNameCheck")&&be(J.attributeNameCheck)&&(ie.attributeNameCheck=J.attributeNameCheck),nn(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),zt(ie),xe&&($e=!1),vt&&(Je=!0),_t&&(V=mt({},hl),W=sa(null),_t.html===!0&&(mt(V,pl),mt(W,ml)),_t.svg===!0&&(mt(V,Ur),mt(W,Yr),mt(W,rr)),_t.svgFilters===!0&&(mt(V,Gr),mt(W,Yr),mt(W,rr)),_t.mathMl===!0&&(mt(V,Kr),mt(W,Cl),mt(W,rr))),he.tagCheck=null,he.attributeCheck=null,nn(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?he.tagCheck=j.ADD_TAGS:la(j.ADD_TAGS)&&(V===ne&&(V=pn(V)),mt(V,j.ADD_TAGS,Le))),nn(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?he.attributeCheck=j.ADD_ATTR:la(j.ADD_ATTR)&&(W===H&&(W=pn(W)),mt(W,j.ADD_ATTR,Le))),nn(j,"ADD_FORBID_CONTENTS")&&la(j.ADD_FORBID_CONTENTS)&&(Et===Bt&&(Et=pn(Et)),mt(Et,j.ADD_FORBID_CONTENTS,Le)),qe&&(V["#text"]=!0),Ee&&mt(V,["html","head","body"]),V.table&&(mt(V,["tbody"]),delete Te.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const me=D;D=j.TRUSTED_TYPES_POLICY;try{A=M("")}catch(ae){throw D=me,ae}}else j.TRUSTED_TYPES_POLICY===null?(D=void 0,A=""):(D===void 0&&(D=L()),D&&typeof A=="string"&&(A=M("")));Ft&&Ft(j),at=j},Xe=mt({},[...Ur,...Gr,...f1]),et=mt({},[...Kr,...b1]),rt=function(j,J,me){return J.namespaceURI===gt?j==="svg":J.namespaceURI===jt?j==="svg"&&(me==="annotation-xml"||Pe[me]):!!Xe[j]},Lt=function(j,J,me){return J.namespaceURI===gt?j==="math":J.namespaceURI===Mt?j==="math"&&dt[me]:!!et[j]},Bn=function(j,J,me){return J.namespaceURI===Mt&&!dt[me]||J.namespaceURI===jt&&!Pe[me]?!1:!et[j]&&(Dt[j]||!Xe[j])},ln=function(j){let J=_(j);(!J||!J.tagName)&&(J={namespaceURI:it,tagName:"template"});const me=Aa(j.tagName),ae=Aa(J.tagName);return ct[j.namespaceURI]?j.namespaceURI===Mt?rt(me,J,ae):j.namespaceURI===jt?Lt(me,J,ae):j.namespaceURI===gt?Bn(me,J,ae):!!(yt==="application/xhtml+xml"&&ct[j.namespaceURI]):!1},$t=function(j){ka(t.removed,{element:j});try{_(j).removeChild(j)}catch{if(y(j),!_(j))throw Kn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ot=function(j,J,me){try{j.removeAttributeNode(J)}catch{try{j.removeAttribute(me)}catch{}}},un=function(j){Jt(j);const J=f(j);if(J){const ae=[];Gn(J,Ce=>{ka(ae,Ce)}),Gn(ae,Ce=>{try{y(Ce)}catch{}})}const me=B(j);if(me)for(let ae=me.length-1;ae>=0;--ae){const Ce=me[ae],Fe=Ce&&Ce.name;typeof Fe=="string"&&Ot(j,Ce,Fe)}},Pt=function(j,J,me){if(!me)try{me=J.getAttributeNode(j)}catch{me=null}ka(t.removed,{attribute:me||null,from:J});try{me?J.removeAttributeNode(me):J.removeAttribute(j)}catch{try{J.removeAttribute(j)}catch{}}if(j==="is")if(Je||vt)try{$t(J)}catch{}else try{J.setAttribute(j,"")}catch{}},kn=function(j){const J=B(j);if(J)for(let me=J.length-1;me>=0;--me){const ae=J[me],Ce=ae&&ae.name;typeof Ce!="string"||W[Le(Ce)]||Ot(j,ae,Ce)}},Jt=function(j){const J=[j];for(;J.length>0;){const me=J.pop();E(me)===hn.element&&kn(me);const Ce=f(me);if(Ce)for(let Fe=Ce.length-1;Fe>=0;--Fe)J.push(Ce[Fe])}},St=function(j,J){return ke?j==="patchsrc"?!0:j==="for"&&J!=="label"&&J!=="output":!1},Rt=function(j){if(!ke)return;const J=[j];for(;J.length>0;){const me=J.pop(),ae=E(me);if(ae===hn.processingInstruction||ae===hn.comment&&Gt(gl,me.data)){try{y(me)}catch{}continue}if(ae===hn.element){const Fe=me,lt=Le(w(me));try{Fe.hasAttribute&&Fe.hasAttribute("patchsrc")&&Fe.removeAttribute("patchsrc"),Fe.hasAttribute&&Fe.hasAttribute("for")&&St("for",lt)&&Fe.removeAttribute("for")}catch{}}const Ce=f(me);if(Ce)for(let Fe=Ce.length-1;Fe>=0;--Fe)J.push(Ce[Fe])}},Wt=function(j){let J=null,me=null;if(Qe)j="<remove></remove>"+j;else{const Fe=il(j,/^[\r\n\t ]+/);me=Fe&&Fe[0]}yt==="application/xhtml+xml"&&it===gt&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const ae=D?M(j):j;if(it===gt)try{J=new h().parseFromString(ae,yt)}catch{}if(!J||!J.documentElement){J=Z.createDocument(it,"template",null);try{J.documentElement.innerHTML=ut?A:ae}catch{}}const Ce=J.body||J.documentElement;return j&&me&&Ce.insertBefore(a.createTextNode(me),Ce.childNodes[0]||null),it===gt?T.call(J,Ee?"html":"body")[0]:Ee?J.documentElement:Ce},Kt=function(j){const J=x?x(j):j.ownerDocument;return F.call(J||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},fn=function(j){return j=Na(j,U," "),j=Na(j,S," "),j=Na(j,I," "),j},Ut=function(j){var J;j.normalize();const me=x?x(j):j.ownerDocument,ae=F.call(me||j,j,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ae.nextNode();for(;Ce;)Ce.data=fn(Ce.data),Ce=ae.nextNode();const Fe=(J=j.querySelectorAll)===null||J===void 0?void 0:J.call(j,"template");Fe&&Gn(Fe,lt=>{cn(lt.content)&&Ut(lt.content)})},Qt=function(j){const J=N?N(j):null;return typeof J!="string"||Le(J)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==B(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==v(j)||j.childNodes!==f(j)},cn=function(j){if(!v||typeof j!="object"||j===null)return!1;try{return v(j)===hn.documentFragment}catch{return!1}},bn=function(j){if(!v||typeof j!="object"||j===null)return!1;try{return typeof v(j)=="number"}catch{return!1}};function Ht(ge,j,J){ge.length!==0&&Gn(ge,me=>{me.call(t,j,J,at)})}const An=function(j,J){return!!(ke&&j.hasChildNodes()&&!bn(j.firstElementChild)&&Gt(bl,j.textContent)&&Gt(bl,j.innerHTML)||ke&&j.namespaceURI===gt&&D1[J]&&(bn(j.firstElementChild)||typeof j.textContent=="string"&&Gt(S1[J],j.textContent))||j.nodeType===hn.processingInstruction||ke&&j.nodeType===hn.comment&&Gt(gl,j.data))},pe=function(j,J){if(j instanceof RegExp)return Gt(j,J);if(j instanceof Function){for(var me=arguments.length,ae=new Array(me>2?me-2:0),Ce=2;Ce<me;Ce++)ae[Ce-2]=arguments[Ce];return!!j(J,...ae)}return!1},De=function(j,J,me){if(!Te[J]&&Ae(J)&&pe(ie.tagNameCheck,J))return!1;if(qe&&!Et[J]){const ae=_(j),Ce=f(j);if(Ce&&ae){const Fe=Ce.length;for(let lt=Fe-1;lt>=0;--lt){const ht=j===me?g(Ce[lt],!0):Ce[lt];ae.insertBefore(ht,C(j))}}}return $t(j),!0},Re=function(j,J,me,ae){return j.length===0?J:J===me||J===ae?pn(J):J},Ge=function(j,J){return j===J||_(j)!==null?!1:(pt&&Jt(j),!0)},ze=function(j,J){if(Ht(Y.beforeSanitizeElements,j,null),Ge(j,J))return!0;if(Qt(j))return $t(j),!0;const me=Le(w(j));if(V=Re(Y.uponSanitizeElement,V,ne,He),Ht(Y.uponSanitizeElement,j,{tagName:me,allowedTags:V}),Ge(j,J))return!0;if(An(j,me))return $t(j),!0;if(Te[me]||!(he.tagCheck instanceof Function&&he.tagCheck(me))&&!V[me]){const Ce=De(j,me,J);return Ce===!1&&Ht(Y.afterSanitizeElements,j,null),Ce}if(E(j)===hn.element&&!ln(j)||(me==="noscript"||me==="noembed"||me==="noframes")&&Gt(N1,j.innerHTML))return $t(j),!0;if(xe&&j.nodeType===hn.text){const Ce=fn(j.textContent);j.textContent!==Ce&&(ka(t.removed,{element:j.cloneNode()}),j.textContent=Ce)}return Ht(Y.afterSanitizeElements,j,null),!1},X=function(j,J,me){if(ye[J]||St(J,j)||Ye&&(J==="id"||J==="name")&&(me in a||me in oe))return!1;const ae=W[J]||he.attributeCheck instanceof Function&&he.attributeCheck(J,j);return $e&&Gt(O,J)||Se&&Gt(z,J)?!0:ae?kt[J]||Gt(ee,Na(me,te,""))||(J==="src"||J==="xlink:href"||J==="href")&&j!=="script"&&ul(me,"data:")===0&&st[j]||Ne&&!Gt(se,Na(me,te,""))?!0:!me:Ae(j)&&pe(ie.tagNameCheck,j)&&pe(ie.attributeNameCheck,J,j)||J==="is"&&ie.allowCustomizedBuiltInElements&&pe(ie.tagNameCheck,me)},ce=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ae=function(j){return!ce[Aa(j)]&&Gt(de,j)},Ve=function(j,J,me,ae){if(D&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!me)switch(p.getAttributeType(j,J)){case"TrustedHTML":return M(ae);case"TrustedScriptURL":return P(ae)}return ae},Ke=function(j,J,me,ae){try{me?j.setAttributeNS(me,J,ae):j.setAttribute(J,ae),Qt(j)?$t(j):ll(t.removed)}catch{Pt(J,j)}},Ze=function(j){Ht(Y.beforeSanitizeAttributes,j,null);const J=j.attributes;if(!J||Qt(j))return;W=Re(Y.uponSanitizeAttribute,W,H,ot);const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let ae=J.length;const Ce=Le(j.nodeName);for(;ae--;){const Fe=J[ae],lt=Fe.name,ht=Fe.namespaceURI,en=Fe.value,tn=Le(lt),Fr=en;let Yt=lt==="value"?Fr:u1(Fr);if(me.attrName=tn,me.attrValue=Yt,me.keepAttr=!0,me.forceKeepAttr=void 0,Ht(Y.uponSanitizeAttribute,j,me),Yt=me.attrValue,we&&(tn==="id"||tn==="name")&&ul(Yt,Ue)!==0&&(Pt(lt,j,Fe),Yt=Ue+Yt),ke&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Yt)){Pt(lt,j,Fe);continue}if(tn==="attributename"&&il(Yt,"href")){Pt(lt,j,Fe);continue}if(!me.forceKeepAttr){if(!me.keepAttr){Pt(lt,j,Fe);continue}if(!ue&&Gt(E1,Yt)){Pt(lt,j,Fe);continue}if(xe&&(Yt=fn(Yt)),!X(Ce,tn,Yt)){Pt(lt,j,Fe);continue}Yt=Ve(Ce,tn,ht,Yt),Yt!==Fr&&Ke(j,lt,ht,Yt)}}Ht(Y.afterSanitizeAttributes,j,null)},ft=function(j){let J=null;const me=Kt(j);for(Ht(Y.beforeSanitizeShadowDOM,j,null);J=me.nextNode();)if(Ht(Y.uponSanitizeShadowNode,J,null),ze(J,j),Ze(J),cn(J.content)&&ft(J.content),E(J)===hn.element){const ae=b(J);cn(ae)&&(bt(ae),ft(ae))}Ht(Y.afterSanitizeShadowDOM,j,null)},bt=function(j){const J=[{node:j,shadow:null}];for(;J.length>0;){const me=J.pop();if(me.shadow){ft(me.shadow);continue}const ae=me.node,Fe=E(ae)===hn.element,lt=f(ae);if(lt)for(let ht=lt.length-1;ht>=0;--ht)J.push({node:lt[ht],shadow:null});if(Fe){const ht=N?N(ae):null;if(typeof ht=="string"&&Le(ht)==="template"){const en=ae.content;cn(en)&&J.push({node:en,shadow:null})}}if(Fe){const ht=b(ae);cn(ht)&&J.push({node:null,shadow:ht},{node:ht,shadow:null})}}};return t.sanitize=function(ge){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,me=null,ae=null,Ce=null;if(ut=!ge,ut&&(ge="<!-->"),typeof ge!="string"&&!bn(ge)&&(ge=m1(ge),typeof ge!="string"))throw Kn("dirty is not a string, aborting");if(!t.isSupported)return ge;We?(V=He,W=ot):Ie(j),(Y.uponSanitizeElement.length>0||Y.uponSanitizeAttribute.length>0)&&(V=pn(V)),Y.uponSanitizeAttribute.length>0&&(W=pn(W)),t.removed=[];const Fe=pt&&typeof ge!="string"&&bn(ge);if(Fe){Rt(ge);const en=w(ge);if(typeof en=="string"){const tn=Le(en);if(!V[tn]||Te[tn])throw un(ge),Kn("root node is forbidden and cannot be sanitized in-place")}if(Qt(ge))throw un(ge),Kn("root node is clobbered and cannot be sanitized in-place");try{bt(ge)}catch(tn){throw un(ge),tn}}else if(bn(ge))J=Wt("<!---->"),me=J.ownerDocument.importNode(ge,!0),me.nodeType===hn.element&&me.nodeName==="BODY"||me.nodeName==="HTML"?J=me:J.appendChild(me),bt(me);else{if(!Je&&!xe&&!Ee&&ge.indexOf("<")===-1)return D&&je?M(ge):ge;if(J=Wt(ge),!J)return Je?null:je?A:""}J&&Qe&&$t(J.firstChild);const lt=Fe?ge:J;try{const en=Kt(lt);for(;ae=en.nextNode();)ze(ae,lt),Ze(ae),cn(ae.content)&&ft(ae.content)}catch(en){throw Fe&&(un(ge),Gn(t.removed,tn=>{tn.element&&Jt(tn.element)})),en}if(Fe)return Gn(t.removed,en=>{en.element&&Jt(en.element)}),xe&&Ut(ge),ge;if(Je){if(xe&&Ut(J),vt)for(Ce=K.call(J.ownerDocument);J.firstChild;)Ce.appendChild(J.firstChild);else Ce=J;return(W.shadowroot||W.shadowrootmode)&&(Ce=q.call(r,Ce,!0)),Ce}let ht=Ee?J.outerHTML:J.innerHTML;return Ee&&V["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&Gt(k1,J.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
|
|
798
|
-
`+ht),xe&&(ht=fn(ht)),D&&je?M(ht):ht},t.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(ge),We=!0,He=V,ot=W},t.clearConfig=function(){at=null,We=!1,He=null,ot=null,D=k,
|
|
796
|
+
*/const U0=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],G0=re("thumbs-up",U0),Wr={"alert-triangle":Os,"align-start-vertical":Td,anchor:i0,armchair:c0,"arrow-down":Ld,"arrow-left":Rd,"arrow-right":Id,"arrow-right-left":Od,"audio-lines":Wd,ban:Vd,bell:Ud,"book-marked":Kd,"book-open":Zd,"bow-arrow":Jd,braces:ep,bug:np,calendar:Js,"calendar-check":rp,"calendar-days":sp,camera:ip,car:h0,"chart-column":cp,"chart-line":pp,"chart-pie":mp,check:zs,"chevron-down":Qs,"chevron-left":Ws,"chevron-right":Hs,"chevron-up":el,circle:F0,"clipboard-list":yp,coffee:C0,combine:_p,copy:wp,"chevrons-left-right-ellipsis":kp,"credit-card":Np,database:Vs,diff:Sp,download:qs,ear:Mp,edit:$p,"edit-2":Pp,"edit-3":Fp,ellipsis:Us,eraser:Wp,"external-link":Vp,eye:Up,"file-text":Kp,"flip-horizontal":Zp,"folder-open":Jp,"folder-plus":eh,gamepad:nh,"gamepad-2":b0,clock:y0,lock:qh,"search-x":Ym,"share-2":tC,tag:kC,target:_0,percent:w0,gavel:rh,"git-merge":Gs,globe:lh,"grip-vertical":uh,headphones:dh,heart:hh,home:Ch,inbox:k0,info:bh,"key-round":yh,landmark:_h,layers:wh,"layout-dashboard":kh,leaf:Nh,lightbulb:Dh,link:jh,"link-2":Mh,"link-2-off":$h,list:Ph,"list-checks":Fh,"list-ordered":zh,loader:Hh,"log-out":Gh,mail:Yh,"map-pin":Xh,menu:H0,"message-circle":Qh,"message-circle-question-mark":tm,"message-square":am,"message-square-more":N0,"message-square-text":om,minus:D0,"minus-circle":lm,moon:q0,"more-horizontal":Us,package:um,"party-popper":dm,pause:hm,pencil:Cm,phone:bm,play:ym,"play-circle":_m,plus:wm,printer:km,"refresh-cw":Nm,repeat:Dm,replace:jm,rocket:Mm,"rotate-ccw":$m,"rotate-cw":Pm,salad:Fm,"scan-search":zm,search:qm,"circle-alert":Ks,"alert-circle":Ks,"check-circle":Ys,scissors:Gm,send:Xm,settings:Qm,"shield-check":aC,"shopping-cart":oC,shuffle:lC,"skip-back":uC,"skip-forward":dC,sparkles:j0,square:hC,star:CC,store:bC,"sun-medium":yC,table:_C,"table-2":wC,terminal:NC,"text-cursor-input":DC,"text-initial":jC,"thumbs-up":G0,ticket:MC,trash:PC,triangle:z0,"trash-2":$C,"trending-up":FC,"triangle-alert":Os,trophy:zC,type:M0,unlink:HC,upload:qC,user:zr,"user-plus":KC,"user-round":ZC,"user-round-check":JC,users:e0,"users-round":n0,volume:$0,"volume-2":Zs,wrench:o0,x:Xs};Object.freeze(Object.keys(Wr));function K0(e){return Wr[e]??null}const tl=new Set;function Y0(e){return On&&!(e in Wr)&&!tl.has(e)&&(tl.add(e),console.warn(`[ihabdevteam-core] lucide \uC544\uC774\uCF58 '${e}' \uC774 \uC815\uC801 \uBAA9\uB85D\uC5D0 \uC5C6\uC5B4 \uB80C\uB354\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. utils/lucideIconSet.ts \uC758 STATIC_LUCIDE_ICONS \uC5D0 \uCD94\uAC00\uD558\uC138\uC694.`)),Promise.resolve(null)}const Z0=e=>e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Za-z])([0-9])/g,"$1-$2").replace(/[_ ]+/g,"-").toLowerCase();function X0(e){const t=e.toLowerCase();if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||e.includes("/assets/")||/\.(png|jpe?g|gif|webp|avif|bmp|ico)$/i.test(t))return null;const a=(e.split("/").pop()||"").replace(/\.svg$/,"");return a?Z0(a):null}const nl=new Map;function J0(e){const t=typeof e=="string"?X0(e):null,a=t?K0(t)??nl.get(t)??null:null,[r,s]=o.useState(null);return o.useEffect(()=>{if(!t||a)return;let l=!1;return Y0(t).then(i=>{nl.set(t,i),l||s(i)}),()=>{l=!0}},[t,a]),a??r}/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function al(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,r=Array(t);a<t;a++)r[a]=e[a];return r}function Q0(e){if(Array.isArray(e))return e}function e1(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r,s,l,i,u=[],c=!0,d=!1;try{if(l=(a=a.call(e)).next,t!==0)for(;!(c=(r=l.call(a)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(d)throw s}}return u}}function t1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
797
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n1(e,t){return Q0(e)||e1(e,t)||a1(e,t)||t1()}function a1(e,t){if(e){if(typeof e=="string")return al(e,t);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?al(e,t):void 0}}const rl=Object.entries,ol=Object.setPrototypeOf,r1=Object.isFrozen,o1=Object.getPrototypeOf,s1=Object.getOwnPropertyDescriptor;let Ft=Object.freeze,zt=Object.seal,sa=Object.create,sl=typeof Reflect<"u"&&Reflect,Hr=sl.apply,Vr=sl.construct;Ft||(Ft=function(t){return t}),zt||(zt=function(t){return t}),Hr||(Hr=function(t,a){for(var r=arguments.length,s=new Array(r>2?r-2:0),l=2;l<r;l++)s[l-2]=arguments[l];return t.apply(a,s)}),Vr||(Vr=function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return new t(...r)});const Gn=It(Array.prototype.forEach),l1=It(Array.prototype.lastIndexOf),ll=It(Array.prototype.pop),ka=It(Array.prototype.push),i1=It(Array.prototype.splice),la=Array.isArray,Aa=It(String.prototype.toLowerCase),qr=It(String.prototype.toString),il=It(String.prototype.match),Na=It(String.prototype.replace),ul=It(String.prototype.indexOf),u1=It(String.prototype.trim),c1=It(Number.prototype.toString),d1=It(Boolean.prototype.toString),cl=typeof BigInt>"u"?null:It(BigInt.prototype.toString),dl=typeof Symbol>"u"?null:It(Symbol.prototype.toString),nn=It(Object.prototype.hasOwnProperty),Ea=It(Object.prototype.toString),Gt=It(RegExp.prototype.test),Kn=p1(TypeError);function It(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return Hr(e,t,r)}}function p1(e){return function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Vr(e,a)}}function mt(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Aa;if(ol&&ol(e,null),!la(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const l=a(s);l!==s&&(r1(t)||(t[r]=l),s=l)}e[s]=!0}return e}function h1(e){for(let t=0;t<e.length;t++)nn(e,t)||(e[t]=null);return e}function pn(e){const t=sa(null);for(const r of rl(e)){var a=n1(r,2);const s=a[0],l=a[1];nn(e,s)&&(la(l)?t[s]=h1(l):l&&typeof l=="object"&&l.constructor===Object?t[s]=pn(l):t[s]=l)}return t}function m1(e){switch(typeof e){case"string":return e;case"number":return c1(e);case"boolean":return d1(e);case"bigint":return cl?cl(e):"0";case"symbol":return dl?dl(e):"Symbol()";case"undefined":return Ea(e);case"function":case"object":{if(e===null)return Ea(e);const t=e,a=_n(t,"toString");if(typeof a=="function"){const r=a(t);return typeof r=="string"?r:Ea(r)}return Ea(e)}default:return Ea(e)}}function _n(e,t){for(;e!==null;){const r=s1(e,t);if(r){if(r.get)return It(r.get);if(typeof r.value=="function")return It(r.value)}e=o1(e)}function a(){return null}return a}function C1(e){try{return Gt(e,""),!0}catch{return!1}}const pl=Ft(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ur=Ft(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gr=Ft(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),f1=Ft(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kr=Ft(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),b1=Ft(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hl=Ft(["#text"]),ml=Ft(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Yr=Ft(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Cl=Ft(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rr=Ft(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g1=zt(/{{[\w\W]*|^[\w\W]*}}/g),y1=zt(/<%[\w\W]*|^[\w\W]*%>/g),v1=zt(/\${[\w\W]*/g),_1=zt(/^data-[\-\w.\u00B7-\uFFFF]+$/),x1=zt(/^aria-[\-\w]+$/),fl=zt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),w1=zt(/^(?:\w+script|data):/i),B1=zt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k1=zt(/^html$/i),A1=zt(/^[a-z][.\w]*(-[.\w]+)+$/i),bl=zt(/<[/\w!]/g),gl=zt(/<[/\w]/g),N1=zt(/<\/no(script|embed|frames)/i),E1=zt(/\/>/i),hn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},yl=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],D1=Ft(mt({},yl)),S1=(function(){const e={};return Gn(yl,t=>{e[t]=zt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ft(e)})(),j1=function(){return typeof window>"u"?null:window},T1=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";a&&a.hasAttribute(s)&&(r=a.getAttribute(s));const l="dompurify"+(r?"#"+r:"");try{return t.createPolicy(l,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},vl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},zn=function(t,a,r,s){return nn(t,a)&&la(t[a])?mt(s.base?pn(s.base):{},t[a],s.transform):r},Zr=function(t,a,r){const s=nn(t,a)?t[a]:void 0;return s&&typeof s=="object"?pn(s):r()};function _l(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j1();const t=ge=>_l(ge);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==hn.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const r=a,s=r.currentScript;e.DocumentFragment;const l=e.HTMLTemplateElement,i=e.Node,u=e.Element,c=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,p=e.trustedTypes,m=u.prototype,g=_n(m,"cloneNode"),y=_n(m,"remove"),C=_n(m,"nextSibling"),f=_n(m,"childNodes"),_=_n(m,"parentNode"),b=_n(m,"shadowRoot"),B=_n(m,"attributes"),v=i&&i.prototype?_n(i.prototype,"nodeType"):null,A=i&&i.prototype?_n(i.prototype,"nodeName"):null,x=i&&i.prototype?_n(i.prototype,"ownerDocument"):null,E=function(j){return v?v(j):j.nodeType},w=function(j){return A?A(j):j.nodeName};if(typeof l=="function"){const ge=a.createElement("template");ge.content&&ge.content.ownerDocument&&(a=ge.content.ownerDocument)}let D,N="",k,R=!1,$=0;const G=function(){if($>0)throw Kn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(j){G(),$++;try{return D.createHTML(j)}finally{$--}},P=function(j){G(),$++;try{return D.createScriptURL(j)}finally{$--}},L=function(){return R||(k=T1(p,s),R=!0),k},Q=a,Z=Q.implementation,F=Q.createNodeIterator,K=Q.createDocumentFragment,T=Q.getElementsByTagName,q=r.importNode;let Y=vl();t.isSupported=typeof rl=="function"&&typeof _=="function"&&Z&&Z.createHTMLDocument!==void 0;const U=g1,S=y1,I=v1,O=_1,z=x1,se=w1,te=B1,de=A1;let ee=fl,V=null;const ne=mt({},[...pl,...Ur,...Gr,...Kr,...hl]);let W=null;const H=mt({},[...ml,...Yr,...Cl,...rr]);let ie=Object.seal(sa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,ye=null;const he=Object.seal(sa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Se=!0,$e=!0,Ne=!1,ue=!0,xe=!1,ke=!0,Ee=!1,We=!1,He=null,ot=null,Qe=!1,Je=!1,vt=!1,je=!1,Ye=!0,we=!1;const Ue="user-content-";let qe=!0,pt=!1,_t={},Et=null;const Bt=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let st=null;const tt=mt({},["audio","video","img","source","image","track"]);let kt=null;const At=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jt="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml";let it=gt,ut=!1,ct=null;const ve=mt({},[jt,Mt,gt],qr),Me=Ft(["mi","mo","mn","ms","mtext"]);let Pe=mt({},Me);const Oe=Ft(["annotation-xml"]);let dt=mt({},Oe);const Dt=mt({},["title","style","font","a","script"]);let yt=null;const wt=["application/xhtml+xml","text/html"],Ct="text/html";let Le=null,at=null;const oe=a.createElement("form"),be=function(j){return j instanceof RegExp||j instanceof Function},Ie=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===j)return;(!j||typeof j!="object")&&(j={}),j=pn(j),yt=wt.indexOf(j.PARSER_MEDIA_TYPE)===-1?Ct:j.PARSER_MEDIA_TYPE,Le=yt==="application/xhtml+xml"?qr:Aa,V=zn(j,"ALLOWED_TAGS",ne,{transform:Le}),W=zn(j,"ALLOWED_ATTR",H,{transform:Le}),ct=zn(j,"ALLOWED_NAMESPACES",ve,{transform:qr}),kt=zn(j,"ADD_URI_SAFE_ATTR",At,{transform:Le,base:At}),st=zn(j,"ADD_DATA_URI_TAGS",tt,{transform:Le,base:tt}),Et=zn(j,"FORBID_CONTENTS",Bt,{transform:Le}),Te=zn(j,"FORBID_TAGS",pn({}),{transform:Le}),ye=zn(j,"FORBID_ATTR",pn({}),{transform:Le}),_t=nn(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?pn(j.USE_PROFILES):j.USE_PROFILES:!1,Se=j.ALLOW_ARIA_ATTR!==!1,$e=j.ALLOW_DATA_ATTR!==!1,Ne=j.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=j.SAFE_FOR_TEMPLATES||!1,ke=j.SAFE_FOR_XML!==!1,Ee=j.WHOLE_DOCUMENT||!1,Je=j.RETURN_DOM||!1,vt=j.RETURN_DOM_FRAGMENT||!1,je=j.RETURN_TRUSTED_TYPE||!1,Qe=j.FORCE_BODY||!1,Ye=j.SANITIZE_DOM!==!1,we=j.SANITIZE_NAMED_PROPS||!1,qe=j.KEEP_CONTENT!==!1,pt=j.IN_PLACE||!1,ee=C1(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:fl,it=typeof j.NAMESPACE=="string"?j.NAMESPACE:gt,Pe=Zr(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>mt({},Me)),dt=Zr(j,"HTML_INTEGRATION_POINTS",()=>mt({},Oe));const J=Zr(j,"CUSTOM_ELEMENT_HANDLING",()=>sa(null));if(ie=sa(null),nn(J,"tagNameCheck")&&be(J.tagNameCheck)&&(ie.tagNameCheck=J.tagNameCheck),nn(J,"attributeNameCheck")&&be(J.attributeNameCheck)&&(ie.attributeNameCheck=J.attributeNameCheck),nn(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),zt(ie),xe&&($e=!1),vt&&(Je=!0),_t&&(V=mt({},hl),W=sa(null),_t.html===!0&&(mt(V,pl),mt(W,ml)),_t.svg===!0&&(mt(V,Ur),mt(W,Yr),mt(W,rr)),_t.svgFilters===!0&&(mt(V,Gr),mt(W,Yr),mt(W,rr)),_t.mathMl===!0&&(mt(V,Kr),mt(W,Cl),mt(W,rr))),he.tagCheck=null,he.attributeCheck=null,nn(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?he.tagCheck=j.ADD_TAGS:la(j.ADD_TAGS)&&(V===ne&&(V=pn(V)),mt(V,j.ADD_TAGS,Le))),nn(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?he.attributeCheck=j.ADD_ATTR:la(j.ADD_ATTR)&&(W===H&&(W=pn(W)),mt(W,j.ADD_ATTR,Le))),nn(j,"ADD_FORBID_CONTENTS")&&la(j.ADD_FORBID_CONTENTS)&&(Et===Bt&&(Et=pn(Et)),mt(Et,j.ADD_FORBID_CONTENTS,Le)),qe&&(V["#text"]=!0),Ee&&mt(V,["html","head","body"]),V.table&&(mt(V,["tbody"]),delete Te.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const me=D;D=j.TRUSTED_TYPES_POLICY;try{N=M("")}catch(ae){throw D=me,ae}}else j.TRUSTED_TYPES_POLICY===null?(D=void 0,N=""):(D===void 0&&(D=L()),D&&typeof N=="string"&&(N=M("")));Ft&&Ft(j),at=j},Xe=mt({},[...Ur,...Gr,...f1]),et=mt({},[...Kr,...b1]),rt=function(j,J,me){return J.namespaceURI===gt?j==="svg":J.namespaceURI===jt?j==="svg"&&(me==="annotation-xml"||Pe[me]):!!Xe[j]},Lt=function(j,J,me){return J.namespaceURI===gt?j==="math":J.namespaceURI===Mt?j==="math"&&dt[me]:!!et[j]},Bn=function(j,J,me){return J.namespaceURI===Mt&&!dt[me]||J.namespaceURI===jt&&!Pe[me]?!1:!et[j]&&(Dt[j]||!Xe[j])},ln=function(j){let J=_(j);(!J||!J.tagName)&&(J={namespaceURI:it,tagName:"template"});const me=Aa(j.tagName),ae=Aa(J.tagName);return ct[j.namespaceURI]?j.namespaceURI===Mt?rt(me,J,ae):j.namespaceURI===jt?Lt(me,J,ae):j.namespaceURI===gt?Bn(me,J,ae):!!(yt==="application/xhtml+xml"&&ct[j.namespaceURI]):!1},$t=function(j){ka(t.removed,{element:j});try{_(j).removeChild(j)}catch{if(y(j),!_(j))throw Kn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ot=function(j,J,me){try{j.removeAttributeNode(J)}catch{try{j.removeAttribute(me)}catch{}}},un=function(j){Jt(j);const J=f(j);if(J){const ae=[];Gn(J,Ce=>{ka(ae,Ce)}),Gn(ae,Ce=>{try{y(Ce)}catch{}})}const me=B(j);if(me)for(let ae=me.length-1;ae>=0;--ae){const Ce=me[ae],Fe=Ce&&Ce.name;typeof Fe=="string"&&Ot(j,Ce,Fe)}},Pt=function(j,J,me){if(!me)try{me=J.getAttributeNode(j)}catch{me=null}ka(t.removed,{attribute:me||null,from:J});try{me?J.removeAttributeNode(me):J.removeAttribute(j)}catch{try{J.removeAttribute(j)}catch{}}if(j==="is")if(Je||vt)try{$t(J)}catch{}else try{J.setAttribute(j,"")}catch{}},kn=function(j){const J=B(j);if(J)for(let me=J.length-1;me>=0;--me){const ae=J[me],Ce=ae&&ae.name;typeof Ce!="string"||W[Le(Ce)]||Ot(j,ae,Ce)}},Jt=function(j){const J=[j];for(;J.length>0;){const me=J.pop();E(me)===hn.element&&kn(me);const Ce=f(me);if(Ce)for(let Fe=Ce.length-1;Fe>=0;--Fe)J.push(Ce[Fe])}},St=function(j,J){return ke?j==="patchsrc"?!0:j==="for"&&J!=="label"&&J!=="output":!1},Rt=function(j){if(!ke)return;const J=[j];for(;J.length>0;){const me=J.pop(),ae=E(me);if(ae===hn.processingInstruction||ae===hn.comment&&Gt(gl,me.data)){try{y(me)}catch{}continue}if(ae===hn.element){const Fe=me,lt=Le(w(me));try{Fe.hasAttribute&&Fe.hasAttribute("patchsrc")&&Fe.removeAttribute("patchsrc"),Fe.hasAttribute&&Fe.hasAttribute("for")&&St("for",lt)&&Fe.removeAttribute("for")}catch{}}const Ce=f(me);if(Ce)for(let Fe=Ce.length-1;Fe>=0;--Fe)J.push(Ce[Fe])}},Wt=function(j){let J=null,me=null;if(Qe)j="<remove></remove>"+j;else{const Fe=il(j,/^[\r\n\t ]+/);me=Fe&&Fe[0]}yt==="application/xhtml+xml"&&it===gt&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const ae=D?M(j):j;if(it===gt)try{J=new h().parseFromString(ae,yt)}catch{}if(!J||!J.documentElement){J=Z.createDocument(it,"template",null);try{J.documentElement.innerHTML=ut?N:ae}catch{}}const Ce=J.body||J.documentElement;return j&&me&&Ce.insertBefore(a.createTextNode(me),Ce.childNodes[0]||null),it===gt?T.call(J,Ee?"html":"body")[0]:Ee?J.documentElement:Ce},Kt=function(j){const J=x?x(j):j.ownerDocument;return F.call(J||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},fn=function(j){return j=Na(j,U," "),j=Na(j,S," "),j=Na(j,I," "),j},Ut=function(j){var J;j.normalize();const me=x?x(j):j.ownerDocument,ae=F.call(me||j,j,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ce=ae.nextNode();for(;Ce;)Ce.data=fn(Ce.data),Ce=ae.nextNode();const Fe=(J=j.querySelectorAll)===null||J===void 0?void 0:J.call(j,"template");Fe&&Gn(Fe,lt=>{cn(lt.content)&&Ut(lt.content)})},Qt=function(j){const J=A?A(j):null;return typeof J!="string"||Le(J)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==B(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==v(j)||j.childNodes!==f(j)},cn=function(j){if(!v||typeof j!="object"||j===null)return!1;try{return v(j)===hn.documentFragment}catch{return!1}},bn=function(j){if(!v||typeof j!="object"||j===null)return!1;try{return typeof v(j)=="number"}catch{return!1}};function Ht(ge,j,J){ge.length!==0&&Gn(ge,me=>{me.call(t,j,J,at)})}const An=function(j,J){return!!(ke&&j.hasChildNodes()&&!bn(j.firstElementChild)&&Gt(bl,j.textContent)&&Gt(bl,j.innerHTML)||ke&&j.namespaceURI===gt&&D1[J]&&(bn(j.firstElementChild)||typeof j.textContent=="string"&&Gt(S1[J],j.textContent))||j.nodeType===hn.processingInstruction||ke&&j.nodeType===hn.comment&&Gt(gl,j.data))},pe=function(j,J){if(j instanceof RegExp)return Gt(j,J);if(j instanceof Function){for(var me=arguments.length,ae=new Array(me>2?me-2:0),Ce=2;Ce<me;Ce++)ae[Ce-2]=arguments[Ce];return!!j(J,...ae)}return!1},De=function(j,J,me){if(!Te[J]&&Ae(J)&&pe(ie.tagNameCheck,J))return!1;if(qe&&!Et[J]){const ae=_(j),Ce=f(j);if(Ce&&ae){const Fe=Ce.length;for(let lt=Fe-1;lt>=0;--lt){const ht=j===me?g(Ce[lt],!0):Ce[lt];ae.insertBefore(ht,C(j))}}}return $t(j),!0},Re=function(j,J,me,ae){return j.length===0?J:J===me||J===ae?pn(J):J},Ge=function(j,J){return j===J||_(j)!==null?!1:(pt&&Jt(j),!0)},ze=function(j,J){if(Ht(Y.beforeSanitizeElements,j,null),Ge(j,J))return!0;if(Qt(j))return $t(j),!0;const me=Le(w(j));if(V=Re(Y.uponSanitizeElement,V,ne,He),Ht(Y.uponSanitizeElement,j,{tagName:me,allowedTags:V}),Ge(j,J))return!0;if(An(j,me))return $t(j),!0;if(Te[me]||!(he.tagCheck instanceof Function&&he.tagCheck(me))&&!V[me]){const Ce=De(j,me,J);return Ce===!1&&Ht(Y.afterSanitizeElements,j,null),Ce}if(E(j)===hn.element&&!ln(j)||(me==="noscript"||me==="noembed"||me==="noframes")&&Gt(N1,j.innerHTML))return $t(j),!0;if(xe&&j.nodeType===hn.text){const Ce=fn(j.textContent);j.textContent!==Ce&&(ka(t.removed,{element:j.cloneNode()}),j.textContent=Ce)}return Ht(Y.afterSanitizeElements,j,null),!1},X=function(j,J,me){if(ye[J]||St(J,j)||Ye&&(J==="id"||J==="name")&&(me in a||me in oe))return!1;const ae=W[J]||he.attributeCheck instanceof Function&&he.attributeCheck(J,j);return $e&&Gt(O,J)||Se&&Gt(z,J)?!0:ae?kt[J]||Gt(ee,Na(me,te,""))||(J==="src"||J==="xlink:href"||J==="href")&&j!=="script"&&ul(me,"data:")===0&&st[j]||Ne&&!Gt(se,Na(me,te,""))?!0:!me:Ae(j)&&pe(ie.tagNameCheck,j)&&pe(ie.attributeNameCheck,J,j)||J==="is"&&ie.allowCustomizedBuiltInElements&&pe(ie.tagNameCheck,me)},ce=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ae=function(j){return!ce[Aa(j)]&&Gt(de,j)},Ve=function(j,J,me,ae){if(D&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!me)switch(p.getAttributeType(j,J)){case"TrustedHTML":return M(ae);case"TrustedScriptURL":return P(ae)}return ae},Ke=function(j,J,me,ae){try{me?j.setAttributeNS(me,J,ae):j.setAttribute(J,ae),Qt(j)?$t(j):ll(t.removed)}catch{Pt(J,j)}},Ze=function(j){Ht(Y.beforeSanitizeAttributes,j,null);const J=j.attributes;if(!J||Qt(j))return;W=Re(Y.uponSanitizeAttribute,W,H,ot);const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let ae=J.length;const Ce=Le(j.nodeName);for(;ae--;){const Fe=J[ae],lt=Fe.name,ht=Fe.namespaceURI,en=Fe.value,tn=Le(lt),Fr=en;let Yt=lt==="value"?Fr:u1(Fr);if(me.attrName=tn,me.attrValue=Yt,me.keepAttr=!0,me.forceKeepAttr=void 0,Ht(Y.uponSanitizeAttribute,j,me),Yt=me.attrValue,we&&(tn==="id"||tn==="name")&&ul(Yt,Ue)!==0&&(Pt(lt,j,Fe),Yt=Ue+Yt),ke&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Yt)){Pt(lt,j,Fe);continue}if(tn==="attributename"&&il(Yt,"href")){Pt(lt,j,Fe);continue}if(!me.forceKeepAttr){if(!me.keepAttr){Pt(lt,j,Fe);continue}if(!ue&&Gt(E1,Yt)){Pt(lt,j,Fe);continue}if(xe&&(Yt=fn(Yt)),!X(Ce,tn,Yt)){Pt(lt,j,Fe);continue}Yt=Ve(Ce,tn,ht,Yt),Yt!==Fr&&Ke(j,lt,ht,Yt)}}Ht(Y.afterSanitizeAttributes,j,null)},ft=function(j){let J=null;const me=Kt(j);for(Ht(Y.beforeSanitizeShadowDOM,j,null);J=me.nextNode();)if(Ht(Y.uponSanitizeShadowNode,J,null),ze(J,j),Ze(J),cn(J.content)&&ft(J.content),E(J)===hn.element){const ae=b(J);cn(ae)&&(bt(ae),ft(ae))}Ht(Y.afterSanitizeShadowDOM,j,null)},bt=function(j){const J=[{node:j,shadow:null}];for(;J.length>0;){const me=J.pop();if(me.shadow){ft(me.shadow);continue}const ae=me.node,Fe=E(ae)===hn.element,lt=f(ae);if(lt)for(let ht=lt.length-1;ht>=0;--ht)J.push({node:lt[ht],shadow:null});if(Fe){const ht=A?A(ae):null;if(typeof ht=="string"&&Le(ht)==="template"){const en=ae.content;cn(en)&&J.push({node:en,shadow:null})}}if(Fe){const ht=b(ae);cn(ht)&&J.push({node:null,shadow:ht},{node:ht,shadow:null})}}};return t.sanitize=function(ge){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,me=null,ae=null,Ce=null;if(ut=!ge,ut&&(ge="<!-->"),typeof ge!="string"&&!bn(ge)&&(ge=m1(ge),typeof ge!="string"))throw Kn("dirty is not a string, aborting");if(!t.isSupported)return ge;We?(V=He,W=ot):Ie(j),(Y.uponSanitizeElement.length>0||Y.uponSanitizeAttribute.length>0)&&(V=pn(V)),Y.uponSanitizeAttribute.length>0&&(W=pn(W)),t.removed=[];const Fe=pt&&typeof ge!="string"&&bn(ge);if(Fe){Rt(ge);const en=w(ge);if(typeof en=="string"){const tn=Le(en);if(!V[tn]||Te[tn])throw un(ge),Kn("root node is forbidden and cannot be sanitized in-place")}if(Qt(ge))throw un(ge),Kn("root node is clobbered and cannot be sanitized in-place");try{bt(ge)}catch(tn){throw un(ge),tn}}else if(bn(ge))J=Wt("<!---->"),me=J.ownerDocument.importNode(ge,!0),me.nodeType===hn.element&&me.nodeName==="BODY"||me.nodeName==="HTML"?J=me:J.appendChild(me),bt(me);else{if(!Je&&!xe&&!Ee&&ge.indexOf("<")===-1)return D&&je?M(ge):ge;if(J=Wt(ge),!J)return Je?null:je?N:""}J&&Qe&&$t(J.firstChild);const lt=Fe?ge:J;try{const en=Kt(lt);for(;ae=en.nextNode();)ze(ae,lt),Ze(ae),cn(ae.content)&&ft(ae.content)}catch(en){throw Fe&&(un(ge),Gn(t.removed,tn=>{tn.element&&Jt(tn.element)})),en}if(Fe)return Gn(t.removed,en=>{en.element&&Jt(en.element)}),xe&&Ut(ge),ge;if(Je){if(xe&&Ut(J),vt)for(Ce=K.call(J.ownerDocument);J.firstChild;)Ce.appendChild(J.firstChild);else Ce=J;return(W.shadowroot||W.shadowrootmode)&&(Ce=q.call(r,Ce,!0)),Ce}let ht=Ee?J.outerHTML:J.innerHTML;return Ee&&V["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&Gt(k1,J.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
|
|
798
|
+
`+ht),xe&&(ht=fn(ht)),D&&je?M(ht):ht},t.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(ge),We=!0,He=V,ot=W},t.clearConfig=function(){at=null,We=!1,He=null,ot=null,D=k,N=""},t.isValidAttribute=function(ge,j,J){at||Ie({});const me=Le(ge),ae=Le(j);return X(me,ae,J)},t.addHook=function(ge,j){typeof j=="function"&&nn(Y,ge)&&ka(Y[ge],j)},t.removeHook=function(ge,j){if(nn(Y,ge)){if(j!==void 0){const J=l1(Y[ge],j);return J===-1?void 0:i1(Y[ge],J,1)[0]}return ll(Y[ge])}},t.removeHooks=function(ge){nn(Y,ge)&&(Y[ge]=[])},t.removeAllHooks=function(){Y=vl()},t}var ia=_l();let Xr=null;const M1=1500;function Jr(){Xr?.clear(),Xr=null}function L1(e,{onEnd:t,rate:a=.9}={}){if(typeof window>"u"||typeof SpeechSynthesisUtterance>"u"||!("speechSynthesis"in window)){t?.();return}const r=window.speechSynthesis;Jr();let s=!1;const l=()=>{if(!s){s=!0;try{t?.()}catch{}}};try{r.cancel()}catch{l();return}const i=()=>{Jr();try{r.cancel();const d=new SpeechSynthesisUtterance(e),h=r.getVoices().find(p=>p.lang.startsWith("ko"));h&&(d.voice=h),d.rate=a,d.onend=t?l:null,d.onerror=t?l:null,r.speak(d)}catch{l()}};let u;try{u=r.getVoices()}catch{l();return}if(u.length>0){i();return}const c=setTimeout(i,M1);try{r.addEventListener("voiceschanged",i,{once:!0})}catch{clearTimeout(c),l();return}Xr={clear:()=>{clearTimeout(c),r.removeEventListener("voiceschanged",i)}}}function Qr(){Jr(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()}const $1=/^(?:[a-z]+:)?\/\//i,R1="__ihab_core_asset_base_url__";function P1(){return globalThis[R1]??""}function eo(e){const t=String(e||"").trim();if(!t)return"";if($1.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const a=t.startsWith("/")?t:`/${t}`,r=P1();return r?`${r}${a}`:a}const xl="__ihab_core_storage_resolvers__";function Da(){return globalThis[xl]??null}function I1(e){globalThis[xl]=e}let wl=class extends Error{constructor(t){super(`
|
|
799
799
|
[ihabdevteam-core] ${t}() \uD638\uCD9C \uC2E4\uD328 \u2014 configureStorage()\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
|
|
800
800
|
|
|
801
801
|
\uC571 \uCD08\uAE30\uD654 \uC2DC\uC810(main.tsx \uB4F1)\uC5D0 \uC544\uB798\uC640 \uAC19\uC774 \uD55C \uBC88 \uD638\uCD9C\uD558\uC138\uC694:
|
|
@@ -819,15 +819,15 @@ 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}}"},Ib={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"},Fb={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:Ib,table:Fb,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",removeWord:"Remove word"},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"},Ig={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"}},Fg={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:Ig,progress:Fg,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.393.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(_e.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 nt(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=JC(g),{iconToUse:C,mode:f,svgText:_,blobUrl:b}=cy(g),B=(w,D={})=>n.jsx("span",{className:d,style:u,...D,children:w}),v=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,N=(w,D={})=>n.jsx("img",{src:w,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 B(t);if(t==="none")return B(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 B(o.createElement(y,{className:m,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(f==="mask"){const w={"--icon-url":b?`url(${b})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return B(n.jsx("span",{className:p,style:w}),{"aria-hidden":"true"})}return f==="img"?B(N(C,{onError:w=>{w.currentTarget.onerror=null,w.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):f==="inline"?B(n.jsx("span",{className:m,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):B(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return N(eo(t),{style:u,onError:w=>{w.currentTarget.onerror=null,w.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 B(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:Be("empty-state",s),children:[e&&n.jsx(nt,{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(nt,{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}=_e.useTranslation(),{pending:u,press:c}=ni(r);return n.jsxs("div",{className:Be("empty-state","error-state",l),role:"alert",children:[n.jsx(nt,{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(nt,{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:Be("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(nt,{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(nt,{icon:"arrow-right",size:18})})]})]})})}function my({as:e="div",className:t="",children:a,storage:r,...s}){r&&F1({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=Be("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}=_e.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}=_e.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 gn(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 gn(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 le(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 xn(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}),[B,v]=o.useState(!1),[N,x]=o.useState("bottom"),[E,w]=o.useState(!1),[D,A]=o.useState(!1),k=!t&&!a,R=o.useRef(null),$=o.useCallback((T=!1,q=!1)=>{if(D&&m)return;const Y=a?a.getBoundingClientRect():t,U=q&&R.current?R.current:Y;if(!U||!f.current)return;const S=f.current,{offsetWidth:I,offsetHeight:O}=S,z=window.innerWidth,se=window.innerHeight,te=z-U.right,de=U.left,ee=U.top,V=se-U.bottom;let ne=0,W=0,H="top";if(ee>=O+r)H="top",W=U.top-r-O,ne=U.left+U.width/2-I/2;else if(V>=O+r)H="bottom",W=U.bottom+r,ne=U.left+U.width/2-I/2;else if(te>=I+r)H="right",ne=U.right+r,W=U.top+U.height/2-O/2;else if(de>=I+r)H="left",ne=U.left-r-I,W=U.top+U.height/2-O/2;else{const he=Math.max(ee,V,te,de);he===ee?(H="top",W=U.top-r-O,ne=U.left+U.width/2-I/2):he===V?(H="bottom",W=U.bottom+r,ne=U.left+U.width/2-I/2):he===te?(H="right",ne=U.right+r,W=U.top+U.height/2-O/2):(H="left",ne=U.left-r-I,W=U.top+U.height/2-O/2)}const ie=Number.isFinite(Number(s))?Number(s):8;ne=Math.min(Math.max(ne,ie),z-I-ie),W=Math.min(Math.max(W,ie),se-O-ie);const Te=Math.round(ne),ye=Math.round(W);T&&f.current?(f.current.style.left=`${Te}px`,f.current.style.top=`${ye}px`,f.current.dataset.placement=H):(x(H||N),b({position:"fixed",left:Te,top:ye}),w(!0))},[D,m,a,t,r,s,N]);o.useEffect(()=>()=>{R.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)"}),w(!0);return}R.current===null&&(R.current=a?a.getBoundingClientRect():t??null),$(!1,!0);const T=requestAnimationFrame(()=>$(!1,!0));return()=>cancelAnimationFrame(T)},[t,a,r,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m||!f.current||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>{t&&$()});return T.observe(f.current),()=>T.disconnect()},[t,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m)return;let T=null;const q=()=>{if(a&&(R.current=a.getBoundingClientRect()),typeof requestAnimationFrame>"u"){$(!0);return}T===null&&(T=requestAnimationFrame(()=>{T=null,$(!0)}))},Y=U=>{if(!a&&l){const S=U.target;if(S&&f.current&&f.current.contains(S))return;try{if(S&&S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}Q.current(!0);return}q()};return window.addEventListener("resize",q),document.addEventListener("scroll",Y,{passive:!0,capture:!0}),()=>{T!==null&&cancelAnimationFrame(T),window.removeEventListener("resize",q),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 T=window.matchMedia("(max-width: 768px)"),q=()=>A(!!T.matches);q();try{T.addEventListener?T.addEventListener("change",q):T.addListener(q)}catch{try{T.addListener(q)}catch{}}return()=>{try{T.removeEventListener?T.removeEventListener("change",q):T.removeListener(q)}catch{}}},[]);const G=o.useRef(!1),M=o.useRef(null),P=yo(),L=o.useCallback((T=!1)=>{if(l&&!(B||G.current)){if(G.current=!0,T){v(!0);try{l&&l()}catch{G.current=!1,v(!1)}return}v(!0),M.current=setTimeout(()=>{M.current=null;try{l&&l()}catch{G.current=!1,v(!1)}},P?0:200)}},[B,l,v,P]);o.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),o.useEffect(()=>{if(k)return;const T=U=>{const S=f.current;if(!S)return;const I=U.target;if(I&&!S.contains(I)){try{if(I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}i&&L(!0)}},q=U=>{const S=f.current;if(!S)return;const I=U.target;if(I&&!S.contains(I)){try{if(I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}i&&L(!0)}},Y=U=>{if(U.key==="Tab"){const S=f.current;if(!S)return;const I=S.querySelectorAll(Nn);if(!I||I.length===0)return;const O=I[0],z=I[I.length-1],se=document.activeElement;U.shiftKey?se===O&&(U.preventDefault(),z.focus()):se===z&&(U.preventDefault(),O.focus())}};return document.addEventListener("pointerdown",T,!0),document.addEventListener("click",q,!0),document.addEventListener("keydown",Y),()=>{document.removeEventListener("pointerdown",T,!0),document.removeEventListener("click",q,!0),document.removeEventListener("keydown",Y)}},[l,i,L,k]);const Q=o.useRef(L);o.useEffect(()=>{Q.current=L});const Z=!!l;o.useEffect(()=>{if(!(k||!Z))return Zn(()=>Q.current())},[k,Z]),o.useEffect(()=>{const T=()=>{L(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",T),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",T)}},[L]);const F=o.useRef(null);o.useEffect(()=>{if(k||C===!1||!E)return;const T=f.current;if(!T)return;const q=T.querySelector(Nn);if(q)return F.current=document.activeElement,q.focus({preventScroll:!0}),()=>{const Y=F.current;F.current=null,Y&&document.contains(Y)&&Y.focus({preventScroll:!0})}},[k,C,E]),o.useEffect(()=>{c==="dialog"&&!d&&wt("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:le(`tooltip__content ${k?"tooltip__content--inline":""} ${g?"tooltip__content--bordered":""} ${B?"is-closing":""} ${u} ${D&&m?"is-mobile":""}`),role:c,"aria-label":d||void 0,style:k?{}:{..._,visibility:E?"visible":"hidden"},tabIndex:-1,"data-placement":N,"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:le("tooltip__header h5"),children:y}),h]});if(k||typeof document>"u")return K;if(p||D&&m){const T=n.jsxs("div",{className:le("tooltip__portal"),children:[n.jsx("div",{className:le("tooltip__backdrop"),onClick:()=>{i&&L(!0)}}),K]});return dn.createPortal(T,document.body)}return dn.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(xn,{anchorRect:t,offset:r,onClose:s,closeOnOutsideClick:!1,className:le(`info-tooltip ${l}`),ariaLabel:i||a,children:n.jsx("div",{className:le("info-tooltip__content body-3"),children:a})}):null}function Xn(e){const{t}=_e.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(xn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:le("description-tooltip"),ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:le("description-tooltip__box"),children:[r&&n.jsx("span",{className:le("description-tooltip__title body-2"),children:r}),n.jsx("ol",{className:le("description-tooltip__items"),children:h.map((p,m)=>n.jsxs("li",{className:le(`description-tooltip__item body-3${m===l?" description-tooltip__item--active":""}`),children:[i&&h.length>1&&n.jsxs("span",{className:le("description-tooltip__index button-1"),children:[m+1,"."]}),p.color&&n.jsx("span",{className:le("description-tooltip__dot"),style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},m))})]})})}function Ia(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=Ia(e),i=Ia(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:B=!1,ariaExpanded:v,ariaControls:N,disabled:x=!1,loading:E=!1,useLabel:w=!0,useBorder:D=!0,useBG:A=!0,useDisabledCovered:k=!1,useDisabledInvisible:R=!1,useDisabledFilled:$=!1,width:G,minWidth:M,onClick:P,onDisabledClick:L,showTooltipInfo:Q=!1,tooltipInfoText:Z=null,tooltipDescription:F=null,tooltipOnly:K=!1,iconSize:T="medium",iconColor:q,shape:Y="rounded",color:U,className:S,...I}=e,O=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),z=O.match(/^\d+$/)?`button${O}`:`button-${O}`,se=Number(a),te=!isNaN(se)&&se<40?"button-2":"button-1",de=h??g,ee=x||!!I.disabled,V=ee?k?"disabled-covered":R?"disabled-invisibled":$?"disabled-filled":"disabled":C,ne=V?`button--variant-${V}`:"",W=f?`button--align-${f}`:"",H=_?"button--nowrap":"",ie=Y?`button--shape-${Y}`:"",Te=typeof q=="string"&&q.startsWith("--")?`var(${q})`:q,ye={...G?{width:typeof G=="number"?`${G}px`:G}:{},...M?{minWidth:typeof M=="number"?`${M}px`:M}:{},...D?{}:{"--button-border":ee?"0":"1px solid transparent"},...Te?{"--button-icon-color":Te}:{},...U?{"--color-main":U}:{}},he=w===!1?"":de,Se=Array.isArray(he)?he.length>0:!!he,$e=!!d,Ne=r??(Se||c||$e?"bar":"dot"),ue=`${z}--${Ne}`,xe=o.useRef(null);o.useEffect(()=>{!On||s!==void 0||xe.current?.closest("form")&&wt(`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 ke=o.useRef(t);ke.current=t;const Ee=o.useCallback(Le=>{xe.current=Le;const at=ke.current;typeof at=="function"?at(Le):at&&(at.current=Le)},[]),We=o.useRef(ee),[He,ot]=o.useState(!!b),[Qe,Je]=o.useState(!1),[vt,je]=o.useState(null),Ye=o.useCallback(()=>Je(!1),[]),[we,Ue]=o.useState(!1),qe=o.useId();o.useEffect(()=>{typeof b=="boolean"&&ot(b)},[b]),o.useEffect(()=>{if(We.current&&!ee&&xe.current){const Le=xe.current;let at=!1;try{at=Le.matches(":focus:not(:focus-visible)")}catch{at=!1}at&&Le.blur(),Le.style.pointerEvents="none";const oe=requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe.current&&(xe.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(oe)}We.current=ee},[ee]);const pt=typeof b=="boolean"?!!b:He,_t=typeof v=="boolean"?void 0:B||typeof b=="boolean"?pt?"true":"false":I["aria-pressed"],Et=Be("button",z,ue,ne,W,H,ie,pt?"is-selected":null,A?null:"button--no-bg",K?"button--tooltip-only":null,S),Bt=`button__icon button__icon--${T}`,st=Array.isArray(m)?m:m!==void 0?[m]:[],tt=()=>{if(Array.isArray(he))return he.map((at,oe)=>{const be=st[oe];return n.jsxs("span",{className:`button__label-text${be!==void 0?" button__label-text--has-sub":""}`,children:[at,be!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:be})]},oe)});const Le=m!==void 0;return n.jsxs("span",{className:`button__label-text${Le?" button__label-text--has-sub":""}`,children:[he,p!=null&&n.jsx("span",{className:"button__count",children:p}),Le&&n.jsx("span",{className:"button__sub-label-text caption-1",children:m})]})},kt=Le=>{typeof b!="boolean"&&!B&&ot(!1),Le.currentTarget.blur()},At=Le=>{ee||(typeof I.onMouseLeave=="function"&&I.onMouseLeave(Le),kt(Le))},jt=Le=>{if(K&&it&&ut.touchPress(Le.currentTarget),ee){it&&ut.touchPress(Le.currentTarget),Le.preventDefault(),L?.(Le);return}typeof b!="boolean"&&B&&ot(at=>!at),P?.(Le)},Mt=o.useCallback(()=>{(Q||F)&&(Je(!0),je(xe.current?.getBoundingClientRect()??null))},[Q,F]),gt=o.useCallback(()=>{(Q||F)&&(Je(!1),je(null))},[Q,F]),it=!!(Q||F),ut=_o(Qe,Le=>{Le?Mt():gt()},xe,{enabled:it&&(ee||K),fallbackOnParent:it&&ee}),ct={...I};delete ct.disabled,delete ct.className,delete ct.faded,delete ct.useFaded,delete ct.loading,delete ct.onMouseLeave,delete ct.onPointerEnter,delete ct.onPointerLeave,delete ct.onPointerUp,delete ct.onFocus,delete ct.onBlur,ee&&(Object.keys(ct).forEach(Le=>{/^on[A-Z]/.test(Le)&&typeof ct[Le]=="function"&&delete ct[Le]}),ct["aria-disabled"]="true"),E&&(ct["aria-busy"]="true");const ve=(typeof Q=="string"?Q:null)??(typeof Z=="string"?Z:null)??(typeof y=="string"?y:null)??(typeof de=="string"?de:null)??void 0,Me=typeof y=="string"?y:typeof de=="string"?de:ve,Pe=F?[F.title,...F.items??[]].filter(Boolean).join(". "):Q&&ve&&ve!==Me?ve:"",Oe=[typeof I["aria-describedby"]=="string"?I["aria-describedby"]:void 0,Pe?qe:null].filter(Boolean).join(" ")||void 0,dt=()=>n.jsx("span",{className:`${Bt} button__spinner`,"aria-hidden":"true",children:n.jsx(pa,{variant:"spinner",size:"100%"})}),Dt=(Le,at)=>n.jsx(nt,{icon:Le,label:at??Me,className:Bt,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),yt=Le=>E?dt():Dt(c,Le),xt=()=>Ne==="dot"?n.jsxs(n.Fragment,{children:[yt(),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()})]}):f==="center"&&(c||E)?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:yt()}),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()})]}),$e&&n.jsx("span",{className:"button__right",children:Dt(d)})]}):n.jsxs(n.Fragment,{children:[(c||E)&&n.jsx("span",{className:"button__left",children:yt(y??de)}),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()}),$e&&n.jsx("span",{className:"button__right",children:Dt(d)})]}),Ct=!!l&&!ee;return n.jsxs(n.Fragment,{children:[n.jsxs(Ct?"a":"button",{...ct,ref:Ee,...Ct?{href:l,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:s??"button",disabled:ee&&!L&&!we},className:Et,"aria-pressed":_t,"aria-expanded":typeof v=="boolean"?v:I["aria-expanded"],"aria-controls":N??I["aria-controls"],"aria-label":Me,"aria-disabled":ee&&(Ct||L||we)?!0:void 0,"aria-describedby":Oe,style:ye,onClick:jt,onMouseLeave:At,onPointerEnter:Le=>{ma(Le)||Mt(),!ee&&typeof I.onPointerEnter=="function"&&I.onPointerEnter(Le)},onPointerLeave:Le=>{ma(Le)||gt(),!ee&&typeof I.onPointerLeave=="function"&&I.onPointerLeave(Le)},onPointerUp:Le=>{ee&&it&&ut.touchPress(Le.currentTarget),!ee&&typeof I.onPointerUp=="function"&&I.onPointerUp(Le)},onFocus:Le=>{Ue(!0),Ca()||Mt(),!ee&&typeof I.onFocus=="function"&&I.onFocus(Le)},onBlur:Le=>{Ue(!1),ee||kt(Le),gt(),!ee&&typeof I.onBlur=="function"&&I.onBlur(Le)},children:[xt(),Pe?n.jsx("span",{id:qe,hidden:!0,"aria-label":Pe}):null]}),Qe&&F?n.jsx(Xn,{anchorRect:vt,title:F.title,items:F.items,onClose:Ye}):Qe&&ve?n.jsx(Tn,{anchorRect:vt,text:ve,onClose:Ye}):null]})}const fe=o.forwardRef(ky);fe.displayName="Button";function Tt(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 Fa={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(Fa.title,t.title),e.style.setProperty(Fa.description,t.description),xo.set(e,t))}function Xt(e){e&&(e.style.removeProperty(Fa.title),e.style.removeProperty(Fa.description),xo.delete(e))}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function di(){const e=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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")],Ii={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 Fi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:s=.1,lineHeightRatio:l=1.4}={}){const i=B=>Math.max(a,Math.min(r,Number(B))),u=B=>{try{const v=localStorage.getItem(B),N=v?Number(v):1;return Number.isFinite(N)?i(N):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=B=>{d(typeof B=="function"?v=>i(B(v)):i(B))},g=()=>m(B=>+(B+s).toFixed(6)),y=()=>m(B=>+(B-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=Ia(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 mn(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=mn(h,p);if(m!==0)return m}return i.length!==u.length?i.length-u.length:mn(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}=_e.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 wn="\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 Iy(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 Fy=(e,{defaultValue:t})=>t,Vi=(e,t)=>({jamos:e,phonetic:t,tooltip:Iy(Fy,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=Ia(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 w=E.target;r&&w.closest?.(r)||c.current?.contains(w)||d.current?.contains(w)||l(!1)};document.addEventListener("mousedown",f),document.addEventListener("pointerdown",f);let _=null;const b=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},B=E=>{d.current?.contains(E.target)||(t==="reposition"?b():t==="close"&&l(!1))};t!=="ignore"&&window.addEventListener("scroll",B,!0);const v=()=>{a==="reposition"?b():a==="close"&&l(!1)};let N=null;const x=()=>{v(),N&&clearTimeout(N),N=setTimeout(()=>{N=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",B,!0),a!=="ignore"&&(window.removeEventListener("resize",v),window.removeEventListener("orientationchange",x)),N&&clearTimeout(N)}},[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),[B,v]=o.useState(0),N=o.useRef(0),x=o.useCallback(T=>{N.current=typeof T=="function"?T(N.current):T,v(N.current)},[]),E=o.useRef(r),w=o.useRef(s);o.useEffect(()=>{E.current=r,w.current=s},[r,s]);const D=o.useRef([]),A=()=>{D.current.forEach(clearTimeout),D.current=[]},k=(T,q)=>{D.current.push(setTimeout(q,T))};o.useEffect(()=>()=>A(),[]);const R=u[d]?.id??null,$=o.useRef(null),G=o.useCallback(()=>{A(),m("playing"),f([]),b(null),x(0);let T=0;e.forEach((q,Y)=>{k(T,()=>{h(Y),y(q.id),E.current?.(q)}),k(T+1e3,()=>{y(null),f(U=>[...U,q.id])}),T+=1300}),k(T,()=>{m("done"),w.current?.({score:0,total:e.length})})},[e,x]),M=o.useCallback((T,q)=>{if(q>=T.length){m("done"),w.current?.({score:N.current,total:T.length});return}$.current=null,h(q),b(null),m("playing"),y(T[q].id),E.current?.(T[q]),k(l,()=>{y(null),m("waiting")})},[l]),P=o.useCallback(()=>{A();const T=$a(e);c(T),x(0),f([]),M(T,0)},[e,M,x]),L=o.useCallback(()=>{t==="playback"?(c(e),G()):P()},[t,e,G,P]),Q=o.useCallback(()=>{A(),m("idle"),y(null),f([]),b(null),h(0),x(0),c([])},[x]),Z=JSON.stringify(e.map(T=>[T.id,T.label,T.angleDeg,T.deg,T.row,T.shortcut]));o.useEffect(()=>(a?L():Q(),()=>A()),[t,Z,a]);const F=o.useCallback(T=>{p!=="waiting"||t==="playback"||$.current===d||($.current=d,b(T),T===u[d]?.id&&x(q=>q+1),t==="exam"?(m("playing"),k(400,()=>M(u,d+1))):(m("feedback"),k(i,()=>M(u,d+1))))},[p,t,u,d,M,i,x]),K=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:g,playedIds:C,selectedId:_,answerId:R,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:F},index:d,total:K,score:B,phase:p,done:p==="done",start:L,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=gn("(max-width: 767px)"),f=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const B=m.current;if(!B)return;const v=wo(B),N=(x,E,w)=>{if(w!==void 0)B.style.setProperty(E,w),f.current[x]=!0;else if(f.current[x]){const D=v?.[x];D?B.style.setProperty(E,D):B.style.removeProperty(E),f.current[x]=!1}};N("title","--promo-banner-bg-title",c),N("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const B=m.current;if(!B)return;const v=wo(B);y(v?.actionVariant??"main")},[p]);const _=Be("promo-banner",`promo-banner--${i}`,h),b=Ii[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(fe,{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}=_e.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),B=o.useRef(null),v=yo(),N=p||g||C,x=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||N||v)return;const w=window.setInterval(()=>h(D=>(Math.min(D,c-1)+1)%c),t);return()=>window.clearInterval(w)},[c,t,N,v]);const E=w=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>{b.current=null,f(!1)},w)};return o.useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current)},[]),o.useEffect(()=>{if(!C)return;const w=D=>{D.pointerType==="touch"&&(B.current&&B.current.contains(D.target)||(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!1)))};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[C]),c===0?null:n.jsxs("section",{ref:B,className:Be("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:w=>{_.current=w.pointerType},onPointerDown:w=>{_.current=w.pointerType,w.pointerType==="touch"&&(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!0))},onPointerUp:w=>{w.pointerType==="touch"&&E(5e3)},onPointerCancel:w=>{w.pointerType==="touch"&&E(5e3)},onMouseEnter:()=>{_.current!=="touch"&&m(!0)},onMouseLeave:()=>m(!1),onFocus:w=>{let D=!0;try{D=w.target.matches(":focus-visible")}catch{D=!0}y(D)},onBlur:w=>{w.currentTarget.contains(w.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((w,D)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":D!==x,...D!==x?{inert:!0}:{},children:w},D))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[x]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((w,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}=_e.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(nt,{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}=_e.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:Be("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}=_e.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 B=_?.[b.ci]?.items?.[b.ii];if(!B||!Array.isArray(B.children)||!B.children.length)break;_=[{title:null,items:B.children}],f.push({title:B.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 B=m.current?.querySelector("button:not([disabled])");if(B&&B.offsetParent){B.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(B=>[...B.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:le(`menu-tooltip menu-tooltip--${r} ${a}`),children:[(c.length>1||d.title)&&n.jsxs("div",{className:le("menu-tooltip__header"),children:[c.length>1?n.jsx(fe,{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:le("menu-tooltip__title button-1"),children:d.title})]}),n.jsx("div",{className:le("menu-tooltip__columns"),ref:m,children:d.columns&&d.columns.map((f,_)=>n.jsxs("div",{className:le("menu-tooltip__column"),children:[f.title?n.jsx("div",{className:le("menu-tooltip__column-title body-3"),children:f.title}):null,n.jsx("div",{className:le("menu-tooltip__items"),children:(f.items||[]).map((b,B)=>n.jsxs(o.Fragment,{children:[b.separatorBefore&&B>0&&n.jsx("div",{className:le("menu-tooltip__separator"),role:"separator"}),n.jsx(fe,{htmlType:"button",className:le("menu-tooltip__item"),size:l,type:b.label?"bar":"dot",icon:b.selected?"check":b.icon||"none",rightIcon:Array.isArray(b.children)&&b.children.length?"chevron-right":b.badgeCount?n.jsx(En,{position:"inline",number:Math.min(b.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:b.label,ariaLabel:b.label&&b.badgeCount&&b.badgeCount>0?s("nav.badgeLabel",{label:b.label,count:b.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):b.label,onClick:()=>C(b,_,B),selected:b.selected,disabled:b.disabled,showTooltipInfo:b.tooltip||!1,useBorder:!1,align:"left"})]},B))})]},_))})]})}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&&wt("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}=_e.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 T=p.current;if(!T)return;const q=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle(T):null,I=T.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),O=T.querySelector(".bottom-nav__left"),z=O?.nextElementSibling,se=(O?.offsetWidth??0)+(O&&z?.classList.contains("bottom-nav__divider")?z.offsetWidth:0);g(Math.max(0,I-se))};if(q(),typeof ResizeObserver>"u")return;const Y=new ResizeObserver(q);Y.observe(T);const U=T.querySelector(".bottom-nav__left");return U&&Y.observe(U),()=>Y.disconnect()},[s]);const C=jo+1,f=T=>Math.max(0,Math.floor((T+br)/(jo+br))),_=y*(jo+br)-br<=m,b=m<=0||l.length===0&&_?y:Math.min(y,f(m-C)),B=m>0&&b<y,v=B?b:y,N=e.slice(0,v),x=e.slice(v),E=B||l.length>0,w=o.useCallback((T,q)=>({position:"fixed",bottom:window.innerHeight-T.top+8,right:window.innerWidth-T.right,zIndex:za(q)}),[]),D=o.useId(),{open:A,toggle:k,close:R,style:$,triggerRef:G,menuRef:M}=Wa({computeStyle:w,onScroll:"ignore",onResize:"reposition"}),P=o.useCallback((T,q)=>q>0?u("nav.badgeLabel",{label:T,count:q,defaultValue:"{{label}}, {{count}}\uAC1C"}):T,[u]),L=o.useCallback((T,q)=>q>0?u("nav.badgeInsideLabel",{label:T,count:q,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):T,[u]),Q=o.useCallback(()=>s?.(c),[s,c]),Z=o.useMemo(()=>x.find(T=>!!T.key&&T.key===t)??l.find(T=>T.selected||T.key&&T.key===t),[x,t,l]),F=o.useMemo(()=>[{items:[...x.map(T=>({label:T.label,icon:T.icon,badgeCount:T.badgeCount,selected:!!T.key&&T.key===t,closeOnSelect:!0,disabled:T.state==="disabled",onClick:()=>{T.state!=="disabled"&&(T.key&&a&&(a(T.key),So(i,"BottomNav")),R())}})),...l.map(T=>({label:T.label,icon:T.icon,badgeCount:T.badgeCount,selected:T.selected??(!!T.key&&T.key===t),closeOnSelect:!0,onClick:()=>{T.onClick?.(),R()}}))]}],[x,l,t,a,R]),K=[...x,...l].reduce((T,q)=>T+Yi(q.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(fe,{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:N.map((T,q)=>{const Y=Yi(T.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:T.icon,ariaLabel:P(T.label,Y),selected:!!T.key&&T.key===t,disabled:T.state==="disabled",className:"bottom-nav-item",onClick:()=>{T.key&&(a?.(T.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})})]},T.key??`__slot-${q}`)})}),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(fe,{htmlType:"button",size:52,type:"dot",icon:Z?.icon??"ellipsis",ariaLabel:L(Z?.label??u("nav.more","\uB354\uBCF4\uAE30"),K),selected:!!Z,className:"bottom-nav-item",onClick:k,"aria-expanded":A,"aria-controls":A?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})}),A&&dn.createPortal(n.jsx("div",{id:D,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:le("tooltip__content"),style:$,ref:M,children:n.jsx(Ha,{columns:F,onClose:R})}),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}=_e.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(fe,{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(fe,{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(fe,{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(fe,{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(fe,{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(fe,{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}=_e.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(nt,{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(B=>{if(f)return;const v=B.detail>0;if(v)try{B.currentTarget.blur()}catch{}u?.(p,B.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}=_e.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,B]=o.useState(null);o.useEffect(()=>{const w=_.current;if(!w)return;let D=null;const A=()=>{const{scrollHeight:$,clientHeight:G,scrollTop:M}=w;if($<=G+1){B(F=>F===null?F:null);return}const P=Math.max(24,G/$*G),L=G-P,Q=$-G,Z={top:Math.round(M/Q*L),height:Math.round(P)};B(F=>F&&F.top===Z.top&&F.height===Z.height?F:Z)},k=()=>{if(typeof requestAnimationFrame>"u"){A();return}D===null&&(D=requestAnimationFrame(()=>{D=null,A()}))};A(),w.addEventListener("scroll",k,{passive:!0});const R=typeof ResizeObserver<"u"?new ResizeObserver(k):null;R?.observe(w);for(const $ of Array.from(w.children))R?.observe($);return()=>{D!==null&&cancelAnimationFrame(D),w.removeEventListener("scroll",k),R?.disconnect()}},[a]);const v=o.useRef(null),N=o.useCallback(w=>{const D=_.current;D&&(w.preventDefault(),v.current={y:w.clientY,top:D.scrollTop},w.currentTarget.setPointerCapture(w.pointerId))},[]),x=o.useCallback(w=>{const D=_.current,A=v.current;!D||!A||(D.scrollTop=A.top+(w.clientY-A.y)*(D.scrollHeight/D.clientHeight))},[]),E=o.useCallback(w=>{v.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.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:N,onPointerMove:x,onPointerUp:E,onPointerCancel:E})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(w=>!w.section&&(w.key||w.label)).map((w,D)=>n.jsxs(o.Fragment,{children:[w.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Qi,{item:w,active:!!w.key&&w.key===r,state:w.disabled?"disabled":void 0,onClick:(A,k,R)=>{if(w.disabled)return;if(w.href){if(Xi(w.href)&&window.open(w.href,"_blank","noopener,noreferrer"),R)try{k?.blur()}catch{}return}if(s?.(w.key),So(y,"SideNav"),!R)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 M=()=>{$.classList.remove("header--force-collapsed"),$.removeEventListener("mouseenter",M)};$.addEventListener("mouseenter",M)}}}})]},w.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}=_e.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}=_e.useTranslation(),f=gn("(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(M=>M.key===$);if(!G?.disabled){if(G?.href){Xi(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.($)}},[a,t]),B=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)}),[]),N=o.useId(),{open:x,toggle:E,close:w,style:D,triggerRef:A,menuRef:k}=Wa({computeStyle:v,onScroll:"ignore",onResize:"reposition"}),R=o.useMemo(()=>[{items:B.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===e),closeOnSelect:!0,onClick:()=>{$.onClick?.(),w()}}))}],[B,e,w]);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:A,children:[n.jsx(fe,{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?N:void 0}),!!u&&!!l&&l>0&&n.jsx(En,{number:Math.min(l,99),size:24,"aria-hidden":!0}),x&&dn.createPortal(n.jsx("div",{id:N,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:le("tooltip__content"),style:D,ref:k,children:n.jsx(Ha,{columns:R,onClose:w})}),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}=e;(e.icon!==void 0||e.number!==void 0||e.position!==void 0||e.animate!==void 0||e.onClick!==void 0)&&wt("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.");const{label:i,children:u,variant:c="default",fill:d="filled",minWidth:h,iconLeft:p,iconRight:m,color:g}=e,y=t==="bar",C=typeof a=="number"?"medium":a??"medium",f=(y?{small:"caption-2",medium:"body-3",large:"body-2"}:{small:"caption-2b",medium:"body-3b",large:"body-2b"})[C]??(y?"body-2":"body-2b"),_={small:12,medium:14,large:16}[C]??14,b=Be("badge",y?"badge--bar":"",`badge--${c}`,`badge--${C}`,d!=="filled"?`badge--${d}`:"",f,r),B=g?.startsWith("--")?`var(${g})`:g,v=h!==void 0||B?{...h!==void 0?{minWidth:typeof h=="number"?`${h}px`:h}:{},...B?{"--badge-color":B}:{}}:void 0;return n.jsxs("span",{className:b,style:v,"aria-label":l?void 0:s,role:s&&!l?"img":void 0,"aria-hidden":l||void 0,children:[p&&n.jsx(nt,{icon:p,size:_,className:"badge__icon"}),i??u,m&&n.jsx(nt,{icon:m,size:_,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=Tt(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=Tt(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=Tt(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=Tt(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:B,onRefund:v,onDelete:N}){const{t:x}=_e.useTranslation(),E=t?ru(t):void 0,w=s??E?.type??"speechear",D=r??E?.plan??x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),A=C??E?.label,k=f??(a?E?.price:void 0),R=_??(a?E?.originalPrice:void 0),$=b??E?.discountLabel,G=o.useMemo(()=>{if(k)return null;const W=t?.durationDays??d2(t?.code);if(!W||W<=0)return i!=null?{percent:null,remainingLabel:du(i,x)}:null;const H=W*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 Se=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(l)),$e=/^(\d{4})-(\d{2})-(\d{2})/.exec(Pa()),Ne=Math.round(Se&&$e?(Date.UTC(+Se[1],+Se[2]-1,+Se[3])-Date.UTC(+$e[1],+$e[2]-1,+$e[3]))/864e5:(he-Date.now())/864e5);ie=Math.max(0,u?Ne+1:Ne)*86400}else c==="expired"?ie=0:ie=H;const Te=E2(ie),ye=Math.max(0,Math.min(100,Math.floor(Math.min(Te,H)/H*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?x("passCard.expired","\uB9CC\uB8CC\uB428"):du(ie,x)}},[k,c,l,i,u,t?.durationDays,t?.code,x]),M=o.useRef(null),[P,L]=o.useState({}),[Q,Z]=o.useState(null),F=!!(B||v||N),K=o.useRef(!1),T=o.useRef(void 0),[q,Y]=o.useState(y);o.useLayoutEffect(()=>{Y(y)},[y]),o.useLayoutEffect(()=>{const W=M.current;W&&(p!==void 0&&W.style.setProperty("--pass-card-text",p),m!==void 0&&W.style.setProperty("--pass-card-sub",m),g!==void 0&&W.style.setProperty("--pass-card-copyright",g))},[p,m,g]),o.useLayoutEffect(()=>{const W=M.current;if(!W)return;const H=m2(W);if(!y){const ie=N2[w],Te=c==="expired"?"_mono":H?.logoColor??"",ye=k2(ie,Te);Y(ye)}},[d,y,w,c]);const U=W=>{const H=M.current;if(!H)return null;const{left:ie,top:Te,width:ye,height:he}=H.getBoundingClientRect(),Se=(W.clientX-ie)/ye-.5;return{rotateX:-((W.clientY-Te)/he-.5)*cu,rotateY:Se*cu}},S=(W,H)=>{const ie=H*-.7,Te=W*.7+10,ye=20+(Math.abs(W)+Math.abs(H))*.4;return`${ie}px ${Te}px ${ye}px rgba(0, 0, 0, 0.18)`},I=o.useCallback(W=>{if(Ca())return;K.current=!0,clearTimeout(T.current),T.current=setTimeout(()=>{K.current=!1},200);const H=U(W);H&&L({transform:`perspective(800px) rotateX(${H.rotateX}deg) rotateY(${H.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(H.rotateX,H.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)"})},[]),O=o.useCallback(W=>{if(Ca())return;const H=U(W);if(!H)return;const ie=K.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${H.rotateX}deg) rotateY(${H.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(H.rotateX,H.rotateY),transition:ie})},[]),z=o.useCallback(()=>{clearTimeout(T.current),K.current=!1,L({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)"})},[]),se=o.useCallback(()=>Z(null),[]),te=o.useMemo(()=>{const W=x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),H=D.replace("\uC774\uC6A9\uAD8C","").replace(W==="\uC774\uC6A9\uAD8C"?"":W,"").trim(),ie=H.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:H})},[D,x]),de=o.useMemo(()=>{const W=da(k);if(!W)return null;const H=W.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!H)return n.jsx("span",{className:"h1",children:W});const[,ie,Te,ye]=H;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:Te}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[k]),ee=o.useCallback(()=>{F&&Z(W=>{if(W)return null;const H=M.current?.getBoundingClientRect();if(!H)return null;const ie=50;return{left:H.left,right:H.right,width:H.width,height:H.height,x:H.x,y:H.y+ie,top:H.top+ie,bottom:H.bottom+ie}})},[F]),V=o.useCallback(W=>{F&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),ee())},[F,ee]),ne=[{items:[...B?[{label:x("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{B(),Z(null)},closeOnSelect:!0}]:[],...v?[{label:x("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{v(),Z(null)},closeOnSelect:!0}]:[],...N?[{label:x("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{N(),Z(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:M,className:`pass-card pass-card--${c}${F?" pass-card--clickable":""}`,style:P,onMouseEnter:I,onMouseMove:O,onMouseLeave:z,onPointerUp:W=>{W.pointerType==="touch"&&z()},onPointerCancel:W=>{W.pointerType==="touch"&&z()},onClick:ee,onKeyDown:F?V:void 0,role:F?"button":void 0,tabIndex:F?0:void 0,"aria-label":e,"aria-haspopup":F?"menu":void 0,"aria-expanded":F?!!Q:void 0,children:[d??D2(w,D,A),!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:q??A2[w],className:"pass-card__logo",alt:w==="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:A?x("passCard.labeledPlan",{label:A}):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:[R&&n.jsx("span",{className:"pass-card__price-original body-3",children:da(R)}),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(xn,{anchorRect:Q,onClose:se,ariaLabel:x("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:ne,onClose:se,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=Tt(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=Tt(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}=_e.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 N=v.prices?v.prices[i]:v.price;return N?(s.tiers||[]).some(x=>!!x.badge&&x.originals?.[i]===N):!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 N=C(v);return N==="\uBB34\uB8CC"||N===g||N==="0\uC6D0"||typeof N=="string"&&/\d/.test(N)&&!/[1-9]/.test(N)}),_=(s.tiers||[]).length>0&&(s.tiers||[]).every(v=>{const N=C(v);return N==="\uBB38\uC758"||N===y}),b=s.group==="org",B=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,N)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(nt,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},N))})]}),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,N)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(nt,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:m}}),v]},N))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:f?null:_?n.jsx(fe,{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 N=v.label||a,x=d(v),E=x||v.openPromo===!0,w=N.replace(/^오픈\s*특가\s*/,"")||a,D=v.prices?v.prices[i]:v.price,A=v.badge?E?`${r}
|
|
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),R=n.jsx(pu,{showPrice:!0,product:{type:B,code:v.code,name:w,label:k,price:D,originalPrice:v.originals?.[i]??void 0,discountLabel:A},bg:L2(b,s.id)}),$=()=>l?.({...v,productId:s.id,productTitle:s.title,preview:R});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:R},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 I2(){const e=Tt(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 F2(e={}){const t=Tt(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:Be("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:B="top-right",shortcutScale:v,scaleShortcut:N=!1}){const{t:x}=_e.useTranslation(),E=Math.max(0,Math.min(1,a)),w=t/2,D=110/300,A=.18,k=W=>t*(D+(W-1)*A),R=W=>{const H=k(W.row??1),ie=W.angleDeg*Math.PI/180;return{x:w+H*Math.cos(ie),y:w+H*Math.sin(ie)}},$=Math.max(...e.map(W=>W.row??1),1),G=t*.08,M=t*.1,P=t*.24,L=t-2*G,Q=t-M-P,Z=t-P/2,F=o.useMemo(()=>[...new Set(e.map(W=>W.deg))].sort((W,H)=>W-H),[e]),K=F.length,T=Math.max(68,K>1?L/(K-1):0),q=o.useMemo(()=>new Map(F.map((W,H)=>[W,H])),[F]),Y=W=>{const H=q.get(W.deg)??0,ie=w+(H-(K-1)/2)*T,Te=$>1?Math.min(68,Q/($-1)):0,ye=Te*($-1),he=M+(Q-ye)/2,Se=$===1?M+Q*.4:he+($-(W.row??1))*Te;return{x:ie,y:Se}},U=W=>{const H=R(W),ie=Y(W);return{x:qa(H.x,ie.x,E),y:qa(H.y,ie.y,E)}},S={x:w,y:qa(w,Z,E)},I=Math.round(g*1.2),O=Math.round(Math.max(16,Math.min(80,g*.7))),z=[],se=new Map;for(const W of e){const H=W.row??1;se.has(H)||se.set(H,[]),se.get(H).push(W)}for(const[W,H]of se.entries()){if(H.length<2)continue;const ie=[...H].sort((He,ot)=>He.deg-ot.deg),Te=ie.map(He=>U(He)),ye=ie.map(He=>He.deg),he=ye[ye.length-1]-ye[0],Se=he/(ye.length-1),$e=360-he,Ne=ie.length>=3&&Se>0&&$e<=Se*1.5,ue=Math.round(k(W)*1e3)/1e3,xe=(He,ot,Qe,Je)=>{const vt=(ot.angleDeg-He.angleDeg+540)%360-180;if(vt===0)return`L ${Je.x} ${Je.y}`;if(E===0)return`A ${ue} ${ue} 0 0 ${vt>0?1:0} ${Je.x} ${Je.y}`;const je=(He.angleDeg+vt/2)*Math.PI/180,Ye={x:w+ue*Math.cos(je),y:w+ue*Math.sin(je)},we={x:(Qe.x+Je.x)/2,y:(Qe.y+Je.y)/2},Ue={x:qa(Ye.x,we.x,E),y:qa(Ye.y,we.y,E)},qe={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${qe.x} ${qe.y} ${Je.x} ${Je.y}`},ke=Ne?[...ie,ie[0]]:ie,Ee=Ne?[...Te,Te[0]]:Te;let We=`M ${Ee[0].x} ${Ee[0].y}`;for(let He=1;He<Ee.length;He++)We+=" "+xe(ke[He-1],ke[He],Ee[He-1],Ee[He]);z.push({key:`arc-${W}`,d:We})}const te=o.useMemo(()=>new Set(s??[]),[s]),de=W=>({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")})[W],ee=W=>{if(r===W.id)return"active";if(u){if(W.id===i)return"correct";if(W.id===l&&l!==i)return"wrong"}return te.has(W.id)?"played":"idle"},V=W=>r===W.id?"loop":u?W.id===i?"loop":null:c&&W.id===l?"once":null,ne=(W,H)=>{switch(W){case"played":case"correct":return n.jsx(zs,{size:H});case"wrong":return n.jsx(Xs,{size:H});default:return n.jsx(Zs,{size:H})}};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(W=>{const{x:H,y:ie}=U(W);return n.jsx("line",{x1:S.x,y1:S.y,x2:H,y2:ie,stroke:"#dde3ec",strokeWidth:"1"},W.id)}),z.map(W=>n.jsx("path",{d:W.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},W.key))]}),b&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:I,height:I,left:S.x-I/2,top:S.y-I/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:I,height:I,left:S.x,top:S.y},"aria-label":f,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(zr,{size:O,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:I,height:I,left:S.x,top:S.y},children:n.jsx(zr,{size:O,color:"currentColor",strokeWidth:1.5})}),e.map((W,H)=>{const{x:ie,y:Te}=U(W),ye=ee(W),he=V(W),Se={...v!==void 0||N?{"--shortcut-badge-scale":String(v??Math.max(.75,Math.min(3,g/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:ye!=="idle"?10:1},$e=g,Ne=Math.round(Math.max(10,Math.min(56,$e*.38))),ue=Math.round(Math.max(7,Math.min(18,$e*.2))),xe=Math.round(Math.max(10,Math.min(56,$e*.4))),ke=y==="answered"&&(ye==="played"||ye==="correct"||ye==="wrong"),Ee=y===!0||ke,We=!ke;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...Se,left:ie-$e/2,top:Te-$e/2},children:[he&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${ye}`+(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?.(W.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${ye}`,style:{width:$e,height:$e},"aria-label":de(ye)?`${W.label}, ${de(ye)}`:W.label,"aria-pressed":l!=null?W.id===l:void 0,children:[Ee&&ne(ye,Ne),We&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:y===!0?ue:xe},children:H+1})]}),W.shortcut&&n.jsx(Cu,{keys:W.shortcut,anchor:B,className:"sound-compass__speaker-shortcut"})]},W.id)})]})})}function z2({orientation:e="horizontal",label:t,className:a=""}){const r=Be("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}=_e.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=Be("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(nt,{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=Be("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(nt,{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}=_e.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(fe,{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}=_e.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}=_e.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(nt,{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}=_e.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 w=a?E:E.slice(0,1);if(l===void 0){const D=a?[...y,...w]:w;g(D),e?.(D)}else e?.(w)},f=x=>{x.preventDefault(),!r&&p(!0)},_=x=>{x.preventDefault(),p(!1)},b=x=>{x.preventDefault(),p(!1),!r&&C(x.dataTransfer.files)},B=x=>{const E=x.target;try{C(E.files)}finally{E.value=""}},v=()=>{r||d.current?.click()},N=x=>{if(!r&&(i?.(x),l===void 0)){const E=y.filter((w,D)=>D!==x);g(E),i||e?.(E)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:Be("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(nt,{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:B,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:()=>N(E),children:n.jsx(nt,{icon:"x",size:14})})]},`${x.name}-${E}`))})]})}function ev({items:e,className:t=""}){const{t:a}=_e.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(nt,{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}=_e.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(w=>w.dataset.star===String(E))?.focus()},B=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,N=()=>{c||h(null)};return n.jsx("div",{className:`rating rating--${s}${c?" rating--readOnly":""} ${i}`.trim(),ref:_,onKeyDown:B,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):l??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:N,onPointerUp:x=>{x.pointerType==="touch"&&N()},onPointerCancel:x=>{x.pointerType==="touch"&&N()},children:Array.from({length:a},(x,E)=>{const w=E+1,D=Math.max(0,Math.min(1,m-E)),A=D>0&&D<1,k=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(nt,{icon:"star",size:g,className:"rating__star rating__star--empty"}),D>0&&n.jsx("span",{className:`rating__star-fill${A?" rating__star-fill--half":""}`,style:A?{width:`${D*100}%`}:void 0,children:n.jsx(nt,{icon:"star",size:g,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:k},w):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===w,"aria-label":u("rating.starLabel",{n:w}),"data-star":w,tabIndex:w===v?0:-1,onClick:()=>C(w),onMouseEnter:()=>f(w),children:k},w)})})}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}=_e.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(nt,{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}=_e.useTranslation(),d=u==="small",h=Be("category-icon",d?"category-icon--small":""),p=d?16:20,m=o.useRef(null),[g,y]=o.useState(!1),C=o.useMemo(()=>{const w=r&&typeof r=="object"?{...r}:{};return!s&&!l?w:{...w,...s?{color:s,"--t-item-fg":s}:{},...l?{"--t-item-bg":l}:{}}},[r,s,l]),f=a||t,_=i&&!!f,[b,B]=o.useState(null);o.useLayoutEffect(()=>{g&&B(m.current?.getBoundingClientRect()??null)},[g]),o.useEffect(()=>{if(!i&&g)try{y(!1)}catch{}},[i,g]),o.useEffect(()=>{if(!g)return;const w=D=>{const A=m.current;if(!A)return;const k=D.target;k&&!A.contains(k)&&y(!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[g]);const v=o.useCallback(()=>{i&&y(!0)},[i]),N=o.useCallback(()=>{i&&y(!1)},[i]),x=o.useCallback(()=>y(!1),[]),E=o.useCallback(w=>{if(w.key==="Escape"){y(!1);return}(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),y(D=>!D))},[]);return n.jsxs("span",{ref:m,className:Be("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:v,onPointerLeave:N,onFocus:v,onBlur:N,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(nt,{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()===""){wt("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 N=[],x=[];for(const E of C)try{const w=Bl(E,f);if(!w){N.push("");continue}let D=null;try{D=await kl(w)}catch{}if(!D)try{const A=await Al(w);A&&(D=URL.createObjectURL(A),x.push(D))}catch{}N.push(D??"")}catch{N.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:N}))})(),()=>{v=!0}},[C.join(","),f]),o.useEffect(()=>()=>{y.current.forEach(v=>{try{URL.revokeObjectURL(v)}catch{}}),y.current=[]},[]);const B=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 N=null;const x=()=>{d.current=!1,N?.stop()};h.current=x;const E=Ga(x);d.current=!0,r(!0);for(let w=0;w<b.length&&d.current;w++){const D=b[w];if(D&&(l(w),N=Ka(D),c.current=N.el,!await N.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:B}}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:B="square"}=e||{},{t:v}=_e.useTranslation(),[N,x]=o.useState(!1),E=o.useRef(null),[w,D]=o.useState(!1);o.useEffect(()=>{E.current?.matches(":hover")&&D(!0)},[]);const{playing:A,playingIndex:k,previewUrls:R,previewHover:$,setPreviewHover:G,previewBtnRef:M,handlePreview:P}=lv(r,a?.key),L=o.useCallback(()=>{f?f():x(!0)},[f]),Q=o.useCallback(()=>x(!1),[]),Z=o.useCallback(()=>D(!0),[]),F=o.useCallback(()=>D(!1),[]),K=o.useCallback(()=>G(!0),[G]),T=o.useCallback(()=>G(!1),[G]),[q,Y]=o.useState(null);o.useLayoutEffect(()=>{$&&Y(M.current?.getBoundingClientRect()??null)},[$,M]);const[U,S]=o.useState(null);o.useLayoutEffect(()=>{w&&!N&&p&&S(E.current?.getBoundingClientRect()??null)},[w,N,p]);const I=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),L())},[L]),O=r||null,z=o.useMemo(()=>{if(!p)return null;const we=h?(Array.isArray(h)?h:[h]).filter(Boolean):null,Ue=we&&we.length>0?we:iv(O);return Ue&&Ue.length>0?Ue:null},[p,h,O]),se=o.useCallback(we=>{we.stopPropagation(),m?.()},[m]),te=o.useCallback(we=>we.stopPropagation(),[]),de=o.useCallback(we=>{typeof C=="function"&&C(we)},[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 ne=Zl(),W=`${a?.label||""} ${t+1}`,H=O?.title||O?.name||W;let ie=a?.icon,Te,ye="",he="";try{const we=O?.category_0||O?.category_main_code||O?.category_main,Ue=O?.category_1||O?.category_sub_code||O?.category_sub,qe=ne.find(pt=>pt.key===we);qe?.icon&&(ie=qe.icon),!Te&&qe?.color&&(Te={"--t-item-fg":qe.color}),!Te&&O?.iconColor&&(Te={"--t-item-fg":O.iconColor}),ye=qe?v(`topic.${qe.key}`,{defaultValue:qe.label||""}):"";try{const pt=qe?.subs?.find(_t=>_t.key===Ue);he=pt?v(`topic.sub.${pt.key}`,{defaultValue:pt.label||""}):""}catch{}}catch{}const Se=he?`${ye} / ${he}`:ye||a?.label||H,$e=we=>v("training.countQuestions",{n:we,count:we}),Ne=we=>v("training.countSentences",{n:we,count:we});let ue="";try{if(O)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(O.items)&&O.items.length>0?we=O.items.length:Array.isArray(O.sentences)&&O.sentences.length>0?we=O.sentences.length:O.sentences&&(we=1),ue=Ne(we)}else if(a?.key==="SHORT_STORY"){let we=1;Array.isArray(r?.items)?we=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?we=r.raw.items.length:Array.isArray(O?.questions)?we=O.questions.length:Array.isArray(O?.sentences)&&(we=O.sentences.length),ue=$e(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(O.items)&&O.items.length>0){const Ue=O.items.reduce((qe,pt)=>{const _t=pt.questionItems;return Array.isArray(_t)?qe+_t.length:Array.isArray(pt.questions)?qe+pt.questions.length:qe},0);we=Ue>0?Ue:O.items.length}else Array.isArray(O.questions)&&O.questions.length>0?we=O.questions.length:Array.isArray(O.sentences)&&O.sentences.length>0&&(we=O.sentences.length);ue=$e(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(O.items)&&O.items.length>0?we=O.items.length:Array.isArray(O.sentences)&&O.sentences.length>0&&(we=O.sentences.length),ue=Ne(we)}else Array.isArray(O.items)&&(ue=O.items.length>0?$e(O.items.length):"")}catch{}const xe=B==="row",ke=B==="list"||xe,Ee=B==="compact",We=B==="small",He=We&&a?.key?qf().find(we=>we.key===a.key):void 0,ot=He?Xl[He.key]:void 0,Qe=He?ot?v(`trainingType.${ot}.title`,{defaultValue:He.label}):He.label??"":"",Je=y&&a?.label&&a.label!==String(H)?String(a.label):We&&Qe&&Qe!==String(H)?Qe:"",vt=!!Je,je=b!==void 0?b:ue,Ye=[Je,typeof H=="string"?H:"",je].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:E,className:`training-block-button${ke?" training-block-button--list":""}${xe?" training-block-button--row":""}${Ee?" training-block-button--compact":""}${We?" training-block-button--small":""}${ee?" training-block-button--completed":""}${V?" training-block-button--selected":""}${vt&&!We?" training-block-button--withType":""}${We&&!vt?" training-block-button--no-type-label":""}`,onClick:L,onPointerEnter:Z,onPointerLeave:F,role:"button",tabIndex:0,onKeyDown:I,"aria-label":typeof s=="string"?s:Ye||void 0,title:!p&&h&&(Array.isArray(h)?h.filter(Boolean).join(`
|
|
824
|
-
`):h)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[y&&a?.label&&a.label!==String(H)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),We&&Qe&&Qe!==String(H)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:Qe}),n.jsx(bu,{icon:ie,label:H,tooltip:Se,wrapperStyle:Te,iconSize:We||Ee?"small":"medium"}),!g&&(ee||V)&&!(m&&w)&&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${w?" is-hover":""}`,icon:"remove",position:"top-left",size:32,"aria-label":v("common.remove","\uC81C\uAC70"),onClick:se}),n.jsx("div",{className:`training-block-button__title ${Ee?"body-3":We?"body-3b":"h3"}`,children:String(H)}),n.jsxs("div",{className:"training-block-button__description",children:[je?n.jsx("div",{className:`training-block-button__count ${We?"caption-2":"caption-1"}`,children:je}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(nt,{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:We?12:20})})]}),(ke&&!xe||We)&&R.length>0&&n.jsx("div",{ref:M,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:te,onPointerEnter:K,onPointerLeave:T,children:n.jsx(fe,{htmlType:"button",size:We?28:32,type:"dot",icon:A?"pause":"play",variant:We?"transparent-lightGray":"default",useBorder:!1,selected:A,ariaLabel:String(H).trim()?A?v("training.stopFor",{name:H,defaultValue:`${H} \uC815\uC9C0`}):v("training.previewFor",{name:H,defaultValue:`${H} \uBBF8\uB9AC \uB4E3\uAE30`}):A?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:P})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(H).trim()?v("common.moreFor",{name:H}):v("common.more","\uB354\uBCF4\uAE30")})})]}),$&&n.jsx(Tn,{anchorRect:q,text:A?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:T}),w&&!N&&p&&(z?n.jsx(Xn,{anchorRect:U,items:z,activeIndex:k,onClose:F}):O?.subTitle?n.jsx(Tn,{anchorRect:U,text:O.subTitle,offset:8,onClose:F}):null),N&&i&&i({trainingData:O,typeKey:a?.key??"",onClose:Q,onComplete:de,popupTitle:String(H),popupSubTitle:a?.subTitle,depth:l!=null?String(l):void 0,popupIcon:ie,popupIconTooltip:String(Se),popupWrapperStyle:Te})]})}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}=_e.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:le("training-tooltip__box"),children:n.jsx("div",{className:le("training-tooltip__groups"),children:i.flatMap(({key:c,label:d,type:h,data:p},m)=>[m>0?n.jsx("div",{className:le("training-tooltip__divider")},`div-${c}`):null,n.jsxs("div",{className:le("training-tooltip__section"),children:[n.jsx("div",{className:le("training-tooltip__section-header"),children:n.jsx("span",{className:le("training-tooltip__type-label body-3b"),children:d})}),n.jsx("div",{className:le("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(xn,{anchorRect:a,offset:r,onClose:s,closeOnOutsideClick:!1,className:le("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=Be("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)},[]),B=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]),N=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)&&B()},[s,r,B]),o.useEffect(()=>{if(!_)return;const x=w=>w instanceof Element&&(m.current?.contains(w)||!!w.closest(".training-tooltip")),E=w=>{x(w.target)?b():N()};return document.addEventListener("pointerover",E,!0),()=>document.removeEventListener("pointerover",E,!0)},[_,b,N]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:m,className:p,onClick:u?x=>{B(),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"?B():v()},onMouseEnter:c,onMouseLeave:x=>{N(),d?.(x)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(nt,{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:B})]})}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}=_e.useTranslation(),m=o.useId(),g=o.useRef(null),y=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const b=document.activeElement,B=_u(),v=g.current;return bo(v,b),v?.focus(),()=>{B();const N=document.activeElement;(!N||N===document.body||v&&v.contains(N))&&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:dn.createPortal(n.jsx("div",{className:Be("dialog",d),onPointerDown:i?b=>{_.current=b.target===b.currentTarget}:void 0,onMouseDown:b=>{b.target===b.currentTarget&&b.preventDefault()},onClick:i?b=>{const B=_.current;_.current=!1,B&&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:Be("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}=_e.useTranslation(),h=!i&&t.length===0;return n.jsxs("div",{className:Be("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:Be("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:Be("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:Be("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:Be("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:Be("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=Ia(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:Be("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:Be("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 yn(e){const{t}=_e.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();wt(`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 N=Math.max(0,g.findIndex(E=>E.key===r)),x=v==="first"?g[0]:v==="last"?g[g.length-1]:g[(N+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 N=x=>typeof x=="string"||typeof x=="number";if(!(!N(v.label)||v.count==null||v.count===!1||!N(v.count)))return`${v.label}, ${v.count}`},B=g.some(v=>v.key===r)?r:g[0]?.key;return n.jsx("div",{ref:m,onKeyDown:_,className:Be("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(fe,{htmlType:"button",role:"radio","aria-checked":v.key===r,"data-segkey":v.key,tabIndex:v.key===B?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}=_e.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:B="",ariaLabel:v,useTitle:N=!0,inline:x=!1,size:E,layer:w="modal",height:D,fillBody:A=!1,resetScrollKey:k}=e||{},[R,$]=o.useState(!1),G=o.useRef(!1),M=o.useRef(null),P=o.useId(),L=o.useRef(null);o.useEffect(()=>{},[x,a,v,B]),o.useEffect(()=>{k!==void 0&&L.current&&(L.current.scrollTop=0)},[k]);const[Q,Z]=o.useState(!1);o.useEffect(()=>{const V=L.current;if(!V)return;const ne=()=>Z(V.scrollHeight>V.clientHeight+1);if(ne(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(ne);W.observe(V);const H=V.firstElementChild;return H&&W.observe(H),()=>W.disconnect()},[i,k]),o.useEffect(()=>{if(!x)return _u()},[x]);const F=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{if(x)return;const V=F.current,ne=M.current;return bo(ne,V),ne&&!ne.contains(document.activeElement)&&(ne.querySelector(Nn)??ne).focus(),()=>{const W=document.activeElement;(!W||W===document.body||ne&&ne.contains(W))&&go(V)?.focus?.()}},[x]),Co(M,!x);const K=o.useRef(!0),T=yo(),q=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,q.current&&(clearTimeout(q.current),q.current=null)}),[]);const Y=o.useCallback(()=>{!K.current||!G.current||(G.current=!1,$(!1))},[]),U=o.useCallback((V,ne=!1)=>{if(ne&&!K.current||G.current)return;G.current=!0,$(!0);const W=setTimeout(()=>{q.current===W&&(q.current=null);let H;try{H=V?V():void 0}catch{Y();return}H&&typeof H.then=="function"&&H.then(()=>{setTimeout(Y,120)},Y)},T?0:xv);ne&&(q.current=W)},[Y,T]),S=o.useCallback(()=>{f||_&&_()===!1||U(C,!0)},[U,C,f,_]),I=o.useRef(S);o.useEffect(()=>{I.current=S});const O=!x&&!!C;o.useEffect(()=>{if(O)return Zn(()=>I.current())},[O]);const z=O&&b,se=o.useRef(!1),te=V=>{se.current=V.target===V.currentTarget},de=V=>{const ne=se.current;se.current=!1,ne&&V.target===V.currentTarget&&S()},ee=n.jsx("div",{className:`popup ${x?"popup--inline":""} ${w==="belowPagePopup"?"popup--below-page-popup":""} ${R?"popup--closing":""} ${B}`,onPointerDown:z?te:void 0,onClick:z?de:void 0,onMouseDown:x?void 0:V=>{V.target===V.currentTarget&&V.preventDefault()},children:n.jsxs("div",{ref:M,className:`popup-panel${E?` popup-panel--${E}`:""}${D!=null?" popup-panel--has-height":""}${A?" 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&&N&&a?P:void 0,"aria-label":!x&&!(N&&a)?v??(typeof a=="string"?a:void 0):void 0,children:[!N&&(s||C)?n.jsxs("div",{className:"popup-close-float",children:[s,C&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,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:P,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:P,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),l&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(yn,{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(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:f,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]}):null,n.jsx("div",{className:"popup-content",ref:L,tabIndex:Q?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof i=="function"?i({animateThen:U,closeWithAnimation:S}):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:S}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof h=="function"?h({animateThen:U,closeWithAnimation:S}):h})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${y!=="center"?` popup-footer--${y}`:""}`,children:u.map((V,ne)=>n.jsx(fe,{htmlType:"button",size:48,variant:V.variant??"default",label:V.label,disabled:V.disabled,onClick:()=>V.onClick?.({animateThen:U,closeWithAnimation:S})},ne))}):c?n.jsx("div",{className:`popup-footer${y!=="center"?` popup-footer--${y}`:""}${g?` ${g}`:""}`,children:typeof c=="function"?c({animateThen:U,closeWithAnimation:S}):c}):null]})});return x||typeof document>"u"?ee:dn.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 vn({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}=_e.useTranslation(),m=r??p("dropdown.placeholder","\uC120\uD0DD"),g=o.useId(),y=o.useId(),C=o.useRef(null),f=o.useCallback((M,P)=>{const L=window.innerHeight-M.bottom<260&&M.top>260;return{position:"fixed",left:M.left,minWidth:M.width,...L?{bottom:window.innerHeight-M.top+6}:{top:M.bottom+6},zIndex:za(P)}},[]),{open:_,setOpen:b,toggle:B,style:v,triggerRef:N,menuRef:x}=Wa({computeStyle:f}),[E,w]=o.useState(-1),D=o.useCallback(()=>w(-1),[]),A=e.find(M=>M.value===t);o.useEffect(()=>{if(_){const M=e.findIndex(P=>P.value===t);w(M>=0?M:e.length?0:-1),requestAnimationFrame(()=>{const P=x.current;if(!P)return;const L=P.querySelectorAll(".dropdown__option")[M];L&&(P.scrollTop=Math.max(0,L.offsetTop-P.clientHeight/2+L.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&w(M=>{if(M>=0&&M<e.length)return M;const P=e.findIndex(L=>L.value===t);return P>=0?P:e.length?0:-1})},[_,e.length]);const k=o.useCallback(()=>{s||B()},[s,B]),R=o.useCallback(M=>{M.disabled||s||(M.value!==t&&a?.(M.value),b(!1))},[a,b,s,t]);o.useEffect(()=>{s&&b(!1)},[s,b]);const $=o.useCallback(M=>{if(!s){if(!_){(M.key==="Enter"||M.key===" "||M.key==="ArrowDown")&&(M.preventDefault(),b(!0));return}if(M.key==="Escape"){M.preventDefault(),b(!1);return}M.key==="ArrowDown"?(M.preventDefault(),w(P=>{let L=P+1;for(;L<e.length&&e[L].disabled;)L++;return L<e.length?L:P})):M.key==="ArrowUp"?(M.preventDefault(),w(P=>{let L=P-1;for(;L>=0&&e[L].disabled;)L--;return L>=0?L:P})):(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),e[E]?R(e[E]):b(!1))}},[s,_,e,E,R,b]),G=_?n.jsx("div",{ref:x,id:g,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:v,onMouseLeave:D,onMouseDown:M=>M.preventDefault(),children:e.map((M,P)=>n.jsxs("button",{id:`${g}-option-${P}`,type:"button",role:"option","aria-selected":M.value===t,className:Be("dropdown__option body-2",M.value===t?"dropdown__option--active":"",P===E?"dropdown__option--active":"",M.disabled?"dropdown__option--disabled":""),onMouseDown:L=>L.preventDefault(),onClick:()=>R(M),onMouseEnter:()=>w(P),disabled:M.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:M.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"})})}),M.label]},M.value))}):null;return n.jsxs("div",{ref:C,className:Be("dropdown",`dropdown--s${i}`,_?"dropdown--open":"",l?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:$,children:[n.jsxs("button",{ref:N,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&&A?y:"",h??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:s,onClick:k,onBlur:M=>{_&&!x.current?.contains(M.relatedTarget)&&b(!1)},children:[n.jsx("span",{id:y,className:`dropdown__trigger-label body-2${A?"":" dropdown__trigger-label--placeholder"}`,children:A?A.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"&&dn.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(R=>Nu(R).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),[]),B=o.useCallback(()=>C(!1),[]),v=i?0:-1;o.useEffect(()=>{c||p(v)},[c,v]),o.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const N=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),[]),w=o.useCallback(()=>{d(!0),p(v)},[v]),D=o.useCallback(()=>{m.current=setTimeout(()=>d(!1),120)},[]),A=o.useCallback(k=>{k.nativeEvent.isComposing||k.keyCode===229||(k.key==="ArrowDown"?(k.preventDefault(),d(!0),p(R=>Math.min(_.length-1,(R<_.length?R:v)+1))):k.key==="ArrowUp"?(k.preventDefault(),p(R=>Math.max(v,(R<_.length?R:_.length)-1))):k.key==="Enter"?N>=0&&x(_[N]):k.key==="Escape"&&c&&(k.preventDefault(),d(!1)))},[_,N,c,x,v]);return{listId:u,open:c,activeIdx:N,filtered:_,handleFocus:E,handleBlur:D,handleInput:w,handleKeyDown:A,handleSelect:x,handleCompositionStart:b,handleCompositionEnd:B}}const Io=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:B=40,variant:v="input",fullWidth:N=!1,newline:x=!1,multiline:E=!1,rows:w=3,leftIcon:D,rightIcon:A,clearable:k=!1,list:R,showCount:$=!0,className:G="",onFocus:M,onBlur:P,onKeyDown:L,onEnter:Q,inputMode:Z,autoComplete:F,autoFocus:K,suggestions:T,filterSuggestions:q,onSelectSuggestion:Y,autoActiveFirst:U,openOnFocus:S=!1}=e,I=C||y?void 0:T,{t:O}=_e.useTranslation(),z=o.useId();!i&&!u&&wt(`TextField:unnamed:${z}`,"[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 se=`tf-${z}`,te=`tf-helper-${z}`,de=o.useRef(null),ee=Eu({value:t??"",onChange:l,suggestions:I??[],openOnFocus:S,filterSuggestions:q,onSelectSuggestion:Y,autoActiveFirst:U}),V=!!I&&ee.open&&ee.filtered.length>0,ne=o.useRef(null),[W,H]=o.useState(null),ie=o.useCallback(()=>{const je=ne.current;if(!je||typeof window>"u")return;const Ye=je.getBoundingClientRect(),we=230,Ue=window.innerHeight-Ye.bottom<we+8&&Ye.top>we+8;H({position:"fixed",left:Ye.left,width:Ye.width,...Ue?{bottom:window.innerHeight-Ye.top+8}:{top:Ye.bottom+8},zIndex:za(je)})},[]);Io(()=>{if(!V)return;ie();let je=null;const Ye=()=>{if(typeof requestAnimationFrame>"u"){ie();return}je===null&&(je=requestAnimationFrame(()=>{je=null,ie()}))},we=Ue=>{const qe=Ue.target;qe&&qe.nodeType===1&&qe.closest?.(".text-field__suggestions")||Ye()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",Ye),()=>{je!==null&&cancelAnimationFrame(je),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Ye)}},[V,ie]);const Te=o.useCallback(je=>{de.current=je,typeof s=="function"?s(je):s&&(s.current=je)},[s]),ye=p?`${p}${m??O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:h,he=t!==void 0,Se=he&&g==="password",[$e,Ne]=o.useState((a??"").length),ue=he?(t??"").length:$e,xe=o.useRef(t);Io(()=>{xe.current=t}),o.useEffect(()=>{const je=de.current;if(!Se||!je)return;const Ye=t??"";je.value!==Ye&&(je.value=Ye)},[Se,t]),o.useEffect(()=>{if(!x||!de.current)return;const je=de.current;je.style.height="",je.scrollHeight>je.clientHeight&&(je.style.height=`${je.scrollHeight}px`)},[t,$e,x]);const ke=b!=null&&ue>b,Ee=B===32?16:20,We=Be("text-field",`text-field--s${B}`,v==="display"?"text-field--display":"",N?"text-field--full-width":"",y?"text-field--disabled":"",C?"text-field--readonly":"",f?"text-field--error":"",D?"text-field--has-left-icon":"",A||k?"text-field--has-right-icon":"",G),He={id:se,...Se?{}:he?{value:t}:{defaultValue:a},ref:Te,placeholder:ye,name:r,disabled:y,readOnly:C,autoFocus:K,maxLength:b,list:R,inputMode:Z,autoComplete:F,"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:I?"combobox":void 0,"aria-autocomplete":I?"list":void 0,"aria-haspopup":I?"listbox":void 0,"aria-expanded":I?V:void 0,"aria-controls":V?ee.listId:void 0,"aria-activedescendant":V&&ee.activeIdx>=0?`${ee.listId}-option-${ee.activeIdx}`:void 0,onChange:je=>{const Ye=je.target;he||Ne(Ye.value.length),l?.(Ye.value),I&&ee.handleInput(),Se&&queueMicrotask(()=>{const we=xe.current??"";Ye.value!==we&&(Ye.value=we)})},onCompositionStart:I?ee.handleCompositionStart:void 0,onCompositionEnd:I?ee.handleCompositionEnd:void 0,onFocus:(je=>{M?.(je),I&&ee.handleFocus()}),onBlur:(je=>{P?.(je),I&&ee.handleBlur()}),onKeyDown:(je=>{const Ye=(je.key==="Tab"&&!je.shiftKey||je.key===" ")&&!je.nativeEvent.isComposing;if(p&&Ye&&!C&&!y&&!(je.currentTarget.value??"").trim()){je.preventDefault();const we=je.currentTarget;he||(we.value=p,Ne(p.length)),l?.(p);return}I&&je.key==="Enter"&&!je.nativeEvent.isComposing&&ee.activeIdx>=0?je.preventDefault():Q&&je.key==="Enter"&&!je.nativeEvent.isComposing&&(je.preventDefault(),Q()),L?.(je),I&&ee.handleKeyDown(je)})},ot=k&&!y&&!C&&ue>0,Qe=()=>x?n.jsx("textarea",{...He,className:"text-field__input text-field__input--auto body-2",rows:1}):E?n.jsx("textarea",{...He,className:"text-field__input text-field__input--textarea body-2",rows:w}):n.jsx("input",{...He,type:g,className:"text-field__input body-2"}),Je=v==="display"&&!x&&!E&&!!ye,vt=()=>n.jsxs(n.Fragment,{children:[Qe(),Je&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:ye})]});return n.jsxs("div",{ref:ne,className:We,children:[i&&n.jsxs("label",{htmlFor:se,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(nt,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Ee})}),vt(),b!=null&&$&&n.jsxs("span",{className:`text-field__count caption-2${ke?" text-field__count--over":""}`,children:[ue,"/",b]}),ot&&n.jsx(fe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:O("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:je=>{je.preventDefault()},onClick:()=>{!he&&de.current&&(de.current.value="",Ne(0)),l?.("")},tabIndex:-1}),A&&!ot&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(nt,{icon:A,label:"",className:"",svgClassName:"text-field__icon-svg",size:Ee})})]}),!!I&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ee.open&&(t??"").length>0&&ee.filtered.length===0?O("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),V&&(typeof document>"u"?null:dn.createPortal(n.jsx("ul",{id:ee.listId,className:"text-field__suggestions",role:"listbox",style:W??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ee.filtered.map((je,Ye)=>n.jsx("li",{id:`${ee.listId}-option-${Ye}`,role:"option","aria-selected":Ye===ee.activeIdx,className:`text-field__suggestion body-2${Ye===ee.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{ee.handleSelect(je),de.current?.focus()},children:typeof je=="string"?je:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:je.label}),je.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:je.hint})]})},typeof je=="string"?`${je}-${Ye}`:je.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:B,onClick:v,children:N,align:x="horizontal",icon:E,useFullWidth:w=!1}=e,D=A=>{v&&A.target===A.currentTarget&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),v())};return n.jsxs("div",{className:Be("panel-row",x==="vertical"?"panel-row--vertical":"",w?"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}),B&&n.jsx("div",{className:"panel-row__sub caption-1",children:B})]}),n.jsx("div",{className:"panel-row__right",children:N})]})}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(yn,{options:b.options,value:b.value,onChange:b.onChange,size:b.size??40,ariaLabel:r})}else if(a==="dropdown"){const b=e,B=b.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:b.dropdowns.map((v,N)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(vn,{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)})},N))}):n.jsx(vn,{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:[B,n.jsx("span",{id:y,className:"caption-1 panel-row__error",role:"alert",children:u})]}):B}else if(a==="button"){const b=e;b.buttons?.length?m=n.jsx("div",{className:"panel-row__button-group",children:b.buttons.map((B,v)=>n.jsx(fe,{htmlType:"button",size:B.btnSize??40,variant:B.btnVariant??"default",disabled:B.disabled,onClick:B.onClick,children:B.label},v))}):m=n.jsx(fe,{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:Be("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}=_e.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(fe,{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:B}){const v=Be("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),N={};i!==void 0&&(N.minHeight=i),u!==void 0&&(N.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(N["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const x=t?`h${t}`:"div";return n.jsxs("div",{className:v,style:Object.keys(N).length?N:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:Be("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(nt,{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(B).length===0?n.jsx(sn,{variant:"empty",children:b}):d?n.jsx("div",{className:Be("panel__body--scroll",h==="stable"&&"panel__body--gutter-stable"),children:B}):B]})}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:Be("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 Fo({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:Be("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}=_e.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),B=o.useId(),v=o.useCallback((V,ne)=>{const W=window.innerHeight,H=window.innerWidth,ie=typeof document<"u"?document.getElementById(B):null,Te=Math.max(ie?.offsetHeight||0,ie?.scrollHeight||0)||300,ye=Math.max(V.width,ie?.offsetWidth||0,260),he=W-V.bottom,Se=V.top,$e=he<Te&&Se>he,Ne=8,ue=(xe,ke)=>Math.min(Math.max(Ne,xe),Math.max(Ne,ke));return{position:"fixed",left:ue(V.left,H-ye-Ne),width:V.width,minWidth:260,...$e?{top:"auto",bottom:ue(W-V.top+6,W-Te-Ne)}:{bottom:"auto",top:ue(V.bottom+6,W-Te-Ne)},zIndex:za(ne)}},[B]),{open:N,setOpen:x,toggle:E,style:w,triggerRef:D,menuRef:A}=Wa({computeStyle:v,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!N)return;const V=A.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 ne=document.activeElement;(!ne||ne===document.body)&&D.current?.focus?.()}},[N,A,D]);const[k,R]=o.useState(1),$=o.useRef(null),G=o.useRef(null);o.useEffect(()=>{if(!N)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;R(V)},[N]),o.useEffect(()=>{if(G.current==null)return;const V=G.current;G.current=null,$.current?.querySelector(`[data-day="${V}"]`)?.focus()}),o.useEffect(()=>{R(V=>Math.min(V,vr(y,C)))},[y,C]);const M=o.useCallback(V=>{let ne=Qa(V.getFullYear(),V.getMonth(),V.getDate());r&&ne<r&&(ne=r),s&&ne>s&&(ne=s);const[W,H,ie]=ne.split("-").map(Number);(W!==y||H-1!==C)&&b(W,H-1),R(ie),G.current=ie},[r,s,y,C,b]),P=o.useCallback(V=>{const ne=new Date(y,C,k),W=ie=>{ne.setDate(ne.getDate()+ie),M(ne)},H=ie=>{const Te=ne.getFullYear()*12+ne.getMonth()+ie,ye=Math.floor(Te/12),he=Te-ye*12;M(new Date(ye,he,Math.min(ne.getDate(),vr(ye,he))))};switch(V.key){case"ArrowLeft":W(-1);break;case"ArrowRight":W(1);break;case"ArrowUp":W(-7);break;case"ArrowDown":W(7);break;case"Home":W(-ne.getDay());break;case"End":W(6-ne.getDay());break;case"PageUp":V.shiftKey?H(-12):H(-1);break;case"PageDown":V.shiftKey?H(12):H(1);break;default:return}V.preventDefault()},[y,C,k,M]),L=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 ne=Qa(y,C,V);return!!(r&&ne<r||s&&ne>s)},Z=(()=>{const V=vr(y,C);if(k>=1&&k<=V&&!Q(k))return k;for(let ne=1;ne<=V;ne++)if(!Q(ne))return ne;return-1})(),F=[];for(let V=0;V<Nv(y,C);V++)F.push(null);for(let V=1;V<=vr(y,C);V++)F.push(V);const K=a===64?20:a===40?16:18,T=ql(h.language),q=V=>new Intl.DateTimeFormat(T,{year:"numeric"}).format(new Date(V,0,1)),Y=(V,ne)=>new Intl.DateTimeFormat(T,{month:"long"}).format(new Date(V,ne-1,1)),U=jv(y,+g.slice(0,4),q,r,s),S=Tu(y,Y,r,s),I=V=>{const ne=Tu(V,Y,r,s);if(ne.length===0)return;const W=ne.some(H=>+H.value===C+1);b(V,W?C:+ne[0].value-1)},[O,z]=o.useState(null);o.useEffect(()=>{z(null)},[e]);const se=o.useCallback(V=>{z(V);const ne=Dv(V);if(!ne||r&&ne<r||s&&ne>s)return;t(ne);const[W,H]=ne.split("-");b(+W,+H-1)},[r,s,t,b]),te=o.useCallback(()=>{z(null)},[]),de=o.useCallback(V=>{V.key==="Enter"?(V.preventDefault(),te(),x(!1)):V.key==="Escape"?(te(),x(!1)):V.key==="ArrowDown"&&!N&&(V.preventDefault(),x(!0))},[te,x,N]),ee=N?dn.createPortal(n.jsxs("div",{ref:A,id:B,className:"date-picker__dropdown",style:w,"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(vn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYear","\uC5F0 \uC120\uD0DD"),options:U,value:String(y),onChange:V=>I(+V),size:40}),n.jsx(vn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectMonth","\uC6D4 \uC120\uD0DD"),options:S,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:P,children:[m.map(V=>n.jsx("div",{className:"date-picker__dow caption-1",children:V},V)),F.map((V,ne)=>{if(V===null)return n.jsx("div",{},`e${ne}`);const W=Qa(y,C,V),H=W===e,ie=W===g,Te=Q(V),ye=ne%7;return n.jsx("button",{type:"button",disabled:Te,"data-day":V,tabIndex:V===Z?0:-1,"aria-current":ie?"date":void 0,onClick:()=>!Te&&L(V),className:Be("date-picker__day caption-1",H&&"date-picker__day--selected",ie&&!H&&"date-picker__day--today",Te&&"date-picker__day--disabled",ye===0&&"date-picker__day--sun",ye===6&&"date-picker__day--sat"),children:V},V)})]})]}),document.body):null;return n.jsxs("div",{className:Be("date-picker",`date-picker--s${a}`,N&&"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:O??Ev(e),placeholder:p,onChange:V=>se(V.target.value),onClick:()=>!l&&!N&&E(),onKeyDown:de,onBlur:te,disabled:l,"aria-haspopup":"dialog","aria-expanded":N,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":N,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}=_e.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)),B={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(fe,{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(Fo,{checked:c.includes(v),disabled:t,label:B[v],onChange:N=>d(x=>N?[...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(yn,{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(yn,{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}=_e.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:Be("pagination",l),children:[n.jsx(fe,{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(fe,{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}=_e.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:Be("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,m)=>n.jsx(yn,{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(vn,{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(vn,{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,`
|
|
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"},Ig={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"}},Fg={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:Ig,progress:Fg,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.395.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(_e.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 nt(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),B=(w,D={})=>n.jsx("span",{className:d,style:u,...D,children:w}),v=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,A=(w,D={})=>n.jsx("img",{src:w,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 B(t);if(t==="none")return B(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 B(o.createElement(y,{className:m,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(f==="mask"){const w={"--icon-url":b?`url(${b})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return B(n.jsx("span",{className:p,style:w}),{"aria-hidden":"true"})}return f==="img"?B(A(C,{onError:w=>{w.currentTarget.onerror=null,w.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):f==="inline"?B(n.jsx("span",{className:m,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):B(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:w=>{w.currentTarget.onerror=null,w.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 B(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:Be("empty-state",s),children:[e&&n.jsx(nt,{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(nt,{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}=_e.useTranslation(),{pending:u,press:c}=ni(r);return n.jsxs("div",{className:Be("empty-state","error-state",l),role:"alert",children:[n.jsx(nt,{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(nt,{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:Be("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(nt,{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(nt,{icon:"arrow-right",size:18})})]})]})})}function my({as:e="div",className:t="",children:a,storage:r,...s}){r&&F1({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=Be("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}=_e.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}=_e.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 gn(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 gn(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 le(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 xn(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}),[B,v]=o.useState(!1),[A,x]=o.useState("bottom"),[E,w]=o.useState(!1),[D,N]=o.useState(!1),k=!t&&!a,R=o.useRef(null),$=o.useCallback((T=!1,q=!1)=>{if(D&&m)return;const Y=a?a.getBoundingClientRect():t,U=q&&R.current?R.current:Y;if(!U||!f.current)return;const S=f.current,{offsetWidth:I,offsetHeight:O}=S,z=window.innerWidth,se=window.innerHeight,te=z-U.right,de=U.left,ee=U.top,V=se-U.bottom;let ne=0,W=0,H="top";if(ee>=O+r)H="top",W=U.top-r-O,ne=U.left+U.width/2-I/2;else if(V>=O+r)H="bottom",W=U.bottom+r,ne=U.left+U.width/2-I/2;else if(te>=I+r)H="right",ne=U.right+r,W=U.top+U.height/2-O/2;else if(de>=I+r)H="left",ne=U.left-r-I,W=U.top+U.height/2-O/2;else{const he=Math.max(ee,V,te,de);he===ee?(H="top",W=U.top-r-O,ne=U.left+U.width/2-I/2):he===V?(H="bottom",W=U.bottom+r,ne=U.left+U.width/2-I/2):he===te?(H="right",ne=U.right+r,W=U.top+U.height/2-O/2):(H="left",ne=U.left-r-I,W=U.top+U.height/2-O/2)}const ie=Number.isFinite(Number(s))?Number(s):8;ne=Math.min(Math.max(ne,ie),z-I-ie),W=Math.min(Math.max(W,ie),se-O-ie);const Te=Math.round(ne),ye=Math.round(W);T&&f.current?(f.current.style.left=`${Te}px`,f.current.style.top=`${ye}px`,f.current.dataset.placement=H):(x(H||A),b({position:"fixed",left:Te,top:ye}),w(!0))},[D,m,a,t,r,s,A]);o.useEffect(()=>()=>{R.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)"}),w(!0);return}R.current===null&&(R.current=a?a.getBoundingClientRect():t??null),$(!1,!0);const T=requestAnimationFrame(()=>$(!1,!0));return()=>cancelAnimationFrame(T)},[t,a,r,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m||!f.current||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>{t&&$()});return T.observe(f.current),()=>T.disconnect()},[t,h,s,k,D,m,$]),o.useEffect(()=>{if(k||D&&m)return;let T=null;const q=()=>{if(a&&(R.current=a.getBoundingClientRect()),typeof requestAnimationFrame>"u"){$(!0);return}T===null&&(T=requestAnimationFrame(()=>{T=null,$(!0)}))},Y=U=>{if(!a&&l){const S=U.target;if(S&&f.current&&f.current.contains(S))return;try{if(S&&S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}Q.current(!0);return}q()};return window.addEventListener("resize",q),document.addEventListener("scroll",Y,{passive:!0,capture:!0}),()=>{T!==null&&cancelAnimationFrame(T),window.removeEventListener("resize",q),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 T=window.matchMedia("(max-width: 768px)"),q=()=>N(!!T.matches);q();try{T.addEventListener?T.addEventListener("change",q):T.addListener(q)}catch{try{T.addListener(q)}catch{}}return()=>{try{T.removeEventListener?T.removeEventListener("change",q):T.removeListener(q)}catch{}}},[]);const G=o.useRef(!1),M=o.useRef(null),P=yo(),L=o.useCallback((T=!1)=>{if(l&&!(B||G.current)){if(G.current=!0,T){v(!0);try{l&&l()}catch{G.current=!1,v(!1)}return}v(!0),M.current=setTimeout(()=>{M.current=null;try{l&&l()}catch{G.current=!1,v(!1)}},P?0:200)}},[B,l,v,P]);o.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),o.useEffect(()=>{if(k)return;const T=U=>{const S=f.current;if(!S)return;const I=U.target;if(I&&!S.contains(I)){try{if(I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}i&&L(!0)}},q=U=>{const S=f.current;if(!S)return;const I=U.target;if(I&&!S.contains(I)){try{if(I.closest&&I.closest("[data-tooltip-ignore]"))return}catch{}i&&L(!0)}},Y=U=>{if(U.key==="Tab"){const S=f.current;if(!S)return;const I=S.querySelectorAll(Nn);if(!I||I.length===0)return;const O=I[0],z=I[I.length-1],se=document.activeElement;U.shiftKey?se===O&&(U.preventDefault(),z.focus()):se===z&&(U.preventDefault(),O.focus())}};return document.addEventListener("pointerdown",T,!0),document.addEventListener("click",q,!0),document.addEventListener("keydown",Y),()=>{document.removeEventListener("pointerdown",T,!0),document.removeEventListener("click",q,!0),document.removeEventListener("keydown",Y)}},[l,i,L,k]);const Q=o.useRef(L);o.useEffect(()=>{Q.current=L});const Z=!!l;o.useEffect(()=>{if(!(k||!Z))return Zn(()=>Q.current())},[k,Z]),o.useEffect(()=>{const T=()=>{L(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",T),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",T)}},[L]);const F=o.useRef(null);o.useEffect(()=>{if(k||C===!1||!E)return;const T=f.current;if(!T)return;const q=T.querySelector(Nn);if(q)return F.current=document.activeElement,q.focus({preventScroll:!0}),()=>{const Y=F.current;F.current=null,Y&&document.contains(Y)&&Y.focus({preventScroll:!0})}},[k,C,E]),o.useEffect(()=>{c==="dialog"&&!d&&xt("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:le(`tooltip__content ${k?"tooltip__content--inline":""} ${g?"tooltip__content--bordered":""} ${B?"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:le("tooltip__header h5"),children:y}),h]});if(k||typeof document>"u")return K;if(p||D&&m){const T=n.jsxs("div",{className:le("tooltip__portal"),children:[n.jsx("div",{className:le("tooltip__backdrop"),onClick:()=>{i&&L(!0)}}),K]});return dn.createPortal(T,document.body)}return dn.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(xn,{anchorRect:t,offset:r,onClose:s,closeOnOutsideClick:!1,className:le(`info-tooltip ${l}`),ariaLabel:i||a,children:n.jsx("div",{className:le("info-tooltip__content body-3"),children:a})}):null}function Xn(e){const{t}=_e.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(xn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:le("description-tooltip"),ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:le("description-tooltip__box"),children:[r&&n.jsx("span",{className:le("description-tooltip__title body-2"),children:r}),n.jsx("ol",{className:le("description-tooltip__items"),children:h.map((p,m)=>n.jsxs("li",{className:le(`description-tooltip__item body-3${m===l?" description-tooltip__item--active":""}`),children:[i&&h.length>1&&n.jsxs("span",{className:le("description-tooltip__index button-1"),children:[m+1,"."]}),p.color&&n.jsx("span",{className:le("description-tooltip__dot"),style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},m))})]})})}function Ia(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=Ia(e),i=Ia(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:B=!1,ariaExpanded:v,ariaControls:A,disabled:x=!1,loading:E=!1,useLabel:w=!0,useBorder:D=!0,useBG:N=!0,useDisabledCovered:k=!1,useDisabledInvisible:R=!1,useDisabledFilled:$=!1,width:G,minWidth:M,onClick:P,onDisabledClick:L,showTooltipInfo:Q=!1,tooltipInfoText:Z=null,tooltipDescription:F=null,tooltipOnly:K=!1,iconSize:T="medium",iconColor:q,shape:Y="rounded",color:U,className:S,...I}=e,O=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),z=O.match(/^\d+$/)?`button${O}`:`button-${O}`,se=Number(a),te=!isNaN(se)&&se<40?"button-2":"button-1",de=h??g,ee=x||!!I.disabled,V=ee?k?"disabled-covered":R?"disabled-invisibled":$?"disabled-filled":"disabled":C,ne=V?`button--variant-${V}`:"",W=f?`button--align-${f}`:"",H=_?"button--nowrap":"",ie=Y?`button--shape-${Y}`:"",Te=typeof q=="string"&&q.startsWith("--")?`var(${q})`:q,ye={...G?{width:typeof G=="number"?`${G}px`:G}:{},...M?{minWidth:typeof M=="number"?`${M}px`:M}:{},...D?{}:{"--button-border":ee?"0":"1px solid transparent"},...Te?{"--button-icon-color":Te}:{},...U?{"--color-main":U}:{}},he=w===!1?"":de,Se=Array.isArray(he)?he.length>0:!!he,$e=!!d,Ne=r??(Se||c||$e?"bar":"dot"),ue=`${z}--${Ne}`,xe=o.useRef(null);o.useEffect(()=>{!On||s!==void 0||xe.current?.closest("form")&&xt(`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 ke=o.useRef(t);ke.current=t;const Ee=o.useCallback(Le=>{xe.current=Le;const at=ke.current;typeof at=="function"?at(Le):at&&(at.current=Le)},[]),We=o.useRef(ee),[He,ot]=o.useState(!!b),[Qe,Je]=o.useState(!1),[vt,je]=o.useState(null),Ye=o.useCallback(()=>Je(!1),[]),[we,Ue]=o.useState(!1),qe=o.useId();o.useEffect(()=>{typeof b=="boolean"&&ot(b)},[b]),o.useEffect(()=>{if(We.current&&!ee&&xe.current){const Le=xe.current;let at=!1;try{at=Le.matches(":focus:not(:focus-visible)")}catch{at=!1}at&&Le.blur(),Le.style.pointerEvents="none";const oe=requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe.current&&(xe.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(oe)}We.current=ee},[ee]);const pt=typeof b=="boolean"?!!b:He,_t=typeof v=="boolean"?void 0:B||typeof b=="boolean"?pt?"true":"false":I["aria-pressed"],Et=Be("button",z,ue,ne,W,H,ie,pt?"is-selected":null,N?null:"button--no-bg",K?"button--tooltip-only":null,S),Bt=`button__icon button__icon--${T}`,st=Array.isArray(m)?m:m!==void 0?[m]:[],tt=()=>{if(Array.isArray(he))return he.map((at,oe)=>{const be=st[oe];return n.jsxs("span",{className:`button__label-text${be!==void 0?" button__label-text--has-sub":""}`,children:[at,be!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:be})]},oe)});const Le=m!==void 0;return n.jsxs("span",{className:`button__label-text${Le?" button__label-text--has-sub":""}`,children:[he,p!=null&&n.jsx("span",{className:"button__count",children:p}),Le&&n.jsx("span",{className:"button__sub-label-text caption-1",children:m})]})},kt=Le=>{typeof b!="boolean"&&!B&&ot(!1),Le.currentTarget.blur()},At=Le=>{ee||(typeof I.onMouseLeave=="function"&&I.onMouseLeave(Le),kt(Le))},jt=Le=>{if(K&&it&&ut.touchPress(Le.currentTarget),ee){it&&ut.touchPress(Le.currentTarget),Le.preventDefault(),L?.(Le);return}typeof b!="boolean"&&B&&ot(at=>!at),P?.(Le)},Mt=o.useCallback(()=>{(Q||F)&&(Je(!0),je(xe.current?.getBoundingClientRect()??null))},[Q,F]),gt=o.useCallback(()=>{(Q||F)&&(Je(!1),je(null))},[Q,F]),it=!!(Q||F),ut=_o(Qe,Le=>{Le?Mt():gt()},xe,{enabled:it&&(ee||K),fallbackOnParent:it&&ee}),ct={...I};delete ct.disabled,delete ct.className,delete ct.faded,delete ct.useFaded,delete ct.loading,delete ct.onMouseLeave,delete ct.onPointerEnter,delete ct.onPointerLeave,delete ct.onPointerUp,delete ct.onFocus,delete ct.onBlur,ee&&(Object.keys(ct).forEach(Le=>{/^on[A-Z]/.test(Le)&&typeof ct[Le]=="function"&&delete ct[Le]}),ct["aria-disabled"]="true"),E&&(ct["aria-busy"]="true");const ve=(typeof Q=="string"?Q:null)??(typeof Z=="string"?Z:null)??(typeof y=="string"?y:null)??(typeof de=="string"?de:null)??void 0,Me=typeof y=="string"?y:typeof de=="string"?de:ve,Pe=F?[F.title,...F.items??[]].filter(Boolean).join(". "):Q&&ve&&ve!==Me?ve:"",Oe=[typeof I["aria-describedby"]=="string"?I["aria-describedby"]:void 0,Pe?qe:null].filter(Boolean).join(" ")||void 0,dt=()=>n.jsx("span",{className:`${Bt} button__spinner`,"aria-hidden":"true",children:n.jsx(pa,{variant:"spinner",size:"100%"})}),Dt=(Le,at)=>n.jsx(nt,{icon:Le,label:at??Me,className:Bt,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),yt=Le=>E?dt():Dt(c,Le),wt=()=>Ne==="dot"?n.jsxs(n.Fragment,{children:[yt(),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()})]}):f==="center"&&(c||E)?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:yt()}),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()})]}),$e&&n.jsx("span",{className:"button__right",children:Dt(d)})]}):n.jsxs(n.Fragment,{children:[(c||E)&&n.jsx("span",{className:"button__left",children:yt(y??de)}),Se&&n.jsx("span",{className:`button__label ${te}`,children:tt()}),$e&&n.jsx("span",{className:"button__right",children:Dt(d)})]}),Ct=!!l&&!ee;return n.jsxs(n.Fragment,{children:[n.jsxs(Ct?"a":"button",{...ct,ref:Ee,...Ct?{href:l,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:s??"button",disabled:ee&&!L&&!we},className:Et,"aria-pressed":_t,"aria-expanded":typeof v=="boolean"?v:I["aria-expanded"],"aria-controls":A??I["aria-controls"],"aria-label":Me,"aria-disabled":ee&&(Ct||L||we)?!0:void 0,"aria-describedby":Oe,style:ye,onClick:jt,onMouseLeave:At,onPointerEnter:Le=>{ma(Le)||Mt(),!ee&&typeof I.onPointerEnter=="function"&&I.onPointerEnter(Le)},onPointerLeave:Le=>{ma(Le)||gt(),!ee&&typeof I.onPointerLeave=="function"&&I.onPointerLeave(Le)},onPointerUp:Le=>{ee&&it&&ut.touchPress(Le.currentTarget),!ee&&typeof I.onPointerUp=="function"&&I.onPointerUp(Le)},onFocus:Le=>{Ue(!0),Ca()||Mt(),!ee&&typeof I.onFocus=="function"&&I.onFocus(Le)},onBlur:Le=>{Ue(!1),ee||kt(Le),gt(),!ee&&typeof I.onBlur=="function"&&I.onBlur(Le)},children:[wt(),Pe?n.jsx("span",{id:qe,hidden:!0,"aria-label":Pe}):null]}),Qe&&F?n.jsx(Xn,{anchorRect:vt,title:F.title,items:F.items,onClose:Ye}):Qe&&ve?n.jsx(Tn,{anchorRect:vt,text:ve,onClose:Ye}):null]})}const fe=o.forwardRef(ky);fe.displayName="Button";function Tt(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 Fa={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(Fa.title,t.title),e.style.setProperty(Fa.description,t.description),xo.set(e,t))}function Xt(e){e&&(e.style.removeProperty(Fa.title),e.style.removeProperty(Fa.description),xo.delete(e))}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function di(){const e=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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=Tt(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")],Ii={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 Fi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:s=.1,lineHeightRatio:l=1.4}={}){const i=B=>Math.max(a,Math.min(r,Number(B))),u=B=>{try{const v=localStorage.getItem(B),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=B=>{d(typeof B=="function"?v=>i(B(v)):i(B))},g=()=>m(B=>+(B+s).toFixed(6)),y=()=>m(B=>+(B-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=Ia(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 mn(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=mn(h,p);if(m!==0)return m}return i.length!==u.length?i.length-u.length:mn(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}=_e.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 wn="\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 Iy(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 Fy=(e,{defaultValue:t})=>t,Vi=(e,t)=>({jamos:e,phonetic:t,tooltip:Iy(Fy,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=Ia(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 w=E.target;r&&w.closest?.(r)||c.current?.contains(w)||d.current?.contains(w)||l(!1)};document.addEventListener("mousedown",f),document.addEventListener("pointerdown",f);let _=null;const b=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},B=E=>{d.current?.contains(E.target)||(t==="reposition"?b():t==="close"&&l(!1))};t!=="ignore"&&window.addEventListener("scroll",B,!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",B,!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),[B,v]=o.useState(0),A=o.useRef(0),x=o.useCallback(T=>{A.current=typeof T=="function"?T(A.current):T,v(A.current)},[]),E=o.useRef(r),w=o.useRef(s);o.useEffect(()=>{E.current=r,w.current=s},[r,s]);const D=o.useRef([]),N=()=>{D.current.forEach(clearTimeout),D.current=[]},k=(T,q)=>{D.current.push(setTimeout(q,T))};o.useEffect(()=>()=>N(),[]);const R=u[d]?.id??null,$=o.useRef(null),G=o.useCallback(()=>{N(),m("playing"),f([]),b(null),x(0);let T=0;e.forEach((q,Y)=>{k(T,()=>{h(Y),y(q.id),E.current?.(q)}),k(T+1e3,()=>{y(null),f(U=>[...U,q.id])}),T+=1300}),k(T,()=>{m("done"),w.current?.({score:0,total:e.length})})},[e,x]),M=o.useCallback((T,q)=>{if(q>=T.length){m("done"),w.current?.({score:A.current,total:T.length});return}$.current=null,h(q),b(null),m("playing"),y(T[q].id),E.current?.(T[q]),k(l,()=>{y(null),m("waiting")})},[l]),P=o.useCallback(()=>{N();const T=$a(e);c(T),x(0),f([]),M(T,0)},[e,M,x]),L=o.useCallback(()=>{t==="playback"?(c(e),G()):P()},[t,e,G,P]),Q=o.useCallback(()=>{N(),m("idle"),y(null),f([]),b(null),h(0),x(0),c([])},[x]),Z=JSON.stringify(e.map(T=>[T.id,T.label,T.angleDeg,T.deg,T.row,T.shortcut]));o.useEffect(()=>(a?L():Q(),()=>N()),[t,Z,a]);const F=o.useCallback(T=>{p!=="waiting"||t==="playback"||$.current===d||($.current=d,b(T),T===u[d]?.id&&x(q=>q+1),t==="exam"?(m("playing"),k(400,()=>M(u,d+1))):(m("feedback"),k(i,()=>M(u,d+1))))},[p,t,u,d,M,i,x]),K=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:g,playedIds:C,selectedId:_,answerId:R,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:F},index:d,total:K,score:B,phase:p,done:p==="done",start:L,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=gn("(max-width: 767px)"),f=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const B=m.current;if(!B)return;const v=wo(B),A=(x,E,w)=>{if(w!==void 0)B.style.setProperty(E,w),f.current[x]=!0;else if(f.current[x]){const D=v?.[x];D?B.style.setProperty(E,D):B.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 B=m.current;if(!B)return;const v=wo(B);y(v?.actionVariant??"main")},[p]);const _=Be("promo-banner",`promo-banner--${i}`,h),b=Ii[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(fe,{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}=_e.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),B=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 w=window.setInterval(()=>h(D=>(Math.min(D,c-1)+1)%c),t);return()=>window.clearInterval(w)},[c,t,A,v]);const E=w=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>{b.current=null,f(!1)},w)};return o.useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current)},[]),o.useEffect(()=>{if(!C)return;const w=D=>{D.pointerType==="touch"&&(B.current&&B.current.contains(D.target)||(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!1)))};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[C]),c===0?null:n.jsxs("section",{ref:B,className:Be("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:w=>{_.current=w.pointerType},onPointerDown:w=>{_.current=w.pointerType,w.pointerType==="touch"&&(b.current!=null&&(window.clearTimeout(b.current),b.current=null),f(!0))},onPointerUp:w=>{w.pointerType==="touch"&&E(5e3)},onPointerCancel:w=>{w.pointerType==="touch"&&E(5e3)},onMouseEnter:()=>{_.current!=="touch"&&m(!0)},onMouseLeave:()=>m(!1),onFocus:w=>{let D=!0;try{D=w.target.matches(":focus-visible")}catch{D=!0}y(D)},onBlur:w=>{w.currentTarget.contains(w.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((w,D)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":D!==x,...D!==x?{inert:!0}:{},children:w},D))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[x]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((w,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}=_e.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(nt,{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}=_e.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:Be("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}=_e.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 B=_?.[b.ci]?.items?.[b.ii];if(!B||!Array.isArray(B.children)||!B.children.length)break;_=[{title:null,items:B.children}],f.push({title:B.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 B=m.current?.querySelector("button:not([disabled])");if(B&&B.offsetParent){B.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(B=>[...B.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:le(`menu-tooltip menu-tooltip--${r} ${a}`),children:[(c.length>1||d.title)&&n.jsxs("div",{className:le("menu-tooltip__header"),children:[c.length>1?n.jsx(fe,{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:le("menu-tooltip__title button-1"),children:d.title})]}),n.jsx("div",{className:le("menu-tooltip__columns"),ref:m,children:d.columns&&d.columns.map((f,_)=>n.jsxs("div",{className:le("menu-tooltip__column"),children:[f.title?n.jsx("div",{className:le("menu-tooltip__column-title body-3"),children:f.title}):null,n.jsx("div",{className:le("menu-tooltip__items"),children:(f.items||[]).map((b,B)=>n.jsxs(o.Fragment,{children:[b.separatorBefore&&B>0&&n.jsx("div",{className:le("menu-tooltip__separator"),role:"separator"}),n.jsx(fe,{htmlType:"button",className:le("menu-tooltip__item"),size:l,type:b.label?"bar":"dot",icon:b.selected?"check":b.icon||"none",rightIcon:Array.isArray(b.children)&&b.children.length?"chevron-right":b.badgeCount?n.jsx(En,{position:"inline",number:Math.min(b.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:b.label,ariaLabel:b.label&&b.badgeCount&&b.badgeCount>0?s("nav.badgeLabel",{label:b.label,count:b.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):b.label,onClick:()=>C(b,_,B),selected:b.selected,disabled:b.disabled,showTooltipInfo:b.tooltip||!1,useBorder:!1,align:"left"})]},B))})]},_))})]})}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&&xt("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}=_e.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 T=p.current;if(!T)return;const q=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle(T):null,I=T.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),O=T.querySelector(".bottom-nav__left"),z=O?.nextElementSibling,se=(O?.offsetWidth??0)+(O&&z?.classList.contains("bottom-nav__divider")?z.offsetWidth:0);g(Math.max(0,I-se))};if(q(),typeof ResizeObserver>"u")return;const Y=new ResizeObserver(q);Y.observe(T);const U=T.querySelector(".bottom-nav__left");return U&&Y.observe(U),()=>Y.disconnect()},[s]);const C=jo+1,f=T=>Math.max(0,Math.floor((T+br)/(jo+br))),_=y*(jo+br)-br<=m,b=m<=0||l.length===0&&_?y:Math.min(y,f(m-C)),B=m>0&&b<y,v=B?b:y,A=e.slice(0,v),x=e.slice(v),E=B||l.length>0,w=o.useCallback((T,q)=>({position:"fixed",bottom:window.innerHeight-T.top+8,right:window.innerWidth-T.right,zIndex:za(q)}),[]),D=o.useId(),{open:N,toggle:k,close:R,style:$,triggerRef:G,menuRef:M}=Wa({computeStyle:w,onScroll:"ignore",onResize:"reposition"}),P=o.useCallback((T,q)=>q>0?u("nav.badgeLabel",{label:T,count:q,defaultValue:"{{label}}, {{count}}\uAC1C"}):T,[u]),L=o.useCallback((T,q)=>q>0?u("nav.badgeInsideLabel",{label:T,count:q,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):T,[u]),Q=o.useCallback(()=>s?.(c),[s,c]),Z=o.useMemo(()=>x.find(T=>!!T.key&&T.key===t)??l.find(T=>T.selected||T.key&&T.key===t),[x,t,l]),F=o.useMemo(()=>[{items:[...x.map(T=>({label:T.label,icon:T.icon,badgeCount:T.badgeCount,selected:!!T.key&&T.key===t,closeOnSelect:!0,disabled:T.state==="disabled",onClick:()=>{T.state!=="disabled"&&(T.key&&a&&(a(T.key),So(i,"BottomNav")),R())}})),...l.map(T=>({label:T.label,icon:T.icon,badgeCount:T.badgeCount,selected:T.selected??(!!T.key&&T.key===t),closeOnSelect:!0,onClick:()=>{T.onClick?.(),R()}}))]}],[x,l,t,a,R]),K=[...x,...l].reduce((T,q)=>T+Yi(q.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(fe,{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((T,q)=>{const Y=Yi(T.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:T.icon,ariaLabel:P(T.label,Y),selected:!!T.key&&T.key===t,disabled:T.state==="disabled",className:"bottom-nav-item",onClick:()=>{T.key&&(a?.(T.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})})]},T.key??`__slot-${q}`)})}),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(fe,{htmlType:"button",size:52,type:"dot",icon:Z?.icon??"ellipsis",ariaLabel:L(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&&dn.createPortal(n.jsx("div",{id:D,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:le("tooltip__content"),style:$,ref:M,children:n.jsx(Ha,{columns:F,onClose:R})}),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}=_e.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(fe,{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(fe,{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(fe,{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(fe,{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(fe,{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(fe,{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}=_e.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(nt,{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(B=>{if(f)return;const v=B.detail>0;if(v)try{B.currentTarget.blur()}catch{}u?.(p,B.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}=_e.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,B]=o.useState(null);o.useEffect(()=>{const w=_.current;if(!w)return;let D=null;const N=()=>{const{scrollHeight:$,clientHeight:G,scrollTop:M}=w;if($<=G+1){B(F=>F===null?F:null);return}const P=Math.max(24,G/$*G),L=G-P,Q=$-G,Z={top:Math.round(M/Q*L),height:Math.round(P)};B(F=>F&&F.top===Z.top&&F.height===Z.height?F:Z)},k=()=>{if(typeof requestAnimationFrame>"u"){N();return}D===null&&(D=requestAnimationFrame(()=>{D=null,N()}))};N(),w.addEventListener("scroll",k,{passive:!0});const R=typeof ResizeObserver<"u"?new ResizeObserver(k):null;R?.observe(w);for(const $ of Array.from(w.children))R?.observe($);return()=>{D!==null&&cancelAnimationFrame(D),w.removeEventListener("scroll",k),R?.disconnect()}},[a]);const v=o.useRef(null),A=o.useCallback(w=>{const D=_.current;D&&(w.preventDefault(),v.current={y:w.clientY,top:D.scrollTop},w.currentTarget.setPointerCapture(w.pointerId))},[]),x=o.useCallback(w=>{const D=_.current,N=v.current;!D||!N||(D.scrollTop=N.top+(w.clientY-N.y)*(D.scrollHeight/D.clientHeight))},[]),E=o.useCallback(w=>{v.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.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(w=>!w.section&&(w.key||w.label)).map((w,D)=>n.jsxs(o.Fragment,{children:[w.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Qi,{item:w,active:!!w.key&&w.key===r,state:w.disabled?"disabled":void 0,onClick:(N,k,R)=>{if(w.disabled)return;if(w.href){if(Xi(w.href)&&window.open(w.href,"_blank","noopener,noreferrer"),R)try{k?.blur()}catch{}return}if(s?.(w.key),So(y,"SideNav"),!R)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 M=()=>{$.classList.remove("header--force-collapsed"),$.removeEventListener("mouseenter",M)};$.addEventListener("mouseenter",M)}}}})]},w.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}=_e.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}=_e.useTranslation(),f=gn("(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(M=>M.key===$);if(!G?.disabled){if(G?.href){Xi(G.href)&&window.open(G.href,"_blank","noopener,noreferrer");return}t?.($)}},[a,t]),B=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:w,style:D,triggerRef:N,menuRef:k}=Wa({computeStyle:v,onScroll:"ignore",onResize:"reposition"}),R=o.useMemo(()=>[{items:B.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===e),closeOnSelect:!0,onClick:()=>{$.onClick?.(),w()}}))}],[B,e,w]);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(fe,{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&&dn.createPortal(n.jsx("div",{id:A,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:le("tooltip__content"),style:D,ref:k,children:n.jsx(Ha,{columns:R,onClose:w})}),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)&&xt("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&&xt("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,B=Be("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:B,style:A,"aria-label":l?void 0:s,role:i??(s&&!l?"img":void 0),"aria-hidden":l||void 0,children:[m&&n.jsx(nt,{icon:m,size:b,className:"badge__icon"}),u??c,g&&n.jsx(nt,{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=Tt(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=Tt(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=Tt(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=Tt(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:B,onRefund:v,onDelete:A}){const{t:x}=_e.useTranslation(),E=t?ru(t):void 0,w=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),R=_??(a?E?.originalPrice:void 0),$=b??E?.discountLabel,G=o.useMemo(()=>{if(k)return null;const W=t?.durationDays??d2(t?.code);if(!W||W<=0)return i!=null?{percent:null,remainingLabel:du(i,x)}:null;const H=W*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 Se=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(l)),$e=/^(\d{4})-(\d{2})-(\d{2})/.exec(Pa()),Ne=Math.round(Se&&$e?(Date.UTC(+Se[1],+Se[2]-1,+Se[3])-Date.UTC(+$e[1],+$e[2]-1,+$e[3]))/864e5:(he-Date.now())/864e5);ie=Math.max(0,u?Ne+1:Ne)*86400}else c==="expired"?ie=0:ie=H;const Te=E2(ie),ye=Math.max(0,Math.min(100,Math.floor(Math.min(Te,H)/H*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?x("passCard.expired","\uB9CC\uB8CC\uB428"):du(ie,x)}},[k,c,l,i,u,t?.durationDays,t?.code,x]),M=o.useRef(null),[P,L]=o.useState({}),[Q,Z]=o.useState(null),F=!!(B||v||A),K=o.useRef(!1),T=o.useRef(void 0),[q,Y]=o.useState(y);o.useLayoutEffect(()=>{Y(y)},[y]),o.useLayoutEffect(()=>{const W=M.current;W&&(p!==void 0&&W.style.setProperty("--pass-card-text",p),m!==void 0&&W.style.setProperty("--pass-card-sub",m),g!==void 0&&W.style.setProperty("--pass-card-copyright",g))},[p,m,g]),o.useLayoutEffect(()=>{const W=M.current;if(!W)return;const H=m2(W);if(!y){const ie=N2[w],Te=c==="expired"?"_mono":H?.logoColor??"",ye=k2(ie,Te);Y(ye)}},[d,y,w,c]);const U=W=>{const H=M.current;if(!H)return null;const{left:ie,top:Te,width:ye,height:he}=H.getBoundingClientRect(),Se=(W.clientX-ie)/ye-.5;return{rotateX:-((W.clientY-Te)/he-.5)*cu,rotateY:Se*cu}},S=(W,H)=>{const ie=H*-.7,Te=W*.7+10,ye=20+(Math.abs(W)+Math.abs(H))*.4;return`${ie}px ${Te}px ${ye}px rgba(0, 0, 0, 0.18)`},I=o.useCallback(W=>{if(Ca())return;K.current=!0,clearTimeout(T.current),T.current=setTimeout(()=>{K.current=!1},200);const H=U(W);H&&L({transform:`perspective(800px) rotateX(${H.rotateX}deg) rotateY(${H.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(H.rotateX,H.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)"})},[]),O=o.useCallback(W=>{if(Ca())return;const H=U(W);if(!H)return;const ie=K.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${H.rotateX}deg) rotateY(${H.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(H.rotateX,H.rotateY),transition:ie})},[]),z=o.useCallback(()=>{clearTimeout(T.current),K.current=!1,L({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)"})},[]),se=o.useCallback(()=>Z(null),[]),te=o.useMemo(()=>{const W=x("passCard.planSuffix","\uC774\uC6A9\uAD8C"),H=D.replace("\uC774\uC6A9\uAD8C","").replace(W==="\uC774\uC6A9\uAD8C"?"":W,"").trim(),ie=H.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:H})},[D,x]),de=o.useMemo(()=>{const W=da(k);if(!W)return null;const H=W.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!H)return n.jsx("span",{className:"h1",children:W});const[,ie,Te,ye]=H;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:Te}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[k]),ee=o.useCallback(()=>{F&&Z(W=>{if(W)return null;const H=M.current?.getBoundingClientRect();if(!H)return null;const ie=50;return{left:H.left,right:H.right,width:H.width,height:H.height,x:H.x,y:H.y+ie,top:H.top+ie,bottom:H.bottom+ie}})},[F]),V=o.useCallback(W=>{F&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),ee())},[F,ee]),ne=[{items:[...B?[{label:x("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{B(),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:M,className:`pass-card pass-card--${c}${F?" pass-card--clickable":""}`,style:P,onMouseEnter:I,onMouseMove:O,onMouseLeave:z,onPointerUp:W=>{W.pointerType==="touch"&&z()},onPointerCancel:W=>{W.pointerType==="touch"&&z()},onClick:ee,onKeyDown:F?V:void 0,role:F?"button":void 0,tabIndex:F?0:void 0,"aria-label":e,"aria-haspopup":F?"menu":void 0,"aria-expanded":F?!!Q:void 0,children:[d??D2(w,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:q??A2[w],className:"pass-card__logo",alt:w==="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:[R&&n.jsx("span",{className:"pass-card__price-original body-3",children:da(R)}),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(xn,{anchorRect:Q,onClose:se,ariaLabel:x("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:ne,onClose:se,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=Tt(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=Tt(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}=_e.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",B=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(nt,{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(nt,{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(fe,{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,w=A.replace(/^오픈\s*특가\s*/,"")||a,D=v.prices?v.prices[i]:v.price,N=v.badge?E?`${r}
|
|
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),R=n.jsx(pu,{showPrice:!0,product:{type:B,code:v.code,name:w,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:R});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:R},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 I2(){const e=Tt(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 F2(e={}){const t=Tt(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:Be("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:B="top-right",shortcutScale:v,scaleShortcut:A=!1}){const{t:x}=_e.useTranslation(),E=Math.max(0,Math.min(1,a)),w=t/2,D=110/300,N=.18,k=W=>t*(D+(W-1)*N),R=W=>{const H=k(W.row??1),ie=W.angleDeg*Math.PI/180;return{x:w+H*Math.cos(ie),y:w+H*Math.sin(ie)}},$=Math.max(...e.map(W=>W.row??1),1),G=t*.08,M=t*.1,P=t*.24,L=t-2*G,Q=t-M-P,Z=t-P/2,F=o.useMemo(()=>[...new Set(e.map(W=>W.deg))].sort((W,H)=>W-H),[e]),K=F.length,T=Math.max(68,K>1?L/(K-1):0),q=o.useMemo(()=>new Map(F.map((W,H)=>[W,H])),[F]),Y=W=>{const H=q.get(W.deg)??0,ie=w+(H-(K-1)/2)*T,Te=$>1?Math.min(68,Q/($-1)):0,ye=Te*($-1),he=M+(Q-ye)/2,Se=$===1?M+Q*.4:he+($-(W.row??1))*Te;return{x:ie,y:Se}},U=W=>{const H=R(W),ie=Y(W);return{x:qa(H.x,ie.x,E),y:qa(H.y,ie.y,E)}},S={x:w,y:qa(w,Z,E)},I=Math.round(g*1.2),O=Math.round(Math.max(16,Math.min(80,g*.7))),z=[],se=new Map;for(const W of e){const H=W.row??1;se.has(H)||se.set(H,[]),se.get(H).push(W)}for(const[W,H]of se.entries()){if(H.length<2)continue;const ie=[...H].sort((He,ot)=>He.deg-ot.deg),Te=ie.map(He=>U(He)),ye=ie.map(He=>He.deg),he=ye[ye.length-1]-ye[0],Se=he/(ye.length-1),$e=360-he,Ne=ie.length>=3&&Se>0&&$e<=Se*1.5,ue=Math.round(k(W)*1e3)/1e3,xe=(He,ot,Qe,Je)=>{const vt=(ot.angleDeg-He.angleDeg+540)%360-180;if(vt===0)return`L ${Je.x} ${Je.y}`;if(E===0)return`A ${ue} ${ue} 0 0 ${vt>0?1:0} ${Je.x} ${Je.y}`;const je=(He.angleDeg+vt/2)*Math.PI/180,Ye={x:w+ue*Math.cos(je),y:w+ue*Math.sin(je)},we={x:(Qe.x+Je.x)/2,y:(Qe.y+Je.y)/2},Ue={x:qa(Ye.x,we.x,E),y:qa(Ye.y,we.y,E)},qe={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${qe.x} ${qe.y} ${Je.x} ${Je.y}`},ke=Ne?[...ie,ie[0]]:ie,Ee=Ne?[...Te,Te[0]]:Te;let We=`M ${Ee[0].x} ${Ee[0].y}`;for(let He=1;He<Ee.length;He++)We+=" "+xe(ke[He-1],ke[He],Ee[He-1],Ee[He]);z.push({key:`arc-${W}`,d:We})}const te=o.useMemo(()=>new Set(s??[]),[s]),de=W=>({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")})[W],ee=W=>{if(r===W.id)return"active";if(u){if(W.id===i)return"correct";if(W.id===l&&l!==i)return"wrong"}return te.has(W.id)?"played":"idle"},V=W=>r===W.id?"loop":u?W.id===i?"loop":null:c&&W.id===l?"once":null,ne=(W,H)=>{switch(W){case"played":case"correct":return n.jsx(zs,{size:H});case"wrong":return n.jsx(Xs,{size:H});default:return n.jsx(Zs,{size:H})}};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(W=>{const{x:H,y:ie}=U(W);return n.jsx("line",{x1:S.x,y1:S.y,x2:H,y2:ie,stroke:"#dde3ec",strokeWidth:"1"},W.id)}),z.map(W=>n.jsx("path",{d:W.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},W.key))]}),b&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:I,height:I,left:S.x-I/2,top:S.y-I/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:I,height:I,left:S.x,top:S.y},"aria-label":f,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(zr,{size:O,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:I,height:I,left:S.x,top:S.y},children:n.jsx(zr,{size:O,color:"currentColor",strokeWidth:1.5})}),e.map((W,H)=>{const{x:ie,y:Te}=U(W),ye=ee(W),he=V(W),Se={...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:ye!=="idle"?10:1},$e=g,Ne=Math.round(Math.max(10,Math.min(56,$e*.38))),ue=Math.round(Math.max(7,Math.min(18,$e*.2))),xe=Math.round(Math.max(10,Math.min(56,$e*.4))),ke=y==="answered"&&(ye==="played"||ye==="correct"||ye==="wrong"),Ee=y===!0||ke,We=!ke;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...Se,left:ie-$e/2,top:Te-$e/2},children:[he&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${ye}`+(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?.(W.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${ye}`,style:{width:$e,height:$e},"aria-label":de(ye)?`${W.label}, ${de(ye)}`:W.label,"aria-pressed":l!=null?W.id===l:void 0,children:[Ee&&ne(ye,Ne),We&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:y===!0?ue:xe},children:H+1})]}),W.shortcut&&n.jsx(Cu,{keys:W.shortcut,anchor:B,className:"sound-compass__speaker-shortcut"})]},W.id)})]})})}function z2({orientation:e="horizontal",label:t,className:a=""}){const r=Be("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}=_e.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=Be("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(nt,{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=Be("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(nt,{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}=_e.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(fe,{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}=_e.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}=_e.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(nt,{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}=_e.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 w=a?E:E.slice(0,1);if(l===void 0){const D=a?[...y,...w]:w;g(D),e?.(D)}else e?.(w)},f=x=>{x.preventDefault(),!r&&p(!0)},_=x=>{x.preventDefault(),p(!1)},b=x=>{x.preventDefault(),p(!1),!r&&C(x.dataTransfer.files)},B=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((w,D)=>D!==x);g(E),i||e?.(E)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:Be("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(nt,{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:B,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(nt,{icon:"x",size:14})})]},`${x.name}-${E}`))})]})}function ev({items:e,className:t=""}){const{t:a}=_e.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(nt,{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}=_e.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(w=>w.dataset.star===String(E))?.focus()},B=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:B,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 w=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(nt,{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(nt,{icon:"star",size:g,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:k},w):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===w,"aria-label":u("rating.starLabel",{n:w}),"data-star":w,tabIndex:w===v?0:-1,onClick:()=>C(w),onMouseEnter:()=>f(w),children:k},w)})})}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}=_e.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(nt,{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}=_e.useTranslation(),d=u==="small",h=Be("category-icon",d?"category-icon--small":""),p=d?16:20,m=o.useRef(null),[g,y]=o.useState(!1),C=o.useMemo(()=>{const w=r&&typeof r=="object"?{...r}:{};return!s&&!l?w:{...w,...s?{color:s,"--t-item-fg":s}:{},...l?{"--t-item-bg":l}:{}}},[r,s,l]),f=a||t,_=i&&!!f,[b,B]=o.useState(null);o.useLayoutEffect(()=>{g&&B(m.current?.getBoundingClientRect()??null)},[g]),o.useEffect(()=>{if(!i&&g)try{y(!1)}catch{}},[i,g]),o.useEffect(()=>{if(!g)return;const w=D=>{const N=m.current;if(!N)return;const k=D.target;k&&!N.contains(k)&&y(!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!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(w=>{if(w.key==="Escape"){y(!1);return}(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),y(D=>!D))},[]);return n.jsxs("span",{ref:m,className:Be("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(nt,{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()===""){xt("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 w=Bl(E,f);if(!w){A.push("");continue}let D=null;try{D=await kl(w)}catch{}if(!D)try{const N=await Al(w);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 B=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 w=0;w<b.length&&d.current;w++){const D=b[w];if(D&&(l(w),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:B}}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:B="square"}=e||{},{t:v}=_e.useTranslation(),[A,x]=o.useState(!1),E=o.useRef(null),[w,D]=o.useState(!1);o.useEffect(()=>{E.current?.matches(":hover")&&D(!0)},[]);const{playing:N,playingIndex:k,previewUrls:R,previewHover:$,setPreviewHover:G,previewBtnRef:M,handlePreview:P}=lv(r,a?.key),L=o.useCallback(()=>{f?f():x(!0)},[f]),Q=o.useCallback(()=>x(!1),[]),Z=o.useCallback(()=>D(!0),[]),F=o.useCallback(()=>D(!1),[]),K=o.useCallback(()=>G(!0),[G]),T=o.useCallback(()=>G(!1),[G]),[q,Y]=o.useState(null);o.useLayoutEffect(()=>{$&&Y(M.current?.getBoundingClientRect()??null)},[$,M]);const[U,S]=o.useState(null);o.useLayoutEffect(()=>{w&&!A&&p&&S(E.current?.getBoundingClientRect()??null)},[w,A,p]);const I=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),L())},[L]),O=r||null,z=o.useMemo(()=>{if(!p)return null;const we=h?(Array.isArray(h)?h:[h]).filter(Boolean):null,Ue=we&&we.length>0?we:iv(O);return Ue&&Ue.length>0?Ue:null},[p,h,O]),se=o.useCallback(we=>{we.stopPropagation(),m?.()},[m]),te=o.useCallback(we=>we.stopPropagation(),[]),de=o.useCallback(we=>{typeof C=="function"&&C(we)},[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 ne=Zl(),W=`${a?.label||""} ${t+1}`,H=O?.title||O?.name||W;let ie=a?.icon,Te,ye="",he="";try{const we=O?.category_0||O?.category_main_code||O?.category_main,Ue=O?.category_1||O?.category_sub_code||O?.category_sub,qe=ne.find(pt=>pt.key===we);qe?.icon&&(ie=qe.icon),!Te&&qe?.color&&(Te={"--t-item-fg":qe.color}),!Te&&O?.iconColor&&(Te={"--t-item-fg":O.iconColor}),ye=qe?v(`topic.${qe.key}`,{defaultValue:qe.label||""}):"";try{const pt=qe?.subs?.find(_t=>_t.key===Ue);he=pt?v(`topic.sub.${pt.key}`,{defaultValue:pt.label||""}):""}catch{}}catch{}const Se=he?`${ye} / ${he}`:ye||a?.label||H,$e=we=>v("training.countQuestions",{n:we,count:we}),Ne=we=>v("training.countSentences",{n:we,count:we});let ue="";try{if(O)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(O.items)&&O.items.length>0?we=O.items.length:Array.isArray(O.sentences)&&O.sentences.length>0?we=O.sentences.length:O.sentences&&(we=1),ue=Ne(we)}else if(a?.key==="SHORT_STORY"){let we=1;Array.isArray(r?.items)?we=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?we=r.raw.items.length:Array.isArray(O?.questions)?we=O.questions.length:Array.isArray(O?.sentences)&&(we=O.sentences.length),ue=$e(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(O.items)&&O.items.length>0){const Ue=O.items.reduce((qe,pt)=>{const _t=pt.questionItems;return Array.isArray(_t)?qe+_t.length:Array.isArray(pt.questions)?qe+pt.questions.length:qe},0);we=Ue>0?Ue:O.items.length}else Array.isArray(O.questions)&&O.questions.length>0?we=O.questions.length:Array.isArray(O.sentences)&&O.sentences.length>0&&(we=O.sentences.length);ue=$e(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(O.items)&&O.items.length>0?we=O.items.length:Array.isArray(O.sentences)&&O.sentences.length>0&&(we=O.sentences.length),ue=Ne(we)}else Array.isArray(O.items)&&(ue=O.items.length>0?$e(O.items.length):"")}catch{}const xe=B==="row",ke=B==="list"||xe,Ee=B==="compact",We=B==="small",He=We&&a?.key?qf().find(we=>we.key===a.key):void 0,ot=He?Xl[He.key]:void 0,Qe=He?ot?v(`trainingType.${ot}.title`,{defaultValue:He.label}):He.label??"":"",Je=y&&a?.label&&a.label!==String(H)?String(a.label):We&&Qe&&Qe!==String(H)?Qe:"",vt=!!Je,je=b!==void 0?b:ue,Ye=[Je,typeof H=="string"?H:"",je].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:E,className:`training-block-button${ke?" training-block-button--list":""}${xe?" training-block-button--row":""}${Ee?" training-block-button--compact":""}${We?" training-block-button--small":""}${ee?" training-block-button--completed":""}${V?" training-block-button--selected":""}${vt&&!We?" training-block-button--withType":""}${We&&!vt?" training-block-button--no-type-label":""}`,onClick:L,onPointerEnter:Z,onPointerLeave:F,role:"button",tabIndex:0,onKeyDown:I,"aria-label":typeof s=="string"?s:Ye||void 0,title:!p&&h&&(Array.isArray(h)?h.filter(Boolean).join(`
|
|
824
|
+
`):h)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[y&&a?.label&&a.label!==String(H)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),We&&Qe&&Qe!==String(H)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:Qe}),n.jsx(bu,{icon:ie,label:H,tooltip:Se,wrapperStyle:Te,iconSize:We||Ee?"small":"medium"}),!g&&(ee||V)&&!(m&&w)&&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${w?" is-hover":""}`,icon:"remove",position:"top-left",size:32,"aria-label":v("common.remove","\uC81C\uAC70"),onClick:se}),n.jsx("div",{className:`training-block-button__title ${Ee?"body-3":We?"body-3b":"h3"}`,children:String(H)}),n.jsxs("div",{className:"training-block-button__description",children:[je?n.jsx("div",{className:`training-block-button__count ${We?"caption-2":"caption-1"}`,children:je}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(nt,{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:We?12:20})})]}),(ke&&!xe||We)&&R.length>0&&n.jsx("div",{ref:M,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:te,onPointerEnter:K,onPointerLeave:T,children:n.jsx(fe,{htmlType:"button",size:We?28:32,type:"dot",icon:N?"pause":"play",variant:We?"transparent-lightGray":"default",useBorder:!1,selected:N,ariaLabel:String(H).trim()?N?v("training.stopFor",{name:H,defaultValue:`${H} \uC815\uC9C0`}):v("training.previewFor",{name:H,defaultValue:`${H} \uBBF8\uB9AC \uB4E3\uAE30`}):N?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:P})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(H).trim()?v("common.moreFor",{name:H}):v("common.more","\uB354\uBCF4\uAE30")})})]}),$&&n.jsx(Tn,{anchorRect:q,text:N?v("training.stop","\uC815\uC9C0"):v("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:T}),w&&!A&&p&&(z?n.jsx(Xn,{anchorRect:U,items:z,activeIndex:k,onClose:F}):O?.subTitle?n.jsx(Tn,{anchorRect:U,text:O.subTitle,offset:8,onClose:F}):null),A&&i&&i({trainingData:O,typeKey:a?.key??"",onClose:Q,onComplete:de,popupTitle:String(H),popupSubTitle:a?.subTitle,depth:l!=null?String(l):void 0,popupIcon:ie,popupIconTooltip:String(Se),popupWrapperStyle:Te})]})}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}=_e.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:le("training-tooltip__box"),children:n.jsx("div",{className:le("training-tooltip__groups"),children:i.flatMap(({key:c,label:d,type:h,data:p},m)=>[m>0?n.jsx("div",{className:le("training-tooltip__divider")},`div-${c}`):null,n.jsxs("div",{className:le("training-tooltip__section"),children:[n.jsx("div",{className:le("training-tooltip__section-header"),children:n.jsx("span",{className:le("training-tooltip__type-label body-3b"),children:d})}),n.jsx("div",{className:le("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(xn,{anchorRect:a,offset:r,onClose:s,closeOnOutsideClick:!1,className:le("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=Be("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)},[]),B=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)&&B()},[s,r,B]),o.useEffect(()=>{if(!_)return;const x=w=>w instanceof Element&&(m.current?.contains(w)||!!w.closest(".training-tooltip")),E=w=>{x(w.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=>{B(),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"?B():v()},onMouseEnter:c,onMouseLeave:x=>{A(),d?.(x)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(nt,{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:B})]})}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}=_e.useTranslation(),m=o.useId(),g=o.useRef(null),y=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const b=document.activeElement,B=_u(),v=g.current;return bo(v,b),v?.focus(),()=>{B();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:dn.createPortal(n.jsx("div",{className:Be("dialog",d),onPointerDown:i?b=>{_.current=b.target===b.currentTarget}:void 0,onMouseDown:b=>{b.target===b.currentTarget&&b.preventDefault()},onClick:i?b=>{const B=_.current;_.current=!1,B&&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:Be("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}=_e.useTranslation(),h=!i&&t.length===0;return n.jsxs("div",{className:Be("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:Be("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:Be("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:Be("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:Be("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:Be("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=Ia(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:Be("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:Be("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 yn(e){const{t}=_e.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();xt(`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}`},B=g.some(v=>v.key===r)?r:g[0]?.key;return n.jsx("div",{ref:m,onKeyDown:_,className:Be("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(fe,{htmlType:"button",role:"radio","aria-checked":v.key===r,"data-segkey":v.key,tabIndex:v.key===B?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}=_e.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:B="",ariaLabel:v,useTitle:A=!0,inline:x=!1,size:E,layer:w="modal",height:D,fillBody:N=!1,resetScrollKey:k}=e||{},[R,$]=o.useState(!1),G=o.useRef(!1),M=o.useRef(null),P=o.useId(),L=o.useRef(null);o.useEffect(()=>{},[x,a,v,B]),o.useEffect(()=>{k!==void 0&&L.current&&(L.current.scrollTop=0)},[k]);const[Q,Z]=o.useState(!1);o.useEffect(()=>{const V=L.current;if(!V)return;const ne=()=>Z(V.scrollHeight>V.clientHeight+1);if(ne(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(ne);W.observe(V);const H=V.firstElementChild;return H&&W.observe(H),()=>W.disconnect()},[i,k]),o.useEffect(()=>{if(!x)return _u()},[x]);const F=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{if(x)return;const V=F.current,ne=M.current;return bo(ne,V),ne&&!ne.contains(document.activeElement)&&(ne.querySelector(Nn)??ne).focus(),()=>{const W=document.activeElement;(!W||W===document.body||ne&&ne.contains(W))&&go(V)?.focus?.()}},[x]),Co(M,!x);const K=o.useRef(!0),T=yo(),q=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,q.current&&(clearTimeout(q.current),q.current=null)}),[]);const Y=o.useCallback(()=>{!K.current||!G.current||(G.current=!1,$(!1))},[]),U=o.useCallback((V,ne=!1)=>{if(ne&&!K.current||G.current)return;G.current=!0,$(!0);const W=setTimeout(()=>{q.current===W&&(q.current=null);let H;try{H=V?V():void 0}catch{Y();return}H&&typeof H.then=="function"&&H.then(()=>{setTimeout(Y,120)},Y)},T?0:xv);ne&&(q.current=W)},[Y,T]),S=o.useCallback(()=>{f||_&&_()===!1||U(C,!0)},[U,C,f,_]),I=o.useRef(S);o.useEffect(()=>{I.current=S});const O=!x&&!!C;o.useEffect(()=>{if(O)return Zn(()=>I.current())},[O]);const z=O&&b,se=o.useRef(!1),te=V=>{se.current=V.target===V.currentTarget},de=V=>{const ne=se.current;se.current=!1,ne&&V.target===V.currentTarget&&S()},ee=n.jsx("div",{className:`popup ${x?"popup--inline":""} ${w==="belowPagePopup"?"popup--below-page-popup":""} ${R?"popup--closing":""} ${B}`,onPointerDown:z?te:void 0,onClick:z?de:void 0,onMouseDown:x?void 0:V=>{V.target===V.currentTarget&&V.preventDefault()},children:n.jsxs("div",{ref:M,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?P: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(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,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:P,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:P,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(yn,{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(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:f,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]})]}):null,n.jsx("div",{className:"popup-content",ref:L,tabIndex:Q?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof i=="function"?i({animateThen:U,closeWithAnimation:S}):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:S}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof h=="function"?h({animateThen:U,closeWithAnimation:S}):h})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${y!=="center"?` popup-footer--${y}`:""}`,children:u.map((V,ne)=>n.jsx(fe,{htmlType:"button",size:48,variant:V.variant??"default",label:V.label,disabled:V.disabled,onClick:()=>V.onClick?.({animateThen:U,closeWithAnimation:S})},ne))}):c?n.jsx("div",{className:`popup-footer${y!=="center"?` popup-footer--${y}`:""}${g?` ${g}`:""}`,children:typeof c=="function"?c({animateThen:U,closeWithAnimation:S}):c}):null]})});return x||typeof document>"u"?ee:dn.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 vn({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}=_e.useTranslation(),m=r??p("dropdown.placeholder","\uC120\uD0DD"),g=o.useId(),y=o.useId(),C=o.useRef(null),f=o.useCallback((M,P)=>{const L=window.innerHeight-M.bottom<260&&M.top>260;return{position:"fixed",left:M.left,minWidth:M.width,...L?{bottom:window.innerHeight-M.top+6}:{top:M.bottom+6},zIndex:za(P)}},[]),{open:_,setOpen:b,toggle:B,style:v,triggerRef:A,menuRef:x}=Wa({computeStyle:f}),[E,w]=o.useState(-1),D=o.useCallback(()=>w(-1),[]),N=e.find(M=>M.value===t);o.useEffect(()=>{if(_){const M=e.findIndex(P=>P.value===t);w(M>=0?M:e.length?0:-1),requestAnimationFrame(()=>{const P=x.current;if(!P)return;const L=P.querySelectorAll(".dropdown__option")[M];L&&(P.scrollTop=Math.max(0,L.offsetTop-P.clientHeight/2+L.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&w(M=>{if(M>=0&&M<e.length)return M;const P=e.findIndex(L=>L.value===t);return P>=0?P:e.length?0:-1})},[_,e.length]);const k=o.useCallback(()=>{s||B()},[s,B]),R=o.useCallback(M=>{M.disabled||s||(M.value!==t&&a?.(M.value),b(!1))},[a,b,s,t]);o.useEffect(()=>{s&&b(!1)},[s,b]);const $=o.useCallback(M=>{if(!s){if(!_){(M.key==="Enter"||M.key===" "||M.key==="ArrowDown")&&(M.preventDefault(),b(!0));return}if(M.key==="Escape"){M.preventDefault(),b(!1);return}M.key==="ArrowDown"?(M.preventDefault(),w(P=>{let L=P+1;for(;L<e.length&&e[L].disabled;)L++;return L<e.length?L:P})):M.key==="ArrowUp"?(M.preventDefault(),w(P=>{let L=P-1;for(;L>=0&&e[L].disabled;)L--;return L>=0?L:P})):(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),e[E]?R(e[E]):b(!1))}},[s,_,e,E,R,b]),G=_?n.jsx("div",{ref:x,id:g,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:v,onMouseLeave:D,onMouseDown:M=>M.preventDefault(),children:e.map((M,P)=>n.jsxs("button",{id:`${g}-option-${P}`,type:"button",role:"option","aria-selected":M.value===t,className:Be("dropdown__option body-2",M.value===t?"dropdown__option--active":"",P===E?"dropdown__option--active":"",M.disabled?"dropdown__option--disabled":""),onMouseDown:L=>L.preventDefault(),onClick:()=>R(M),onMouseEnter:()=>w(P),disabled:M.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:M.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"})})}),M.label]},M.value))}):null;return n.jsxs("div",{ref:C,className:Be("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:M=>{_&&!x.current?.contains(M.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"&&dn.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(R=>Nu(R).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),[]),B=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),[]),w=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(R=>Math.min(_.length-1,(R<_.length?R:v)+1))):k.key==="ArrowUp"?(k.preventDefault(),p(R=>Math.max(v,(R<_.length?R:_.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:w,handleKeyDown:N,handleSelect:x,handleCompositionStart:b,handleCompositionEnd:B}}const Io=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:B=40,variant:v="input",fullWidth:A=!1,newline:x=!1,multiline:E=!1,rows:w=3,leftIcon:D,rightIcon:N,clearable:k=!1,list:R,showCount:$=!0,className:G="",onFocus:M,onBlur:P,onKeyDown:L,onEnter:Q,inputMode:Z,autoComplete:F,autoFocus:K,suggestions:T,filterSuggestions:q,onSelectSuggestion:Y,autoActiveFirst:U,openOnFocus:S=!1}=e,I=C||y?void 0:T,{t:O}=_e.useTranslation(),z=o.useId();!i&&!u&&xt(`TextField:unnamed:${z}`,"[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 se=`tf-${z}`,te=`tf-helper-${z}`,de=o.useRef(null),ee=Eu({value:t??"",onChange:l,suggestions:I??[],openOnFocus:S,filterSuggestions:q,onSelectSuggestion:Y,autoActiveFirst:U}),V=!!I&&ee.open&&ee.filtered.length>0,ne=o.useRef(null),[W,H]=o.useState(null),ie=o.useCallback(()=>{const je=ne.current;if(!je||typeof window>"u")return;const Ye=je.getBoundingClientRect(),we=230,Ue=window.innerHeight-Ye.bottom<we+8&&Ye.top>we+8;H({position:"fixed",left:Ye.left,width:Ye.width,...Ue?{bottom:window.innerHeight-Ye.top+8}:{top:Ye.bottom+8},zIndex:za(je)})},[]);Io(()=>{if(!V)return;ie();let je=null;const Ye=()=>{if(typeof requestAnimationFrame>"u"){ie();return}je===null&&(je=requestAnimationFrame(()=>{je=null,ie()}))},we=Ue=>{const qe=Ue.target;qe&&qe.nodeType===1&&qe.closest?.(".text-field__suggestions")||Ye()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",Ye),()=>{je!==null&&cancelAnimationFrame(je),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Ye)}},[V,ie]);const Te=o.useCallback(je=>{de.current=je,typeof s=="function"?s(je):s&&(s.current=je)},[s]),ye=p?`${p}${m??O("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:h,he=t!==void 0,Se=he&&g==="password",[$e,Ne]=o.useState((a??"").length),ue=he?(t??"").length:$e,xe=o.useRef(t);Io(()=>{xe.current=t}),o.useEffect(()=>{const je=de.current;if(!Se||!je)return;const Ye=t??"";je.value!==Ye&&(je.value=Ye)},[Se,t]),o.useEffect(()=>{if(!x||!de.current)return;const je=de.current;je.style.height="",je.scrollHeight>je.clientHeight&&(je.style.height=`${je.scrollHeight}px`)},[t,$e,x]);const ke=b!=null&&ue>b,Ee=B===32?16:20,We=Be("text-field",`text-field--s${B}`,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),He={id:se,...Se?{}:he?{value:t}:{defaultValue:a},ref:Te,placeholder:ye,name:r,disabled:y,readOnly:C,autoFocus:K,maxLength:b,list:R,inputMode:Z,autoComplete:F,"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:I?"combobox":void 0,"aria-autocomplete":I?"list":void 0,"aria-haspopup":I?"listbox":void 0,"aria-expanded":I?V:void 0,"aria-controls":V?ee.listId:void 0,"aria-activedescendant":V&&ee.activeIdx>=0?`${ee.listId}-option-${ee.activeIdx}`:void 0,onChange:je=>{const Ye=je.target;he||Ne(Ye.value.length),l?.(Ye.value),I&&ee.handleInput(),Se&&queueMicrotask(()=>{const we=xe.current??"";Ye.value!==we&&(Ye.value=we)})},onCompositionStart:I?ee.handleCompositionStart:void 0,onCompositionEnd:I?ee.handleCompositionEnd:void 0,onFocus:(je=>{M?.(je),I&&ee.handleFocus()}),onBlur:(je=>{P?.(je),I&&ee.handleBlur()}),onKeyDown:(je=>{const Ye=(je.key==="Tab"&&!je.shiftKey||je.key===" ")&&!je.nativeEvent.isComposing;if(p&&Ye&&!C&&!y&&!(je.currentTarget.value??"").trim()){je.preventDefault();const we=je.currentTarget;he||(we.value=p,Ne(p.length)),l?.(p);return}I&&je.key==="Enter"&&!je.nativeEvent.isComposing&&ee.activeIdx>=0?je.preventDefault():Q&&je.key==="Enter"&&!je.nativeEvent.isComposing&&(je.preventDefault(),Q()),L?.(je),I&&ee.handleKeyDown(je)})},ot=k&&!y&&!C&&ue>0,Qe=()=>x?n.jsx("textarea",{...He,className:"text-field__input text-field__input--auto body-2",rows:1}):E?n.jsx("textarea",{...He,className:"text-field__input text-field__input--textarea body-2",rows:w}):n.jsx("input",{...He,type:g,className:"text-field__input body-2"}),Je=v==="display"&&!x&&!E&&!!ye,vt=()=>n.jsxs(n.Fragment,{children:[Qe(),Je&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:ye})]});return n.jsxs("div",{ref:ne,className:We,children:[i&&n.jsxs("label",{htmlFor:se,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(nt,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Ee})}),vt(),b!=null&&$&&n.jsxs("span",{className:`text-field__count caption-2${ke?" text-field__count--over":""}`,children:[ue,"/",b]}),ot&&n.jsx(fe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:O("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:je=>{je.preventDefault()},onClick:()=>{!he&&de.current&&(de.current.value="",Ne(0)),l?.("")},tabIndex:-1}),N&&!ot&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(nt,{icon:N,label:"",className:"",svgClassName:"text-field__icon-svg",size:Ee})})]}),!!I&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ee.open&&(t??"").length>0&&ee.filtered.length===0?O("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),V&&(typeof document>"u"?null:dn.createPortal(n.jsx("ul",{id:ee.listId,className:"text-field__suggestions",role:"listbox",style:W??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ee.filtered.map((je,Ye)=>n.jsx("li",{id:`${ee.listId}-option-${Ye}`,role:"option","aria-selected":Ye===ee.activeIdx,className:`text-field__suggestion body-2${Ye===ee.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{ee.handleSelect(je),de.current?.focus()},children:typeof je=="string"?je:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:je.label}),je.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:je.hint})]})},typeof je=="string"?`${je}-${Ye}`:je.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:B,onClick:v,children:A,align:x="horizontal",icon:E,useFullWidth:w=!1}=e,D=N=>{v&&N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),v())};return n.jsxs("div",{className:Be("panel-row",x==="vertical"?"panel-row--vertical":"",w?"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}),B&&n.jsx("div",{className:"panel-row__sub caption-1",children:B})]}),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(yn,{options:b.options,value:b.value,onChange:b.onChange,size:b.size??40,ariaLabel:r})}else if(a==="dropdown"){const b=e,B=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(vn,{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(vn,{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:[B,n.jsx("span",{id:y,className:"caption-1 panel-row__error",role:"alert",children:u})]}):B}else if(a==="button"){const b=e;b.buttons?.length?m=n.jsx("div",{className:"panel-row__button-group",children:b.buttons.map((B,v)=>n.jsx(fe,{htmlType:"button",size:B.btnSize??40,variant:B.btnVariant??"default",disabled:B.disabled,onClick:B.onClick,children:B.label},v))}):m=n.jsx(fe,{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:Be("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}=_e.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(fe,{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:B}){const v=Be("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:Be("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(nt,{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(B).length===0?n.jsx(sn,{variant:"empty",children:b}):d?n.jsx("div",{className:Be("panel__body--scroll",h==="stable"&&"panel__body--gutter-stable"),children:B}):B]})}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:Be("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 Fo({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:Be("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}=_e.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),B=o.useId(),v=o.useCallback((V,ne)=>{const W=window.innerHeight,H=window.innerWidth,ie=typeof document<"u"?document.getElementById(B):null,Te=Math.max(ie?.offsetHeight||0,ie?.scrollHeight||0)||300,ye=Math.max(V.width,ie?.offsetWidth||0,260),he=W-V.bottom,Se=V.top,$e=he<Te&&Se>he,Ne=8,ue=(xe,ke)=>Math.min(Math.max(Ne,xe),Math.max(Ne,ke));return{position:"fixed",left:ue(V.left,H-ye-Ne),width:V.width,minWidth:260,...$e?{top:"auto",bottom:ue(W-V.top+6,W-Te-Ne)}:{bottom:"auto",top:ue(V.bottom+6,W-Te-Ne)},zIndex:za(ne)}},[B]),{open:A,setOpen:x,toggle:E,style:w,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 ne=document.activeElement;(!ne||ne===document.body)&&D.current?.focus?.()}},[A,N,D]);const[k,R]=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;R(V)},[A]),o.useEffect(()=>{if(G.current==null)return;const V=G.current;G.current=null,$.current?.querySelector(`[data-day="${V}"]`)?.focus()}),o.useEffect(()=>{R(V=>Math.min(V,vr(y,C)))},[y,C]);const M=o.useCallback(V=>{let ne=Qa(V.getFullYear(),V.getMonth(),V.getDate());r&&ne<r&&(ne=r),s&&ne>s&&(ne=s);const[W,H,ie]=ne.split("-").map(Number);(W!==y||H-1!==C)&&b(W,H-1),R(ie),G.current=ie},[r,s,y,C,b]),P=o.useCallback(V=>{const ne=new Date(y,C,k),W=ie=>{ne.setDate(ne.getDate()+ie),M(ne)},H=ie=>{const Te=ne.getFullYear()*12+ne.getMonth()+ie,ye=Math.floor(Te/12),he=Te-ye*12;M(new Date(ye,he,Math.min(ne.getDate(),vr(ye,he))))};switch(V.key){case"ArrowLeft":W(-1);break;case"ArrowRight":W(1);break;case"ArrowUp":W(-7);break;case"ArrowDown":W(7);break;case"Home":W(-ne.getDay());break;case"End":W(6-ne.getDay());break;case"PageUp":V.shiftKey?H(-12):H(-1);break;case"PageDown":V.shiftKey?H(12):H(1);break;default:return}V.preventDefault()},[y,C,k,M]),L=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 ne=Qa(y,C,V);return!!(r&&ne<r||s&&ne>s)},Z=(()=>{const V=vr(y,C);if(k>=1&&k<=V&&!Q(k))return k;for(let ne=1;ne<=V;ne++)if(!Q(ne))return ne;return-1})(),F=[];for(let V=0;V<Nv(y,C);V++)F.push(null);for(let V=1;V<=vr(y,C);V++)F.push(V);const K=a===64?20:a===40?16:18,T=ql(h.language),q=V=>new Intl.DateTimeFormat(T,{year:"numeric"}).format(new Date(V,0,1)),Y=(V,ne)=>new Intl.DateTimeFormat(T,{month:"long"}).format(new Date(V,ne-1,1)),U=jv(y,+g.slice(0,4),q,r,s),S=Tu(y,Y,r,s),I=V=>{const ne=Tu(V,Y,r,s);if(ne.length===0)return;const W=ne.some(H=>+H.value===C+1);b(V,W?C:+ne[0].value-1)},[O,z]=o.useState(null);o.useEffect(()=>{z(null)},[e]);const se=o.useCallback(V=>{z(V);const ne=Dv(V);if(!ne||r&&ne<r||s&&ne>s)return;t(ne);const[W,H]=ne.split("-");b(+W,+H-1)},[r,s,t,b]),te=o.useCallback(()=>{z(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?dn.createPortal(n.jsxs("div",{ref:N,id:B,className:"date-picker__dropdown",style:w,"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(vn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYear","\uC5F0 \uC120\uD0DD"),options:U,value:String(y),onChange:V=>I(+V),size:40}),n.jsx(vn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectMonth","\uC6D4 \uC120\uD0DD"),options:S,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:P,children:[m.map(V=>n.jsx("div",{className:"date-picker__dow caption-1",children:V},V)),F.map((V,ne)=>{if(V===null)return n.jsx("div",{},`e${ne}`);const W=Qa(y,C,V),H=W===e,ie=W===g,Te=Q(V),ye=ne%7;return n.jsx("button",{type:"button",disabled:Te,"data-day":V,tabIndex:V===Z?0:-1,"aria-current":ie?"date":void 0,onClick:()=>!Te&&L(V),className:Be("date-picker__day caption-1",H&&"date-picker__day--selected",ie&&!H&&"date-picker__day--today",Te&&"date-picker__day--disabled",ye===0&&"date-picker__day--sun",ye===6&&"date-picker__day--sat"),children:V},V)})]})]}),document.body):null;return n.jsxs("div",{className:Be("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:O??Ev(e),placeholder:p,onChange:V=>se(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}=_e.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)),B={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(fe,{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(Fo,{checked:c.includes(v),disabled:t,label:B[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(yn,{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(yn,{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}=_e.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:Be("pagination",l),children:[n.jsx(fe,{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(fe,{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}=_e.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:Be("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,m)=>n.jsx(yn,{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(vn,{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(vn,{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,`
|
|
826
826
|
`);t=t.replace(/^\n+/,"").replace(/\n+$/,"");const a=t.split(`
|
|
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}=_e.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:Be("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(fe,{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 Iv({count:e,actions:t,onClear:a,clearLabel:r,visible:s,content:l,max:i}){const{t:u}=_e.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,B=g.current;if(g.current=c,c&&!B){const v=typeof document<"u"?document.activeElement:null;m.current=v&&v!==document.body&&!b?.contains(v)?v:null}else!c&&B&&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 B=D=>{f.current=D,C(D)},v=()=>{const D=b.firstElementChild??b,A=Array.from(D.children);if(A.length<2){B(!1);return}const k=A[0].offsetTop,R=A.some(L=>L.offsetTop!==k);if(!f.current){_.current=b.clientWidth,R&&B(!0);return}if(R)return;const $=A[0],G=A[A.length-1],M=G.offsetLeft+G.offsetWidth-$.offsetLeft,P=_.current;(P==null||M<=P)&&B(!1)};if(v(),typeof ResizeObserver>"u")return;const N=new ResizeObserver(v);N.observe(b);const x=b.parentElement;let E=x?.clientWidth??0;const w=new ResizeObserver(()=>{const D=x?.clientWidth??0;D!==E&&(E=D,_.current=null,v())});return x&&w.observe(x),()=>{N.disconnect(),w.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(fe,{htmlType:"button",size:40,label:d,onClick:a}),t.map((b,B)=>n.jsx(fe,{htmlType:"button",size:40,variant:b.variant??"default",icon:b.icon,label:b.label,onClick:b.onClick},B))]})]})}const Fv=[{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:Be("item-actions",a),children:Fv.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(fe,{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:Be("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:Be("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:Be("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:Be("section-head-float",t),children:e})}function Wo({items:e,className:t}){return n.jsx("div",{className:le(t?`chart-section__legend ${t}`:"chart-section__legend"),children:e.map((a,r)=>n.jsxs("span",{className:le("chart-section__legend-item"),children:[n.jsx("span",{className:le("chart-section__legend-dot"),style:{background:a.color}}),a.label]},r))})}function er({label:e,children:t}){return e?n.jsxs("div",{className:le("chart-section__total chart-section__total--stacked"),children:[n.jsx("span",{className:le("chart-section__total__label body-3"),children:e}),n.jsx("span",{className:le("chart-section__total__value"),children:t})]}):n.jsx("div",{className:le("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:B=!1,children:v}){const{t:N}=_e.useTranslation(),x=o.useRef(null),{anchorRect:E,openAt:w,close:D}=Oa(),A=o.useCallback(()=>{m&&x.current&&w(x.current)},[m,w]),[k,R]=o.useState(!1);Io(()=>{const S=x.current;if(!S||!u)return;const I=z=>R(z>0&&z<d);if(I(S.clientWidth),typeof ResizeObserver>"u")return;const O=new ResizeObserver(z=>I(z[0].contentRect.width));return O.observe(S),()=>O.disconnect()},[u,d]);const[$,G]=o.useState(null),M=o.useCallback(()=>G(null),[]),P=o.useCallback(S=>{const I=S.currentTarget.getBoundingClientRect();G(O=>O?null:{left:I.left,right:I.right,top:I.top,bottom:I.bottom,width:I.width,height:I.height,x:I.x,y:I.y})},[]),L=!!u&&k;o.useEffect(()=>{L||G(null)},[L]);const Q=u?[...u.options.map(S=>({label:S.label,icon:S.icon,selected:S.key===u.value,disabled:S.disabled,onClick:()=>u.onChange(S.key),closeOnSelect:!0})),...(c??[]).map((S,I)=>I===0?{...S,separatorBefore:!0}:S)]:[],Z=o.useCallback(S=>{if(!h)return;const I=S.target;I&&typeof I.closest=="function"&&I.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),F=o.useCallback(S=>{h&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},[h]),K=typeof l=="function"?l({collapsed:L}):l,T=g!=null||C?n.jsxs(er,{label:C,children:[g!=null&&n.jsx("span",{className:le("chart-section__total__num h0"),children:g}),y&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:y})]}):null,q=K||u?n.jsxs("div",{className:le("chart-section__head-right"),children:[u&&(L?n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??N("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??N("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!$,onClick:P}):n.jsx(yn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(S=>({key:S.key,label:S.label,disabled:S.disabled})),value:u.value,onChange:u.onChange})),K]}):null,Y=o.useId(),U=a?`h${a}`:"div";return n.jsxs("section",{ref:x,className:le(["chart-section",B&&"chart-section--grid",h&&"chart-section--clickable",b].filter(Boolean).join(" ")),onClick:h?Z:void 0,onKeyDown:h?F:void 0,onPointerEnter:m?A:void 0,onPointerLeave:m?D:void 0,onFocus:m?A: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:le("chart-section__head"),children:[n.jsxs("div",{className:le("chart-section__title-row"),children:[r&&n.jsx(nt,{icon:r,label:typeof e=="string"?e:void 0,className:le("chart-section__icon")}),n.jsx(U,{id:Y,className:le(["chart-section__title",t].filter(Boolean).join(" ")),children:e})]}),q,s&&n.jsx("div",{className:le("chart-section__disc body-3"),children:s})]}),(T||f)&&n.jsxs("div",{className:le(["chart-section__sub-row",_!=="start"&&`chart-section__sub-row--${_}`].filter(Boolean).join(" ")),children:[T,f]}),v,$&&n.jsx(xn,{anchorRect:$,onClose:M,ariaLabel:u?.ariaLabel??N("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:[{items:Q}],onClose:M,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,N)=>Math.max(v,N.parts?.length??0,N.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)),B=Array.from({length:g+1},()=>new Array(y).fill(0));for(const v of d){const N=v.date.getDate();if(f[N]+=v.a,_[N]+=v.b,v.parts)for(let x=0;x<y;x++)b[N][x]+=v.parts[x]??0;if(v.partsB)for(let x=0;x<y;x++)B[N][x]+=v.partsB[x]??0}l.set(c,{year:p,month:m,daysInMonth:g,partsLen:y,hasPartsB:C,dayA:f,dayB:_,dayParts:b,dayPartsB:B})}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(),B=l.get(r(p===11?h+1:h,(p+1)%12)),v=d.partsLen,N=[];for(let E=1;E<=m;E++){const w=_&&E>b;N.push({label:String(E),...w&&g[E]===0&&y[E]===0?{future:!0}:{},a:w&&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 w=Math.max(0,E+6-m),D=w&&B?Math.max(v,B.partsLen):v,A=d.hasPartsB||!!(w&&B?.hasPartsB);let k=0,R=0;const $=new Array(D).fill(0),G=new Array(D).fill(0);for(let P=E;P<=Math.min(E+6,m);P++){k+=g[P],R+=y[P];for(let L=0;L<v;L++)$[L]+=C[P][L],G[L]+=f[P][L]}if(w&&B)for(let P=1;P<=w&&!i(B.year,B.month,P);P++){k+=B.dayA[P],R+=B.dayB[P];for(let L=0;L<B.partsLen;L++)$[L]+=B.dayParts[P][L],G[L]+=B.dayPartsB[P][L]}const M=w?`${(p+1)%12+1}/${w}`:`${E+6}`;x.push({label:`${x.length+1}\uC8FC`,sublabel:`[${E}\uC77C~${M}\uC77C]`,a:k,b:R,...D?{parts:$}:{},...D&&A?{partsB:G}:{}})}u[c]={weekly:x,daily:N}}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 Iu(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 Fu(e){const{t,i18n:a}=_e.useTranslation(),[r,s]=o.useState("week"),l=o.useMemo(()=>qv().filter(D=>D.value in e),[e]),i=o.useMemo(()=>{const D=[];for(const A of l){const k=new Date(A.year,A.month,0).getDate(),R=Dn(A.year,A.month-1),$=Math.ceil((k-R+1)/7);for(let G=$-1;G>=0;G--)D.push({value:qo(A.value,G),monthKey:A.value,year:A.year,month:A.month,week:G})}return D},[l]),u=o.useCallback(D=>`${io(t,a.language,D.year,D.month)} ${Iu(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,B=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]),N=_.findIndex(D=>D.value===b),x=o.useCallback(()=>{const D=_.findIndex(A=>A.value===b);D<_.length-1&&B(_[D+1].value)},[_,b,B]),E=o.useCallback(()=>{const D=_.findIndex(A=>A.value===b);D>0&&B(_[D-1].value)},[_,b,B]),w=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:B,activeOptions:_,activeIdx:N,handlePrev:x,handleNext:E,periodOptions:w,monthRange:g,weekRange:C,weekRanges:i,DOW:v}}const Nt=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,B=o.useMemo(()=>_?Math.max(0,...e.filter(F=>!Pn(F,b==null)).map(F=>g?Math.max(0,...(F.parts??[]).map(Nt)):(F.parts??[]).reduce((K,T)=>K+Math.max(0,Nt(T)),0))):Math.max(0,...e.filter(F=>!Pn(F,b==null)).flatMap(F=>f?[Nt(F.a)]:[Nt(F.a),Nt(F.b)])),[e,f,_,g]),v=o.useMemo(()=>{if(b==null)return 0;const F=e.filter(K=>!Pn(K,b==null)).flatMap(K=>_?(K.parts??[]).map(Nt):f?[Nt(K.a)]:[Nt(K.a),Nt(K.b)]);return Math.max(0,...F.map(K=>Math.abs(K-b)))},[e,b,_,f]),N=o.useMemo(()=>{const F=b!=null?v:B;return c??(d?F>0?F:10:Math.ceil(F/10)*10||10)},[B,v,b,c,d]),x=u,E=_?g?Math.max(1,h.length):1:f?1:2,w={"--bar-width":`${o.useMemo(()=>{const F=Math.max(1,e.length);return Math.max(2,Math.min(l,Math.round(120/(F*E)+6)))},[e.length,E,l])}px`},D={"--bar-group-gap":`${Math.max(0,i)}px`},A=o.useMemo(()=>{const F=Math.round(N/2);return b!=null?[b+N,...F!==N?[b+F]:[],b,...F!==N?[b-F]:[],b-N]:F!==N?[N,F,0]:[N,0]},[N,b]),k=F=>b!=null?1-(F-(b-N))/(2*N):1-F/N,[R,$]=o.useState(null),G=o.useCallback(()=>$(null),[]),M=o.useCallback((F,K)=>{const T=[F.label,F.sublabel].filter(Boolean).join(" ");let q;if(_&&g&&F.rawPartsB)q=(p??[]).map((Y,U)=>{const S=F.rawPartsB[U]??0;return{text:S>0?`${Y}: ${K[U]??0}% (${F.rawParts?.[U]??0}/${S})`:`${Y}: -`,color:(h??[])[U]}});else if(_&&g)q=(p??[]).map((Y,U)=>({text:`${Y}: ${Q(K[U]??0)}`,color:(h??[])[U]}));else if(_){const Y=(p??[]).map((S,I)=>({text:`${S}: ${K[I]??0}`,color:(h??[])[I]})),U=Y.filter((S,I)=>(K[I]??0)>0);q=U.length?U:Y}else m&&!f?q=[{text:`${r} ${Nt(F.a)}%`,color:t},{text:`${s} ${Nt(F.b)}%`,color:a}]:m&&F.rawB!==void 0?q=[{text:`${m.total} ${F.rawB}`},{text:`${m.done} ${F.rawA??0}`,color:t}]:f?q=[{text:`${r}: ${Nt(F.a)}`,color:t}]:q=[{text:`${r}: ${Nt(F.a)}`,color:t},{text:`${s}: ${Nt(F.b)}`,color:a}];return{title:T,items:q}},[_,g,p,h,m,f,r,s,t,a,b]),P=o.useCallback((F,K,T)=>{const q=F.getBoundingClientRect(),{title:Y,items:U}=M(K,T);$({rect:{left:q.left,top:q.top,right:q.right,bottom:q.bottom,width:q.width,height:q.height},title:Y,items:U})},[M]),L=o.useCallback((F,K)=>{const{title:T,items:q}=M(F,K);return[T,...q.map(Y=>Y.text)].filter(Boolean).join(", ")},[M]),Q=F=>b!=null&&F>b?`+${F}`:`${F}`,Z=R!=null;return o.useEffect(()=>{if(!Z)return;const F=()=>$(null),K=T=>{const q=T.target;q&&typeof q.closest=="function"&&q.closest(".bar-chart__col")||$(null)};return window.addEventListener("scroll",F,!0),document.addEventListener("pointerdown",K,!0),()=>{window.removeEventListener("scroll",F,!0),document.removeEventListener("pointerdown",K,!0)}},[Z]),n.jsxs("div",{className:le("bar-chart__wrap"),style:D,children:[n.jsx("div",{className:le("bar-chart__inner"),children:n.jsx("div",{className:le("bar-chart__scroll"),children:n.jsxs("div",{className:le("bar-chart__area"),children:[n.jsxs("div",{className:le("bar-chart__plot"),style:{height:x},children:[A.slice(0,-1).map((F,K)=>n.jsx("div",{className:le(`bar-chart__gridline${b!=null&&F===b?" bar-chart__gridline--baseline":""}`),style:{top:k(F)*x},children:n.jsx("span",{className:le("bar-chart__gridline__label caption-1"),children:F})},K)),e.map((F,K)=>{const T=Pn(F,b==null),q=x/2,Y=O=>b!=null?Math.min(q,Math.abs(Nt(O)-b)/N*q):Math.min(x,Math.max(0,Nt(O)/N*x)),U=T?0:Y(F.a),S=T?0:Y(F.b),I=(F.parts??[]).map(Nt);return n.jsx("div",{className:le(`bar-chart__col${g&&_?" bar-chart__col--group":""}`),style:{cursor:T?"default":"pointer"},tabIndex:C&&!T?0:void 0,role:C&&!T?"img":void 0,"aria-label":C&&!T?L(F,I):void 0,onMouseEnter:T?void 0:O=>P(O.currentTarget,F,I),onFocus:T||!C?void 0:O=>P(O.currentTarget,F,I),onBlur:C?G:void 0,onMouseLeave:G,children:!T&&(_&&g?(h??[]).map((O,z)=>{const se=I[z]??0;if(b==null)return n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:Y(se),background:O}},z);const te=Nt(se)<b;return n.jsxs("div",{className:le("bar-chart__slot"),style:w,children:[n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--up"),children:!te&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full"),style:{height:Y(se),background:O}})}),n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--down"),children:te&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(se),background:O}})})]},z)}):_?n.jsx("div",{className:le("bar-chart__stack"),style:w,children:(()=>{const O=I.reduce((se,te,de)=>te>0?de:se,-1);let z=x;return I.map((se,te)=>{if(se<=0)return null;const de=Math.min(z,se/N*x);return z-=de,n.jsx("div",{className:le("bar-chart__stack-segment"),style:{height:de,background:(h??[])[te],borderRadius:te===O?"6px 6px 0 0":void 0}},te)})})()}):b!=null?n.jsx(n.Fragment,{children:[{v:Nt(F.a),c:t},...f?[]:[{v:Nt(F.b),c:a}]].map(({v:O,c:z},se)=>n.jsxs("div",{className:le("bar-chart__slot"),style:w,children:[n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--up"),children:O>=b&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full"),style:{height:Y(O),background:z}})}),n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--down"),children:O<b&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(O),background:z}})})]},se))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:U,background:t}}),!f&&n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:S,background:a}})]}))},K)})]}),n.jsx("div",{className:le("bar-chart__x-axis"),children:e.map((F,K)=>{const T=Pn(F,b==null);return n.jsxs("span",{className:le(`bar-chart__x-axis__label${T?" bar-chart__x-axis__label--future":""}`),children:[n.jsxs("span",{className:le("caption-1 bar-chart__x-axis__main"),children:[F.isToday&&n.jsx("span",{className:le("bar-chart__x-axis__today-dot"),style:{background:t}}),F.label]}),F.sublabel&&n.jsx("span",{className:"caption-1",children:F.sublabel})]},K)})})]})})}),R&&n.jsx(Xn,{anchorRect:R.rect,title:R.title,items:R.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Ou({control:e}){const{t}=_e.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:le("chart-section__controls"),children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:i}),n.jsx(vn,{value:s,onChange:l,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:m,showTooltipInfo:m,disabled:r<=0,onClick:u}),n.jsx(yn,{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,B=_&&b?Dn(_,b-1):1;return C.weekly.map((v,N)=>{const x=N+1;let E=v.label,w=!1,D=!1;if(_&&b){const A=B+N*7,k=new Date(_,b-1,A+6),R=k.getMonth()+1,$=k.getDate(),G=R===b?`${$}`:`${R}/${$}`;E=a("manager.chart.weekRange",{start:A,end:G});const M=new Date(h,p-1,m).getTime();w=M>=new Date(_,b-1,A).getTime()&&M<=k.getTime(),D=_>h||_===h&&(b>p||b===p&&A>m)}return{...v,label:E,sublabel:Iu(a,x-1),isToday:w,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,B=C.getDate(),v=C.getFullYear();return{label:b===g.month&&v===g.year?`${B}`:`${b}/${B}`,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&&B===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:B,series:v,seriesMode:N="stack",loading:x=!1,onDetail:E,headExtra:w,headSegment:D,icon:A,disc:k,onClick:R,cardAriaLabel:$,cardTooltip:G,detailSize:M=32,barGap:P,baseline:L,className:Q,inGrid:Z=!1}){const{t:F}=_e.useTranslation(),K=Kv[t],T=Fu(l),q=g??T,Y=o.useMemo(()=>Gv(l,q,F,L==null),[l,q,F,L]),U=N==="group"&&!!v&&v.length>0;P!=null&&!U&&wt("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 S=o.useMemo(()=>{if(!C)return Y;const ee=q.period==="month"?ga(q.monthRange):null,V=ca(),ne=v?.length??0,W=H=>{const ie=[],Te=[],ye=[];for(let he=0;he<ne;he++){let Se=0,$e=0,Ne=0;for(const ue of H){const xe=Nt(ue.a[he]),ke=Nt(ue.b[he]);ke<=0||(Se+=xe,$e+=ke,Ne+=xe/ke*100)}ie.push(f==="weighted"?$e>0?Math.round(Se/$e*100):0:H.length?Math.round(Ne/H.length):0),Te.push(Se),ye.push($e)}return{pct:ie,ra:Te,rb:ye}};return Y.map((H,ie)=>{let Te=H.a===-1?-1:H.b>0?Math.round(H.a/H.b*100):0;if(ee&&!Pn(H)){const he=ee.year,Se=ee.month1-1,$e=Uo(l,new Date(he,Se,Dn(he,Se)+ie*7),V).filter(Ne=>!Ne.isFuture);if(f==="weighted"){let Ne=0,ue=0;for(const{entry:xe}of $e)xe&&xe.b>0&&(Ne+=xe.a,ue+=xe.b);Te=ue>0?Math.round(Ne/ue*100):0}else Te=$e.length?Math.round($e.reduce((Ne,{entry:ue})=>Ne+(ue&&ue.b>0?ue.a/ue.b*100:0),0)/$e.length):0}let ye=null;if(U&&!Pn(H)){let he;if(ee){const $e=ee.year,Ne=ee.month1-1;he=Uo(l,new Date($e,Ne,Dn($e,Ne)+ie*7),V).filter(ue=>!ue.isFuture).map(({entry:ue})=>({a:ue?.parts??[],b:ue?.partsB??[]}))}else he=[{a:H.parts??[],b:H.partsB??[]}];const Se=W(he);ye={parts:Se.pct,rawParts:Se.ra,rawPartsB:Se.rb}}return{...H,a:Te,b:H.a===-1?0:d&&H.parts&&H.parts[1]>0?Math.round(H.parts[0]/H.parts[1]*100):0,rawA:H.a===-1?-1:H.a,rawB:H.b,...ye??{}}})},[Y,C,f,d,q.period,q.monthRange,l,U,v?.length]),I=o.useMemo(()=>{if(C||b){const V=(q.period==="week"?Y:l[q.monthRange]?.daily??[]).filter(W=>W.a!==-1);if(V.length===0)return 0;if(C&&f==="weighted"){let W=0,H=0;for(const ie of V)ie.b>0&&(W+=ie.a,H+=ie.b);return H>0?Math.round(W/H*100):0}const ne=C?V.reduce((W,H)=>W+(H.b>0?H.a/H.b*100:0),0):V.reduce((W,H)=>W+(H.a>0?H.a:0),0);return Math.round(ne/V.length)}const ee=q.period==="month"?l[q.monthRange]?.daily??[]:S;return L!=null?ee.reduce((V,ne)=>V+(Pn(ne,!1)?0:Nt(ne.a)+(d?Nt(ne.b):0)),0):ee.reduce((V,ne)=>V+(ne.a>0?ne.a:0)+(d&&ne.b>0?ne.b:0),0)},[S,Y,C,f,b,L,d,q.period,q.monthRange,l]),O=v&&v.length>0?v.map(ee=>({color:ee.color,label:ee.label})):[{color:i,label:F(c)},...d?[{color:u,label:F(d)}]:[]],z=t==="small",se=[z?"chart-section--compact":t==="large"?"chart-section--full":void 0,Q].filter(Boolean).join(" ")||void 0,te=r?F(r):"",de=te?F("trainingStatus.detailFor",{name:te,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):F("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Ho,{className:se,inGrid:Z,icon:A,disc:k,onClick:R,ariaLabel:$,tooltip:G,headSegment:D,headMenuItems:E?[{label:de,icon:"list",onClick:E,closeOnSelect:!0}]:void 0,title:F(r),titleLevel:s,titleClassName:z?"h5 chart-section-title--small":void 0,headRight:z?w??void 0:({collapsed:ee})=>n.jsxs(n.Fragment,{children:[!y&&n.jsx(Ou,{control:q}),w,E&&!ee&&n.jsx("span",{className:le("bar-chart__detail-btn"),children:n.jsx(fe,{htmlType:"button",size:M,type:"dot",icon:"list",ariaLabel:de,showTooltipInfo:de,onClick:E})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||b||m&&B?n.jsx(er,{label:z?void 0:`${F(q.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${F(m??c)}`,children:B?(B(I).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ee,V)=>/\d/.test(ee)?n.jsx("span",{className:le("chart-section__total__num h0"),children:ee},V):n.jsx("span",{className:le("chart-section__total__unit h5"),children:ee},V)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:le("chart-section__total__num h0"),children:I}),p&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(p)})]})}):n.jsxs(er,{children:[n.jsx("span",{className:le("chart-section__total__num h0"),children:I}),n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(c)}),p&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(p)})]}):n.jsx("span",{}),n.jsx(Wo,{items:O,className:"caption-1"})]}),children:x?n.jsx("div",{className:le("bar-chart__wrap bar-chart__loading"),"aria-busy":"true",children:n.jsx("div",{className:le("bar-chart__inner"),children:n.jsxs("div",{className:le("bar-chart__area bar-chart__area--loading"),children:[n.jsx("div",{className:le("bar-chart__plot bar-chart__plot--loading"),style:{height:K.height},children:n.jsx(pa,{size:32})}),n.jsx("div",{className:le("bar-chart__x-axis"),"aria-hidden":"true",children:n.jsxs("span",{className:le("bar-chart__x-axis__label"),children:[n.jsx("span",{className:le("caption-1 bar-chart__x-axis__main"),children:"\xA0"}),S.some(ee=>!!ee.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Uv,{focusableBars:e,data:S,colorA:i,colorB:d?u:void 0,labelA:F(c),labelB:d?F(d):void 0,barWidth:a??K.barWidth,barGap:P,baseline:L,height:K.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:v?.map(ee=>ee.color),seriesLabels:v?.map(ee=>ee.label),rateLabels:C?{total:F("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:F("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 L=Z=>m(Math.round(Z)||null);if(L(g.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Q=new ResizeObserver(([Z])=>L(Z.contentRect.width));return Q.observe(g),()=>{Q.disconnect()}},[g]);const{payload:C,anchorRect:f,openAfterDelay:_,close:b}=Hy(zu),B=o.useCallback((L,Q)=>{L&&_(L,Q.getBoundingClientRect())},[_]),v=p??i,N=l,{left:x,right:E,top:w,bottom:D}={...Zv,...u},[A,k]=t,R=L=>k===A?x:x+(v-x-E)*(L-A)/(k-A),$=L=>w+(N-w-D)*(100-L)/100,G={x:R,y:$,plot:{left:x,right:v-E,top:w,bottom:N-D,width:Math.max(0,v-x-E),height:Math.max(0,N-w-D)}},M=e.filter(L=>!L.hollow),P=s??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:y,className:Be("line-chart",h),viewBox:`0 0 ${v} ${N}`,role:"img","aria-label":d??e.map(L=>L.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map(L=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:x,x2:v-E,y1:$(L),y2:$(L)}),n.jsxs("text",{className:"line-chart__tick",x:x-6,y:$(L)+4,textAnchor:"end",children:[L,"%"]})]},L)),c?.(G),a.map(L=>n.jsx("text",{className:"line-chart__tick",x:R(L.x),y:N-5,textAnchor:"middle",children:L.label},L.x)),M.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:P,points:M.map(L=>`${R(L.x)},${$(L.pct)}`).join(" ")}),e.map(L=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Q=>B(L.description,Q.currentTarget),onPointerLeave:b,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:R(L.x),cy:$(L.pct),r:12}),n.jsx("circle",{className:Be("line-chart__dot-main",L.hollow&&"is-hollow"),cx:R(L.x),cy:$(L.pct),r:4,stroke:P,fill:L.hollow?void 0:P})]},L.x))]}),C!=null&&n.jsx(xn,{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:Be("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:Be("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(fe,{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,B)=>{const v=b.length>0?b[b.length-1].acc:0,N=Number.isFinite(B.ratio)?B.ratio:0,x=Math.max(0,Math.min(N,1-v));return b.push({color:B.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,B)=>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})`},B))]})})}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}=_e.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",B=[c,f?"chart-section--compact":b?"chart-section--full":""].filter(Boolean).join(" ")||void 0,v=r&&n.jsx("span",{className:le("chart-section-icon"),children:n.jsx(nt,{icon:r,className:le("chart-section-icon-inner")})});return n.jsx(Ho,{className:B,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:le("chart-section__total__num h0"),children:C}),n.jsx("span",{className:le("chart-section__total__unit h5"),children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Wo,{items:i})]}),children:u?n.jsx("div",{className:le("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:le("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:le(`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:le("stat-chart__card__label-row"),children:[n.jsx("span",{className:le("stat-chart__card__label h5"),children:e}),s&&n.jsx("span",{className:le("stat-chart__card__icon"),children:n.jsx(nt,{icon:s,className:le("stat-chart__card__icon-inner")})})]}),n.jsxs("div",{className:le("stat-chart__card__content"),children:[n.jsxs("div",{className:le("stat-chart__card__left"),children:[n.jsx("div",{className:le("stat-chart__card__value h2"),children:t}),y&&n.jsx("div",{className:le(`stat-chart__card__change stat-chart__card__change--${g??"neutral"} caption-1`),children:y})]}),u&&n.jsx("div",{className:le("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:B=!1,tickStep:v,tickShape:N="dot"}){t&&!c&&wt("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,w=l==="vertical",D=!t,A=Y=>t?.(Number(Y.target.value)),k=typeof d=="number"?`${d}px`:d,R={"--slider-ratio":String(E),"--slider-thumb":`${i}px`,...k?w?{height:k}:{width:k}:{}},$=v??s,G=(b||B)&&$>0&&r>a?Math.floor((r-a)/$+1e-6):0;if(G>0&&G<=100){const Y=N!=="dash",U=se=>Y?`radial-gradient(circle, ${se} 0.5px, transparent 1px)`:w?`linear-gradient(to bottom, transparent calc(50% - 2px), ${se} calc(50% - 2px), ${se} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${se} calc(50% - 2px), ${se} calc(50% + 2px), transparent calc(50% + 2px))`,S=Y?"2px":"4px",I=[],O=[],z=[];for(let se=0;se<=G;se++){const te=se*$/(r-a);if(te>1+1e-6)break;const de=`${((w?1-te:te)*100).toFixed(4)}%`,ee=te<=E+1e-6;if(ee?!B:!b)continue;const V=ee?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";I.push(U(V)),O.push(w?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),z.push(w?`center ${de}`:`${de} center`)}I.push(w?"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))"),O.push("100% 100%"),z.push("0 0"),R.backgroundImage=I.join(", "),R.backgroundSize=O.join(", "),R.backgroundPosition=z.join(", "),R.backgroundRepeat="no-repeat"}const M=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,P=n.jsx("input",{type:"range",className:Be("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":M,"aria-orientation":l,onChange:A,style:R});if(!p&&!C)return P;const L=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:Be("slider-track-group",`slider-track-group--${l}`,!p&&h),children:[w?Q:L,P,w?L:Q]}):P;if(!p)return Z;const F=g??(w?"bottom":"right"),K=`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`,T=m?m(x):p==="percent"?K:p==="count"?`${x} / ${r}`:String(x),q=n.jsx("span",{className:"slider-wrap__value body-3b",children:T});return n.jsxs("div",{className:Be("slider-wrap",`slider-wrap--${l}`,`slider-wrap--label-${F}`,`slider-wrap--align-${y}`,h),children:[Z,q]})}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=P=>{const L=Yo(P,c,d,h);C.current&&(C.current.textContent=L);const Q=g.current;Q&&(Q.setAttribute("aria-valuenow",String(Ko(P,c,d,h))),Q.setAttribute("aria-valuetext",L))},E=e??G1(t)??(_&&_.el===t?_.node:null),w=y.current;if(!E||!w){w?.style.setProperty("--meter-level","0"),x(u);let P=!1;return!e&&t&&sr(t).then(L=>{!P&&L&&b({el:t,node:L})}),()=>{P=!0}}ao();const D=new Float32Array(E.fftSize);let A=0,k=0,R=0,$=0,G=null;const M=P=>{const L=K1(E,D);A=L>A?L:A*n4;const Q=A>1e-5?20*Math.log10(A):-1/0,Z=Math.max(u,Q),F=Z-c,K=Math.min(1,Math.max(0,(F-d)/(h-d)));if(w.style.setProperty("--meter-level",K.toFixed(3)),k+=Z,R+=1,P-$>=a4){const T=k/R;G=G==null?T:G*.6+T*.4,x(G),k=0,R=0,$=P}f.current=requestAnimationFrame(M)};return f.current=requestAnimationFrame(M),()=>{f.current!=null&&cancelAnimationFrame(f.current),f.current=null}},[e,t,_,u,c,d,h]);const B=typeof r=="number"?`${r}px`:r,v=n.jsx("div",{className:"audio-meter__track",style:B?a==="vertical"?{height:B}:{width:B}:{},children:n.jsx("div",{ref:y,className:"audio-meter__fill"})}),N=l??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:g,className:Be("audio-meter",`audio-meter--${a}`,s&&`audio-meter--label-${N}`,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),B=o.useRef(null),v=o.useRef(null),N=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)))},[]),w=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 A=h.current;if(A)try{A.classList.remove("is-visible"),A.style.transition="none",t==="top"?A.style.transform="translateX(-50%) translateY(-16px)":A.style.transform="translateX(-50%) translateY(16px)",A.style.opacity="0",A.offsetWidth,A.style.transition="",A.classList.add("is-visible"),N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{N.current=null;try{A.style.opacity="",A.style.transform="",A.style.transition=""}catch{}},60)}catch{}};c.current?(D(),l(!0)):(u(!0),B.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),B.current&&cancelAnimationFrame(B.current),v.current&&cancelAnimationFrame(v.current),N.current&&clearTimeout(N.current),y.current=null,b.current=null,B.current=null,v.current=null,N.current=null}},[e,g,t]),{mounted:i,showing:s,popupRef:h,pause:E,resume:w}}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"?dn.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:Be("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}=_e.useTranslation(),d=gn("(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:Be("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:B,icon:v,count:N,collapsed:x=!1,onToggleCollapse:E,headerActions:w,empty:D,loading:A,dragOver:k=!1,onDragOver:R,onDragLeave:$,onDrop:G,renderExpandedRow:M,expandedId:P}){const{t:L}=_e.useTranslation(),Q=o.useId(),Z=`table-title-${Q}`,F=`table-row-hint-${Q}`,[K,T]=o.useState(null),q=o.useCallback((oe,be)=>{const Ie=e[be];if(!Ie)return;if(Ie.sortValue)return Ie.sortValue(oe);if(Ie.sortKey)return oe[Ie.sortKey];const Xe=l(oe)[be]?.content;return typeof Xe=="string"||typeof Xe=="number"?Xe:void 0},[e,l]),Y=!t&&a&&!e.some(oe=>oe.sortDir!==void 0||oe.onClick),U=o.useCallback(oe=>{const be=e[oe];if(!be||be.sortable===!1)return!1;if(be.sortValue||be.sortKey)return!0;const Ie=s[0];return Ie!==void 0&&q(Ie,oe)!==void 0},[e,s,q]),S=o.useMemo(()=>t?e.map(oe=>{if(!oe.sortKey||oe.sortDir!==void 0)return oe;const be=t.field(String(oe.label??""),oe.sortKey);return{...oe,sortDir:be.sortDir,onClick:oe.onClick??be.onClick}}):Y?e.map((oe,be)=>U(be)?{...oe,sortDir:K?.index===be?K.asc?"asc":"desc":null,onClick:()=>T(Ie=>Ie?.index===be?{index:be,asc:!Ie.asc}:{index:be,asc:!0})}:oe):e,[e,t,Y,K,U]),I=o.useMemo(()=>{if(!Y||!K)return s;const{index:oe,asc:be}=K;return[...s].sort((Ie,Xe)=>fr(q(Ie,oe),q(Xe,oe),be))},[s,Y,K,q]),O=gn("(max-width: 767px)"),z=y&&O?y:null,se=C&&!O,te=o.useRef(se);te.current=se;const de=48,ee=40,V=o.useRef(()=>de),ne=_?`table-cols:${_}`:null,W=o.useRef(null),H=o.useRef(null),ie=o.useRef(null),Te=o.useRef(null),[ye,he]=o.useState(!1),[Se,$e]=o.useState(0),Ne=o.useCallback(()=>{const oe=ie.current;if(!oe)return;const be=Te.current,Ie=W.current;if(be&&(be.style.minWidth="",Ie)){const Xe=Ie.scrollWidth,et=te.current?ee:0;be.style.minWidth=Xe>oe.clientWidth+1?`${Xe+et}px`:""}he(oe.scrollWidth>oe.clientWidth+1),$e(oe.clientWidth)},[]),ue=o.useCallback((oe,be)=>{const Ie=oe.current;Ie&&H.current&&H.current.unobserve(Ie),oe.current=be,be?(!H.current&&typeof ResizeObserver<"u"&&(H.current=new ResizeObserver(()=>Ne())),H.current?.observe(be)):!ie.current&&!Te.current&&(H.current?.disconnect(),H.current=null),Ne()},[Ne]),xe=o.useCallback(oe=>ue(ie,oe),[ue]),ke=o.useCallback(oe=>ue(Te,oe),[ue]);o.useEffect(()=>{Ne()}),o.useEffect(()=>{if(typeof window>"u")return;const oe=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>Ne()):null;return window.addEventListener("resize",Ne),()=>{oe!=null&&cancelAnimationFrame(oe),window.removeEventListener("resize",Ne)}},[Ne]);const Ee=o.useRef(()=>!1),We=o.useRef([]),He=o.useRef(null),ot=oe=>{if(!oe||typeof window>"u")return null;try{const be=JSON.parse(window.localStorage.getItem(oe)??"null");return Array.isArray(be)&&be.length>0&&be.every(Ie=>typeof Ie=="number"&&Number.isFinite(Ie)&&Ie>0)?be:null}catch{return null}},[Qe,Je]=o.useState(()=>ot(ne)),[vt,je]=o.useState(ne),[Ye,we]=o.useState(()=>ot(ne)!==null);if(vt!==ne){je(ne);const oe=ot(ne);Je(oe),we(oe!==null)}const Ue=o.useRef(Qe);o.useEffect(()=>{Ue.current=Qe},[Qe]);const qe=o.useCallback(oe=>{const be=He.current;if(!be)return;const Ie=Ue.current;if(Ie){const Xe=[...Ie],et=()=>de;if(be.next!=null&&be.startWNext!=null){const rt=oe.clientX-be.startX,Lt=Math.max(et()-be.startW,Math.min(be.startWNext-et(),rt));Xe[be.index]=be.startW+Lt,Xe[be.next]=be.startWNext-Lt}else Xe[be.index]=Math.max(et(),be.startW+(oe.clientX-be.startX));Ue.current=Xe,Je(Xe)}},[]),pt=o.useCallback(()=>{if(He.current=null,window.removeEventListener("pointermove",qe),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),document.body.style.cursor="",document.body.style.userSelect="",ne&&Ue.current)try{window.localStorage.setItem(ne,JSON.stringify(Ue.current))}catch{}},[qe,ne]),_t=o.useCallback((oe,be)=>{be.preventDefault(),be.stopPropagation();const Ie=W.current;if(!Ie)return;const Xe=Array.from(Ie.children).map(rt=>rt.getBoundingClientRect().width),et=f==="fit"?S.findIndex((rt,Lt)=>Lt>oe&&rt.resizable!==!1):-1;He.current=et>=0?{index:oe,startX:be.clientX,startW:Xe[oe],next:et,startWNext:Xe[et]}:{index:oe,startX:be.clientX,startW:Xe[oe]},Ue.current=Xe,Je(Xe),we(!0),window.addEventListener("pointermove",qe),window.addEventListener("pointerup",pt),window.addEventListener("pointercancel",pt),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[qe,pt,f,S]),Et=o.useCallback(()=>{const oe=W.current,be=oe?.closest(".table-wrap");if(!oe||!be)return null;const Ie=be.style.getPropertyValue("--table-grid-cols");be.style.setProperty("--table-grid-cols",S.map(()=>"max-content").join(" "));const Xe=Array.from(be.querySelectorAll(".table-row")).filter(St=>!St.classList.contains("table-row--loading")&&!St.classList.contains("table-row--empty")),et=St=>Array.from(St.children).map(Rt=>{const Wt=window.getComputedStyle(Rt);return{width:Rt.getBoundingClientRect().width,span:u4(Wt.gridColumnStart,Wt.gridColumnEnd)}}),rt=parseFloat(window.getComputedStyle(oe).columnGap)||0,Lt=Xe.map(et),Bn=et(oe),ln=i4([Bn,...Lt],S.length,rt),$t=p4(S.map((St,Rt)=>({declaredMin:V.current(Rt),headWidth:Bn[Rt]?.width??0,sortable:St.sortDir!==void 0||!!St.onClick,sorted:!!St.sortDir}))),Ot=St=>$t[St]??V.current(St),un=S.map((St,Rt)=>{const Wt=ln[Rt],Kt=Ee.current(Rt)?parseFloat(We.current[Rt]):NaN;return Number.isFinite(Kt)&&Math.ceil(Wt)>Kt&&wt(`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(oe),kn=(parseFloat(Pt.paddingLeft)||0)+(parseFloat(Pt.paddingRight)||0),Jt=be.clientWidth-kn;return Ie?be.style.setProperty("--table-grid-cols",Ie):be.style.removeProperty("--table-grid-cols"),c4(un,{isFixed:St=>Ee.current(St),floorOf:Ot,containerWidth:Jt})},[S,f]),Bt=(oe,be)=>oe!==null&&oe.length===be.length&&oe.every((Ie,Xe)=>Ie===be[Xe]),st=o.useRef(Et);o.useEffect(()=>{st.current=Et});const[tt,kt]=o.useState(0),At=I.length>0,jt=`${ne??""}|${tt}|${S.length}|${Se}`,Mt=!Ye&&se&&ne!==null&&!A?`${jt}|${At?1:0}`:null,gt=o.useRef(null);o.useEffect(()=>{if(Mt===null||!At||gt.current===jt)return;const oe=st.current();oe&&(gt.current=jt,Je(be=>Bt(be,oe)?be:oe))},[Mt]);const it=o.useCallback(()=>{if(ne)try{window.localStorage.removeItem(ne)}catch{}we(!1);const oe=st.current();Je(oe),Ue.current=oe,kt(be=>be+1)},[ne]);o.useEffect(()=>()=>{He.current&&(window.removeEventListener("pointermove",qe),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),document.body.style.cursor="",document.body.style.userSelect="")},[qe,pt]);const ut=S.length>0&&S.every(oe=>oe.width!=null)?S.map(oe=>typeof oe.width=="number"?`${oe.width}px`:String(oe.width)).join(" "):null;S.some(oe=>oe.width!=null)&&!ut&&wt(`table-field-width:${S.map(oe=>oe.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."),ut&&g&&wt("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 ct=g??ut??void 0,ve=l4(ct),Me=ve.filter(oe=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(oe));Me.length>0&&wt(`table-content-track:${g}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Me.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=S.findIndex(oe=>!!oe.sortDir);S.filter(oe=>!!oe.sortDir).length>1&&wt("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 Oe=oe=>oe===Pe?S[oe].sortDir==="asc"?"ascending":"descending":S[oe].onClick?"none":void 0,dt=oe=>/^\d+(\.\d+)?px$/.test(ve[oe]??""),Dt=oe=>{const be=ve[oe]??"",Ie=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(be)??/^(\d+(?:\.\d+)?)px$/.exec(be);return Ie?parseFloat(Ie[1]):de};Ee.current=dt,V.current=Dt,We.current=ve;const yt=oe=>f==="fit"&&!dt(oe)?"fr":"px",xt=Qe&&Qe.length===S.length&&!O,Ct=z??(xt?S.map((oe,be)=>oe.resizable===!1&&ve[be]?ve[be]:`${Qe[be]}${yt(be)}`).join(" "):ct),Le=Ct?{"--table-grid-cols":Ct}:void 0,at=B!==void 0;return n.jsxs("div",{ref:xe,className:`table-wrap table-wrap--${b}${se?" table-wrap--resizable":""}${k?" table-wrap--dragover":""}${x?" table-wrap--collapsed":""}`,style:Le,onDragOver:R,onDragLeave:$,onDrop:G,tabIndex:ye?0:void 0,role:ye?"region":void 0,"aria-label":ye?typeof B=="string"?B:L("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:F,className:"table-row-hint",children:L("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:ke,role:"table","aria-labelledby":at&&typeof B=="string"?Z:void 0,className:"table body-2",children:[at&&n.jsxs("div",{className:Be("table-header",E&&"table-header--clickable"),onClick:E,role:"caption",children:[E&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:x?"chevron-right":"chevron-down",ariaLabel:x?L("common.expand","\uD3BC\uCE58\uAE30"):L("common.collapse","\uC811\uAE30"),ariaExpanded:!x,className:"table-header__chevron"}),v&&n.jsx(nt,{icon:v,label:typeof B=="string"?B:void 0,className:"table-header__icon"}),n.jsx("span",{id:Z,className:"table-header__title h5b",children:B}),N!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:N}),w&&n.jsx("span",{className:"table-header__actions",onClick:oe=>oe.stopPropagation(),children:w})]}),!x&&n.jsxs(n.Fragment,{children:[r&&r.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:r.map((oe,be)=>n.jsx("div",{role:"columnheader","aria-colspan":oe.span,className:Be("table-field body-3",oe.className),style:{gridColumn:`span ${oe.span}`},children:oe.label},be))}),n.jsxs("div",{role:"presentation",className:Be("table-fields-strip",se&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:W,children:S.map((oe,be)=>n.jsx(C4,{onClick:oe.onClick,className:Be(oe.className,Ju(oe.align)),sortDir:oe.sortDir,ariaSort:Oe(be),onResizeStart:se&&be<S.length-1&&oe.resizable!==!1&&(f!=="fit"||S.some((Ie,Xe)=>Xe>be&&Ie.resizable!==!1))?Ie=>_t(be,Ie):void 0,children:oe.label},be))}),se&&n.jsx("div",{className:"table-fields__reset-dock",children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:it})})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:A?n.jsx(Xo,{variant:"loading",colSpan:S.length||void 0}):I.length===0&&D?n.jsx(Xo,{variant:"empty",colSpan:S.length||void 0,children:D}):I.map((oe,be)=>{const Ie=m!=null&&oe.id===m,Xe=!!i&&(u?u(oe):!0),et=P!=null&&oe.id!=null&&(P instanceof Set?P.has(oe.id)||[...P].some(rt=>String(rt)===String(oe.id)):String(oe.id)===String(P));return n.jsx(Xo,{className:`${Xe?" table-row--clickable":""}${h?" table-row--draggable":""}${Ie?" table-row--dragging":""}`.trim(),draggable:!!h,onClick:Xe?()=>i(oe):void 0,colSpan:S.length||void 0,rowHasButton:l(oe).some(rt=>!!rt.rowLabel),describedBy:F,onMouseEnter:c?rt=>c(oe,rt):void 0,onMouseLeave:d?rt=>d(oe,rt):void 0,onDragStart:h?rt=>h(oe,rt):void 0,onDragEnd:p?rt=>p(oe,rt):void 0,expandedContent:et&&M?M(oe):void 0,children:l(oe).map((rt,Lt)=>n.jsx(h4,{className:Be(rt.className,Ju(S[Lt]?.align)),style:rt.style,span:rt.span,rowLabel:Xe?rt.rowLabel:void 0,onRowClick:Xe?()=>i(oe):void 0,children:rt.content},Lt))},oe.id!=null?`${typeof oe.id}:${oe.id}`:`__idx:${be}`)})})]})]})]})}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}=_e.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,B)=>{if(f==="worn"){const v=Number(B.worn)-Number(b.worn);return _?v:-v}return fr(Qu(b,f),Qu(B,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(fe,{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(Fo,{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(fe,{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}=_e.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),w=[];for(let D=0;D<E;D++)w.push(null);for(let D=1;D<=x;D++)w.push(D);for(;w.length<35;)w.push(null);return w},[d,p]),b=o.useCallback(()=>{p===0?(h(x=>x-1),m(11)):m(x=>x-1)},[p]),B=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")}`,N=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(nt,{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:B,"aria-label":l("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(nt,{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 w=x,D=v(w),A=f[D]??[],k=Vl(D,i.language),R=g===D;return n.jsxs("div",{className:`calendar-cell${N(w)?" today":""}${R?" 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":N(w)?"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:w}),A.length>0&&(()=>{const $=[{key:"visited",label:l("calendar.legend.visited","\uBC29\uBB38"),count:A.filter(M=>(M.status??"visited")==="visited").length},{key:"scheduled",label:l("calendar.legend.scheduled","\uC608\uC57D"),count:A.filter(M=>M.status==="scheduled").length},{key:"noVisit",label:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:A.filter(M=>M.status==="noVisit").length}].filter(M=>M.count>0),G=$.length===1&&$[0].key==="visited"?l("calendar.visitCount",{count:A.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):$.map(M=>l("calendar.statusCount",{label:M.label,count:M.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${k} ${G}`,children:[$.map(M=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${M.key}`,"aria-hidden":"true"},M.key)),A.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:A.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?M=>{C.current=$.id,M.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,y(null)}:void 0,onClick:t?M=>{M.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))})]},w)})]})]})}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:Be("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(nt,{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}=_e.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)),B=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),N=o.useRef(null);function x(){const E=document.activeElement;N.current=_r()&&E&&E.closest?.(".training-block__more")?_:null,b(w=>Math.min(f,w+xr))}return o.useEffect(()=>{const E=N.current;if(E==null)return;N.current=null;const w=document.activeElement;w&&w!==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,w)=>{const D=E;return n.jsx($o,{index:w,type:a,trainingData:D,depth:B,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"?A=>m(D,A):void 0},D?.id!=null?`${a?.key||"t"}-${String(D.id)}`:`${a?.key||"t"}-${w}`)})}),f>xr&&_<f&&n.jsx("div",{className:"training-block__more",children:n.jsx(fe,{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:Be("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}=_e.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 B=o.useRef(null),v=gn("(max-width: 767px)"),[N,x]=o.useState(!1),[E,w]=o.useState(!1),D=`${typeof y=="string"?y:y?.src??""}\0${m}`,[A,k]=o.useState({for:"",url:""}),R=A.for===D?A.url:"",$=zl(),G=e.textOnly??(!e.image&&!!_.label&&!!$&&$.entries.length>0&&!$.byWord.has(_.label)),M=G?"":ua()?.(_.label,_.homonum)??e.image??"",{imgRef:P,loading:L,hasImage:Q,onLoad:Z,onError:F}=es(M);o.useEffect(()=>{let z=!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 se=Sa();if(se&&m)try{const te=await Promise.resolve(se(m));!z&&te&&k({for:D,url:te})}catch{}})(),()=>{z=!0}},[y,m,D]);const K=o.useRef(!0),T=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,T.current&&yr(T.current),T.current=null;try{B.current?.pause()}catch{}B.current=null}),[]);const q=o.useCallback(()=>new Promise(z=>{if(typeof window<"u"&&window.speechSynthesis&&m){x(!0),window.speechSynthesis.cancel();const se=new SpeechSynthesisUtterance(m);se.lang="ko-KR",se.onend=()=>{x(!1);try{a?.()}catch{}z()},se.onerror=()=>{x(!1),z()},window.speechSynthesis.speak(se)}else z()}),[m,a]),Y=o.useCallback(z=>{const se=Ka(z,te=>{if(x(!1),te)try{a?.()}catch{}});return B.current=se.el,se.done},[a]),U=o.useCallback(async()=>{if(t||!K.current)return;const z=()=>{T.current===z&&(T.current=null);try{B.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1)},se=Ga(z);T.current=z;try{window.speechSynthesis?.cancel()}catch{}try{if(R&&(x(!0),await Y(R)))return;const te=or();if(te&&m)try{w(!0);const de=await Promise.resolve(te(m));if(!K.current||T.current!==z||(w(!1),de&&(x(!0),await Y(de))))return}catch{}if(!K.current||T.current!==z)return;await q()}finally{T.current===z&&w(!1),se(),T.current===z&&(T.current=null)}},[t,R,m,Y,q]);o.useImperativeHandle(h,()=>({play:()=>U()}),[U]);const S=z=>z.stopPropagation(),I=o.useCallback(z=>{if(z.stopPropagation(),!t){if(N){try{B.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1);return}U()}},[t,N,U]),O=Be("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:O,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?z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" "||z.key==="Spacebar")&&(z.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:S,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:[L&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:P,className:"training-word-card__image",src:M,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:L?0:1},onLoad:Z,onError:F})]}):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?S:void 0,children:n.jsx(fe,{htmlType:"button",size:v?40:48,type:v?"dot":"bar",icon:N?"pause":"play",label:v?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:N,loading:E,onClick:I,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"){wt("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 I4=24,F4={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}=_e.useTranslation(),C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),[b,B]=o.useState(1),[v,N]=o.useState(!1),[x,E]=o.useState(!1),[w,D]=o.useState({for:"",url:""}),[A,k]=o.useState(null),R=t&&t.length>0?t:q1()?.(e,l)??"",$=ua()?.(e,l)??"",{imgRef:G,loading:M,failed:P,onLoad:L,onError:Q}=es($),Z=o.useCallback(()=>k(f.current?.getBoundingClientRect()??null),[]),F=o.useCallback(()=>k(null),[]),K=_o(!!A,ee=>{ee?Z():F()},f),T=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]),q=R||e,Y=w.for===q?w.url:"";o.useEffect(()=>{const ee=Sa(),V=R||e;if(!ee||!V)return;let ne=!1;return Promise.resolve(ee(V)).then(W=>{!ne&&W&&D({for:V,url:W})}),()=>{ne=!0}},[R,e]);const U=o.useRef(null),S=o.useRef(null);o.useEffect(()=>()=>{_.current?.pause(),S.current?.()},[]);const I=o.useRef(null);o.useEffect(()=>()=>{I.current&&(I.current.cancelled=!0)},[]);const O=o.useCallback(ee=>{if(ee.stopPropagation(),v||x){U.current?.();return}if(!Y){const ne=or(),W=R||e;if(!ne||!W)return;const H={cancelled:!1,stop:null};I.current=H;const ie=()=>{H.cancelled=!0,H.stop?.(),E(!1),N(!1),S.current?.()};U.current=ie,S.current=Ga(ie),E(!0),Promise.resolve().then(()=>ne(W)).then(Te=>{if(H.cancelled)return;if(!Te){ie();return}D({for:W,url:Te});const ye=Ka(Te,()=>{N(!1),S.current?.()});_.current=ye.el,H.stop=ye.stop,E(!1),N(!0)}).catch(()=>{ie()});return}N(!0);const V=Ka(Y,()=>{N(!1),S.current?.()});_.current=V.el,U.current=V.stop,S.current=Ga(V.stop)},[v,x,Y,R,e]),z=u&&!!$&&!P,se=z&&i?pc:z?$4:L4,te=z&&i?hc:z?P4:R4;o.useEffect(()=>{const ee=C.current;if(!ee||typeof ResizeObserver>"u")return;const V=new ResizeObserver(([ne])=>{const{width:W,height:H}=ne.contentRect;B(Math.min(W/se,H/te))});return V.observe(ee),()=>V.disconnect()},[se,te]);const de=p*g<I4;return n.jsxs("div",{ref:C,className:Be("word-table-cell",de&&"word-table-cell--tap-too-small",z?"word-table-cell--with-image":""),"data-ref-w":se,"data-ref-h":te,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${b})`},children:[z&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[M&&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:M?0:1},onLoad:L,onError:Q})]}),h&&(s||r)&&n.jsxs("span",{className:"word-table-cell__caption",children:[s&&n.jsx(on,{type:"bar",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&&R&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",R,"]"]}),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(fe,{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:O})}),n.jsx("span",{"data-play-state":"pause",style:{display:v?void 0:"none"},children:n.jsx(fe,{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:O})})]}),m&&n.jsxs("div",{ref:f,className:"word-table-cell__info-button",onPointerEnter:ee=>{ma(ee)||Z()},onPointerLeave:ee=>{ma(ee)||F()},onFocus:()=>{Ca()||Z()},onBlur:F,children:[n.jsx(fe,{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()}}),A&&T&&n.jsx(Xn,{anchorRect:A,items:T,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:B,indexOffset:v=0,totalCount:N,renderCellAction:x,showFillerAdd:E=!1,addableCount:w,contentRef:D,buttonSize:A=40,brand:k,code:R,pageNumber:$,pageNumberPosition:G="right",fitHeight:M=!1,scoring:P=!1,marks:L,onMarkClick:Q,scoreIndexOffset:Z=0}){const F=o.useCallback((ve,Me)=>{Q?.(Z+ve,Me)},[Q,Z]),K=(ve,Me)=>{const Pe=L?.[wr(Z+ve)]??null;return n.jsx("div",{className:Be("word-table-cell__score",Pe?"word-table-cell__score--marked":""),style:it>1?{transform:`translateX(-50%) scale(${it})`,transformOrigin:"bottom center"}:void 0,children:Br.map(Oe=>n.jsx("span",{className:Be("word-table-cell__score-slot",Pe===Oe?"word-table-cell__score-slot--on":""),children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",shape:"pill",icon:rc[Oe],variant:Pe===Oe?oc[Oe]:"default",selected:Pe===Oe,useBorder:!1,...gt?{}:{tabIndex:-1,role:"img"},showTooltipInfo:T(`wordTable.scoring.markName.${Oe}`,{defaultValue:Oe}),ariaLabel:T(`wordTable.scoring.${Oe}`,{word:Me,defaultValue:`${Me} ${Oe}`}),onClick:gt?dt=>{dt.stopPropagation(),F(ve,Oe)}:void 0})},Oe))})},{t:T}=_e.useTranslation(),q=m!==void 0,Y=e!=null||!!t||!!a,U=gn("(max-width: 767px)"),S=o.useRef(null),[I,O]=o.useState(null),z=p?.length??0,se=N??z,[te,de]=o.useState(null),[ee,V]=o.useState(""),ne=o.useRef(null),W=o.useRef(null),H=o.useRef(null),ie=o.useRef(null),Te=o.useCallback(ve=>{W.current=ve,typeof D=="function"?D(ve):D&&(D.current=ve)},[D]),ye=o.useCallback((ve,Me)=>{ne.current=v+Me,b?.(ve,Me),V(T("wordTable.reorder.moved",{n:v+Me+1,total:se,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[b,T,se,v]);o.useEffect(()=>{const ve=ne.current;ve!=null&&(ne.current=null,(W.current?.closest(".word-table-block__pages")??W.current)?.querySelector(`[data-wordtable-index="${ve}"] .word-table__card-handle button`)?.focus())}),o.useEffect(()=>()=>{ie.current?.()},[]);const he=o.useCallback((ve,Me)=>{if(!b||!ve.altKey||ve.ctrlKey||ve.metaKey)return;const Pe=ve.key==="ArrowRight";if(!Pe&&ve.key!=="ArrowLeft")return;ve.preventDefault();const Oe=Me+(Pe?1:-1),dt=v+Oe;dt<0||dt>=se||ye(Me,Oe)},[b,se,v,ye]),Se=o.useCallback((ve,Me)=>{if(!b||ve.pointerType==="mouse")return;const Pe=ve.target.closest?.("button");if(Pe&&!Pe.closest(".word-table__card-handle"))return;ie.current?.();const Oe={x:ve.clientX,y:ve.clientY};let dt=!1;const Dt=Ie=>{dt&&Ie.cancelable&&Ie.preventDefault()};let yt=null,xt=null;const Ct=()=>{const Ie=xt;if(!Ie)return;const Xe=document.elementFromPoint?.(Ie.x,Ie.y)?.closest?.("[data-wordtable-cell]"),et=Xe?Number(Xe.dataset.wordtableCell):NaN,rt=Number.isInteger(et)?et:null;H.current=rt,O(Lt=>Lt===rt?Lt:rt)},Le=Ie=>{if(!dt){(Math.abs(Ie.clientX-Oe.x)>Cc||Math.abs(Ie.clientY-Oe.y)>Cc)&&be();return}if(xt={x:Ie.clientX,y:Ie.clientY},typeof requestAnimationFrame>"u"){Ct();return}yt===null&&(yt=requestAnimationFrame(()=>{yt=null,Ct()}))},at=()=>{yt!==null&&(cancelAnimationFrame(yt),yt=null,Ct());const Ie=H.current,Xe=dt;be(),Xe&&Ie!=null&&Ie!==Me&&ye(Me,Ie)},oe=setTimeout(()=>{dt=!0,de(Me),H.current=Me,O(Me),window.addEventListener("touchmove",Dt,{passive:!1})},O4);function be(){clearTimeout(oe),window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",at),window.removeEventListener("pointercancel",at),window.removeEventListener("touchmove",Dt),dt=!1,yt!==null&&(cancelAnimationFrame(yt),yt=null),H.current=null,ie.current=null,de(null),O(null)}ie.current=be,window.addEventListener("pointermove",Le),window.addEventListener("pointerup",at),window.addEventListener("pointercancel",at)},[b,ye]),{width:$e,height:Ne}=ea[s],ue=typeof M=="number"?M:M&&typeof M=="object"?U?M.narrow:M.wide:null,{scalerRef:xe,scale:ke,offset:Ee}=mc($e,M?Ne:void 0),We=q?m?.length??0:p?.length??0,He=Math.max(g??We,1),ot=!q&&!!i,Qe=j4(s,He),Je=lc(s,He),vt=ot?Qe.cols:Je.cols,je=ot?Qe.rows:Je.rows,Ye=ot&&s==="landscape"?Qe.cols*2:vt,we=ot&&s==="portrait"?Qe.rows*2:je,Ue=ve=>({word:ve.length===0||ve.includes("word"),image:ve.length===0||ve.includes("image"),pron:ve.length===0||ve.includes("standardPron"),colloq:ve.length===0||ve.includes("colloquialPron"),caption:ve.length===0||ve.includes("caption")}),qe=Ue(l),pt=o.useMemo(()=>{const ve=(p??[]).map(Pe=>Pe.id),Me=ve.every(Pe=>typeof Pe=="string"&&Pe.length>0)&&new Set(ve).size===ve.length;return!Me&&ve.length>0&&wt("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."),Me?ve:null},[p]),_t=Ue(u??l),Et=q?(m??[]).some(ve=>ve!==null&&ve.length>1):(p??[]).some(ve=>(ve.words??[]).length>1),Bt=!!k?.show,st=!!k?.show&&k?.top!==!1,tt=!!k?.show&&k?.bottom!==!1,kt=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",At=le(Be("word-table__content",T4[c],d&&"word-table__content--outline",h&&Et&&"word-table__content--div-line",!Bt&&$&&G!=="none"&&"word-table__content--page-number",st&&"word-table__content--brand-top",tt&&"word-table__content--brand-bottom")),jt={transform:`scale(${1/ke})`,transformOrigin:"center center"},Mt=A*Br.length+4*(Br.length-1),gt=!!Q,it=gt?Math.max(1,Math.min(1/ke,$e/Ye/Mt)):1,ut=n.jsxs("div",{ref:xe,className:"word-table__scaler",style:{height:Ne*ke},children:[n.jsx("div",{className:Be("word-table",P&&!gt&&"word-table--score-readonly",!Y&&r),style:{width:$e,height:Ne,transform:`scale(${ke})`,transformOrigin:"top left",marginLeft:Ee},children:n.jsxs("div",{ref:Te,className:At,style:{gridTemplateColumns:`repeat(${Ye}, 1fr)`,gridTemplateRows:`repeat(${we}, 1fr)`},children:[q?n.jsx(n.Fragment,{children:(m??[]).map((ve,Me)=>n.jsx("div",{className:le(Be("word-table__edit-cell",ve?"word-table__edit-cell--filled":"word-table__edit-cell--empty",y===Me?"word-table__edit-cell--active":"")),style:ss(Me,Ye,we,c),children:ve?n.jsxs(n.Fragment,{children:[ve.map((Pe,Oe)=>n.jsxs(o.Fragment,{children:[Oe>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:Pe.word,subLabel:Pe.pronunciation,colloquialLabel:Pe.colloquialPronunciation,homonum:Pe.homonum,showWord:qe.word,showImage:qe.image,showPronunciation:qe.pron,showColloquial:qe.colloq,showCaption:qe.caption,buttonSize:A})]},Oe)),P&&K(Me,ve.map(Pe=>Pe.word).join(" / ")),f&&n.jsx("div",{className:le("word-table__card-close"),children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:ve.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:ve.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>f(Me)})})]}):C&&n.jsx("div",{style:jt,children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"plus",variant:"default",ariaLabel:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C(Me)})})},Me))}):n.jsxs(n.Fragment,{children:[ot&&i&&n.jsx("div",{className:le("word-table__card word-table__card--base"),style:{gridColumn:`1 / span ${Qe.cols}`,gridRow:`1 / span ${Qe.rows}`,...ss(0,s==="landscape"?2:1,s==="landscape"?1:2,c)},children:(i.words??[]).map((ve,Me)=>n.jsxs(o.Fragment,{children:[Me>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:ve.label,subLabel:ve.subLabel,colloquialLabel:ve.colloquialLabel,captionLabel:ve.captionLabel,captionBadge:ve.captionBadge,homonum:ve.homonum,showWord:_t.word,showImage:_t.image,showPronunciation:_t.pron,showColloquial:_t.colloq,showCaption:_t.caption,buttonSize:A,wordInfo:ve.grade||ve.syllables!=null||ve.pos||ve.wordType?{grade:ve.grade,syllables:ve.syllables,pos:ve.pos,wordType:ve.wordType}:void 0})]},Me))}),(p??[]).map((ve,Me)=>n.jsxs("div",{"data-wordtable-cell":b?Me:void 0,"data-wordtable-index":b?v+Me:void 0,className:le(`word-table__card${b?" word-table__card--draggable":""}${I===Me?" word-table__card--drag-over":""}${te===Me?" word-table__card--dragging":""}`),style:ss(Me,vt,je,c),draggable:!!b,onPointerDown:b?Pe=>Se(Pe,Me):void 0,onKeyDown:b?Pe=>he(Pe,Me):void 0,onDragStart:b?()=>{S.current=Me}:void 0,onDragOver:b?Pe=>{Pe.preventDefault(),O(Me)}:void 0,onDragLeave:b?()=>O(null):void 0,onDrop:b?Pe=>{Pe.preventDefault(),S.current!==null&&S.current!==Me&&b(S.current,Me),S.current=null,O(null)}:void 0,onDragEnd:b?()=>{S.current=null,O(null)}:void 0,children:[(ve.words??[]).map((Pe,Oe)=>n.jsxs(o.Fragment,{children:[Oe>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:Pe.label,subLabel:Pe.subLabel,colloquialLabel:Pe.colloquialLabel,captionLabel:Pe.captionLabel,captionBadge:Pe.captionBadge,homonum:Pe.homonum,showWord:qe.word,showImage:qe.image,showPronunciation:qe.pron,showColloquial:qe.colloq,showCaption:qe.caption,buttonSize:A,wordInfo:Pe.grade||Pe.syllables!=null||Pe.pos||Pe.wordType?{grade:Pe.grade,syllables:Pe.syllables,pos:Pe.pos,wordType:Pe.wordType}:void 0})]},Oe)),P&&K(Me,(ve.words??[]).map(Pe=>Pe.label).join(" / ")),(x||_||B||b)&&n.jsxs("div",{className:le("word-table__card-actions"),children:[_&&n.jsx("div",{className:le("word-table__card-close"),children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(ve.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(ve.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>_(ve.id)})}),B&&n.jsx("div",{className:le("word-table__card-copy"),children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"copy",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:T("wordTable.copyItem","\uD55C \uCE78 \uB354"),ariaLabel:T("wordTable.copyItemAria",{n:v+Me+1,defaultValue:"{{n}}\uBC88 \uCE78 \uB0B1\uB9D0\uC744 \uD55C \uCE78 \uB354"}),onClick:()=>B(ve.id,v+Me)})}),x?.(Me,ve),b&&n.jsx("div",{className:le("word-table__card-handle"),children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:T("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:T("wordTable.reorder.handle",{word:(ve.words??[]).map(Pe=>Pe.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})})]})]},pt?pt[Me]:Me)),Array.from({length:Math.max(0,vt*je-(p?.length??0))}).map((ve,Me)=>{const Pe=(p?.length??0)+Me<(w??He);return n.jsx("div",{className:le("word-table__card word-table__card--filler"),children:E&&C&&Pe&&n.jsx("div",{style:jt,children:n.jsx(fe,{htmlType:"button",size:A,type:"dot",icon:"plus",variant:"default",ariaLabel:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C((p?.length??0)+Me)})})},`filler-${Me}`)})]}),st&&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 ve=[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"),R&&n.jsx("span",{className:"word-table__code",children:R},"c")].filter(Boolean);return ve.length===0?null:n.jsx("span",{className:"word-table__ident",children:ve.map((Me,Pe)=>n.jsxs(o.Fragment,{children:[Pe>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),Me]},Pe))})})()]})}),tt&&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:kt})]}),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:T("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})]})}),!Bt&&$&&G!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${G}`,children:T("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})}),b&&n.jsx("span",{role:"status",style:F4,children:ee})]}),ct=ue==null?ut:n.jsx("div",{className:"word-table__frame",style:{height:ue},children:ut});return Y?n.jsx(va,{type:"page",icon:t,title:e,disc:a,className:Be(le("word-table__section"),r),children:ct}):ct}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!==wn);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 In({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}=_e.useTranslation(),[_,b]=o.useState(l),B=i??_,v=()=>{const k=!B;b(k),u?.(k)},N=k=>{if(!s)return;const R=k.target;!R||typeof R.closest!="function"||R.closest(".filter-panel__collapse-toggle")||R.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||v()},x=o.useMemo(()=>r!==void 0||!B?"":z4(d,h,f("common.all","\uC804\uCCB4")),[r,B,d,h,f]),E=r??(x?n.jsx("span",{className:"filter-panel__header-summary body-3",children:x}):null),w=e||a||r||s,D=o.useId(),A=t?`h${t}`:"span";return n.jsxs("div",{className:Be("filter-panel",s?"filter-panel--collapsible":"",B?"filter-panel--collapsed":"",y),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?D:void 0,children:[w&&n.jsxs("div",{className:"filter-panel__header",onClick:s?N:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(A,{id:D,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[B?E:a,s&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:B?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:B?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),showTooltipInfo:B?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),"aria-expanded":!B,onClick:v})]})]}),!B&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Be("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(k=>{const R=h[k.label],$=R===void 0||(Array.isArray(R)?R.length===0:!1),G=(k.items??[]).filter(P=>P!=null);k.allOption&&G.some(P=>(typeof P=="string"?P:P.value)===wn)&&wt(`filter-panel-all-value:${k.label}`,`[FilterPanel] '${k.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${wn}' \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 M=P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"&&!!P.disabled,Z=typeof P!="string"?P.labels:void 0,F=typeof P!="string"?P.displayLabel:void 0,K=typeof P!="string"?P.tooltip:void 0,T=typeof P!="string"?P.descriptionTooltip:void 0,q=typeof P!="string"?P.shape:void 0,Y=Array.isArray(R)?R.includes(L):R===L;return n.jsx(fe,{htmlType:"button",size:"keyboard",label:Z??F??L,type:k.itemType??(Z?"bar":L.length===1?"dot":void 0),selected:Y,disabled:Q,shape:q,showTooltipInfo:!!K,tooltipInfoText:K,tooltipDescription:T,onClick:()=>p?.(L,k.label)},L)};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:Be("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:P=>p?.(P,k.label),error:k.error}):!k.multiple&&k.display==="segmented"?n.jsx(yn,{ariaLabel:k.displayLabel??k.label,options:[...k.allOption?[{key:wn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"?P.displayLabel:void 0,Z=typeof P!="string"?P.disabled:void 0;return{key:L,label:Q??L,disabled:Z}})],value:$&&k.allOption?wn:h[k.label]??"",onChange:P=>p?.(P,k.label),size:32}):!k.multiple&&k.display==="dropdown"?n.jsx(vn,{className:"filter-panel__dropdown",ariaLabel:typeof k.label=="string"?k.label:void 0,size:40,options:[...k.allOption?[{value:wn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"?P.displayLabel:void 0,Z=typeof P!="string"?P.disabled:void 0;return{value:L,label:Q??L,disabled:Z}})],value:$&&k.allOption?wn:h[k.label],onChange:P=>p?.(P,k.label)}):n.jsxs("div",{className:k.groups?"filter-panel__item-groups":"filter-panel__items",children:[k.allOption&&!k.groups&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(wn,k.label)}),k.groups?k.groups.map((P,L)=>n.jsxs("div",{className:"filter-panel__item-group",children:[L===0&&k.allOption&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(wn,k.label)}),P.filter(Q=>Q!=null).map(M)]},L)):G.map(M)]})]})]},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],Cn="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:Cn,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:Cn,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:Cn,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:Cn,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:Cn,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?Cn:Sn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?Cn:Sn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?Cn:Sn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?Cn:Sn}:{}}}function Dc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===wn?(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===Cn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===Cn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===Cn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===Cn),!0):!1}function G4(e){return"sections"in e}function is(e){const{t}=_e.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(In,{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:B=!1,showDivLine2:v=!1,middleSections:N=[],extraSelected:x={},onExtraSelect:E,showPaperBands:w=!1,showTopInfo:D=!0,showBottomInfo:A=!0}=e,k=[gc(t,{hasImage:h,hasColloquial:p,hasCaption:m??!1}),yc(t),...N,vc(t),...B?[wc(t)]:[],...v?[Bc(t)]:[],...w?[_c(t),xc(t)]:[]],R={...Ec(t,{contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,showTopInfo:D,showBottomInfo:A}),...x},$=(G,M)=>{Dc(t,G,M,b)||E?.(G,M)};return n.jsx(In,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:k,selected:R,onSelect:$,...d,sectionAlign:"horizontal"})}function us(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function K4(e){return us(e).replace(/"/g,""").replace(/'/g,"'")}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}=_e.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:Be("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(fe,{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 Iv({count:e,actions:t,onClear:a,clearLabel:r,visible:s,content:l,max:i}){const{t:u}=_e.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,B=g.current;if(g.current=c,c&&!B){const v=typeof document<"u"?document.activeElement:null;m.current=v&&v!==document.body&&!b?.contains(v)?v:null}else!c&&B&&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 B=D=>{f.current=D,C(D)},v=()=>{const D=b.firstElementChild??b,N=Array.from(D.children);if(N.length<2){B(!1);return}const k=N[0].offsetTop,R=N.some(L=>L.offsetTop!==k);if(!f.current){_.current=b.clientWidth,R&&B(!0);return}if(R)return;const $=N[0],G=N[N.length-1],M=G.offsetLeft+G.offsetWidth-$.offsetLeft,P=_.current;(P==null||M<=P)&&B(!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 w=new ResizeObserver(()=>{const D=x?.clientWidth??0;D!==E&&(E=D,_.current=null,v())});return x&&w.observe(x),()=>{A.disconnect(),w.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(fe,{htmlType:"button",size:40,label:d,onClick:a}),t.map((b,B)=>n.jsx(fe,{htmlType:"button",size:40,variant:b.variant??"default",icon:b.icon,label:b.label,onClick:b.onClick},B))]})]})}const Fv=[{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:Be("item-actions",a),children:Fv.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(fe,{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:Be("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:Be("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:Be("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:Be("section-head-float",t),children:e})}function Wo({items:e,className:t}){return n.jsx("div",{className:le(t?`chart-section__legend ${t}`:"chart-section__legend"),children:e.map((a,r)=>n.jsxs("span",{className:le("chart-section__legend-item"),children:[n.jsx("span",{className:le("chart-section__legend-dot"),style:{background:a.color}}),a.label]},r))})}function er({label:e,children:t}){return e?n.jsxs("div",{className:le("chart-section__total chart-section__total--stacked"),children:[n.jsx("span",{className:le("chart-section__total__label body-3"),children:e}),n.jsx("span",{className:le("chart-section__total__value"),children:t})]}):n.jsx("div",{className:le("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:B=!1,children:v}){const{t:A}=_e.useTranslation(),x=o.useRef(null),{anchorRect:E,openAt:w,close:D}=Oa(),N=o.useCallback(()=>{m&&x.current&&w(x.current)},[m,w]),[k,R]=o.useState(!1);Io(()=>{const S=x.current;if(!S||!u)return;const I=z=>R(z>0&&z<d);if(I(S.clientWidth),typeof ResizeObserver>"u")return;const O=new ResizeObserver(z=>I(z[0].contentRect.width));return O.observe(S),()=>O.disconnect()},[u,d]);const[$,G]=o.useState(null),M=o.useCallback(()=>G(null),[]),P=o.useCallback(S=>{const I=S.currentTarget.getBoundingClientRect();G(O=>O?null:{left:I.left,right:I.right,top:I.top,bottom:I.bottom,width:I.width,height:I.height,x:I.x,y:I.y})},[]),L=!!u&&k;o.useEffect(()=>{L||G(null)},[L]);const Q=u?[...u.options.map(S=>({label:S.label,icon:S.icon,selected:S.key===u.value,disabled:S.disabled,onClick:()=>u.onChange(S.key),closeOnSelect:!0})),...(c??[]).map((S,I)=>I===0?{...S,separatorBefore:!0}:S)]:[],Z=o.useCallback(S=>{if(!h)return;const I=S.target;I&&typeof I.closest=="function"&&I.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),F=o.useCallback(S=>{h&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},[h]),K=typeof l=="function"?l({collapsed:L}):l,T=g!=null||C?n.jsxs(er,{label:C,children:[g!=null&&n.jsx("span",{className:le("chart-section__total__num h0"),children:g}),y&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:y})]}):null,q=K||u?n.jsxs("div",{className:le("chart-section__head-right"),children:[u&&(L?n.jsx(fe,{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:P}):n.jsx(yn,{size:32,ariaLabel:u.ariaLabel,options:u.options.map(S=>({key:S.key,label:S.label,disabled:S.disabled})),value:u.value,onChange:u.onChange})),K]}):null,Y=o.useId(),U=a?`h${a}`:"div";return n.jsxs("section",{ref:x,className:le(["chart-section",B&&"chart-section--grid",h&&"chart-section--clickable",b].filter(Boolean).join(" ")),onClick:h?Z:void 0,onKeyDown:h?F: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:le("chart-section__head"),children:[n.jsxs("div",{className:le("chart-section__title-row"),children:[r&&n.jsx(nt,{icon:r,label:typeof e=="string"?e:void 0,className:le("chart-section__icon")}),n.jsx(U,{id:Y,className:le(["chart-section__title",t].filter(Boolean).join(" ")),children:e})]}),q,s&&n.jsx("div",{className:le("chart-section__disc body-3"),children:s})]}),(T||f)&&n.jsxs("div",{className:le(["chart-section__sub-row",_!=="start"&&`chart-section__sub-row--${_}`].filter(Boolean).join(" ")),children:[T,f]}),v,$&&n.jsx(xn,{anchorRect:$,onClose:M,ariaLabel:u?.ariaLabel??A("tooltip.menu","\uBA54\uB274"),children:n.jsx(Ha,{columns:[{items:Q}],onClose:M,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)),B=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++)B[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:B})}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(),B=l.get(r(p===11?h+1:h,(p+1)%12)),v=d.partsLen,A=[];for(let E=1;E<=m;E++){const w=_&&E>b;A.push({label:String(E),...w&&g[E]===0&&y[E]===0?{future:!0}:{},a:w&&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 w=Math.max(0,E+6-m),D=w&&B?Math.max(v,B.partsLen):v,N=d.hasPartsB||!!(w&&B?.hasPartsB);let k=0,R=0;const $=new Array(D).fill(0),G=new Array(D).fill(0);for(let P=E;P<=Math.min(E+6,m);P++){k+=g[P],R+=y[P];for(let L=0;L<v;L++)$[L]+=C[P][L],G[L]+=f[P][L]}if(w&&B)for(let P=1;P<=w&&!i(B.year,B.month,P);P++){k+=B.dayA[P],R+=B.dayB[P];for(let L=0;L<B.partsLen;L++)$[L]+=B.dayParts[P][L],G[L]+=B.dayPartsB[P][L]}const M=w?`${(p+1)%12+1}/${w}`:`${E+6}`;x.push({label:`${x.length+1}\uC8FC`,sublabel:`[${E}\uC77C~${M}\uC77C]`,a:k,b:R,...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 Iu(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 Fu(e){const{t,i18n:a}=_e.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(),R=Dn(N.year,N.month-1),$=Math.ceil((k-R+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)} ${Iu(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,B=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&&B(_[D+1].value)},[_,b,B]),E=o.useCallback(()=>{const D=_.findIndex(N=>N.value===b);D>0&&B(_[D-1].value)},[_,b,B]),w=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:B,activeOptions:_,activeIdx:A,handlePrev:x,handleNext:E,periodOptions:w,monthRange:g,weekRange:C,weekRanges:i,DOW:v}}const Nt=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,B=o.useMemo(()=>_?Math.max(0,...e.filter(F=>!Pn(F,b==null)).map(F=>g?Math.max(0,...(F.parts??[]).map(Nt)):(F.parts??[]).reduce((K,T)=>K+Math.max(0,Nt(T)),0))):Math.max(0,...e.filter(F=>!Pn(F,b==null)).flatMap(F=>f?[Nt(F.a)]:[Nt(F.a),Nt(F.b)])),[e,f,_,g]),v=o.useMemo(()=>{if(b==null)return 0;const F=e.filter(K=>!Pn(K,b==null)).flatMap(K=>_?(K.parts??[]).map(Nt):f?[Nt(K.a)]:[Nt(K.a),Nt(K.b)]);return Math.max(0,...F.map(K=>Math.abs(K-b)))},[e,b,_,f]),A=o.useMemo(()=>{const F=b!=null?v:B;return c??(d?F>0?F:10:Math.ceil(F/10)*10||10)},[B,v,b,c,d]),x=u,E=_?g?Math.max(1,h.length):1:f?1:2,w={"--bar-width":`${o.useMemo(()=>{const F=Math.max(1,e.length);return Math.max(2,Math.min(l,Math.round(120/(F*E)+6)))},[e.length,E,l])}px`},D={"--bar-group-gap":`${Math.max(0,i)}px`},N=o.useMemo(()=>{const F=Math.round(A/2);return b!=null?[b+A,...F!==A?[b+F]:[],b,...F!==A?[b-F]:[],b-A]:F!==A?[A,F,0]:[A,0]},[A,b]),k=F=>b!=null?1-(F-(b-A))/(2*A):1-F/A,[R,$]=o.useState(null),G=o.useCallback(()=>$(null),[]),M=o.useCallback((F,K)=>{const T=[F.label,F.sublabel].filter(Boolean).join(" ");let q;if(_&&g&&F.rawPartsB)q=(p??[]).map((Y,U)=>{const S=F.rawPartsB[U]??0;return{text:S>0?`${Y}: ${K[U]??0}% (${F.rawParts?.[U]??0}/${S})`:`${Y}: -`,color:(h??[])[U]}});else if(_&&g)q=(p??[]).map((Y,U)=>({text:`${Y}: ${Q(K[U]??0)}`,color:(h??[])[U]}));else if(_){const Y=(p??[]).map((S,I)=>({text:`${S}: ${K[I]??0}`,color:(h??[])[I]})),U=Y.filter((S,I)=>(K[I]??0)>0);q=U.length?U:Y}else m&&!f?q=[{text:`${r} ${Nt(F.a)}%`,color:t},{text:`${s} ${Nt(F.b)}%`,color:a}]:m&&F.rawB!==void 0?q=[{text:`${m.total} ${F.rawB}`},{text:`${m.done} ${F.rawA??0}`,color:t}]:f?q=[{text:`${r}: ${Nt(F.a)}`,color:t}]:q=[{text:`${r}: ${Nt(F.a)}`,color:t},{text:`${s}: ${Nt(F.b)}`,color:a}];return{title:T,items:q}},[_,g,p,h,m,f,r,s,t,a,b]),P=o.useCallback((F,K,T)=>{const q=F.getBoundingClientRect(),{title:Y,items:U}=M(K,T);$({rect:{left:q.left,top:q.top,right:q.right,bottom:q.bottom,width:q.width,height:q.height},title:Y,items:U})},[M]),L=o.useCallback((F,K)=>{const{title:T,items:q}=M(F,K);return[T,...q.map(Y=>Y.text)].filter(Boolean).join(", ")},[M]),Q=F=>b!=null&&F>b?`+${F}`:`${F}`,Z=R!=null;return o.useEffect(()=>{if(!Z)return;const F=()=>$(null),K=T=>{const q=T.target;q&&typeof q.closest=="function"&&q.closest(".bar-chart__col")||$(null)};return window.addEventListener("scroll",F,!0),document.addEventListener("pointerdown",K,!0),()=>{window.removeEventListener("scroll",F,!0),document.removeEventListener("pointerdown",K,!0)}},[Z]),n.jsxs("div",{className:le("bar-chart__wrap"),style:D,children:[n.jsx("div",{className:le("bar-chart__inner"),children:n.jsx("div",{className:le("bar-chart__scroll"),children:n.jsxs("div",{className:le("bar-chart__area"),children:[n.jsxs("div",{className:le("bar-chart__plot"),style:{height:x},children:[N.slice(0,-1).map((F,K)=>n.jsx("div",{className:le(`bar-chart__gridline${b!=null&&F===b?" bar-chart__gridline--baseline":""}`),style:{top:k(F)*x},children:n.jsx("span",{className:le("bar-chart__gridline__label caption-1"),children:F})},K)),e.map((F,K)=>{const T=Pn(F,b==null),q=x/2,Y=O=>b!=null?Math.min(q,Math.abs(Nt(O)-b)/A*q):Math.min(x,Math.max(0,Nt(O)/A*x)),U=T?0:Y(F.a),S=T?0:Y(F.b),I=(F.parts??[]).map(Nt);return n.jsx("div",{className:le(`bar-chart__col${g&&_?" bar-chart__col--group":""}`),style:{cursor:T?"default":"pointer"},tabIndex:C&&!T?0:void 0,role:C&&!T?"img":void 0,"aria-label":C&&!T?L(F,I):void 0,onMouseEnter:T?void 0:O=>P(O.currentTarget,F,I),onFocus:T||!C?void 0:O=>P(O.currentTarget,F,I),onBlur:C?G:void 0,onMouseLeave:G,children:!T&&(_&&g?(h??[]).map((O,z)=>{const se=I[z]??0;if(b==null)return n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:Y(se),background:O}},z);const te=Nt(se)<b;return n.jsxs("div",{className:le("bar-chart__slot"),style:w,children:[n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--up"),children:!te&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full"),style:{height:Y(se),background:O}})}),n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--down"),children:te&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(se),background:O}})})]},z)}):_?n.jsx("div",{className:le("bar-chart__stack"),style:w,children:(()=>{const O=I.reduce((se,te,de)=>te>0?de:se,-1);let z=x;return I.map((se,te)=>{if(se<=0)return null;const de=Math.min(z,se/A*x);return z-=de,n.jsx("div",{className:le("bar-chart__stack-segment"),style:{height:de,background:(h??[])[te],borderRadius:te===O?"6px 6px 0 0":void 0}},te)})})()}):b!=null?n.jsx(n.Fragment,{children:[{v:Nt(F.a),c:t},...f?[]:[{v:Nt(F.b),c:a}]].map(({v:O,c:z},se)=>n.jsxs("div",{className:le("bar-chart__slot"),style:w,children:[n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--up"),children:O>=b&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full"),style:{height:Y(O),background:z}})}),n.jsx("div",{className:le("bar-chart__slot__half bar-chart__slot__half--down"),children:O<b&&n.jsx("div",{className:le("bar-chart__bar bar-chart__bar--full bar-chart__bar--down"),style:{height:Y(O),background:z}})})]},se))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:U,background:t}}),!f&&n.jsx("div",{className:le("bar-chart__bar"),style:{...w,height:S,background:a}})]}))},K)})]}),n.jsx("div",{className:le("bar-chart__x-axis"),children:e.map((F,K)=>{const T=Pn(F,b==null);return n.jsxs("span",{className:le(`bar-chart__x-axis__label${T?" bar-chart__x-axis__label--future":""}`),children:[n.jsxs("span",{className:le("caption-1 bar-chart__x-axis__main"),children:[F.isToday&&n.jsx("span",{className:le("bar-chart__x-axis__today-dot"),style:{background:t}}),F.label]}),F.sublabel&&n.jsx("span",{className:"caption-1",children:F.sublabel})]},K)})})]})})}),R&&n.jsx(Xn,{anchorRect:R.rect,title:R.title,items:R.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Ou({control:e}){const{t}=_e.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:le("chart-section__controls"),children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:i}),n.jsx(vn,{value:s,onChange:l,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:m,showTooltipInfo:m,disabled:r<=0,onClick:u}),n.jsx(yn,{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,B=_&&b?Dn(_,b-1):1;return C.weekly.map((v,A)=>{const x=A+1;let E=v.label,w=!1,D=!1;if(_&&b){const N=B+A*7,k=new Date(_,b-1,N+6),R=k.getMonth()+1,$=k.getDate(),G=R===b?`${$}`:`${R}/${$}`;E=a("manager.chart.weekRange",{start:N,end:G});const M=new Date(h,p-1,m).getTime();w=M>=new Date(_,b-1,N).getTime()&&M<=k.getTime(),D=_>h||_===h&&(b>p||b===p&&N>m)}return{...v,label:E,sublabel:Iu(a,x-1),isToday:w,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,B=C.getDate(),v=C.getFullYear();return{label:b===g.month&&v===g.year?`${B}`:`${b}/${B}`,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&&B===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:B,series:v,seriesMode:A="stack",loading:x=!1,onDetail:E,headExtra:w,headSegment:D,icon:N,disc:k,onClick:R,cardAriaLabel:$,cardTooltip:G,detailSize:M=32,barGap:P,baseline:L,className:Q,inGrid:Z=!1}){const{t:F}=_e.useTranslation(),K=Kv[t],T=Fu(l),q=g??T,Y=o.useMemo(()=>Gv(l,q,F,L==null),[l,q,F,L]),U=A==="group"&&!!v&&v.length>0;P!=null&&!U&&xt("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 S=o.useMemo(()=>{if(!C)return Y;const ee=q.period==="month"?ga(q.monthRange):null,V=ca(),ne=v?.length??0,W=H=>{const ie=[],Te=[],ye=[];for(let he=0;he<ne;he++){let Se=0,$e=0,Ne=0;for(const ue of H){const xe=Nt(ue.a[he]),ke=Nt(ue.b[he]);ke<=0||(Se+=xe,$e+=ke,Ne+=xe/ke*100)}ie.push(f==="weighted"?$e>0?Math.round(Se/$e*100):0:H.length?Math.round(Ne/H.length):0),Te.push(Se),ye.push($e)}return{pct:ie,ra:Te,rb:ye}};return Y.map((H,ie)=>{let Te=H.a===-1?-1:H.b>0?Math.round(H.a/H.b*100):0;if(ee&&!Pn(H)){const he=ee.year,Se=ee.month1-1,$e=Uo(l,new Date(he,Se,Dn(he,Se)+ie*7),V).filter(Ne=>!Ne.isFuture);if(f==="weighted"){let Ne=0,ue=0;for(const{entry:xe}of $e)xe&&xe.b>0&&(Ne+=xe.a,ue+=xe.b);Te=ue>0?Math.round(Ne/ue*100):0}else Te=$e.length?Math.round($e.reduce((Ne,{entry:ue})=>Ne+(ue&&ue.b>0?ue.a/ue.b*100:0),0)/$e.length):0}let ye=null;if(U&&!Pn(H)){let he;if(ee){const $e=ee.year,Ne=ee.month1-1;he=Uo(l,new Date($e,Ne,Dn($e,Ne)+ie*7),V).filter(ue=>!ue.isFuture).map(({entry:ue})=>({a:ue?.parts??[],b:ue?.partsB??[]}))}else he=[{a:H.parts??[],b:H.partsB??[]}];const Se=W(he);ye={parts:Se.pct,rawParts:Se.ra,rawPartsB:Se.rb}}return{...H,a:Te,b:H.a===-1?0:d&&H.parts&&H.parts[1]>0?Math.round(H.parts[0]/H.parts[1]*100):0,rawA:H.a===-1?-1:H.a,rawB:H.b,...ye??{}}})},[Y,C,f,d,q.period,q.monthRange,l,U,v?.length]),I=o.useMemo(()=>{if(C||b){const V=(q.period==="week"?Y:l[q.monthRange]?.daily??[]).filter(W=>W.a!==-1);if(V.length===0)return 0;if(C&&f==="weighted"){let W=0,H=0;for(const ie of V)ie.b>0&&(W+=ie.a,H+=ie.b);return H>0?Math.round(W/H*100):0}const ne=C?V.reduce((W,H)=>W+(H.b>0?H.a/H.b*100:0),0):V.reduce((W,H)=>W+(H.a>0?H.a:0),0);return Math.round(ne/V.length)}const ee=q.period==="month"?l[q.monthRange]?.daily??[]:S;return L!=null?ee.reduce((V,ne)=>V+(Pn(ne,!1)?0:Nt(ne.a)+(d?Nt(ne.b):0)),0):ee.reduce((V,ne)=>V+(ne.a>0?ne.a:0)+(d&&ne.b>0?ne.b:0),0)},[S,Y,C,f,b,L,d,q.period,q.monthRange,l]),O=v&&v.length>0?v.map(ee=>({color:ee.color,label:ee.label})):[{color:i,label:F(c)},...d?[{color:u,label:F(d)}]:[]],z=t==="small",se=[z?"chart-section--compact":t==="large"?"chart-section--full":void 0,Q].filter(Boolean).join(" ")||void 0,te=r?F(r):"",de=te?F("trainingStatus.detailFor",{name:te,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):F("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Ho,{className:se,inGrid:Z,icon:N,disc:k,onClick:R,ariaLabel:$,tooltip:G,headSegment:D,headMenuItems:E?[{label:de,icon:"list",onClick:E,closeOnSelect:!0}]:void 0,title:F(r),titleLevel:s,titleClassName:z?"h5 chart-section-title--small":void 0,headRight:z?w??void 0:({collapsed:ee})=>n.jsxs(n.Fragment,{children:[!y&&n.jsx(Ou,{control:q}),w,E&&!ee&&n.jsx("span",{className:le("bar-chart__detail-btn"),children:n.jsx(fe,{htmlType:"button",size:M,type:"dot",icon:"list",ariaLabel:de,showTooltipInfo:de,onClick:E})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||b||m&&B?n.jsx(er,{label:z?void 0:`${F(q.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${F(m??c)}`,children:B?(B(I).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ee,V)=>/\d/.test(ee)?n.jsx("span",{className:le("chart-section__total__num h0"),children:ee},V):n.jsx("span",{className:le("chart-section__total__unit h5"),children:ee},V)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:le("chart-section__total__num h0"),children:I}),p&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(p)})]})}):n.jsxs(er,{children:[n.jsx("span",{className:le("chart-section__total__num h0"),children:I}),n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(c)}),p&&n.jsx("span",{className:le("chart-section__total__unit h5"),children:F(p)})]}):n.jsx("span",{}),n.jsx(Wo,{items:O,className:"caption-1"})]}),children:x?n.jsx("div",{className:le("bar-chart__wrap bar-chart__loading"),"aria-busy":"true",children:n.jsx("div",{className:le("bar-chart__inner"),children:n.jsxs("div",{className:le("bar-chart__area bar-chart__area--loading"),children:[n.jsx("div",{className:le("bar-chart__plot bar-chart__plot--loading"),style:{height:K.height},children:n.jsx(pa,{size:32})}),n.jsx("div",{className:le("bar-chart__x-axis"),"aria-hidden":"true",children:n.jsxs("span",{className:le("bar-chart__x-axis__label"),children:[n.jsx("span",{className:le("caption-1 bar-chart__x-axis__main"),children:"\xA0"}),S.some(ee=>!!ee.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(Uv,{focusableBars:e,data:S,colorA:i,colorB:d?u:void 0,labelA:F(c),labelB:d?F(d):void 0,barWidth:a??K.barWidth,barGap:P,baseline:L,height:K.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:v?.map(ee=>ee.color),seriesLabels:v?.map(ee=>ee.label),rateLabels:C?{total:F("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:F("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 L=Z=>m(Math.round(Z)||null);if(L(g.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Q=new ResizeObserver(([Z])=>L(Z.contentRect.width));return Q.observe(g),()=>{Q.disconnect()}},[g]);const{payload:C,anchorRect:f,openAfterDelay:_,close:b}=Hy(zu),B=o.useCallback((L,Q)=>{L&&_(L,Q.getBoundingClientRect())},[_]),v=p??i,A=l,{left:x,right:E,top:w,bottom:D}={...Zv,...u},[N,k]=t,R=L=>k===N?x:x+(v-x-E)*(L-N)/(k-N),$=L=>w+(A-w-D)*(100-L)/100,G={x:R,y:$,plot:{left:x,right:v-E,top:w,bottom:A-D,width:Math.max(0,v-x-E),height:Math.max(0,A-w-D)}},M=e.filter(L=>!L.hollow),P=s??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:y,className:Be("line-chart",h),viewBox:`0 0 ${v} ${A}`,role:"img","aria-label":d??e.map(L=>L.description).filter(Boolean).join(", "),children:[r&&n.jsx("text",{className:"line-chart__axis-title",x:0,y:12,children:r}),[0,100].map(L=>n.jsxs("g",{children:[n.jsx("line",{className:"line-chart__grid",x1:x,x2:v-E,y1:$(L),y2:$(L)}),n.jsxs("text",{className:"line-chart__tick",x:x-6,y:$(L)+4,textAnchor:"end",children:[L,"%"]})]},L)),c?.(G),a.map(L=>n.jsx("text",{className:"line-chart__tick",x:R(L.x),y:A-5,textAnchor:"middle",children:L.label},L.x)),M.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:P,points:M.map(L=>`${R(L.x)},${$(L.pct)}`).join(" ")}),e.map(L=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Q=>B(L.description,Q.currentTarget),onPointerLeave:b,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:R(L.x),cy:$(L.pct),r:12}),n.jsx("circle",{className:Be("line-chart__dot-main",L.hollow&&"is-hollow"),cx:R(L.x),cy:$(L.pct),r:4,stroke:P,fill:L.hollow?void 0:P})]},L.x))]}),C!=null&&n.jsx(xn,{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:Be("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:Be("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(fe,{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,B)=>{const v=b.length>0?b[b.length-1].acc:0,A=Number.isFinite(B.ratio)?B.ratio:0,x=Math.max(0,Math.min(A,1-v));return b.push({color:B.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,B)=>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})`},B))]})})}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}=_e.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",B=[c,f?"chart-section--compact":b?"chart-section--full":""].filter(Boolean).join(" ")||void 0,v=r&&n.jsx("span",{className:le("chart-section-icon"),children:n.jsx(nt,{icon:r,className:le("chart-section-icon-inner")})});return n.jsx(Ho,{className:B,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:le("chart-section__total__num h0"),children:C}),n.jsx("span",{className:le("chart-section__total__unit h5"),children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Wo,{items:i})]}),children:u?n.jsx("div",{className:le("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:le("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:le(`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:le("stat-chart__card__label-row"),children:[n.jsx("span",{className:le("stat-chart__card__label h5"),children:e}),s&&n.jsx("span",{className:le("stat-chart__card__icon"),children:n.jsx(nt,{icon:s,className:le("stat-chart__card__icon-inner")})})]}),n.jsxs("div",{className:le("stat-chart__card__content"),children:[n.jsxs("div",{className:le("stat-chart__card__left"),children:[n.jsx("div",{className:le("stat-chart__card__value h2"),children:t}),y&&n.jsx("div",{className:le(`stat-chart__card__change stat-chart__card__change--${g??"neutral"} caption-1`),children:y})]}),u&&n.jsx("div",{className:le("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:B=!1,tickStep:v,tickShape:A="dot"}){t&&!c&&xt("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,w=l==="vertical",D=!t,N=Y=>t?.(Number(Y.target.value)),k=typeof d=="number"?`${d}px`:d,R={"--slider-ratio":String(E),"--slider-thumb":`${i}px`,...k?w?{height:k}:{width:k}:{}},$=v??s,G=(b||B)&&$>0&&r>a?Math.floor((r-a)/$+1e-6):0;if(G>0&&G<=100){const Y=A!=="dash",U=se=>Y?`radial-gradient(circle, ${se} 0.5px, transparent 1px)`:w?`linear-gradient(to bottom, transparent calc(50% - 2px), ${se} calc(50% - 2px), ${se} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${se} calc(50% - 2px), ${se} calc(50% + 2px), transparent calc(50% + 2px))`,S=Y?"2px":"4px",I=[],O=[],z=[];for(let se=0;se<=G;se++){const te=se*$/(r-a);if(te>1+1e-6)break;const de=`${((w?1-te:te)*100).toFixed(4)}%`,ee=te<=E+1e-6;if(ee?!B:!b)continue;const V=ee?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";I.push(U(V)),O.push(w?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),z.push(w?`center ${de}`:`${de} center`)}I.push(w?"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))"),O.push("100% 100%"),z.push("0 0"),R.backgroundImage=I.join(", "),R.backgroundSize=O.join(", "),R.backgroundPosition=z.join(", "),R.backgroundRepeat="no-repeat"}const M=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,P=n.jsx("input",{type:"range",className:Be("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":M,"aria-orientation":l,onChange:N,style:R});if(!p&&!C)return P;const L=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:Be("slider-track-group",`slider-track-group--${l}`,!p&&h),children:[w?Q:L,P,w?L:Q]}):P;if(!p)return Z;const F=g??(w?"bottom":"right"),K=`${Math.round(r>a?(x-a)/(r-a)*100:0)}%`,T=m?m(x):p==="percent"?K:p==="count"?`${x} / ${r}`:String(x),q=n.jsx("span",{className:"slider-wrap__value body-3b",children:T});return n.jsxs("div",{className:Be("slider-wrap",`slider-wrap--${l}`,`slider-wrap--label-${F}`,`slider-wrap--align-${y}`,h),children:[Z,q]})}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=P=>{const L=Yo(P,c,d,h);C.current&&(C.current.textContent=L);const Q=g.current;Q&&(Q.setAttribute("aria-valuenow",String(Ko(P,c,d,h))),Q.setAttribute("aria-valuetext",L))},E=e??G1(t)??(_&&_.el===t?_.node:null),w=y.current;if(!E||!w){w?.style.setProperty("--meter-level","0"),x(u);let P=!1;return!e&&t&&sr(t).then(L=>{!P&&L&&b({el:t,node:L})}),()=>{P=!0}}ao();const D=new Float32Array(E.fftSize);let N=0,k=0,R=0,$=0,G=null;const M=P=>{const L=K1(E,D);N=L>N?L:N*n4;const Q=N>1e-5?20*Math.log10(N):-1/0,Z=Math.max(u,Q),F=Z-c,K=Math.min(1,Math.max(0,(F-d)/(h-d)));if(w.style.setProperty("--meter-level",K.toFixed(3)),k+=Z,R+=1,P-$>=a4){const T=k/R;G=G==null?T:G*.6+T*.4,x(G),k=0,R=0,$=P}f.current=requestAnimationFrame(M)};return f.current=requestAnimationFrame(M),()=>{f.current!=null&&cancelAnimationFrame(f.current),f.current=null}},[e,t,_,u,c,d,h]);const B=typeof r=="number"?`${r}px`:r,v=n.jsx("div",{className:"audio-meter__track",style:B?a==="vertical"?{height:B}:{width:B}:{},children:n.jsx("div",{ref:y,className:"audio-meter__fill"})}),A=l??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:g,className:Be("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),B=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)))},[]),w=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),B.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),B.current&&cancelAnimationFrame(B.current),v.current&&cancelAnimationFrame(v.current),A.current&&clearTimeout(A.current),y.current=null,b.current=null,B.current=null,v.current=null,A.current=null}},[e,g,t]),{mounted:i,showing:s,popupRef:h,pause:E,resume:w}}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"?dn.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:Be("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}=_e.useTranslation(),d=gn("(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:Be("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:B,icon:v,count:A,collapsed:x=!1,onToggleCollapse:E,headerActions:w,empty:D,loading:N,dragOver:k=!1,onDragOver:R,onDragLeave:$,onDrop:G,renderExpandedRow:M,expandedId:P}){const{t:L}=_e.useTranslation(),Q=o.useId(),Z=`table-title-${Q}`,F=`table-row-hint-${Q}`,[K,T]=o.useState(null),q=o.useCallback((oe,be)=>{const Ie=e[be];if(!Ie)return;if(Ie.sortValue)return Ie.sortValue(oe);if(Ie.sortKey)return oe[Ie.sortKey];const Xe=l(oe)[be]?.content;return typeof Xe=="string"||typeof Xe=="number"?Xe:void 0},[e,l]),Y=!t&&a&&!e.some(oe=>oe.sortDir!==void 0||oe.onClick),U=o.useCallback(oe=>{const be=e[oe];if(!be||be.sortable===!1)return!1;if(be.sortValue||be.sortKey)return!0;const Ie=s[0];return Ie!==void 0&&q(Ie,oe)!==void 0},[e,s,q]),S=o.useMemo(()=>t?e.map(oe=>{if(!oe.sortKey||oe.sortDir!==void 0)return oe;const be=t.field(String(oe.label??""),oe.sortKey);return{...oe,sortDir:be.sortDir,onClick:oe.onClick??be.onClick}}):Y?e.map((oe,be)=>U(be)?{...oe,sortDir:K?.index===be?K.asc?"asc":"desc":null,onClick:()=>T(Ie=>Ie?.index===be?{index:be,asc:!Ie.asc}:{index:be,asc:!0})}:oe):e,[e,t,Y,K,U]),I=o.useMemo(()=>{if(!Y||!K)return s;const{index:oe,asc:be}=K;return[...s].sort((Ie,Xe)=>fr(q(Ie,oe),q(Xe,oe),be))},[s,Y,K,q]),O=gn("(max-width: 767px)"),z=y&&O?y:null,se=C&&!O,te=o.useRef(se);te.current=se;const de=48,ee=40,V=o.useRef(()=>de),ne=_?`table-cols:${_}`:null,W=o.useRef(null),H=o.useRef(null),ie=o.useRef(null),Te=o.useRef(null),[ye,he]=o.useState(!1),[Se,$e]=o.useState(0),Ne=o.useCallback(()=>{const oe=ie.current;if(!oe)return;const be=Te.current,Ie=W.current;if(be&&(be.style.minWidth="",Ie)){const Xe=Ie.scrollWidth,et=te.current?ee:0;be.style.minWidth=Xe>oe.clientWidth+1?`${Xe+et}px`:""}he(oe.scrollWidth>oe.clientWidth+1),$e(oe.clientWidth)},[]),ue=o.useCallback((oe,be)=>{const Ie=oe.current;Ie&&H.current&&H.current.unobserve(Ie),oe.current=be,be?(!H.current&&typeof ResizeObserver<"u"&&(H.current=new ResizeObserver(()=>Ne())),H.current?.observe(be)):!ie.current&&!Te.current&&(H.current?.disconnect(),H.current=null),Ne()},[Ne]),xe=o.useCallback(oe=>ue(ie,oe),[ue]),ke=o.useCallback(oe=>ue(Te,oe),[ue]);o.useEffect(()=>{Ne()}),o.useEffect(()=>{if(typeof window>"u")return;const oe=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>Ne()):null;return window.addEventListener("resize",Ne),()=>{oe!=null&&cancelAnimationFrame(oe),window.removeEventListener("resize",Ne)}},[Ne]);const Ee=o.useRef(()=>!1),We=o.useRef([]),He=o.useRef(null),ot=oe=>{if(!oe||typeof window>"u")return null;try{const be=JSON.parse(window.localStorage.getItem(oe)??"null");return Array.isArray(be)&&be.length>0&&be.every(Ie=>typeof Ie=="number"&&Number.isFinite(Ie)&&Ie>0)?be:null}catch{return null}},[Qe,Je]=o.useState(()=>ot(ne)),[vt,je]=o.useState(ne),[Ye,we]=o.useState(()=>ot(ne)!==null);if(vt!==ne){je(ne);const oe=ot(ne);Je(oe),we(oe!==null)}const Ue=o.useRef(Qe);o.useEffect(()=>{Ue.current=Qe},[Qe]);const qe=o.useCallback(oe=>{const be=He.current;if(!be)return;const Ie=Ue.current;if(Ie){const Xe=[...Ie],et=()=>de;if(be.next!=null&&be.startWNext!=null){const rt=oe.clientX-be.startX,Lt=Math.max(et()-be.startW,Math.min(be.startWNext-et(),rt));Xe[be.index]=be.startW+Lt,Xe[be.next]=be.startWNext-Lt}else Xe[be.index]=Math.max(et(),be.startW+(oe.clientX-be.startX));Ue.current=Xe,Je(Xe)}},[]),pt=o.useCallback(()=>{if(He.current=null,window.removeEventListener("pointermove",qe),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),document.body.style.cursor="",document.body.style.userSelect="",ne&&Ue.current)try{window.localStorage.setItem(ne,JSON.stringify(Ue.current))}catch{}},[qe,ne]),_t=o.useCallback((oe,be)=>{be.preventDefault(),be.stopPropagation();const Ie=W.current;if(!Ie)return;const Xe=Array.from(Ie.children).map(rt=>rt.getBoundingClientRect().width),et=f==="fit"?S.findIndex((rt,Lt)=>Lt>oe&&rt.resizable!==!1):-1;He.current=et>=0?{index:oe,startX:be.clientX,startW:Xe[oe],next:et,startWNext:Xe[et]}:{index:oe,startX:be.clientX,startW:Xe[oe]},Ue.current=Xe,Je(Xe),we(!0),window.addEventListener("pointermove",qe),window.addEventListener("pointerup",pt),window.addEventListener("pointercancel",pt),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[qe,pt,f,S]),Et=o.useCallback(()=>{const oe=W.current,be=oe?.closest(".table-wrap");if(!oe||!be)return null;const Ie=be.style.getPropertyValue("--table-grid-cols");be.style.setProperty("--table-grid-cols",S.map(()=>"max-content").join(" "));const Xe=Array.from(be.querySelectorAll(".table-row")).filter(St=>!St.classList.contains("table-row--loading")&&!St.classList.contains("table-row--empty")),et=St=>Array.from(St.children).map(Rt=>{const Wt=window.getComputedStyle(Rt);return{width:Rt.getBoundingClientRect().width,span:u4(Wt.gridColumnStart,Wt.gridColumnEnd)}}),rt=parseFloat(window.getComputedStyle(oe).columnGap)||0,Lt=Xe.map(et),Bn=et(oe),ln=i4([Bn,...Lt],S.length,rt),$t=p4(S.map((St,Rt)=>({declaredMin:V.current(Rt),headWidth:Bn[Rt]?.width??0,sortable:St.sortDir!==void 0||!!St.onClick,sorted:!!St.sortDir}))),Ot=St=>$t[St]??V.current(St),un=S.map((St,Rt)=>{const Wt=ln[Rt],Kt=Ee.current(Rt)?parseFloat(We.current[Rt]):NaN;return Number.isFinite(Kt)&&Math.ceil(Wt)>Kt&&xt(`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(oe),kn=(parseFloat(Pt.paddingLeft)||0)+(parseFloat(Pt.paddingRight)||0),Jt=be.clientWidth-kn;return Ie?be.style.setProperty("--table-grid-cols",Ie):be.style.removeProperty("--table-grid-cols"),c4(un,{isFixed:St=>Ee.current(St),floorOf:Ot,containerWidth:Jt})},[S,f]),Bt=(oe,be)=>oe!==null&&oe.length===be.length&&oe.every((Ie,Xe)=>Ie===be[Xe]),st=o.useRef(Et);o.useEffect(()=>{st.current=Et});const[tt,kt]=o.useState(0),At=I.length>0,jt=`${ne??""}|${tt}|${S.length}|${Se}`,Mt=!Ye&&se&&ne!==null&&!N?`${jt}|${At?1:0}`:null,gt=o.useRef(null);o.useEffect(()=>{if(Mt===null||!At||gt.current===jt)return;const oe=st.current();oe&&(gt.current=jt,Je(be=>Bt(be,oe)?be:oe))},[Mt]);const it=o.useCallback(()=>{if(ne)try{window.localStorage.removeItem(ne)}catch{}we(!1);const oe=st.current();Je(oe),Ue.current=oe,kt(be=>be+1)},[ne]);o.useEffect(()=>()=>{He.current&&(window.removeEventListener("pointermove",qe),window.removeEventListener("pointerup",pt),window.removeEventListener("pointercancel",pt),document.body.style.cursor="",document.body.style.userSelect="")},[qe,pt]);const ut=S.length>0&&S.every(oe=>oe.width!=null)?S.map(oe=>typeof oe.width=="number"?`${oe.width}px`:String(oe.width)).join(" "):null;S.some(oe=>oe.width!=null)&&!ut&&xt(`table-field-width:${S.map(oe=>oe.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."),ut&&g&&xt("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 ct=g??ut??void 0,ve=l4(ct),Me=ve.filter(oe=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(oe));Me.length>0&&xt(`table-content-track:${g}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Me.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=S.findIndex(oe=>!!oe.sortDir);S.filter(oe=>!!oe.sortDir).length>1&&xt("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 Oe=oe=>oe===Pe?S[oe].sortDir==="asc"?"ascending":"descending":S[oe].onClick?"none":void 0,dt=oe=>/^\d+(\.\d+)?px$/.test(ve[oe]??""),Dt=oe=>{const be=ve[oe]??"",Ie=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(be)??/^(\d+(?:\.\d+)?)px$/.exec(be);return Ie?parseFloat(Ie[1]):de};Ee.current=dt,V.current=Dt,We.current=ve;const yt=oe=>f==="fit"&&!dt(oe)?"fr":"px",wt=Qe&&Qe.length===S.length&&!O,Ct=z??(wt?S.map((oe,be)=>oe.resizable===!1&&ve[be]?ve[be]:`${Qe[be]}${yt(be)}`).join(" "):ct),Le=Ct?{"--table-grid-cols":Ct}:void 0,at=B!==void 0;return n.jsxs("div",{ref:xe,className:`table-wrap table-wrap--${b}${se?" table-wrap--resizable":""}${k?" table-wrap--dragover":""}${x?" table-wrap--collapsed":""}`,style:Le,onDragOver:R,onDragLeave:$,onDrop:G,tabIndex:ye?0:void 0,role:ye?"region":void 0,"aria-label":ye?typeof B=="string"?B:L("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!i&&n.jsx("span",{id:F,className:"table-row-hint",children:L("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:ke,role:"table","aria-labelledby":at&&typeof B=="string"?Z:void 0,className:"table body-2",children:[at&&n.jsxs("div",{className:Be("table-header",E&&"table-header--clickable"),onClick:E,role:"caption",children:[E&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:x?"chevron-right":"chevron-down",ariaLabel:x?L("common.expand","\uD3BC\uCE58\uAE30"):L("common.collapse","\uC811\uAE30"),ariaExpanded:!x,className:"table-header__chevron"}),v&&n.jsx(nt,{icon:v,label:typeof B=="string"?B:void 0,className:"table-header__icon"}),n.jsx("span",{id:Z,className:"table-header__title h5b",children:B}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),w&&n.jsx("span",{className:"table-header__actions",onClick:oe=>oe.stopPropagation(),children:w})]}),!x&&n.jsxs(n.Fragment,{children:[r&&r.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:r.map((oe,be)=>n.jsx("div",{role:"columnheader","aria-colspan":oe.span,className:Be("table-field body-3",oe.className),style:{gridColumn:`span ${oe.span}`},children:oe.label},be))}),n.jsxs("div",{role:"presentation",className:Be("table-fields-strip",se&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:W,children:S.map((oe,be)=>n.jsx(C4,{onClick:oe.onClick,className:Be(oe.className,Ju(oe.align)),sortDir:oe.sortDir,ariaSort:Oe(be),onResizeStart:se&&be<S.length-1&&oe.resizable!==!1&&(f!=="fit"||S.some((Ie,Xe)=>Xe>be&&Ie.resizable!==!1))?Ie=>_t(be,Ie):void 0,children:oe.label},be))}),se&&n.jsx("div",{className:"table-fields__reset-dock",children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:L("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:it})})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:N?n.jsx(Xo,{variant:"loading",colSpan:S.length||void 0}):I.length===0&&D?n.jsx(Xo,{variant:"empty",colSpan:S.length||void 0,children:D}):I.map((oe,be)=>{const Ie=m!=null&&oe.id===m,Xe=!!i&&(u?u(oe):!0),et=P!=null&&oe.id!=null&&(P instanceof Set?P.has(oe.id)||[...P].some(rt=>String(rt)===String(oe.id)):String(oe.id)===String(P));return n.jsx(Xo,{className:`${Xe?" table-row--clickable":""}${h?" table-row--draggable":""}${Ie?" table-row--dragging":""}`.trim(),draggable:!!h,onClick:Xe?()=>i(oe):void 0,colSpan:S.length||void 0,rowHasButton:l(oe).some(rt=>!!rt.rowLabel),describedBy:F,onMouseEnter:c?rt=>c(oe,rt):void 0,onMouseLeave:d?rt=>d(oe,rt):void 0,onDragStart:h?rt=>h(oe,rt):void 0,onDragEnd:p?rt=>p(oe,rt):void 0,expandedContent:et&&M?M(oe):void 0,children:l(oe).map((rt,Lt)=>n.jsx(h4,{className:Be(rt.className,Ju(S[Lt]?.align)),style:rt.style,span:rt.span,rowLabel:Xe?rt.rowLabel:void 0,onRowClick:Xe?()=>i(oe):void 0,children:rt.content},Lt))},oe.id!=null?`${typeof oe.id}:${oe.id}`:`__idx:${be}`)})})]})]})]})}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}=_e.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,B)=>{if(f==="worn"){const v=Number(B.worn)-Number(b.worn);return _?v:-v}return fr(Qu(b,f),Qu(B,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(fe,{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(Fo,{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(fe,{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}=_e.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),w=[];for(let D=0;D<E;D++)w.push(null);for(let D=1;D<=x;D++)w.push(D);for(;w.length<35;)w.push(null);return w},[d,p]),b=o.useCallback(()=>{p===0?(h(x=>x-1),m(11)):m(x=>x-1)},[p]),B=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(nt,{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:B,"aria-label":l("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(nt,{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 w=x,D=v(w),N=f[D]??[],k=Vl(D,i.language),R=g===D;return n.jsxs("div",{className:`calendar-cell${A(w)?" today":""}${R?" 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(w)?"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:w}),N.length>0&&(()=>{const $=[{key:"visited",label:l("calendar.legend.visited","\uBC29\uBB38"),count:N.filter(M=>(M.status??"visited")==="visited").length},{key:"scheduled",label:l("calendar.legend.scheduled","\uC608\uC57D"),count:N.filter(M=>M.status==="scheduled").length},{key:"noVisit",label:l("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:N.filter(M=>M.status==="noVisit").length}].filter(M=>M.count>0),G=$.length===1&&$[0].key==="visited"?l("calendar.visitCount",{count:N.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):$.map(M=>l("calendar.statusCount",{label:M.label,count:M.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${k} ${G}`,children:[$.map(M=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${M.key}`,"aria-hidden":"true"},M.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?M=>{C.current=$.id,M.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,y(null)}:void 0,onClick:t?M=>{M.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))})]},w)})]})]})}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:Be("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(nt,{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}=_e.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)),B=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(w=>Math.min(f,w+xr))}return o.useEffect(()=>{const E=A.current;if(E==null)return;A.current=null;const w=document.activeElement;w&&w!==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,w)=>{const D=E;return n.jsx($o,{index:w,type:a,trainingData:D,depth:B,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"}-${w}`)})}),f>xr&&_<f&&n.jsx("div",{className:"training-block__more",children:n.jsx(fe,{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:Be("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}=_e.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 B=o.useRef(null),v=gn("(max-width: 767px)"),[A,x]=o.useState(!1),[E,w]=o.useState(!1),D=`${typeof y=="string"?y:y?.src??""}\0${m}`,[N,k]=o.useState({for:"",url:""}),R=N.for===D?N.url:"",$=zl(),G=e.textOnly??(!e.image&&!!_.label&&!!$&&$.entries.length>0&&!$.byWord.has(_.label)),M=G?"":ua()?.(_.label,_.homonum)??e.image??"",{imgRef:P,loading:L,hasImage:Q,onLoad:Z,onError:F}=es(M);o.useEffect(()=>{let z=!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 se=Sa();if(se&&m)try{const te=await Promise.resolve(se(m));!z&&te&&k({for:D,url:te})}catch{}})(),()=>{z=!0}},[y,m,D]);const K=o.useRef(!0),T=o.useRef(null);o.useEffect(()=>(K.current=!0,()=>{K.current=!1,T.current&&yr(T.current),T.current=null;try{B.current?.pause()}catch{}B.current=null}),[]);const q=o.useCallback(()=>new Promise(z=>{if(typeof window<"u"&&window.speechSynthesis&&m){x(!0),window.speechSynthesis.cancel();const se=new SpeechSynthesisUtterance(m);se.lang="ko-KR",se.onend=()=>{x(!1);try{a?.()}catch{}z()},se.onerror=()=>{x(!1),z()},window.speechSynthesis.speak(se)}else z()}),[m,a]),Y=o.useCallback(z=>{const se=Ka(z,te=>{if(x(!1),te)try{a?.()}catch{}});return B.current=se.el,se.done},[a]),U=o.useCallback(async()=>{if(t||!K.current)return;const z=()=>{T.current===z&&(T.current=null);try{B.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1)},se=Ga(z);T.current=z;try{window.speechSynthesis?.cancel()}catch{}try{if(R&&(x(!0),await Y(R)))return;const te=or();if(te&&m)try{w(!0);const de=await Promise.resolve(te(m));if(!K.current||T.current!==z||(w(!1),de&&(x(!0),await Y(de))))return}catch{}if(!K.current||T.current!==z)return;await q()}finally{T.current===z&&w(!1),se(),T.current===z&&(T.current=null)}},[t,R,m,Y,q]);o.useImperativeHandle(h,()=>({play:()=>U()}),[U]);const S=z=>z.stopPropagation(),I=o.useCallback(z=>{if(z.stopPropagation(),!t){if(A){try{B.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}x(!1);return}U()}},[t,A,U]),O=Be("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:O,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?z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" "||z.key==="Spacebar")&&(z.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:S,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:[L&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:P,className:"training-word-card__image",src:M,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:L?0:1},onLoad:Z,onError:F})]}):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?S:void 0,children:n.jsx(fe,{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:I,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"){xt("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 I4=24,F4={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}=_e.useTranslation(),C=o.useRef(null),f=o.useRef(null),_=o.useRef(null),[b,B]=o.useState(1),[v,A]=o.useState(!1),[x,E]=o.useState(!1),[w,D]=o.useState({for:"",url:""}),[N,k]=o.useState(null),R=t&&t.length>0?t:q1()?.(e,l)??"",$=ua()?.(e,l)??"",{imgRef:G,loading:M,failed:P,onLoad:L,onError:Q}=es($),Z=o.useCallback(()=>k(f.current?.getBoundingClientRect()??null),[]),F=o.useCallback(()=>k(null),[]),K=_o(!!N,ee=>{ee?Z():F()},f),T=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]),q=R||e,Y=w.for===q?w.url:"";o.useEffect(()=>{const ee=Sa(),V=R||e;if(!ee||!V)return;let ne=!1;return Promise.resolve(ee(V)).then(W=>{!ne&&W&&D({for:V,url:W})}),()=>{ne=!0}},[R,e]);const U=o.useRef(null),S=o.useRef(null);o.useEffect(()=>()=>{_.current?.pause(),S.current?.()},[]);const I=o.useRef(null);o.useEffect(()=>()=>{I.current&&(I.current.cancelled=!0)},[]);const O=o.useCallback(ee=>{if(ee.stopPropagation(),v||x){U.current?.();return}if(!Y){const ne=or(),W=R||e;if(!ne||!W)return;const H={cancelled:!1,stop:null};I.current=H;const ie=()=>{H.cancelled=!0,H.stop?.(),E(!1),A(!1),S.current?.()};U.current=ie,S.current=Ga(ie),E(!0),Promise.resolve().then(()=>ne(W)).then(Te=>{if(H.cancelled)return;if(!Te){ie();return}D({for:W,url:Te});const ye=Ka(Te,()=>{A(!1),S.current?.()});_.current=ye.el,H.stop=ye.stop,E(!1),A(!0)}).catch(()=>{ie()});return}A(!0);const V=Ka(Y,()=>{A(!1),S.current?.()});_.current=V.el,U.current=V.stop,S.current=Ga(V.stop)},[v,x,Y,R,e]),z=u&&!!$&&!P,se=z&&i?pc:z?$4:L4,te=z&&i?hc:z?P4:R4;o.useEffect(()=>{const ee=C.current;if(!ee||typeof ResizeObserver>"u")return;const V=new ResizeObserver(([ne])=>{const{width:W,height:H}=ne.contentRect;B(Math.min(W/se,H/te))});return V.observe(ee),()=>V.disconnect()},[se,te]);const de=p*g<I4;return n.jsxs("div",{ref:C,className:Be("word-table-cell",de&&"word-table-cell--tap-too-small",z?"word-table-cell--with-image":""),"data-ref-w":se,"data-ref-h":te,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${b})`},children:[z&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[M&&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:M?0:1},onLoad:L,onError:Q})]}),h&&(s||r)&&n.jsxs("span",{className:"word-table-cell__caption",children:[s&&n.jsx(on,{type:"bar",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&&R&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",R,"]"]}),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(fe,{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:O})}),n.jsx("span",{"data-play-state":"pause",style:{display:v?void 0:"none"},children:n.jsx(fe,{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:O})})]}),m&&n.jsxs("div",{ref:f,className:"word-table-cell__info-button",onPointerEnter:ee=>{ma(ee)||Z()},onPointerLeave:ee=>{ma(ee)||F()},onFocus:()=>{Ca()||Z()},onBlur:F,children:[n.jsx(fe,{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&&T&&n.jsx(Xn,{anchorRect:N,items:T,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:B,indexOffset:v=0,totalCount:A,renderCellAction:x,showFillerAdd:E=!1,addableCount:w,contentRef:D,buttonSize:N=40,brand:k,code:R,pageNumber:$,pageNumberPosition:G="right",fitHeight:M=!1,scoring:P=!1,marks:L,onMarkClick:Q,scoreIndexOffset:Z=0}){const F=o.useCallback((ve,Me)=>{Q?.(Z+ve,Me)},[Q,Z]),K=(ve,Me)=>{const Pe=L?.[wr(Z+ve)]??null;return n.jsx("div",{className:Be("word-table-cell__score",Pe?"word-table-cell__score--marked":""),style:it>1?{transform:`translateX(-50%) scale(${it})`,transformOrigin:"bottom center"}:void 0,children:Br.map(Oe=>n.jsx("span",{className:Be("word-table-cell__score-slot",Pe===Oe?"word-table-cell__score-slot--on":""),children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",shape:"pill",icon:rc[Oe],variant:Pe===Oe?oc[Oe]:"default",selected:Pe===Oe,useBorder:!1,...gt?{}:{tabIndex:-1,role:"img"},showTooltipInfo:T(`wordTable.scoring.markName.${Oe}`,{defaultValue:Oe}),ariaLabel:T(`wordTable.scoring.${Oe}`,{word:Me,defaultValue:`${Me} ${Oe}`}),onClick:gt?dt=>{dt.stopPropagation(),F(ve,Oe)}:void 0})},Oe))})},{t:T}=_e.useTranslation(),q=m!==void 0,Y=e!=null||!!t||!!a,U=gn("(max-width: 767px)"),S=o.useRef(null),[I,O]=o.useState(null),z=p?.length??0,se=A??z,[te,de]=o.useState(null),[ee,V]=o.useState(""),ne=o.useRef(null),W=o.useRef(null),H=o.useRef(null),ie=o.useRef(null),Te=o.useCallback(ve=>{W.current=ve,typeof D=="function"?D(ve):D&&(D.current=ve)},[D]),ye=o.useCallback((ve,Me)=>{ne.current=v+Me,b?.(ve,Me),V(T("wordTable.reorder.moved",{n:v+Me+1,total:se,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[b,T,se,v]);o.useEffect(()=>{const ve=ne.current;ve!=null&&(ne.current=null,(W.current?.closest(".word-table-block__pages")??W.current)?.querySelector(`[data-wordtable-index="${ve}"] .word-table__card-handle button`)?.focus())}),o.useEffect(()=>()=>{ie.current?.()},[]);const he=o.useCallback((ve,Me)=>{if(!b||!ve.altKey||ve.ctrlKey||ve.metaKey)return;const Pe=ve.key==="ArrowRight";if(!Pe&&ve.key!=="ArrowLeft")return;ve.preventDefault();const Oe=Me+(Pe?1:-1),dt=v+Oe;dt<0||dt>=se||ye(Me,Oe)},[b,se,v,ye]),Se=o.useCallback((ve,Me)=>{if(!b||ve.pointerType==="mouse")return;const Pe=ve.target.closest?.("button");if(Pe&&!Pe.closest(".word-table__card-handle"))return;ie.current?.();const Oe={x:ve.clientX,y:ve.clientY};let dt=!1;const Dt=Ie=>{dt&&Ie.cancelable&&Ie.preventDefault()};let yt=null,wt=null;const Ct=()=>{const Ie=wt;if(!Ie)return;const Xe=document.elementFromPoint?.(Ie.x,Ie.y)?.closest?.("[data-wordtable-cell]"),et=Xe?Number(Xe.dataset.wordtableCell):NaN,rt=Number.isInteger(et)?et:null;H.current=rt,O(Lt=>Lt===rt?Lt:rt)},Le=Ie=>{if(!dt){(Math.abs(Ie.clientX-Oe.x)>Cc||Math.abs(Ie.clientY-Oe.y)>Cc)&&be();return}if(wt={x:Ie.clientX,y:Ie.clientY},typeof requestAnimationFrame>"u"){Ct();return}yt===null&&(yt=requestAnimationFrame(()=>{yt=null,Ct()}))},at=()=>{yt!==null&&(cancelAnimationFrame(yt),yt=null,Ct());const Ie=H.current,Xe=dt;be(),Xe&&Ie!=null&&Ie!==Me&&ye(Me,Ie)},oe=setTimeout(()=>{dt=!0,de(Me),H.current=Me,O(Me),window.addEventListener("touchmove",Dt,{passive:!1})},O4);function be(){clearTimeout(oe),window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",at),window.removeEventListener("pointercancel",at),window.removeEventListener("touchmove",Dt),dt=!1,yt!==null&&(cancelAnimationFrame(yt),yt=null),H.current=null,ie.current=null,de(null),O(null)}ie.current=be,window.addEventListener("pointermove",Le),window.addEventListener("pointerup",at),window.addEventListener("pointercancel",at)},[b,ye]),{width:$e,height:Ne}=ea[s],ue=typeof M=="number"?M:M&&typeof M=="object"?U?M.narrow:M.wide:null,{scalerRef:xe,scale:ke,offset:Ee}=mc($e,M?Ne:void 0),We=q?m?.length??0:p?.length??0,He=Math.max(g??We,1),ot=!q&&!!i,Qe=j4(s,He),Je=lc(s,He),vt=ot?Qe.cols:Je.cols,je=ot?Qe.rows:Je.rows,Ye=ot&&s==="landscape"?Qe.cols*2:vt,we=ot&&s==="portrait"?Qe.rows*2:je,Ue=ve=>({word:ve.length===0||ve.includes("word"),image:ve.length===0||ve.includes("image"),pron:ve.length===0||ve.includes("standardPron"),colloq:ve.length===0||ve.includes("colloquialPron"),caption:ve.length===0||ve.includes("caption")}),qe=Ue(l),pt=o.useMemo(()=>{const ve=(p??[]).map(Pe=>Pe.id),Me=ve.every(Pe=>typeof Pe=="string"&&Pe.length>0)&&new Set(ve).size===ve.length;return!Me&&ve.length>0&&xt("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."),Me?ve:null},[p]),_t=Ue(u??l),Et=q?(m??[]).some(ve=>ve!==null&&ve.length>1):(p??[]).some(ve=>(ve.words??[]).length>1),Bt=!!k?.show,st=!!k?.show&&k?.top!==!1,tt=!!k?.show&&k?.bottom!==!1,kt=k?.copyright??"\xA9 IHAB, Inc. All rights reserved.",At=le(Be("word-table__content",T4[c],d&&"word-table__content--outline",h&&Et&&"word-table__content--div-line",!Bt&&$&&G!=="none"&&"word-table__content--page-number",st&&"word-table__content--brand-top",tt&&"word-table__content--brand-bottom")),jt={transform:`scale(${1/ke})`,transformOrigin:"center center"},Mt=N*Br.length+4*(Br.length-1),gt=!!Q,it=gt?Math.max(1,Math.min(1/ke,$e/Ye/Mt)):1,ut=n.jsxs("div",{ref:xe,className:"word-table__scaler",style:{height:Ne*ke},children:[n.jsx("div",{className:Be("word-table",P&&!gt&&"word-table--score-readonly",!Y&&r),style:{width:$e,height:Ne,transform:`scale(${ke})`,transformOrigin:"top left",marginLeft:Ee},children:n.jsxs("div",{ref:Te,className:At,style:{gridTemplateColumns:`repeat(${Ye}, 1fr)`,gridTemplateRows:`repeat(${we}, 1fr)`},children:[q?n.jsx(n.Fragment,{children:(m??[]).map((ve,Me)=>n.jsx("div",{className:le(Be("word-table__edit-cell",ve?"word-table__edit-cell--filled":"word-table__edit-cell--empty",y===Me?"word-table__edit-cell--active":"")),style:ss(Me,Ye,we,c),children:ve?n.jsxs(n.Fragment,{children:[ve.map((Pe,Oe)=>n.jsxs(o.Fragment,{children:[Oe>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:Pe.word,subLabel:Pe.pronunciation,colloquialLabel:Pe.colloquialPronunciation,homonum:Pe.homonum,showWord:qe.word,showImage:qe.image,showPronunciation:qe.pron,showColloquial:qe.colloq,showCaption:qe.caption,buttonSize:N})]},Oe)),P&&K(Me,ve.map(Pe=>Pe.word).join(" / ")),f&&n.jsx("div",{className:le("word-table__card-close"),children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:ve.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:ve.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>f(Me)})})]}):C&&n.jsx("div",{style:jt,children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C(Me)})})},Me))}):n.jsxs(n.Fragment,{children:[ot&&i&&n.jsx("div",{className:le("word-table__card word-table__card--base"),style:{gridColumn:`1 / span ${Qe.cols}`,gridRow:`1 / span ${Qe.rows}`,...ss(0,s==="landscape"?2:1,s==="landscape"?1:2,c)},children:(i.words??[]).map((ve,Me)=>n.jsxs(o.Fragment,{children:[Me>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:ve.label,subLabel:ve.subLabel,colloquialLabel:ve.colloquialLabel,captionLabel:ve.captionLabel,captionBadge:ve.captionBadge,homonum:ve.homonum,showWord:_t.word,showImage:_t.image,showPronunciation:_t.pron,showColloquial:_t.colloq,showCaption:_t.caption,buttonSize:N,wordInfo:ve.grade||ve.syllables!=null||ve.pos||ve.wordType?{grade:ve.grade,syllables:ve.syllables,pos:ve.pos,wordType:ve.wordType}:void 0})]},Me))}),(p??[]).map((ve,Me)=>n.jsxs("div",{"data-wordtable-cell":b?Me:void 0,"data-wordtable-index":b?v+Me:void 0,className:le(`word-table__card${b?" word-table__card--draggable":""}${I===Me?" word-table__card--drag-over":""}${te===Me?" word-table__card--dragging":""}`),style:ss(Me,vt,je,c),draggable:!!b,onPointerDown:b?Pe=>Se(Pe,Me):void 0,onKeyDown:b?Pe=>he(Pe,Me):void 0,onDragStart:b?()=>{S.current=Me}:void 0,onDragOver:b?Pe=>{Pe.preventDefault(),O(Me)}:void 0,onDragLeave:b?()=>O(null):void 0,onDrop:b?Pe=>{Pe.preventDefault(),S.current!==null&&S.current!==Me&&b(S.current,Me),S.current=null,O(null)}:void 0,onDragEnd:b?()=>{S.current=null,O(null)}:void 0,children:[(ve.words??[]).map((Pe,Oe)=>n.jsxs(o.Fragment,{children:[Oe>0&&n.jsx("div",{className:le("word-table__pair-divider")}),n.jsx(ls,{outerScale:ke,label:Pe.label,subLabel:Pe.subLabel,colloquialLabel:Pe.colloquialLabel,captionLabel:Pe.captionLabel,captionBadge:Pe.captionBadge,homonum:Pe.homonum,showWord:qe.word,showImage:qe.image,showPronunciation:qe.pron,showColloquial:qe.colloq,showCaption:qe.caption,buttonSize:N,wordInfo:Pe.grade||Pe.syllables!=null||Pe.pos||Pe.wordType?{grade:Pe.grade,syllables:Pe.syllables,pos:Pe.pos,wordType:Pe.wordType}:void 0})]},Oe)),P&&K(Me,(ve.words??[]).map(Pe=>Pe.label).join(" / ")),(x||_||B||b)&&n.jsxs("div",{className:le("word-table__card-actions"),children:[_&&n.jsx("div",{className:le("word-table__card-close"),children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(ve.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(ve.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>_(ve.id)})}),B&&n.jsx("div",{className:le("word-table__card-copy"),children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"copy",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:T("wordTable.copyItem","\uD55C \uCE78 \uB354"),ariaLabel:T("wordTable.copyItemAria",{n:v+Me+1,defaultValue:"{{n}}\uBC88 \uCE78 \uB0B1\uB9D0\uC744 \uD55C \uCE78 \uB354"}),onClick:()=>B(ve.id,v+Me)})}),x?.(Me,ve),b&&n.jsx("div",{className:le("word-table__card-handle"),children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:T("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:T("wordTable.reorder.handle",{word:(ve.words??[]).map(Pe=>Pe.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})})]})]},pt?pt[Me]:Me)),Array.from({length:Math.max(0,vt*je-(p?.length??0))}).map((ve,Me)=>{const Pe=(p?.length??0)+Me<(w??He);return n.jsx("div",{className:le("word-table__card word-table__card--filler"),children:E&&C&&Pe&&n.jsx("div",{style:jt,children:n.jsx(fe,{htmlType:"button",size:N,type:"dot",icon:"plus",variant:"default",ariaLabel:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),showTooltipInfo:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>C((p?.length??0)+Me)})})},`filler-${Me}`)})]}),st&&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 ve=[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"),R&&n.jsx("span",{className:"word-table__code",children:R},"c")].filter(Boolean);return ve.length===0?null:n.jsx("span",{className:"word-table__ident",children:ve.map((Me,Pe)=>n.jsxs(o.Fragment,{children:[Pe>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),Me]},Pe))})})()]})}),tt&&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:kt})]}),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:T("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})]})}),!Bt&&$&&G!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${G}`,children:T("wordTable.filter.pageIndicator",{current:$.current,total:$.total})})]})}),b&&n.jsx("span",{role:"status",style:F4,children:ee})]}),ct=ue==null?ut:n.jsx("div",{className:"word-table__frame",style:{height:ue},children:ut});return Y?n.jsx(va,{type:"page",icon:t,title:e,disc:a,className:Be(le("word-table__section"),r),children:ct}):ct}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!==wn);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 In({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}=_e.useTranslation(),[_,b]=o.useState(l),B=i??_,v=()=>{const k=!B;b(k),u?.(k)},A=k=>{if(!s)return;const R=k.target;!R||typeof R.closest!="function"||R.closest(".filter-panel__collapse-toggle")||R.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||v()},x=o.useMemo(()=>r!==void 0||!B?"":z4(d,h,f("common.all","\uC804\uCCB4")),[r,B,d,h,f]),E=r??(x?n.jsx("span",{className:"filter-panel__header-summary body-3",children:x}):null),w=e||a||r||s,D=o.useId(),N=t?`h${t}`:"span";return n.jsxs("div",{className:Be("filter-panel",s?"filter-panel--collapsible":"",B?"filter-panel--collapsed":"",y),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?D:void 0,children:[w&&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:[B?E:a,s&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:B?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:B?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),showTooltipInfo:B?f("common.expand","\uD3BC\uCE58\uAE30"):f("common.collapse","\uC811\uAE30"),"aria-expanded":!B,onClick:v})]})]}),!B&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Be("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(k=>{const R=h[k.label],$=R===void 0||(Array.isArray(R)?R.length===0:!1),G=(k.items??[]).filter(P=>P!=null);k.allOption&&G.some(P=>(typeof P=="string"?P:P.value)===wn)&&xt(`filter-panel-all-value:${k.label}`,`[FilterPanel] '${k.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${wn}' \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 M=P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"&&!!P.disabled,Z=typeof P!="string"?P.labels:void 0,F=typeof P!="string"?P.displayLabel:void 0,K=typeof P!="string"?P.tooltip:void 0,T=typeof P!="string"?P.descriptionTooltip:void 0,q=typeof P!="string"?P.shape:void 0,Y=Array.isArray(R)?R.includes(L):R===L;return n.jsx(fe,{htmlType:"button",size:"keyboard",label:Z??F??L,type:k.itemType??(Z?"bar":L.length===1?"dot":void 0),selected:Y,disabled:Q,shape:q,showTooltipInfo:!!K,tooltipInfoText:K,tooltipDescription:T,onClick:()=>p?.(L,k.label)},L)};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:Be("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:P=>p?.(P,k.label),error:k.error}):!k.multiple&&k.display==="segmented"?n.jsx(yn,{ariaLabel:k.displayLabel??k.label,options:[...k.allOption?[{key:wn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"?P.displayLabel:void 0,Z=typeof P!="string"?P.disabled:void 0;return{key:L,label:Q??L,disabled:Z}})],value:$&&k.allOption?wn:h[k.label]??"",onChange:P=>p?.(P,k.label),size:32}):!k.multiple&&k.display==="dropdown"?n.jsx(vn,{className:"filter-panel__dropdown",ariaLabel:typeof k.label=="string"?k.label:void 0,size:40,options:[...k.allOption?[{value:wn,label:k.allLabel??f("common.all","\uC804\uCCB4"),disabled:k.allOptionDisabled}]:[],...G.map(P=>{const L=typeof P=="string"?P:P.value,Q=typeof P!="string"?P.displayLabel:void 0,Z=typeof P!="string"?P.disabled:void 0;return{value:L,label:Q??L,disabled:Z}})],value:$&&k.allOption?wn:h[k.label],onChange:P=>p?.(P,k.label)}):n.jsxs("div",{className:k.groups?"filter-panel__item-groups":"filter-panel__items",children:[k.allOption&&!k.groups&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(wn,k.label)}),k.groups?k.groups.map((P,L)=>n.jsxs("div",{className:"filter-panel__item-group",children:[L===0&&k.allOption&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:k.allLabel??f("common.all","\uC804\uCCB4"),selected:$,disabled:k.allOptionDisabled,onClick:()=>p?.(wn,k.label)}),P.filter(Q=>Q!=null).map(M)]},L)):G.map(M)]})]})]},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],Cn="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:Cn,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:Cn,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:Cn,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:Cn,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:Cn,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?Cn:Sn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?Cn:Sn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?Cn:Sn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?Cn:Sn}:{}}}function Dc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===wn?(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===Cn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===Cn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===Cn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===Cn),!0):!1}function G4(e){return"sections"in e}function is(e){const{t}=_e.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(In,{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:B=!1,showDivLine2:v=!1,middleSections:A=[],extraSelected:x={},onExtraSelect:E,showPaperBands:w=!1,showTopInfo:D=!0,showBottomInfo:N=!0}=e,k=[gc(t,{hasImage:h,hasColloquial:p,hasCaption:m??!1}),yc(t),...A,vc(t),...B?[wc(t)]:[],...v?[Bc(t)]:[],...w?[_c(t),xc(t)]:[]],R={...Ec(t,{contentTypes:g,orientation:y,showOutline:C,cutLine:f,showDivLine:_,showTopInfo:D,showBottomInfo:N}),...x},$=(G,M)=>{Dc(t,G,M,b)||E?.(G,M)};return n.jsx(In,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:k,selected:R,onSelect:$,...d,sectionAlign:"horizontal"})}function us(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function K4(e){return us(e).replace(/"/g,""").replace(/'/g,"'")}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(`
|
|
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
833
|
<html${c?` lang="${K4(c)}"`:""} data-theme="${u}">
|
|
@@ -1034,10 +1034,10 @@ ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(
|
|
|
1034
1034
|
`:""}
|
|
1035
1035
|
<\/script>
|
|
1036
1036
|
</body>
|
|
1037
|
-
</html>`}const Z4=1e3;function ps({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:s,header:l=""}){const{t:i}=_e.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}=_e.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),[B,v]=o.useState(8),[N,x]=o.useState("right"),E=e.length,w=e.some(K=>(K.words??[]).length>1),D=e.some(K=>(K.words??[]).some(T=>!!T.colloquialLabel)),A=bc(e),k=Math.max(1,Math.min(Math.max(E,1),s??Math.max(E,1))),R=Math.min(B,k),$=o.useMemo(()=>D4(e,R),[e,R]),G=$.length>1,M=R,[P,L]=o.useState(!1);o.useEffect(()=>{let K=!1;if(!ua()){L(!1);return}return Promise.all(e.flatMap(T=>(T.words??[]).map(q=>Tl(q.label,q.homonum)))).then(T=>{K||L(T.some(Boolean))},()=>{}),()=>{K=!0}},[e]);const Q=o.useMemo(()=>[gc(a,{hasImage:P,hasColloquial:D,hasCaption:A}),yc(a),...E>0?[kc(a,{hasPairs:w,itemCount:E,max:s})]:[],vc(a),...M>1?[wc(a)]:[],...w?[Bc(a)]:[],...r?[_c(a),xc(a)]:[]],[a,P,D,A,E,w,G,M,r,s]),Z={...Ec(a,{contentTypes:u,orientation:l,showOutline:p,cutLine:d,showDivLine:_,showTopInfo:g,showBottomInfo:C}),...E>0?{[a(w?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${R}\uAC1C`}:{},...G?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:N}:{}},F=o.useCallback((K,T)=>{Dc(a,K,T,{setContentTypes:c,setOrientation:i,setShowOutline:m,setCutLine:h,setShowDivLine:b,setShowTopInfo:y,setShowBottomInfo:f})||(T===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||T===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?v(Ac(parseInt(K),E)):T===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:M,showTopInfo:g,showBottomInfo:C},filterSections:Q,filterSelected:Z,handleSelect:F,pages:$,isPaginated:G,pageNumberPosition:N}}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:B,printHeader:v,brand:N,code:x,beforeClose:E}){const{t:w}=_e.useTranslation(),D=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(H=>typeof H=="string"&&H.length>0).map((H,ie)=>({id:`${H}-${ie}`,words:[{label:H}]})),[e,t]),{settings:A,filterSections:k,filterSelected:R,handleSelect:$,pages:G,isPaginated:M,pageNumberPosition:P}=Sc(D,{paperBands:!!N?.show,maxItemsPerPage:s}),L=o.useMemo(()=>sc(G.map(H=>H.length)),[G]),[Q,Z]=o.useState({}),F=o.useCallback((H,ie)=>{Z(Te=>({...Te,[wr(H)]:ac(Te[wr(H)]??null,ie)}))},[]),K=o.useRef(B);o.useEffect(()=>{K.current=B});const T=o.useRef(Q);o.useEffect(()=>{T.current!==Q&&(T.current=Q,K.current?.(ns(Q)))},[Q]);const q=o.useMemo(()=>ns(Q),[Q]),Y=o.useRef(null),{toastMessage:U,toastKey:S,showWarning:I,clearToast:O}=Ui("warning"),z=o.useRef([]),se=o.useCallback(()=>M?z.current.filter(H=>H!==null):Y.current?[Y.current]:[],[M]),{print:te,openNewWindow:de}=ps({getElements:se,paperW:ea[A.orientation].width,paperH:ea[A.orientation].height,fileName:g??"",header:v??"",onPopupBlocked:()=>I(w("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:w("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>de()},{label:w("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>te()},...c??[]]:c,[h,d,g,c,w,te,de]),V=o.useMemo(()=>h?h({print:te,openNewWindow:de}):void 0,[h,te,de]),ne=o.useRef(!1),W=o.useRef(te);return o.useEffect(()=>{W.current=te},[te]),o.useEffect(()=>{if(!C||ne.current)return;const H=window.setTimeout(()=>{ne.current=!0,W.current()},100);return()=>window.clearTimeout(H)},[C]),n.jsxs(Rn,{title:l??w("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:i,size:"large",className:Be("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:R,onSelect:$}),M?n.jsx("div",{className:"word-table-popup__pages",children:G.map((H,ie)=>n.jsx(_a,{items:H,orientation:A.orientation,contentTypes:A.contentTypes,baseItem:a,baseContentTypes:r,cutLine:A.cutLine,showOutline:A.showOutline,showDivLine:A.showDivLine,count:A.count,contentRef:Te=>{z.current[ie]=Te},pageNumber:{current:ie+1,total:G.length},pageNumberPosition:P,brand:N&&{...N,top:A.showTopInfo,bottom:A.showBottomInfo},code:x,scoring:b,scoreIndexOffset:L[ie],marks:q,onMarkClick:F},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(_a,{items:D,orientation:A.orientation,contentTypes:A.contentTypes,baseItem:a,baseContentTypes:r,cutLine:A.cutLine,showOutline:A.showOutline,showDivLine:A.showDivLine,count:A.count,contentRef:Y,fitHeight:!0,scoring:b,marks:q,onMarkClick:F,brand:N&&{...N,top:A.showTopInfo,bottom:A.showBottomInfo},code:x})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:u??w("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ya,{message:U,position:"top",onClose:O},S)]})}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||mn(s.label,l.label)||mn(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||mn(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||mn(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(nt,{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(fe,{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}=_e.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
|
|
1037
|
+
</html>`}const Z4=1e3;function ps({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:s,header:l=""}){const{t:i}=_e.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}=_e.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),[B,v]=o.useState(8),[A,x]=o.useState("right"),E=e.length,w=e.some(K=>(K.words??[]).length>1),D=e.some(K=>(K.words??[]).some(T=>!!T.colloquialLabel)),N=bc(e),k=Math.max(1,Math.min(Math.max(E,1),s??Math.max(E,1))),R=Math.min(B,k),$=o.useMemo(()=>D4(e,R),[e,R]),G=$.length>1,M=R,[P,L]=o.useState(!1);o.useEffect(()=>{let K=!1;if(!ua()){L(!1);return}return Promise.all(e.flatMap(T=>(T.words??[]).map(q=>Tl(q.label,q.homonum)))).then(T=>{K||L(T.some(Boolean))},()=>{}),()=>{K=!0}},[e]);const Q=o.useMemo(()=>[gc(a,{hasImage:P,hasColloquial:D,hasCaption:N}),yc(a),...E>0?[kc(a,{hasPairs:w,itemCount:E,max:s})]:[],vc(a),...M>1?[wc(a)]:[],...w?[Bc(a)]:[],...r?[_c(a),xc(a)]:[]],[a,P,D,N,E,w,G,M,r,s]),Z={...Ec(a,{contentTypes:u,orientation:l,showOutline:p,cutLine:d,showDivLine:_,showTopInfo:g,showBottomInfo:C}),...E>0?{[a(w?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${R}\uAC1C`}:{},...G?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:A}:{}},F=o.useCallback((K,T)=>{Dc(a,K,T,{setContentTypes:c,setOrientation:i,setShowOutline:m,setCutLine:h,setShowDivLine:b,setShowTopInfo:y,setShowBottomInfo:f})||(T===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||T===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?v(Ac(parseInt(K),E)):T===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:M,showTopInfo:g,showBottomInfo:C},filterSections:Q,filterSelected:Z,handleSelect:F,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:B,printHeader:v,brand:A,code:x,beforeClose:E}){const{t:w}=_e.useTranslation(),D=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(H=>typeof H=="string"&&H.length>0).map((H,ie)=>({id:`${H}-${ie}`,words:[{label:H}]})),[e,t]),{settings:N,filterSections:k,filterSelected:R,handleSelect:$,pages:G,isPaginated:M,pageNumberPosition:P}=Sc(D,{paperBands:!!A?.show,maxItemsPerPage:s}),L=o.useMemo(()=>sc(G.map(H=>H.length)),[G]),[Q,Z]=o.useState({}),F=o.useCallback((H,ie)=>{Z(Te=>({...Te,[wr(H)]:ac(Te[wr(H)]??null,ie)}))},[]),K=o.useRef(B);o.useEffect(()=>{K.current=B});const T=o.useRef(Q);o.useEffect(()=>{T.current!==Q&&(T.current=Q,K.current?.(ns(Q)))},[Q]);const q=o.useMemo(()=>ns(Q),[Q]),Y=o.useRef(null),{toastMessage:U,toastKey:S,showWarning:I,clearToast:O}=Ui("warning"),z=o.useRef([]),se=o.useCallback(()=>M?z.current.filter(H=>H!==null):Y.current?[Y.current]:[],[M]),{print:te,openNewWindow:de}=ps({getElements:se,paperW:ea[N.orientation].width,paperH:ea[N.orientation].height,fileName:g??"",header:v??"",onPopupBlocked:()=>I(w("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:w("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>de()},{label:w("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>te()},...c??[]]:c,[h,d,g,c,w,te,de]),V=o.useMemo(()=>h?h({print:te,openNewWindow:de}):void 0,[h,te,de]),ne=o.useRef(!1),W=o.useRef(te);return o.useEffect(()=>{W.current=te},[te]),o.useEffect(()=>{if(!C||ne.current)return;const H=window.setTimeout(()=>{ne.current=!0,W.current()},100);return()=>window.clearTimeout(H)},[C]),n.jsxs(Rn,{title:l??w("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:i,size:"large",className:Be("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:R,onSelect:$}),M?n.jsx("div",{className:"word-table-popup__pages",children:G.map((H,ie)=>n.jsx(_a,{items:H,orientation:N.orientation,contentTypes:N.contentTypes,baseItem:a,baseContentTypes:r,cutLine:N.cutLine,showOutline:N.showOutline,showDivLine:N.showDivLine,count:N.count,contentRef:Te=>{z.current[ie]=Te},pageNumber:{current:ie+1,total:G.length},pageNumberPosition:P,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x,scoring:b,scoreIndexOffset:L[ie],marks:q,onMarkClick:F},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:q,onMarkClick:F,brand:A&&{...A,top:N.showTopInfo,bottom:N.showBottomInfo},code:x})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:u??w("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ya,{message:U,position:"top",onClose:O},S)]})}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||mn(s.label,l.label)||mn(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||mn(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||mn(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(nt,{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(fe,{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}=_e.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
1038
|
\uC2E0\uB8B0\uB97C \uC313\uACE0
|
|
1039
1039
|
\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}=_e.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,B=v=>{v.matches&&m(!1)};return b&&(b.matches&&m(!1),b.addEventListener?.("change",B)),()=>{_(),b?.removeEventListener?.("change",B)}},[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(B=>{const v=setTimeout(()=>{r.current===v&&(r.current=null),B(!!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((N,x=250)=>{const E=l.current;if(!E)return;const w=d.current;if(w){d.current=null;try{E.pause()}catch{}E.src=w,E.load()}if(!E.src)return;m.current+=1,C();try{ao(),sr(E).then(R=>{if(l.current===E)try{s.current?.("noise",R)}catch{}})}catch{}const D=E.paused?0:lr(E);E.paused&&Hn(E,0),E.play().catch(()=>{});const A=performance.now(),k=()=>{const R=Math.min(1,(performance.now()-A)/x);try{Hn(E,D+(N-D)*R)}catch{}R<1?p.current=requestAnimationFrame(k):p.current=null};p.current=requestAnimationFrame(k)},[C]),_=o.useCallback((N=250,x)=>{const E=l.current;if(!E||E.paused){x?.();return}const w=++m.current;C();const D=performance.now(),A=lr(E),k=()=>{const R=Math.min(1,(performance.now()-D)/N);try{Hn(E,A*(1-R))}catch{}if(R<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===w){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{E.paused||(Hn(E,0),E.pause(),x?.())}catch{}}},N+150)},[C]);o.useEffect(()=>{const N=document.createElement("audio");return N.loop=!0,N.crossOrigin="anonymous",l.current=N,()=>{C();try{N.pause(),N.removeAttribute("src"),N.load()}catch{}l.current=null,c.current=null,d.current=null}},[C]);const b=e?fs(e.settings):0,B=!!e?.settings.enabled&&b>0;o.useEffect(()=>{if(!B)return;let N=0;const x=setInterval(()=>{const E=l.current;if(!E||E.paused){N=0;return}const w=t.current;if(w&&!w.paused&&!w.ended||y()||a.current==="playing"){N=0;return}N+=1,N>=2&&(N=0,_())},400);return()=>clearInterval(x)},[_,B,t,a,y]),o.useEffect(()=>{const N=()=>{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,w=!!E&&!E.paused&&!E.ended||y()||a.current==="playing",D=h.current;w&&D?.enabled&&D.volume>0&&f(D.volume)};return document.addEventListener("visibilitychange",N),()=>document.removeEventListener("visibilitychange",N)},[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 N=e?.settings,x=l.current;if(!x)return;const E=N?fs(N):0;if(!N||!N.enabled||E===0){_();return}if(c.current!==N.type){const w=R_(N.type);w&&(c.current=N.type,u(w),d.current=w,_(150,()=>{if(d.current!==w)return;d.current=null,x.src=w,x.load();const D=t.current;if(D&&!D.paused||y()){v.current?.();const A=()=>{x.removeEventListener("canplay",A),v.current===k&&(v.current=null);const R=t.current,$=h.current;(R&&!R.paused&&!R.ended||y())&&$?.enabled&&$.volume>0&&f($.volume)},k=()=>x.removeEventListener("canplay",A);v.current=k,x.addEventListener("canplay",A)}}))}else{const w=t.current,D=!!w&&!w.paused&&!w.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 A=lr(x),k=performance.now(),R=()=>{const $=Math.min(1,(performance.now()-k)/150);try{Hn(x,A+(E-A)*$)}catch{}$<1?p.current=requestAnimationFrame(R):p.current=null};p.current=requestAnimationFrame(R)}}},[e?.settings,e?.settings.enabled,b,e?.settings.type,C,f,_,t,a,h,y]),o.useEffect(()=>{const N=l.current;if(N)try{N.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=(N,x=1)=>{try{const E=(N||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(N||"").length);return Math.max(700,Math.round(E*300/Math.max(.25,x)))}catch{return 1200}},B=o.useCallback(N=>{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 w=N??e,D=Array.isArray(w)?w.filter(M=>!!M):[w||""];D.length===0&&D.push("");const A=Math.max(.3,Math.min(3,t));y.current=D.reduce((M,P)=>M+b(P,A||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 R=()=>{try{const M=g.current||performance.now(),P=performance.now()-M,L=y.current||1200,Q=Math.min(1,P/L);try{r.current&&(r.current.style.left=`${Q*100}%`),s.current&&s.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(R))}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=M=>{const P=new SpeechSynthesisUtterance(D[M]);try{P.rate=A}catch{}try{P.volume=Math.max(0,Math.min(1,a))}catch{}P.onend=()=>{if(E===f.current){if(M<D.length-1){try{G(M+1)}catch{$()}return}$()}},P.onerror=()=>{$()},P.onstart=()=>{if(!(M>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(R)}catch{}},_.current=!0,x.speak(P)};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:B,stopTTS:v}}const F_=.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])<=F_;)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 B=Math.abs(u[b]);B>_&&(_=B)}return _})}catch{return null}finally{try{s?.close?.()}catch{}}}async function Ic(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),Fc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Oc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Fc(t),s=Fc(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),[B,v]=o.useState(!1),[N,x]=o.useState(null),[E,w]=o.useState(2),[D,A]=o.useState(0),[k,R]=o.useState(null),[$,G]=o.useState(!1),[M,P]=o.useState(!1),L=3,Q=3,Z=1,F=300,K=o.useRef(0),T=o.useCallback(()=>{const ye=C.current,he=f&&f.current?f.current:ye?ye.closest(".audio-player__wave"):null,Se=he?he.getBoundingClientRect():ye?ye.getBoundingClientRect():null,$e=Se?Se.width:0,Ne=Se?Math.max(100,Se.width):320,ue=Se?Se.height:0,xe=Math.max(Z,Math.min(F,Math.floor((Ne+Q)/(L+Q)))),ke=xe*L,Ee=Math.max(0,xe-1),We=Math.max(0,Ee>0?(Ne-ke)/Ee:Q);return{bars:xe,gap:We,height:ue,width:$e}},[]),q=o.useRef(void 0),Y=o.useRef(null),U=o.useCallback(async(ye,he,{quiet:Se=!1}={})=>{const $e=++K.current,Ne=()=>K.current===$e;try{if(Se||v(!1),q.current=ye,!ye){Ne()&&b(null);return}let ue=he;if(!ue)try{for(let Ee=0;Ee<4&&!(C.current||f.current);Ee++)await new Promise(We=>requestAnimationFrame(We));await new Promise(Ee=>requestAnimationFrame(Ee));const ke=T();ke.height>0&&A(ke.height),ue=ke.bars,w(ke.gap)}catch{ue=120}Y.current=ue;const xe=await Ic(ye,ue);if(!Ne())return;if(!xe){b(null),v(!1);return}b(xe),x(ue),v(!0)}catch{if(!Ne())return;b(null),v(!1)}},[v,b,A,w,x,T]);o.useEffect(()=>{const ye=f.current;if(!ye||typeof ResizeObserver>"u")return;let he=null;const Se=new ResizeObserver(()=>{he!==null&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;try{const $e=T();if($e.width<=0||($e.height>0&&A($e.height),Y.current===null||$e.bars===Y.current))return;const Ne=q.current;w($e.gap),Ne?U(Ne,$e.bars,{quiet:!0}).catch(()=>{}):Y.current=$e.bars}catch{}})});return Se.observe(ye),()=>{Se.disconnect(),he!==null&&cancelAnimationFrame(he)}},[T,U]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;U(typeof ye=="string"?ye:void 0).catch(()=>{}),P(!1)},[t,a,U]),o.useEffect(()=>{let ye=!1;if(G(!1),R(null),!l||!N)return;const he=c>0?c*(u||1):void 0;return Ic(l,N,he,!0).then(Se=>{ye||(R(Se),Se||G(!0))}).catch(()=>{ye||(R(null),G(!0))}),()=>{ye=!0}},[l,N,c,u]);const S=Math.max(0,Math.min(1,d)),I=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),O=N||40,z=o.useMemo(()=>Y_({bars:O,trackDurationSec:y,leadInMs:m,tailMs:g}),[O,y,m,g]),se=o.useMemo(()=>Array.from({length:O}).map((ye,he)=>{const Se=he>=z.lead&&he<z.lead+z.sound,$e=z.sound>0&&Se?Math.min(O-1,Math.round((he-z.lead)/z.sound*O)):-1,Ne=Se?_&&_[$e]!=null?_[$e]:null:_?0:null,ue=Ne==null?null:Math.min(1,Ne/I*S),xe=ue!=null&&D>0&&Er(ue)<=Hc,ke=ue==null?.15:xe?0:Dr(ue),Ee=xe,We=O>1?he/(O-1):0;return n.jsx("div",{className:Ee?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":ke,"--i":he,"--mix":We}},he)}),[O,_,I,S,D,z]),te={"--progress":String(Math.max(0,Math.min(1,r)))},de=o.useMemo(()=>k&&k.length&&Math.max(...k.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[k]),ee=S*Math.max(0,i),V=!l||!k||!k.length?1:Math.max(1,ee),ne={"--bar-gap":`${E}px`,"--wave-h":`${Er(V)}px`,"--wave-h1":`${ys}px`},W=B&&(l?!!k||$:!0);o.useEffect(()=>{W&&P(!0)},[W]);const H=M?B:W;o.useEffect(()=>{h?.(H)},[H,h]);const ie=N||40,Te=o.useMemo(()=>Array.from({length:ie}).map((ye,he)=>{const Se=k&&k[he]!=null?k[he]:null,$e=Se==null?0:Math.abs(Se)/de*ee,Ne=Math.max(nx,Dr($e)),ue=ie>1?he/(ie-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":Ne,"--i":he,"--mix":ue}},he)}),[ie,k,de,ee,D]);return n.jsxs("div",{className:"audio-player__wave",ref:f,style:ne,children:[l&&n.jsx("div",{className:`audio-player__wave-noise ${W?"is-ready":""}`,"aria-hidden":"true",children:Te}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${H?"is-ready":""}`,ref:C,children:se}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${H?"is-ready":""}`,ref:s,style:te,children:se})]})]})}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 B=null;try{B=typeof document<"u"?document.visibilityState:null}catch{}wt(`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).`,B==="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,B=b?0:ix(f),v=t.current,N=(i||0)>0||(u||0)>0,x=N&&(l?.positionRef.current?.phase??"sound")!=="sound";if(B===null&&!x)try{v&&v.style.visibility!=="hidden"&&(v.style.visibility="hidden")}catch{}else{const E=b?_.duration:B||0;On&&x&&!(E>0)&&wt("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 w=N?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:B??0});try{v&&(v.style.visibility&&(v.style.visibility=""),v.style.left=`${w*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(w))}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}=_e.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(),B=o.useRef(null),v=o.useRef(!1),N=o.useRef(null),{ref:x,rect:E,show:w,hide:D}=lx();o.useEffect(()=>()=>{y.current?.("main",null),y.current?.("noise",null)},[]);const[A,k]=o.useState(!1),[R,$]=o.useState("idle"),[G,M]=o.useState("stopped"),P=o.useRef("stopped");o.useEffect(()=>{P.current=G},[G]);const[L,Q]=o.useState(0),[Z,F]=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[T,q]=o.useState(null),[Y,U]=o.useState(null),[S,I]=o.useState(0),[O,z]=o.useState(!1),[se,te]=o.useState(0),de=g?.playbackRate??1,ee=g?.mainVolume??1,V=g?Cs(g.settings):0,ne=g?Rc(g.settings):ee,[W,H]=o.useState("idle"),[ie,Te]=o.useState(""),[ye]=o.useState("top"),he=o.useRef(null),Se=o.useRef(0),$e=o.useRef(null),Ne=o.useRef(!0),ue=S_({mountedRef:Ne}),xe=o.useRef(null),ke=o.useRef(d),Ee=o.useRef(h);o.useEffect(()=>{ke.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Ee.current=Math.max(0,h||0)},[h]);const{start:We,stop:He,settleTo:ot}=dx({audioRef:C,fillRef:f,waveProgressRef:$e,sourcesRef:he,currentIndexRef:Se,sequencer:ue,leadInMs:d,tailMs:h}),{onReadyChange:Qe,waitForReady:Je,markNotReady:vt}=ox({showSoundWaveForm:u,showNoiseWaveForm:c}),je=o.useRef(null),Ye=o.useRef(s),we=o.useRef(r),Ue=o.useRef(null),qe=o.useRef(!1),[pt,_t]=o.useState(!1),Et=o.useCallback(X=>{qe.current=X,_t(X)},[]),Bt=o.useRef(null),{activeNoiseUrl:st,noiseSettingsRef:tt,fadeInNoise:kt,fadeOutNoise:At}=P_({noisePlayer:g,audioRef:C,playbackStateRef:P,sequencer:ue}),{startTTS:jt,stopTTS:Mt}=I_({ttsText:l,playbackRate:de,mainVolume:ne,fillRef:f,waveProgressRef:$e,setProgress:Q,setPlaybackState:M,setStateLocal:F,fadeInNoise:kt,fadeOutNoise:At,noiseSettingsRef:tt,onDoneRef:we,handleEndRef:Bt});o.useEffect(()=>{Pe.current=Mt});const gt=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Te(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}jt(X);return}yt("tts"),jt(X)},it=Array.isArray(t)?t.filter(Boolean):t?[t]:[],ut=(!it||it.length===0)&&!!l,ct=Array.isArray(T)&&T.length>0?T:Array.isArray(Y)&&Y.length>0?Y:null,ve=Math.max(Array.isArray(ct)?ct.length:0,it.length);o.useEffect(()=>(Ne.current=!0,()=>{Ne.current=!1}),[]);const Me=()=>{ue.abort()},Pe=o.useRef(null),Oe=o.useRef(null),dt=o.useRef(null),Dt=o.useRef(null);Dt.current||(Dt.current=()=>{dt.current=null;const X=C.current;if(Oe.current==="audio"&&X&&(!X.paused||ue.isRunning())){Me();try{X.pause()}catch{}Ne.current&&(M("paused"),He(),At())}else if(Oe.current==="tts")try{Pe.current?.()}catch{}});const yt=X=>{Oe.current=X,dt.current=Ga(Dt.current)},xt=()=>{dt.current?.(),dt.current=null};o.useEffect(()=>()=>{Dt.current&&yr(Dt.current)},[]);const Ct=o.useRef(de);o.useEffect(()=>{Ct.current=de||1},[de]);const Le=o.useCallback(X=>{const ce=Ct.current||1;try{X.defaultPlaybackRate=ce}catch{}try{X.playbackRate=ce}catch{}},[]),at=o.useCallback((X,ce)=>{if(!tx(X,ce)){try{X.currentTime=0}catch{}Le(X);return}X.src=ce,Le(X),X.load(),Le(X)},[Le]),oe=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),H("idle")},[]),be=o.useCallback(async(X,ce=3,Ae=50,Ve=0)=>{oe();const Ke=ue.generation(),Ze=!!X&&X.currentTime>0&&!X.ended,ft=Math.max(0,ke.current-Math.max(0,Ve));if(ft>0&&!Ze){yt("audio"),We(),M("playing");const bt=tt.current;if(bt?.enabled&&(bt.volume??0)>0)try{kt(bt.volume)}catch{}if(!await ue.waitPad(ft,"lead",Ve)||!Ne.current||!ue.isCurrent(Ke))return!1}ue.enterSound();for(let bt=0;bt<ce;bt++){if(!Ne.current||!ue.isCurrent(Ke))return!1;try{return yt("audio"),await X.play(),!0}catch(ge){if((ge instanceof Error||typeof ge=="object"&&ge&&"name"in ge?ge.name:void 0)==="AbortError"){if(!ue.isCurrent(Ke))return!1;await new Promise(j=>setTimeout(j,Ae));continue}try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,We,ue,kt,tt,oe]),Ie=o.useCallback(X=>{const ce=ue.generation(),Ae=Math.max(0,Ee.current-Math.max(0,X));We();const Ve=tt.current;if(Ve?.enabled&&(Ve.volume??0)>0)try{kt(Ve.volume)}catch{}const Ke=()=>{try{xe.current?.()}catch{}};if(Ae<=0){ue.leave(),Ke();return}ue.waitPad(Ae,"tail",X).then(Ze=>{ue.leave(),Ze&&ue.isCurrent(ce)&&Ke()}).catch(()=>{})},[ue,We,kt,tt]),Xe=o.useCallback(()=>{const X=C.current;if(!X)return;const ce=()=>{M("playing"),F("playMode"),z(!0),We();try{ao(),sr(X).then(Ze=>{if(Ne.current)try{y.current?.("main",Ze)}catch{}})}catch{}const Ke=tt.current;Ke?.enabled&&(Ke?.volume??0)>0&&kt(Ke.volume)},Ae=()=>{X_({ended:!!X?.ended,completedByEnd:qe.current})||(M("paused"),He(),At())},Ve=()=>{const Ke=()=>{try{const Ze=he.current,ft=Z_(Ze,Se.current);if(ft!==null){Se.current=ft,I(ft),z(!0);const bt=Ze?.[ft]&&Ze[ft].src;if(bt&&X){at(X,bt),be(X).catch(()=>{});return}}}catch{}M("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}He(),z(!1),At();try{!Ye.current&&Bt.current&&Bt.current()}catch{}};if(xe.current=Ke,Ee.current>0){We(),ue.waitPad(Ee.current,"tail").then(Ze=>{ue.leave(),Ze&&Ke()}).catch(()=>{});return}Ke()};return X.addEventListener("play",ce),X.addEventListener("pause",Ae),X.addEventListener("ended",Ve),()=>{try{X.removeEventListener("play",ce),X.removeEventListener("pause",Ae),X.removeEventListener("ended",Ve),He()}catch{}}},[kt,At,be,tt,We,He,ue]);o.useEffect(()=>Xe(),[Xe]),o.useEffect(()=>{Ye.current=s},[s]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(s||Z!=="active")return;const X=N.current;if(!X)return;let ce=null;const Ae=requestAnimationFrame(()=>{try{const Ve=X.getTotalLength();if(!Ve)return;const Ke=Ve*.2;X.style.strokeDasharray=`${Ve-Ke} ${Ke}`;const Ze="triFlow_"+Math.random().toString(36).slice(2);ce=document.createElement("style"),ce.textContent=`@keyframes ${Ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${Ve}}}`,document.head.appendChild(ce),X.style.animation=`${Ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(Ae),ce?.remove()}},[Z,s]),o.useEffect(()=>{he.current=T},[T]),o.useEffect(()=>{Se.current=S},[S]),o.useEffect(()=>{const X=_.current,ce=B.current;if(!X||!ce)return;let Ae=null;const Ve=32,Ke=60,Ze=()=>{try{const bt=Array.from(X.querySelectorAll(":scope > .button"));let ge=0;bt.forEach(Ce=>{if(Ce===ce)return;const Fe=Ce.getBoundingClientRect();ge+=Fe.width});const j=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(j-ge-8)),me=ve;if(!me||J<=0){Array.from(ce.children).forEach(Ce=>{try{Ce.style.width=""}catch{}});return}let ae=Math.floor(J/me);ae>Ke&&(ae=Ke),ae<Ve&&(ae=Math.max(Ve,Math.floor(J/me))),Array.from(ce.querySelectorAll(".button")).forEach(Ce=>{try{Ce.style.width=`${ae}px`}catch{}})}catch{}},ft=requestAnimationFrame(Ze);try{Ae=new ResizeObserver(()=>{requestAnimationFrame(Ze)}),Ae.observe(X),Ae.observe(ce),window.addEventListener("resize",Ze)}catch{}return()=>{try{cancelAnimationFrame(ft)}catch{}try{Ae&&(Ae.disconnect(),Ae=null)}catch{}try{window.removeEventListener("resize",Ze)}catch{}}},[T,Y,ve]),o.useEffect(()=>()=>{try{je.current&&(clearTimeout(je.current),je.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const et=(X,ce)=>{q(X),te(ce),vt(),U(J_(X)),he.current=X},rt=()=>{F("playMode"),I(0),z(!0)},Lt=async(X,ce)=>{Et(!1),v.current=!1,at(X,ce),await qc(X),await Je()!==!1&&(k(!1),rt(),await be(X))},Bn=async(X,ce=!1)=>{const Ae=C.current;k(!0),$("measuring_duration");try{const Ve=await vs(X,{timeoutMs:1e4,rejectOnError:!0});et([{src:X,objectUrl:null,duration:Ve}],Ve),$("ready"),ce&&Ae&&await Lt(Ae,X)}finally{v.current=!1,k(!1)}},ln=async(X,ce=!1)=>{const Ae=C.current;k(!0),$("measuring_duration");try{const Ve=await Promise.all(X.map(Ze=>vs(Ze,{timeoutMs:1e4})));if(!Ne.current)return;const Ke=X.map((Ze,ft)=>({src:Ze,objectUrl:null,duration:Ve[ft]||0}));et(Ke,Q_(Ke)),$("ready"),ce&&Ae&&Ke.length>0&&await Lt(Ae,Ke[0].src)}finally{v.current=!1,k(!1)}},$t=async(X=!1,ce=!0)=>{const Ae=C.current,Ve=t?Array.isArray(t)?t:[t]:[];if(!Ve||Ve.length===0||!Ve.some(Boolean))return!1;if(v.current)return null;v.current=!0,ce&&k(!0),$("resolving");try{const Ke=ex(t,a,Bl),Ze=[];let ft=0;for(const bt of Ke){let ge=bt.src??null,j=null;if(!ge&&bt.resolvedPath){try{$("getting_signed_url"),ge=await kl(bt.resolvedPath)}catch{ge=null}if(!Ne.current)return!1;if(!ge)try{$("downloading");const me=await Al(bt.resolvedPath);if(!Ne.current)return!1;if(me){const ae=me instanceof Blob?me:new Blob([me]);j=b.track(URL.createObjectURL(ae)),ge=j}}catch{$("error");try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),F("active")}catch{}}}if(!ge)continue;let J=0;try{$("measuring_duration"),J=await vs(ge,{timeoutMs:3e3})}catch{J=0}if(!Ne.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const me of Ze)if(me.objectUrl)try{URL.revokeObjectURL(me.objectUrl)}catch{}return!1}ft+=J||0,Ze.push({...bt,src:ge,objectUrl:j,duration:J})}if(et(Ze,ft),Ze.length>0&&X&&Ae){const bt=Ze[0];Et(!1);try{b.keepOnly(Ze.map(ge=>ge.objectUrl))}catch{}if($("ready"),v.current=!1,bt.src&&Ae)try{if(at(Ae,bt.src),await qc(Ae),await Je()===!1)return!1;ce&&k(!1),rt(),Ae&&await be(Ae)}catch{ce&&k(!1)}else ce&&k(!1);F("playMode"),I(0),z(!0)}return Ze.length>0}finally{v.current=!1,ce&&k(!1),$(Ke=>Ke==="ready"?"ready":"idle")}},Ot=async X=>{const ce=ue.isRunning();if(X.paused&&!ce){if(qe.current){await Pt();return}const Ae=ue.resume();if(Ae){if(M("playing"),Ae.phase==="tail"){Ie(Ae.elapsed);return}await be(X,3,50,Ae.elapsed);return}await be(X),M("playing")}else ue.pause(),Me(),X.pause(),M("paused"),ce&&(He(),At())},un=async()=>{const X=C.current;if(!(!X&&!ut)){if(ut){const ce=window.speechSynthesis;if(Z==="active"){const Ae=Sa(),Ve=Array.isArray(l)?l.filter(Boolean):l?[l]:[];if(Ae&&Ve.length>0){if(v.current)return;F("load"),k(!0),$("synthesizing"),v.current=!0;try{const Ke=await Promise.all(Ve.map(Ze=>Promise.resolve(Ae(Ze))));Ke.length>1?await ln(Ke,!0):await Bn(Ke[0],!0)}catch{v.current=!1,k(!1),F("active"),gt(Ve.length>0?Ve:void 0)}return}gt(Ve.length>0?Ve:void 0);return}if(Z==="playMode"){const Ae=!!ce&&(ce.speaking||ce.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!Ae){await Ot(X);return}try{if(ce&&ce.paused)try{yt("tts"),ce.resume(),M("playing")}catch{}else try{ce.pause(),M("paused")}catch{}}catch{}}return}if(Z==="active"){if(s&&Array.isArray(he.current)&&he.current.length>0){const Ae=he.current[0];try{if(Ae.src&&X)try{at(X,Ae.src),rt(),X&&await be(X)}catch{}rt();return}catch{}}F("load");let ce;try{ce=await $t(!0)}catch{ce=!1}if(ce===!1&&Ne.current){try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}F("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 fn(0);return}Et(!1);try{X.currentTime=0}catch{}X&&await be(X),M("playing"),F("playMode")}catch{}},kn=()=>{Me(),xt(),Pe.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}At(),M("stopped"),F("active"),Q(0),z(!1)},Jt=async(X,{sameSegment:ce=!1}={})=>{Me();const Ae=ue.generation(),Ve=C.current,Ke=he.current?.[X]?.src;try{if(Et(!1),I(X),z(!0),Se.current=X,!Ke||!Ve||(ce||vt(),at(Ve,Ke),!ce&&await Je()===!1)||!ue.isCurrent(Ae)||(await be(Ve),!ue.isCurrent(Ae)))return;M("playing"),F("playMode")}catch{}},St=async()=>{const X=he.current,ce=Se.current||0;if(!X||ce<=0){await Pt();return}await Jt(ce-1)},Rt=async()=>{const X=he.current,ce=Se.current||0;if(!X||ce>=X.length-1){kn();return}await Jt(ce+1)},Wt=()=>{if(qe.current)return;const X=200,ce=340;Et(!0),Me(),xt();try{Q(1)}catch{}ot(1);try{H("hold")}catch{}try{const Ae=C.current,Ve=ut&&!!Ae?.src;if(!ut||Ve){if(Ae){Ae.pause();try{Ae.currentTime=0}catch{}}}else Mt();At()}catch{}try{M("stopped")}catch{}if(z(!1),!Ye.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{H("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{H("idle")}catch{}Ue.current=null},ce)},X)}catch{}};o.useEffect(()=>{Bt.current=Wt});const Kt=o.useCallback(()=>Te(""),[]),fn=async X=>{(he.current||[])[X]&&await Jt(X,{sameSegment:X===Se.current})},Ut=G==="playing",Qt=o.useMemo(()=>{if(!Y||Y.length<=1)return Y;const X=Y[S];return X?[X]:Y},[Y,S]),cn=s===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Le(X)}catch{}},[de,Le]);const bn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ce=Math.max(0,Math.min(1,ne)),Ae=bn.current,Ve=()=>{Ae.raf!==null&&(cancelAnimationFrame(Ae.raf),Ae.raf=null),Ae.timer!==null&&(clearTimeout(Ae.timer),Ae.timer=null)};Ve();const Ke=lr(X);if(X.paused||Math.abs(Ke-ce)<.001||typeof requestAnimationFrame!="function"){try{Hn(X,ce)}catch{}return}const Ze=performance.now(),ft=()=>{const bt=Math.min(1,(performance.now()-Ze)/150);try{Hn(X,Ke+(ce-Ke)*bt)}catch{}Ae.raf=bt<1?requestAnimationFrame(ft):null};return Ae.raf=requestAnimationFrame(ft),Ae.timer=setTimeout(()=>{Ve();try{Hn(X,ce)}catch{}},200),Ve},[ne]);const Ht=W==="hold",An=W==="out",pe=Z==="playMode"&&!A&&!pt||Ht||An,De=G!=="stopped"||Ht||An,Re=G==="paused",Ge=Math.max(0,Math.min(100,(L||0)*100)),ze=Be("audio-player__fill",pe?"is-visible":"",De?"is-expanded":"",Re?"is-paused":"",An?"is-out":"");return n.jsxs("div",{className:`audio-player ${cn?"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":""} ${A?"is-loading":""} ${Z!=="default"?"is-revealed":""}`,children:[A?n.jsxs("div",{className:"audio-player__loading",role:Vc[R]?"status":void 0,"aria-live":Vc[R]?"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:cn,onClick:()=>{K.current=_r(),D(),un()},"aria-label":typeof m=="string"?m:p("training.listen","\uB4E3\uAE30"),onMouseEnter:w,onMouseLeave:D,onFocus:w,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:N,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(fe,{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(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:Ut?"pause":"play",onClick:un,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":Ut,width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}),n.jsx(fe,{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"}),ve>1?n.jsx("div",{ref:B,className:"audio-player__source-buttons",children:Array.from({length:ve}).map((X,ce)=>n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ce+1),onClick:()=>{try{fn(ce)}catch{}},ariaLabel:p("training.sourcePlay",{n:ce+1}),variant:"transparent-white",selected:O&&S===ce,disabled:Z!=="playMode"||!(Array.isArray(T)&&T[ce]),showTooltipInfo:!0},ce))}):null,!Array.isArray(T)||T.length<=1?n.jsx(fe,{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(fe,{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(fe,{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:ze,ref:f,style:{left:`${Ge}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(ax,{segments:Qt,progress:L,totalDuration:se,waveProgressRef:$e,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:T?.[S]?.duration??0,noiseSrc:c&&g?.settings.enabled&&V>0?st:null,noiseRatio:g?ar(g.settings):0,noiseSpeed:g?.settings.speed??1,mainVolume:ee,onReadyChange:Qe})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(nt,{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:ye,onClose:Kt})]})}function Sr(e){const{t}=_e.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}=Fi({storageKey:"tooltip-fontScale"}),f=o.useCallback(()=>d(N=>N==="dark"?"light":"dark"),[]),_=o.useCallback(N=>{try{N.stopPropagation()}catch{}try{typeof l=="function"&&l()}catch{}},[l]),b=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],B={fontSize:`${y}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},v=n.jsxs("div",{className:le(`text-box-tooltip__root ${c==="dark"?"is-dark":""}`),children:[n.jsxs("div",{className:le("text-box-tooltip__box"),children:[r&&n.jsx("div",{className:le("text-box-tooltip__label body-2b"),children:r}),n.jsx("div",{className:le("text-box-tooltip__text body-1"),style:B,children:b.map((N,x)=>n.jsxs("div",{className:le("text-box-tooltip__line"),children:[b.length>1?n.jsx("div",{className:le("text-box-tooltip__marker"),children:n.jsx("span",{className:le("text-box-tooltip__line-number button-1"),children:x+1})}):null,n.jsx("span",{className:le("text-box-tooltip__line-text"),children:N})]},x))})]}),n.jsxs("div",{className:le("text-box-tooltip__buttons"),children:[n.jsx(fe,{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(fe,{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(fe,{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(fe,{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(xn,{anchorRect:s,className:le(`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:le(`text-box-tooltip ${c==="dark"?"is-dark":""}`),children:v})}function Gc({state:e="disabled"}){const{t}=_e.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(nt,{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}=_e.useTranslation(),m=gn("(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,B]=o.useState(null),[v,N]=o.useState(null);Kc(f&&!!b,()=>{if(typeof document>"u")return null;const A=Array.from(document.querySelectorAll(".tooltip__content"));for(let k=A.length-1;k>=0;k--)if(A[k].querySelector(".text-box-tooltip__root"))return A[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(A=>typeof A=="string"||typeof A=="number")?i.join(""):"",[i]),w=o.useCallback(()=>{_(!1),B(null),N(null)},[]);o.useEffect(()=>{if(!f)return;let A;try{typeof x.current=="function"&&(A=x.current())}catch{}if(A===!1){w();return}N(typeof A<"u"&&A!==null?A:null)},[E]);const D=o.useCallback(()=>{let A;try{typeof l=="function"&&(A=l())}catch{}if(A!==!1){if(N(typeof A<"u"&&A!==null?A:i),!C.current){_(k=>!k);return}if(f)_(!1),B(null),N(null);else{const k=C.current.getBoundingClientRect();B(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(fe,{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(fe,{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:w,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}=_e.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 A=E.currentTarget??E.target;if(A&&typeof A.getBoundingClientRect=="function")return A.getBoundingClientRect()}if(x instanceof DOMRect)return x;const w=x;if(w&&typeof w.getBoundingClientRect=="function")return w.getBoundingClientRect();const D=x?.current;return D&&typeof D.getBoundingClientRect=="function"?D.getBoundingClientRect():null}catch{return null}},[]),B=o.useCallback((x,{text:E="",label:w="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:D=!1,alignX:A="center",alignY:k="top"}={})=>{const R=b(x);_({text:E,label:w,anchorRect:R,backdrop:D,alignX:A,alignY:k}),C(!0)},[b]),v=o.useCallback(()=>{C(!1),_(x=>({...x,anchorRect:null}))},[]),N=o.Children.map(l,x=>{if(o.isValidElement(x)){const E=x;if(typeof E.type=="string")return E;const w=E.props??{},D=typeof w.onDone=="function"?w.onDone:g,A=typeof w.disabled=="boolean";let k=p==="disabled";return A&&(k=!!w.disabled),o.cloneElement(E,{onDone:D,disabled:k,showTooltip:B,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}),N]}),y?n.jsx(xn,{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}=_e.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}=Fi({storageKey:"textbox_fontScale"}),[C,f]=o.useState(""),_=o.useRef(null),b=o.useRef(!1),B=o.useCallback(()=>{b.current=_r()&&!!_.current&&_.current.contains(document.activeElement),l("active")},[]),v=o.useCallback(()=>f(""),[]),N=$=>{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]),[w,D]=o.useState(E);w!==E&&(D(E),l("disabled"));const A=t==="disabled"?s:t,k=A==="disabled"?"training-text-box--disabled":A==="active"?"training-text-box--active":A==="done"?"training-text-box--done":"",R=o.useMemo(()=>({fontSize:`${g}px`,lineHeight:`${y}px`}),[g,y]);return o.useEffect(()=>{if(A==="disabled"||!b.current)return;b.current=!1;const $=document.activeElement;$&&$!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[A]),n.jsxs("div",{ref:_,className:`training-text-box ${k} ${A!=="disabled"&&i==="dark"?"is-dark":""}`,children:[A==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(fe,{htmlType:"button",size:48,type:"bar",onClick:B,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":A==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:R,children:E})}),A!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":A==="disabled",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:h,onDisabledClick:()=>N(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(fe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>N(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(fe,{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}=_e.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,B=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,N=d?d.join("||"):"",x=h?h.join("||"):"",[E,w]=o.useState(()=>Array.isArray(v)?C?$a(v):v.slice():void 0);o.useEffect(()=>{Array.isArray(v)&&v.length?w(C?$a(v):v.slice()):w(void 0)},[c,N,x,C]);const[D,A]=o.useState(null),[k,R]=o.useState(()=>new Set);o.useEffect(()=>{A(null),R(new Set)},[x,c,N]);const $=o.useRef(void 0);o.useEffect(()=>{const P=$.current;typeof P=="number"&&typeof t=="number"&&typeof e=="number"&&P>=e&&t<e&&(A(null),R(new Set)),$.current=t},[t,e]);const G=o.useCallback(P=>{if(!ra(B))return;const L=E?.[P];if(L==null)return;const Q=L;if(p){const Z=new Set(k);Z.has(Q)?Z.delete(Q):Z.add(Q),R(Z),typeof u=="function"&&u({selectedValues:[...Z],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...Z],__ts:Date.now()})}else A(Q),typeof u=="function"&&u({selectedIndex:P,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:P,selectedValue:Q,__ts:Date.now()})},[E,B,p,u,k]),M=`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:M,children:Array.isArray(E)&&E.length>0?E.map((P,L)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>G(L),ariaLabel:String(P),label:P,useLabel:!0,icon:y?y[String(P)]:void 0,variant:"default",disabled:B==="disabled",selected:p?k.has(P):D===P,useDisabledCovered:g,minWidth:0},String(P))):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}=_e.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,B]=o.useState(_);b!==_&&(B(_),c==null&&f(null));const[v,N]=o.useState(c);Object.is(v,c)||(N(c),f(c??null));const x=o.useRef(void 0);o.useEffect(()=>{const A=x.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&c==null&&f(null),x.current=t},[t,e,c]);const E=o.useCallback(A=>{const k=typeof A=="object"&&A!==null?Object.assign({},A,{__ts:Date.now()}):{value:A,__ts:Date.now()};typeof i=="function"&&i(k),ra(m)&&typeof l=="function"&&l(k)},[i,m,l]),w=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((A,k)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>{ra(m)&&(f(k),E&&E(k))},disabled:m==="disabled",ariaLabel:String(A),label:A,variant:m,selected:C===k},k)):n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:w,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(fe,{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:_}=_e.useTranslation(),b=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),B=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:B,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}=_e.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,S)=>({id:S,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 S=(I=>{const O=(I||[]).map((de,ee)=>({id:ee,text:h(de)}));if(O.length<=1)return O;const z=(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 se=$a(O),te=0;for(;z(se,O)&&te<20;)se=$a(O),te+=1;return se})(U);y(S);try{if(typeof i=="function"){const I=S.filter((O,z)=>O.text===h(U[z])).length;i({shuffled:S,score:I,total:(U||[]).length,initial:!0,__ts:Date.now()})}if(typeof l=="function"&&C==="active"){const I=S.filter((O,z)=>O.text===h(U[z])).length;b.current=u,l({shuffled:S,score:I,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:[],S=g.filter((I,O)=>I.text===h(U[O])).length;l({shuffled:g,score:S,total:U.length,initial:!0,__ts:Date.now()})},[C,u]);const B=(U,S)=>{const I=[...g],O=U+S;if(O<0||O>=I.length)return;const z=I[O];I[O]=I[U],I[U]=z,Q(I);try{if(typeof l=="function"&&C==="active"){const se=I.filter((te,de)=>te.text===h(p[de])).length;l({shuffled:I,score:se,total:(p||[]).length,__ts:Date.now()})}}catch{}},[v,N]=o.useState(null),x=o.useRef(null),E=o.useRef(null),w=o.useRef(null),D=o.useRef(null),A=o.useRef(null),k=o.useRef({x:0,y:0}),R=o.useRef(null),$=o.useRef({dx:0,dy:0}),G=()=>{if(R.current!==null)return;const U=()=>{if(!x.current){R.current=null;return}R.current=requestAnimationFrame(U);const S=k.current,I=$.current||{dx:0,dy:0};x.current&&(x.current.style.transform=`translate3d(${S.x-I.dx}px, ${S.y-I.dy}px, 0)`)};R.current=requestAnimationFrame(U)},M=o.useRef(new Map),P=o.useRef(new Map),L=()=>{const U=new Map;return M.current.forEach((S,I)=>{S&&S.getBoundingClientRect&&U.set(I,S.getBoundingClientRect())}),U},Q=U=>{const S=L();y(U);try{if(typeof i=="function"){const I=U.filter((O,z)=>O.text===h(p[z])).length;i({shuffled:U,score:I,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const I=L();U.forEach(O=>{const z=S.get(O.id),se=I.get(O.id),te=M.current.get(O.id);if(!te||!z||!se)return;const de=z.top-se.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,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(U))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const I=document.createElement("div");I.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(I),S.dataTransfer?.setDragImage(I,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(I)}catch{}})}catch{}}catch{}N(U);try{const I=g[U],O=document.createElement("div");O.className="order-list__dragging-object order-list__dragging-object--visible",O.textContent=I&&I.text?I.text:"",document.body.appendChild(O),x.current=O;const z=M.current.get(I.id);let se=S.clientX||0,te=S.clientY||0;try{if(z&&z.getBoundingClientRect){const H=z.getBoundingClientRect();se=H.left+H.width/2,te=H.top+H.height/2}}catch{}const de=O.getBoundingClientRect(),ee=de.width/2,V=de.height/2;$.current={dx:ee,dy:V},O.style.transition="none",k.current={x:se,y:te},O.style.transform=`translate3d(${se-ee}px, ${te-V}px, 0)`,requestAnimationFrame(()=>{try{O.style.transition=""}catch{}G()});const ne=H=>{const ie=H;k.current={x:ie.clientX,y:ie.clientY},G()};w.current=ne,document.addEventListener("mousemove",ne);const W=H=>{const ie=H;k.current={x:ie.clientX,y:ie.clientY},G()};E.current=W,document.addEventListener("dragover",W);try{S.dataTransfer?.setData("text/plain",String(U));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:U}))}catch{}}catch{}}catch{}},F=(U,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{A.current!==null&&(clearTimeout(A.current),A.current=null);const I=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(I&&D.current!==I){if(D.current)try{D.current.classList.remove("drag-over")}catch{}try{I.classList.add("drag-over")}catch{}D.current=I}}catch{}},K=(U,S)=>{S.preventDefault();const I=S.dataTransfer?.getData("text/plain")||"",O=I?parseInt(I,10):v,z=U;if(typeof O!="number"||isNaN(O)||O===z){N(null),Y(),T();return}const se=Nf(g,O,z);Q(se),N(null),T();try{if(typeof l=="function"&&C==="active"){const te=se.filter((de,ee)=>de.text===h(p[ee])).length;l({shuffled:se,score:te,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const te=document.querySelectorAll(".order-list .order-list__item")[z];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()},T=()=>{if(x.current){try{document.body.removeChild(x.current)}catch{}x.current=null}E.current&&(document.removeEventListener("dragover",E.current),E.current=null),w.current&&(document.removeEventListener("mousemove",w.current),w.current=null),R.current!==null&&(cancelAnimationFrame(R.current),R.current=null)},q=()=>{N(null),Y(),T()};o.useEffect(()=>()=>T(),[]);const Y=()=>{try{if(A.current!==null&&(clearTimeout(A.current),A.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((S,I)=>{const O=P.current.get(S.id);if(!O)return;let z=50;U>1&&(z=Math.round(I/(U-1)*100));try{O.style.setProperty("--marker-pos",z+"%")}catch{}})}catch{}},[g]),o.useEffect(()=>()=>{T(),A.current!==null&&(clearTimeout(A.current),A.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,S)=>{const I=Math.max(1,(g||[]).length),O=I>1?Math.round(S/(I-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":O+"%"},ref:z=>{const se=P.current;z?se.set(U.id,z):se.delete(U.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:z=>{const se=M.current;z?se.set(U.id,z):se.delete(U.id)},className:`order-list__draggable ${v===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:f,onDragStart:f?z=>Z(S,z):void 0,onDragEnter:f?z=>F(S,z):void 0,onDragOver:f?z=>F(S,z):void 0,onDragLeave:f?()=>{try{A.current!==null&&clearTimeout(A.current),A.current=setTimeout(()=>{try{const z=document.querySelectorAll(".order-list .order-list__item");z&&z[S]&&(z[S].classList.remove("drag-over"),D.current===z[S]&&(D.current=null))}catch{}},80)}catch{}}:void 0,onDrop:f?z=>K(S,z):void 0,onDragEnd:f?q: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(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>B(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>B(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===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}=_e.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,B=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",[v,N]=o.useState(null),x=o.useRef([]),[E,w]=o.useState(!1),D=o.useRef(null),A=o.useRef(!0);o.useEffect(()=>(A.current=!0,()=>{A.current=!1}),[]);const k=o.useMemo(()=>C.map(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{N(null)},[k]);const R=o.useRef(void 0);o.useEffect(()=>{const L=R.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&N(null),R.current=t},[t,e]);const $=o.useCallback((L,Q)=>{if(c)return;const Z={item:L,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(B==="active"&&typeof l=="function")try{l(Z)}catch{}},[c,i,B,l]),G=o.useRef(m);o.useEffect(()=>{G.current=Math.max(0,m||0)},[m]);const M=o.useCallback(async()=>{if(E||B==="disabled")return;w(!0);let L=!1;const Q=new Promise(Z=>{D.current=()=>{L=!0,Z()}});try{for(let Z=0;Z<_.length&&!(!A.current||L);Z++){const F=x.current[Z];if(!F)continue;await Promise.race([mx(F.play(),hx),Q]);const K=Math.max(0,G.current||0);K>0&&Z<_.length-1&&!L&&A.current&&await Promise.race([new Promise(T=>{setTimeout(T,K)}),Q])}}finally{D.current=null,w(!1)}},[E,B,_.length]),P=o.useCallback((L,Q)=>{if(!ra(B))return;N(Q);const Z={selectedValue:L.word||L.title||"",selectedIndex:Q,item:L,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(typeof l=="function")try{l(Z)}catch{}},[i,B,l]);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:y,onDone:l,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:M,playAllActive:E},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Q=D.current;if(!Q)return;const Z=L.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((L,Q)=>n.jsx(ts,{ref:Z=>{x.current[Q]=Z},item:L,disabled:B==="disabled",onPlayDone:()=>$(L,Q),selectable:c,selected:c&&v===Q,onSelect:c?()=>P(L,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:h},L&&L.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:le("noise-settings-tooltip__slider-input")}),n.jsx("div",{className:le(Be("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}=_e.useTranslation(),s=gn("(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(xn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:le("noise-settings-tooltip__header"),children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(fe,{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:le("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(yn,{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:le("noise-settings-tooltip__width-ghost"),"aria-hidden":"true",inert:!0,children:n.jsx(sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(yn,{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}=_e.useTranslation(),[p,m]=o.useState(!1),[g,y]=o.useState(null),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),B=Ar(),v=u>0,N=v&&i<u-1,x=!v||i>=u-1,E=s===Math.max(0,l);o.useEffect(()=>{e||(m(!1),y(null))},[e]);const w=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]),A=o.useCallback(()=>{if(p){m(!1),y(null);return}const Q=b?.current?.getBoundingClientRect();Q&&y(Q),t?.(),m(!0)},[p,t]),k=gn("(max-width: 767px)"),R=o.useRef(null),[$,G]=o.useState(null),M=o.useCallback(()=>{f(Q=>{const Z=!Q;return G(Z?R.current?.getBoundingClientRect()??null:null),Z})},[]),P=o.useCallback(()=>{f(!1),G(null)},[]);o.useEffect(()=>{c&&(f(!1),G(null))},[c]);const L=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:B?.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:B?.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(fe,{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(fe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:A,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:R,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:M,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:L})]}),e&&C&&k&&$&&n.jsx(xn,{anchorRect:$,onClose:P,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:L})}),n.jsxs("div",{className:"pp-bottom__right",children:[x&&n.jsx(fe,{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}),N&&n.jsx(fe,{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:w,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}=_e.useTranslation(),y=gn("(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,B=typeof e=="string"?e.trim():e,v=typeof t=="string"?t.trim():t,N=!!(B||v),x=N?B||v:g("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),E=b||(B?t:void 0),w=y&&typeof E=="string"&&(E.includes(" \xB7 ")||E.includes(" / "))?E.split(/\s[·/]\s/).pop():E,D=o.useMemo(()=>{const A=l&&typeof l=="object"?{...l}:{};return!("width"in A)&&!("height"in A)&&(A.width="40px",A.height="40px"),A},[l]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(fe,{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:[w?n.jsx("span",{className:"pp-title__depth caption-1",children:w}):null,n.jsx("span",{className:`pp-title__title h2${N?"":" 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}=_e.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 B=C.current;typeof B=="number"&&typeof t=="number"&&typeof e=="number"&&B>=e&&t<e&&m(Array.from({length:y},()=>null)),C.current=t},[t,e,y]);const f=o.useMemo(()=>p.filter(B=>B!==null).length+1,[p]),_=o.useCallback(B=>{if(!ra(h))return;const v=p;let N;if(v[B]!=null){const E=v[B];N=v.map(w=>w!==null&&w>=E?null:w)}else N=[...v],N[B]=f;m(N);const x={selectedOrder:N,words:l,__ts:Date.now()};try{typeof u=="function"&&u(x)}catch{}if(v[B]==null&&N.length>0&&N.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((B,v)=>n.jsx(ts,{item:{word:B},disabled:h==="disabled",selectable:!0,selected:p[v]!==null,orderRank:p[v],onSelect:()=>_(v),flipDelay:v*120,hideLabel:!1,hideAudio:!0},`${B}-${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 wt(`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?(wt(`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)||(wt(`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 Fx=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function Ox(e){wt("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}=_e.useTranslation(),h=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const A=a??0;if(t!=null&&A>0&&t/A>.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(A=>{const k=md(A),R=Mr(A?.wording,A?.label);return k===!0?{variant:"main",label:R??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:k===!1?{variant:"danger",label:R??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:R??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),B=o.useCallback(()=>{f.current?.(),f.current=null,b(null)},[]);o.useEffect(()=>B,[B]);const v=o.useRef(0),N=(A,k)=>{if(!On)return;const R=Math.round(performance.now()-v.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${R}ms ${A}`,k??"")},x=o.useRef(0),E=o.useCallback((A,k,R)=>{B();const $=++x.current,G=()=>x.current===$;v.current=On?performance.now():0,N(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${A}`,{text:k,rawUrl:R}),b(A),f.current=()=>{N("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),x.current++,Qr()};const M=Z=>{N("\uD2BC\uB2E4",Z);const F=Ka(Z,K=>{N(`\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=()=>{N("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),x.current++,F.stop(),Qr()},F.done},P=Px(k,R);N("\uCC28\uB840",P.map(Z=>Z.kind));const L=P[0]?.kind==="raw",Q=L?M(R):Promise.resolve(!1);(async()=>{if(await Q||!G())return;const Z=Ix(),F=L?P.slice(1):P;for(let K=0;K<F.length;K++){if(!G())return;N(`${F[K].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const T=await F[K].resolve(Fx(Z,F.length-K));if(N(`${F[K].kind} \uAC00 \uB2F5\uD588\uB2E4`,T),!G()||T&&(await M(T)||!G()))return}G()&&(N("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),Ox(k),f.current=()=>{x.current++,Qr()},N("\uB0AD\uB3C5\uD55C\uB2E4"),L1(k,{onEnd:()=>{G()&&(f.current=null,b(null))}}))})()},[B]),w=o.useMemo(()=>C.map(A=>{const k=A??{},R=zx(k)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:$,label:G}=m(k),M=Array.isArray(k.corrects)?k.corrects:[],P=M.length?M.join(", "):k.answer!=null&&k.answer!==""?String(k.answer):null,L=typeof k.selectedText=="string"?k.selectedText:null,Q=md(k)===!0,Z=Wx(k),F=!!Z||Rx(R);return{problem:R,variant:$,label:G,answer:P,selectedText:L,isCorrect:Q,sound:Z,canHear:F}}),[C,m,d]),D=o.useMemo(()=>w.some(A=>A.answer!==null||A.selectedText!==null),[w]);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:A,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(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>A(l)}),n.jsx(fe,{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})]})})]}),w.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")})]}),w.map((A,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:A.problem}),A.canHear&&n.jsx(fe,{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?B():E(k,A.problem,A.sound)})]}),D&&n.jsxs("div",{className:"trp-row__answers",children:[A.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:A.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${A.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${A.isCorrect?"is-correct":"is-wrong"}`,children:A.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(on,{variant:A.variant,label:A.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}},Fn=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:B,label:v,buildResults:N,onResult:x,typeKey:E,entryPoint:w,dailyTotal:D,itemRef:A,renderResultPopup:k,noiseOverride:R,hideNoiseRows:$=!1}=e;Hx(E&&!fd.has(E)?E:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:M}=_e.useTranslation(),P=x,L=!!t,Q=t?.id||null,Z=t?.meta||{},F=Array.isArray(t?.pages)?t.pages:[],K=Array.isArray(b)||o.isValidElement(b)&&typeof b!="function"?o.Children.toArray(b).filter(o.isValidElement):[],T=K.length>0,q=pe=>pe===Tr||pe?.__isTrainingPage===!0,Y=T&&K.some(pe=>q(pe.type)),U=Y?K.filter(pe=>q(pe.type)).map((pe,De)=>{const Re=pe.props||{};return{id:`children-page-${De}`,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}],S=T&&!L&&typeof b!="function",I=S?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 De=Number(pe.dataset.ihabTrainingPopupCount||"1")-1;De>0?pe.dataset.ihabTrainingPopupCount=String(De):(delete pe.dataset.ihabTrainingPopupCount,pe.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return pv()},[]);const[O,z]=o.useState({...na,enabled:!1}),se=o.useRef(O);o.useEffect(()=>{se.current=O},[O]);const te=o.useRef(R),de=o.useRef(!1),ee=o.useRef(null);o.useEffect(()=>{let pe=!1;const De=Re=>{if(pe)return;de.current=!0;const Ge=Re?ta({...na,enabled:!1},Re):{...na},ze=ee.current;ee.current=null;const X=ze?ta(Ge,ze):Ge;se.current=X,z(X),ze&&!te.current&&po(X),dr(X);const ce=te.current;if(ce){const Ae=typeof ce=="function"?ce(X):ce,Ve=ta(X,Ae);se.current=Ve,z(Ve),dr(Ve)}};return zf().then(Re=>{if(pe){const Ge=ee.current;if(ee.current=null,Ge&&!te.current){const ze=Re?ta({...na,enabled:!1},Re):{...na};po(ta(ze,Ge))}return}De(Re)}),()=>{pe=!0}},[]);const[V,ne]=o.useState(null),[W,H]=o.useState(null),ie=o.useCallback((pe,De)=>{pe==="main"?ne(De):H(De)},[]),Te=o.useRef(null),ye=o.useRef(null),he=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const pe=Te.current;Te.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 Se=o.useCallback(pe=>{const De=ta(se.current,pe);if(se.current=De,z(De),!de.current){ee.current={...ee.current??{},...pe},dr(De);return}te.current||(Te.current=De,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(he,qx)),dr(De)},[he]),$e=O.mainSpeed,Ne=O.mainVolume,ue=o.useCallback(pe=>Se({mainSpeed:pe}),[Se]),xe=o.useCallback(pe=>Se({mainVolume:pe}),[Se]),ke=o.useMemo(()=>({settings:O,setSettings:Se,registerAnalyser:ie,mainAnalyser:V,noiseAnalyser:W,playbackRate:$e,setPlaybackRate:ue,mainVolume:Ne,setMainVolume:xe}),[O,Se,ie,V,W,$e,ue,Ne,xe]),Ee=o.useRef(null),[We,He]=o.useState(0),ot=o.useRef([]),[Qe,Je]=o.useState("center"),[vt,je]=o.useState(!1),Ye=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(pe=>{Ye.current||(Ye.current=!0,je(!0),we.current=setTimeout(()=>{try{pe()}catch{Ye.current=!1,je(!1)}},Ux()?0:Cx))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const qe=o.useRef(m);o.useEffect(()=>{qe.current=m});const pt=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const pe=Ee.current,De=pt.current;if(bo(pe,De),pe){const Re=Array.from(pe.querySelectorAll(Nn)).filter(Ge=>!Ge.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(De)?.focus?.()}catch{}}},[]),o.useEffect(()=>Zn(()=>Ue(()=>{const pe=qe.current;typeof pe=="function"&&pe()})),[Ue]),Co(Ee,!0);const[_t,Et]=o.useState(!1),Bt=o.useRef(!1),[st,tt]=o.useState(null),kt=o.useRef(0),At=o.useRef(0),jt=()=>{kt.current+=1,At.current+=1,tt(null)},[Mt,gt]=o.useState(""),[it,ut]=o.useState(()=>Rr()),ct=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(ut(Rr()),jt())},[L,Q,S]),o.useEffect(()=>{S&&ut(pe=>{const De=Math.max(0,Math.min(pe.pageIndex,Math.max(0,I-1)));return De!==pe.pageIndex?{...pe,pageIndex:De,stepIndex:0}:pe})},[S,I]);const ve=S?Math.max(0,Math.min(it.pageIndex,I-1)):0,Me=S?U[ve]:null,Pe=S&&Me&&Array.isArray(Me.steps)?Me.steps:[],Oe=L?it.pageIndex:S?ve:typeof c=="number"?c:0,dt=L?F[Math.max(0,Math.min(it.pageIndex,Math.max(0,F.length-1)))]:null,Dt=L&&dt&&Array.isArray(dt.steps)?dt.steps:[],yt=L?Dt.length:S?Pe.length:typeof p=="number"?p:0,xt=L||S?Math.max(0,Math.min(it.stepIndex,Math.max(0,yt))):typeof h=="number"?h:0,Ct=L?F.length:S?I:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const pe=L?Lr(dt,Oe):Me?.id||`children-page-${Oe??0}`,De=new Date().toISOString();for(let Re=0;Re<=xt;Re+=1){const Ge=L?$r(Dt[Re],Re):`step-${Re}`,ze=be(pe,Ge);oe.current.has(ze)||oe.current.set(ze,De)}},[L,S,Oe,xt,Me?.id]),o.useLayoutEffect(()=>{const pe=ct.current;if(typeof Oe=="number"&&pe!==null&&Oe!==pe&&Oe>pe)try{gt(M("training.problemNotice",{n:Oe+1}))}catch{}ct.current=typeof Oe=="number"?Oe:ct.current},[Oe,c,M]),o.useLayoutEffect(()=>{const pe=Ee.current;if(!pe)return;const De=()=>pe.querySelector(".page-popup__scroll");let Re=null,Ge=null,ze=null;const X=Ze=>{const ft=De();if(!ft)return;const bt=ft.scrollHeight<=ft.clientHeight;if(Je(bt?"center":"top"),Ze&&!Bt.current){Bt.current=!0;try{Et(!0)}catch{}try{Ve.disconnect()}catch{}}},ce=()=>{Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Ge!==null&&clearTimeout(Ge),Ge=setTimeout(()=>X(!0),60)})},Ae=()=>{ze!==null&&cancelAnimationFrame(ze),ze=requestAnimationFrame(()=>X(!1))};ce(),window.addEventListener("resize",Ae);const Ve=new MutationObserver(ce);Ve.observe(pe,{childList:!0,subtree:!0,attributes:!0});const Ke=setTimeout(()=>{Bt.current||X(!0)},400);return()=>{window.removeEventListener("resize",Ae),Re!==null&&cancelAnimationFrame(Re),Ge!==null&&clearTimeout(Ge),ze!==null&&cancelAnimationFrame(ze),clearTimeout(Ke);try{Ve.disconnect()}catch{}}},[Ee]);const Le=o.useCallback(pe=>{Ee.current&&(Ee.current._childOnNext=pe)},[]),at=o.useCallback(pe=>{Ee.current&&(Ee.current._childOnResult=pe)},[]),oe=o.useRef(new Map),be=(pe,De)=>`${pe}\0${De}`,Ie=o.useCallback((pe,De,Re)=>{ut(Ge=>{const ze=Ge.answersByPage[pe]||{},X=ze[De],ce=Es(Re),Ae=Es(X);if(X&&Ae>ce)return Ge;const Ve=rd(Re,oe.current.get(be(pe,De)),ce);return{...Ge,answersByPage:{...Ge.answersByPage,[pe]:{...ze,[De]:Ve}}}})},[ut]),Xe=o.useCallback((pe,De,Re)=>{const Ge=Lr(dt,Oe),ze=$r(pe,De);Ie(Ge,ze,Re)},[dt,Oe,Ie]),et=o.useCallback((pe,De,Re)=>{const Ge=Lr(dt,Oe),ze=$r(pe,De);Ie(Ge,ze,Re),!Re?.allowChange&&pe?.autoAdvance!==!1&&ut(X=>({...X,stepIndex:Math.max(X.stepIndex,De+1)}))},[dt,Oe,Ie,ut]),rt=o.useCallback((pe,De)=>{const Re=Me?.id||`children-page-${Oe??0}`,Ge=typeof De=="number"?De:xt??0,ze=`step-${Ge}`;Ie(Re,ze,pe),pe?.allowChange||ut(X=>({...X,stepIndex:Math.max(X.stepIndex,Ge+1)}))},[Me,Oe,xt,Ie,ut]),Lt=o.useCallback((pe,De)=>{const Re=Me?.id||`children-page-${Oe??0}`,Ge=`step-${typeof De=="number"?De:xt??0}`;Ie(Re,Ge,pe)},[Me,Oe,xt,Ie]),Bn=S?{currentPageIndex:Oe??0,currentStepIndex:xt??0,totalStepsInPage:Pe.length,handleStepDone:rt,handleStepChange:Lt}:null,ln=async()=>{const pe=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:F,flowState:it,answersByPage:it.answersByPage})):null;return typeof P=="function"&&await Promise.resolve(P(pe))||pe},$t=async()=>{const pe=Me?.id||`children-page-${it.pageIndex}`,De=it.answersByPage[pe]||{},Re=Y?(()=>{const X={};let ce=0;return U.forEach(Ae=>{const Ve=it.answersByPage[Ae.id]||{},Ke=Array.isArray(Ae.steps)?Ae.steps.length:0;for(let Ze=0;Ze<Ke;Ze+=1){const ft=Ve[`step-${Ze}`];typeof ft<"u"&&(X[`step-${ce+Ze}`]=ft)}ce+=Ke}),X})():De;if(typeof N=="function"){const X=await Promise.resolve(N(Re,{pageAnswers:De,answersByPage:it.answersByPage,pages:U,currentPageId:pe}));return typeof P=="function"&&await Promise.resolve(P(X))||X}const Ge=Object.entries(De).map(([X,ce],Ae)=>({index:Ae,key:X,payload:ce})),ze={results:Ge,answers:Ge,score:0};return typeof P=="function"&&await Promise.resolve(P(ze))||ze},Ot=()=>{const pe=++kt.current,De=()=>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(L){const ze=ln();tt(Fn);const X=ze;Promise.resolve(X).then(ce=>{De()||tt(ce||{isEmpty:!0})}).catch(ce=>{!De()&&tt({isEmpty:!0})});return}if(S){const ze=$t();tt(Fn);const X=ze;Promise.resolve(X).then(ce=>{De()||tt(ce||{isEmpty:!0})}).catch(ce=>{!De()&&tt({isEmpty:!0})});return}const Re=Ee.current&&Ee.current._childOnResult,Ge=ze=>{try{return ze?ze():void 0}catch{return}};if(typeof Re=="function"){const ze=Ge(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{}ze&&typeof ze.then!="function"?tt(ze):tt(ze&&typeof ze.then=="function"?Fn:{});const X=()=>{De()||tt(ce=>ce===Fn?{}:ce)};Promise.resolve(ze).then(ce=>{ce&&!De()?tt(ce):X()}).catch(ce=>{X()});return}if(typeof P=="function"){const ze=Ge(P);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{}ze&&typeof ze.then!="function"?tt(ze):tt(ze&&typeof ze.then=="function"?Fn:{});const X=()=>{De()||tt(ce=>ce===Fn?{}:ce)};Promise.resolve(ze).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&&!De()?tt(ce):X()}).catch(ce=>{console.error("viewResults external handler failed",ce),X()});return}},un=()=>{if(L){if(typeof Oe=="number"&&typeof Ct=="number"&&Oe<Ct-1){ut(De=>({...De,pageIndex:De.pageIndex+1,stepIndex:0}));return}return Ot()}if(S){const De=Pe.length;if(typeof xt=="number"&&xt<De-1){ut(Re=>({...Re,stepIndex:Re.stepIndex+1}));return}if(typeof Oe=="number"&&typeof Ct=="number"&&Oe<Ct-1){ut(Re=>({...Re,pageIndex:Re.pageIndex+1,stepIndex:0}));return}return Ot()}if(typeof C=="function"){try{C()}catch{}return}const pe=Ee.current&&Ee.current._childOnNext;if(typeof pe=="function"){try{pe()}catch{}return}},Pt=L?Z.title||Z.label||B||M("common.popup","\uD31D\uC5C5"):a||v||(Array.isArray(s)?s[s.length-1]:void 0)||B||M("common.popup","\uD31D\uC5C5"),kn=B||Pt,Jt=L?Z.title??Z.label??Pt:a??v??Pt,St=(pe,De)=>{const Re=Lr(dt,Oe),Ge=$r(pe,De),ze=it.answersByPage[Re]?.[Ge],X=Vx(pe,{page:dt,pageIndex:Oe,step:pe,stepIndex:De,storedPayload:ze,answersByPage:it.answersByPage,flowState:it}),ce={key:Ge,index:De,stepIndex:xt,isLast:De===Dt.length-1};switch(pe?.type){case"listen":return n.jsx(ks,{...ce,...X,onDone:Ae=>et(pe,De,Ae)});case"confirm":return n.jsx(ws,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});case"confirmWithText":return n.jsx(Bs,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});case"orderList":return n.jsx(As,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});default:return null}},Rt=o.useRef(void 0);o.useEffect(()=>{const pe=Rt.current;if(Rt.current=Oe,pe===void 0||pe===Oe||!_r())return;const De=Ee.current;if(!De)return;const Re=document.activeElement;if(!(!Re||Re===document.body||!De.contains(Re)||Re.disabled===!0))return;const Ge=De.querySelector(`.training-steps ${Nn.split(", ").join(", .training-steps ")}`)??Array.from(De.querySelectorAll(Nn)).find(ze=>!ze.closest('[aria-hidden="true"]'));try{Ge?.focus()}catch{}},[Oe]);const Wt=L?F.length>0?n.jsx("div",{className:"training-steps",children:Dt.map((pe,De)=>St(pe,De))},`replay-${We}`):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||M("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Kt=S?n.jsxs(sd.Provider,{value:Bn,children:[Me?.pageTop?n.jsx("div",{className:"training-page-top",children:Me.pageTop}):null,n.jsx("div",{className:"training-steps",children:Pe.map((pe,De)=>{const Re=pe;return o.cloneElement(Re,{...Re.props,_stepIndex:De,_totalSteps:Pe.length,_stepKey:`step-${De}`,_pageIndex:Oe})})},`replay-${We}`),Me?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Me.pageBottom}):null]}):null,fn=o.useRef(-1),Ut=o.useCallback(()=>{if(!E)return;const pe=st,{results:De,correct:Re,total:Ge}=js(st),ze={correct:Re,total:Ge,attempt:ot.current.length+1,previousAttempts:[...ot.current]};if(fn.current===At.current)return ze;fn.current=At.current,jf({items:Of(De),category:fd.has(E)?"sentence":"word",trainingType:E,entryPoint:w??"sentence",itemRef:A??null,correct:Re,total:Ge,score:typeof pe?.score=="number"?pe.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:D??null});try{y?.(ze)}catch{}return ze},[E,w,D,A,st,y]);o.useEffect(()=>{!st||st===Fn||st?.isEmpty||(js(st).total??0)>0&&Ut()},[st,Ut]);const Qt=o.useCallback(()=>{const pe=Ut();jt(),Ue(()=>{typeof g=="function"&&g(pe),typeof m=="function"&&m()})},[g,m,Ut,tt,Ue]),cn=o.useCallback(()=>gt(""),[gt]),bn=o.useCallback(()=>{Ue(()=>{typeof m=="function"&&m()})},[m,Ue]),Ht=n.jsxs("div",{className:`page-popup${vt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":kn,children:[n.jsxs("div",{ref:Ee,className:`page-popup__panel ${_t?"":"page-popup__panel--measuring"} ${Qe==="center"?"page-popup__panel--center":Qe==="top"?"page-popup__panel--top":""}`,children:[n.jsx(td,{title:Jt,subtitle:L?Z.subtitle||Z.label:Array.isArray(s)?s.join(" / "):void 0,desc:L?void 0:r,depth:L?Z.depth:s,icon:L?Z.icon:l,wrapperStyle:L?Z.wrapperStyle:i,iconTooltip:L?Z.iconTooltip:u,progressMax:Ct,progressIndex:Oe,pageIndex:Oe,pageCount:Ct,onBack:bn,onClose:bn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${Qe==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Kt:L?Wt:typeof b=="function"?b({registerOnNext:Le,registerOnResult:at,panelRef:Ee,setResultOverlay:tt}):b})}),n.jsx(ed,{onSettings:f,onNext:un,onResult:Ot,useNoiseSettingBtn:!!(L?Z.useNoiseSetting??!0:_),stepIndex:xt,stepCount:yt,pageIndex:Oe,pageCount:Ct,resultOpen:!!(st&&!st.isEmpty),hideNoiseRows:$})]}),st&&!st.isEmpty&&(k??Gx)({score:st.score,results:st.results||st.answers||[],contextsLength:st.results?st.results.length:st.answers?st.answers.length:0,onReplay:()=>{if(G.current=Date.now(),st!==Fn){const{correct:pe,total:De}=js(st);ot.current.push({correct:pe,total:De})}if(jt(),He(pe=>pe+1),L){if(ut(Rr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){ut(Rr());return}try{const pe=Ee.current&&Ee.current._childOnResult;typeof pe=="function"&&pe({replay:!0})}catch{}},onClose:Qt,pending:st===Fn}),st?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":M("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:M("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(fe,{htmlType:"button",variant:"main",size:48,onClick:Qt,label:M("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ya,{message:Mt,position:"top",onClose:cn})]}),An=n.jsx(bs.Provider,{value:ke,children:Ht});return typeof document<"u"&&document.body?dn.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:le("word-image-tooltip__cell"),children:[s&&n.jsx("div",{className:le("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:le("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:dn.createPortal(n.jsx("div",{ref:a,className:le("word-image-tooltip"),style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:le("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}=_e.useTranslation(),B=b.language?.startsWith("ko")??!1,{anchorRect:v,openAt:N,close:x}=Oa(),[E,w]=o.useState(null),D=o.useCallback(()=>{x(),w(null)},[x]);Wy(D,!!E);const A=(r??"").trim(),k=/^[^,[\]\s]+$/.test(A)?A:"",R=k.length>0,$=r===void 0&&t===void 0,G=R?"match":$?"original":"ganada",[M,P]=o.useState(()=>G),[L,Q]=o.useState("50"),[Z,F]=o.useState(1),[K,T]=o.useState(R);K!==R&&(T(R),P(G));const q=M==="match"&&!R||M==="original"&&!$?G:M,Y=o.useMemo(()=>[...R?[{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"})}],[_,R,$]),U=o.useMemo(()=>["10","25","50","100"].map(ue=>({value:ue,label:_("wordSearch.pageSize",{count:Number(ue),defaultValue:`${ue}\uAC1C\uC529 \uBCF4\uAE30`})})),[_]),S=ue=>ue.words?.[0],I=o.useMemo(()=>{const ue=[...k].length,xe=hf(k),ke=new Map;return Ee=>{let We=ke.get(Ee);return We===void 0&&(We=xe((Ee.words?.[0]?.label??"").slice(0,ue))?0:1,ke.set(Ee,We)),We}},[k]),O=o.useCallback((ue,xe)=>{const ke=He=>S(He)?.label??"",Ee=He=>S(He)?.syllables??[...ke(He)].length,We=He=>(He.words??[]).reduce((ot,Qe)=>{const Je=parseInt(Qe.grade??"",10);return Number.isFinite(Je)&&Je<ot?Je:ot},999);switch(q){case"match":return I(ue)-I(xe)||mn(ke(ue),ke(xe));case"ganada":return mn(ke(ue),ke(xe));case"ganada_desc":return mn(ke(xe),ke(ue));case"syllable":return Ee(ue)-Ee(xe)||mn(ke(ue),ke(xe));case"syllable_desc":return Ee(xe)-Ee(ue)||mn(ke(ue),ke(xe));case"grade":return We(ue)-We(xe)||mn(ke(ue),ke(xe));case"grade_desc":return We(xe)-We(ue)||mn(ke(ue),ke(xe));default:return 0}},[q,I]),z=o.useMemo(()=>s.slice().sort(O),[s,O]),se=Number(L)||10,te=o.useMemo(()=>(l??[]).flatMap(ue=>ue.items.slice().sort(O).map(xe=>({item:xe,label:ue.label}))),[l,O]),de=l?te.length:z.length,ee=Math.max(1,Math.ceil(de/se)),V=Math.min(Z,ee),ne=o.useMemo(()=>z.slice((V-1)*se,V*se),[z,V,se]),W=o.useId(),H=o.useMemo(()=>{if(!l)return null;const ue=te.slice((V-1)*se,V*se),xe=new Map;for(const{item:ke,label:Ee}of ue)xe.has(Ee)||xe.set(Ee,[]),xe.get(Ee).push(ke);return[...xe.entries()].map(([ke,Ee])=>({label:ke,items:Ee}))},[l,te,V,se]);o.useEffect(()=>{F(1)},[M,L,de,r]);const ie=de>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(vn,{size:40,options:Y,value:q,onChange:P,ariaLabel:_("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(vn,{size:40,options:U,value:L,onChange:Q,ariaLabel:_("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(Oo,{page:V,totalPages:ee,onChange:F})]}):void 0,Te=ue=>{u&&u(ue)},ye=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:B?Bf(a):a})]}):void 0,he=t!==void 0&&t>0&&c!==void 0&&a?_("wordSearch.resultDisc",{unit:B?Af(a):a,max:c,selected:i.length}):void 0,Se=f??he,$e=l?l.length===0:s.length===0,Ne=$e&&!y&&!g;return n.jsxs(va,{type:C,className:Be("word-search-result-block",m),children:[n.jsxs("div",{className:Be("word-search-result-block__inner",Ne&&"word-search-result-block__inner--head-only"),children:[(ye||ie||Se)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(nt,{icon:e,className:"word-search-result-block__head-icon"}),ye&&n.jsx("span",{className:"word-search-result-block__title h3",children:ye})]}),ie&&n.jsx("div",{className:"word-search-result-block__head-actions",children:ie}),Se&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:Se})]}),$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?(H??[]).map(ue=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${W}-${ue.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${W}-${ue.label}`,children:ue.label}),n.jsx("div",{className:"word-search-result-block__items",children:ue.items.map(xe=>{const ke=i.includes(xe.id);return n.jsx("div",{onMouseEnter:Ee=>{N(Ee.currentTarget),w(xe.words??[])},onMouseLeave:D,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(xe.words??[]).map(Ee=>Ee.label),subLabel:(xe.words??[]).some(Ee=>Ee.subLabel)?(xe.words??[]).map(Ee=>Ee.subLabel):void 0,selected:ke,onClick:()=>Te(xe.id),minWidth:200})},xe.id)})})]},ue.label)):n.jsx("div",{className:"word-search-result-block__items",children:ne.map(ue=>{const xe=i.includes(ue.id);return n.jsx("div",{onMouseEnter:ke=>{N(ke.currentTarget),w(ue.words??[])},onMouseLeave:D,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(ue.words??[]).map(ke=>ke.label),subLabel:(ue.words??[]).some(ke=>ke.subLabel)?(ue.words??[]).map(ke=>ke.subLabel):void 0,selected:xe,onClick:()=>Te(ue.id),minWidth:200})},ue.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(fe,{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(fe,{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:B,searchChecking:v=!1,pairMode:N=!1,sectionType:x="page",beforeSearchContent:E,beforeContent:w,afterContent:D,hideCountControl:A=!1,ordinal:k=!1}){const{t:R}=_e.useTranslation(),$=o.useMemo(()=>R("wordPairs.infoNotes",{returnObjects:!0}),[R]),G=o.useMemo(()=>Array.from({length:s-l+1},(S,I)=>{const O=l+I;return{key:String(O),label:R("wordPairs.count",{n:O})}}),[R,s,l]),M=o.useMemo(()=>R("wordPairs.ordinals",{returnObjects:!0}),[R]),P=o.useCallback(S=>k?R("wordPairs.phonemeOrdinalLabel",{ordinal:M[S-1]??S}):a===1?R("wordPairs.phonemeSingleLabel","\uC74C\uC808"):R("wordPairs.phonemeN",{n:S}),[k,M,a,R]),L=o.useCallback(S=>k?R("wordPairs.phonemeContrastOrdinalLabel",{ordinal:M[S-1]??S}):a===1?R("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):R("wordPairs.phonemeContrast",{n:S}),[k,M,a,R]),Q=o.useCallback((S,I)=>I?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:Z,toggleAt:F,close:K}=Oa(),T=o.useCallback(S=>r(Number(S)),[r]),q=gn("(max-width: 767px)"),Y=o.useCallback(S=>Xx(S,e).map(({label:I,value:O,displayLabel:z})=>{const se=!!O&&O!=="\uC5C6\uC74C";return n.jsxs("span",{className:Be("phoneme-select-block__cell-jamo-part",O?"":"phoneme-select-block__cell-jamo-part--empty",se?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${O==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:O==="\uC5C6\uC74C"?"x":O||d}),se&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:z??I})]},I)}),[e,d]),U=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:q?"dot":void 0,icon:"info",label:q?void 0:R("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:R("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:Z?"is-selected":void 0,"aria-expanded":!!Z,"aria-haspopup":"dialog",onClick:S=>F(S.currentTarget)})}),Z&&n.jsx(Xn,{title:R("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:Be("phoneme-select-block",h),children:[w,!A&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(yn,{options:G,value:String(a),onChange:T,size:40,ariaLabel:R("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:N?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,I)=>{const O=t[I*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(O)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:P(I+1)})]},I)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:R("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,I)=>{const O=t[I*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(O)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(I+1)})]},I)})})]}):t.map((S,I)=>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(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:P(I+1)})]},I))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:N?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((S,I)=>{const O=t[I*2]??{};return n.jsx(In,{title:Q(P(I+1),I===0),sections:u?u(O,I*2):i,selected:O,onSelect:c?.(I*2),align:"newline"},I)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,I)=>{const O=t[I*2+1]??{};return n.jsx(In,{title:L(I+1),sections:u?u(O,I*2+1):i,selected:O,onSelect:c?.(I*2+1),align:"newline"},I)})})]}):t.map((S,I)=>n.jsx(In,{title:Q(P(I+1),I===0),sections:u?u(S,I):i,selected:S,onSelect:c?.(I),align:"newline"},I))})}),E&&n.jsx("div",{className:"phoneme-select-block__before-search",children:E}),(C||f||v)&&(()=>{const S=t.every(I=>{const O=uf(I);return Object.entries(O).every(([z,se])=>!se||z==="coda"&&se===Rl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:R("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),f?n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:v?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:B??R("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||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:B??R("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}=_e.useTranslation();return n.jsx(In,{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}=_e.useTranslation();return a.length===0?null:n.jsx(In,{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}=_e.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(In,{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:B,topContent:v,className:N=""}=e,{t:x}=_e.useTranslation(),E=u??x("common.search","\uAC80\uC0C9"),w=_??x("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),D=b??x("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[A,k]=o.useState(""),[R,$]=o.useState(d??r[0]?.key??""),[G,M]=o.useState(h),[P,L]=o.useState(String(f??C[0]??10)),[Q,Z]=o.useState(1);o.useEffect(()=>{Z(1)},[A,P]);const F=c!==null,K=o.useCallback((te,de)=>{if(!de)return!0;const ee=de.toLowerCase();return r.some(V=>{const ne=te[V.key];return ne==null?!1:String(ne).toLowerCase().includes(ee)})},[r]),T=c??K,q=o.useMemo(()=>{const te=F?a.filter(de=>T(de,A)):a;return R?[...te].sort((de,ee)=>{const V=de[R],ne=ee[R];return V===ne?0:fr(V,ne,G)}):te},[a,A,R,G,F,T]),Y=Math.max(1,Math.ceil(q.length/Number(P)));Q>Y&&Z(Y);const U=Math.min(Q,Y),S=q.slice((U-1)*Number(P),U*Number(P)),I=o.useCallback(te=>{R===te?M(de=>!de):($(te),M(!0)),Z(1)},[R]),O=o.useMemo(()=>{if(typeof B=="function"){const te=q.length,de=B(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 B=="string"&&B.includes("{n}")){const[te,de]=B.split("{n}");return{prefix:te,suffix:de}}return{prefix:x("common.totalCountPrefix","\uCD1D "),suffix:x("common.totalCountSuffix","\uAC1C")}},[B,q.length,x]),z=o.useMemo(()=>r.map(te=>({label:te.label,onClick:te.sortable!==!1?()=>I(te.key):void 0,className:te.className,sortDir:te.sortable!==!1&&R===te.key?G?"asc":"desc":null})),[r,R,G,I]),se=o.useMemo(()=>C.map(te=>({value:String(te),label:x("common.pageSizeLabel",{n:te})})),[C,x]);return n.jsxs(Rn,{className:`popup-list ${N}`,title:t,onClose:y,children:[v,"label"in O&&n.jsx("p",{className:"toolbar__count body-1",children:O.label}),n.jsx(zo,{count:"label"in O?void 0:{value:q.length,prefix:O.prefix,suffix:O.suffix},search:F?{value:A,onChange:k,placeholder:E}:void 0,pageSize:{options:se,value:P,onChange:L},pagination:{page:U,total:Y,onChange:Z}}),n.jsx(Jo,{size:"medium",gridTemplateColumns:l,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:s,fields:z,items:S,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:Be(ee.className,de&&"popup-list__row--selected")}))},empty:F&&A!==""&&a.length>0?D:w})]})}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:B}=_e.useTranslation(),v=o.useRef(null);o.useEffect(()=>{if(C||b==="close")return;const A=v.current?.closest(".popup-panel"),k=Array.from(A?.querySelectorAll(".popup-footer--buttons button")??[]),R=b==="confirm"?k[k.length-1]:c?void 0:k[d?1:0];R&&!R.disabled&&R.focus()},[]);const N=o.useRef(!1),[x,E]=o.useState(!1),w=A=>{let k=!1;return{close:()=>{k=!0,A()},didClose:()=>k}},D=async A=>{if(N.current)return;N.current=!0;const k=typeof document<"u"?document.activeElement:null;E(!0);let R=!1;try{R=await A()}catch($){typeof console<"u"&&console.error($)}finally{R||(N.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:Be("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||x,onClick:async({closeWithAnimation:A})=>{await D(async()=>{const k=w(A);await d.onClick(k.close);const R=d.closeOnClick??!0;return R&&A(),R||k.didClose()})}}]:[],...c?[]:[{label:u??B("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:x,onClick:({closeWithAnimation:A})=>A()}],{label:i??B("common.confirm","\uD655\uC778"),variant:h,disabled:p||x,onClick:async({closeWithAnimation:A})=>{await D(async()=>{const k=w(A);return await m(k.close),g&&A(),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((A,k)=>n.jsx(sn,{label:A.label,children:n.jsx("span",{className:"panel-row__text body-2",children:A.value})},k))}),n.jsx("p",{ref:v,className:"body-2 confirm-popup__message",children:a}),l]})}function aw(e,t,a={}){const{t:r}=_e.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}=_e.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,B)=>Array.from({length:b}).map((v,N)=>{const x=6+Math.random()*12,E=Math.round(Math.min(18,x*Math.min(1.5,1+r*.4))),w=yd[Math.floor(Math.random()*yd.length)],D=Math.random()*300,A=(360+Math.random()*260)*r*1.2,k=(B==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,R=Math.cos(k)*A,$=Math.sin(k)*A*1.35,G=Math.random()*720-360,M=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),P=Math.random()>.7?"50%":"3px";return{id:`${B}-${N}`,side:B,size:E,color:w,delay:D,vx:R,vy:$,angularVel:G,life:M,borderRadius:P}});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),B=K=>Math.max(40,(K||window.innerWidth)*.02),v=_?.width||window.innerWidth||375,N=_?.height||window.innerHeight||812,x=K=>{const T=[...K].sort((q,Y)=>q-Y);return T[Math.floor(T.length/2)]||1},E=x(i.map(K=>Math.abs(K.vy))),w=x(i.map(K=>Math.abs(K.vx))),D=Math.sqrt(2*C*(N*.72+b))/E,A=E*D/C,k=v*.5/(w*A),R=(K,T,q)=>Math.min(q,Math.max(T,K)),$=R(D,.8,2.4),G=R(k,.7,2.2),M=a>0?a/ow:1,P=i.map(K=>({...K,life:K.life*M,vx:K.vx*G,vy:K.vy*$,startTime:f+K.delay,ended:!1})),L=_?{x:_.left-B(_.width),y:_.top+_.height+b}:{x:-B(window.innerWidth),y:window.innerHeight+b},Q=_?{x:_.left+_.width+B(_.width),y:_.top+_.height+b}:{x:window.innerWidth+B(window.innerWidth),y:window.innerHeight+b},Z=K=>{let T=!1;for(const q of P){const Y=c.current[q.id];if(!Y||!Y)continue;if(K<q.startTime){Y.style.display="none",T=!0;continue}if(!q._inited){const V=q.side==="left"?L.x:Q.x,ne=q.side==="left"?L.y:Q.y;Y.style.left=`${V}px`,Y.style.top=`${ne}px`,Y.style.transform="translate3d(0px, 0px, 0)",Y.style.display="block",Y.style.zIndex="100000",typeof q.color=="string"&&q.color.startsWith("var(")&&(Y.style.background=sw(Y,q.color)??"#FF0060"),q._inited=!0}const U=(K-q.startTime)/1e3;if(U<0)continue;const S=q.life/1e3;if(U>=S){Y.style.opacity="0",Y.style.display="none",q.ended=!0;continue}T=!0;const I=q.side==="left"?L.x:Q.x,O=q.side==="left"?L.y:Q.y,z=I+q.vx*U,se=O+q.vy*U+.5*C*U*U,te=(q.angularVel||0)*U,de=z-I,ee=se-O;Y.style.transform=`translate3d(${de}px, ${ee}px, 0) rotate(${te}deg)`,Y.style.opacity=`${Math.max(0,1-U/S)}`}T?d.current=requestAnimationFrame(Z):h.current?.()};d.current=requestAnimationFrame(Z);const F=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 T of i){const q=document.createElement("span");q.className=`confetti confetti--${T.side}`,q.setAttribute("aria-hidden","true"),q.style.display="none",q.style.position="fixed",q.style.left="0px",q.style.top="0px",q.style.width=`${T.size}px`,q.style.height=`${Math.max(4,T.size*.6)}px`,q.style.background=T.color,q.style.borderRadius=T.borderRadius,q.style.transform="translate3d(0,0,0)",q.style.opacity="0",K.appendChild(q),c.current[T.id]=q}(document.body||m.current).appendChild(K),p.current=K}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(F),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"?dn.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}=_e.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(fe,{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:Be("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}=_e.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 M=p.current;if(!M)return;const P=()=>b(M.scrollWidth>M.clientWidth+1);if(P(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(P);return L.observe(M),()=>L.disconnect()},[C]);const B=e.map(M=>`${M.id}\0${M.section??""}\0${M.group??""}`).join(""),v=C&&C.shape===B?C.pages:null,[N,x]=o.useState(0);o.useEffect(()=>{const M=y.current;if(!M||typeof ResizeObserver>"u")return;const P=new ResizeObserver(()=>x(M.offsetHeight));return P.observe(M),()=>P.disconnect()},[]);const[E,w]=o.useState(0);o.useEffect(()=>{const M=m.current;if(!M||typeof ResizeObserver>"u")return;let P=null;const L=typeof requestAnimationFrame=="function"?F=>requestAnimationFrame(F):F=>setTimeout(F,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:F=>clearTimeout(F),Z=new ResizeObserver(()=>{P==null&&(P=L(()=>{P=null,w(F=>F+1)}))});return Array.from(M.children).forEach(F=>Z.observe(F)),()=>{Z.disconnect(),P!=null&&Q(P)}},[B]),o.useLayoutEffect(()=>{const M=m.current,P=y.current;if(!M||!P)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Q=new Map;g.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Q.set(S.dataset.chromeSection??"",L(S))});const Z=S=>L(P)-(Q.get(S??"")??0),F=Array.from(M.children).map(S=>L(S)),K=[];e.forEach((S,I)=>{const O=K[K.length-1],z=O?e[O[0]]:void 0;z&&S.group!=null&&z.group===S.group&&z.section===S.section?O.push(I):K.push([I])});const T=[];let q=[],Y=0;const U=()=>{q.length&&T.push(q),q=[],Y=0};K.forEach(S=>{const I=S.reduce((z,se)=>z+F[se],0),O=Z(e[S[0]].section);q.length&&e[q[0]].section!==e[S[0]].section&&U(),I>O?S.forEach(z=>{q.length&&Y+F[z]>O+.01&&U(),q.push(z),Y+=F[z]}):(q.length&&Y+I>O+.01&&U(),S.forEach(z=>q.push(z)),Y+=I)}),U(),f(S=>S&&S.shape===B&&JSON.stringify(S.pages)===JSON.stringify(T)?S:{shape:B,pages:T})},[B,N,l,i,u,E]);const D=Lo,A=D,k=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:A,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),R=(M,P,L)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:L!=null&&t?.[L]||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(M,P)})]})}),$=Array.from(new Set(e.map(M=>M.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:Be("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(M=>{const P=R(1,1,M||void 0);return n.jsxs("div",{"data-chrome-section":M,children:[P.header,P.footer]},M)})}),n.jsx("div",{ref:m,className:"report-doc__measure-blocks",children:e.map(M=>n.jsx("div",{children:M.content},M.id))})]}),v&&n.jsx("div",{className:"report-doc__pages",children:v.map((M,P)=>{const{header:L,footer:Q}=R(P+1,v.length,e[M[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,M.map(Z=>n.jsx("div",{children:e[Z].content},e[Z].id)),Q]},P)})})]})}function Cw({title:e,fields:t,columns:a=4,className:r,style:s}){return n.jsxs("div",{className:Be("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 Ir(){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(()=>Ir())),Pr.observe(e)),Ir(),()=>{const t=(oa.get(e)??1)-1;if(t>0){oa.set(e,t),Ir();return}oa.delete(e),Pr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Ir()})}function yw({title:e,message:t,actionLabel:a,onAction:r,icon:s,onClose:l,className:i=""}){const{t:u}=_e.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:Be("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(fe,{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:Be("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}=_e.useTranslation(),_=o.useId(),b=t?`h${t}`:"span",B=s!=null,v=Be("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",B&&"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:[B&&n.jsx(fe,{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:N=>N.stopPropagation(),children:[l,i&&n.jsx(vn,{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:B,onReset:v,resetLabel:N,saveButtonLabel:x,secondarySaveButtonLabel:E,onReorder:w,showCellCount:D,onAddItem:A,className:k,renderSavePopup:R,renderWordSearch:$,hideControls:G,saveOnly:M,tableName:P,nameValue:L,onNameChange:Q,descriptionValue:Z,onDescriptionChange:F,namePlaceholder:K,descriptionPlaceholder:T,existingNames:q,editingName:Y,onCancel:U,initialItemsPerPage:S,renderCellAction:I,actionsLeftExtra:O}){const{t:z}=_e.useTranslation(),se=N??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),te=C===void 0,de=!!Q,[ee,V]=o.useState([]),ne=(L??"").trim(),W=ne||(K??"").trim(),H=(Z??"").trim()||(T??"").trim(),ie=(q??[]).map(ae=>ae.trim().toLowerCase()),Te=[Y?.trim().toLowerCase(),...ee].filter(ae=>!!ae),ye=[...ie];for(const ae of Te){const Ce=ye.indexOf(ae);Ce!==-1&&ye.splice(Ce,1)}const he=ne!==""&&ye.includes(ne.toLowerCase()),[Se,$e]=o.useState(Array(4).fill(null)),[Ne,ue]=o.useState(4),[xe,ke]=o.useState(null),Ee=Se.slice(0,Ne),We=!!d?.show,[He,ot]=o.useState(!0),[Qe,Je]=o.useState(!0),vt=d&&{...d,top:He,bottom:Qe},[je,Ye]=o.useState("landscape"),[we,Ue]=o.useState([...fc]),[qe,pt]=o.useState("show"),[_t,Et]=o.useState(!0),[Bt,st]=o.useState(!0),tt=o.useRef(null),kt=o.useRef([]),[At,jt]=o.useState(S==="all"?Number.POSITIVE_INFINITY:S??8),[Mt,gt]=o.useState("right"),[it,ut]=o.useState(!1),[ct,ve]=o.useState(!1),{toastMessage:Me,toastType:Pe,showWarning:Oe,clearToast:dt}=Ui("warning"),Dt=o.useCallback(()=>ke(null),[ke]);A&&!te&&!D&&!g&&wt("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&&wt("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[yt,xt]=o.useState(()=>Math.max(C?.length??1,1)),Ct=Math.max(g??0,C?.length??0,1),Le=te?Ne:D?Math.max(yt,C?.length??1,1):Ct,{width:at,height:oe}=ea[je],be=!te&&!D,Ie=Math.max(1,Math.min(Ct,y??Ct)),Xe=Math.min(At,Ie),et=be?Xe:Le,rt=Math.ceil((C?.length??0)/Math.max(1,et)),Lt=(C?.length??0)<Ct?Math.floor((C?.length??0)/Math.max(1,et))+1:0,Bn=be?Math.max(1,rt,Lt):0,ln=be?Array.from({length:Bn},(ae,Ce)=>(C??[]).slice(Ce*et,(Ce+1)*et)):null,$t=!!ln&&ln.length>1,Ot=te?Ee.some(ae=>ae!==null&&ae.length>1):(C??[]).some(ae=>(ae.words??[]).length>1),un=P?.trim()||`${Kl(Pa())} ${Ot?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Pt=o.useCallback(()=>$t?kt.current.filter(ae=>ae!==null):tt.current?[tt.current]:[],[$t]),{print:kn,openNewWindow:Jt,downloadHtml:St}=ps({getElements:Pt,paperW:at,paperH:oe,fileName:un,onPopupBlocked:()=>{Oe(z("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=ae=>{ue(ae),$e(Ce=>Ce.length>=ae?Ce:[...Ce,...Array(ae-Ce.length).fill(null)]),ke(null)},Wt=ae=>{$e(Ce=>{const Fe=[...Ce];return Fe[ae]=null,Fe}),xe===ae&&ke(null)},Kt=ae=>{if(xe===null)return;const Ce=xe;$e(lt=>{const ht=[...lt];return ht[Ce]=ae.length>0?ae:null,ht});const Fe=Ee.findIndex((lt,ht)=>ht>Ce&<===null);ke(Fe!==-1?Fe:null)},fn=te?Ee.some(ae=>ae?.some(Ce=>!!Ce.colloquialPronunciation)):(C??[]).some(ae=>(ae.words??[]).some(Ce=>!!Ce.colloquialLabel)),Ut=!te&&bc([...p?[p]:[],...C??[]]),Qt=o.useMemo(()=>ua()?te?Se.slice(0,Ne).flatMap(ae=>(ae??[]).map(Ce=>[Ce.word,Ce.homonum])):(ae=>ae.flatMap(Ce=>(Ce.words??[]).map(Fe=>[Fe.label,Fe.homonum])))([...p?[p]:[],...C??[]]):[],[te,Se,Ne,C,p]),[cn,bn]=o.useState(!1);o.useEffect(()=>{if(Qt.length===0)return;let ae=!1;return Promise.all(Qt.map(([Ce,Fe])=>Tl(Ce,Fe))).then(Ce=>{ae||bn(Ce.some(Boolean))},()=>{}),()=>{ae=!0}},[Qt]);const Ht=Qt.length>0&&cn,An=o.useMemo(()=>[...te||D?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:V4.map(ae=>({value:`${ae}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ae})})),display:"segmented"}]:[],...be&&(C?.length??0)>0?[kc(z,{hasPairs:Ot,itemCount:Ct,max:y})]:[],...$t?[U4(z)]:[]],[z,te,D,be,C?.length,Ot,Ct,y,$t]),pe={...te||D?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Le}\uCE78`}:{},...be&&(C?.length??0)>0?{[z(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${Xe}\uAC1C`}:{},...$t?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:Mt}:{}},De=(ae,Ce)=>{Ce===z("wordTable.filter.columns","\uCE78 \uC218")?te?Rt(parseInt(ae)):xt(parseInt(ae)):Ce===z(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?jt(Ac(parseInt(ae),Ct)):Ce===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&>(Nc(ae))},Re=te?kw(Ee.filter(ae=>ae!==null&&ae.length>0).map(ae=>({id:Ls(ae),words:ae.map(_d)}))):C??[],Ge=()=>{te&&$e(ae=>ae.length>Ne?ae.slice(0,Ne):ae)},ze=(ae=!1)=>{if(ve(ae),de&&f){const Ce=W.trim().toLowerCase();Ce&&V(Fe=>Fe.includes(Ce)?Fe:[...Fe,Ce]),f(W,Re,H||void 0,ae),Ge();return}if(M&&f){f("",Re,void 0,ae),Ge();return}if(f){ut(!0);return}St()},[X,ce]=o.useState(!1),[Ae,Ve]=o.useState(""),Ke=Ae.trim(),Ze=Ke!==""&&ie.includes(Ke.toLowerCase()),ft=()=>{Ve(W?z("wordTable.save.copyName",{name:W,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),ce(!0)},bt=()=>{!Ke||Ze||!f||(f(Ke,Re,H||void 0,!0),Ge(),ce(!1))},ge=Re.length===0,j=ge||de&&(W===""||he),J=()=>{if(ge){Oe(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(de&&W===""){Oe(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}de&&he&&Oe(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},me=n.jsx(_a,{items:Re,orientation:je,contentTypes:we,baseItem:p,baseContentTypes:m,cutLine:qe,showOutline:_t,showDivLine:Bt,count:Le});return n.jsxs(n.Fragment,{children:[n.jsxs(va,{type:"page",icon:t,title:e,disc:a,className:Be("word-table-block",k),children:[X&&n.jsx(Rn,{size:"small",title:E??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>ce(!1),footer:({closeWithAnimation:ae})=>n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ae}),n.jsx(fe,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Ke||Ze,onClick:bt})]}),children:n.jsx(qn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:Ae,onChange:Ve,placeholder:z("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:bt,error:Ze?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),it&&f&&R?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:me,previewW:at,previewH:oe,items:Re,existingNames:Bw().map(ae=>ae.name),saveAsNew:ct,onSave:(ae,Ce)=>{f(ae,Re,Ce,ct),Ge(),ut(!1)},onCancel:()=>ut(!1)}),(te||A)&&xe!==null&&$?.({cellIndex:xe,onConfirm:te?Kt:ae=>{if(A){const Ce=ae[0];if(Ce){const Fe=new Set((C??[]).map(ht=>ht.id));let lt=Ls([Ce]);for(let ht=2;Fe.has(lt);ht++)lt=`${Ls([Ce])}~${ht}`;A({id:lt,words:[_d(Ce)]})}}ke(null)},onClose:Dt}),!G&&n.jsx(is,{title:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:Ht,hasColloquial:fn,hasCaption:Ut,contentTypes:we,orientation:je,showOutline:_t,cutLine:qe,showDivLine:Bt,setters:{setContentTypes:Ue,setOrientation:Ye,setShowOutline:Et,setCutLine:pt,setShowDivLine:st,setShowTopInfo:ot,setShowBottomInfo:Je},showCutLine:(be?et:Le)>1,showDivLine2:Ot,middleSections:An,extraSelected:pe,onExtraSelect:De,showPaperBands:We,showTopInfo:He,showBottomInfo:Qe}),$t&&ln?n.jsx("div",{className:"word-table-block__pages",children:ln.map((ae,Ce)=>n.jsx(_a,{orientation:je,contentTypes:we,cutLine:qe,showOutline:_t,showDivLine:Bt,count:et,items:ae,baseItem:p,baseContentTypes:m,onRemoveItem:b,onCopyItem:B,onReorder:w&&((Fe,lt)=>w(Fe+Ce*et,lt+Ce*et)),indexOffset:Ce*et,totalCount:C?.length??0,renderCellAction:I&&((Fe,lt)=>I(Fe+Ce*et,lt)),showFillerAdd:!!A,onActivateCell:A?(Fe=>ke(Fe+Ce*et)):void 0,addableCount:Math.max(0,Math.min(et,Ct-Ce*et)),brand:vt,code:h,contentRef:Fe=>{kt.current[Ce]=Fe},pageNumber:{current:Ce+1,total:ln.length},pageNumberPosition:Mt},Ce))}):n.jsx(_a,{orientation:je,contentTypes:we,cutLine:qe,showOutline:_t,showDivLine:Bt,count:Le,items:te?void 0:C??[],baseItem:te?void 0:p,baseContentTypes:m,editCells:te?Ee:void 0,activeCell:xe,onActivateCell:te||A?ke:void 0,onRemoveCell:te?Wt:void 0,onRemoveItem:te?void 0:b,onCopyItem:te?void 0:B,onReorder:te?void 0:w,renderCellAction:te?void 0:I,brand:vt,code:h,showFillerAdd:!!A,contentRef:tt}),!G&&!M&&O!=null&&n.jsx("div",{className:"word-table-block__table-actions",children:O}),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:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(qn,{required:!0,value:L??"",onChange:Q,placeholder:K?K+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:he?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(L??"").trim()&&(K??"").trim()&&(ae.preventDefault(),Q?.(K??""))}})}),n.jsx(sn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(qn,{value:Z??"",onChange:F,placeholder:T?T+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(Z??"").trim()&&(T??"").trim()&&(ae.preventDefault(),F?.(T??""))}})})]})]}),!G&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!M&&_&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:_}),!M&&v&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:se,onClick:v}),!M&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Jt})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[U&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:U}),!M&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:kn}),E&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:E,onClick:()=>de?ft():ze(!0),disabled:ge,onDisabledClick:()=>{Oe(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:x??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>ze(!1),disabled:j,onDisabledClick:J})]})]}),n.jsx(ya,{message:Me,type:Pe,onClose:dt})]})}const Nw=8;function xd({items:e,className:t}){const{t:a}=_e.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:Be("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:B}){const{t:v}=_e.useTranslation(),N=b!=null,x=h!=null||p!=null||m!=null||g!=null,E=w=>{w.target===w.currentTarget&&!N&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),f?.())};return n.jsxs("div",{className:Be("word-table-button",C?"word-table-button--selected":"",x?"":"word-table-button--no-footer",B),role:"button",tabIndex:0,"aria-label":s?`${t} (${s})`:t,onClick:N?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})]}),_&&!N&&n.jsx(fe,{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:w=>{w.stopPropagation(),_(w)}})]}),(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:w=>{w.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}`})})]})]})]})}/**
|
|
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}=_e.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,B=v=>{v.matches&&m(!1)};return b&&(b.matches&&m(!1),b.addEventListener?.("change",B)),()=>{_(),b?.removeEventListener?.("change",B)}},[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(B=>{const v=setTimeout(()=>{r.current===v&&(r.current=null),B(!!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 w=d.current;if(w){d.current=null;try{E.pause()}catch{}E.src=w,E.load()}if(!E.src)return;m.current+=1,C();try{ao(),sr(E).then(R=>{if(l.current===E)try{s.current?.("noise",R)}catch{}})}catch{}const D=E.paused?0:lr(E);E.paused&&Hn(E,0),E.play().catch(()=>{});const N=performance.now(),k=()=>{const R=Math.min(1,(performance.now()-N)/x);try{Hn(E,D+(A-D)*R)}catch{}R<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 w=++m.current;C();const D=performance.now(),N=lr(E),k=()=>{const R=Math.min(1,(performance.now()-D)/A);try{Hn(E,N*(1-R))}catch{}if(R<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===w){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,B=!!e?.settings.enabled&&b>0;o.useEffect(()=>{if(!B)return;let A=0;const x=setInterval(()=>{const E=l.current;if(!E||E.paused){A=0;return}const w=t.current;if(w&&!w.paused&&!w.ended||y()||a.current==="playing"){A=0;return}A+=1,A>=2&&(A=0,_())},400);return()=>clearInterval(x)},[_,B,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,w=!!E&&!E.paused&&!E.ended||y()||a.current==="playing",D=h.current;w&&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 w=R_(A.type);w&&(c.current=A.type,u(w),d.current=w,_(150,()=>{if(d.current!==w)return;d.current=null,x.src=w,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 R=t.current,$=h.current;(R&&!R.paused&&!R.ended||y())&&$?.enabled&&$.volume>0&&f($.volume)},k=()=>x.removeEventListener("canplay",N);v.current=k,x.addEventListener("canplay",N)}}))}else{const w=t.current,D=!!w&&!w.paused&&!w.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(),R=()=>{const $=Math.min(1,(performance.now()-k)/150);try{Hn(x,N+(E-N)*$)}catch{}$<1?p.current=requestAnimationFrame(R):p.current=null};p.current=requestAnimationFrame(R)}}},[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}},B=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 w=A??e,D=Array.isArray(w)?w.filter(M=>!!M):[w||""];D.length===0&&D.push("");const N=Math.max(.3,Math.min(3,t));y.current=D.reduce((M,P)=>M+b(P,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 R=()=>{try{const M=g.current||performance.now(),P=performance.now()-M,L=y.current||1200,Q=Math.min(1,P/L);try{r.current&&(r.current.style.left=`${Q*100}%`),s.current&&s.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(R))}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=M=>{const P=new SpeechSynthesisUtterance(D[M]);try{P.rate=N}catch{}try{P.volume=Math.max(0,Math.min(1,a))}catch{}P.onend=()=>{if(E===f.current){if(M<D.length-1){try{G(M+1)}catch{$()}return}$()}},P.onerror=()=>{$()},P.onstart=()=>{if(!(M>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(R)}catch{}},_.current=!0,x.speak(P)};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:B,stopTTS:v}}const F_=.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])<=F_;)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 B=Math.abs(u[b]);B>_&&(_=B)}return _})}catch{return null}finally{try{s?.close?.()}catch{}}}async function Ic(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),Fc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Oc({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Fc(t),s=Fc(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),[B,v]=o.useState(!1),[A,x]=o.useState(null),[E,w]=o.useState(2),[D,N]=o.useState(0),[k,R]=o.useState(null),[$,G]=o.useState(!1),[M,P]=o.useState(!1),L=3,Q=3,Z=1,F=300,K=o.useRef(0),T=o.useCallback(()=>{const ye=C.current,he=f&&f.current?f.current:ye?ye.closest(".audio-player__wave"):null,Se=he?he.getBoundingClientRect():ye?ye.getBoundingClientRect():null,$e=Se?Se.width:0,Ne=Se?Math.max(100,Se.width):320,ue=Se?Se.height:0,xe=Math.max(Z,Math.min(F,Math.floor((Ne+Q)/(L+Q)))),ke=xe*L,Ee=Math.max(0,xe-1),We=Math.max(0,Ee>0?(Ne-ke)/Ee:Q);return{bars:xe,gap:We,height:ue,width:$e}},[]),q=o.useRef(void 0),Y=o.useRef(null),U=o.useCallback(async(ye,he,{quiet:Se=!1}={})=>{const $e=++K.current,Ne=()=>K.current===$e;try{if(Se||v(!1),q.current=ye,!ye){Ne()&&b(null);return}let ue=he;if(!ue)try{for(let Ee=0;Ee<4&&!(C.current||f.current);Ee++)await new Promise(We=>requestAnimationFrame(We));await new Promise(Ee=>requestAnimationFrame(Ee));const ke=T();ke.height>0&&N(ke.height),ue=ke.bars,w(ke.gap)}catch{ue=120}Y.current=ue;const xe=await Ic(ye,ue);if(!Ne())return;if(!xe){b(null),v(!1);return}b(xe),x(ue),v(!0)}catch{if(!Ne())return;b(null),v(!1)}},[v,b,N,w,x,T]);o.useEffect(()=>{const ye=f.current;if(!ye||typeof ResizeObserver>"u")return;let he=null;const Se=new ResizeObserver(()=>{he!==null&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;try{const $e=T();if($e.width<=0||($e.height>0&&N($e.height),Y.current===null||$e.bars===Y.current))return;const Ne=q.current;w($e.gap),Ne?U(Ne,$e.bars,{quiet:!0}).catch(()=>{}):Y.current=$e.bars}catch{}})});return Se.observe(ye),()=>{Se.disconnect(),he!==null&&cancelAnimationFrame(he)}},[T,U]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;U(typeof ye=="string"?ye:void 0).catch(()=>{}),P(!1)},[t,a,U]),o.useEffect(()=>{let ye=!1;if(G(!1),R(null),!l||!A)return;const he=c>0?c*(u||1):void 0;return Ic(l,A,he,!0).then(Se=>{ye||(R(Se),Se||G(!0))}).catch(()=>{ye||(R(null),G(!0))}),()=>{ye=!0}},[l,A,c,u]);const S=Math.max(0,Math.min(1,d)),I=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),O=A||40,z=o.useMemo(()=>Y_({bars:O,trackDurationSec:y,leadInMs:m,tailMs:g}),[O,y,m,g]),se=o.useMemo(()=>Array.from({length:O}).map((ye,he)=>{const Se=he>=z.lead&&he<z.lead+z.sound,$e=z.sound>0&&Se?Math.min(O-1,Math.round((he-z.lead)/z.sound*O)):-1,Ne=Se?_&&_[$e]!=null?_[$e]:null:_?0:null,ue=Ne==null?null:Math.min(1,Ne/I*S),xe=ue!=null&&D>0&&Er(ue)<=Hc,ke=ue==null?.15:xe?0:Dr(ue),Ee=xe,We=O>1?he/(O-1):0;return n.jsx("div",{className:Ee?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":ke,"--i":he,"--mix":We}},he)}),[O,_,I,S,D,z]),te={"--progress":String(Math.max(0,Math.min(1,r)))},de=o.useMemo(()=>k&&k.length&&Math.max(...k.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[k]),ee=S*Math.max(0,i),V=!l||!k||!k.length?1:Math.max(1,ee),ne={"--bar-gap":`${E}px`,"--wave-h":`${Er(V)}px`,"--wave-h1":`${ys}px`},W=B&&(l?!!k||$:!0);o.useEffect(()=>{W&&P(!0)},[W]);const H=M?B:W;o.useEffect(()=>{h?.(H)},[H,h]);const ie=A||40,Te=o.useMemo(()=>Array.from({length:ie}).map((ye,he)=>{const Se=k&&k[he]!=null?k[he]:null,$e=Se==null?0:Math.abs(Se)/de*ee,Ne=Math.max(nx,Dr($e)),ue=ie>1?he/(ie-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":Ne,"--i":he,"--mix":ue}},he)}),[ie,k,de,ee,D]);return n.jsxs("div",{className:"audio-player__wave",ref:f,style:ne,children:[l&&n.jsx("div",{className:`audio-player__wave-noise ${W?"is-ready":""}`,"aria-hidden":"true",children:Te}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${H?"is-ready":""}`,ref:C,children:se}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${H?"is-ready":""}`,ref:s,style:te,children:se})]})]})}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 B=null;try{B=typeof document<"u"?document.visibilityState:null}catch{}xt(`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).`,B==="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,B=b?0:ix(f),v=t.current,A=(i||0)>0||(u||0)>0,x=A&&(l?.positionRef.current?.phase??"sound")!=="sound";if(B===null&&!x)try{v&&v.style.visibility!=="hidden"&&(v.style.visibility="hidden")}catch{}else{const E=b?_.duration:B||0;On&&x&&!(E>0)&&xt("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 w=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:B??0});try{v&&(v.style.visibility&&(v.style.visibility=""),v.style.left=`${w*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(w))}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}=_e.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(),B=o.useRef(null),v=o.useRef(!1),A=o.useRef(null),{ref:x,rect:E,show:w,hide:D}=lx();o.useEffect(()=>()=>{y.current?.("main",null),y.current?.("noise",null)},[]);const[N,k]=o.useState(!1),[R,$]=o.useState("idle"),[G,M]=o.useState("stopped"),P=o.useRef("stopped");o.useEffect(()=>{P.current=G},[G]);const[L,Q]=o.useState(0),[Z,F]=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[T,q]=o.useState(null),[Y,U]=o.useState(null),[S,I]=o.useState(0),[O,z]=o.useState(!1),[se,te]=o.useState(0),de=g?.playbackRate??1,ee=g?.mainVolume??1,V=g?Cs(g.settings):0,ne=g?Rc(g.settings):ee,[W,H]=o.useState("idle"),[ie,Te]=o.useState(""),[ye]=o.useState("top"),he=o.useRef(null),Se=o.useRef(0),$e=o.useRef(null),Ne=o.useRef(!0),ue=S_({mountedRef:Ne}),xe=o.useRef(null),ke=o.useRef(d),Ee=o.useRef(h);o.useEffect(()=>{ke.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Ee.current=Math.max(0,h||0)},[h]);const{start:We,stop:He,settleTo:ot}=dx({audioRef:C,fillRef:f,waveProgressRef:$e,sourcesRef:he,currentIndexRef:Se,sequencer:ue,leadInMs:d,tailMs:h}),{onReadyChange:Qe,waitForReady:Je,markNotReady:vt}=ox({showSoundWaveForm:u,showNoiseWaveForm:c}),je=o.useRef(null),Ye=o.useRef(s),we=o.useRef(r),Ue=o.useRef(null),qe=o.useRef(!1),[pt,_t]=o.useState(!1),Et=o.useCallback(X=>{qe.current=X,_t(X)},[]),Bt=o.useRef(null),{activeNoiseUrl:st,noiseSettingsRef:tt,fadeInNoise:kt,fadeOutNoise:At}=P_({noisePlayer:g,audioRef:C,playbackStateRef:P,sequencer:ue}),{startTTS:jt,stopTTS:Mt}=I_({ttsText:l,playbackRate:de,mainVolume:ne,fillRef:f,waveProgressRef:$e,setProgress:Q,setPlaybackState:M,setStateLocal:F,fadeInNoise:kt,fadeOutNoise:At,noiseSettingsRef:tt,onDoneRef:we,handleEndRef:Bt});o.useEffect(()=>{Pe.current=Mt});const gt=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Te(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}jt(X);return}yt("tts"),jt(X)},it=Array.isArray(t)?t.filter(Boolean):t?[t]:[],ut=(!it||it.length===0)&&!!l,ct=Array.isArray(T)&&T.length>0?T:Array.isArray(Y)&&Y.length>0?Y:null,ve=Math.max(Array.isArray(ct)?ct.length:0,it.length);o.useEffect(()=>(Ne.current=!0,()=>{Ne.current=!1}),[]);const Me=()=>{ue.abort()},Pe=o.useRef(null),Oe=o.useRef(null),dt=o.useRef(null),Dt=o.useRef(null);Dt.current||(Dt.current=()=>{dt.current=null;const X=C.current;if(Oe.current==="audio"&&X&&(!X.paused||ue.isRunning())){Me();try{X.pause()}catch{}Ne.current&&(M("paused"),He(),At())}else if(Oe.current==="tts")try{Pe.current?.()}catch{}});const yt=X=>{Oe.current=X,dt.current=Ga(Dt.current)},wt=()=>{dt.current?.(),dt.current=null};o.useEffect(()=>()=>{Dt.current&&yr(Dt.current)},[]);const Ct=o.useRef(de);o.useEffect(()=>{Ct.current=de||1},[de]);const Le=o.useCallback(X=>{const ce=Ct.current||1;try{X.defaultPlaybackRate=ce}catch{}try{X.playbackRate=ce}catch{}},[]),at=o.useCallback((X,ce)=>{if(!tx(X,ce)){try{X.currentTime=0}catch{}Le(X);return}X.src=ce,Le(X),X.load(),Le(X)},[Le]),oe=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),H("idle")},[]),be=o.useCallback(async(X,ce=3,Ae=50,Ve=0)=>{oe();const Ke=ue.generation(),Ze=!!X&&X.currentTime>0&&!X.ended,ft=Math.max(0,ke.current-Math.max(0,Ve));if(ft>0&&!Ze){yt("audio"),We(),M("playing");const bt=tt.current;if(bt?.enabled&&(bt.volume??0)>0)try{kt(bt.volume)}catch{}if(!await ue.waitPad(ft,"lead",Ve)||!Ne.current||!ue.isCurrent(Ke))return!1}ue.enterSound();for(let bt=0;bt<ce;bt++){if(!Ne.current||!ue.isCurrent(Ke))return!1;try{return yt("audio"),await X.play(),!0}catch(ge){if((ge instanceof Error||typeof ge=="object"&&ge&&"name"in ge?ge.name:void 0)==="AbortError"){if(!ue.isCurrent(Ke))return!1;await new Promise(j=>setTimeout(j,Ae));continue}try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,We,ue,kt,tt,oe]),Ie=o.useCallback(X=>{const ce=ue.generation(),Ae=Math.max(0,Ee.current-Math.max(0,X));We();const Ve=tt.current;if(Ve?.enabled&&(Ve.volume??0)>0)try{kt(Ve.volume)}catch{}const Ke=()=>{try{xe.current?.()}catch{}};if(Ae<=0){ue.leave(),Ke();return}ue.waitPad(Ae,"tail",X).then(Ze=>{ue.leave(),Ze&&ue.isCurrent(ce)&&Ke()}).catch(()=>{})},[ue,We,kt,tt]),Xe=o.useCallback(()=>{const X=C.current;if(!X)return;const ce=()=>{M("playing"),F("playMode"),z(!0),We();try{ao(),sr(X).then(Ze=>{if(Ne.current)try{y.current?.("main",Ze)}catch{}})}catch{}const Ke=tt.current;Ke?.enabled&&(Ke?.volume??0)>0&&kt(Ke.volume)},Ae=()=>{X_({ended:!!X?.ended,completedByEnd:qe.current})||(M("paused"),He(),At())},Ve=()=>{const Ke=()=>{try{const Ze=he.current,ft=Z_(Ze,Se.current);if(ft!==null){Se.current=ft,I(ft),z(!0);const bt=Ze?.[ft]&&Ze[ft].src;if(bt&&X){at(X,bt),be(X).catch(()=>{});return}}}catch{}M("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}He(),z(!1),At();try{!Ye.current&&Bt.current&&Bt.current()}catch{}};if(xe.current=Ke,Ee.current>0){We(),ue.waitPad(Ee.current,"tail").then(Ze=>{ue.leave(),Ze&&Ke()}).catch(()=>{});return}Ke()};return X.addEventListener("play",ce),X.addEventListener("pause",Ae),X.addEventListener("ended",Ve),()=>{try{X.removeEventListener("play",ce),X.removeEventListener("pause",Ae),X.removeEventListener("ended",Ve),He()}catch{}}},[kt,At,be,tt,We,He,ue]);o.useEffect(()=>Xe(),[Xe]),o.useEffect(()=>{Ye.current=s},[s]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(s||Z!=="active")return;const X=A.current;if(!X)return;let ce=null;const Ae=requestAnimationFrame(()=>{try{const Ve=X.getTotalLength();if(!Ve)return;const Ke=Ve*.2;X.style.strokeDasharray=`${Ve-Ke} ${Ke}`;const Ze="triFlow_"+Math.random().toString(36).slice(2);ce=document.createElement("style"),ce.textContent=`@keyframes ${Ze}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${Ve}}}`,document.head.appendChild(ce),X.style.animation=`${Ze} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(Ae),ce?.remove()}},[Z,s]),o.useEffect(()=>{he.current=T},[T]),o.useEffect(()=>{Se.current=S},[S]),o.useEffect(()=>{const X=_.current,ce=B.current;if(!X||!ce)return;let Ae=null;const Ve=32,Ke=60,Ze=()=>{try{const bt=Array.from(X.querySelectorAll(":scope > .button"));let ge=0;bt.forEach(Ce=>{if(Ce===ce)return;const Fe=Ce.getBoundingClientRect();ge+=Fe.width});const j=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(j-ge-8)),me=ve;if(!me||J<=0){Array.from(ce.children).forEach(Ce=>{try{Ce.style.width=""}catch{}});return}let ae=Math.floor(J/me);ae>Ke&&(ae=Ke),ae<Ve&&(ae=Math.max(Ve,Math.floor(J/me))),Array.from(ce.querySelectorAll(".button")).forEach(Ce=>{try{Ce.style.width=`${ae}px`}catch{}})}catch{}},ft=requestAnimationFrame(Ze);try{Ae=new ResizeObserver(()=>{requestAnimationFrame(Ze)}),Ae.observe(X),Ae.observe(ce),window.addEventListener("resize",Ze)}catch{}return()=>{try{cancelAnimationFrame(ft)}catch{}try{Ae&&(Ae.disconnect(),Ae=null)}catch{}try{window.removeEventListener("resize",Ze)}catch{}}},[T,Y,ve]),o.useEffect(()=>()=>{try{je.current&&(clearTimeout(je.current),je.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const et=(X,ce)=>{q(X),te(ce),vt(),U(J_(X)),he.current=X},rt=()=>{F("playMode"),I(0),z(!0)},Lt=async(X,ce)=>{Et(!1),v.current=!1,at(X,ce),await qc(X),await Je()!==!1&&(k(!1),rt(),await be(X))},Bn=async(X,ce=!1)=>{const Ae=C.current;k(!0),$("measuring_duration");try{const Ve=await vs(X,{timeoutMs:1e4,rejectOnError:!0});et([{src:X,objectUrl:null,duration:Ve}],Ve),$("ready"),ce&&Ae&&await Lt(Ae,X)}finally{v.current=!1,k(!1)}},ln=async(X,ce=!1)=>{const Ae=C.current;k(!0),$("measuring_duration");try{const Ve=await Promise.all(X.map(Ze=>vs(Ze,{timeoutMs:1e4})));if(!Ne.current)return;const Ke=X.map((Ze,ft)=>({src:Ze,objectUrl:null,duration:Ve[ft]||0}));et(Ke,Q_(Ke)),$("ready"),ce&&Ae&&Ke.length>0&&await Lt(Ae,Ke[0].src)}finally{v.current=!1,k(!1)}},$t=async(X=!1,ce=!0)=>{const Ae=C.current,Ve=t?Array.isArray(t)?t:[t]:[];if(!Ve||Ve.length===0||!Ve.some(Boolean))return!1;if(v.current)return null;v.current=!0,ce&&k(!0),$("resolving");try{const Ke=ex(t,a,Bl),Ze=[];let ft=0;for(const bt of Ke){let ge=bt.src??null,j=null;if(!ge&&bt.resolvedPath){try{$("getting_signed_url"),ge=await kl(bt.resolvedPath)}catch{ge=null}if(!Ne.current)return!1;if(!ge)try{$("downloading");const me=await Al(bt.resolvedPath);if(!Ne.current)return!1;if(me){const ae=me instanceof Blob?me:new Blob([me]);j=b.track(URL.createObjectURL(ae)),ge=j}}catch{$("error");try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),F("active")}catch{}}}if(!ge)continue;let J=0;try{$("measuring_duration"),J=await vs(ge,{timeoutMs:3e3})}catch{J=0}if(!Ne.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const me of Ze)if(me.objectUrl)try{URL.revokeObjectURL(me.objectUrl)}catch{}return!1}ft+=J||0,Ze.push({...bt,src:ge,objectUrl:j,duration:J})}if(et(Ze,ft),Ze.length>0&&X&&Ae){const bt=Ze[0];Et(!1);try{b.keepOnly(Ze.map(ge=>ge.objectUrl))}catch{}if($("ready"),v.current=!1,bt.src&&Ae)try{if(at(Ae,bt.src),await qc(Ae),await Je()===!1)return!1;ce&&k(!1),rt(),Ae&&await be(Ae)}catch{ce&&k(!1)}else ce&&k(!1);F("playMode"),I(0),z(!0)}return Ze.length>0}finally{v.current=!1,ce&&k(!1),$(Ke=>Ke==="ready"?"ready":"idle")}},Ot=async X=>{const ce=ue.isRunning();if(X.paused&&!ce){if(qe.current){await Pt();return}const Ae=ue.resume();if(Ae){if(M("playing"),Ae.phase==="tail"){Ie(Ae.elapsed);return}await be(X,3,50,Ae.elapsed);return}await be(X),M("playing")}else ue.pause(),Me(),X.pause(),M("paused"),ce&&(He(),At())},un=async()=>{const X=C.current;if(!(!X&&!ut)){if(ut){const ce=window.speechSynthesis;if(Z==="active"){const Ae=Sa(),Ve=Array.isArray(l)?l.filter(Boolean):l?[l]:[];if(Ae&&Ve.length>0){if(v.current)return;F("load"),k(!0),$("synthesizing"),v.current=!0;try{const Ke=await Promise.all(Ve.map(Ze=>Promise.resolve(Ae(Ze))));Ke.length>1?await ln(Ke,!0):await Bn(Ke[0],!0)}catch{v.current=!1,k(!1),F("active"),gt(Ve.length>0?Ve:void 0)}return}gt(Ve.length>0?Ve:void 0);return}if(Z==="playMode"){const Ae=!!ce&&(ce.speaking||ce.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!Ae){await Ot(X);return}try{if(ce&&ce.paused)try{yt("tts"),ce.resume(),M("playing")}catch{}else try{ce.pause(),M("paused")}catch{}}catch{}}return}if(Z==="active"){if(s&&Array.isArray(he.current)&&he.current.length>0){const Ae=he.current[0];try{if(Ae.src&&X)try{at(X,Ae.src),rt(),X&&await be(X)}catch{}rt();return}catch{}}F("load");let ce;try{ce=await $t(!0)}catch{ce=!1}if(ce===!1&&Ne.current){try{Te(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}F("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 fn(0);return}Et(!1);try{X.currentTime=0}catch{}X&&await be(X),M("playing"),F("playMode")}catch{}},kn=()=>{Me(),wt(),Pe.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}At(),M("stopped"),F("active"),Q(0),z(!1)},Jt=async(X,{sameSegment:ce=!1}={})=>{Me();const Ae=ue.generation(),Ve=C.current,Ke=he.current?.[X]?.src;try{if(Et(!1),I(X),z(!0),Se.current=X,!Ke||!Ve||(ce||vt(),at(Ve,Ke),!ce&&await Je()===!1)||!ue.isCurrent(Ae)||(await be(Ve),!ue.isCurrent(Ae)))return;M("playing"),F("playMode")}catch{}},St=async()=>{const X=he.current,ce=Se.current||0;if(!X||ce<=0){await Pt();return}await Jt(ce-1)},Rt=async()=>{const X=he.current,ce=Se.current||0;if(!X||ce>=X.length-1){kn();return}await Jt(ce+1)},Wt=()=>{if(qe.current)return;const X=200,ce=340;Et(!0),Me(),wt();try{Q(1)}catch{}ot(1);try{H("hold")}catch{}try{const Ae=C.current,Ve=ut&&!!Ae?.src;if(!ut||Ve){if(Ae){Ae.pause();try{Ae.currentTime=0}catch{}}}else Mt();At()}catch{}try{M("stopped")}catch{}if(z(!1),!Ye.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{H("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{H("idle")}catch{}Ue.current=null},ce)},X)}catch{}};o.useEffect(()=>{Bt.current=Wt});const Kt=o.useCallback(()=>Te(""),[]),fn=async X=>{(he.current||[])[X]&&await Jt(X,{sameSegment:X===Se.current})},Ut=G==="playing",Qt=o.useMemo(()=>{if(!Y||Y.length<=1)return Y;const X=Y[S];return X?[X]:Y},[Y,S]),cn=s===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Le(X)}catch{}},[de,Le]);const bn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ce=Math.max(0,Math.min(1,ne)),Ae=bn.current,Ve=()=>{Ae.raf!==null&&(cancelAnimationFrame(Ae.raf),Ae.raf=null),Ae.timer!==null&&(clearTimeout(Ae.timer),Ae.timer=null)};Ve();const Ke=lr(X);if(X.paused||Math.abs(Ke-ce)<.001||typeof requestAnimationFrame!="function"){try{Hn(X,ce)}catch{}return}const Ze=performance.now(),ft=()=>{const bt=Math.min(1,(performance.now()-Ze)/150);try{Hn(X,Ke+(ce-Ke)*bt)}catch{}Ae.raf=bt<1?requestAnimationFrame(ft):null};return Ae.raf=requestAnimationFrame(ft),Ae.timer=setTimeout(()=>{Ve();try{Hn(X,ce)}catch{}},200),Ve},[ne]);const Ht=W==="hold",An=W==="out",pe=Z==="playMode"&&!N&&!pt||Ht||An,De=G!=="stopped"||Ht||An,Re=G==="paused",Ge=Math.max(0,Math.min(100,(L||0)*100)),ze=Be("audio-player__fill",pe?"is-visible":"",De?"is-expanded":"",Re?"is-paused":"",An?"is-out":"");return n.jsxs("div",{className:`audio-player ${cn?"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[R]?"status":void 0,"aria-live":Vc[R]?"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:cn,onClick:()=>{K.current=_r(),D(),un()},"aria-label":typeof m=="string"?m:p("training.listen","\uB4E3\uAE30"),onMouseEnter:w,onMouseLeave:D,onFocus:w,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(fe,{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(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:Ut?"pause":"play",onClick:un,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":Ut,width:"60px",variant:"transparent-white",disabled:Z!=="playMode"}),n.jsx(fe,{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"}),ve>1?n.jsx("div",{ref:B,className:"audio-player__source-buttons",children:Array.from({length:ve}).map((X,ce)=>n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ce+1),onClick:()=>{try{fn(ce)}catch{}},ariaLabel:p("training.sourcePlay",{n:ce+1}),variant:"transparent-white",selected:O&&S===ce,disabled:Z!=="playMode"||!(Array.isArray(T)&&T[ce]),showTooltipInfo:!0},ce))}):null,!Array.isArray(T)||T.length<=1?n.jsx(fe,{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(fe,{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(fe,{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:ze,ref:f,style:{left:`${Ge}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(ax,{segments:Qt,progress:L,totalDuration:se,waveProgressRef:$e,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:T?.[S]?.duration??0,noiseSrc:c&&g?.settings.enabled&&V>0?st:null,noiseRatio:g?ar(g.settings):0,noiseSpeed:g?.settings.speed??1,mainVolume:ee,onReadyChange:Qe})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(nt,{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:ye,onClose:Kt})]})}function Sr(e){const{t}=_e.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}=Fi({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],B={fontSize:`${y}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},v=n.jsxs("div",{className:le(`text-box-tooltip__root ${c==="dark"?"is-dark":""}`),children:[n.jsxs("div",{className:le("text-box-tooltip__box"),children:[r&&n.jsx("div",{className:le("text-box-tooltip__label body-2b"),children:r}),n.jsx("div",{className:le("text-box-tooltip__text body-1"),style:B,children:b.map((A,x)=>n.jsxs("div",{className:le("text-box-tooltip__line"),children:[b.length>1?n.jsx("div",{className:le("text-box-tooltip__marker"),children:n.jsx("span",{className:le("text-box-tooltip__line-number button-1"),children:x+1})}):null,n.jsx("span",{className:le("text-box-tooltip__line-text"),children:A})]},x))})]}),n.jsxs("div",{className:le("text-box-tooltip__buttons"),children:[n.jsx(fe,{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(fe,{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(fe,{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(fe,{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(xn,{anchorRect:s,className:le(`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:le(`text-box-tooltip ${c==="dark"?"is-dark":""}`),children:v})}function Gc({state:e="disabled"}){const{t}=_e.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(nt,{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}=_e.useTranslation(),m=gn("(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,B]=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]),w=o.useCallback(()=>{_(!1),B(null),A(null)},[]);o.useEffect(()=>{if(!f)return;let N;try{typeof x.current=="function"&&(N=x.current())}catch{}if(N===!1){w();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),B(null),A(null);else{const k=C.current.getBoundingClientRect();B(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(fe,{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(fe,{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:w,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}=_e.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 w=x;if(w&&typeof w.getBoundingClientRect=="function")return w.getBoundingClientRect();const D=x?.current;return D&&typeof D.getBoundingClientRect=="function"?D.getBoundingClientRect():null}catch{return null}},[]),B=o.useCallback((x,{text:E="",label:w="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:D=!1,alignX:N="center",alignY:k="top"}={})=>{const R=b(x);_({text:E,label:w,anchorRect:R,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 w=E.props??{},D=typeof w.onDone=="function"?w.onDone:g,N=typeof w.disabled=="boolean";let k=p==="disabled";return N&&(k=!!w.disabled),o.cloneElement(E,{onDone:D,disabled:k,showTooltip:B,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(xn,{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}=_e.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}=Fi({storageKey:"textbox_fontScale"}),[C,f]=o.useState(""),_=o.useRef(null),b=o.useRef(!1),B=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]),[w,D]=o.useState(E);w!==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":"",R=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(fe,{htmlType:"button",size:48,type:"bar",onClick:B,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:R,children:E})}),N!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":N==="disabled",children:[n.jsx(fe,{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(fe,{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(fe,{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}=_e.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,B=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,w]=o.useState(()=>Array.isArray(v)?C?$a(v):v.slice():void 0);o.useEffect(()=>{Array.isArray(v)&&v.length?w(C?$a(v):v.slice()):w(void 0)},[c,A,x,C]);const[D,N]=o.useState(null),[k,R]=o.useState(()=>new Set);o.useEffect(()=>{N(null),R(new Set)},[x,c,A]);const $=o.useRef(void 0);o.useEffect(()=>{const P=$.current;typeof P=="number"&&typeof t=="number"&&typeof e=="number"&&P>=e&&t<e&&(N(null),R(new Set)),$.current=t},[t,e]);const G=o.useCallback(P=>{if(!ra(B))return;const L=E?.[P];if(L==null)return;const Q=L;if(p){const Z=new Set(k);Z.has(Q)?Z.delete(Q):Z.add(Q),R(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:P,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:P,selectedValue:Q,__ts:Date.now()})},[E,B,p,u,k]),M=`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:M,children:Array.isArray(E)&&E.length>0?E.map((P,L)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>G(L),ariaLabel:String(P),label:P,useLabel:!0,icon:y?y[String(P)]:void 0,variant:"default",disabled:B==="disabled",selected:p?k.has(P):D===P,useDisabledCovered:g,minWidth:0},String(P))):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}=_e.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,B]=o.useState(_);b!==_&&(B(_),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]),w=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(fe,{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(fe,{htmlType:"button",size:56,type:"bar",onClick:w,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(fe,{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:_}=_e.useTranslation(),b=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),B=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:B,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}=_e.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,S)=>({id:S,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 S=(I=>{const O=(I||[]).map((de,ee)=>({id:ee,text:h(de)}));if(O.length<=1)return O;const z=(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 se=$a(O),te=0;for(;z(se,O)&&te<20;)se=$a(O),te+=1;return se})(U);y(S);try{if(typeof i=="function"){const I=S.filter((O,z)=>O.text===h(U[z])).length;i({shuffled:S,score:I,total:(U||[]).length,initial:!0,__ts:Date.now()})}if(typeof l=="function"&&C==="active"){const I=S.filter((O,z)=>O.text===h(U[z])).length;b.current=u,l({shuffled:S,score:I,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:[],S=g.filter((I,O)=>I.text===h(U[O])).length;l({shuffled:g,score:S,total:U.length,initial:!0,__ts:Date.now()})},[C,u]);const B=(U,S)=>{const I=[...g],O=U+S;if(O<0||O>=I.length)return;const z=I[O];I[O]=I[U],I[U]=z,Q(I);try{if(typeof l=="function"&&C==="active"){const se=I.filter((te,de)=>te.text===h(p[de])).length;l({shuffled:I,score:se,total:(p||[]).length,__ts:Date.now()})}}catch{}},[v,A]=o.useState(null),x=o.useRef(null),E=o.useRef(null),w=o.useRef(null),D=o.useRef(null),N=o.useRef(null),k=o.useRef({x:0,y:0}),R=o.useRef(null),$=o.useRef({dx:0,dy:0}),G=()=>{if(R.current!==null)return;const U=()=>{if(!x.current){R.current=null;return}R.current=requestAnimationFrame(U);const S=k.current,I=$.current||{dx:0,dy:0};x.current&&(x.current.style.transform=`translate3d(${S.x-I.dx}px, ${S.y-I.dy}px, 0)`)};R.current=requestAnimationFrame(U)},M=o.useRef(new Map),P=o.useRef(new Map),L=()=>{const U=new Map;return M.current.forEach((S,I)=>{S&&S.getBoundingClientRect&&U.set(I,S.getBoundingClientRect())}),U},Q=U=>{const S=L();y(U);try{if(typeof i=="function"){const I=U.filter((O,z)=>O.text===h(p[z])).length;i({shuffled:U,score:I,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const I=L();U.forEach(O=>{const z=S.get(O.id),se=I.get(O.id),te=M.current.get(O.id);if(!te||!z||!se)return;const de=z.top-se.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,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(U))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const I=document.createElement("div");I.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(I),S.dataTransfer?.setDragImage(I,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(I)}catch{}})}catch{}}catch{}A(U);try{const I=g[U],O=document.createElement("div");O.className="order-list__dragging-object order-list__dragging-object--visible",O.textContent=I&&I.text?I.text:"",document.body.appendChild(O),x.current=O;const z=M.current.get(I.id);let se=S.clientX||0,te=S.clientY||0;try{if(z&&z.getBoundingClientRect){const H=z.getBoundingClientRect();se=H.left+H.width/2,te=H.top+H.height/2}}catch{}const de=O.getBoundingClientRect(),ee=de.width/2,V=de.height/2;$.current={dx:ee,dy:V},O.style.transition="none",k.current={x:se,y:te},O.style.transform=`translate3d(${se-ee}px, ${te-V}px, 0)`,requestAnimationFrame(()=>{try{O.style.transition=""}catch{}G()});const ne=H=>{const ie=H;k.current={x:ie.clientX,y:ie.clientY},G()};w.current=ne,document.addEventListener("mousemove",ne);const W=H=>{const ie=H;k.current={x:ie.clientX,y:ie.clientY},G()};E.current=W,document.addEventListener("dragover",W);try{S.dataTransfer?.setData("text/plain",String(U));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:U}))}catch{}}catch{}}catch{}},F=(U,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{N.current!==null&&(clearTimeout(N.current),N.current=null);const I=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(I&&D.current!==I){if(D.current)try{D.current.classList.remove("drag-over")}catch{}try{I.classList.add("drag-over")}catch{}D.current=I}}catch{}},K=(U,S)=>{S.preventDefault();const I=S.dataTransfer?.getData("text/plain")||"",O=I?parseInt(I,10):v,z=U;if(typeof O!="number"||isNaN(O)||O===z){A(null),Y(),T();return}const se=Nf(g,O,z);Q(se),A(null),T();try{if(typeof l=="function"&&C==="active"){const te=se.filter((de,ee)=>de.text===h(p[ee])).length;l({shuffled:se,score:te,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const te=document.querySelectorAll(".order-list .order-list__item")[z];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()},T=()=>{if(x.current){try{document.body.removeChild(x.current)}catch{}x.current=null}E.current&&(document.removeEventListener("dragover",E.current),E.current=null),w.current&&(document.removeEventListener("mousemove",w.current),w.current=null),R.current!==null&&(cancelAnimationFrame(R.current),R.current=null)},q=()=>{A(null),Y(),T()};o.useEffect(()=>()=>T(),[]);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((S,I)=>{const O=P.current.get(S.id);if(!O)return;let z=50;U>1&&(z=Math.round(I/(U-1)*100));try{O.style.setProperty("--marker-pos",z+"%")}catch{}})}catch{}},[g]),o.useEffect(()=>()=>{T(),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,S)=>{const I=Math.max(1,(g||[]).length),O=I>1?Math.round(S/(I-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":O+"%"},ref:z=>{const se=P.current;z?se.set(U.id,z):se.delete(U.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:z=>{const se=M.current;z?se.set(U.id,z):se.delete(U.id)},className:`order-list__draggable ${v===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:f,onDragStart:f?z=>Z(S,z):void 0,onDragEnter:f?z=>F(S,z):void 0,onDragOver:f?z=>F(S,z):void 0,onDragLeave:f?()=>{try{N.current!==null&&clearTimeout(N.current),N.current=setTimeout(()=>{try{const z=document.querySelectorAll(".order-list .order-list__item");z&&z[S]&&(z[S].classList.remove("drag-over"),D.current===z[S]&&(D.current=null))}catch{}},80)}catch{}}:void 0,onDrop:f?z=>K(S,z):void 0,onDragEnd:f?q: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(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>B(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>B(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===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}=_e.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,B=typeof t!="number"?"disabled":b<t?"done":b===t?"active":"disabled",[v,A]=o.useState(null),x=o.useRef([]),[E,w]=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(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{A(null)},[k]);const R=o.useRef(void 0);o.useEffect(()=>{const L=R.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&A(null),R.current=t},[t,e]);const $=o.useCallback((L,Q)=>{if(c)return;const Z={item:L,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(B==="active"&&typeof l=="function")try{l(Z)}catch{}},[c,i,B,l]),G=o.useRef(m);o.useEffect(()=>{G.current=Math.max(0,m||0)},[m]);const M=o.useCallback(async()=>{if(E||B==="disabled")return;w(!0);let L=!1;const Q=new Promise(Z=>{D.current=()=>{L=!0,Z()}});try{for(let Z=0;Z<_.length&&!(!N.current||L);Z++){const F=x.current[Z];if(!F)continue;await Promise.race([mx(F.play(),hx),Q]);const K=Math.max(0,G.current||0);K>0&&Z<_.length-1&&!L&&N.current&&await Promise.race([new Promise(T=>{setTimeout(T,K)}),Q])}}finally{D.current=null,w(!1)}},[E,B,_.length]),P=o.useCallback((L,Q)=>{if(!ra(B))return;A(Q);const Z={selectedValue:L.word||L.title||"",selectedIndex:Q,item:L,__ts:Date.now()};try{typeof i=="function"&&i(Z)}catch{}if(typeof l=="function")try{l(Z)}catch{}},[i,B,l]);return n.jsx(aa,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:y,onDone:l,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:M,playAllActive:E},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Q=D.current;if(!Q)return;const Z=L.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((L,Q)=>n.jsx(ts,{ref:Z=>{x.current[Q]=Z},item:L,disabled:B==="disabled",onPlayDone:()=>$(L,Q),selectable:c,selected:c&&v===Q,onSelect:c?()=>P(L,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:h},L&&L.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:le("noise-settings-tooltip__slider-input")}),n.jsx("div",{className:le(Be("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}=_e.useTranslation(),s=gn("(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(xn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:le("noise-settings-tooltip__header"),children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(fe,{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:le("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(yn,{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:le("noise-settings-tooltip__width-ghost"),"aria-hidden":"true",inert:!0,children:n.jsx(sn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(yn,{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}=_e.useTranslation(),[p,m]=o.useState(!1),[g,y]=o.useState(null),[C,f]=o.useState(!1),_=o.useRef(null),b=o.useRef(null),B=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 w=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=gn("(max-width: 767px)"),R=o.useRef(null),[$,G]=o.useState(null),M=o.useCallback(()=>{f(Q=>{const Z=!Q;return G(Z?R.current?.getBoundingClientRect()??null:null),Z})},[]),P=o.useCallback(()=>{f(!1),G(null)},[]);o.useEffect(()=>{c&&(f(!1),G(null))},[c]);const L=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:B?.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:B?.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(fe,{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(fe,{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:R,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:M,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:L})]}),e&&C&&k&&$&&n.jsx(xn,{anchorRect:$,onClose:P,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:L})}),n.jsxs("div",{className:"pp-bottom__right",children:[x&&n.jsx(fe,{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(fe,{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:w,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}=_e.useTranslation(),y=gn("(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,B=typeof e=="string"?e.trim():e,v=typeof t=="string"?t.trim():t,A=!!(B||v),x=A?B||v:g("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),E=b||(B?t:void 0),w=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(fe,{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:[w?n.jsx("span",{className:"pp-title__depth caption-1",children:w}):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}=_e.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 B=C.current;typeof B=="number"&&typeof t=="number"&&typeof e=="number"&&B>=e&&t<e&&m(Array.from({length:y},()=>null)),C.current=t},[t,e,y]);const f=o.useMemo(()=>p.filter(B=>B!==null).length+1,[p]),_=o.useCallback(B=>{if(!ra(h))return;const v=p;let A;if(v[B]!=null){const E=v[B];A=v.map(w=>w!==null&&w>=E?null:w)}else A=[...v],A[B]=f;m(A);const x={selectedOrder:A,words:l,__ts:Date.now()};try{typeof u=="function"&&u(x)}catch{}if(v[B]==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((B,v)=>n.jsx(ts,{item:{word:B},disabled:h==="disabled",selectable:!0,selected:p[v]!==null,orderRank:p[v],onSelect:()=>_(v),flipDelay:v*120,hideLabel:!1,hideAudio:!0},`${B}-${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 xt(`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?(xt(`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)||(xt(`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 Fx=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function Ox(e){xt("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}=_e.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),R=Mr(N?.wording,N?.label);return k===!0?{variant:"main",label:R??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:k===!1?{variant:"danger",label:R??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:R??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),B=o.useCallback(()=>{f.current?.(),f.current=null,b(null)},[]);o.useEffect(()=>B,[B]);const v=o.useRef(0),A=(N,k)=>{if(!On)return;const R=Math.round(performance.now()-v.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${R}ms ${N}`,k??"")},x=o.useRef(0),E=o.useCallback((N,k,R)=>{B();const $=++x.current,G=()=>x.current===$;v.current=On?performance.now():0,A(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${N}`,{text:k,rawUrl:R}),b(N),f.current=()=>{A("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),x.current++,Qr()};const M=Z=>{A("\uD2BC\uB2E4",Z);const F=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++,F.stop(),Qr()},F.done},P=Px(k,R);A("\uCC28\uB840",P.map(Z=>Z.kind));const L=P[0]?.kind==="raw",Q=L?M(R):Promise.resolve(!1);(async()=>{if(await Q||!G())return;const Z=Ix(),F=L?P.slice(1):P;for(let K=0;K<F.length;K++){if(!G())return;A(`${F[K].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const T=await F[K].resolve(Fx(Z,F.length-K));if(A(`${F[K].kind} \uAC00 \uB2F5\uD588\uB2E4`,T),!G()||T&&(await M(T)||!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))}}))})()},[B]),w=o.useMemo(()=>C.map(N=>{const k=N??{},R=zx(k)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:$,label:G}=m(k),M=Array.isArray(k.corrects)?k.corrects:[],P=M.length?M.join(", "):k.answer!=null&&k.answer!==""?String(k.answer):null,L=typeof k.selectedText=="string"?k.selectedText:null,Q=md(k)===!0,Z=Wx(k),F=!!Z||Rx(R);return{problem:R,variant:$,label:G,answer:P,selectedText:L,isCorrect:Q,sound:Z,canHear:F}}),[C,m,d]),D=o.useMemo(()=>w.some(N=>N.answer!==null||N.selectedText!==null),[w]);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(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>N(l)}),n.jsx(fe,{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})]})})]}),w.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")})]}),w.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(fe,{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?B():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}},Fn=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:B,label:v,buildResults:A,onResult:x,typeKey:E,entryPoint:w,dailyTotal:D,itemRef:N,renderResultPopup:k,noiseOverride:R,hideNoiseRows:$=!1}=e;Hx(E&&!fd.has(E)?E:"");const G=o.useRef(0);o.useEffect(()=>{G.current=Date.now()},[]);const{t:M}=_e.useTranslation(),P=x,L=!!t,Q=t?.id||null,Z=t?.meta||{},F=Array.isArray(t?.pages)?t.pages:[],K=Array.isArray(b)||o.isValidElement(b)&&typeof b!="function"?o.Children.toArray(b).filter(o.isValidElement):[],T=K.length>0,q=pe=>pe===Tr||pe?.__isTrainingPage===!0,Y=T&&K.some(pe=>q(pe.type)),U=Y?K.filter(pe=>q(pe.type)).map((pe,De)=>{const Re=pe.props||{};return{id:`children-page-${De}`,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}],S=T&&!L&&typeof b!="function",I=S?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 De=Number(pe.dataset.ihabTrainingPopupCount||"1")-1;De>0?pe.dataset.ihabTrainingPopupCount=String(De):(delete pe.dataset.ihabTrainingPopupCount,pe.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return pv()},[]);const[O,z]=o.useState({...na,enabled:!1}),se=o.useRef(O);o.useEffect(()=>{se.current=O},[O]);const te=o.useRef(R),de=o.useRef(!1),ee=o.useRef(null);o.useEffect(()=>{let pe=!1;const De=Re=>{if(pe)return;de.current=!0;const Ge=Re?ta({...na,enabled:!1},Re):{...na},ze=ee.current;ee.current=null;const X=ze?ta(Ge,ze):Ge;se.current=X,z(X),ze&&!te.current&&po(X),dr(X);const ce=te.current;if(ce){const Ae=typeof ce=="function"?ce(X):ce,Ve=ta(X,Ae);se.current=Ve,z(Ve),dr(Ve)}};return zf().then(Re=>{if(pe){const Ge=ee.current;if(ee.current=null,Ge&&!te.current){const ze=Re?ta({...na,enabled:!1},Re):{...na};po(ta(ze,Ge))}return}De(Re)}),()=>{pe=!0}},[]);const[V,ne]=o.useState(null),[W,H]=o.useState(null),ie=o.useCallback((pe,De)=>{pe==="main"?ne(De):H(De)},[]),Te=o.useRef(null),ye=o.useRef(null),he=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const pe=Te.current;Te.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 Se=o.useCallback(pe=>{const De=ta(se.current,pe);if(se.current=De,z(De),!de.current){ee.current={...ee.current??{},...pe},dr(De);return}te.current||(Te.current=De,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(he,qx)),dr(De)},[he]),$e=O.mainSpeed,Ne=O.mainVolume,ue=o.useCallback(pe=>Se({mainSpeed:pe}),[Se]),xe=o.useCallback(pe=>Se({mainVolume:pe}),[Se]),ke=o.useMemo(()=>({settings:O,setSettings:Se,registerAnalyser:ie,mainAnalyser:V,noiseAnalyser:W,playbackRate:$e,setPlaybackRate:ue,mainVolume:Ne,setMainVolume:xe}),[O,Se,ie,V,W,$e,ue,Ne,xe]),Ee=o.useRef(null),[We,He]=o.useState(0),ot=o.useRef([]),[Qe,Je]=o.useState("center"),[vt,je]=o.useState(!1),Ye=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(pe=>{Ye.current||(Ye.current=!0,je(!0),we.current=setTimeout(()=>{try{pe()}catch{Ye.current=!1,je(!1)}},Ux()?0:Cx))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const qe=o.useRef(m);o.useEffect(()=>{qe.current=m});const pt=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const pe=Ee.current,De=pt.current;if(bo(pe,De),pe){const Re=Array.from(pe.querySelectorAll(Nn)).filter(Ge=>!Ge.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(De)?.focus?.()}catch{}}},[]),o.useEffect(()=>Zn(()=>Ue(()=>{const pe=qe.current;typeof pe=="function"&&pe()})),[Ue]),Co(Ee,!0);const[_t,Et]=o.useState(!1),Bt=o.useRef(!1),[st,tt]=o.useState(null),kt=o.useRef(0),At=o.useRef(0),jt=()=>{kt.current+=1,At.current+=1,tt(null)},[Mt,gt]=o.useState(""),[it,ut]=o.useState(()=>Rr()),ct=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(ut(Rr()),jt())},[L,Q,S]),o.useEffect(()=>{S&&ut(pe=>{const De=Math.max(0,Math.min(pe.pageIndex,Math.max(0,I-1)));return De!==pe.pageIndex?{...pe,pageIndex:De,stepIndex:0}:pe})},[S,I]);const ve=S?Math.max(0,Math.min(it.pageIndex,I-1)):0,Me=S?U[ve]:null,Pe=S&&Me&&Array.isArray(Me.steps)?Me.steps:[],Oe=L?it.pageIndex:S?ve:typeof c=="number"?c:0,dt=L?F[Math.max(0,Math.min(it.pageIndex,Math.max(0,F.length-1)))]:null,Dt=L&&dt&&Array.isArray(dt.steps)?dt.steps:[],yt=L?Dt.length:S?Pe.length:typeof p=="number"?p:0,wt=L||S?Math.max(0,Math.min(it.stepIndex,Math.max(0,yt))):typeof h=="number"?h:0,Ct=L?F.length:S?I:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const pe=L?Lr(dt,Oe):Me?.id||`children-page-${Oe??0}`,De=new Date().toISOString();for(let Re=0;Re<=wt;Re+=1){const Ge=L?$r(Dt[Re],Re):`step-${Re}`,ze=be(pe,Ge);oe.current.has(ze)||oe.current.set(ze,De)}},[L,S,Oe,wt,Me?.id]),o.useLayoutEffect(()=>{const pe=ct.current;if(typeof Oe=="number"&&pe!==null&&Oe!==pe&&Oe>pe)try{gt(M("training.problemNotice",{n:Oe+1}))}catch{}ct.current=typeof Oe=="number"?Oe:ct.current},[Oe,c,M]),o.useLayoutEffect(()=>{const pe=Ee.current;if(!pe)return;const De=()=>pe.querySelector(".page-popup__scroll");let Re=null,Ge=null,ze=null;const X=Ze=>{const ft=De();if(!ft)return;const bt=ft.scrollHeight<=ft.clientHeight;if(Je(bt?"center":"top"),Ze&&!Bt.current){Bt.current=!0;try{Et(!0)}catch{}try{Ve.disconnect()}catch{}}},ce=()=>{Re!==null&&cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{Ge!==null&&clearTimeout(Ge),Ge=setTimeout(()=>X(!0),60)})},Ae=()=>{ze!==null&&cancelAnimationFrame(ze),ze=requestAnimationFrame(()=>X(!1))};ce(),window.addEventListener("resize",Ae);const Ve=new MutationObserver(ce);Ve.observe(pe,{childList:!0,subtree:!0,attributes:!0});const Ke=setTimeout(()=>{Bt.current||X(!0)},400);return()=>{window.removeEventListener("resize",Ae),Re!==null&&cancelAnimationFrame(Re),Ge!==null&&clearTimeout(Ge),ze!==null&&cancelAnimationFrame(ze),clearTimeout(Ke);try{Ve.disconnect()}catch{}}},[Ee]);const Le=o.useCallback(pe=>{Ee.current&&(Ee.current._childOnNext=pe)},[]),at=o.useCallback(pe=>{Ee.current&&(Ee.current._childOnResult=pe)},[]),oe=o.useRef(new Map),be=(pe,De)=>`${pe}\0${De}`,Ie=o.useCallback((pe,De,Re)=>{ut(Ge=>{const ze=Ge.answersByPage[pe]||{},X=ze[De],ce=Es(Re),Ae=Es(X);if(X&&Ae>ce)return Ge;const Ve=rd(Re,oe.current.get(be(pe,De)),ce);return{...Ge,answersByPage:{...Ge.answersByPage,[pe]:{...ze,[De]:Ve}}}})},[ut]),Xe=o.useCallback((pe,De,Re)=>{const Ge=Lr(dt,Oe),ze=$r(pe,De);Ie(Ge,ze,Re)},[dt,Oe,Ie]),et=o.useCallback((pe,De,Re)=>{const Ge=Lr(dt,Oe),ze=$r(pe,De);Ie(Ge,ze,Re),!Re?.allowChange&&pe?.autoAdvance!==!1&&ut(X=>({...X,stepIndex:Math.max(X.stepIndex,De+1)}))},[dt,Oe,Ie,ut]),rt=o.useCallback((pe,De)=>{const Re=Me?.id||`children-page-${Oe??0}`,Ge=typeof De=="number"?De:wt??0,ze=`step-${Ge}`;Ie(Re,ze,pe),pe?.allowChange||ut(X=>({...X,stepIndex:Math.max(X.stepIndex,Ge+1)}))},[Me,Oe,wt,Ie,ut]),Lt=o.useCallback((pe,De)=>{const Re=Me?.id||`children-page-${Oe??0}`,Ge=`step-${typeof De=="number"?De:wt??0}`;Ie(Re,Ge,pe)},[Me,Oe,wt,Ie]),Bn=S?{currentPageIndex:Oe??0,currentStepIndex:wt??0,totalStepsInPage:Pe.length,handleStepDone:rt,handleStepChange:Lt}:null,ln=async()=>{const pe=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:F,flowState:it,answersByPage:it.answersByPage})):null;return typeof P=="function"&&await Promise.resolve(P(pe))||pe},$t=async()=>{const pe=Me?.id||`children-page-${it.pageIndex}`,De=it.answersByPage[pe]||{},Re=Y?(()=>{const X={};let ce=0;return U.forEach(Ae=>{const Ve=it.answersByPage[Ae.id]||{},Ke=Array.isArray(Ae.steps)?Ae.steps.length:0;for(let Ze=0;Ze<Ke;Ze+=1){const ft=Ve[`step-${Ze}`];typeof ft<"u"&&(X[`step-${ce+Ze}`]=ft)}ce+=Ke}),X})():De;if(typeof A=="function"){const X=await Promise.resolve(A(Re,{pageAnswers:De,answersByPage:it.answersByPage,pages:U,currentPageId:pe}));return typeof P=="function"&&await Promise.resolve(P(X))||X}const Ge=Object.entries(De).map(([X,ce],Ae)=>({index:Ae,key:X,payload:ce})),ze={results:Ge,answers:Ge,score:0};return typeof P=="function"&&await Promise.resolve(P(ze))||ze},Ot=()=>{const pe=++kt.current,De=()=>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(L){const ze=ln();tt(Fn);const X=ze;Promise.resolve(X).then(ce=>{De()||tt(ce||{isEmpty:!0})}).catch(ce=>{!De()&&tt({isEmpty:!0})});return}if(S){const ze=$t();tt(Fn);const X=ze;Promise.resolve(X).then(ce=>{De()||tt(ce||{isEmpty:!0})}).catch(ce=>{!De()&&tt({isEmpty:!0})});return}const Re=Ee.current&&Ee.current._childOnResult,Ge=ze=>{try{return ze?ze():void 0}catch{return}};if(typeof Re=="function"){const ze=Ge(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{}ze&&typeof ze.then!="function"?tt(ze):tt(ze&&typeof ze.then=="function"?Fn:{});const X=()=>{De()||tt(ce=>ce===Fn?{}:ce)};Promise.resolve(ze).then(ce=>{ce&&!De()?tt(ce):X()}).catch(ce=>{X()});return}if(typeof P=="function"){const ze=Ge(P);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{}ze&&typeof ze.then!="function"?tt(ze):tt(ze&&typeof ze.then=="function"?Fn:{});const X=()=>{De()||tt(ce=>ce===Fn?{}:ce)};Promise.resolve(ze).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&&!De()?tt(ce):X()}).catch(ce=>{console.error("viewResults external handler failed",ce),X()});return}},un=()=>{if(L){if(typeof Oe=="number"&&typeof Ct=="number"&&Oe<Ct-1){ut(De=>({...De,pageIndex:De.pageIndex+1,stepIndex:0}));return}return Ot()}if(S){const De=Pe.length;if(typeof wt=="number"&&wt<De-1){ut(Re=>({...Re,stepIndex:Re.stepIndex+1}));return}if(typeof Oe=="number"&&typeof Ct=="number"&&Oe<Ct-1){ut(Re=>({...Re,pageIndex:Re.pageIndex+1,stepIndex:0}));return}return Ot()}if(typeof C=="function"){try{C()}catch{}return}const pe=Ee.current&&Ee.current._childOnNext;if(typeof pe=="function"){try{pe()}catch{}return}},Pt=L?Z.title||Z.label||B||M("common.popup","\uD31D\uC5C5"):a||v||(Array.isArray(s)?s[s.length-1]:void 0)||B||M("common.popup","\uD31D\uC5C5"),kn=B||Pt,Jt=L?Z.title??Z.label??Pt:a??v??Pt,St=(pe,De)=>{const Re=Lr(dt,Oe),Ge=$r(pe,De),ze=it.answersByPage[Re]?.[Ge],X=Vx(pe,{page:dt,pageIndex:Oe,step:pe,stepIndex:De,storedPayload:ze,answersByPage:it.answersByPage,flowState:it}),ce={key:Ge,index:De,stepIndex:wt,isLast:De===Dt.length-1};switch(pe?.type){case"listen":return n.jsx(ks,{...ce,...X,onDone:Ae=>et(pe,De,Ae)});case"confirm":return n.jsx(ws,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});case"confirmWithText":return n.jsx(Bs,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});case"orderList":return n.jsx(As,{...ce,...X,onDone:Ae=>et(pe,De,Ae),onChange:Ae=>Xe(pe,De,Ae)});default:return null}},Rt=o.useRef(void 0);o.useEffect(()=>{const pe=Rt.current;if(Rt.current=Oe,pe===void 0||pe===Oe||!_r())return;const De=Ee.current;if(!De)return;const Re=document.activeElement;if(!(!Re||Re===document.body||!De.contains(Re)||Re.disabled===!0))return;const Ge=De.querySelector(`.training-steps ${Nn.split(", ").join(", .training-steps ")}`)??Array.from(De.querySelectorAll(Nn)).find(ze=>!ze.closest('[aria-hidden="true"]'));try{Ge?.focus()}catch{}},[Oe]);const Wt=L?F.length>0?n.jsx("div",{className:"training-steps",children:Dt.map((pe,De)=>St(pe,De))},`replay-${We}`):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||M("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Kt=S?n.jsxs(sd.Provider,{value:Bn,children:[Me?.pageTop?n.jsx("div",{className:"training-page-top",children:Me.pageTop}):null,n.jsx("div",{className:"training-steps",children:Pe.map((pe,De)=>{const Re=pe;return o.cloneElement(Re,{...Re.props,_stepIndex:De,_totalSteps:Pe.length,_stepKey:`step-${De}`,_pageIndex:Oe})})},`replay-${We}`),Me?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Me.pageBottom}):null]}):null,fn=o.useRef(-1),Ut=o.useCallback(()=>{if(!E)return;const pe=st,{results:De,correct:Re,total:Ge}=js(st),ze={correct:Re,total:Ge,attempt:ot.current.length+1,previousAttempts:[...ot.current]};if(fn.current===At.current)return ze;fn.current=At.current,jf({items:Of(De),category:fd.has(E)?"sentence":"word",trainingType:E,entryPoint:w??"sentence",itemRef:N??null,correct:Re,total:Ge,score:typeof pe?.score=="number"?pe.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-G.current)/1e3)),dailyTotal:D??null});try{y?.(ze)}catch{}return ze},[E,w,D,N,st,y]);o.useEffect(()=>{!st||st===Fn||st?.isEmpty||(js(st).total??0)>0&&Ut()},[st,Ut]);const Qt=o.useCallback(()=>{const pe=Ut();jt(),Ue(()=>{typeof g=="function"&&g(pe),typeof m=="function"&&m()})},[g,m,Ut,tt,Ue]),cn=o.useCallback(()=>gt(""),[gt]),bn=o.useCallback(()=>{Ue(()=>{typeof m=="function"&&m()})},[m,Ue]),Ht=n.jsxs("div",{className:`page-popup${vt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":kn,children:[n.jsxs("div",{ref:Ee,className:`page-popup__panel ${_t?"":"page-popup__panel--measuring"} ${Qe==="center"?"page-popup__panel--center":Qe==="top"?"page-popup__panel--top":""}`,children:[n.jsx(td,{title:Jt,subtitle:L?Z.subtitle||Z.label:Array.isArray(s)?s.join(" / "):void 0,desc:L?void 0:r,depth:L?Z.depth:s,icon:L?Z.icon:l,wrapperStyle:L?Z.wrapperStyle:i,iconTooltip:L?Z.iconTooltip:u,progressMax:Ct,progressIndex:Oe,pageIndex:Oe,pageCount:Ct,onBack:bn,onClose:bn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${Qe==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Kt:L?Wt:typeof b=="function"?b({registerOnNext:Le,registerOnResult:at,panelRef:Ee,setResultOverlay:tt}):b})}),n.jsx(ed,{onSettings:f,onNext:un,onResult:Ot,useNoiseSettingBtn:!!(L?Z.useNoiseSetting??!0:_),stepIndex:wt,stepCount:yt,pageIndex:Oe,pageCount:Ct,resultOpen:!!(st&&!st.isEmpty),hideNoiseRows:$})]}),st&&!st.isEmpty&&(k??Gx)({score:st.score,results:st.results||st.answers||[],contextsLength:st.results?st.results.length:st.answers?st.answers.length:0,onReplay:()=>{if(G.current=Date.now(),st!==Fn){const{correct:pe,total:De}=js(st);ot.current.push({correct:pe,total:De})}if(jt(),He(pe=>pe+1),L){if(ut(Rr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){ut(Rr());return}try{const pe=Ee.current&&Ee.current._childOnResult;typeof pe=="function"&&pe({replay:!0})}catch{}},onClose:Qt,pending:st===Fn}),st?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":M("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:M("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(fe,{htmlType:"button",variant:"main",size:48,onClick:Qt,label:M("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ya,{message:Mt,position:"top",onClose:cn})]}),An=n.jsx(bs.Provider,{value:ke,children:Ht});return typeof document<"u"&&document.body?dn.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:le("word-image-tooltip__cell"),children:[s&&n.jsx("div",{className:le("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:le("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:dn.createPortal(n.jsx("div",{ref:a,className:le("word-image-tooltip"),style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:le("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}=_e.useTranslation(),B=b.language?.startsWith("ko")??!1,{anchorRect:v,openAt:A,close:x}=Oa(),[E,w]=o.useState(null),D=o.useCallback(()=>{x(),w(null)},[x]);Wy(D,!!E);const N=(r??"").trim(),k=/^[^,[\]\s]+$/.test(N)?N:"",R=k.length>0,$=r===void 0&&t===void 0,G=R?"match":$?"original":"ganada",[M,P]=o.useState(()=>G),[L,Q]=o.useState("50"),[Z,F]=o.useState(1),[K,T]=o.useState(R);K!==R&&(T(R),P(G));const q=M==="match"&&!R||M==="original"&&!$?G:M,Y=o.useMemo(()=>[...R?[{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"})}],[_,R,$]),U=o.useMemo(()=>["10","25","50","100"].map(ue=>({value:ue,label:_("wordSearch.pageSize",{count:Number(ue),defaultValue:`${ue}\uAC1C\uC529 \uBCF4\uAE30`})})),[_]),S=ue=>ue.words?.[0],I=o.useMemo(()=>{const ue=[...k].length,xe=hf(k),ke=new Map;return Ee=>{let We=ke.get(Ee);return We===void 0&&(We=xe((Ee.words?.[0]?.label??"").slice(0,ue))?0:1,ke.set(Ee,We)),We}},[k]),O=o.useCallback((ue,xe)=>{const ke=He=>S(He)?.label??"",Ee=He=>S(He)?.syllables??[...ke(He)].length,We=He=>(He.words??[]).reduce((ot,Qe)=>{const Je=parseInt(Qe.grade??"",10);return Number.isFinite(Je)&&Je<ot?Je:ot},999);switch(q){case"match":return I(ue)-I(xe)||mn(ke(ue),ke(xe));case"ganada":return mn(ke(ue),ke(xe));case"ganada_desc":return mn(ke(xe),ke(ue));case"syllable":return Ee(ue)-Ee(xe)||mn(ke(ue),ke(xe));case"syllable_desc":return Ee(xe)-Ee(ue)||mn(ke(ue),ke(xe));case"grade":return We(ue)-We(xe)||mn(ke(ue),ke(xe));case"grade_desc":return We(xe)-We(ue)||mn(ke(ue),ke(xe));default:return 0}},[q,I]),z=o.useMemo(()=>s.slice().sort(O),[s,O]),se=Number(L)||10,te=o.useMemo(()=>(l??[]).flatMap(ue=>ue.items.slice().sort(O).map(xe=>({item:xe,label:ue.label}))),[l,O]),de=l?te.length:z.length,ee=Math.max(1,Math.ceil(de/se)),V=Math.min(Z,ee),ne=o.useMemo(()=>z.slice((V-1)*se,V*se),[z,V,se]),W=o.useId(),H=o.useMemo(()=>{if(!l)return null;const ue=te.slice((V-1)*se,V*se),xe=new Map;for(const{item:ke,label:Ee}of ue)xe.has(Ee)||xe.set(Ee,[]),xe.get(Ee).push(ke);return[...xe.entries()].map(([ke,Ee])=>({label:ke,items:Ee}))},[l,te,V,se]);o.useEffect(()=>{F(1)},[M,L,de,r]);const ie=de>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(vn,{size:40,options:Y,value:q,onChange:P,ariaLabel:_("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(vn,{size:40,options:U,value:L,onChange:Q,ariaLabel:_("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(Oo,{page:V,totalPages:ee,onChange:F})]}):void 0,Te=ue=>{u&&u(ue)},ye=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:B?Bf(a):a})]}):void 0,he=t!==void 0&&t>0&&c!==void 0&&a?_("wordSearch.resultDisc",{unit:B?Af(a):a,max:c,selected:i.length}):void 0,Se=f??he,$e=l?l.length===0:s.length===0,Ne=$e&&!y&&!g;return n.jsxs(va,{type:C,className:Be("word-search-result-block",m),children:[n.jsxs("div",{className:Be("word-search-result-block__inner",Ne&&"word-search-result-block__inner--head-only"),children:[(ye||ie||Se)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(nt,{icon:e,className:"word-search-result-block__head-icon"}),ye&&n.jsx("span",{className:"word-search-result-block__title h3",children:ye})]}),ie&&n.jsx("div",{className:"word-search-result-block__head-actions",children:ie}),Se&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:Se})]}),$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?(H??[]).map(ue=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${W}-${ue.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${W}-${ue.label}`,children:ue.label}),n.jsx("div",{className:"word-search-result-block__items",children:ue.items.map(xe=>{const ke=i.includes(xe.id);return n.jsx("div",{onMouseEnter:Ee=>{A(Ee.currentTarget),w(xe.words??[])},onMouseLeave:D,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(xe.words??[]).map(Ee=>Ee.label),subLabel:(xe.words??[]).some(Ee=>Ee.subLabel)?(xe.words??[]).map(Ee=>Ee.subLabel):void 0,selected:ke,onClick:()=>Te(xe.id),minWidth:200})},xe.id)})})]},ue.label)):n.jsx("div",{className:"word-search-result-block__items",children:ne.map(ue=>{const xe=i.includes(ue.id);return n.jsx("div",{onMouseEnter:ke=>{A(ke.currentTarget),w(ue.words??[])},onMouseLeave:D,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(ue.words??[]).map(ke=>ke.label),subLabel:(ue.words??[]).some(ke=>ke.subLabel)?(ue.words??[]).map(ke=>ke.subLabel):void 0,selected:xe,onClick:()=>Te(ue.id),minWidth:200})},ue.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(fe,{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(fe,{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:B,searchChecking:v=!1,pairMode:A=!1,sectionType:x="page",beforeSearchContent:E,beforeContent:w,afterContent:D,hideCountControl:N=!1,ordinal:k=!1}){const{t:R}=_e.useTranslation(),$=o.useMemo(()=>R("wordPairs.infoNotes",{returnObjects:!0}),[R]),G=o.useMemo(()=>Array.from({length:s-l+1},(S,I)=>{const O=l+I;return{key:String(O),label:R("wordPairs.count",{n:O})}}),[R,s,l]),M=o.useMemo(()=>R("wordPairs.ordinals",{returnObjects:!0}),[R]),P=o.useCallback(S=>k?R("wordPairs.phonemeOrdinalLabel",{ordinal:M[S-1]??S}):a===1?R("wordPairs.phonemeSingleLabel","\uC74C\uC808"):R("wordPairs.phonemeN",{n:S}),[k,M,a,R]),L=o.useCallback(S=>k?R("wordPairs.phonemeContrastOrdinalLabel",{ordinal:M[S-1]??S}):a===1?R("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):R("wordPairs.phonemeContrast",{n:S}),[k,M,a,R]),Q=o.useCallback((S,I)=>I?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:Z,toggleAt:F,close:K}=Oa(),T=o.useCallback(S=>r(Number(S)),[r]),q=gn("(max-width: 767px)"),Y=o.useCallback(S=>Xx(S,e).map(({label:I,value:O,displayLabel:z})=>{const se=!!O&&O!=="\uC5C6\uC74C";return n.jsxs("span",{className:Be("phoneme-select-block__cell-jamo-part",O?"":"phoneme-select-block__cell-jamo-part--empty",se?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${O==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:O==="\uC5C6\uC74C"?"x":O||d}),se&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:z??I})]},I)}),[e,d]),U=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:q?"dot":void 0,icon:"info",label:q?void 0:R("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:R("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:Z?"is-selected":void 0,"aria-expanded":!!Z,"aria-haspopup":"dialog",onClick:S=>F(S.currentTarget)})}),Z&&n.jsx(Xn,{title:R("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:Be("phoneme-select-block",h),children:[w,!N&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(yn,{options:G,value:String(a),onChange:T,size:40,ariaLabel:R("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((S,I)=>{const O=t[I*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(O)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:P(I+1)})]},I)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:R("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,I)=>{const O=t[I*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(O)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(I+1)})]},I)})})]}):t.map((S,I)=>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(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:P(I+1)})]},I))}),(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((S,I)=>{const O=t[I*2]??{};return n.jsx(In,{title:Q(P(I+1),I===0),sections:u?u(O,I*2):i,selected:O,onSelect:c?.(I*2),align:"newline"},I)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,I)=>{const O=t[I*2+1]??{};return n.jsx(In,{title:L(I+1),sections:u?u(O,I*2+1):i,selected:O,onSelect:c?.(I*2+1),align:"newline"},I)})})]}):t.map((S,I)=>n.jsx(In,{title:Q(P(I+1),I===0),sections:u?u(S,I):i,selected:S,onSelect:c?.(I),align:"newline"},I))})}),E&&n.jsx("div",{className:"phoneme-select-block__before-search",children:E}),(C||f||v)&&(()=>{const S=t.every(I=>{const O=uf(I);return Object.entries(O).every(([z,se])=>!se||z==="coda"&&se===Rl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:R("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),f?n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:v?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:B??R("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||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:B??R("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}=_e.useTranslation();return n.jsx(In,{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}=_e.useTranslation();return a.length===0?null:n.jsx(In,{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}=_e.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(In,{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:B,topContent:v,className:A=""}=e,{t:x}=_e.useTranslation(),E=u??x("common.search","\uAC80\uC0C9"),w=_??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(""),[R,$]=o.useState(d??r[0]?.key??""),[G,M]=o.useState(h),[P,L]=o.useState(String(f??C[0]??10)),[Q,Z]=o.useState(1);o.useEffect(()=>{Z(1)},[N,P]);const F=c!==null,K=o.useCallback((te,de)=>{if(!de)return!0;const ee=de.toLowerCase();return r.some(V=>{const ne=te[V.key];return ne==null?!1:String(ne).toLowerCase().includes(ee)})},[r]),T=c??K,q=o.useMemo(()=>{const te=F?a.filter(de=>T(de,N)):a;return R?[...te].sort((de,ee)=>{const V=de[R],ne=ee[R];return V===ne?0:fr(V,ne,G)}):te},[a,N,R,G,F,T]),Y=Math.max(1,Math.ceil(q.length/Number(P)));Q>Y&&Z(Y);const U=Math.min(Q,Y),S=q.slice((U-1)*Number(P),U*Number(P)),I=o.useCallback(te=>{R===te?M(de=>!de):($(te),M(!0)),Z(1)},[R]),O=o.useMemo(()=>{if(typeof B=="function"){const te=q.length,de=B(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 B=="string"&&B.includes("{n}")){const[te,de]=B.split("{n}");return{prefix:te,suffix:de}}return{prefix:x("common.totalCountPrefix","\uCD1D "),suffix:x("common.totalCountSuffix","\uAC1C")}},[B,q.length,x]),z=o.useMemo(()=>r.map(te=>({label:te.label,onClick:te.sortable!==!1?()=>I(te.key):void 0,className:te.className,sortDir:te.sortable!==!1&&R===te.key?G?"asc":"desc":null})),[r,R,G,I]),se=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 O&&n.jsx("p",{className:"toolbar__count body-1",children:O.label}),n.jsx(zo,{count:"label"in O?void 0:{value:q.length,prefix:O.prefix,suffix:O.suffix},search:F?{value:N,onChange:k,placeholder:E}:void 0,pageSize:{options:se,value:P,onChange:L},pagination:{page:U,total:Y,onChange:Z}}),n.jsx(Jo,{size:"medium",gridTemplateColumns:l,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:s,fields:z,items:S,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:Be(ee.className,de&&"popup-list__row--selected")}))},empty:F&&N!==""&&a.length>0?D:w})]})}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:B}=_e.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")??[]),R=b==="confirm"?k[k.length-1]:c?void 0:k[d?1:0];R&&!R.disabled&&R.focus()},[]);const A=o.useRef(!1),[x,E]=o.useState(!1),w=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 R=!1;try{R=await N()}catch($){typeof console<"u"&&console.error($)}finally{R||(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:Be("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=w(N);await d.onClick(k.close);const R=d.closeOnClick??!0;return R&&N(),R||k.didClose()})}}]:[],...c?[]:[{label:u??B("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:x,onClick:({closeWithAnimation:N})=>N()}],{label:i??B("common.confirm","\uD655\uC778"),variant:h,disabled:p||x,onClick:async({closeWithAnimation:N})=>{await D(async()=>{const k=w(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}=_e.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}=_e.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,B)=>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))),w=yd[Math.floor(Math.random()*yd.length)],D=Math.random()*300,N=(360+Math.random()*260)*r*1.2,k=(B==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,R=Math.cos(k)*N,$=Math.sin(k)*N*1.35,G=Math.random()*720-360,M=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),P=Math.random()>.7?"50%":"3px";return{id:`${B}-${A}`,side:B,size:E,color:w,delay:D,vx:R,vy:$,angularVel:G,life:M,borderRadius:P}});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),B=K=>Math.max(40,(K||window.innerWidth)*.02),v=_?.width||window.innerWidth||375,A=_?.height||window.innerHeight||812,x=K=>{const T=[...K].sort((q,Y)=>q-Y);return T[Math.floor(T.length/2)]||1},E=x(i.map(K=>Math.abs(K.vy))),w=x(i.map(K=>Math.abs(K.vx))),D=Math.sqrt(2*C*(A*.72+b))/E,N=E*D/C,k=v*.5/(w*N),R=(K,T,q)=>Math.min(q,Math.max(T,K)),$=R(D,.8,2.4),G=R(k,.7,2.2),M=a>0?a/ow:1,P=i.map(K=>({...K,life:K.life*M,vx:K.vx*G,vy:K.vy*$,startTime:f+K.delay,ended:!1})),L=_?{x:_.left-B(_.width),y:_.top+_.height+b}:{x:-B(window.innerWidth),y:window.innerHeight+b},Q=_?{x:_.left+_.width+B(_.width),y:_.top+_.height+b}:{x:window.innerWidth+B(window.innerWidth),y:window.innerHeight+b},Z=K=>{let T=!1;for(const q of P){const Y=c.current[q.id];if(!Y||!Y)continue;if(K<q.startTime){Y.style.display="none",T=!0;continue}if(!q._inited){const V=q.side==="left"?L.x:Q.x,ne=q.side==="left"?L.y:Q.y;Y.style.left=`${V}px`,Y.style.top=`${ne}px`,Y.style.transform="translate3d(0px, 0px, 0)",Y.style.display="block",Y.style.zIndex="100000",typeof q.color=="string"&&q.color.startsWith("var(")&&(Y.style.background=sw(Y,q.color)??"#FF0060"),q._inited=!0}const U=(K-q.startTime)/1e3;if(U<0)continue;const S=q.life/1e3;if(U>=S){Y.style.opacity="0",Y.style.display="none",q.ended=!0;continue}T=!0;const I=q.side==="left"?L.x:Q.x,O=q.side==="left"?L.y:Q.y,z=I+q.vx*U,se=O+q.vy*U+.5*C*U*U,te=(q.angularVel||0)*U,de=z-I,ee=se-O;Y.style.transform=`translate3d(${de}px, ${ee}px, 0) rotate(${te}deg)`,Y.style.opacity=`${Math.max(0,1-U/S)}`}T?d.current=requestAnimationFrame(Z):h.current?.()};d.current=requestAnimationFrame(Z);const F=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 T of i){const q=document.createElement("span");q.className=`confetti confetti--${T.side}`,q.setAttribute("aria-hidden","true"),q.style.display="none",q.style.position="fixed",q.style.left="0px",q.style.top="0px",q.style.width=`${T.size}px`,q.style.height=`${Math.max(4,T.size*.6)}px`,q.style.background=T.color,q.style.borderRadius=T.borderRadius,q.style.transform="translate3d(0,0,0)",q.style.opacity="0",K.appendChild(q),c.current[T.id]=q}(document.body||m.current).appendChild(K),p.current=K}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(F),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"?dn.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}=_e.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(fe,{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:Be("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}=_e.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 M=p.current;if(!M)return;const P=()=>b(M.scrollWidth>M.clientWidth+1);if(P(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(P);return L.observe(M),()=>L.disconnect()},[C]);const B=e.map(M=>`${M.id}\0${M.section??""}\0${M.group??""}`).join(""),v=C&&C.shape===B?C.pages:null,[A,x]=o.useState(0);o.useEffect(()=>{const M=y.current;if(!M||typeof ResizeObserver>"u")return;const P=new ResizeObserver(()=>x(M.offsetHeight));return P.observe(M),()=>P.disconnect()},[]);const[E,w]=o.useState(0);o.useEffect(()=>{const M=m.current;if(!M||typeof ResizeObserver>"u")return;let P=null;const L=typeof requestAnimationFrame=="function"?F=>requestAnimationFrame(F):F=>setTimeout(F,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:F=>clearTimeout(F),Z=new ResizeObserver(()=>{P==null&&(P=L(()=>{P=null,w(F=>F+1)}))});return Array.from(M.children).forEach(F=>Z.observe(F)),()=>{Z.disconnect(),P!=null&&Q(P)}},[B]),o.useLayoutEffect(()=>{const M=m.current,P=y.current;if(!M||!P)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Q=new Map;g.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Q.set(S.dataset.chromeSection??"",L(S))});const Z=S=>L(P)-(Q.get(S??"")??0),F=Array.from(M.children).map(S=>L(S)),K=[];e.forEach((S,I)=>{const O=K[K.length-1],z=O?e[O[0]]:void 0;z&&S.group!=null&&z.group===S.group&&z.section===S.section?O.push(I):K.push([I])});const T=[];let q=[],Y=0;const U=()=>{q.length&&T.push(q),q=[],Y=0};K.forEach(S=>{const I=S.reduce((z,se)=>z+F[se],0),O=Z(e[S[0]].section);q.length&&e[q[0]].section!==e[S[0]].section&&U(),I>O?S.forEach(z=>{q.length&&Y+F[z]>O+.01&&U(),q.push(z),Y+=F[z]}):(q.length&&Y+I>O+.01&&U(),S.forEach(z=>q.push(z)),Y+=I)}),U(),f(S=>S&&S.shape===B&&JSON.stringify(S.pages)===JSON.stringify(T)?S:{shape:B,pages:T})},[B,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."]}),R=(M,P,L)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:L!=null&&t?.[L]||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(M,P)})]})}),$=Array.from(new Set(e.map(M=>M.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:Be("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(M=>{const P=R(1,1,M||void 0);return n.jsxs("div",{"data-chrome-section":M,children:[P.header,P.footer]},M)})}),n.jsx("div",{ref:m,className:"report-doc__measure-blocks",children:e.map(M=>n.jsx("div",{children:M.content},M.id))})]}),v&&n.jsx("div",{className:"report-doc__pages",children:v.map((M,P)=>{const{header:L,footer:Q}=R(P+1,v.length,e[M[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,M.map(Z=>n.jsx("div",{children:e[Z].content},e[Z].id)),Q]},P)})})]})}function Cw({title:e,fields:t,columns:a=4,className:r,style:s}){return n.jsxs("div",{className:Be("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 Ir(){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(()=>Ir())),Pr.observe(e)),Ir(),()=>{const t=(oa.get(e)??1)-1;if(t>0){oa.set(e,t),Ir();return}oa.delete(e),Pr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Ir()})}function yw({title:e,message:t,actionLabel:a,onAction:r,icon:s,onClose:l,className:i=""}){const{t:u}=_e.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:Be("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(fe,{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:Be("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}=_e.useTranslation(),_=o.useId(),b=t?`h${t}`:"span",B=s!=null,v=Be("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",B&&"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:[B&&n.jsx(fe,{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(vn,{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:B,onReset:v,resetLabel:A,saveButtonLabel:x,secondarySaveButtonLabel:E,onReorder:w,showCellCount:D,onAddItem:N,className:k,renderSavePopup:R,renderWordSearch:$,hideControls:G,saveOnly:M,tableName:P,nameValue:L,onNameChange:Q,descriptionValue:Z,onDescriptionChange:F,namePlaceholder:K,descriptionPlaceholder:T,existingNames:q,editingName:Y,onCancel:U,initialItemsPerPage:S,renderCellAction:I,actionsLeftExtra:O}){const{t:z}=_e.useTranslation(),se=A??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),te=C===void 0,de=!!Q,[ee,V]=o.useState([]),ne=(L??"").trim(),W=ne||(K??"").trim(),H=(Z??"").trim()||(T??"").trim(),ie=(q??[]).map(ae=>ae.trim().toLowerCase()),Te=[Y?.trim().toLowerCase(),...ee].filter(ae=>!!ae),ye=[...ie];for(const ae of Te){const Ce=ye.indexOf(ae);Ce!==-1&&ye.splice(Ce,1)}const he=ne!==""&&ye.includes(ne.toLowerCase()),[Se,$e]=o.useState(Array(4).fill(null)),[Ne,ue]=o.useState(4),[xe,ke]=o.useState(null),Ee=Se.slice(0,Ne),We=!!d?.show,[He,ot]=o.useState(!0),[Qe,Je]=o.useState(!0),vt=d&&{...d,top:He,bottom:Qe},[je,Ye]=o.useState("landscape"),[we,Ue]=o.useState([...fc]),[qe,pt]=o.useState("show"),[_t,Et]=o.useState(!0),[Bt,st]=o.useState(!0),tt=o.useRef(null),kt=o.useRef([]),[At,jt]=o.useState(S==="all"?Number.POSITIVE_INFINITY:S??8),[Mt,gt]=o.useState("right"),[it,ut]=o.useState(!1),[ct,ve]=o.useState(!1),{toastMessage:Me,toastType:Pe,showWarning:Oe,clearToast:dt}=Ui("warning"),Dt=o.useCallback(()=>ke(null),[ke]);N&&!te&&!D&&!g&&xt("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&&xt("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[yt,wt]=o.useState(()=>Math.max(C?.length??1,1)),Ct=Math.max(g??0,C?.length??0,1),Le=te?Ne:D?Math.max(yt,C?.length??1,1):Ct,{width:at,height:oe}=ea[je],be=!te&&!D,Ie=Math.max(1,Math.min(Ct,y??Ct)),Xe=Math.min(At,Ie),et=be?Xe:Le,rt=Math.ceil((C?.length??0)/Math.max(1,et)),Lt=(C?.length??0)<Ct?Math.floor((C?.length??0)/Math.max(1,et))+1:0,Bn=be?Math.max(1,rt,Lt):0,ln=be?Array.from({length:Bn},(ae,Ce)=>(C??[]).slice(Ce*et,(Ce+1)*et)):null,$t=!!ln&&ln.length>1,Ot=te?Ee.some(ae=>ae!==null&&ae.length>1):(C??[]).some(ae=>(ae.words??[]).length>1),un=P?.trim()||`${Kl(Pa())} ${Ot?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Pt=o.useCallback(()=>$t?kt.current.filter(ae=>ae!==null):tt.current?[tt.current]:[],[$t]),{print:kn,openNewWindow:Jt,downloadHtml:St}=ps({getElements:Pt,paperW:at,paperH:oe,fileName:un,onPopupBlocked:()=>{Oe(z("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=ae=>{ue(ae),$e(Ce=>Ce.length>=ae?Ce:[...Ce,...Array(ae-Ce.length).fill(null)]),ke(null)},Wt=ae=>{$e(Ce=>{const Fe=[...Ce];return Fe[ae]=null,Fe}),xe===ae&&ke(null)},Kt=ae=>{if(xe===null)return;const Ce=xe;$e(lt=>{const ht=[...lt];return ht[Ce]=ae.length>0?ae:null,ht});const Fe=Ee.findIndex((lt,ht)=>ht>Ce&<===null);ke(Fe!==-1?Fe:null)},fn=te?Ee.some(ae=>ae?.some(Ce=>!!Ce.colloquialPronunciation)):(C??[]).some(ae=>(ae.words??[]).some(Ce=>!!Ce.colloquialLabel)),Ut=!te&&bc([...p?[p]:[],...C??[]]),Qt=o.useMemo(()=>ua()?te?Se.slice(0,Ne).flatMap(ae=>(ae??[]).map(Ce=>[Ce.word,Ce.homonum])):(ae=>ae.flatMap(Ce=>(Ce.words??[]).map(Fe=>[Fe.label,Fe.homonum])))([...p?[p]:[],...C??[]]):[],[te,Se,Ne,C,p]),[cn,bn]=o.useState(!1);o.useEffect(()=>{if(Qt.length===0)return;let ae=!1;return Promise.all(Qt.map(([Ce,Fe])=>Tl(Ce,Fe))).then(Ce=>{ae||bn(Ce.some(Boolean))},()=>{}),()=>{ae=!0}},[Qt]);const Ht=Qt.length>0&&cn,An=o.useMemo(()=>[...te||D?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:V4.map(ae=>({value:`${ae}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ae})})),display:"segmented"}]:[],...be&&(C?.length??0)>0?[kc(z,{hasPairs:Ot,itemCount:Ct,max:y})]:[],...$t?[U4(z)]:[]],[z,te,D,be,C?.length,Ot,Ct,y,$t]),pe={...te||D?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Le}\uCE78`}:{},...be&&(C?.length??0)>0?{[z(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${Xe}\uAC1C`}:{},...$t?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:Mt}:{}},De=(ae,Ce)=>{Ce===z("wordTable.filter.columns","\uCE78 \uC218")?te?Rt(parseInt(ae)):wt(parseInt(ae)):Ce===z(Ot?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?jt(Ac(parseInt(ae),Ct)):Ce===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&>(Nc(ae))},Re=te?kw(Ee.filter(ae=>ae!==null&&ae.length>0).map(ae=>({id:Ls(ae),words:ae.map(_d)}))):C??[],Ge=()=>{te&&$e(ae=>ae.length>Ne?ae.slice(0,Ne):ae)},ze=(ae=!1)=>{if(ve(ae),de&&f){const Ce=W.trim().toLowerCase();Ce&&V(Fe=>Fe.includes(Ce)?Fe:[...Fe,Ce]),f(W,Re,H||void 0,ae),Ge();return}if(M&&f){f("",Re,void 0,ae),Ge();return}if(f){ut(!0);return}St()},[X,ce]=o.useState(!1),[Ae,Ve]=o.useState(""),Ke=Ae.trim(),Ze=Ke!==""&&ie.includes(Ke.toLowerCase()),ft=()=>{Ve(W?z("wordTable.save.copyName",{name:W,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),ce(!0)},bt=()=>{!Ke||Ze||!f||(f(Ke,Re,H||void 0,!0),Ge(),ce(!1))},ge=Re.length===0,j=ge||de&&(W===""||he),J=()=>{if(ge){Oe(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(de&&W===""){Oe(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}de&&he&&Oe(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},me=n.jsx(_a,{items:Re,orientation:je,contentTypes:we,baseItem:p,baseContentTypes:m,cutLine:qe,showOutline:_t,showDivLine:Bt,count:Le});return n.jsxs(n.Fragment,{children:[n.jsxs(va,{type:"page",icon:t,title:e,disc:a,className:Be("word-table-block",k),children:[X&&n.jsx(Rn,{size:"small",title:E??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>ce(!1),footer:({closeWithAnimation:ae})=>n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ae}),n.jsx(fe,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Ke||Ze,onClick:bt})]}),children:n.jsx(qn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:Ae,onChange:Ve,placeholder:z("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:bt,error:Ze?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),it&&f&&R?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:me,previewW:at,previewH:oe,items:Re,existingNames:Bw().map(ae=>ae.name),saveAsNew:ct,onSave:(ae,Ce)=>{f(ae,Re,Ce,ct),Ge(),ut(!1)},onCancel:()=>ut(!1)}),(te||N)&&xe!==null&&$?.({cellIndex:xe,onConfirm:te?Kt:ae=>{if(N){const Ce=ae[0];if(Ce){const Fe=new Set((C??[]).map(ht=>ht.id));let lt=Ls([Ce]);for(let ht=2;Fe.has(lt);ht++)lt=`${Ls([Ce])}~${ht}`;N({id:lt,words:[_d(Ce)]})}}ke(null)},onClose:Dt}),!G&&n.jsx(is,{title:r,collapsible:s,defaultCollapsed:l,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:Ht,hasColloquial:fn,hasCaption:Ut,contentTypes:we,orientation:je,showOutline:_t,cutLine:qe,showDivLine:Bt,setters:{setContentTypes:Ue,setOrientation:Ye,setShowOutline:Et,setCutLine:pt,setShowDivLine:st,setShowTopInfo:ot,setShowBottomInfo:Je},showCutLine:(be?et:Le)>1,showDivLine2:Ot,middleSections:An,extraSelected:pe,onExtraSelect:De,showPaperBands:We,showTopInfo:He,showBottomInfo:Qe}),$t&&ln?n.jsx("div",{className:"word-table-block__pages",children:ln.map((ae,Ce)=>n.jsx(_a,{orientation:je,contentTypes:we,cutLine:qe,showOutline:_t,showDivLine:Bt,count:et,items:ae,baseItem:p,baseContentTypes:m,onRemoveItem:b,onCopyItem:B,onReorder:w&&((Fe,lt)=>w(Fe+Ce*et,lt+Ce*et)),indexOffset:Ce*et,totalCount:C?.length??0,renderCellAction:I&&((Fe,lt)=>I(Fe+Ce*et,lt)),showFillerAdd:!!N,onActivateCell:N?(Fe=>ke(Fe+Ce*et)):void 0,addableCount:Math.max(0,Math.min(et,Ct-Ce*et)),brand:vt,code:h,contentRef:Fe=>{kt.current[Ce]=Fe},pageNumber:{current:Ce+1,total:ln.length},pageNumberPosition:Mt},Ce))}):n.jsx(_a,{orientation:je,contentTypes:we,cutLine:qe,showOutline:_t,showDivLine:Bt,count:Le,items:te?void 0:C??[],baseItem:te?void 0:p,baseContentTypes:m,editCells:te?Ee:void 0,activeCell:xe,onActivateCell:te||N?ke:void 0,onRemoveCell:te?Wt:void 0,onRemoveItem:te?void 0:b,onCopyItem:te?void 0:B,onReorder:te?void 0:w,renderCellAction:te?void 0:I,brand:vt,code:h,showFillerAdd:!!N,contentRef:tt}),!G&&!M&&O!=null&&n.jsx("div",{className:"word-table-block__table-actions",children:O}),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:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(qn,{required:!0,value:L??"",onChange:Q,placeholder:K?K+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:he?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(L??"").trim()&&(K??"").trim()&&(ae.preventDefault(),Q?.(K??""))}})}),n.jsx(sn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(qn,{value:Z??"",onChange:F,placeholder:T?T+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ae=>{(ae.key==="Tab"&&!ae.shiftKey||ae.key===" ")&&!(Z??"").trim()&&(T??"").trim()&&(ae.preventDefault(),F?.(T??""))}})})]})]}),!G&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!M&&_&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:_}),!M&&v&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:se,onClick:v}),!M&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Jt})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[U&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:U}),!M&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:kn}),E&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:E,onClick:()=>de?ft():ze(!0),disabled:ge,onDisabledClick:()=>{Oe(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:x??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>ze(!1),disabled:j,onDisabledClick:J})]})]}),n.jsx(ya,{message:Me,type:Pe,onClose:dt})]})}const Nw=8;function xd({items:e,className:t}){const{t:a}=_e.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:Be("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:B}){const{t:v}=_e.useTranslation(),A=b!=null,x=h!=null||p!=null||m!=null||g!=null,E=w=>{w.target===w.currentTarget&&!A&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),f?.())};return n.jsxs("div",{className:Be("word-table-button",C?"word-table-button--selected":"",x?"":"word-table-button--no-footer",B),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(fe,{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:w=>{w.stopPropagation(),_(w)}})]}),(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:w=>{w.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
1041
|
* @license lucide-react v1.38.0 - ISC
|
|
1042
1042
|
*
|
|
1043
1043
|
* This source code is licensed under the ISC license.
|
|
@@ -1047,4 +1047,4 @@ ${v.badge}`:v.badge:void 0;if(x&&c(v.code))return null;if(!v.badge&&!h)return p(
|
|
|
1047
1047
|
*
|
|
1048
1048
|
* This source code is licensed under the ISC license.
|
|
1049
1049
|
* 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=re("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}=_e.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}=_e.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),B=_(2),v=_(3),N=u==="image-match"&&m?Math.round((p??0)/m*100):void 0,x=o.useMemo(()=>{if(B!=="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)})}},[B,u,h,m,p,i]);return n.jsx(Rn,{inline:l,className:"popup--word-data-update",title:e,footer:f&&r?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):f?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:s??a,children:i("common.close","\uB2EB\uAE30")}):n.jsx(fe,{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:B,pct:N,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}=_e.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=Iv,exports.Button=fe,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=Fo,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=vn,exports.EffectPartyPopper=Ts,exports.EffectPartyPopperHost=lw,exports.EmptyState=dy,exports.ErrorState=py,exports.FILTER_ALL_VALUE=wn,exports.FileUpload=Q2,exports.FilterPanel=In,exports.FilterSectionInfo=Ua,exports.Footer=N_,exports.GameIntro=Jv,exports.Header=nu,exports.Icon=nt,exports.IconGridMenu=k_,exports.IconRenderer=nt,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=Ii,exports.PROMO_BANNER_BG_OPTIONS=Ay,exports.PROMO_BANNER_BG_VARS=Fa,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=I2,exports.PassCardBgLeftColorGrid=F2,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=yn,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=xn,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=Be,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=Fu,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;
|
|
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=re("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}=_e.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}=_e.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),B=_(2),v=_(3),A=u==="image-match"&&m?Math.round((p??0)/m*100):void 0,x=o.useMemo(()=>{if(B!=="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)})}},[B,u,h,m,p,i]);return n.jsx(Rn,{inline:l,className:"popup--word-data-update",title:e,footer:f&&r?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):f?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:s??a,children:i("common.close","\uB2EB\uAE30")}):n.jsx(fe,{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:B,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}=_e.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=Iv,exports.Button=fe,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=Fo,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=vn,exports.EffectPartyPopper=Ts,exports.EffectPartyPopperHost=lw,exports.EmptyState=dy,exports.ErrorState=py,exports.FILTER_ALL_VALUE=wn,exports.FileUpload=Q2,exports.FilterPanel=In,exports.FilterSectionInfo=Ua,exports.Footer=N_,exports.GameIntro=Jv,exports.Header=nu,exports.Icon=nt,exports.IconGridMenu=k_,exports.IconRenderer=nt,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=Ii,exports.PROMO_BANNER_BG_OPTIONS=Ay,exports.PROMO_BANNER_BG_VARS=Fa,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=I2,exports.PassCardBgLeftColorGrid=F2,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=yn,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=xn,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=Be,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=Fu,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;
|