@ihabdevteam/core 0.361.0 → 0.362.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.
@@ -824,8 +824,8 @@
824
824
  * This source code is licensed under the ISC license.
825
825
  * See the LICENSE file in the root directory of this source tree.
826
826
  */const K1=[["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"}]],Y1=te("thumbs-up",K1),Ys={"alert-triangle":Ls,"align-start-vertical":_d,anchor:n1,armchair:r1,"arrow-down":Bd,"arrow-left":Ad,"arrow-right":Ed,"arrow-right-left":Sd,"arrow-up-a-z":s1,"audio-lines":Td,baby:Ld,ban:Rd,"bar-chart-2":i1,bell:Id,"book-marked":Od,"book-open":Wd,"bow-arrow":Vd,braces:Ud,bug:Kd,calendar:Us,"calendar-check":Zd,"calendar-days":Jd,camera:ep,car:d1,"chart-column":np,"chart-line":rp,"chart-pie":sp,check:$s,"chevron-down":Gs,"chevron-left":Rs,"chevron-right":Ps,"chevron-up":Ks,circle:z1,"clipboard-list":dp,coffee:h1,combine:hp,copy:fp,"chevrons-left-right-ellipsis":gp,"credit-card":yp,database:Is,diff:_p,download:Fs,ear:kp,edit:Np,"edit-2":Dp,"edit-3":jp,ellipsis:Os,eraser:Lp,"external-link":Rp,eye:Ip,"file-text":Op,"flip-horizontal":Wp,"folder-open":Vp,"folder-plus":Up,gamepad:Kp,"gamepad-2":f1,clock:g1,target:y1,percent:x1,gavel:Zp,"git-merge":zs,globe:Qp,"grip-vertical":th,headphones:ah,heart:oh,home:lh,inbox:w1,info:uh,"key-round":dh,landmark:hh,layers:fh,"layout-dashboard":gh,leaf:yh,lightbulb:xh,link:wh,"link-2":kh,"link-2-off":Nh,list:Dh,"list-checks":jh,"list-ordered":Mh,"list-tree":k1,loader:$h,lock:Ph,"log-out":Fh,mail:zh,"map-pin":Hh,menu:q1,"message-circle":qh,"message-circle-question-mark":Gh,"message-square":Yh,"message-square-more":N1,"message-square-text":Xh,minus:D1,"minus-circle":Qh,moon:G1,"more-horizontal":Os,package:tm,palette:am,"party-popper":om,pause:lm,pencil:um,phone:dm,play:hm,"play-circle":fm,plus:gm,printer:ym,"refresh-cw":xm,repeat:wm,replace:km,rocket:Nm,"rotate-ccw":Dm,"rotate-cw":jm,salad:Mm,"scan-search":$m,search:Fm,"circle-alert":Ws,"alert-circle":Ws,"check-circle":Hs,scissors:zm,"search-x":Hm,send:qm,settings:Gm,"share-2":j1,"shield-check":Ym,"shopping-cart":Xm,shuffle:Qm,"skip-back":t0,"skip-forward":a0,sparkles:M1,square:o0,star:l0,store:u0,"sun-medium":d0,table:h0,"table-2":f0,tag:g0,terminal:y0,"text-cursor-input":x0,"text-initial":w0,"thumbs-up":Y1,ticket:k0,trash:D0,triangle:H1,"trash-2":N0,"trending-up":j0,"triangle-alert":Ls,trophy:M0,type:$1,unlink:$0,upload:P0,user:Pr,"user-plus":O0,"user-round":W0,"user-round-check":V0,users:U0,"users-round":K0,volume:P1,"volume-2":Vs,wrench:X0,x:qs,zap:e1};function Z1(e){return Ys[e]??null}const Zs=new Set;function X1(e){return $n&&!(e in Ys)&&!Zs.has(e)&&(Zs.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 J1=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 Q1(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?J1(a):null}const Xs=new Map;function ef(e){const t=typeof e=="string"?Q1(e):null,a=t?Z1(t)??Xs.get(t)??null:null,[r,l]=o.useState(null);return o.useEffect(()=>{if(!t||a)return;let s=!1;return X1(t).then(i=>{Xs.set(t,i),s||l(i)}),()=>{s=!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 Js(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 tf(e){if(Array.isArray(e))return e}function nf(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r,l,s,i,u=[],c=!0,d=!1;try{if(s=(a=a.call(e)).next,t!==0)for(;!(c=(r=s.call(a)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(h){d=!0,l=h}finally{try{if(!c&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(d)throw l}}return u}}function af(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
827
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rf(e,t){return tf(e)||nf(e,t)||of(e,t)||af()}function of(e,t){if(e){if(typeof e=="string")return Js(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)?Js(e,t):void 0}}const Qs=Object.entries,el=Object.setPrototypeOf,sf=Object.isFrozen,lf=Object.getPrototypeOf,uf=Object.getOwnPropertyDescriptor;let jt=Object.freeze,Mt=Object.seal,aa=Object.create,tl=typeof Reflect<"u"&&Reflect,Ir=tl.apply,Fr=tl.construct;jt||(jt=function(t){return t}),Mt||(Mt=function(t){return t}),Ir||(Ir=function(t,a){for(var r=arguments.length,l=new Array(r>2?r-2:0),s=2;s<r;s++)l[s-2]=arguments[s];return t.apply(a,l)}),Fr||(Fr=function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return new t(...r)});const Vn=Dt(Array.prototype.forEach),cf=Dt(Array.prototype.lastIndexOf),nl=Dt(Array.prototype.pop),_a=Dt(Array.prototype.push),df=Dt(Array.prototype.splice),ra=Array.isArray,wa=Dt(String.prototype.toLowerCase),Or=Dt(String.prototype.toString),al=Dt(String.prototype.match),Ba=Dt(String.prototype.replace),rl=Dt(String.prototype.indexOf),pf=Dt(String.prototype.trim),hf=Dt(Number.prototype.toString),mf=Dt(Boolean.prototype.toString),ol=typeof BigInt>"u"?null:Dt(BigInt.prototype.toString),sl=typeof Symbol>"u"?null:Dt(Symbol.prototype.toString),Xt=Dt(Object.prototype.hasOwnProperty),ka=Dt(Object.prototype.toString),It=Dt(RegExp.prototype.test),qn=ff(TypeError);function Dt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return Ir(e,t,r)}}function ff(e){return function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Fr(e,a)}}function ct(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wa;if(el&&el(e,null),!ra(t))return e;let r=t.length;for(;r--;){let l=t[r];if(typeof l=="string"){const s=a(l);s!==l&&(sf(t)||(t[r]=s),l=s)}e[l]=!0}return e}function Cf(e){for(let t=0;t<e.length;t++)Xt(e,t)||(e[t]=null);return e}function an(e){const t=aa(null);for(const r of Qs(e)){var a=rf(r,2);const l=a[0],s=a[1];Xt(e,l)&&(ra(s)?t[l]=Cf(s):s&&typeof s=="object"&&s.constructor===Object?t[l]=an(s):t[l]=s)}return t}function gf(e){switch(typeof e){case"string":return e;case"number":return hf(e);case"boolean":return mf(e);case"bigint":return ol?ol(e):"0";case"symbol":return sl?sl(e):"Symbol()";case"undefined":return ka(e);case"function":case"object":{if(e===null)return ka(e);const t=e,a=hn(t,"toString");if(typeof a=="function"){const r=a(t);return typeof r=="string"?r:ka(r)}return ka(e)}default:return ka(e)}}function hn(e,t){for(;e!==null;){const r=uf(e,t);if(r){if(r.get)return Dt(r.get);if(typeof r.value=="function")return Dt(r.value)}e=lf(e)}function a(){return null}return a}function bf(e){try{return It(e,""),!0}catch{return!1}}const ll=jt(["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"]),zr=jt(["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"]),Wr=jt(["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"]),yf=jt(["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"]),Hr=jt(["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"]),vf=jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),il=jt(["#text"]),ul=jt(["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"]),Vr=jt(["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=jt(["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"]),Qa=jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xf=Mt(/{{[\w\W]*|^[\w\W]*}}/g),_f=Mt(/<%[\w\W]*|^[\w\W]*%>/g),wf=Mt(/\${[\w\W]*/g),Bf=Mt(/^data-[\-\w.\u00B7-\uFFFF]+$/),kf=Mt(/^aria-[\-\w]+$/),dl=Mt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Af=Mt(/^(?:\w+script|data):/i),Nf=Mt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ef=Mt(/^html$/i),Df=Mt(/^[a-z][.\w]*(-[.\w]+)+$/i),pl=Mt(/<[/\w!]/g),hl=Mt(/<[/\w]/g),Sf=Mt(/<\/no(script|embed|frames)/i),jf=Mt(/\/>/i),rn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ml=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Tf=jt(ct({},ml)),Mf=(function(){const e={};return Vn(ml,t=>{e[t]=Mt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),jt(e)})(),Lf=function(){return typeof window>"u"?null:window},$f=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";a&&a.hasAttribute(l)&&(r=a.getAttribute(l));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},fl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Rn=function(t,a,r,l){return Xt(t,a)&&ra(t[a])?ct(l.base?an(l.base):{},t[a],l.transform):r},qr=function(t,a,r){const l=Xt(t,a)?t[a]:void 0;return l&&typeof l=="object"?an(l):r()};function Cl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lf();const t=be=>Cl(be);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==rn.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const r=a,l=r.currentScript;e.DocumentFragment;const s=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,f=u.prototype,b=hn(f,"cloneNode"),x=hn(f,"remove"),C=hn(f,"nextSibling"),m=hn(f,"childNodes"),_=hn(f,"parentNode"),g=hn(f,"shadowRoot"),A=hn(f,"attributes"),y=i&&i.prototype?hn(i.prototype,"nodeType"):null,w=i&&i.prototype?hn(i.prototype,"nodeName"):null,v=i&&i.prototype?hn(i.prototype,"ownerDocument"):null,B=function(j){return y?y(j):j.nodeType},k=function(j){return w?w(j):j.nodeName};if(typeof s=="function"){const be=a.createElement("template");be.content&&be.content.ownerDocument&&(a=be.content.ownerDocument)}let E,D="",N,I=!1,R=0;const Y=function(){if(R>0)throw qn('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){Y(),R++;try{return E.createHTML(j)}finally{R--}},T=function(j){Y(),R++;try{return E.createScriptURL(j)}finally{R--}},L=function(){return I||(N=$f(p,l),I=!0),N},Z=a,G=Z.implementation,O=Z.createNodeIterator,U=Z.createDocumentFragment,$=Z.getElementsByTagName,H=r.importNode;let z=fl();t.isSupported=typeof Qs=="function"&&typeof _=="function"&&G&&G.createHTMLDocument!==void 0;const V=xf,S=_f,P=wf,F=Bf,X=kf,se=Af,ae=Nf,me=Df;let ne=dl,W=null;const ie=ct({},[...ll,...zr,...Wr,...Hr,...il]);let q=null;const K=ct({},[...ul,...Vr,...cl,...Qa]);let ce=Object.seal(aa(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}})),ke=null,ye=null;const de=Object.seal(aa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,he=!1,pe=!0,Me=!1,ze=!0,Le=!1,Fe=!1,We=null,pt=null,it=!1,at=!1,ht=!1,Ne=!1,Ve=!0,we=!1;const Ue="user-content-";let Ae=!0,$e=!1,Se={},Xe=null;const gt=ct({},["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 nt=null;const Je=ct({},["audio","video","img","source","image","track"]);let _t=null;const mt=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",bt="http://www.w3.org/1999/xhtml";let Ke=bt,re=!1,Ee=null;const Qe=ct({},[wt,vt,bt],Or),qe=jt(["mi","mo","mn","ms","mtext"]);let rt=ct({},qe);const Te=jt(["annotation-xml"]);let ut=ct({},Te);const Re=ct({},["title","style","font","a","script"]);let ot=null;const ft=["application/xhtml+xml","text/html"],Bt="text/html";let Ze=null,st=null;const lt=a.createElement("form"),dt=function(j){return j instanceof RegExp||j instanceof Function},kt=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(st&&st===j)return;(!j||typeof j!="object")&&(j={}),j=an(j),ot=ft.indexOf(j.PARSER_MEDIA_TYPE)===-1?Bt:j.PARSER_MEDIA_TYPE,Ze=ot==="application/xhtml+xml"?Or:wa,W=Rn(j,"ALLOWED_TAGS",ie,{transform:Ze}),q=Rn(j,"ALLOWED_ATTR",K,{transform:Ze}),Ee=Rn(j,"ALLOWED_NAMESPACES",Qe,{transform:Or}),_t=Rn(j,"ADD_URI_SAFE_ATTR",mt,{transform:Ze,base:mt}),nt=Rn(j,"ADD_DATA_URI_TAGS",Je,{transform:Ze,base:Je}),Xe=Rn(j,"FORBID_CONTENTS",gt,{transform:Ze}),ke=Rn(j,"FORBID_TAGS",an({}),{transform:Ze}),ye=Rn(j,"FORBID_ATTR",an({}),{transform:Ze}),Se=Xt(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?an(j.USE_PROFILES):j.USE_PROFILES:!1,oe=j.ALLOW_ARIA_ATTR!==!1,ge=j.ALLOW_DATA_ATTR!==!1,he=j.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=j.SAFE_FOR_TEMPLATES||!1,ze=j.SAFE_FOR_XML!==!1,Le=j.WHOLE_DOCUMENT||!1,at=j.RETURN_DOM||!1,ht=j.RETURN_DOM_FRAGMENT||!1,Ne=j.RETURN_TRUSTED_TYPE||!1,it=j.FORCE_BODY||!1,Ve=j.SANITIZE_DOM!==!1,we=j.SANITIZE_NAMED_PROPS||!1,Ae=j.KEEP_CONTENT!==!1,$e=j.IN_PLACE||!1,ne=bf(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:dl,Ke=typeof j.NAMESPACE=="string"?j.NAMESPACE:bt,rt=qr(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>ct({},qe)),ut=qr(j,"HTML_INTEGRATION_POINTS",()=>ct({},Te));const Q=qr(j,"CUSTOM_ELEMENT_HANDLING",()=>aa(null));if(ce=aa(null),Xt(Q,"tagNameCheck")&&dt(Q.tagNameCheck)&&(ce.tagNameCheck=Q.tagNameCheck),Xt(Q,"attributeNameCheck")&&dt(Q.attributeNameCheck)&&(ce.attributeNameCheck=Q.attributeNameCheck),Xt(Q,"allowCustomizedBuiltInElements")&&typeof Q.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=Q.allowCustomizedBuiltInElements),Mt(ce),Me&&(ge=!1),ht&&(at=!0),Se&&(W=ct({},il),q=aa(null),Se.html===!0&&(ct(W,ll),ct(q,ul)),Se.svg===!0&&(ct(W,zr),ct(q,Vr),ct(q,Qa)),Se.svgFilters===!0&&(ct(W,Wr),ct(q,Vr),ct(q,Qa)),Se.mathMl===!0&&(ct(W,Hr),ct(q,cl),ct(q,Qa))),de.tagCheck=null,de.attributeCheck=null,Xt(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?de.tagCheck=j.ADD_TAGS:ra(j.ADD_TAGS)&&(W===ie&&(W=an(W)),ct(W,j.ADD_TAGS,Ze))),Xt(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?de.attributeCheck=j.ADD_ATTR:ra(j.ADD_ATTR)&&(q===K&&(q=an(q)),ct(q,j.ADD_ATTR,Ze))),Xt(j,"ADD_FORBID_CONTENTS")&&ra(j.ADD_FORBID_CONTENTS)&&(Xe===gt&&(Xe=an(Xe)),ct(Xe,j.ADD_FORBID_CONTENTS,Ze)),Ae&&(W["#text"]=!0),Le&&ct(W,["html","head","body"]),W.table&&(ct(W,["tbody"]),delete ke.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const fe=E;E=j.TRUSTED_TYPES_POLICY;try{D=M("")}catch(De){throw E=fe,De}}else j.TRUSTED_TYPES_POLICY===null?(E=void 0,D=""):(E===void 0&&(E=L()),E&&typeof D=="string"&&(D=M("")));jt&&jt(j),st=j},Vt=ct({},[...zr,...Wr,...yf]),en=ct({},[...Hr,...vf]),Cn=function(j,Q,fe){return Q.namespaceURI===bt?j==="svg":Q.namespaceURI===wt?j==="svg"&&(fe==="annotation-xml"||rt[fe]):!!Vt[j]},jn=function(j,Q,fe){return Q.namespaceURI===bt?j==="math":Q.namespaceURI===vt?j==="math"&&ut[fe]:!!en[j]},Wn=function(j,Q,fe){return Q.namespaceURI===vt&&!ut[fe]||Q.namespaceURI===wt&&!rt[fe]?!1:!en[j]&&(Re[j]||!Vt[j])},Hn=function(j){let Q=_(j);(!Q||!Q.tagName)&&(Q={namespaceURI:Ke,tagName:"template"});const fe=wa(j.tagName),De=wa(Q.tagName);return Ee[j.namespaceURI]?j.namespaceURI===vt?Cn(fe,Q,De):j.namespaceURI===wt?jn(fe,Q,De):j.namespaceURI===bt?Wn(fe,Q,De):!!(ot==="application/xhtml+xml"&&Ee[j.namespaceURI]):!1},qt=function(j){_a(t.removed,{element:j});try{_(j).removeChild(j)}catch{if(x(j),!_(j))throw qn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},dn=function(j,Q,fe){try{j.removeAttributeNode(Q)}catch{try{j.removeAttribute(fe)}catch{}}},Ut=function(j){ln(j);const Q=m(j);if(Q){const De=[];Vn(Q,Ie=>{_a(De,Ie)}),Vn(De,Ie=>{try{x(Ie)}catch{}})}const fe=A(j);if(fe)for(let De=fe.length-1;De>=0;--De){const Ie=fe[De],Ye=Ie&&Ie.name;typeof Ye=="string"&&dn(j,Ie,Ye)}},Lt=function(j,Q,fe){if(!fe)try{fe=Q.getAttributeNode(j)}catch{fe=null}_a(t.removed,{attribute:fe||null,from:Q});try{fe?Q.removeAttributeNode(fe):Q.removeAttribute(j)}catch{try{Q.removeAttribute(j)}catch{}}if(j==="is")if(at||ht)try{qt(Q)}catch{}else try{Q.setAttribute(j,"")}catch{}},Tn=function(j){const Q=A(j);if(Q)for(let fe=Q.length-1;fe>=0;--fe){const De=Q[fe],Ie=De&&De.name;typeof Ie!="string"||q[Ze(Ie)]||dn(j,De,Ie)}},ln=function(j){const Q=[j];for(;Q.length>0;){const fe=Q.pop();B(fe)===rn.element&&Tn(fe);const Ie=m(fe);if(Ie)for(let Ye=Ie.length-1;Ye>=0;--Ye)Q.push(Ie[Ye])}},Mn=function(j,Q){return ze?j==="patchsrc"?!0:j==="for"&&Q!=="label"&&Q!=="output":!1},Ln=function(j){if(!ze)return;const Q=[j];for(;Q.length>0;){const fe=Q.pop(),De=B(fe);if(De===rn.processingInstruction||De===rn.comment&&It(hl,fe.data)){try{x(fe)}catch{}continue}if(De===rn.element){const Ye=fe,yt=Ze(k(fe));try{Ye.hasAttribute&&Ye.hasAttribute("patchsrc")&&Ye.removeAttribute("patchsrc"),Ye.hasAttribute&&Ye.hasAttribute("for")&&Mn("for",yt)&&Ye.removeAttribute("for")}catch{}}const Ie=m(fe);if(Ie)for(let Ye=Ie.length-1;Ye>=0;--Ye)Q.push(Ie[Ye])}},xn=function(j){let Q=null,fe=null;if(it)j="<remove></remove>"+j;else{const Ye=al(j,/^[\r\n\t ]+/);fe=Ye&&Ye[0]}ot==="application/xhtml+xml"&&Ke===bt&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const De=E?M(j):j;if(Ke===bt)try{Q=new h().parseFromString(De,ot)}catch{}if(!Q||!Q.documentElement){Q=G.createDocument(Ke,"template",null);try{Q.documentElement.innerHTML=re?D:De}catch{}}const Ie=Q.body||Q.documentElement;return j&&fe&&Ie.insertBefore(a.createTextNode(fe),Ie.childNodes[0]||null),Ke===bt?$.call(Q,Le?"html":"body")[0]:Le?Q.documentElement:Ie},Gt=function(j){const Q=v?v(j):j.ownerDocument;return O.call(Q||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ft=function(j){return j=Ba(j,V," "),j=Ba(j,S," "),j=Ba(j,P," "),j},$t=function(j){var Q;j.normalize();const fe=v?v(j):j.ownerDocument,De=O.call(fe||j,j,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ie=De.nextNode();for(;Ie;)Ie.data=Ft(Ie.data),Ie=De.nextNode();const Ye=(Q=j.querySelectorAll)===null||Q===void 0?void 0:Q.call(j,"template");Ye&&Vn(Ye,yt=>{Ot(yt.content)&&$t(yt.content)})},pn=function(j){const Q=w?w(j):null;return typeof Q!="string"||Ze(Q)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==A(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==y(j)||j.childNodes!==m(j)},Ot=function(j){if(!y||typeof j!="object"||j===null)return!1;try{return y(j)===rn.documentFragment}catch{return!1}},tn=function(j){if(!y||typeof j!="object"||j===null)return!1;try{return typeof y(j)=="number"}catch{return!1}};function Tt(be,j,Q){be.length!==0&&Vn(be,fe=>{fe.call(t,j,Q,st)})}const Kt=function(j,Q){return!!(ze&&j.hasChildNodes()&&!tn(j.firstElementChild)&&It(pl,j.textContent)&&It(pl,j.innerHTML)||ze&&j.namespaceURI===bt&&Tf[Q]&&(tn(j.firstElementChild)||typeof j.textContent=="string"&&It(Mf[Q],j.textContent))||j.nodeType===rn.processingInstruction||ze&&j.nodeType===rn.comment&&It(hl,j.data))},le=function(j,Q){if(j instanceof RegExp)return It(j,Q);if(j instanceof Function){for(var fe=arguments.length,De=new Array(fe>2?fe-2:0),Ie=2;Ie<fe;Ie++)De[Ie-2]=arguments[Ie];return!!j(Q,...De)}return!1},Be=function(j,Q,fe){if(!ke[Q]&&ee(Q)&&le(ce.tagNameCheck,Q))return!1;if(Ae&&!Xe[Q]){const De=_(j),Ie=m(j);if(Ie&&De){const Ye=Ie.length;for(let yt=Ye-1;yt>=0;--yt){const At=j===fe?b(Ie[yt],!0):Ie[yt];De.insertBefore(At,C(j))}}}return qt(j),!0},je=function(j,Q,fe,De){return j.length===0?Q:Q===fe||Q===De?an(Q):Q},Ge=function(j,Q){return j===Q||_(j)!==null?!1:($e&&ln(j),!0)},Oe=function(j,Q){if(Tt(z.beforeSanitizeElements,j,null),Ge(j,Q))return!0;if(pn(j))return qt(j),!0;const fe=Ze(k(j));if(W=je(z.uponSanitizeElement,W,ie,We),Tt(z.uponSanitizeElement,j,{tagName:fe,allowedTags:W}),Ge(j,Q))return!0;if(Kt(j,fe))return qt(j),!0;if(ke[fe]||!(de.tagCheck instanceof Function&&de.tagCheck(fe))&&!W[fe]){const Ie=Be(j,fe,Q);return Ie===!1&&Tt(z.afterSanitizeElements,j,null),Ie}if(B(j)===rn.element&&!Hn(j)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&It(Sf,j.innerHTML))return qt(j),!0;if(Me&&j.nodeType===rn.text){const Ie=Ft(j.textContent);j.textContent!==Ie&&(_a(t.removed,{element:j.cloneNode()}),j.textContent=Ie)}return Tt(z.afterSanitizeElements,j,null),!1},J=function(j,Q,fe){if(ye[Q]||Mn(Q,j)||Ve&&(Q==="id"||Q==="name")&&(fe in a||fe in lt))return!1;const De=q[Q]||de.attributeCheck instanceof Function&&de.attributeCheck(Q,j);return ge&&It(F,Q)||oe&&It(X,Q)?!0:De?_t[Q]||It(ne,Ba(fe,ae,""))||(Q==="src"||Q==="xlink:href"||Q==="href")&&j!=="script"&&rl(fe,"data:")===0&&nt[j]||he&&!It(se,Ba(fe,ae,""))?!0:!fe:ee(j)&&le(ce.tagNameCheck,j)&&le(ce.attributeNameCheck,Q,j)||Q==="is"&&ce.allowCustomizedBuiltInElements&&le(ce.tagNameCheck,fe)},ue=ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ee=function(j){return!ue[wa(j)]&&It(me,j)},ve=function(j,Q,fe,De){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!fe)switch(p.getAttributeType(j,Q)){case"TrustedHTML":return M(De);case"TrustedScriptURL":return T(De)}return De},Pe=function(j,Q,fe,De){try{fe?j.setAttributeNS(fe,Q,De):j.setAttribute(Q,De),pn(j)?qt(j):nl(t.removed)}catch{Lt(Q,j)}},He=function(j){Tt(z.beforeSanitizeAttributes,j,null);const Q=j.attributes;if(!Q||pn(j))return;q=je(z.uponSanitizeAttribute,q,K,pt);const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let De=Q.length;const Ie=Ze(j.nodeName);for(;De--;){const Ye=Q[De],yt=Ye.name,At=Ye.namespaceURI,Yt=Ye.value,Zt=Ze(yt),$r=Yt;let zt=yt==="value"?$r:pf($r);if(fe.attrName=Zt,fe.attrValue=zt,fe.keepAttr=!0,fe.forceKeepAttr=void 0,Tt(z.uponSanitizeAttribute,j,fe),zt=fe.attrValue,we&&(Zt==="id"||Zt==="name")&&rl(zt,Ue)!==0&&(Lt(yt,j,Ye),zt=Ue+zt),ze&&It(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,zt)){Lt(yt,j,Ye);continue}if(Zt==="attributename"&&al(zt,"href")){Lt(yt,j,Ye);continue}if(!fe.forceKeepAttr){if(!fe.keepAttr){Lt(yt,j,Ye);continue}if(!pe&&It(jf,zt)){Lt(yt,j,Ye);continue}if(Me&&(zt=Ft(zt)),!J(Ie,Zt,zt)){Lt(yt,j,Ye);continue}zt=ve(Ie,Zt,At,zt),zt!==$r&&Pe(j,yt,At,zt)}}Tt(z.afterSanitizeAttributes,j,null)},tt=function(j){let Q=null;const fe=Gt(j);for(Tt(z.beforeSanitizeShadowDOM,j,null);Q=fe.nextNode();)if(Tt(z.uponSanitizeShadowNode,Q,null),Oe(Q,j),He(Q),Ot(Q.content)&&tt(Q.content),B(Q)===rn.element){const De=g(Q);Ot(De)&&(Ct(De),tt(De))}Tt(z.afterSanitizeShadowDOM,j,null)},Ct=function(j){const Q=[{node:j,shadow:null}];for(;Q.length>0;){const fe=Q.pop();if(fe.shadow){tt(fe.shadow);continue}const De=fe.node,Ye=B(De)===rn.element,yt=m(De);if(yt)for(let At=yt.length-1;At>=0;--At)Q.push({node:yt[At],shadow:null});if(Ye){const At=w?w(De):null;if(typeof At=="string"&&Ze(At)==="template"){const Yt=De.content;Ot(Yt)&&Q.push({node:Yt,shadow:null})}}if(Ye){const At=g(De);Ot(At)&&Q.push({node:null,shadow:At},{node:At,shadow:null})}}};return t.sanitize=function(be){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,fe=null,De=null,Ie=null;if(re=!be,re&&(be="<!-->"),typeof be!="string"&&!tn(be)&&(be=gf(be),typeof be!="string"))throw qn("dirty is not a string, aborting");if(!t.isSupported)return be;Fe?(W=We,q=pt):kt(j),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(W=an(W)),z.uponSanitizeAttribute.length>0&&(q=an(q)),t.removed=[];const Ye=$e&&typeof be!="string"&&tn(be);if(Ye){Ln(be);const Yt=k(be);if(typeof Yt=="string"){const Zt=Ze(Yt);if(!W[Zt]||ke[Zt])throw Ut(be),qn("root node is forbidden and cannot be sanitized in-place")}if(pn(be))throw Ut(be),qn("root node is clobbered and cannot be sanitized in-place");try{Ct(be)}catch(Zt){throw Ut(be),Zt}}else if(tn(be))Q=xn("<!---->"),fe=Q.ownerDocument.importNode(be,!0),fe.nodeType===rn.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?Q=fe:Q.appendChild(fe),Ct(fe);else{if(!at&&!Me&&!Le&&be.indexOf("<")===-1)return E&&Ne?M(be):be;if(Q=xn(be),!Q)return at?null:Ne?D:""}Q&&it&&qt(Q.firstChild);const yt=Ye?be:Q;try{const Yt=Gt(yt);for(;De=Yt.nextNode();)Oe(De,yt),He(De),Ot(De.content)&&tt(De.content)}catch(Yt){throw Ye&&(Ut(be),Vn(t.removed,Zt=>{Zt.element&&ln(Zt.element)})),Yt}if(Ye)return Vn(t.removed,Yt=>{Yt.element&&ln(Yt.element)}),Me&&$t(be),be;if(at){if(Me&&$t(Q),ht)for(Ie=U.call(Q.ownerDocument);Q.firstChild;)Ie.appendChild(Q.firstChild);else Ie=Q;return(q.shadowroot||q.shadowrootmode)&&(Ie=H.call(r,Ie,!0)),Ie}let At=Le?Q.outerHTML:Q.innerHTML;return Le&&W["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&It(Ef,Q.ownerDocument.doctype.name)&&(At="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
828
- `+At),Me&&(At=Ft(At)),E&&Ne?M(At):At},t.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kt(be),Fe=!0,We=W,pt=q},t.clearConfig=function(){st=null,Fe=!1,We=null,pt=null,E=N,D=""},t.isValidAttribute=function(be,j,Q){st||kt({});const fe=Ze(be),De=Ze(j);return J(fe,De,Q)},t.addHook=function(be,j){typeof j=="function"&&Xt(z,be)&&_a(z[be],j)},t.removeHook=function(be,j){if(Xt(z,be)){if(j!==void 0){const Q=cf(z[be],j);return Q===-1?void 0:df(z[be],Q,1)[0]}return nl(z[be])}},t.removeHooks=function(be){Xt(z,be)&&(z[be]=[])},t.removeAllHooks=function(){z=fl()},t}var oa=Cl();let Ur=null;const Rf=1500;function Gr(){Ur?.clear(),Ur=null}function Pf(e,{onEnd:t,rate:a=.9}={}){if(typeof window>"u"||typeof SpeechSynthesisUtterance>"u"||!("speechSynthesis"in window)){t?.();return}const r=window.speechSynthesis;Gr();let l=!1;const s=()=>{if(!l){l=!0;try{t?.()}catch{}}};try{r.cancel()}catch{s();return}const i=()=>{Gr();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?s:null,d.onerror=t?s:null,r.speak(d)}catch{s()}};let u;try{u=r.getVoices()}catch{s();return}if(u.length>0){i();return}const c=setTimeout(i,Rf);try{r.addEventListener("voiceschanged",i,{once:!0})}catch{clearTimeout(c),s();return}Ur={clear:()=>{clearTimeout(c),r.removeEventListener("voiceschanged",i)}}}function Kr(){Gr(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()}const If=/^(?:[a-z]+:)?\/\//i,Ff="__ihab_core_asset_base_url__";function Of(){return globalThis[Ff]??""}function Yr(e){const t=String(e||"").trim();if(!t)return"";if(If.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const a=t.startsWith("/")?t:`/${t}`,r=Of();return r?`${r}${a}`:a}const gl="__ihab_core_storage_resolvers__";function Aa(){return globalThis[gl]??null}function zf(e){globalThis[gl]=e}let bl=class extends Error{constructor(t){super(`
827
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rf(e,t){return tf(e)||nf(e,t)||of(e,t)||af()}function of(e,t){if(e){if(typeof e=="string")return Js(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)?Js(e,t):void 0}}const Qs=Object.entries,el=Object.setPrototypeOf,sf=Object.isFrozen,lf=Object.getPrototypeOf,uf=Object.getOwnPropertyDescriptor;let jt=Object.freeze,Mt=Object.seal,aa=Object.create,tl=typeof Reflect<"u"&&Reflect,Ir=tl.apply,Fr=tl.construct;jt||(jt=function(t){return t}),Mt||(Mt=function(t){return t}),Ir||(Ir=function(t,a){for(var r=arguments.length,l=new Array(r>2?r-2:0),s=2;s<r;s++)l[s-2]=arguments[s];return t.apply(a,l)}),Fr||(Fr=function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return new t(...r)});const Vn=Dt(Array.prototype.forEach),cf=Dt(Array.prototype.lastIndexOf),nl=Dt(Array.prototype.pop),_a=Dt(Array.prototype.push),df=Dt(Array.prototype.splice),ra=Array.isArray,wa=Dt(String.prototype.toLowerCase),Or=Dt(String.prototype.toString),al=Dt(String.prototype.match),Ba=Dt(String.prototype.replace),rl=Dt(String.prototype.indexOf),pf=Dt(String.prototype.trim),hf=Dt(Number.prototype.toString),mf=Dt(Boolean.prototype.toString),ol=typeof BigInt>"u"?null:Dt(BigInt.prototype.toString),sl=typeof Symbol>"u"?null:Dt(Symbol.prototype.toString),Xt=Dt(Object.prototype.hasOwnProperty),ka=Dt(Object.prototype.toString),It=Dt(RegExp.prototype.test),qn=ff(TypeError);function Dt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];return Ir(e,t,r)}}function ff(e){return function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Fr(e,a)}}function ut(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wa;if(el&&el(e,null),!ra(t))return e;let r=t.length;for(;r--;){let l=t[r];if(typeof l=="string"){const s=a(l);s!==l&&(sf(t)||(t[r]=s),l=s)}e[l]=!0}return e}function Cf(e){for(let t=0;t<e.length;t++)Xt(e,t)||(e[t]=null);return e}function an(e){const t=aa(null);for(const r of Qs(e)){var a=rf(r,2);const l=a[0],s=a[1];Xt(e,l)&&(ra(s)?t[l]=Cf(s):s&&typeof s=="object"&&s.constructor===Object?t[l]=an(s):t[l]=s)}return t}function gf(e){switch(typeof e){case"string":return e;case"number":return hf(e);case"boolean":return mf(e);case"bigint":return ol?ol(e):"0";case"symbol":return sl?sl(e):"Symbol()";case"undefined":return ka(e);case"function":case"object":{if(e===null)return ka(e);const t=e,a=hn(t,"toString");if(typeof a=="function"){const r=a(t);return typeof r=="string"?r:ka(r)}return ka(e)}default:return ka(e)}}function hn(e,t){for(;e!==null;){const r=uf(e,t);if(r){if(r.get)return Dt(r.get);if(typeof r.value=="function")return Dt(r.value)}e=lf(e)}function a(){return null}return a}function bf(e){try{return It(e,""),!0}catch{return!1}}const ll=jt(["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"]),zr=jt(["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"]),Wr=jt(["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"]),yf=jt(["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"]),Hr=jt(["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"]),vf=jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),il=jt(["#text"]),ul=jt(["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"]),Vr=jt(["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=jt(["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"]),Qa=jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xf=Mt(/{{[\w\W]*|^[\w\W]*}}/g),_f=Mt(/<%[\w\W]*|^[\w\W]*%>/g),wf=Mt(/\${[\w\W]*/g),Bf=Mt(/^data-[\-\w.\u00B7-\uFFFF]+$/),kf=Mt(/^aria-[\-\w]+$/),dl=Mt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Af=Mt(/^(?:\w+script|data):/i),Nf=Mt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ef=Mt(/^html$/i),Df=Mt(/^[a-z][.\w]*(-[.\w]+)+$/i),pl=Mt(/<[/\w!]/g),hl=Mt(/<[/\w]/g),Sf=Mt(/<\/no(script|embed|frames)/i),jf=Mt(/\/>/i),rn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ml=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Tf=jt(ut({},ml)),Mf=(function(){const e={};return Vn(ml,t=>{e[t]=Mt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),jt(e)})(),Lf=function(){return typeof window>"u"?null:window},$f=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";a&&a.hasAttribute(l)&&(r=a.getAttribute(l));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},fl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Rn=function(t,a,r,l){return Xt(t,a)&&ra(t[a])?ut(l.base?an(l.base):{},t[a],l.transform):r},qr=function(t,a,r){const l=Xt(t,a)?t[a]:void 0;return l&&typeof l=="object"?an(l):r()};function Cl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lf();const t=be=>Cl(be);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==rn.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const r=a,l=r.currentScript;e.DocumentFragment;const s=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,f=u.prototype,b=hn(f,"cloneNode"),x=hn(f,"remove"),C=hn(f,"nextSibling"),m=hn(f,"childNodes"),_=hn(f,"parentNode"),g=hn(f,"shadowRoot"),A=hn(f,"attributes"),y=i&&i.prototype?hn(i.prototype,"nodeType"):null,w=i&&i.prototype?hn(i.prototype,"nodeName"):null,v=i&&i.prototype?hn(i.prototype,"ownerDocument"):null,B=function(j){return y?y(j):j.nodeType},k=function(j){return w?w(j):j.nodeName};if(typeof s=="function"){const be=a.createElement("template");be.content&&be.content.ownerDocument&&(a=be.content.ownerDocument)}let E,D="",N,I=!1,P=0;const K=function(){if(P>0)throw qn('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.')},T=function(j){K(),P++;try{return E.createHTML(j)}finally{P--}},M=function(j){K(),P++;try{return E.createScriptURL(j)}finally{P--}},L=function(){return I||(N=$f(p,l),I=!0),N},Q=a,H=Q.implementation,O=Q.createNodeIterator,U=Q.createDocumentFragment,$=Q.getElementsByTagName,V=r.importNode;let z=fl();t.isSupported=typeof Qs=="function"&&typeof _=="function"&&H&&H.createHTMLDocument!==void 0;const Y=xf,S=_f,R=wf,F=Bf,Z=kf,pe=Af,re=Nf,oe=Df;let ae=dl,W=null;const ie=ut({},[...ll,...zr,...Wr,...Hr,...il]);let q=null;const G=ut({},[...ul,...Vr,...cl,...Qa]);let de=Object.seal(aa(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}})),Ee=null,ye=null;const he=Object.seal(aa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let se=!0,Ce=!0,ge=!1,ce=!0,Me=!1,Oe=!0,Le=!1,ze=!1,We=null,dt=null,lt=!1,at=!1,ht=!1,Ae=!1,qe=!0,we=!1;const Ue="user-content-";let ke=!0,$e=!1,je={},Ze=null;const yt=ut({},["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 et=null;const Xe=ut({},["audio","video","img","source","image","track"]);let _t=null;const Ct=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",Bt="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let rt=mt,ne=!1,Ne=null;const Je=ut({},[wt,Bt,mt],Or),Ve=jt(["mi","mo","mn","ms","mtext"]);let it=ut({},Ve);const Se=jt(["annotation-xml"]);let pt=ut({},Se);const gt=ut({},["title","style","font","a","script"]);let Pe=null;const nt=["application/xhtml+xml","text/html"],vt="text/html";let Ge=null,ot=null;const st=a.createElement("form"),ct=function(j){return j instanceof RegExp||j instanceof Function},kt=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===j)return;(!j||typeof j!="object")&&(j={}),j=an(j),Pe=nt.indexOf(j.PARSER_MEDIA_TYPE)===-1?vt:j.PARSER_MEDIA_TYPE,Ge=Pe==="application/xhtml+xml"?Or:wa,W=Rn(j,"ALLOWED_TAGS",ie,{transform:Ge}),q=Rn(j,"ALLOWED_ATTR",G,{transform:Ge}),Ne=Rn(j,"ALLOWED_NAMESPACES",Je,{transform:Or}),_t=Rn(j,"ADD_URI_SAFE_ATTR",Ct,{transform:Ge,base:Ct}),et=Rn(j,"ADD_DATA_URI_TAGS",Xe,{transform:Ge,base:Xe}),Ze=Rn(j,"FORBID_CONTENTS",yt,{transform:Ge}),Ee=Rn(j,"FORBID_TAGS",an({}),{transform:Ge}),ye=Rn(j,"FORBID_ATTR",an({}),{transform:Ge}),je=Xt(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?an(j.USE_PROFILES):j.USE_PROFILES:!1,se=j.ALLOW_ARIA_ATTR!==!1,Ce=j.ALLOW_DATA_ATTR!==!1,ge=j.ALLOW_UNKNOWN_PROTOCOLS||!1,ce=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=j.SAFE_FOR_TEMPLATES||!1,Oe=j.SAFE_FOR_XML!==!1,Le=j.WHOLE_DOCUMENT||!1,at=j.RETURN_DOM||!1,ht=j.RETURN_DOM_FRAGMENT||!1,Ae=j.RETURN_TRUSTED_TYPE||!1,lt=j.FORCE_BODY||!1,qe=j.SANITIZE_DOM!==!1,we=j.SANITIZE_NAMED_PROPS||!1,ke=j.KEEP_CONTENT!==!1,$e=j.IN_PLACE||!1,ae=bf(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:dl,rt=typeof j.NAMESPACE=="string"?j.NAMESPACE:mt,it=qr(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>ut({},Ve)),pt=qr(j,"HTML_INTEGRATION_POINTS",()=>ut({},Se));const J=qr(j,"CUSTOM_ELEMENT_HANDLING",()=>aa(null));if(de=aa(null),Xt(J,"tagNameCheck")&&ct(J.tagNameCheck)&&(de.tagNameCheck=J.tagNameCheck),Xt(J,"attributeNameCheck")&&ct(J.attributeNameCheck)&&(de.attributeNameCheck=J.attributeNameCheck),Xt(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),Mt(de),Me&&(Ce=!1),ht&&(at=!0),je&&(W=ut({},il),q=aa(null),je.html===!0&&(ut(W,ll),ut(q,ul)),je.svg===!0&&(ut(W,zr),ut(q,Vr),ut(q,Qa)),je.svgFilters===!0&&(ut(W,Wr),ut(q,Vr),ut(q,Qa)),je.mathMl===!0&&(ut(W,Hr),ut(q,cl),ut(q,Qa))),he.tagCheck=null,he.attributeCheck=null,Xt(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?he.tagCheck=j.ADD_TAGS:ra(j.ADD_TAGS)&&(W===ie&&(W=an(W)),ut(W,j.ADD_TAGS,Ge))),Xt(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?he.attributeCheck=j.ADD_ATTR:ra(j.ADD_ATTR)&&(q===G&&(q=an(q)),ut(q,j.ADD_ATTR,Ge))),Xt(j,"ADD_FORBID_CONTENTS")&&ra(j.ADD_FORBID_CONTENTS)&&(Ze===yt&&(Ze=an(Ze)),ut(Ze,j.ADD_FORBID_CONTENTS,Ge)),ke&&(W["#text"]=!0),Le&&ut(W,["html","head","body"]),W.table&&(ut(W,["tbody"]),delete Ee.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const me=E;E=j.TRUSTED_TYPES_POLICY;try{D=T("")}catch(De){throw E=me,De}}else j.TRUSTED_TYPES_POLICY===null?(E=void 0,D=""):(E===void 0&&(E=L()),E&&typeof D=="string"&&(D=T("")));jt&&jt(j),ot=j},Vt=ut({},[...zr,...Wr,...yf]),en=ut({},[...Hr,...vf]),Cn=function(j,J,me){return J.namespaceURI===mt?j==="svg":J.namespaceURI===wt?j==="svg"&&(me==="annotation-xml"||it[me]):!!Vt[j]},jn=function(j,J,me){return J.namespaceURI===mt?j==="math":J.namespaceURI===Bt?j==="math"&&pt[me]:!!en[j]},Wn=function(j,J,me){return J.namespaceURI===Bt&&!pt[me]||J.namespaceURI===wt&&!it[me]?!1:!en[j]&&(gt[j]||!Vt[j])},Hn=function(j){let J=_(j);(!J||!J.tagName)&&(J={namespaceURI:rt,tagName:"template"});const me=wa(j.tagName),De=wa(J.tagName);return Ne[j.namespaceURI]?j.namespaceURI===Bt?Cn(me,J,De):j.namespaceURI===wt?jn(me,J,De):j.namespaceURI===mt?Wn(me,J,De):!!(Pe==="application/xhtml+xml"&&Ne[j.namespaceURI]):!1},qt=function(j){_a(t.removed,{element:j});try{_(j).removeChild(j)}catch{if(x(j),!_(j))throw qn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},dn=function(j,J,me){try{j.removeAttributeNode(J)}catch{try{j.removeAttribute(me)}catch{}}},Ut=function(j){ln(j);const J=m(j);if(J){const De=[];Vn(J,Ie=>{_a(De,Ie)}),Vn(De,Ie=>{try{x(Ie)}catch{}})}const me=A(j);if(me)for(let De=me.length-1;De>=0;--De){const Ie=me[De],Ye=Ie&&Ie.name;typeof Ye=="string"&&dn(j,Ie,Ye)}},Lt=function(j,J,me){if(!me)try{me=J.getAttributeNode(j)}catch{me=null}_a(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(at||ht)try{qt(J)}catch{}else try{J.setAttribute(j,"")}catch{}},Tn=function(j){const J=A(j);if(J)for(let me=J.length-1;me>=0;--me){const De=J[me],Ie=De&&De.name;typeof Ie!="string"||q[Ge(Ie)]||dn(j,De,Ie)}},ln=function(j){const J=[j];for(;J.length>0;){const me=J.pop();B(me)===rn.element&&Tn(me);const Ie=m(me);if(Ie)for(let Ye=Ie.length-1;Ye>=0;--Ye)J.push(Ie[Ye])}},Mn=function(j,J){return Oe?j==="patchsrc"?!0:j==="for"&&J!=="label"&&J!=="output":!1},Ln=function(j){if(!Oe)return;const J=[j];for(;J.length>0;){const me=J.pop(),De=B(me);if(De===rn.processingInstruction||De===rn.comment&&It(hl,me.data)){try{x(me)}catch{}continue}if(De===rn.element){const Ye=me,bt=Ge(k(me));try{Ye.hasAttribute&&Ye.hasAttribute("patchsrc")&&Ye.removeAttribute("patchsrc"),Ye.hasAttribute&&Ye.hasAttribute("for")&&Mn("for",bt)&&Ye.removeAttribute("for")}catch{}}const Ie=m(me);if(Ie)for(let Ye=Ie.length-1;Ye>=0;--Ye)J.push(Ie[Ye])}},xn=function(j){let J=null,me=null;if(lt)j="<remove></remove>"+j;else{const Ye=al(j,/^[\r\n\t ]+/);me=Ye&&Ye[0]}Pe==="application/xhtml+xml"&&rt===mt&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const De=E?T(j):j;if(rt===mt)try{J=new h().parseFromString(De,Pe)}catch{}if(!J||!J.documentElement){J=H.createDocument(rt,"template",null);try{J.documentElement.innerHTML=ne?D:De}catch{}}const Ie=J.body||J.documentElement;return j&&me&&Ie.insertBefore(a.createTextNode(me),Ie.childNodes[0]||null),rt===mt?$.call(J,Le?"html":"body")[0]:Le?J.documentElement:Ie},Gt=function(j){const J=v?v(j):j.ownerDocument;return O.call(J||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ft=function(j){return j=Ba(j,Y," "),j=Ba(j,S," "),j=Ba(j,R," "),j},$t=function(j){var J;j.normalize();const me=v?v(j):j.ownerDocument,De=O.call(me||j,j,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Ie=De.nextNode();for(;Ie;)Ie.data=Ft(Ie.data),Ie=De.nextNode();const Ye=(J=j.querySelectorAll)===null||J===void 0?void 0:J.call(j,"template");Ye&&Vn(Ye,bt=>{Ot(bt.content)&&$t(bt.content)})},pn=function(j){const J=w?w(j):null;return typeof J!="string"||Ge(J)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==A(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==y(j)||j.childNodes!==m(j)},Ot=function(j){if(!y||typeof j!="object"||j===null)return!1;try{return y(j)===rn.documentFragment}catch{return!1}},tn=function(j){if(!y||typeof j!="object"||j===null)return!1;try{return typeof y(j)=="number"}catch{return!1}};function Tt(be,j,J){be.length!==0&&Vn(be,me=>{me.call(t,j,J,ot)})}const Kt=function(j,J){return!!(Oe&&j.hasChildNodes()&&!tn(j.firstElementChild)&&It(pl,j.textContent)&&It(pl,j.innerHTML)||Oe&&j.namespaceURI===mt&&Tf[J]&&(tn(j.firstElementChild)||typeof j.textContent=="string"&&It(Mf[J],j.textContent))||j.nodeType===rn.processingInstruction||Oe&&j.nodeType===rn.comment&&It(hl,j.data))},le=function(j,J){if(j instanceof RegExp)return It(j,J);if(j instanceof Function){for(var me=arguments.length,De=new Array(me>2?me-2:0),Ie=2;Ie<me;Ie++)De[Ie-2]=arguments[Ie];return!!j(J,...De)}return!1},Be=function(j,J,me){if(!Ee[J]&&ee(J)&&le(de.tagNameCheck,J))return!1;if(ke&&!Ze[J]){const De=_(j),Ie=m(j);if(Ie&&De){const Ye=Ie.length;for(let bt=Ye-1;bt>=0;--bt){const At=j===me?b(Ie[bt],!0):Ie[bt];De.insertBefore(At,C(j))}}}return qt(j),!0},Te=function(j,J,me,De){return j.length===0?J:J===me||J===De?an(J):J},Ke=function(j,J){return j===J||_(j)!==null?!1:($e&&ln(j),!0)},Fe=function(j,J){if(Tt(z.beforeSanitizeElements,j,null),Ke(j,J))return!0;if(pn(j))return qt(j),!0;const me=Ge(k(j));if(W=Te(z.uponSanitizeElement,W,ie,We),Tt(z.uponSanitizeElement,j,{tagName:me,allowedTags:W}),Ke(j,J))return!0;if(Kt(j,me))return qt(j),!0;if(Ee[me]||!(he.tagCheck instanceof Function&&he.tagCheck(me))&&!W[me]){const Ie=Be(j,me,J);return Ie===!1&&Tt(z.afterSanitizeElements,j,null),Ie}if(B(j)===rn.element&&!Hn(j)||(me==="noscript"||me==="noembed"||me==="noframes")&&It(Sf,j.innerHTML))return qt(j),!0;if(Me&&j.nodeType===rn.text){const Ie=Ft(j.textContent);j.textContent!==Ie&&(_a(t.removed,{element:j.cloneNode()}),j.textContent=Ie)}return Tt(z.afterSanitizeElements,j,null),!1},X=function(j,J,me){if(ye[J]||Mn(J,j)||qe&&(J==="id"||J==="name")&&(me in a||me in st))return!1;const De=q[J]||he.attributeCheck instanceof Function&&he.attributeCheck(J,j);return Ce&&It(F,J)||se&&It(Z,J)?!0:De?_t[J]||It(ae,Ba(me,re,""))||(J==="src"||J==="xlink:href"||J==="href")&&j!=="script"&&rl(me,"data:")===0&&et[j]||ge&&!It(pe,Ba(me,re,""))?!0:!me:ee(j)&&le(de.tagNameCheck,j)&&le(de.attributeNameCheck,J,j)||J==="is"&&de.allowCustomizedBuiltInElements&&le(de.tagNameCheck,me)},ue=ut({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ee=function(j){return!ue[wa(j)]&&It(oe,j)},ve=function(j,J,me,De){if(E&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!me)switch(p.getAttributeType(j,J)){case"TrustedHTML":return T(De);case"TrustedScriptURL":return M(De)}return De},Re=function(j,J,me,De){try{me?j.setAttributeNS(me,J,De):j.setAttribute(J,De),pn(j)?qt(j):nl(t.removed)}catch{Lt(J,j)}},He=function(j){Tt(z.beforeSanitizeAttributes,j,null);const J=j.attributes;if(!J||pn(j))return;q=Te(z.uponSanitizeAttribute,q,G,dt);const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q,forceKeepAttr:void 0};let De=J.length;const Ie=Ge(j.nodeName);for(;De--;){const Ye=J[De],bt=Ye.name,At=Ye.namespaceURI,Yt=Ye.value,Zt=Ge(bt),$r=Yt;let zt=bt==="value"?$r:pf($r);if(me.attrName=Zt,me.attrValue=zt,me.keepAttr=!0,me.forceKeepAttr=void 0,Tt(z.uponSanitizeAttribute,j,me),zt=me.attrValue,we&&(Zt==="id"||Zt==="name")&&rl(zt,Ue)!==0&&(Lt(bt,j,Ye),zt=Ue+zt),Oe&&It(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,zt)){Lt(bt,j,Ye);continue}if(Zt==="attributename"&&al(zt,"href")){Lt(bt,j,Ye);continue}if(!me.forceKeepAttr){if(!me.keepAttr){Lt(bt,j,Ye);continue}if(!ce&&It(jf,zt)){Lt(bt,j,Ye);continue}if(Me&&(zt=Ft(zt)),!X(Ie,Zt,zt)){Lt(bt,j,Ye);continue}zt=ve(Ie,Zt,At,zt),zt!==$r&&Re(j,bt,At,zt)}}Tt(z.afterSanitizeAttributes,j,null)},tt=function(j){let J=null;const me=Gt(j);for(Tt(z.beforeSanitizeShadowDOM,j,null);J=me.nextNode();)if(Tt(z.uponSanitizeShadowNode,J,null),Fe(J,j),He(J),Ot(J.content)&&tt(J.content),B(J)===rn.element){const De=g(J);Ot(De)&&(ft(De),tt(De))}Tt(z.afterSanitizeShadowDOM,j,null)},ft=function(j){const J=[{node:j,shadow:null}];for(;J.length>0;){const me=J.pop();if(me.shadow){tt(me.shadow);continue}const De=me.node,Ye=B(De)===rn.element,bt=m(De);if(bt)for(let At=bt.length-1;At>=0;--At)J.push({node:bt[At],shadow:null});if(Ye){const At=w?w(De):null;if(typeof At=="string"&&Ge(At)==="template"){const Yt=De.content;Ot(Yt)&&J.push({node:Yt,shadow:null})}}if(Ye){const At=g(De);Ot(At)&&J.push({node:null,shadow:At},{node:At,shadow:null})}}};return t.sanitize=function(be){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,me=null,De=null,Ie=null;if(ne=!be,ne&&(be="<!-->"),typeof be!="string"&&!tn(be)&&(be=gf(be),typeof be!="string"))throw qn("dirty is not a string, aborting");if(!t.isSupported)return be;ze?(W=We,q=dt):kt(j),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(W=an(W)),z.uponSanitizeAttribute.length>0&&(q=an(q)),t.removed=[];const Ye=$e&&typeof be!="string"&&tn(be);if(Ye){Ln(be);const Yt=k(be);if(typeof Yt=="string"){const Zt=Ge(Yt);if(!W[Zt]||Ee[Zt])throw Ut(be),qn("root node is forbidden and cannot be sanitized in-place")}if(pn(be))throw Ut(be),qn("root node is clobbered and cannot be sanitized in-place");try{ft(be)}catch(Zt){throw Ut(be),Zt}}else if(tn(be))J=xn("<!---->"),me=J.ownerDocument.importNode(be,!0),me.nodeType===rn.element&&me.nodeName==="BODY"||me.nodeName==="HTML"?J=me:J.appendChild(me),ft(me);else{if(!at&&!Me&&!Le&&be.indexOf("<")===-1)return E&&Ae?T(be):be;if(J=xn(be),!J)return at?null:Ae?D:""}J&&lt&&qt(J.firstChild);const bt=Ye?be:J;try{const Yt=Gt(bt);for(;De=Yt.nextNode();)Fe(De,bt),He(De),Ot(De.content)&&tt(De.content)}catch(Yt){throw Ye&&(Ut(be),Vn(t.removed,Zt=>{Zt.element&&ln(Zt.element)})),Yt}if(Ye)return Vn(t.removed,Yt=>{Yt.element&&ln(Yt.element)}),Me&&$t(be),be;if(at){if(Me&&$t(J),ht)for(Ie=U.call(J.ownerDocument);J.firstChild;)Ie.appendChild(J.firstChild);else Ie=J;return(q.shadowroot||q.shadowrootmode)&&(Ie=V.call(r,Ie,!0)),Ie}let At=Le?J.outerHTML:J.innerHTML;return Le&&W["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&It(Ef,J.ownerDocument.doctype.name)&&(At="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
828
+ `+At),Me&&(At=Ft(At)),E&&Ae?T(At):At},t.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kt(be),ze=!0,We=W,dt=q},t.clearConfig=function(){ot=null,ze=!1,We=null,dt=null,E=N,D=""},t.isValidAttribute=function(be,j,J){ot||kt({});const me=Ge(be),De=Ge(j);return X(me,De,J)},t.addHook=function(be,j){typeof j=="function"&&Xt(z,be)&&_a(z[be],j)},t.removeHook=function(be,j){if(Xt(z,be)){if(j!==void 0){const J=cf(z[be],j);return J===-1?void 0:df(z[be],J,1)[0]}return nl(z[be])}},t.removeHooks=function(be){Xt(z,be)&&(z[be]=[])},t.removeAllHooks=function(){z=fl()},t}var oa=Cl();let Ur=null;const Rf=1500;function Gr(){Ur?.clear(),Ur=null}function Pf(e,{onEnd:t,rate:a=.9}={}){if(typeof window>"u"||typeof SpeechSynthesisUtterance>"u"||!("speechSynthesis"in window)){t?.();return}const r=window.speechSynthesis;Gr();let l=!1;const s=()=>{if(!l){l=!0;try{t?.()}catch{}}};try{r.cancel()}catch{s();return}const i=()=>{Gr();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?s:null,d.onerror=t?s:null,r.speak(d)}catch{s()}};let u;try{u=r.getVoices()}catch{s();return}if(u.length>0){i();return}const c=setTimeout(i,Rf);try{r.addEventListener("voiceschanged",i,{once:!0})}catch{clearTimeout(c),s();return}Ur={clear:()=>{clearTimeout(c),r.removeEventListener("voiceschanged",i)}}}function Kr(){Gr(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()}const If=/^(?:[a-z]+:)?\/\//i,Ff="__ihab_core_asset_base_url__";function Of(){return globalThis[Ff]??""}function Yr(e){const t=String(e||"").trim();if(!t)return"";if(If.test(t)||t.startsWith("data:")||t.startsWith("blob:"))return t;const a=t.startsWith("/")?t:`/${t}`,r=Of();return r?`${r}${a}`:a}const gl="__ihab_core_storage_resolvers__";function Aa(){return globalThis[gl]??null}function zf(e){globalThis[gl]=e}let bl=class extends Error{constructor(t){super(`
829
829
  [ihabdevteam-core] ${t}() \uD638\uCD9C \uC2E4\uD328 \u2014 configureStorage()\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
830
830
 
831
831
  \uC571 \uCD08\uAE30\uD654 \uC2DC\uC810(main.tsx \uB4F1)\uC5D0 \uC544\uB798\uC640 \uAC19\uC774 \uD55C \uBC88 \uD638\uCD9C\uD558\uC138\uC694:
@@ -849,15 +849,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
849
849
  \uC2E0\uB8B0\uB97C \uC313\uACE0
850
850
  \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"},Eg={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},Dg={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"},Sg={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},jg={ariaLabel:"\uC120\uD0DD \uD0ED"},Tg={ariaLabel:"\uD0ED"},Mg={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},Lg={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},$g={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"}},Rg={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"},Pg={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"}},Ig={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},Fg={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"},Og={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"},zg={viewWords:"\uB0B1\uB9D0"},Wg={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},Hg={chooseDate:"\uB0A0\uC9DC \uC120\uD0DD",selectYear:"\uC5F0 \uC120\uD0DD",selectMonth:"\uC6D4 \uC120\uD0DD"},Vg={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},qg={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},Ug={place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},Gg={clearSelection:"\uC120\uD0DD \uD574\uC81C"},Kg={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Yg={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Zg={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},Xg={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},Jg={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},Qg={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},eb={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"},tb={common:eg,calendar:tg,passCard:ng,rating:ag,colorPicker:rg,dropdown:og,accordion:sg,header:lg,nav:ig,settings:ug,usage:cg,account:dg,training:pg,customers:hg,payment:mg,coupons:fg,visits:Cg,trainingType:gg,myWordTable:bg,keyWords:yg,wordTable:vg,wordSearch:xg,wordPrint:_g,topic:wg,device:Bg,manager:kg,wordPairs:Ag,footer:Ng,date:Eg,wordData:Dg,textField:Sg,segmentedControl:jg,tabs:Tg,fileUpload:Mg,avatar:Lg,myHomework:$g,trainingStatus:Rg,store:Pg,progress:Ig,trainingMiss:Fg,table:Og,wordScore:zg,topBanner:Wg,datePicker:Hg,report:Vg,tooltip:qg,phonemeProfile:Ug,bulkBar:Gg,debug:Kg,badge:Yg,loader:Zg,soundCompass:Xg,breadcrumb:Jg,board:Qg,promoBannerBg:eb},nb={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",collapseFor:"Collapse {{name}}",expandFor:"Expand {{name}}",sortFor:"Sort {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",discardConfirm:{title:"Discard your changes?",body:"If you do not save, everything you have entered will be lost.",confirm:"Discard"},close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",likeCount_one:"{{count}} like",likeCount_other:"{{count}} likes",selectedOfMax:"{{count}} of {{max}}",downloadCount_one:"{{count}} download",downloadCount_other:"{{count}} downloads",descriptionFor:"About {{name}}",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",playFor:"Play {{name}}",pauseFor:"Pause {{name}}",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",noMatches:"No matching items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},ab={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"]},rb={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"}},ob={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},sb={selected:"selected"},lb={placeholder:"Select"},ib={collapse:"Collapse",expand:"Expand"},ub={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},cb={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"},db={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"}}}},pb={couponButton:"Enter Coupon"},hb={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."}}},mb={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"}},fb={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"}},Cb={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},gb={input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply"},bb={showN:"Show {{n}}"},yb={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."}},vb={newBadge:"Newly created",publishedBadge:"Published",sharedBadge:"Shared"},xb={title:"Key Words",empty:"No key words available."},_b={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount_one:"{{count}} word",itemCount_other:"{{count}} words",deleteAriaLabel:"Delete {{name}}",viewLabel:"View as",sortLabel:"Sort by",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},publisherFilter:"Show only tables by {{name}}",groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",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"}},wb={filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",gradeNone:"None",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",field:"Semantic Category",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193",original:"Original order"},pageSize:"Show {{count}}",pageSizeAria:"Page size"},Bb={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},kb={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"}},Ab={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"}},Nb={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}}"}},Eb={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",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."]},Db={lead:`IHAB builds trust
851
851
  through sound
852
- 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"},Sb={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},jb={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"},Tb={clearAriaLabel:"Clear input"},Mb={ariaLabel:"Select tab"},Lb={ariaLabel:"Tabs"},$b={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Rb={ariaLabel:"User avatar"},Pb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Ib={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"},Fb={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"}},Ob={steps:"Step {{current}} of {{total}}"},zb={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"},Wb={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Hb={viewWords:"Words"},Vb={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},qb={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},Ub={previewRegion:"Report preview \u2014 scrollable sideways"},Gb={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Kb={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Yb={clearSelection:"Clear selection"},Zb={showResult:"Show {{type}} result"},Xb={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Jb={loading:"Loading"},Qb={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},ey={ariaLabel:"Breadcrumb"},ty={empty:"No items yet."},ny={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"},ay={common:nb,calendar:ab,passCard:rb,rating:ob,colorPicker:sb,dropdown:lb,accordion:ib,header:ub,nav:cb,settings:db,usage:pb,account:hb,training:mb,customers:fb,payment:Cb,coupons:gb,visits:bb,trainingType:yb,myWordTable:vb,keyWords:xb,wordTable:_b,wordSearch:wb,wordPrint:Bb,topic:kb,device:Ab,manager:Nb,wordPairs:Eb,footer:Db,date:Sb,wordData:jb,textField:Tb,segmentedControl:Mb,tabs:Lb,fileUpload:$b,avatar:Rb,myHomework:Pb,trainingStatus:Ib,store:Fb,progress:Ob,trainingMiss:zb,table:Wb,wordScore:Hb,topBanner:Vb,datePicker:qb,report:Ub,tooltip:Gb,phonemeProfile:Kb,bulkBar:Yb,debug:Zb,badge:Xb,loader:Jb,soundCompass:Qb,breadcrumb:ey,board:ty,promoBannerBg:ny};const ry="0.361.0",oy=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],co="ko",sy="ihab_display_language";function Gl(){if(typeof window>"u")return co;try{const e=localStorage.getItem(sy);if(e&&oy.some(t=>t.code===e))return e}catch{}return co}function Kl(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",Kl),Kl(Gl()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:tb},en:{translation:ay}},lng:Gl(),fallbackLng:co,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const ly=new Map;try{Rt.store?.on?.("added",()=>ly.clear())}catch{}let or=null,Yl=null,Zl=null;function iy(){const e=Rl();if(e&&e.entries.length>0){const t=vC();if(or&&Yl===e&&Zl===t)return or;const a=new Set,r=[];for(const l of e.entries)!l.word||a.has(l.word)||(a.add(l.word),r.push({w:l.word,s:l.syllables,p:t?.[l.word]?[...t[l.word].cho??[],...t[l.word].jung??[],...t[l.word].jong??[]]:[],pron:l.pronunciation||l.word,grade:l.grade}));return or=r,Yl=e,Zl=t,or}return[]}new Proxy([],{get(e,t){const a=iy(),r=a[t];return typeof r=="function"?r.bind(a):r}});function uy(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 cy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&uy(r.attrValue)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function dy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),[s,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),l(null),i(null),c(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=Yr(e):/^(Logo|Symbol)/i.test(p)?f=Yr(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),i(null),c(null),a(e),l(f)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function f(){try{let b=await fetch(r);b.ok||(b=await fetch(r));const x=b.headers.get("content-type")||"";if(p)return;if(x.includes("svg")){i("mask");return}if(x.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const m=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(m)){const _=cy(m);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return f(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,f=null;return s==="mask"&&r&&fetch(r).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.blob()}).then(b=>{p||(f=URL.createObjectURL(b),h(f))}).catch(()=>{p||i("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),h(null)}},[s,r]),t===e?{iconToUse:r,mode:s,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function et(e){const{icon:t,label:a,className:r,imgClassName:l,maskClassName:s,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",h=l??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=i??"iconRenderer-icon-svg",b=typeof t=="string"?t:null,x=ef(b),{iconToUse:C,mode:m,svgText:_,blobUrl:g}=dy(b),A=(k,E={})=>n.jsx("span",{className:d,style:u,...E,children:k}),y=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,w=(k,E={})=>n.jsx("img",{src:k,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:h,...E,style:y?{...E.style,...y}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,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(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(m==="mask"){const k={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:k}),{"aria-hidden":"true"})}return m==="img"?A(w(C,{onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):m==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return w(Yr(t),{style:u,onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,B=`<svg width="${v}" height="${v}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:B}}),{"aria-hidden":"true"})}function Xl(e){const[t,a]=o.useState(!1),r=o.useRef(!1),l=o.useRef(!0);o.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const s=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,l.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:s}}function py({icon:e,title:t,message:a,action:r,className:l}){const{pending:s,press:i}=Xl(r?.onClick);return n.jsxs("div",{className:_e("empty-state",l),children:[e&&n.jsx(et,{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:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(et,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function hy({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:l,className:s}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=Xl(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(et,{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(et,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:l??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function my({icon:e,title:t,description:a,cta:r,tone:l="main",disabled:s=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,h=`${c}-desc`,p=`${c}-cta`,f=()=>{s||i?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${h} ${p}`,onClick:f,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f())},className:_e("action-card",`action-card--${l}`,s&&"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(et,{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(et,{icon:"arrow-right",size:18})})]})]})})}function fy({as:e="div",className:t="",children:a,storage:r,...l}){r&&Wf({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 s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...l,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 po(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=l=>{if(l.key!=="Tab")return;const s=Array.from(a.querySelectorAll(gn)).filter(Cy);if(!s.length){l.preventDefault();return}const i=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;l.shiftKey&&(c===i||d)?(l.preventDefault(),u.focus()):!l.shiftKey&&c===u&&(l.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const gn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ho=new WeakMap;function mo(e,t){e&&ho.set(e,t)}function fo(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!ho.has(r);)r=r.parentElement;if(!r)return t;t=ho.get(r)??null}return t}function Jl(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 sr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(Jl(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const l=Array.from(document.querySelectorAll(gn)).filter(c=>!(e&&e.contains(c))&&Jl(c));let s=null,i=null;for(const c of l)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:i||(i=c);const u=s??i;return u?.focus(),u}function gy({title:e="",lines:t=[],notices:a=null,children:r,variant:l="default",dismissible:s=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),h=o.useRef(null),p=o.useCallback(()=>{const C=h.current;C&&C.contains(document.activeElement)&&sr(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${l} body-2 ${i}`.trim(),b=s&&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:f,role:"note",children:[a.map((C,m)=>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((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},m)),b]});const x=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,m)=>n.jsx("li",{className:"notice-box__line",children:C},m))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:h,className:f,role:"note",children:[x,b]})}const ua=[];let lr=!1;function Ql(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ua[ua.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return ua.push(e),!lr&&typeof document<"u"&&(document.addEventListener("keydown",Ql),lr=!0),()=>{const t=ua.lastIndexOf(e);t>=0&&ua.splice(t,1),ua.length===0&&lr&&typeof document<"u"&&(document.removeEventListener("keydown",Ql),lr=!1)}}const ei=o.createContext(null);function by(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const ti=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 Ss.useSyncExternalStore(t,()=>ti(e),()=>!1)}function vy(e){const[t,a]=o.useState(ti(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),l=i=>a(i.matches),s=r;return s.addEventListener?s.addEventListener("change",l):s.addListener&&s.addListener(l),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",l):s.removeListener&&s.removeListener(l)}},[e]),t}const xy=typeof Ss.useSyncExternalStore=="function"?yy:vy;function un(e){const t=o.useContext(ei),a=xy(e);return t&&typeof t.mobile=="boolean"&&by(e)?t.mobile:a}const _y="(prefers-reduced-motion: reduce)";function Co(){return un(_y)}function mn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:l=20,onClose:s,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:h,backdrop:p=!1,isMobilePopup:f=!1,useBorder:b=!0,header:x,focusOnOpen:C}=e||{},m=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,y]=o.useState(!1),[w,v]=o.useState("bottom"),[B,k]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,I=o.useCallback((U=!1)=>{if(E&&f)return;const $=a?a.getBoundingClientRect():t;if(!$||!m.current)return;const H=m.current,{offsetWidth:z,offsetHeight:V}=H,S=window.innerWidth,P=window.innerHeight,F=S-$.right,X=$.left,se=$.top,ae=P-$.bottom;let me=0,ne=0,W="top";if(se>=V+r)W="top",ne=$.top-r-V,me=$.left+$.width/2-z/2;else if(ae>=V+r)W="bottom",ne=$.bottom+r,me=$.left+$.width/2-z/2;else if(F>=z+r)W="right",me=$.right+r,ne=$.top+$.height/2-V/2;else if(X>=z+r)W="left",me=$.left-r-z,ne=$.top+$.height/2-V/2;else{const ce=Math.max(se,ae,F,X);ce===se?(W="top",ne=$.top-r-V,me=$.left+$.width/2-z/2):ce===ae?(W="bottom",ne=$.bottom+r,me=$.left+$.width/2-z/2):ce===F?(W="right",me=$.right+r,ne=$.top+$.height/2-V/2):(W="left",me=$.left-r-z,ne=$.top+$.height/2-V/2)}const ie=Number.isFinite(Number(l))?Number(l):8;me=Math.min(Math.max(me,ie),S-z-ie),ne=Math.min(Math.max(ne,ie),P-V-ie);const q=Math.round(me),K=Math.round(ne);U&&m.current?(m.current.style.left=`${q}px`,m.current.style.top=`${K}px`,m.current.dataset.placement=W):(v(W||w),g({position:"fixed",left:q,top:K}),k(!0))},[E,f,a,t,r,l,w]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),k(!0);return}I();const U=requestAnimationFrame(()=>I());return()=>cancelAnimationFrame(U)},[t,a,r,h,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f||!m.current||typeof ResizeObserver>"u")return;const U=new ResizeObserver(()=>{t&&I()});return U.observe(m.current),()=>U.disconnect()},[t,h,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f)return;let U=null;const $=()=>{if(typeof requestAnimationFrame>"u"){I(!0);return}U===null&&(U=requestAnimationFrame(()=>{U=null,I(!0)}))},H=z=>{if(!a&&s){const V=z.target;if(V&&m.current&&m.current.contains(V))return;try{if(V&&V.closest&&V.closest("[data-tooltip-ignore]"))return}catch{}L.current(!0);return}$()};return window.addEventListener("resize",$),document.addEventListener("scroll",H,{passive:!0,capture:!0}),()=>{U!==null&&cancelAnimationFrame(U),window.removeEventListener("resize",$),document.removeEventListener("scroll",H,{capture:!0})}},[t,a,s,r,h,l,N,E,f,I]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const U=window.matchMedia("(max-width: 768px)"),$=()=>D(!!U.matches);$();try{U.addEventListener?U.addEventListener("change",$):U.addListener($)}catch{try{U.addListener($)}catch{}}return()=>{try{U.removeEventListener?U.removeEventListener("change",$):U.removeListener($)}catch{}}},[]);const R=o.useRef(!1),Y=o.useRef(null),M=Co(),T=o.useCallback((U=!1)=>{if(s&&!(A||R.current)){if(R.current=!0,U){y(!0);try{s&&s()}catch{R.current=!1,y(!1)}return}y(!0),Y.current=setTimeout(()=>{Y.current=null;try{s&&s()}catch{R.current=!1,y(!1)}},M?0:200)}},[A,s,y,M]);o.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]),o.useEffect(()=>{if(N)return;const U=z=>{const V=m.current;if(!V)return;const S=z.target;if(S&&!V.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&T(!0)}},$=z=>{const V=m.current;if(!V)return;const S=z.target;if(S&&!V.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&T(!0)}},H=z=>{if(z.key==="Tab"){const V=m.current;if(!V)return;const S=V.querySelectorAll(gn);if(!S||S.length===0)return;const P=S[0],F=S[S.length-1],X=document.activeElement;z.shiftKey?X===P&&(z.preventDefault(),F.focus()):X===F&&(z.preventDefault(),P.focus())}};return document.addEventListener("pointerdown",U,!0),document.addEventListener("click",$,!0),document.addEventListener("keydown",H),()=>{document.removeEventListener("pointerdown",U,!0),document.removeEventListener("click",$,!0),document.removeEventListener("keydown",H)}},[s,i,T,N]);const L=o.useRef(T);o.useEffect(()=>{L.current=T});const Z=!!s;o.useEffect(()=>{if(!(N||!Z))return Gn(()=>L.current())},[N,Z]),o.useEffect(()=>{const U=()=>{T(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",U),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",U)}},[T]);const G=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!B)return;const U=m.current;if(!U)return;const $=U.querySelector(gn);if($)return G.current=document.activeElement,$.focus(),()=>{const H=G.current;G.current=null,H&&document.contains(H)&&H.focus()}},[N,C,B]),o.useEffect(()=>{c==="dialog"&&!d&&St("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 O=n.jsxs("div",{ref:m,className:`tooltip-content ${N?"tooltip-content--inline":""} ${b?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:B?"visible":"hidden"},tabIndex:-1,"data-placement":w,"data-left":N?"":_.left,"data-top":N?"":_.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:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),h]});if(N||typeof document>"u")return O;if(p||E&&f){const U=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&T(!0)}}),O]});return nn.createPortal(U,document.body)}return nn.createPortal(O,document.body)}function wn(e){const{anchorRect:t,text:a,offset:r=8,onClose:l,className:s="",ariaLabel:i}=e||{};return a?n.jsx(mn,{anchorRect:t,offset:r,onClose:l,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:i||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:l,activeIndex:s=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},h=(Array.isArray(l)?l:l?[l]:[]).map(p=>typeof p=="string"?{text:p}:p);return!h.length&&!r?null:n.jsx(mn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:h.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[i&&h.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function $a(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let go=0,ni=!1;function ai(){ni||typeof document>"u"||(ni=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(go=Date.now())},!0),document.addEventListener("touchstart",()=>{go=Date.now()},{capture:!0,passive:!0}))}ai();function ca(e){return!!e&&e.pointerType==="touch"}function da(e=1e3){return ai(),Date.now()-go<e}function bo(e,t,a,{enabled:r=!0,fallbackOnParent:l=!1}={}){const s=$a(e),i=$a(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const h=p=>{const f=p,b=p.target,x=a.current,C=!!(b&&x&&x.contains(b));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(b&&b.closest?.(".tooltip-content"))&&i.current(!1,x)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[r,a,s,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||!l)return;const h=a.current,p=h?.parentElement;if(!h||!p)return;let f=null;const b=m=>{const _=m.changedTouches?.[0];if(!_)return!1;const g=h.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=m=>{f=b(m)?s.current:null},C=m=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!b(m))&&(u.current=null,c.current=Date.now(),i.current(!_,h))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,l,a,s,i]),{touchPress:d}}function wy(e,t){const{size:a=48,type:r,htmlType:l,href:s,target:i,rel:u,icon:c,rightIcon:d,label:h,count:p,subLabel:f,children:b,ariaLabel:x,variant:C="default",align:m="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:y,ariaControls:w,disabled:v=!1,useLabel:B=!0,useBorder:k=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,width:I,minWidth:R,onClick:Y,onDisabledClick:M,showTooltipInfo:T=!1,tooltipInfoText:L=null,tooltipDescription:Z=null,tooltipOnly:G=!1,iconSize:O="medium",iconColor:U,shape:$="rounded",color:H,className:z,...V}=e,S=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),P=S.match(/^\d+$/)?`button${S}`:`button-${S}`,F=Number(a),X=!isNaN(F)&&F<40?"button-2":"button-1",se=h??b,ae=v||!!V.disabled,me=ae?D?"disabled-covered":N?"disabled-invisibled":"disabled":C,ne=me?`button--variant-${me}`:"",W=m?`button--align-${m}`:"",ie=_?"button--nowrap":"",q=$?`button--shape-${$}`:"",K=typeof U=="string"&&U.startsWith("--")?`var(${U})`:U,ce={...I?{width:typeof I=="number"?`${I}px`:I}:{},...R?{minWidth:typeof R=="number"?`${R}px`:R}:{},...k?{}:{"--button-border":ae?"0":"1px solid transparent"},...K?{"--button-icon-color":K}:{},...H?{"--color-main":H}:{}},ke=B===!1?"":se,ye=Array.isArray(ke)?ke.length>0:!!ke,de=!!d,oe=r??(ye||c||de?"bar":"dot"),ge=`${P}--${oe}`,he=o.useRef(null);o.useEffect(()=>{!$n||l!==void 0||he.current?.closest("form")&&St(`button-in-form:${typeof se=="string"?se:""}`,'[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 se=="string"&&se?` \uB2E8\uCD94: ${se}`:""))},[l,se]);const pe=o.useRef(t);pe.current=t;const Me=o.useCallback(Re=>{he.current=Re;const ot=pe.current;typeof ot=="function"?ot(Re):ot&&(ot.current=Re)},[]),ze=o.useRef(ae),[Le,Fe]=o.useState(!!g),[We,pt]=o.useState(!1),[it,at]=o.useState(null),ht=o.useCallback(()=>pt(!1),[]),[Ne,Ve]=o.useState(!1),we=o.useId();o.useEffect(()=>{typeof g=="boolean"&&Fe(g)},[g]),o.useEffect(()=>{if(ze.current&&!ae&&he.current){const Re=he.current;let ot=!1;try{ot=Re.matches(":focus:not(:focus-visible)")}catch{ot=!1}ot&&Re.blur(),Re.style.pointerEvents="none";const ft=requestAnimationFrame(()=>{requestAnimationFrame(()=>{he.current&&(he.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(ft)}ze.current=ae},[ae]);const Ue=typeof g=="boolean"?!!g:Le,Ae=typeof y=="boolean"?void 0:A||typeof g=="boolean"?Ue?"true":"false":V["aria-pressed"],$e=_e("button",P,ge,ne,W,ie,q,Ue?"is-selected":null,E?null:"button--no-bg",G?"button--tooltip-only":null,z),Se=`button__icon button__icon--${O}`,Xe=Array.isArray(f)?f:f!==void 0?[f]:[],gt=()=>{if(Array.isArray(ke))return ke.map((ot,ft)=>{const Bt=Xe[ft];return n.jsxs("span",{className:`button__label-text${Bt!==void 0?" button__label-text--has-sub":""}`,children:[ot,Bt!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Bt})]},ft)});const Re=f!==void 0;return n.jsxs("span",{className:`button__label-text${Re?" button__label-text--has-sub":""}`,children:[ke,p!=null&&n.jsx("span",{className:"button__count",children:p}),Re&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},nt=Re=>{typeof g!="boolean"&&!A&&Fe(!1),Re.currentTarget.blur()},Je=Re=>{ae||(typeof V.onMouseLeave=="function"&&V.onMouseLeave(Re),nt(Re))},_t=Re=>{if(G&&vt&&bt.touchPress(Re.currentTarget),ae){vt&&bt.touchPress(Re.currentTarget),Re.preventDefault(),M?.(Re);return}typeof g!="boolean"&&A&&Fe(ot=>!ot),Y?.(Re)},mt=o.useCallback(()=>{(T||Z)&&(pt(!0),at(he.current?.getBoundingClientRect()??null))},[T,Z]),wt=o.useCallback(()=>{(T||Z)&&(pt(!1),at(null))},[T,Z]),vt=!!(T||Z),bt=bo(We,Re=>{Re?mt():wt()},he,{enabled:vt&&(ae||G),fallbackOnParent:vt&&ae}),Ke={...V};delete Ke.disabled,delete Ke.className,delete Ke.faded,delete Ke.useFaded,delete Ke.loading,delete Ke.onMouseLeave,delete Ke.onPointerEnter,delete Ke.onPointerLeave,delete Ke.onPointerUp,delete Ke.onFocus,delete Ke.onBlur,ae&&(Object.keys(Ke).forEach(Re=>{/^on[A-Z]/.test(Re)&&typeof Ke[Re]=="function"&&delete Ke[Re]}),Ke["aria-disabled"]="true");const re=(typeof T=="string"?T:null)??(typeof L=="string"?L:null)??(typeof x=="string"?x:null)??(typeof se=="string"?se:null)??void 0,Ee=typeof x=="string"?x:typeof se=="string"?se:re,Qe=Z?[Z.title,...Z.items??[]].filter(Boolean).join(". "):T&&re&&re!==Ee?re:"",qe=[typeof V["aria-describedby"]=="string"?V["aria-describedby"]:void 0,Qe?we:null].filter(Boolean).join(" ")||void 0,rt=(Re,ot)=>n.jsx(et,{icon:Re,label:ot??Ee,className:Se,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),Te=()=>oe==="dot"?n.jsxs(n.Fragment,{children:[rt(c),ye&&n.jsx("span",{className:`button__label ${X}`,children:gt()})]}):m==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:rt(c)}),ye&&n.jsx("span",{className:`button__label ${X}`,children:gt()})]}),de&&n.jsx("span",{className:"button__right",children:rt(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:rt(c,x??se)}),ye&&n.jsx("span",{className:`button__label ${X}`,children:gt()}),de&&n.jsx("span",{className:"button__right",children:rt(d)})]}),ut=!!s&&!ae;return n.jsxs(n.Fragment,{children:[n.jsxs(ut?"a":"button",{...Ke,ref:Me,...ut?{href:s,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:l??"button",disabled:ae&&!M&&!Ne},className:$e,"aria-pressed":Ae,"aria-expanded":typeof y=="boolean"?y:V["aria-expanded"],"aria-controls":w??V["aria-controls"],"aria-label":Ee,"aria-disabled":ae&&(ut||M||Ne)?!0:void 0,"aria-describedby":qe,style:ce,onClick:_t,onMouseLeave:Je,onPointerEnter:Re=>{ca(Re)||mt(),!ae&&typeof V.onPointerEnter=="function"&&V.onPointerEnter(Re)},onPointerLeave:Re=>{ca(Re)||wt(),!ae&&typeof V.onPointerLeave=="function"&&V.onPointerLeave(Re)},onPointerUp:Re=>{ae&&vt&&bt.touchPress(Re.currentTarget),!ae&&typeof V.onPointerUp=="function"&&V.onPointerUp(Re)},onFocus:Re=>{Ve(!0),da()||mt(),!ae&&typeof V.onFocus=="function"&&V.onFocus(Re)},onBlur:Re=>{Ve(!1),ae||nt(Re),wt(),!ae&&typeof V.onBlur=="function"&&V.onBlur(Re)},children:[Te(),Qe?n.jsx("span",{id:we,hidden:!0,"aria-label":Qe}):null]}),We&&Z?n.jsx(Kn,{anchorRect:it,title:Z.title,items:Z.items,onClose:ht}):We&&re?n.jsx(wn,{anchorRect:it,text:re,onClose:ht}):null]})}const Ce=o.forwardRef(wy);Ce.displayName="Button";function Nt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const l=r.current?.parentElement??null;return t(l,e),()=>a(l)},[e,t,a]),r}const Ra={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},yo=new WeakMap;function vo(e){if(e)return yo.get(e)}function Wt(e,t){e&&(e.style.setProperty(Ra.title,t.title),e.style.setProperty(Ra.description,t.description),yo.set(e,t))}function Ht(e){e&&(e.style.removeProperty(Ra.title),e.style.removeProperty(Ra.description),yo.delete(e))}const ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function oi(){const e=Nt(ri,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const si={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function li(){const e=Nt(si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const ii={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ui(){const e=Nt(ii,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function di(){const e=Nt(ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const pi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function hi(){const e=Nt(pi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const mi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function fi(){const e=Nt(mi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const Ci={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function gi(){const e=Nt(Ci,Wt,Ht);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 yi(){const e=Nt(bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const vi={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function xi(){const e=Nt(vi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const _i={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function wi(){const e=Nt(_i,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Bi={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ki(){const e=Nt(Bi,Wt,Ht);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 Ai={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ni(){const e=Nt(Ai,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Ei={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function Di(){const e=Nt(Ei,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Si={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function ji(){const e=Nt(Si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),By=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Ti={main:oi,soft:li,sub:ui,deep:di,softSub:hi,warm:fi,dark:gi,radial:yi,diagonal:xi,dots:wi,outline:ki,success:Ni,naver:Di,instagram:ji};function Mi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:l=.1,lineHeightRatio:s=1.4}={}){const i=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const y=localStorage.getItem(A),w=y?Number(y):1;return Number.isFinite(w)?i(w):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 f=A=>{d(typeof A=="function"?y=>i(A(y)):i(A))},b=()=>f(A=>+(A+l).toFixed(6)),x=()=>f(A=>+(A-l).toFixed(6)),C=c<r-Number.EPSILON,m=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:b,decrease:x,canIncrease:C,canDecrease:m,fontSize:_,lineHeight:g}}function Li(e,t){const a=$a(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const xo=" \xB7 ",$i=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(xo)?e.split(xo).pop()??e:e})(),ky=o.createContext(!1),Yn=[];let Ri=null;function Ay(e){const t=o.useContext(ky);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Ri=document.title);const a={text:$i?`${e}${xo}${$i}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Ri??document.title}},[e,t])}const _o=[{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"}],Ny=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function on(e,t){return Ny().compare(e,t)}const ir=new Map;function Ey(e){const t=ir.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let l=0;for(let s=r.exec(e);s;s=r.exec(e)){let i=s.index,u=s[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>l&&a.push(e.slice(l,i)),a.push(Number(u)),l=s.index+s[0].length}return l<e.length&&a.push(e.slice(l)),ir.size>5e3&&ir.clear(),ir.set(e,a),a}function Dy(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 Sy(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),l=a(t);if(r===l)return 0;const s=(d,h)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=Dy(h);return p!==null?[p]:Ey(h)},i=s(e,r),u=s(t,l),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 f=on(h,p);if(f!==0)return f}return i.length!==u.length?i.length-u.length:on(r,l)}const Pi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function wo(e,t,a){const r=Pi(e),l=Pi(t);if(r||l)return r===l?0:r?1:-1;const s=Sy(e,t);return a?s:-s}function jy(e,t,a){const{t:r}=xe.useTranslation(),[l,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&_o.some(C=>C.value===x)?x:"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(()=>_o.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{_o.some(C=>C.value===x)&&(s(x),u(1))},[]),f=Math.max(1,Math.ceil(e.length/Number(l))),b=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),f);return i!==b&&u(b),{pageRows:o.useMemo(()=>e.slice((b-1)*Number(l),b*Number(l)),[e,b,l]),pageSizeProps:{options:h,value:l,onChange:p},paginationProps:{page:b,total:f,onChange:u},setPage:u}}function Ty(e){const[t,a]=o.useState(null),r=o.useRef(t),l=o.useRef(e?.onSortChange);l.current=e?.onSortChange;const s=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),l.current?.(h)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:h,asc:p}=t;return[...c].sort((f,b)=>wo(d(f,h),d(b,h),p))},[t]);return{sort:t,field:i,sortRows:u}}const fn="\uC804\uCCB4";Object.fromEntries(Object.entries(dC).map(([e,{nucleus:t}])=>[e,t]));const My={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"})},Ly={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"})},$y={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 Ry(e,t){if("place"in t)return My[t.place](e);const a=Ly[t.vowel](e);return t.glide?`${a} \xB7 ${$y[t.glide](e)}`:a}const Py=(e,{defaultValue:t})=>t,Ii=(e,t)=>({jamos:e,phonetic:t,tooltip:Ry(Py,t)}),Bn=(e,t)=>t.map(a=>Ii([a],{place:e})),Pt=(e,t,a)=>Ii([...e],a?{vowel:t,glide:a}:{vowel:t}),Bo={cho:[Bn("labial",["\u3142","\u3143","\u314D","\u3141"]),Bn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Bn("alveolar",["\u3145","\u3146"]),Bn("palatal",["\u3148","\u3149","\u314A"]),Bn("velar",["\u3131","\u3132","\u314B"]),Bn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[Bn("labial",["\u3142","\u3141"]),Bn("alveolar",["\u3137","\u3134","\u3139"]),Bn("velar",["\u3131","\u3147"])]},Iy=e=>e===Fy?[]:Array.from(e),Fy="__NO_CODA__",ko=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:l})=>({v:a.join(""),phonetic:r,tooltip:l}))),Fi={cho:ko(Bo.cho),jung:ko(Bo.jung),jong:ko(Bo.jong)};Fi.jung.flat().forEach(({v:e})=>{for(const t of Iy(e));}),new Set(Fi.cho.flat().map(e=>e.v));function Oy(e,t=!0){const a=$a(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Pa(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),l=o.useCallback(s=>{const i=s.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:l}}function zy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const i=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),l(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),l(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Oi(e="warning"){const[t,a]=o.useState(""),[r,l]=o.useState(e),[s,i]=o.useState(0),u=o.useCallback((p,f)=>{l(f),a(p),i(b=>b+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:s,showToast:u,showWarning:c,showNormal:d,clearToast:h}}function Ia(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 Fa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[l,s]=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(()=>{l&&h()},[l,h]),o.useEffect(()=>{if(!l)return;let b=d.current?.offsetHeight??0;b>0&&h();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const B=d.current?.offsetHeight??0;if(B!==b){if(b=B,++x>4){C?.disconnect(),C=null;return}h()}}),C.observe(d.current));const m=B=>{const k=B.target;r&&k.closest?.(r)||c.current?.contains(k)||d.current?.contains(k)||s(!1)};document.addEventListener("mousedown",m),document.addEventListener("pointerdown",m);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},A=B=>{d.current?.contains(B.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const y=()=>{a==="reposition"?g():a==="close"&&s(!1)};let w=null;const v=()=>{y(),w&&clearTimeout(w),w=setTimeout(()=>{w=null,a==="reposition"&&h()},250)};return a!=="ignore"&&(window.addEventListener("resize",y),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",m),document.removeEventListener("pointerdown",m),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",y),window.removeEventListener("orientationchange",v)),w&&clearTimeout(w)}},[l,h,t,a,r]),o.useEffect(()=>{if(l)return Gn(()=>s(!1))},[l]);const p=o.useCallback(()=>s(b=>!b),[]),f=o.useCallback(()=>s(!1),[]);return{open:l,setOpen:s,toggle:p,close:f,style:i,triggerRef:c,menuRef:d}}function Wy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:l,playMs:s=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,h]=o.useState(0),[p,f]=o.useState("idle"),[b,x]=o.useState(null),[C,m]=o.useState([]),[_,g]=o.useState(null),[A,y]=o.useState(0),w=o.useRef(0),v=o.useCallback($=>{w.current=typeof $=="function"?$(w.current):$,y(w.current)},[]),B=o.useRef(r),k=o.useRef(l);o.useEffect(()=>{B.current=r,k.current=l},[r,l]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=($,H)=>{E.current.push(setTimeout(H,$))};o.useEffect(()=>()=>D(),[]);const I=u[d]?.id??null,R=o.useRef(null),Y=o.useCallback(()=>{D(),f("playing"),m([]),g(null),v(0);let $=0;e.forEach((H,z)=>{N($,()=>{h(z),x(H.id),B.current?.(H)}),N($+1e3,()=>{x(null),m(V=>[...V,H.id])}),$+=1300}),N($,()=>{f("done"),k.current?.({score:0,total:e.length})})},[e,v]),M=o.useCallback(($,H)=>{if(H>=$.length){f("done"),k.current?.({score:w.current,total:$.length});return}R.current=null,h(H),g(null),f("playing"),x($[H].id),B.current?.($[H]),N(s,()=>{x(null),f("waiting")})},[s]),T=o.useCallback(()=>{D();const $=Ta(e);c($),v(0),m([]),M($,0)},[e,M,v]),L=o.useCallback(()=>{t==="playback"?(c(e),Y()):T()},[t,e,Y,T]),Z=o.useCallback(()=>{D(),f("idle"),x(null),m([]),g(null),h(0),v(0),c([])},[v]),G=JSON.stringify(e.map($=>[$.id,$.label,$.angleDeg,$.deg,$.row,$.shortcut]));o.useEffect(()=>(a?L():Z(),()=>D()),[t,G,a]);const O=o.useCallback($=>{p!=="waiting"||t==="playback"||R.current===d||(R.current=d,g($),$===u[d]?.id&&v(H=>H+1),t==="exam"?(f("playing"),N(400,()=>M(u,d+1))):(f("feedback"),N(i,()=>M(u,d+1))))},[p,t,u,d,M,i,v]),U=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:b,playedIds:C,selectedId:_,answerId:I,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:O},index:d,total:U,score:A,phase:p,done:p==="done",start:L,reset:Z}}const Ao=new Map,No=new Map,Hy=()=>()=>{},Vy=()=>!0,qy=()=>!1;function zi(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 Uy(e){if(typeof window>"u")return"";const t=(a,r)=>{const l=r.attrName.toLowerCase(),s=r.attrValue.trim();(l==="href"||l==="xlink:href")&&!s.startsWith("#")&&(r.keepAttr=!1),(l==="style"||s.includes("\\")&&s.includes("("))&&(r.keepAttr=!1);const i=s.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function Gy(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])),l=[...a].filter(i=>r.has(i));if(l.length===0)return e;let s=e;for(const i of l){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;s=s.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 s}function Ky(e){const t=No.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&Ao.set(e,r),r)).catch(()=>null).finally(()=>{No.delete(e)});return No.set(e,a),a}function Yy(e,t=!0){const a=o.useSyncExternalStore(Hy,Vy,qy)&&t&&e?zi(e)??Ao.get(e)??null:null,[r,l]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){l({src:e,enabled:t,svg:null});return}const s=zi(e)??Ao.get(e)??null;if(s!==null){l({src:e,enabled:t,svg:s});return}let i=!0;return Ky(e).then(u=>{i&&l({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Zy({title:e,description:t,actionLabel:a,onAction:r,bg:l,color:s,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:h=""}){const p=l??s??"main",f=o.useRef(null),[b,x]=o.useState("main"),C=un("(max-width: 767px)"),m=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=vo(A),w=(v,B,k)=>{if(k!==void 0)A.style.setProperty(B,k),m.current[v]=!0;else if(m.current[v]){const E=y?.[v];E?A.style.setProperty(B,E):A.style.removeProperty(B),m.current[v]=!1}};w("title","--promo-banner-bg-title",c),w("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=vo(A);x(y?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${i}`,h),g=Ti[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),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(Ce,{htmlType:"button",size:40,variant:u??b,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Xy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":l}){const{t:s}=xe.useTranslation(),i=l??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,h]=o.useState(0),[p,f]=o.useState(!1),[b,x]=o.useState(!1),[C,m]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),y=Co(),w=p||b||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||w||y)return;const k=window.setInterval(()=>h(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(k)},[c,t,w,y]);const B=k=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,m(!1)},k)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const k=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),m(!1)))};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:k=>{_.current=k.pointerType},onPointerDown:k=>{_.current=k.pointerType,k.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),m(!0))},onPointerUp:k=>{k.pointerType==="touch"&&B(5e3)},onPointerCancel:k=>{k.pointerType==="touch"&&B(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:k=>{let E=!0;try{E=k.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((k,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:k},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((k,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>h(E)},E))})]})}function Jy({title:e,body:t,open:a=!1,onToggle:r,avatar:l,titleClassName:s="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const h=d.currentTarget.closest('[role="list"]');if(!h)return;const p=Array.from(h.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[l&&n.jsx("div",{className:"accordion-item__avatar",children:l}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(et,{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 Qy({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:l}){const[s,i]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(Jy,{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:l},c.id??d))})}function e2(){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 t2(){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 n2(){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 Et(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:l="","aria-label":s,"aria-hidden":i}=e;if(a==="dot"){const{icon:w,number:v,position:B="top-right",onClick:k,animate:E=!1}=e,D=w??"check",N=v!==void 0?"number":D,I=typeof r=="number"?r:32,R=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${B}`,`circle-badge--${I}`,E?"circle-badge--animate":"",k?"circle-badge--clickable":"",l),Y=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:R,onClick:k,onKeyDown:k?M=>{M.key!=="Enter"&&M.key!==" "||(M.preventDefault(),M.currentTarget.click())}:void 0,"aria-label":i?void 0:s??Y,"aria-hidden":i||void 0,role:k?"button":i?void 0:"img",tabIndex:k?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(e2,{}),v===void 0&&D==="remove"&&n.jsx(t2,{}),v===void 0&&D==="minus"&&n.jsx(n2,{})]})}const{label:u,children:c,variant:d="default",fill:h="filled",minWidth:p,iconLeft:f,iconRight:b,color:x}=e,C=typeof r=="number"?"medium":r??"medium",m={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,h!=="filled"?`badge--${h}`:"",m,l),A=x?.startsWith("--")?`var(${x})`:x,y=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:y,"aria-label":i?void 0:s,role:s&&!i?"img":void 0,"aria-hidden":i||void 0,children:[f&&n.jsx(et,{icon:f,size:_,className:"badge__icon"}),u??c,b&&n.jsx(et,{icon:b,size:_,className:"badge__icon"})]})}function Oa({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:l}=xe.useTranslation(),s=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const m=[{title:null,columns:e}];let _=e;for(const g of i){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],m.push({title:A.label||null,columns:_})}return m},[e,i]),d=c[c.length-1],h=c.length-1,p=o.useCallback(()=>u(m=>m.slice(0,Math.max(0,Math.min(m.length,h)-1))),[h]),f=o.useRef(null),b=o.useRef(null),x=c.length;o.useEffect(()=>{b.current||(b.current=document.activeElement);let m=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(m=requestAnimationFrame(g))};return m=requestAnimationFrame(g),()=>cancelAnimationFrame(m)},[x]),o.useEffect(()=>()=>{b.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((m,_,g)=>{if(m){if(Array.isArray(m.children)&&m.children.length){u(A=>[...A.slice(0,h),{ci:_,ii:g}]);return}try{typeof m.onClick=="function"&&m.onClick()}catch{}try{m&&m.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,h]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(Ce,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:l("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((m,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[m.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:m.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(m.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(Ce,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(Et,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?l("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Wi=".content-area";function Eo(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Wi);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Wi}) \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 Do=52,ur=10,Hi=e=>e&&e>0?e:0;function Vi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:l,moreItems:s=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",h=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,b]=o.useState(0),x=e.length;o.useEffect(()=>{const $=p.current;if(!$)return;const H=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle($):null,P=$.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=$.querySelector(".bottom-nav__left"),X=F?.nextElementSibling,se=(F?.offsetWidth??0)+(F&&X?.classList.contains("bottom-nav__divider")?X.offsetWidth:0);b(Math.max(0,P-se))};if(H(),typeof ResizeObserver>"u")return;const z=new ResizeObserver(H);z.observe($);const V=$.querySelector(".bottom-nav__left");return V&&z.observe(V),()=>z.disconnect()},[l]);const C=Do+1,m=$=>Math.max(0,Math.floor(($+ur)/(Do+ur))),_=x*(Do+ur)-ur<=f,g=f<=0||s.length===0&&_?x:Math.min(x,m(f-C)),A=f>0&&g<x,y=A?g:x,w=e.slice(0,y),v=e.slice(y),B=A||s.length>0,k=o.useCallback(($,H)=>({position:"fixed",bottom:window.innerHeight-$.top+8,right:window.innerWidth-$.right,zIndex:Ia(H)}),[]),E=o.useId(),{open:D,toggle:N,close:I,style:R,triggerRef:Y,menuRef:M}=Fa({computeStyle:k,onScroll:"ignore",onResize:"reposition"}),T=o.useCallback(($,H)=>H>0?u("nav.badgeLabel",{label:$,count:H,defaultValue:"{{label}}, {{count}}\uAC1C"}):$,[u]),L=o.useCallback(($,H)=>H>0?u("nav.badgeInsideLabel",{label:$,count:H,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):$,[u]),Z=o.useCallback(()=>l?.(c),[l,c]),G=o.useMemo(()=>v.find($=>!!$.key&&$.key===t)??s.find($=>$.selected||$.key&&$.key===t),[v,t,s]),O=o.useMemo(()=>[{items:[...v.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:!!$.key&&$.key===t,closeOnSelect:!0,disabled:$.state==="disabled",onClick:()=>{$.state!=="disabled"&&($.key&&a&&(a($.key),Eo(i,"BottomNav")),I())}})),...s.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===t),closeOnSelect:!0,onClick:()=>{$.onClick?.(),I()}}))]}],[v,s,t,a,I]),U=[...v,...s].reduce(($,H)=>$+Hi(H.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[l&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(Ce,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:h,className:"bottom-nav-item",onClick:Z})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:w.map(($,H)=>{const z=Hi($.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(Ce,{htmlType:"button",size:52,type:"dot",icon:$.icon,ariaLabel:T($.label,z),selected:!!$.key&&$.key===t,disabled:$.state==="disabled",className:"bottom-nav-item",onClick:()=>{$.key&&(a?.($.key),Eo(i,"BottomNav"))}}),z>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(z,99),size:24})})]},$.key??`__slot-${H}`)})}),B&&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:Y,className:"bottom-nav__slot",children:[n.jsx(Ce,{htmlType:"button",size:52,type:"dot",icon:G?.icon??"ellipsis",ariaLabel:L(G?.label??u("nav.more","\uB354\uBCF4\uAE30"),U),selected:!!G,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),U>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(U,99),size:24})}),D&&nn.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:R,ref:M,children:n.jsx(Oa,{columns:O,onClose:I})}),document.body)]})})]})]})}function qi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const l=r.charCodeAt(0);l<=32||l>=127&&l<=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 Ui(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function a2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:l,onNotification:s,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},h="default";return l||s||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[l&&n.jsx(Ce,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:l,selected:a==="debug"}),s&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(Ce,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:h,icon:"bell",ariaLabel:Ui(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(Et,{type:"dot",number:Math.min(r,99),size:24,"aria-hidden":!0})]}),i&&n.jsx(Ce,{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(Ce,{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(Ce,{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(Ce,{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 Gi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:l,icon:s,active:i,onClick:u,style:c,state:d,labelStyle:h}=e||{},p=a?.key??r??"",f=a?.label??l??"",b=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(et,{icon:b,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),m=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${m?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(m)return;const y=A.detail>0;if(y)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,y)},[m,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ui(t,f,x):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":m,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:h,children:f}),x>0&&n.jsx(Et,{type:"dot",position:"inline",number:Math.min(x,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 Ki(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}=e||{},C=f==="manager",m=o.useCallback(()=>b?.(C?"malgwi":"manager"),[b,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const k=_.current;if(!k)return;let E=null;const D=()=>{const{scrollHeight:R,clientHeight:Y,scrollTop:M}=k;if(R<=Y+1){A(O=>O===null?O:null);return}const T=Math.max(24,Y/R*Y),L=Y-T,Z=R-Y,G={top:Math.round(M/Z*L),height:Math.round(T)};A(O=>O&&O.top===G.top&&O.height===G.height?O:G)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),k.addEventListener("scroll",N,{passive:!0});const I=typeof ResizeObserver<"u"?new ResizeObserver(N):null;I?.observe(k);for(const R of Array.from(k.children))I?.observe(R);return()=>{E!==null&&cancelAnimationFrame(E),k.removeEventListener("scroll",N),I?.disconnect()}},[a]);const y=o.useRef(null),w=o.useCallback(k=>{const E=_.current;E&&(k.preventDefault(),y.current={y:k.clientY,top:E.scrollTop},k.currentTarget.setPointerCapture(k.pointerId))},[]),v=o.useCallback(k=>{const E=_.current,D=y.current;!E||!D||(E.scrollTop=D.top+(k.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),B=o.useCallback(k=>{y.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:w,onPointerMove:v,onPointerUp:B,onPointerCancel:B})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(k=>!k.section&&(k.key||k.label)).map((k,E)=>n.jsxs(o.Fragment,{children:[k.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Gi,{item:k,active:!!k.key&&k.key===r,state:k.disabled?"disabled":void 0,onClick:(D,N,I)=>{if(k.disabled)return;if(k.href){if(qi(k.href)&&window.open(k.href,"_blank","noopener,noreferrer"),I)try{N?.blur()}catch{}return}if(l?.(k.key),Eo(x,"SideNav"),!I)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const R=document.querySelector(".header");if(R){const Y=typeof R.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&Y&&R.matches(":hover"))){R.classList.add("header--force-collapsed");const M=()=>{R.classList.remove("header--force-collapsed"),R.removeEventListener("mouseenter",M)};R.addEventListener("mouseenter",M)}}}})]},k.key??`side-nav__item-${E}`)),b&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),b&&n.jsx(Gi,{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:m})]}),n.jsx(a2,{activeKey:r,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p})]})}var cr='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>',So='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>',r2='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 Yi({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?So:cr,l=r2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:l,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 Zi({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}){const{t:C}=xe.useTranslation(),m=un("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(R=>!R.section&&(R.key||R.label)).map(R=>({key:R.key,label:typeof R.label=="string"?R.label:void 0,icon:R.icon,state:R.disabled?"disabled":void 0,badgeCount:R.badge})),[a]),g=o.useCallback(R=>{const Y=a?.find(M=>M.key===R);if(!Y?.disabled){if(Y?.href){qi(Y.href)&&window.open(Y.href,"_blank","noopener,noreferrer");return}t?.(R)}},[a,t]),A=o.useMemo(()=>{const R=[];return i&&R.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&R.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&R.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),h&&R.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:h}),p&&R.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&R.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),R},[C,i,u,d,h,p,c,s]),y=o.useCallback((R,Y)=>({position:"fixed",top:R.bottom+8,right:Math.max(8,window.innerWidth-R.right),zIndex:Ia(Y)}),[]),w=o.useId(),{open:v,toggle:B,close:k,style:E,triggerRef:D,menuRef:N}=Fa({computeStyle:y,onScroll:"ignore",onResize:"reposition"}),I=o.useMemo(()=>[{items:A.map(R=>({label:R.label,icon:R.icon,badgeCount:R.badgeCount,selected:R.selected??(!!R.key&&R.key===e),closeOnSelect:!0,onClick:()=>{R.onClick?.(),k()}}))}],[A,e,k]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Yi,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(Ce,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:B,"aria-expanded":v,"aria-controls":v?w:void 0}),!!u&&!!s&&s>0&&n.jsx(Et,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&nn.createPortal(n.jsx("div",{id:w,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(Oa,{columns:I,onClose:k})}),document.body)]})]}),n.jsx(Ki,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b}),m&&n.jsx(Vi,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:b})]})}const o2=Zi,s2=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function Xi(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 ia(`${t.toLocaleString("ko-KR")}\uC6D0`)}return ia(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function l2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function i2(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\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 l=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return l?l[2].toLowerCase()==="year"?`${l[1]}\uB144`:`${l[1]}\uC77C`:a||s2()}function u2(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 Ji(e){return{type:e.type??l2(e),plan:i2(e),label:e.label,price:Xi(e.price),originalPrice:Xi(e.originalPrice),discountLabel:e.discountLabel}}var c2='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>',d2='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>',Qi='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 Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},jo=new WeakMap;function p2(e){if(e)return jo.get(e)}function kn(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),jo.set(e,t))}function An(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),jo.delete(e))}const eu={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function tu(e={}){const t=Nt(eu,kn,An);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("${Qi}")`}})]})}const nu="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",pa=240;var za='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 h2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},m2=100,f2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function au(e={}){const t=Nt(h2,kn,An),a="var(--color-main)",r=270,l=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:f2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*m2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,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("${za}")`}})]})}const C2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},g2=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 y2(e={}){const t=Nt(C2,kn,An),a="#ffffff",r=270,l=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:b2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*g2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,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("${Qi}")`}})]})}const v2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function x2(e={}){const t=Nt(v2,kn,An);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("${za}")`}})]})}const _2={Logo_SpeechEar_ko:{"":cr,_mono:c2},Logo_SpeechEarManager_ko:{"":So,_mono:d2}};function w2(e,t){if(e)return _2[e]?.[t??""]??void 0}const B2={speechear:cr,manager:So},k2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},ru=10;function A2(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 ou(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 l=Math.floor(e/60);return l>0?t("passCard.remainingMinute",{n:l}):t("passCard.remainingSecond",{n:Math.floor(e)})}function N2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),l=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(x2,{}):l?n.jsx(y2,{}):n.jsx(au,{})}return n.jsx(tu,{})}function su({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:l,endDate:s,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:h=!1,textColor:p,subColor:f,copyrightColor:b,logoSrc:x,label:C,price:m,originalPrice:_,discountLabel:g,onUse:A,onRefund:y,onDelete:w}){const{t:v}=xe.useTranslation(),B=t?Ji(t):void 0,k=l??B?.type??"speechear",E=r??B?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??B?.label,N=m??(a?B?.price:void 0),I=_??(a?B?.originalPrice:void 0),R=g??B?.discountLabel,Y=o.useMemo(()=>{if(N)return null;const q=t?.durationDays??u2(t?.code);if(!q||q<=0)return i!=null?{percent:null,remainingLabel:ou(i,v)}:null;const K=q*86400;let ce;if(i!=null)ce=i;else if((c==="active"||c==="expired")&&s){const de=new Date(s).getTime();if(Number.isNaN(de))return null;const oe=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),ge=/^(\d{4})-(\d{2})-(\d{2})/.exec(La()),he=Math.round(oe&&ge?(Date.UTC(+oe[1],+oe[2]-1,+oe[3])-Date.UTC(+ge[1],+ge[2]-1,+ge[3]))/864e5:(de-Date.now())/864e5);ce=Math.max(0,u?he+1:he)*86400}else c==="expired"?ce=0:ce=K;const ke=A2(ce),ye=Math.max(0,Math.min(100,Math.floor(Math.min(ke,K)/K*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):ou(ce,v)}},[N,c,s,i,u,t?.durationDays,t?.code,v]),M=o.useRef(null),[T,L]=o.useState({}),[Z,G]=o.useState(null),O=!!(A||y||w),U=o.useRef(!1),$=o.useRef(void 0),[H,z]=o.useState(x);o.useLayoutEffect(()=>{z(x)},[x]),o.useLayoutEffect(()=>{const q=M.current;q&&(p!==void 0&&q.style.setProperty("--pass-card-text",p),f!==void 0&&q.style.setProperty("--pass-card-sub",f),b!==void 0&&q.style.setProperty("--pass-card-copyright",b))},[p,f,b]),o.useLayoutEffect(()=>{const q=M.current;if(!q)return;const K=p2(q);if(!x){const ce=k2[k],ke=c==="expired"?"_mono":K?.logoColor??"",ye=w2(ce,ke);z(ye)}},[d,x,k,c]);const V=q=>{const K=M.current;if(!K)return null;const{left:ce,top:ke,width:ye,height:de}=K.getBoundingClientRect(),oe=(q.clientX-ce)/ye-.5;return{rotateX:-((q.clientY-ke)/de-.5)*ru,rotateY:oe*ru}},S=(q,K)=>{const ce=K*-.7,ke=q*.7+10,ye=20+(Math.abs(q)+Math.abs(K))*.4;return`${ce}px ${ke}px ${ye}px rgba(0, 0, 0, 0.18)`},P=o.useCallback(q=>{if(da())return;U.current=!0,clearTimeout($.current),$.current=setTimeout(()=>{U.current=!1},200);const K=V(q);K&&L({transform:`perspective(800px) rotateX(${K.rotateX}deg) rotateY(${K.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(K.rotateX,K.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)"})},[]),F=o.useCallback(q=>{if(da())return;const K=V(q);if(!K)return;const ce=U.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${K.rotateX}deg) rotateY(${K.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(K.rotateX,K.rotateY),transition:ce})},[]),X=o.useCallback(()=>{clearTimeout($.current),U.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(()=>G(null),[]),ae=o.useMemo(()=>{const q=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),K=E.replace("\uC774\uC6A9\uAD8C","").replace(q==="\uC774\uC6A9\uAD8C"?"":q,"").trim(),ce=K.match(/^(.*?)(일|년)$/);return ce?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:ce[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:ce[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:K})},[E,v]),me=o.useMemo(()=>{const q=ia(N);if(!q)return null;const K=q.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!K)return n.jsx("span",{className:"h1",children:q});const[,ce,ke,ye]=K;return n.jsxs(n.Fragment,{children:[ce&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ce}),n.jsx("span",{className:"h1 pass-card__price-amount",children:ke}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[N]),ne=o.useCallback(()=>{O&&G(q=>{if(q)return null;const K=M.current?.getBoundingClientRect();if(!K)return null;const ce=50;return{left:K.left,right:K.right,width:K.width,height:K.height,x:K.x,y:K.y+ce,top:K.top+ce,bottom:K.bottom+ce}})},[O]),W=o.useCallback(q=>{O&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),ne())},[O,ne]),ie=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),G(null)},closeOnSelect:!0}]:[],...y?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{y(),G(null)},closeOnSelect:!0}]:[],...w?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{w(),G(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}${O?" pass-card--clickable":""}`,style:T,onMouseEnter:P,onMouseMove:F,onMouseLeave:X,onPointerUp:q=>{q.pointerType==="touch"&&X()},onPointerCancel:q=>{q.pointerType==="touch"&&X()},onClick:ne,onKeyDown:O?W:void 0,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-label":e,"aria-haspopup":O?"menu":void 0,"aria-expanded":O?!!Z:void 0,children:[d??N2(k,E,D),!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:H??B2[k],className:"pass-card__logo",alt:k==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:ae}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[R&&n.jsx("span",{className:"pass-card__discount body-3",children:R}),n.jsxs("div",{className:"pass-card__price",children:[I&&n.jsx("span",{className:"pass-card__price-original body-3",children:ia(I)}),me]})]}):Y?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:Y.remainingLabel}),Y.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:Y.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."})]})]})}),Z&&n.jsx(mn,{anchorRect:Z,onClose:se,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:ie,onClose:se,size:"small"})})]})}const E2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function D2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Nt(E2,kn,An);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("${za}")`}})]})}const S2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function j2(e={}){const t=Nt(S2,kn,An);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("${za}")`}})]})}function T2(e,t){if(e){if(t==="manager_pro")return n.jsx(j2,{});if(t==="manager_standard")return n.jsx(D2,{});if(t==="manager_lite")return n.jsx(au,{})}}function M2(e){const t=ia(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,l,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),l,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function L2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:l,onSelect:s,period:i="monthly",ownedCodes:u}=e||{},c=y=>!!y&&!!u?.includes(y),d=y=>y.onceOnly??/오픈\s*특가/.test(y.label??""),h=(l.tiers||[]).some(y=>d(y)&&c(y.code)),p=y=>{const w=y.prices?y.prices[i]:y.price;return w?(l.tiers||[]).some(v=>!!v.badge&&v.originals?.[i]===w):!1},f=l.colorToken?`var(--color-${l.colorToken})`:"var(--color-gray)",b=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=y=>y.prices?y.prices[i]:y.price,m=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB34\uB8CC"||w===b||w==="0\uC6D0"||typeof w=="string"&&/\d/.test(w)&&!/[1-9]/.test(w)}),_=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB38\uC758"||w===x}),g=l.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[l.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(Et,{label:l.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:f},children:l.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:l.tier??l.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:l.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:(l.recommendedFor||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(et,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),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:(l.features||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(et,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:m?null:_?n.jsx(Ce,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>l.tiers?.[0]&&s?.({...l.tiers[0],productId:l.id,productTitle:l.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(l.tiers||[]).map(y=>{const w=y.label||a,v=d(y),B=v||y.openPromo===!0,k=w.replace(/^오픈\s*특가\s*/,"")||a,E=y.prices?y.prices[i]:y.price,D=y.badge?B?`${r}
853
- ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!h)return p(y)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${y.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:y.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:M2(E)})})]},y.id);const N=l.tier??(g?l.title:void 0),I=n.jsx(su,{showPrice:!0,product:{type:A,code:y.code,name:k,label:N,price:E,originalPrice:y.originals?.[i]??void 0,discountLabel:D},bg:T2(g,l.id)}),R=()=>s?.({...y,productId:l.id,productTitle:l.title,preview:I});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:R,onKeyDown:s?Y=>{Y.target===Y.currentTarget&&(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),R())}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,children:I},y.id)})})})})]})}function $2({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 To='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 lu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function R2(){const e=Nt(lu,kn,An);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("${To}")`}})})}const iu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function P2(e={}){const t=Nt(iu,kn,An);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("${za}")`}})]})}function uu({keys:e,anchor:t="top-right",scale:a,className:r=""}){const l=Array.isArray(e)?e:[e];return n.jsx("span",{className:_e("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:l.map((s,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:s})]},`${s}-${i}`))})}const Wa=(e,t,a)=>e+(t-e)*a;function I2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:l,selectedId:s=null,answerId:i=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:h,clickable:p=!1,onSelectSpeaker:f,buttonSize:b=40,showIcon:x=!0,onCenterClick:C,centerLabel:m,centerDisabled:_=!1,centerAttention:g=!1,shortcutAnchor:A="top-right",shortcutScale:y,scaleShortcut:w=!1}){const{t:v}=xe.useTranslation(),B=Math.max(0,Math.min(1,a)),k=t/2,E=110/300,D=.18,N=q=>t*(E+(q-1)*D),I=q=>{const K=N(q.row??1),ce=q.angleDeg*Math.PI/180;return{x:k+K*Math.cos(ce),y:k+K*Math.sin(ce)}},R=Math.max(...e.map(q=>q.row??1),1),Y=t*.08,M=t*.1,T=t*.24,L=t-2*Y,Z=t-M-T,G=t-T/2,O=o.useMemo(()=>[...new Set(e.map(q=>q.deg))].sort((q,K)=>q-K),[e]),U=O.length,$=Math.max(68,U>1?L/(U-1):0),H=o.useMemo(()=>new Map(O.map((q,K)=>[q,K])),[O]),z=q=>{const K=H.get(q.deg)??0,ce=k+(K-(U-1)/2)*$,ke=R>1?Math.min(68,Z/(R-1)):0,ye=ke*(R-1),de=M+(Z-ye)/2,oe=R===1?M+Z*.4:de+(R-(q.row??1))*ke;return{x:ce,y:oe}},V=q=>{const K=I(q),ce=z(q);return{x:Wa(K.x,ce.x,B),y:Wa(K.y,ce.y,B)}},S={x:k,y:Wa(k,G,B)},P=Math.round(b*1.2),F=Math.round(Math.max(16,Math.min(80,b*.7))),X=[],se=new Map;for(const q of e){const K=q.row??1;se.has(K)||se.set(K,[]),se.get(K).push(q)}for(const[q,K]of se.entries()){if(K.length<2)continue;const ce=[...K].sort((We,pt)=>We.deg-pt.deg),ke=ce.map(We=>V(We)),ye=ce.map(We=>We.deg),de=ye[ye.length-1]-ye[0],oe=de/(ye.length-1),ge=360-de,he=ce.length>=3&&oe>0&&ge<=oe*1.5,pe=Math.round(N(q)*1e3)/1e3,Me=(We,pt,it,at)=>{const ht=(pt.angleDeg-We.angleDeg+540)%360-180;if(ht===0)return`L ${at.x} ${at.y}`;if(B===0)return`A ${pe} ${pe} 0 0 ${ht>0?1:0} ${at.x} ${at.y}`;const Ne=(We.angleDeg+ht/2)*Math.PI/180,Ve={x:k+pe*Math.cos(Ne),y:k+pe*Math.sin(Ne)},we={x:(it.x+at.x)/2,y:(it.y+at.y)/2},Ue={x:Wa(Ve.x,we.x,B),y:Wa(Ve.y,we.y,B)},Ae={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${Ae.x} ${Ae.y} ${at.x} ${at.y}`},ze=he?[...ce,ce[0]]:ce,Le=he?[...ke,ke[0]]:ke;let Fe=`M ${Le[0].x} ${Le[0].y}`;for(let We=1;We<Le.length;We++)Fe+=" "+Me(ze[We-1],ze[We],Le[We-1],Le[We]);X.push({key:`arc-${q}`,d:Fe})}const ae=o.useMemo(()=>new Set(l??[]),[l]),me=q=>({idle:"",active:v("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:v("soundCompass.state.played","\uB4E4\uC74C"),correct:v("soundCompass.state.correct","\uC815\uB2F5"),wrong:v("soundCompass.state.wrong","\uC624\uB2F5")})[q],ne=q=>{if(r===q.id)return"active";if(u){if(q.id===i)return"correct";if(q.id===s&&s!==i)return"wrong"}return ae.has(q.id)?"played":"idle"},W=q=>r===q.id?"loop":u?q.id===i?"loop":null:c&&q.id===s?"once":null,ie=(q,K)=>{switch(q){case"played":case"correct":return n.jsx($s,{size:K});case"wrong":return n.jsx(qs,{size:K});default:return n.jsx(Vs,{size:K})}};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:[B===0&&e.map(q=>{const{x:K,y:ce}=V(q);return n.jsx("line",{x1:S.x,y1:S.y,x2:K,y2:ce,stroke:"#dde3ec",strokeWidth:"1"},q.id)}),X.map(q=>n.jsx("path",{d:q.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},q.key))]}),g&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:P,height:P,left:S.x-P/2,top:S.y-P/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:P,height:P,left:S.x,top:S.y},"aria-label":m,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:P,height:P,left:S.x,top:S.y},children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}),e.map((q,K)=>{const{x:ce,y:ke}=V(q),ye=ne(q),de=W(q),oe={...y!==void 0||w?{"--shortcut-badge-scale":String(y??Math.max(.75,Math.min(3,b/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:ye!=="idle"?10:1},ge=b,he=Math.round(Math.max(10,Math.min(56,ge*.38))),pe=Math.round(Math.max(7,Math.min(18,ge*.2))),Me=Math.round(Math.max(10,Math.min(56,ge*.4))),ze=x==="answered"&&(ye==="played"||ye==="correct"||ye==="wrong"),Le=x===!0||ze,Fe=!ze;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...oe,left:ce-ge/2,top:ke-ge/2},children:[de&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${ye}`+(de==="once"?" sound-compass__pulse--once":""),style:{width:ge,height:ge,...de==="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?()=>f?.(q.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${ye}`,style:{width:ge,height:ge},"aria-label":me(ye)?`${q.label}, ${me(ye)}`:q.label,"aria-pressed":s!=null?q.id===s:void 0,children:[Le&&ie(ye,he),Fe&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:x===!0?pe:Me},children:K+1})]}),q.shortcut&&n.jsx(uu,{keys:q.shortcut,anchor:A,className:"sound-compass__speaker-shortcut"})]},q.id)})]})})}function F2({children:e,position:t="top-left",size:a=24,className:r=""}){return n.jsx("span",{className:_e("circle-badge","circle-badge--number",`circle-badge--${a}`,`circle-badge--${t}`,r),children:e})}function O2({orientation:e="horizontal",label:t,className:a=""}){const r=_e("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 cu({checked:e,onChange:t,name:a,value:r,disabled:l=!1,label:s,className:i=""}){const u=o.useId();return n.jsxs("label",{className:`radio${l?" radio--disabled":""} ${i}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:l,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),s&&n.jsx("span",{className:"radio__label body-2",children:s})]})}function z2({options:e,value:t,onChange:a,name:r,disabled:l=!1,direction:s="vertical",className:i="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${s} ${i}`.trim(),role:"radiogroup","aria-label":u,children:e.map(h=>n.jsx(cu,{name:d,value:h.value,checked:t===h.value,disabled:l||h.disabled,label:h.label,onChange:p=>{p&&a?.(h.value)}},h.value))})}const W2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function H2({tone:e="info",title:t,message:a,children:r,dismissible:l=!1,onDismiss:s,live:i,className:u=""}){const{t:c}=xe.useTranslation(),[d,h]=o.useState(!1),p=o.useRef(null),f=o.useCallback(()=>{const g=p.current;g&&g.contains(document.activeElement)&&sr(g),h(!0),s?.()},[s]);if(d)return null;const b=_e("alert",`alert--${e}`,u),x=i??(e==="danger"||e==="warning"?"assertive":"polite"),C=x==="assertive"?"alert":x==="polite"?"status":void 0,m=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:b,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(et,{icon:W2[e],size:20,className:"alert__icon"}),m&&n.jsx("span",{className:"alert__title body-2",children:t}),!m&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),m&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),l&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:f,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const V2={ready:"search",guide:"info",error:"circle-alert"};function q2(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let l=0,s=0;for(const i of a){const u=e.indexOf(i,l);u<0||(u>l&&r.push(e.slice(l,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:i},s++)),l=u+i.length)}return l<e.length&&r.push(e.slice(l)),r}function U2({status:e="guide",label:t,children:a,emphasis:r,icon:l,className:s=""}){const i=l===!1?null:l??V2[e],u=_e("search-summary",`search-summary--${e}`,s),c=t??a,d=typeof c=="string"&&r&&r.length>0?q2(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[i!=null&&n.jsx(et,{icon:i,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Ha({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:l,close:s}=Pa(),i=o.useRef(null),u=bo(!!r,(c,d)=>{c&&d?l(i.current?.querySelector("button")??d):s()},i);return n.jsxs("span",{ref:i,style:{display:"contents"},children:[n.jsx(Ce,{htmlType:"button",size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!r,ariaLabel:a("common.info","\uC124\uBA85"),onPointerEnter:c=>{ca(c)||l(c.currentTarget)},onPointerLeave:c=>{ca(c)||s()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{da()||l(c.currentTarget)},onBlur:s}),r&&n.jsx(Kn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:s})]})}function G2({items:e=[],value:t,onChange:a,className:r="",size:l=40}){const s=o.useId(),{t:i}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,h=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),f=(C,m=p())=>{if(m.length===0)return;const _=(C%m.length+m.length)%m.length;m[_]?.focus(),m[_]?.click()},b=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const m=p(),_=m.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?f(_+1,m):C.key==="ArrowLeft"||C.key==="ArrowUp"?f(_-1,m):C.key==="Home"?f(0,m):f(m.length-1,m)},x=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--${l}`,role:"tablist","aria-label":i("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${s}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${s}-${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:b,children:C.label},C.key))}),x&&n.jsx("div",{id:`tabs__panel-${s}-${x.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${s}-${x.key}`,tabIndex:0,className:"tabs__panel",children:x.panel},x.key)]})}const K2={xs:12,sm:16,md:20,lg:28,xl:36};function Y2(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 Z2({src:e,name:t,size:a="md",shape:r="circle",className:l=""}){const{t:s}=xe.useTranslation(),[i,u]=o.useState(null),c=!!e&&i===e,d=t?Y2(t):"",h=!!e&&!c,p=!h&&!!d,f=t||s("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${l}`.trim(),role:"img","aria-label":f,children:[h&&n.jsx("img",{className:"avatar__image",src:e,alt:f,onError:()=>u(e??null)}),!h&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!h&&!p&&n.jsx(et,{icon:"user-round",size:K2[a],className:"avatar__icon"})]})}function X2(e,t){if(!t)return!0;const a=t.split(",").map(s=>s.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),l=e.type.toLowerCase();return a.some(s=>{const i=s.toLowerCase();return i.startsWith(".")?r.endsWith(i):i.endsWith("/*")?l.startsWith(i.slice(0,-1)):l===i})}function J2({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:l=!0,files:s,onRemove:i,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[h,p]=o.useState(!1),[f,b]=o.useState([]),x=s??f,C=v=>{if(!v||v.length===0)return;const B=Array.from(v).filter(E=>X2(E,t));if(B.length===0)return;const k=a?B:B.slice(0,1);if(s===void 0){const E=a?[...x,...k]:k;b(E),e?.(E)}else e?.(k)},m=v=>{v.preventDefault(),!r&&p(!0)},_=v=>{v.preventDefault(),p(!1)},g=v=>{v.preventDefault(),p(!1),!r&&C(v.dataTransfer.files)},A=v=>{const B=v.target;try{C(B.files)}finally{B.value=""}},y=()=>{r||d.current?.click()},w=v=>{if(!r&&(i?.(v),s===void 0)){const B=x.filter((k,E)=>E!==v);b(B),i||e?.(B)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:_e("file-upload__dropzone",h&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},onDragOver:m,onDragLeave:_,onDrop:g,children:[n.jsx(et,{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:v=>{v.stopPropagation(),y()},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:A,tabIndex:-1})]}),l&&x.length>0&&n.jsx("ul",{className:"file-upload__list",children:x.map((v,B)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:v.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:v.name}),disabled:r,onClick:()=>w(B),children:n.jsx(et,{icon:"x",size:14})})]},`${v.name}-${B}`))})]})}function Q2({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,l)=>{const s=l===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[s?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}),!s&&n.jsx(et,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},l)})})})}const ev={small:14,medium:20,large:28};function tv({value:e,onChange:t,max:a=5,readOnly:r=!1,size:l="medium",ariaLabel:s,className:i=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,h]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,f=d??p,b=ev[l],x=v=>{v!==e&&t?.(v)},C=v=>{c||x(v)},m=v=>{c||da()||h(v)},_=o.useRef(null),g=v=>{const B=Math.min(a,Math.max(1,v));x(B),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(k=>k.dataset.star===String(B))?.focus()},A=v=>{if(!c){switch(v.key){case"ArrowRight":case"ArrowUp":g((p||0)+1);break;case"ArrowLeft":case"ArrowDown":g((p||1)-1);break;case"Home":g(1);break;case"End":g(a);break;default:return}v.preventDefault()}},y=p>=1&&p<=a?Math.round(p):1,w=()=>{c||h(null)};return n.jsx("div",{className:`rating rating--${l}${c?" rating--readOnly":""} ${i}`.trim(),ref:_,onKeyDown:A,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):s??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:w,onPointerUp:v=>{v.pointerType==="touch"&&w()},onPointerCancel:v=>{v.pointerType==="touch"&&w()},children:Array.from({length:a},(v,B)=>{const k=B+1,E=Math.max(0,Math.min(1,f-B)),D=E>0&&E<1,N=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(et,{icon:"star",size:b,className:"rating__star rating__star--empty"}),E>0&&n.jsx("span",{className:`rating__star-fill${D?" rating__star-fill--half":""}`,style:D?{width:`${E*100}%`}:void 0,children:n.jsx(et,{icon:"star",size:b,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:N},k):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===k,"aria-label":u("rating.starLabel",{n:k}),"data-star":k,tabIndex:k===y?0:-1,onClick:()=>C(k),onMouseEnter:()=>m(k),children:N},k)})})}const nv=20,av=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function rv({value:e,onChange:t,palette:a=av,size:r=40,className:l="",ariaLabel:s}){const{t:i}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${l}`.trim(),role:"group","aria-label":s,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(et,{icon:"check",size:nv,className:"color-picker__check"})},u)})})}function du({icon:e,label:t,tooltip:a,wrapperStyle:r,color:l,bgColor:s,useHover:i=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",h=_e("category-icon",d?"category-icon--small":""),p=d?16:20,f=o.useRef(null),[b,x]=o.useState(!1),C=o.useMemo(()=>{const k=r&&typeof r=="object"?{...r}:{};return!l&&!s?k:{...k,...l?{color:l,"--t-item-fg":l}:{},...s?{"--t-item-bg":s}:{}}},[r,l,s]),m=a||t,_=i&&!!m,[g,A]=o.useState(null);o.useLayoutEffect(()=>{b&&A(f.current?.getBoundingClientRect()??null)},[b]),o.useEffect(()=>{if(!i&&b)try{x(!1)}catch{}},[i,b]),o.useEffect(()=>{if(!b)return;const k=E=>{const D=f.current;if(!D)return;const N=E.target;N&&!D.contains(N)&&x(!1)};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[b]);const y=o.useCallback(()=>{i&&x(!0)},[i]),w=o.useCallback(()=>{i&&x(!1)},[i]),v=o.useCallback(()=>x(!1),[]),B=o.useCallback(k=>{if(k.key==="Escape"){x(!1);return}(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),x(E=>!E))},[]);return n.jsxs("span",{ref:f,className:_e("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:y,onPointerLeave:w,onFocus:y,onBlur:w,onKeyDown:B,role:"button",tabIndex:0,"aria-label":typeof m=="string"?c("common.descriptionFor",{name:m,defaultValue:`${m} \uC124\uBA85`}):void 0,"aria-haspopup":!!m,"aria-expanded":b,"data-tooltip-ignore":!0,children:[n.jsx(et,{icon:e,label:t,className:h,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),b&&m&&n.jsx(wn,{anchorRect:g,text:typeof m=="string"?m:void 0,offset:8,onClose:v,className:"category-icon__tooltip",ariaLabel:typeof m=="string"?m:void 0})]})}let Fn=null;function dr(e){if(Fn&&Fn!==e)try{Fn()}catch{}return Fn=e,()=>{Fn===e&&(Fn=null)}}function pr(e){if(Fn===e){Fn=null;try{e()}catch{}}}function hr(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){St("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 l=!1;const s=u=>{if(!l){l=!0;try{t?.(u)}catch{}a(u)}};let i;try{i=new Audio(e)}catch{return s(!1),{el:{},stop:()=>{},done:r}}i.onended=()=>s(!0),i.onerror=()=>s(!1);try{i.play().catch(()=>s(!1))}catch{s(!1)}return{el:i,stop:()=>{try{i.pause()}catch{}s(!1)},done:r}}function ov(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 l=a.sentences||a.items||[],s=r(Array.isArray(l)?l:[]);return s.length===0&&(a.contextCode||a.context_code)&&s.push(String(a.contextCode||a.context_code)),{previewCodes:s,previewBucket:null}}function sv(e,t){const[a,r]=o.useState(!1),[l,s]=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),[f,b]=o.useState(!1),x=o.useRef([]),{previewCodes:C,previewBucket:m}=ov(e,t),_=`${C.join(",")}|${m??""}`,g=o.useMemo(()=>i.key===_?i.urls:[],[i,_]);o.useEffect(()=>{if(!C.length)return;let y=!1;return(async()=>{const w=[],v=[];for(const B of C)try{const k=yl(B,m);if(!k){w.push("");continue}let E=null;try{E=await vl(k)}catch{}if(!E)try{const D=await xl(k);D&&(E=URL.createObjectURL(D),v.push(E))}catch{}w.push(E??"")}catch{w.push("")}y?v.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}):(x.current.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}),x.current=v,u({key:_,urls:w}))})(),()=>{y=!0}},[C.join(","),m]),o.useEffect(()=>()=>{x.current.forEach(y=>{try{URL.revokeObjectURL(y)}catch{}}),x.current=[]},[]);const A=o.useCallback(async y=>{if(y.stopPropagation(),y.preventDefault(),d.current){h.current&&pr(h.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),s(-1);return}if(!g.filter(Boolean).length)return;let w=null;const v=()=>{d.current=!1,w?.stop()};h.current=v;const B=dr(v);d.current=!0,r(!0);for(let k=0;k<g.length&&d.current;k++){const E=g[k];if(E&&(s(k),w=hr(E),c.current=w.el,!await w.done))break}B(),h.current===v&&(h.current=null,d.current=!1,r(!1),s(-1))},[g]);return o.useEffect(()=>()=>{h.current&&pr(h.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:l,previewUrls:g,previewHover:f,setPreviewHover:b,previewBtnRef:p,handlePreview:A}}const lv=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 l=r;return l.sentence||l.text||l.context||l.question||l.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function Mo(e){const{index:t,type:a,trainingData:r,ariaLabel:l,depth:s,renderPopup:i,completed:u,completedIds:c,selectedIds:d,tooltipText:h,useDescriptionTooltip:p=!1,onRemove:f,hideCheckBadge:b=!1,showTypeLabel:x=!1,onComplete:C,onSelect:m,onMore:_,countLabelOverride:g,size:A="square"}=e||{},{t:y}=xe.useTranslation(),[w,v]=o.useState(!1),B=o.useRef(null),[k,E]=o.useState(!1);o.useEffect(()=>{B.current?.matches(":hover")&&E(!0)},[]);const{playing:D,playingIndex:N,previewUrls:I,previewHover:R,setPreviewHover:Y,previewBtnRef:M,handlePreview:T}=sv(r,a?.key),L=o.useCallback(()=>{m?m():v(!0)},[m]),Z=o.useCallback(()=>v(!1),[]),G=o.useCallback(()=>E(!0),[]),O=o.useCallback(()=>E(!1),[]),U=o.useCallback(()=>Y(!0),[Y]),$=o.useCallback(()=>Y(!1),[Y]),[H,z]=o.useState(null);o.useLayoutEffect(()=>{R&&z(M.current?.getBoundingClientRect()??null)},[R,M]);const[V,S]=o.useState(null);o.useLayoutEffect(()=>{k&&!w&&p&&S(B.current?.getBoundingClientRect()??null)},[k,w,p]);const P=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),L())},[L]),F=r||null,X=o.useMemo(()=>{if(!p)return null;const we=h?(Array.isArray(h)?h:[h]).filter(Boolean):null,Ue=we&&we.length>0?we:lv(F);return Ue&&Ue.length>0?Ue:null},[p,h,F]),se=o.useCallback(we=>{we.stopPropagation(),f?.()},[f]),ae=o.useCallback(we=>we.stopPropagation(),[]),me=o.useCallback(we=>{typeof C=="function"&&C(we)},[C]),ne=u||(c&&r?.id!=null?c.has(String(r.id)):!1),W=!ne&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Li("speechear.popup.close",Z);const ie=ql(),q=`${a?.label||""} ${t+1}`,K=F?.title||F?.name||q;let ce=a?.icon,ke,ye="",de="";try{const we=F?.category_0||F?.category_main_code||F?.category_main,Ue=F?.category_1||F?.category_sub_code||F?.category_sub,Ae=ie.find($e=>$e.key===we);Ae?.icon&&(ce=Ae.icon),!ke&&Ae?.color&&(ke={"--t-item-fg":Ae.color}),!ke&&F?.iconColor&&(ke={"--t-item-fg":F.iconColor}),ye=Ae?y(`topic.${Ae.key}`,{defaultValue:Ae.label||""}):"";try{const $e=Ae?.subs?.find(Se=>Se.key===Ue);de=$e?y(`topic.sub.${$e.key}`,{defaultValue:$e.label||""}):""}catch{}}catch{}const oe=de?`${ye} / ${de}`:ye||a?.label||K,ge=we=>y("training.countQuestions",{n:we,count:we}),he=we=>y("training.countSentences",{n:we,count:we});let pe="";try{if(F)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0?we=F.sentences.length:F.sentences&&(we=1),pe=he(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(F?.questions)?we=F.questions.length:Array.isArray(F?.sentences)&&(we=F.sentences.length),pe=ge(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(F.items)&&F.items.length>0){const Ue=F.items.reduce((Ae,$e)=>{const Se=$e.questionItems;return Array.isArray(Se)?Ae+Se.length:Array.isArray($e.questions)?Ae+$e.questions.length:Ae},0);we=Ue>0?Ue:F.items.length}else Array.isArray(F.questions)&&F.questions.length>0?we=F.questions.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length);pe=ge(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length),pe=he(we)}else Array.isArray(F.items)&&(pe=F.items.length>0?ge(F.items.length):"")}catch{}const Me=A==="row",ze=A==="list"||Me,Le=A==="compact",Fe=A==="small",We=Fe&&a?.key?UC().find(we=>we.key===a.key):void 0,pt=We?Ul[We.key]:void 0,it=We?pt?y(`trainingType.${pt}.title`,{defaultValue:We.label}):We.label??"":"",at=x&&a?.label&&a.label!==String(K)?String(a.label):Fe&&it&&it!==String(K)?it:"",ht=!!at,Ne=g!==void 0?g:pe,Ve=[at,typeof K=="string"?K:"",Ne].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:B,className:`training-block-button${ze?" training-block-button--list":""}${Me?" training-block-button--row":""}${Le?" training-block-button--compact":""}${Fe?" training-block-button--small":""}${ne?" training-block-button--completed":""}${W?" training-block-button--selected":""}${ht&&!Fe?" training-block-button--withType":""}${Fe&&!ht?" training-block-button--no-type-label":""}`,onClick:L,onPointerEnter:G,onPointerLeave:O,role:"button",tabIndex:0,onKeyDown:P,"aria-label":typeof l=="string"?l:Ve||void 0,title:!p&&h&&(Array.isArray(h)?h.filter(Boolean).join(`
854
- `):h)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[x&&a?.label&&a.label!==String(K)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),Fe&&it&&it!==String(K)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:it}),n.jsx(du,{icon:ce,label:K,tooltip:oe,wrapperStyle:ke,iconSize:Fe||Le?"small":"medium"}),!b&&(ne||W)&&!(f&&k)&&n.jsx(Et,{className:f?"training-block-button__check--removable":void 0,type:"dot",icon:"check",position:"top-left",size:"medium","aria-label":ne?y("training.completed","\uD6C8\uB828 \uC644\uB8CC"):y("training.selected","\uC120\uD0DD\uB428")}),f&&n.jsx(Et,{className:`training-block-button__remove${k?" is-hover":""}`,type:"dot",icon:"remove",position:"top-left",size:"medium","aria-label":y("common.remove","\uC81C\uAC70"),onClick:se}),n.jsx("div",{className:`training-block-button__title ${Le?"body-3":Fe?"body-3b":"h3"}`,children:String(K)}),n.jsxs("div",{className:"training-block-button__description",children:[Ne?n.jsx("div",{className:`training-block-button__count ${Fe?"caption-2":"caption-1"}`,children:Ne}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(et,{icon:"chevron-right",label:y("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:Fe?12:20})})]}),(ze&&!Me||Fe)&&I.length>0&&n.jsx("div",{ref:M,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:ae,onPointerEnter:U,onPointerLeave:$,children:n.jsx(Ce,{htmlType:"button",size:Fe?28:32,type:"dot",icon:D?"pause":"play",variant:Fe?"transparent-lightGray":"default",useBorder:!1,selected:D,ariaLabel:String(K).trim()?D?y("training.stopFor",{name:K,defaultValue:`${K} \uC815\uC9C0`}):y("training.previewFor",{name:K,defaultValue:`${K} \uBBF8\uB9AC \uB4E3\uAE30`}):D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:T})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(Ce,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(K).trim()?y("common.moreFor",{name:K}):y("common.more","\uB354\uBCF4\uAE30")})})]}),R&&n.jsx(wn,{anchorRect:H,text:D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:$}),k&&!w&&p&&(X?n.jsx(Kn,{anchorRect:V,items:X,activeIndex:N,onClose:O}):F?.subTitle?n.jsx(wn,{anchorRect:V,text:F.subTitle,offset:8,onClose:O}):null),w&&i&&i({trainingData:F,typeKey:a?.key??"",onClose:Z,onComplete:me,popupTitle:String(K),popupSubTitle:a?.subTitle,depth:s!=null?String(s):void 0,popupIcon:ce,popupIconTooltip:String(oe),popupWrapperStyle:ke})]})}const pu=200;function iv(e){return e.itemId?(XC()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function hu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:l}){const{t:s}=xe.useTranslation(),i=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):QC(s).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(iv).filter(h=>h!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,s]);if(i.length===0)return null;const u=n.jsx("div",{className:"tooltip-training__box",children:n.jsx("div",{className:"tooltip-training__groups",children:i.flatMap(({key:c,label:d,type:h,data:p},f)=>[f>0?n.jsx("div",{className:"tooltip-training__divider"},`div-${c}`):null,n.jsxs("div",{className:"tooltip-training__section",children:[n.jsx("div",{className:"tooltip-training__section-header",children:n.jsx("span",{className:"tooltip-training__type-label body-3b",children:d})}),n.jsx("div",{className:"tooltip-training__items",children:p.map((b,x)=>n.jsx(Mo,{index:x,type:h,trainingData:b,size:"compact",hideCheckBadge:!0},String(b.id??x)))})]},c)])})});return a?n.jsx(mn,{anchorRect:a,offset:r,onClose:l,closeOnOutsideClick:!1,className:"tooltip-training",ariaLabel:s("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const uv=200;function cv({icon:e,count:t,title:a,plan:r,tooltip:l=!0,hoverAccent:s=!1,className:i="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const h=!!u||!!c||l&&!!r,p=_e("count-tile",h&&"count-tile--interactive",h&&s&&"count-tile--accent",u&&"count-tile--clickable",i),f=o.useRef(null),[b,x]=o.useState(null),C=o.useRef(null),m=o.useRef(null),_=!!(b&&r&&l),g=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),m.current&&(clearTimeout(m.current),m.current=null)},[]),A=o.useCallback(()=>{g(),x(null)},[g]),y=o.useCallback(()=>{!l||!r||(g(),C.current=setTimeout(()=>{C.current=null,x(f.current?.getBoundingClientRect()??null)},pu))},[l,r,g]),w=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!m.current&&(m.current=setTimeout(()=>{m.current=null,x(null)},uv))},[]);return o.useEffect(()=>()=>{g()},[g]),o.useEffect(()=>{(!l||!r)&&A()},[l,r,A]),o.useEffect(()=>{if(!_)return;const v=k=>k instanceof Element&&(f.current?.contains(k)||!!k.closest(".tooltip-training")),B=k=>{v(k.target)?g():w()};return document.addEventListener("pointerover",B,!0),()=>document.removeEventListener("pointerover",B,!0)},[_,g,w]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:f,className:p,onClick:u?v=>{A(),u(v)}:void 0,onKeyDown:u?v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.currentTarget.click())}:void 0,onPointerEnter:v=>{v.pointerType==="touch"||v.pointerType==="pen"?A():y()},onMouseEnter:c,onMouseLeave:v=>{w(),d?.(v)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(et,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),b&&r&&n.jsx(hu,{plan:r,anchorRect:b,onClose:A})]})}let Va=0,mu="",Lo="",qa=0;function fu(){return Cu(!1)}function dv(){return Cu(!0)}function Cu(e){const t=typeof document<"u";Va===0&&t&&(mu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(qa===0&&(Lo=document.body.style.paddingRight),qa++,document.body.style.paddingRight="0px"),Va++;let a=!1;return()=>{a||(a=!0,Va=Math.max(0,Va-1),e&&t&&(qa=Math.max(0,qa-1),qa===0&&(Lo?document.body.style.paddingRight=Lo:document.body.style.removeProperty("padding-right"))),Va===0&&t&&(document.body.style.overflow=mu))}}function pv(){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 hv({open:e,onClose:t,ariaLabel:a,title:r,children:l,size:s="md",closeOnBackdrop:i=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:h}){const{t:p}=xe.useTranslation(),f=o.useId(),b=o.useRef(null),x=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const g=document.activeElement,A=fu(),y=b.current;return mo(y,g),y?.focus(),()=>{A();const w=document.activeElement;(!w||w===document.body||y&&y.contains(w))&&fo(g)?.focus?.()}},[e]);const C=o.useRef(x),m=o.useRef(u);o.useEffect(()=>{C.current=x,m.current=u}),o.useEffect(()=>{if(e)return Gn(()=>{m.current&&C.current()})},[e]);const _=o.useRef(!1);return po(b,e),!e||typeof document>"u"?null:nn.createPortal(n.jsx("div",{className:_e("dialog",d),onPointerDown:i?g=>{_.current=g.target===g.currentTarget}:void 0,onMouseDown:g=>{g.target===g.currentTarget&&g.preventDefault()},onClick:i?g=>{const A=_.current;_.current=!1,A&&g.target===g.currentTarget&&x()}:void 0,children:n.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?f:void 0,tabIndex:-1,className:_e("dialog__surface",`dialog__surface--${s}`,h),onClick:g=>g.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:f,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:x,children:n.jsx(pv,{})}):null,n.jsx("div",{className:"dialog__body",children:l})]})}),document.body)}function mv({columns:e,rows:t,rowKey:a,title:r,toolbar:l,empty:s,loading:i,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),h=!i&&t.length===0;return n.jsxs("div",{className:_e("board",c),children:[r||l?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),l?n.jsx("div",{className:"board__toolbar",children:l}):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:_e("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:s??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,f)=>n.jsx("tr",{className:"board__row",children:e.map(b=>n.jsx("td",{className:_e("board__td",`board__cell--${b.align??"left"}`),children:b.render(p,f)},b.key))},a(p,f)))})]})]})}function fv({name:e,role:t,photo:a,media:r,credentials:l,size:s=190,className:i=""}){return n.jsxs("div",{className:_e("person-card",i),children:[n.jsx("div",{className:"person-card__photo",style:{width:s,height:s},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,l?.length?n.jsx("ul",{className:"person-card__credentials",children:l.map(u=>n.jsx("li",{children:u},u))}):null]})}function Cv({groups:e,className:t=""}){return n.jsx("div",{className:_e("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,l)=>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((s,i)=>n.jsx("p",{children:s},i))})]},`${r.label??""}-${l}`))})]},a.title))})}function gv({title:e,kind:t,body:a,badge:r,badgeSrc:l,footer:s,width:i,className:u=""}){const c=r??(l?n.jsx("img",{src:l,alt:""}):null);return n.jsxs("div",{className:_e("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}),s?n.jsx("div",{className:"publication-card__footer",children:s}):null]})}function bv({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const l=$a(a);return o.useEffect(()=>{const s=setTimeout(()=>l.current?.(),r);return()=>clearTimeout(s)},[r,l]),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 yv({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:l=2,tone:s="dark",className:i=""}){const u=l===1?"h1":"h2";return n.jsxs("div",{className:_e("section-header",`section-header--${s}`,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 vv({items:e,className:t=""}){return n.jsx("ul",{className:_e("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))})}function gu(e){return typeof e=="string"?e:e.label}function bu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:l,onSelectSuggestion:s,autoActiveFirst:i=!1}){const u=o.useId(),[c,d]=o.useState(!1),[h,p]=o.useState(-1),f=o.useRef(null),b=o.useMemo(()=>{if(!a.length)return[];const N=e??"";return l===!1?a:N?typeof l=="function"?l(a,N):a.filter(I=>gu(I).toLowerCase().includes(N.toLowerCase())):r?a:[]},[a,e,r,l]),[x,C]=o.useState(!1),m=o.useRef([]),_=x&&b.length===0?m.current:b;o.useEffect(()=>{_.length&&(m.current=_)},[_]);const g=o.useCallback(()=>C(!0),[]),A=o.useCallback(()=>C(!1),[]),y=i?0:-1;o.useEffect(()=>{c||p(y)},[c,y]),o.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const w=h<_.length?h:y<_.length?y:-1,v=o.useCallback(N=>{s?s(N):t?.(gu(N)),d(!1)},[t,s]),B=o.useCallback(()=>d(!0),[]),k=o.useCallback(()=>{d(!0),p(y)},[y]),E=o.useCallback(()=>{f.current=setTimeout(()=>d(!1),120)},[]),D=o.useCallback(N=>{N.nativeEvent.isComposing||N.keyCode===229||(N.key==="ArrowDown"?(N.preventDefault(),d(!0),p(I=>Math.min(_.length-1,(I<_.length?I:y)+1))):N.key==="ArrowUp"?(N.preventDefault(),p(I=>Math.max(y,(I<_.length?I:_.length)-1))):N.key==="Enter"?w>=0&&v(_[w]):N.key==="Escape"&&c&&(N.preventDefault(),d(!1)))},[_,w,c,v,y]);return{listId:u,open:c,activeIdx:w,filtered:_,handleFocus:B,handleBlur:E,handleInput:k,handleKeyDown:D,handleSelect:v,handleCompositionStart:g,handleCompositionEnd:A}}const $o=typeof window<"u"?o.useLayoutEffect:o.useEffect;function Xn(e){const{value:t,defaultValue:a,name:r,inputRef:l,onChange:s,label:i,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:h,ghostText:p,ghostHint:f,type:b="text",disabled:x=!1,readOnly:C=!1,error:m,helperText:_,maxLength:g,size:A=48,variant:y="input",fullWidth:w=!1,newline:v=!1,multiline:B=!1,rows:k=3,leftIcon:E,rightIcon:D,clearable:N=!1,list:I,showCount:R=!0,className:Y="",onFocus:M,onBlur:T,onKeyDown:L,onEnter:Z,inputMode:G,autoComplete:O,autoFocus:U,suggestions:$,filterSuggestions:H,onSelectSuggestion:z,autoActiveFirst:V,openOnFocus:S=!1}=e,P=C||x?void 0:$,{t:F}=xe.useTranslation(),X=o.useId();!i&&!u&&St(`TextField:unnamed:${X}`,"[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-${X}`,ae=`tf-helper-${X}`,me=o.useRef(null),ne=bu({value:t??"",onChange:s,suggestions:P??[],openOnFocus:S,filterSuggestions:H,onSelectSuggestion:z,autoActiveFirst:V}),W=!!P&&ne.open&&ne.filtered.length>0,ie=o.useRef(null),[q,K]=o.useState(null),ce=o.useCallback(()=>{const Ne=ie.current;if(!Ne||typeof window>"u")return;const Ve=Ne.getBoundingClientRect(),we=230,Ue=window.innerHeight-Ve.bottom<we+8&&Ve.top>we+8;K({position:"fixed",left:Ve.left,width:Ve.width,...Ue?{bottom:window.innerHeight-Ve.top+8}:{top:Ve.bottom+8},zIndex:Ia(Ne)})},[]);$o(()=>{if(!W)return;ce();let Ne=null;const Ve=()=>{if(typeof requestAnimationFrame>"u"){ce();return}Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,ce()}))},we=Ue=>{const Ae=Ue.target;Ae&&Ae.nodeType===1&&Ae.closest?.(".text-field__suggestions")||Ve()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",Ve),()=>{Ne!==null&&cancelAnimationFrame(Ne),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Ve)}},[W,ce]);const ke=o.useCallback(Ne=>{me.current=Ne,typeof l=="function"?l(Ne):l&&(l.current=Ne)},[l]),ye=p?`${p}${f??F("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:h,de=t!==void 0,oe=de&&b==="password",[ge,he]=o.useState((a??"").length),pe=de?(t??"").length:ge,Me=o.useRef(t);$o(()=>{Me.current=t}),o.useEffect(()=>{const Ne=me.current;if(!oe||!Ne)return;const Ve=t??"";Ne.value!==Ve&&(Ne.value=Ve)},[oe,t]),o.useEffect(()=>{if(!v||!me.current)return;const Ne=me.current;Ne.style.height="",Ne.scrollHeight>Ne.clientHeight&&(Ne.style.height=`${Ne.scrollHeight}px`)},[t,ge,v]);const ze=g!=null&&pe>g,Le=A===32?16:20,Fe=_e("text-field",`text-field--s${A}`,y==="display"?"text-field--display":"",w?"text-field--full-width":"",x?"text-field--disabled":"",C?"text-field--readonly":"",m?"text-field--error":"",E?"text-field--has-left-icon":"",D||N?"text-field--has-right-icon":"",Y),We={id:se,...oe?{}:de?{value:t}:{defaultValue:a},ref:ke,placeholder:ye,name:r,disabled:x,readOnly:C,autoFocus:U,maxLength:g,list:I,inputMode:G,autoComplete:O,"aria-label":!i&&u?u:void 0,"aria-required":d,"aria-invalid":!!m,"aria-describedby":[_||m?ae:null,c].filter(Boolean).join(" ")||void 0,role:P?"combobox":void 0,"aria-autocomplete":P?"list":void 0,"aria-haspopup":P?"listbox":void 0,"aria-expanded":P?W:void 0,"aria-controls":W?ne.listId:void 0,"aria-activedescendant":W&&ne.activeIdx>=0?`${ne.listId}-option-${ne.activeIdx}`:void 0,onChange:Ne=>{const Ve=Ne.target;de||he(Ve.value.length),s?.(Ve.value),P&&ne.handleInput(),oe&&queueMicrotask(()=>{const we=Me.current??"";Ve.value!==we&&(Ve.value=we)})},onCompositionStart:P?ne.handleCompositionStart:void 0,onCompositionEnd:P?ne.handleCompositionEnd:void 0,onFocus:(Ne=>{M?.(Ne),P&&ne.handleFocus()}),onBlur:(Ne=>{T?.(Ne),P&&ne.handleBlur()}),onKeyDown:(Ne=>{const Ve=(Ne.key==="Tab"&&!Ne.shiftKey||Ne.key===" ")&&!Ne.nativeEvent.isComposing;if(p&&Ve&&!C&&!x&&!(Ne.currentTarget.value??"").trim()){Ne.preventDefault();const we=Ne.currentTarget;de||(we.value=p,he(p.length)),s?.(p);return}P&&Ne.key==="Enter"&&!Ne.nativeEvent.isComposing&&ne.activeIdx>=0?Ne.preventDefault():Z&&Ne.key==="Enter"&&!Ne.nativeEvent.isComposing&&(Ne.preventDefault(),Z()),L?.(Ne),P&&ne.handleKeyDown(Ne)})},pt=N&&!x&&!C&&pe>0,it=()=>v?n.jsx("textarea",{...We,className:"text-field__input text-field__input--auto body-2",rows:1}):B?n.jsx("textarea",{...We,className:"text-field__input text-field__input--textarea body-2",rows:k}):n.jsx("input",{...We,type:b,className:"text-field__input body-2"}),at=y==="display"&&!v&&!B&&!!ye,ht=()=>n.jsxs(n.Fragment,{children:[it(),at&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:ye})]});return n.jsxs("div",{ref:ie,className:Fe,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:[E&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(et,{icon:E,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})}),ht(),g!=null&&R&&n.jsxs("span",{className:`text-field__count caption-2${ze?" text-field__count--over":""}`,children:[pe,"/",g]}),pt&&n.jsx(Ce,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:F("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:Ne=>{Ne.preventDefault()},onClick:()=>{!de&&me.current&&(me.current.value="",he(0)),s?.("")},tabIndex:-1}),D&&!pt&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(et,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})})]}),!!P&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ne.open&&(t??"").length>0&&ne.filtered.length===0?F("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),W&&(typeof document>"u"?null:nn.createPortal(n.jsx("ul",{id:ne.listId,className:"text-field__suggestions",role:"listbox",style:q??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ne.filtered.map((Ne,Ve)=>n.jsx("li",{id:`${ne.listId}-option-${Ve}`,role:"option","aria-selected":Ve===ne.activeIdx,className:`text-field__suggestion body-2${Ve===ne.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{ne.handleSelect(Ne),me.current?.focus()},children:typeof Ne=="string"?Ne:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:Ne.label}),Ne.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:Ne.hint})]})},typeof Ne=="string"?`${Ne}-${Ve}`:Ne.id))}),document.body)),(_||m)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:ae,className:"text-field__helper caption-1",role:m?"alert":void 0,children:m||_})})]})}function cn({options:e,value:t,onChange:a,placeholder:r,disabled:l=!1,block:s=!1,size:i=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:h}){const{t:p}=xe.useTranslation(),f=r??p("dropdown.placeholder","\uC120\uD0DD"),b=o.useId(),x=o.useId(),C=o.useRef(null),m=o.useCallback((M,T)=>{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:Ia(T)}},[]),{open:_,setOpen:g,toggle:A,style:y,triggerRef:w,menuRef:v}=Fa({computeStyle:m}),[B,k]=o.useState(-1),E=o.useCallback(()=>k(-1),[]),D=e.find(M=>M.value===t);o.useEffect(()=>{if(_){const M=e.findIndex(T=>T.value===t);k(M>=0?M:e.length?0:-1),requestAnimationFrame(()=>{const T=v.current;if(!T)return;const L=T.querySelectorAll(".dropdown__option")[M];L&&(T.scrollTop=Math.max(0,L.offsetTop-T.clientHeight/2+L.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&k(M=>{if(M>=0&&M<e.length)return M;const T=e.findIndex(L=>L.value===t);return T>=0?T:e.length?0:-1})},[_,e.length]);const N=o.useCallback(()=>{l||A()},[l,A]),I=o.useCallback(M=>{M.disabled||l||(M.value!==t&&a?.(M.value),g(!1))},[a,g,l,t]);o.useEffect(()=>{l&&g(!1)},[l,g]);const R=o.useCallback(M=>{if(!l){if(!_){(M.key==="Enter"||M.key===" "||M.key==="ArrowDown")&&(M.preventDefault(),g(!0));return}if(M.key==="Escape"){M.preventDefault(),g(!1);return}M.key==="ArrowDown"?(M.preventDefault(),k(T=>{let L=T+1;for(;L<e.length&&e[L].disabled;)L++;return L<e.length?L:T})):M.key==="ArrowUp"?(M.preventDefault(),k(T=>{let L=T-1;for(;L>=0&&e[L].disabled;)L--;return L>=0?L:T})):(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),e[B]?I(e[B]):g(!1))}},[l,_,e,B,I,g]),Y=_?n.jsx("div",{ref:v,id:b,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:y,onMouseLeave:E,onMouseDown:M=>M.preventDefault(),children:e.map((M,T)=>n.jsxs("button",{id:`${b}-option-${T}`,type:"button",role:"option","aria-selected":M.value===t,className:_e("dropdown__option body-2",M.value===t?"dropdown__option--active":"",T===B?"dropdown__option--active":"",M.disabled?"dropdown__option--disabled":""),onMouseDown:L=>L.preventDefault(),onClick:()=>I(M),onMouseEnter:()=>k(T),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:_e("dropdown",`dropdown--s${i}`,_?"dropdown--open":"",s?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:R,children:[n.jsxs("button",{ref:w,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?b:void 0,"aria-activedescendant":_&&B>=0?`${b}-option-${B}`:void 0,"aria-label":d,"aria-describedby":[d&&D?x:"",h??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:l,onClick:N,onBlur:M=>{_&&!v.current?.contains(M.relatedTarget)&&g(!1)},children:[n.jsx("span",{id:x,className:`dropdown__trigger-label body-2${D?"":" dropdown__trigger-label--placeholder"}`,children:D?D.label:f}),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"&&nn.createPortal(Y,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}function mr({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:l,className:s=""}){const{t:i}=xe.useTranslation(),u=r??i("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=l??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:_e("pagination",s),children:[n.jsx(Ce,{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(Ce,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-right",ariaLabel:c,disabled:e>=t,onClick:p})]})}const Ua=new Map;function bn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(y=>!y.disabled)?.key??a[0]?.key,onChange:l=y=>{},className:s="",size:i=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:h,ariaLabel:p}=e||{},f=o.useRef(null),b=a.filter(y=>!y.disabled),x=o.useId(),C=a.map(y=>y.key).join("\xB7");o.useEffect(()=>{if(!(!$n||p!=null&&p!=="")){if(Ua.set(x,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Ua.size>1){const y=[...Ua.values()].sort();St(`segmented-control-unnamed:${y.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Ua.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): ${y.join(" / ")}`)}return()=>{Ua.delete(x)}}},[p,C,x]);const m=y=>{if(!b.length)return;const w=Math.max(0,b.findIndex(B=>B.key===r)),v=y==="first"?b[0]:y==="last"?b[b.length-1]:b[(w+y+b.length)%b.length];v&&(l(v.key),Array.from(f.current?.querySelectorAll("[data-segkey]")??[]).find(B=>B.dataset.segkey===v.key)?.focus())},_=y=>{switch(y.key){case"ArrowRight":case"ArrowDown":m(1);break;case"ArrowLeft":case"ArrowUp":m(-1);break;case"Home":m("first");break;case"End":m("last");break;default:return}y.preventDefault()},g=y=>{const w=v=>typeof v=="string"||typeof v=="number";if(!(!w(y.label)||y.count==null||y.count===!1||!w(y.count)))return`${y.label}, ${y.count}`},A=b.some(y=>y.key===r)?r:b[0]?.key;return n.jsx("div",{ref:f,onKeyDown:_,className:_e("segmented-control",`segmented-control--${u}`,`segmented-control--${i}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",h!=null&&"segmented-control--min",s),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(y=>n.jsx(Ce,{htmlType:"button",role:"radio","aria-checked":y.key===r,"data-segkey":y.key,tabIndex:y.key===A?0:-1,label:y.label,count:y.count,ariaLabel:g(y),disabled:y.disabled,className:y.key===r?"is-selected":"",onClick:()=>{y.disabled||l(y.key)},size:i,shape:u,useBorder:!1,useBG:!1},y.key))})}function Ro({count:e,search:t,segment:a,filters:r,pageSize:l,pagination:s,actions:i,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),h=!!(t||r?.length||l||s||i);return n.jsxs("div",{className:_e("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,f)=>n.jsx(bn,{size:40,...p},p.ariaLabel??f))]}),h&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(Xn,{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,f)=>n.jsx(cn,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},f)),(l||s)&&n.jsxs("div",{className:"toolbar__pager",children:[l&&n.jsx(cn,{size:40,options:l.options,value:l.value,onChange:l.onChange,ariaLabel:l.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),s&&n.jsx(mr,{page:s.page,totalPages:s.total,onChange:s.onChange,prevLabel:s.prevLabel,nextLabel:s.nextLabel})]}),i]})})]})}function yu(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(yu).join(""):""}function xv(e){let t=e.replace(/\r\n/g,`
852
+ 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"},Sb={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},jb={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"},Tb={clearAriaLabel:"Clear input"},Mb={ariaLabel:"Select tab"},Lb={ariaLabel:"Tabs"},$b={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Rb={ariaLabel:"User avatar"},Pb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Ib={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"},Fb={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"}},Ob={steps:"Step {{current}} of {{total}}"},zb={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"},Wb={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},Hb={viewWords:"Words"},Vb={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},qb={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},Ub={previewRegion:"Report preview \u2014 scrollable sideways"},Gb={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Kb={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Yb={clearSelection:"Clear selection"},Zb={showResult:"Show {{type}} result"},Xb={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Jb={loading:"Loading"},Qb={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},ey={ariaLabel:"Breadcrumb"},ty={empty:"No items yet."},ny={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"},ay={common:nb,calendar:ab,passCard:rb,rating:ob,colorPicker:sb,dropdown:lb,accordion:ib,header:ub,nav:cb,settings:db,usage:pb,account:hb,training:mb,customers:fb,payment:Cb,coupons:gb,visits:bb,trainingType:yb,myWordTable:vb,keyWords:xb,wordTable:_b,wordSearch:wb,wordPrint:Bb,topic:kb,device:Ab,manager:Nb,wordPairs:Eb,footer:Db,date:Sb,wordData:jb,textField:Tb,segmentedControl:Mb,tabs:Lb,fileUpload:$b,avatar:Rb,myHomework:Pb,trainingStatus:Ib,store:Fb,progress:Ob,trainingMiss:zb,table:Wb,wordScore:Hb,topBanner:Vb,datePicker:qb,report:Ub,tooltip:Gb,phonemeProfile:Kb,bulkBar:Yb,debug:Zb,badge:Xb,loader:Jb,soundCompass:Qb,breadcrumb:ey,board:ty,promoBannerBg:ny};const ry="0.362.0",oy=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],co="ko",sy="ihab_display_language";function Gl(){if(typeof window>"u")return co;try{const e=localStorage.getItem(sy);if(e&&oy.some(t=>t.code===e))return e}catch{}return co}function Kl(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",Kl),Kl(Gl()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:tb},en:{translation:ay}},lng:Gl(),fallbackLng:co,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const ly=new Map;try{Rt.store?.on?.("added",()=>ly.clear())}catch{}let or=null,Yl=null,Zl=null;function iy(){const e=Rl();if(e&&e.entries.length>0){const t=vC();if(or&&Yl===e&&Zl===t)return or;const a=new Set,r=[];for(const l of e.entries)!l.word||a.has(l.word)||(a.add(l.word),r.push({w:l.word,s:l.syllables,p:t?.[l.word]?[...t[l.word].cho??[],...t[l.word].jung??[],...t[l.word].jong??[]]:[],pron:l.pronunciation||l.word,grade:l.grade}));return or=r,Yl=e,Zl=t,or}return[]}new Proxy([],{get(e,t){const a=iy(),r=a[t];return typeof r=="function"?r.bind(a):r}});function uy(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 cy(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&uy(r.attrValue)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function dy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),[s,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),l(null),i(null),c(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=Yr(e):/^(Logo|Symbol)/i.test(p)?f=Yr(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),i(null),c(null),a(e),l(f)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function f(){try{let b=await fetch(r);b.ok||(b=await fetch(r));const x=b.headers.get("content-type")||"";if(p)return;if(x.includes("svg")){i("mask");return}if(x.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const m=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(m)){const _=cy(m);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return f(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,f=null;return s==="mask"&&r&&fetch(r).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.blob()}).then(b=>{p||(f=URL.createObjectURL(b),h(f))}).catch(()=>{p||i("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),h(null)}},[s,r]),t===e?{iconToUse:r,mode:s,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function Qe(e){const{icon:t,label:a,className:r,imgClassName:l,maskClassName:s,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",h=l??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=i??"iconRenderer-icon-svg",b=typeof t=="string"?t:null,x=ef(b),{iconToUse:C,mode:m,svgText:_,blobUrl:g}=dy(b),A=(k,E={})=>n.jsx("span",{className:d,style:u,...E,children:k}),y=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,w=(k,E={})=>n.jsx("img",{src:k,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:h,...E,style:y?{...E.style,...y}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,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(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(m==="mask"){const k={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:k}),{"aria-hidden":"true"})}return m==="img"?A(w(C,{onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):m==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return w(Yr(t),{style:u,onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,B=`<svg width="${v}" height="${v}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:B}}),{"aria-hidden":"true"})}function Xl(e){const[t,a]=o.useState(!1),r=o.useRef(!1),l=o.useRef(!0);o.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const s=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,l.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:s}}function py({icon:e,title:t,message:a,action:r,className:l}){const{pending:s,press:i}=Xl(r?.onClick);return n.jsxs("div",{className:_e("empty-state",l),children:[e&&n.jsx(Qe,{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:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(Qe,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function hy({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:l,className:s}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=Xl(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(Qe,{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(Qe,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:l??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function my({icon:e,title:t,description:a,cta:r,tone:l="main",disabled:s=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,h=`${c}-desc`,p=`${c}-cta`,f=()=>{s||i?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${h} ${p}`,onClick:f,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f())},className:_e("action-card",`action-card--${l}`,s&&"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(Qe,{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(Qe,{icon:"arrow-right",size:18})})]})]})})}function fy({as:e="div",className:t="",children:a,storage:r,...l}){r&&Wf({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 s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...l,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 po(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=l=>{if(l.key!=="Tab")return;const s=Array.from(a.querySelectorAll(gn)).filter(Cy);if(!s.length){l.preventDefault();return}const i=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;l.shiftKey&&(c===i||d)?(l.preventDefault(),u.focus()):!l.shiftKey&&c===u&&(l.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const gn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ho=new WeakMap;function mo(e,t){e&&ho.set(e,t)}function fo(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!ho.has(r);)r=r.parentElement;if(!r)return t;t=ho.get(r)??null}return t}function Jl(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 sr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(Jl(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const l=Array.from(document.querySelectorAll(gn)).filter(c=>!(e&&e.contains(c))&&Jl(c));let s=null,i=null;for(const c of l)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:i||(i=c);const u=s??i;return u?.focus(),u}function gy({title:e="",lines:t=[],notices:a=null,children:r,variant:l="default",dismissible:s=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),h=o.useRef(null),p=o.useCallback(()=>{const C=h.current;C&&C.contains(document.activeElement)&&sr(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${l} body-2 ${i}`.trim(),b=s&&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:f,role:"note",children:[a.map((C,m)=>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((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},m)),b]});const x=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,m)=>n.jsx("li",{className:"notice-box__line",children:C},m))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:h,className:f,role:"note",children:[x,b]})}const ua=[];let lr=!1;function Ql(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ua[ua.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return ua.push(e),!lr&&typeof document<"u"&&(document.addEventListener("keydown",Ql),lr=!0),()=>{const t=ua.lastIndexOf(e);t>=0&&ua.splice(t,1),ua.length===0&&lr&&typeof document<"u"&&(document.removeEventListener("keydown",Ql),lr=!1)}}const ei=o.createContext(null);function by(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const ti=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 Ss.useSyncExternalStore(t,()=>ti(e),()=>!1)}function vy(e){const[t,a]=o.useState(ti(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),l=i=>a(i.matches),s=r;return s.addEventListener?s.addEventListener("change",l):s.addListener&&s.addListener(l),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",l):s.removeListener&&s.removeListener(l)}},[e]),t}const xy=typeof Ss.useSyncExternalStore=="function"?yy:vy;function un(e){const t=o.useContext(ei),a=xy(e);return t&&typeof t.mobile=="boolean"&&by(e)?t.mobile:a}const _y="(prefers-reduced-motion: reduce)";function Co(){return un(_y)}function mn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:l=20,onClose:s,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:h,backdrop:p=!1,isMobilePopup:f=!1,useBorder:b=!0,header:x,focusOnOpen:C}=e||{},m=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,y]=o.useState(!1),[w,v]=o.useState("bottom"),[B,k]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,I=o.useCallback((U=!1)=>{if(E&&f)return;const $=a?a.getBoundingClientRect():t;if(!$||!m.current)return;const V=m.current,{offsetWidth:z,offsetHeight:Y}=V,S=window.innerWidth,R=window.innerHeight,F=S-$.right,Z=$.left,pe=$.top,re=R-$.bottom;let oe=0,ae=0,W="top";if(pe>=Y+r)W="top",ae=$.top-r-Y,oe=$.left+$.width/2-z/2;else if(re>=Y+r)W="bottom",ae=$.bottom+r,oe=$.left+$.width/2-z/2;else if(F>=z+r)W="right",oe=$.right+r,ae=$.top+$.height/2-Y/2;else if(Z>=z+r)W="left",oe=$.left-r-z,ae=$.top+$.height/2-Y/2;else{const de=Math.max(pe,re,F,Z);de===pe?(W="top",ae=$.top-r-Y,oe=$.left+$.width/2-z/2):de===re?(W="bottom",ae=$.bottom+r,oe=$.left+$.width/2-z/2):de===F?(W="right",oe=$.right+r,ae=$.top+$.height/2-Y/2):(W="left",oe=$.left-r-z,ae=$.top+$.height/2-Y/2)}const ie=Number.isFinite(Number(l))?Number(l):8;oe=Math.min(Math.max(oe,ie),S-z-ie),ae=Math.min(Math.max(ae,ie),R-Y-ie);const q=Math.round(oe),G=Math.round(ae);U&&m.current?(m.current.style.left=`${q}px`,m.current.style.top=`${G}px`,m.current.dataset.placement=W):(v(W||w),g({position:"fixed",left:q,top:G}),k(!0))},[E,f,a,t,r,l,w]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),k(!0);return}I();const U=requestAnimationFrame(()=>I());return()=>cancelAnimationFrame(U)},[t,a,r,h,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f||!m.current||typeof ResizeObserver>"u")return;const U=new ResizeObserver(()=>{t&&I()});return U.observe(m.current),()=>U.disconnect()},[t,h,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f)return;let U=null;const $=()=>{if(typeof requestAnimationFrame>"u"){I(!0);return}U===null&&(U=requestAnimationFrame(()=>{U=null,I(!0)}))},V=z=>{if(!a&&s){const Y=z.target;if(Y&&m.current&&m.current.contains(Y))return;try{if(Y&&Y.closest&&Y.closest("[data-tooltip-ignore]"))return}catch{}L.current(!0);return}$()};return window.addEventListener("resize",$),document.addEventListener("scroll",V,{passive:!0,capture:!0}),()=>{U!==null&&cancelAnimationFrame(U),window.removeEventListener("resize",$),document.removeEventListener("scroll",V,{capture:!0})}},[t,a,s,r,h,l,N,E,f,I]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const U=window.matchMedia("(max-width: 768px)"),$=()=>D(!!U.matches);$();try{U.addEventListener?U.addEventListener("change",$):U.addListener($)}catch{try{U.addListener($)}catch{}}return()=>{try{U.removeEventListener?U.removeEventListener("change",$):U.removeListener($)}catch{}}},[]);const P=o.useRef(!1),K=o.useRef(null),T=Co(),M=o.useCallback((U=!1)=>{if(s&&!(A||P.current)){if(P.current=!0,U){y(!0);try{s&&s()}catch{P.current=!1,y(!1)}return}y(!0),K.current=setTimeout(()=>{K.current=null;try{s&&s()}catch{P.current=!1,y(!1)}},T?0:200)}},[A,s,y,T]);o.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]),o.useEffect(()=>{if(N)return;const U=z=>{const Y=m.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},$=z=>{const Y=m.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},V=z=>{if(z.key==="Tab"){const Y=m.current;if(!Y)return;const S=Y.querySelectorAll(gn);if(!S||S.length===0)return;const R=S[0],F=S[S.length-1],Z=document.activeElement;z.shiftKey?Z===R&&(z.preventDefault(),F.focus()):Z===F&&(z.preventDefault(),R.focus())}};return document.addEventListener("pointerdown",U,!0),document.addEventListener("click",$,!0),document.addEventListener("keydown",V),()=>{document.removeEventListener("pointerdown",U,!0),document.removeEventListener("click",$,!0),document.removeEventListener("keydown",V)}},[s,i,M,N]);const L=o.useRef(M);o.useEffect(()=>{L.current=M});const Q=!!s;o.useEffect(()=>{if(!(N||!Q))return Gn(()=>L.current())},[N,Q]),o.useEffect(()=>{const U=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",U),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",U)}},[M]);const H=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!B)return;const U=m.current;if(!U)return;const $=U.querySelector(gn);if($)return H.current=document.activeElement,$.focus(),()=>{const V=H.current;H.current=null,V&&document.contains(V)&&V.focus()}},[N,C,B]),o.useEffect(()=>{c==="dialog"&&!d&&St("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 O=n.jsxs("div",{ref:m,className:`tooltip-content ${N?"tooltip-content--inline":""} ${b?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:B?"visible":"hidden"},tabIndex:-1,"data-placement":w,"data-left":N?"":_.left,"data-top":N?"":_.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:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),h]});if(N||typeof document>"u")return O;if(p||E&&f){const U=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&M(!0)}}),O]});return nn.createPortal(U,document.body)}return nn.createPortal(O,document.body)}function wn(e){const{anchorRect:t,text:a,offset:r=8,onClose:l,className:s="",ariaLabel:i}=e||{};return a?n.jsx(mn,{anchorRect:t,offset:r,onClose:l,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:i||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:l,activeIndex:s=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},h=(Array.isArray(l)?l:l?[l]:[]).map(p=>typeof p=="string"?{text:p}:p);return!h.length&&!r?null:n.jsx(mn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:h.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[i&&h.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function $a(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let go=0,ni=!1;function ai(){ni||typeof document>"u"||(ni=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(go=Date.now())},!0),document.addEventListener("touchstart",()=>{go=Date.now()},{capture:!0,passive:!0}))}ai();function ca(e){return!!e&&e.pointerType==="touch"}function da(e=1e3){return ai(),Date.now()-go<e}function bo(e,t,a,{enabled:r=!0,fallbackOnParent:l=!1}={}){const s=$a(e),i=$a(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const h=p=>{const f=p,b=p.target,x=a.current,C=!!(b&&x&&x.contains(b));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(b&&b.closest?.(".tooltip-content"))&&i.current(!1,x)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[r,a,s,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||!l)return;const h=a.current,p=h?.parentElement;if(!h||!p)return;let f=null;const b=m=>{const _=m.changedTouches?.[0];if(!_)return!1;const g=h.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=m=>{f=b(m)?s.current:null},C=m=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!b(m))&&(u.current=null,c.current=Date.now(),i.current(!_,h))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,l,a,s,i]),{touchPress:d}}function wy(e,t){const{size:a=48,type:r,htmlType:l,href:s,target:i,rel:u,icon:c,rightIcon:d,label:h,count:p,subLabel:f,children:b,ariaLabel:x,variant:C="default",align:m="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:y,ariaControls:w,disabled:v=!1,useLabel:B=!0,useBorder:k=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,useDisabledFilled:I=!1,width:P,minWidth:K,onClick:T,onDisabledClick:M,showTooltipInfo:L=!1,tooltipInfoText:Q=null,tooltipDescription:H=null,tooltipOnly:O=!1,iconSize:U="medium",iconColor:$,shape:V="rounded",color:z,className:Y,...S}=e,R=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),F=R.match(/^\d+$/)?`button${R}`:`button-${R}`,Z=Number(a),pe=!isNaN(Z)&&Z<40?"button-2":"button-1",re=h??b,oe=v||!!S.disabled,ae=oe?D?"disabled-covered":N?"disabled-invisibled":I?"disabled-filled":"disabled":C,W=ae?`button--variant-${ae}`:"",ie=m?`button--align-${m}`:"",q=_?"button--nowrap":"",G=V?`button--shape-${V}`:"",de=typeof $=="string"&&$.startsWith("--")?`var(${$})`:$,Ee={...P?{width:typeof P=="number"?`${P}px`:P}:{},...K?{minWidth:typeof K=="number"?`${K}px`:K}:{},...k?{}:{"--button-border":oe?"0":"1px solid transparent"},...de?{"--button-icon-color":de}:{},...z?{"--color-main":z}:{}},ye=B===!1?"":re,he=Array.isArray(ye)?ye.length>0:!!ye,se=!!d,Ce=r??(he||c||se?"bar":"dot"),ge=`${F}--${Ce}`,ce=o.useRef(null);o.useEffect(()=>{!$n||l!==void 0||ce.current?.closest("form")&&St(`button-in-form:${typeof re=="string"?re:""}`,'[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 re=="string"&&re?` \uB2E8\uCD94: ${re}`:""))},[l,re]);const Me=o.useRef(t);Me.current=t;const Oe=o.useCallback(Pe=>{ce.current=Pe;const nt=Me.current;typeof nt=="function"?nt(Pe):nt&&(nt.current=Pe)},[]),Le=o.useRef(oe),[ze,We]=o.useState(!!g),[dt,lt]=o.useState(!1),[at,ht]=o.useState(null),Ae=o.useCallback(()=>lt(!1),[]),[qe,we]=o.useState(!1),Ue=o.useId();o.useEffect(()=>{typeof g=="boolean"&&We(g)},[g]),o.useEffect(()=>{if(Le.current&&!oe&&ce.current){const Pe=ce.current;let nt=!1;try{nt=Pe.matches(":focus:not(:focus-visible)")}catch{nt=!1}nt&&Pe.blur(),Pe.style.pointerEvents="none";const vt=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce.current&&(ce.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(vt)}Le.current=oe},[oe]);const ke=typeof g=="boolean"?!!g:ze,$e=typeof y=="boolean"?void 0:A||typeof g=="boolean"?ke?"true":"false":S["aria-pressed"],je=_e("button",F,ge,W,ie,q,G,ke?"is-selected":null,E?null:"button--no-bg",O?"button--tooltip-only":null,Y),Ze=`button__icon button__icon--${U}`,yt=Array.isArray(f)?f:f!==void 0?[f]:[],et=()=>{if(Array.isArray(ye))return ye.map((nt,vt)=>{const Ge=yt[vt];return n.jsxs("span",{className:`button__label-text${Ge!==void 0?" button__label-text--has-sub":""}`,children:[nt,Ge!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Ge})]},vt)});const Pe=f!==void 0;return n.jsxs("span",{className:`button__label-text${Pe?" button__label-text--has-sub":""}`,children:[ye,p!=null&&n.jsx("span",{className:"button__count",children:p}),Pe&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},Xe=Pe=>{typeof g!="boolean"&&!A&&We(!1),Pe.currentTarget.blur()},_t=Pe=>{oe||(typeof S.onMouseLeave=="function"&&S.onMouseLeave(Pe),Xe(Pe))},Ct=Pe=>{if(O&&mt&&rt.touchPress(Pe.currentTarget),oe){mt&&rt.touchPress(Pe.currentTarget),Pe.preventDefault(),M?.(Pe);return}typeof g!="boolean"&&A&&We(nt=>!nt),T?.(Pe)},wt=o.useCallback(()=>{(L||H)&&(lt(!0),ht(ce.current?.getBoundingClientRect()??null))},[L,H]),Bt=o.useCallback(()=>{(L||H)&&(lt(!1),ht(null))},[L,H]),mt=!!(L||H),rt=bo(dt,Pe=>{Pe?wt():Bt()},ce,{enabled:mt&&(oe||O),fallbackOnParent:mt&&oe}),ne={...S};delete ne.disabled,delete ne.className,delete ne.faded,delete ne.useFaded,delete ne.loading,delete ne.onMouseLeave,delete ne.onPointerEnter,delete ne.onPointerLeave,delete ne.onPointerUp,delete ne.onFocus,delete ne.onBlur,oe&&(Object.keys(ne).forEach(Pe=>{/^on[A-Z]/.test(Pe)&&typeof ne[Pe]=="function"&&delete ne[Pe]}),ne["aria-disabled"]="true");const Ne=(typeof L=="string"?L:null)??(typeof Q=="string"?Q:null)??(typeof x=="string"?x:null)??(typeof re=="string"?re:null)??void 0,Je=typeof x=="string"?x:typeof re=="string"?re:Ne,Ve=H?[H.title,...H.items??[]].filter(Boolean).join(". "):L&&Ne&&Ne!==Je?Ne:"",it=[typeof S["aria-describedby"]=="string"?S["aria-describedby"]:void 0,Ve?Ue:null].filter(Boolean).join(" ")||void 0,Se=(Pe,nt)=>n.jsx(Qe,{icon:Pe,label:nt??Je,className:Ze,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),pt=()=>Ce==="dot"?n.jsxs(n.Fragment,{children:[Se(c),he&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}):m==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Se(c)}),he&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:Se(c,x??re)}),he&&n.jsx("span",{className:`button__label ${pe}`,children:et()}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}),gt=!!s&&!oe;return n.jsxs(n.Fragment,{children:[n.jsxs(gt?"a":"button",{...ne,ref:Oe,...gt?{href:s,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:l??"button",disabled:oe&&!M&&!qe},className:je,"aria-pressed":$e,"aria-expanded":typeof y=="boolean"?y:S["aria-expanded"],"aria-controls":w??S["aria-controls"],"aria-label":Je,"aria-disabled":oe&&(gt||M||qe)?!0:void 0,"aria-describedby":it,style:Ee,onClick:Ct,onMouseLeave:_t,onPointerEnter:Pe=>{ca(Pe)||wt(),!oe&&typeof S.onPointerEnter=="function"&&S.onPointerEnter(Pe)},onPointerLeave:Pe=>{ca(Pe)||Bt(),!oe&&typeof S.onPointerLeave=="function"&&S.onPointerLeave(Pe)},onPointerUp:Pe=>{oe&&mt&&rt.touchPress(Pe.currentTarget),!oe&&typeof S.onPointerUp=="function"&&S.onPointerUp(Pe)},onFocus:Pe=>{we(!0),da()||wt(),!oe&&typeof S.onFocus=="function"&&S.onFocus(Pe)},onBlur:Pe=>{we(!1),oe||Xe(Pe),Bt(),!oe&&typeof S.onBlur=="function"&&S.onBlur(Pe)},children:[pt(),Ve?n.jsx("span",{id:Ue,hidden:!0,"aria-label":Ve}):null]}),dt&&H?n.jsx(Kn,{anchorRect:at,title:H.title,items:H.items,onClose:Ae}):dt&&Ne?n.jsx(wn,{anchorRect:at,text:Ne,onClose:Ae}):null]})}const fe=o.forwardRef(wy);fe.displayName="Button";function Nt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const l=r.current?.parentElement??null;return t(l,e),()=>a(l)},[e,t,a]),r}const Ra={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},yo=new WeakMap;function vo(e){if(e)return yo.get(e)}function Wt(e,t){e&&(e.style.setProperty(Ra.title,t.title),e.style.setProperty(Ra.description,t.description),yo.set(e,t))}function Ht(e){e&&(e.style.removeProperty(Ra.title),e.style.removeProperty(Ra.description),yo.delete(e))}const ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function oi(){const e=Nt(ri,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const si={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function li(){const e=Nt(si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const ii={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ui(){const e=Nt(ii,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function di(){const e=Nt(ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const pi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function hi(){const e=Nt(pi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const mi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function fi(){const e=Nt(mi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const Ci={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function gi(){const e=Nt(Ci,Wt,Ht);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 yi(){const e=Nt(bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const vi={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function xi(){const e=Nt(vi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const _i={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function wi(){const e=Nt(_i,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Bi={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ki(){const e=Nt(Bi,Wt,Ht);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 Ai={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ni(){const e=Nt(Ai,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Ei={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function Di(){const e=Nt(Ei,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Si={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function ji(){const e=Nt(Si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),By=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Ti={main:oi,soft:li,sub:ui,deep:di,softSub:hi,warm:fi,dark:gi,radial:yi,diagonal:xi,dots:wi,outline:ki,success:Ni,naver:Di,instagram:ji};function Mi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:l=.1,lineHeightRatio:s=1.4}={}){const i=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const y=localStorage.getItem(A),w=y?Number(y):1;return Number.isFinite(w)?i(w):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 f=A=>{d(typeof A=="function"?y=>i(A(y)):i(A))},b=()=>f(A=>+(A+l).toFixed(6)),x=()=>f(A=>+(A-l).toFixed(6)),C=c<r-Number.EPSILON,m=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:b,decrease:x,canIncrease:C,canDecrease:m,fontSize:_,lineHeight:g}}function Li(e,t){const a=$a(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const xo=" \xB7 ",$i=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(xo)?e.split(xo).pop()??e:e})(),ky=o.createContext(!1),Yn=[];let Ri=null;function Ay(e){const t=o.useContext(ky);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Ri=document.title);const a={text:$i?`${e}${xo}${$i}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Ri??document.title}},[e,t])}const _o=[{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"}],Ny=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function on(e,t){return Ny().compare(e,t)}const ir=new Map;function Ey(e){const t=ir.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let l=0;for(let s=r.exec(e);s;s=r.exec(e)){let i=s.index,u=s[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>l&&a.push(e.slice(l,i)),a.push(Number(u)),l=s.index+s[0].length}return l<e.length&&a.push(e.slice(l)),ir.size>5e3&&ir.clear(),ir.set(e,a),a}function Dy(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 Sy(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),l=a(t);if(r===l)return 0;const s=(d,h)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=Dy(h);return p!==null?[p]:Ey(h)},i=s(e,r),u=s(t,l),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 f=on(h,p);if(f!==0)return f}return i.length!==u.length?i.length-u.length:on(r,l)}const Pi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function wo(e,t,a){const r=Pi(e),l=Pi(t);if(r||l)return r===l?0:r?1:-1;const s=Sy(e,t);return a?s:-s}function jy(e,t,a){const{t:r}=xe.useTranslation(),[l,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&_o.some(C=>C.value===x)?x:"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(()=>_o.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{_o.some(C=>C.value===x)&&(s(x),u(1))},[]),f=Math.max(1,Math.ceil(e.length/Number(l))),b=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),f);return i!==b&&u(b),{pageRows:o.useMemo(()=>e.slice((b-1)*Number(l),b*Number(l)),[e,b,l]),pageSizeProps:{options:h,value:l,onChange:p},paginationProps:{page:b,total:f,onChange:u},setPage:u}}function Ty(e){const[t,a]=o.useState(null),r=o.useRef(t),l=o.useRef(e?.onSortChange);l.current=e?.onSortChange;const s=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),l.current?.(h)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:h,asc:p}=t;return[...c].sort((f,b)=>wo(d(f,h),d(b,h),p))},[t]);return{sort:t,field:i,sortRows:u}}const fn="\uC804\uCCB4";Object.fromEntries(Object.entries(dC).map(([e,{nucleus:t}])=>[e,t]));const My={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"})},Ly={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"})},$y={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 Ry(e,t){if("place"in t)return My[t.place](e);const a=Ly[t.vowel](e);return t.glide?`${a} \xB7 ${$y[t.glide](e)}`:a}const Py=(e,{defaultValue:t})=>t,Ii=(e,t)=>({jamos:e,phonetic:t,tooltip:Ry(Py,t)}),Bn=(e,t)=>t.map(a=>Ii([a],{place:e})),Pt=(e,t,a)=>Ii([...e],a?{vowel:t,glide:a}:{vowel:t}),Bo={cho:[Bn("labial",["\u3142","\u3143","\u314D","\u3141"]),Bn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Bn("alveolar",["\u3145","\u3146"]),Bn("palatal",["\u3148","\u3149","\u314A"]),Bn("velar",["\u3131","\u3132","\u314B"]),Bn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[Bn("labial",["\u3142","\u3141"]),Bn("alveolar",["\u3137","\u3134","\u3139"]),Bn("velar",["\u3131","\u3147"])]},Iy=e=>e===Fy?[]:Array.from(e),Fy="__NO_CODA__",ko=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:l})=>({v:a.join(""),phonetic:r,tooltip:l}))),Fi={cho:ko(Bo.cho),jung:ko(Bo.jung),jong:ko(Bo.jong)};Fi.jung.flat().forEach(({v:e})=>{for(const t of Iy(e));}),new Set(Fi.cho.flat().map(e=>e.v));function Oy(e,t=!0){const a=$a(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Pa(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),l=o.useCallback(s=>{const i=s.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:l}}function zy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const i=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),l(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),l(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Oi(e="warning"){const[t,a]=o.useState(""),[r,l]=o.useState(e),[s,i]=o.useState(0),u=o.useCallback((p,f)=>{l(f),a(p),i(b=>b+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:s,showToast:u,showWarning:c,showNormal:d,clearToast:h}}function Ia(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 Fa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[l,s]=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(()=>{l&&h()},[l,h]),o.useEffect(()=>{if(!l)return;let b=d.current?.offsetHeight??0;b>0&&h();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const B=d.current?.offsetHeight??0;if(B!==b){if(b=B,++x>4){C?.disconnect(),C=null;return}h()}}),C.observe(d.current));const m=B=>{const k=B.target;r&&k.closest?.(r)||c.current?.contains(k)||d.current?.contains(k)||s(!1)};document.addEventListener("mousedown",m),document.addEventListener("pointerdown",m);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){h();return}_===null&&(_=requestAnimationFrame(()=>{_=null,h()}))},A=B=>{d.current?.contains(B.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const y=()=>{a==="reposition"?g():a==="close"&&s(!1)};let w=null;const v=()=>{y(),w&&clearTimeout(w),w=setTimeout(()=>{w=null,a==="reposition"&&h()},250)};return a!=="ignore"&&(window.addEventListener("resize",y),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",m),document.removeEventListener("pointerdown",m),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",y),window.removeEventListener("orientationchange",v)),w&&clearTimeout(w)}},[l,h,t,a,r]),o.useEffect(()=>{if(l)return Gn(()=>s(!1))},[l]);const p=o.useCallback(()=>s(b=>!b),[]),f=o.useCallback(()=>s(!1),[]);return{open:l,setOpen:s,toggle:p,close:f,style:i,triggerRef:c,menuRef:d}}function Wy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:l,playMs:s=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,h]=o.useState(0),[p,f]=o.useState("idle"),[b,x]=o.useState(null),[C,m]=o.useState([]),[_,g]=o.useState(null),[A,y]=o.useState(0),w=o.useRef(0),v=o.useCallback($=>{w.current=typeof $=="function"?$(w.current):$,y(w.current)},[]),B=o.useRef(r),k=o.useRef(l);o.useEffect(()=>{B.current=r,k.current=l},[r,l]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=($,V)=>{E.current.push(setTimeout(V,$))};o.useEffect(()=>()=>D(),[]);const I=u[d]?.id??null,P=o.useRef(null),K=o.useCallback(()=>{D(),f("playing"),m([]),g(null),v(0);let $=0;e.forEach((V,z)=>{N($,()=>{h(z),x(V.id),B.current?.(V)}),N($+1e3,()=>{x(null),m(Y=>[...Y,V.id])}),$+=1300}),N($,()=>{f("done"),k.current?.({score:0,total:e.length})})},[e,v]),T=o.useCallback(($,V)=>{if(V>=$.length){f("done"),k.current?.({score:w.current,total:$.length});return}P.current=null,h(V),g(null),f("playing"),x($[V].id),B.current?.($[V]),N(s,()=>{x(null),f("waiting")})},[s]),M=o.useCallback(()=>{D();const $=Ta(e);c($),v(0),m([]),T($,0)},[e,T,v]),L=o.useCallback(()=>{t==="playback"?(c(e),K()):M()},[t,e,K,M]),Q=o.useCallback(()=>{D(),f("idle"),x(null),m([]),g(null),h(0),v(0),c([])},[v]),H=JSON.stringify(e.map($=>[$.id,$.label,$.angleDeg,$.deg,$.row,$.shortcut]));o.useEffect(()=>(a?L():Q(),()=>D()),[t,H,a]);const O=o.useCallback($=>{p!=="waiting"||t==="playback"||P.current===d||(P.current=d,g($),$===u[d]?.id&&v(V=>V+1),t==="exam"?(f("playing"),N(400,()=>T(u,d+1))):(f("feedback"),N(i,()=>T(u,d+1))))},[p,t,u,d,T,i,v]),U=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:b,playedIds:C,selectedId:_,answerId:I,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:O},index:d,total:U,score:A,phase:p,done:p==="done",start:L,reset:Q}}const Ao=new Map,No=new Map,Hy=()=>()=>{},Vy=()=>!0,qy=()=>!1;function zi(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 Uy(e){if(typeof window>"u")return"";const t=(a,r)=>{const l=r.attrName.toLowerCase(),s=r.attrValue.trim();(l==="href"||l==="xlink:href")&&!s.startsWith("#")&&(r.keepAttr=!1),(l==="style"||s.includes("\\")&&s.includes("("))&&(r.keepAttr=!1);const i=s.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function Gy(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])),l=[...a].filter(i=>r.has(i));if(l.length===0)return e;let s=e;for(const i of l){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;s=s.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 s}function Ky(e){const t=No.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&Ao.set(e,r),r)).catch(()=>null).finally(()=>{No.delete(e)});return No.set(e,a),a}function Yy(e,t=!0){const a=o.useSyncExternalStore(Hy,Vy,qy)&&t&&e?zi(e)??Ao.get(e)??null:null,[r,l]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){l({src:e,enabled:t,svg:null});return}const s=zi(e)??Ao.get(e)??null;if(s!==null){l({src:e,enabled:t,svg:s});return}let i=!0;return Ky(e).then(u=>{i&&l({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Zy({title:e,description:t,actionLabel:a,onAction:r,bg:l,color:s,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:h=""}){const p=l??s??"main",f=o.useRef(null),[b,x]=o.useState("main"),C=un("(max-width: 767px)"),m=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=vo(A),w=(v,B,k)=>{if(k!==void 0)A.style.setProperty(B,k),m.current[v]=!0;else if(m.current[v]){const E=y?.[v];E?A.style.setProperty(B,E):A.style.removeProperty(B),m.current[v]=!1}};w("title","--promo-banner-bg-title",c),w("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=vo(A);x(y?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${i}`,h),g=Ti[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),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??b,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Xy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":l}){const{t:s}=xe.useTranslation(),i=l??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,h]=o.useState(0),[p,f]=o.useState(!1),[b,x]=o.useState(!1),[C,m]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),y=Co(),w=p||b||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||w||y)return;const k=window.setInterval(()=>h(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(k)},[c,t,w,y]);const B=k=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,m(!1)},k)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const k=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),m(!1)))};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:k=>{_.current=k.pointerType},onPointerDown:k=>{_.current=k.pointerType,k.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),m(!0))},onPointerUp:k=>{k.pointerType==="touch"&&B(5e3)},onPointerCancel:k=>{k.pointerType==="touch"&&B(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:k=>{let E=!0;try{E=k.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((k,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:k},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((k,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>h(E)},E))})]})}function Jy({title:e,body:t,open:a=!1,onToggle:r,avatar:l,titleClassName:s="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const h=d.currentTarget.closest('[role="list"]');if(!h)return;const p=Array.from(h.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[l&&n.jsx("div",{className:"accordion-item__avatar",children:l}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(Qe,{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 Qy({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:l}){const[s,i]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(Jy,{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:l},c.id??d))})}function e2(){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 t2(){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 n2(){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 Et(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:l="","aria-label":s,"aria-hidden":i}=e;if(a==="dot"){const{icon:w,number:v,position:B="top-right",onClick:k,animate:E=!1}=e,D=w??"check",N=v!==void 0?"number":D,I=typeof r=="number"?r:32,P=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${B}`,`circle-badge--${I}`,E?"circle-badge--animate":"",k?"circle-badge--clickable":"",l),K=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:P,onClick:k,onKeyDown:k?T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.currentTarget.click())}:void 0,"aria-label":i?void 0:s??K,"aria-hidden":i||void 0,role:k?"button":i?void 0:"img",tabIndex:k?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(e2,{}),v===void 0&&D==="remove"&&n.jsx(t2,{}),v===void 0&&D==="minus"&&n.jsx(n2,{})]})}const{label:u,children:c,variant:d="default",fill:h="filled",minWidth:p,iconLeft:f,iconRight:b,color:x}=e,C=typeof r=="number"?"medium":r??"medium",m={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,h!=="filled"?`badge--${h}`:"",m,l),A=x?.startsWith("--")?`var(${x})`:x,y=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:y,"aria-label":i?void 0:s,role:s&&!i?"img":void 0,"aria-hidden":i||void 0,children:[f&&n.jsx(Qe,{icon:f,size:_,className:"badge__icon"}),u??c,b&&n.jsx(Qe,{icon:b,size:_,className:"badge__icon"})]})}function Oa({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:l}=xe.useTranslation(),s=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const m=[{title:null,columns:e}];let _=e;for(const g of i){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],m.push({title:A.label||null,columns:_})}return m},[e,i]),d=c[c.length-1],h=c.length-1,p=o.useCallback(()=>u(m=>m.slice(0,Math.max(0,Math.min(m.length,h)-1))),[h]),f=o.useRef(null),b=o.useRef(null),x=c.length;o.useEffect(()=>{b.current||(b.current=document.activeElement);let m=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(m=requestAnimationFrame(g))};return m=requestAnimationFrame(g),()=>cancelAnimationFrame(m)},[x]),o.useEffect(()=>()=>{b.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((m,_,g)=>{if(m){if(Array.isArray(m.children)&&m.children.length){u(A=>[...A.slice(0,h),{ci:_,ii:g}]);return}try{typeof m.onClick=="function"&&m.onClick()}catch{}try{m&&m.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,h]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(fe,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:l("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((m,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[m.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:m.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(m.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(fe,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(Et,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?l("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Wi=".content-area";function Eo(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Wi);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Wi}) \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 Do=52,ur=10,Hi=e=>e&&e>0?e:0;function Vi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:l,moreItems:s=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",h=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,b]=o.useState(0),x=e.length;o.useEffect(()=>{const $=p.current;if(!$)return;const V=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle($):null,R=$.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=$.querySelector(".bottom-nav__left"),Z=F?.nextElementSibling,pe=(F?.offsetWidth??0)+(F&&Z?.classList.contains("bottom-nav__divider")?Z.offsetWidth:0);b(Math.max(0,R-pe))};if(V(),typeof ResizeObserver>"u")return;const z=new ResizeObserver(V);z.observe($);const Y=$.querySelector(".bottom-nav__left");return Y&&z.observe(Y),()=>z.disconnect()},[l]);const C=Do+1,m=$=>Math.max(0,Math.floor(($+ur)/(Do+ur))),_=x*(Do+ur)-ur<=f,g=f<=0||s.length===0&&_?x:Math.min(x,m(f-C)),A=f>0&&g<x,y=A?g:x,w=e.slice(0,y),v=e.slice(y),B=A||s.length>0,k=o.useCallback(($,V)=>({position:"fixed",bottom:window.innerHeight-$.top+8,right:window.innerWidth-$.right,zIndex:Ia(V)}),[]),E=o.useId(),{open:D,toggle:N,close:I,style:P,triggerRef:K,menuRef:T}=Fa({computeStyle:k,onScroll:"ignore",onResize:"reposition"}),M=o.useCallback(($,V)=>V>0?u("nav.badgeLabel",{label:$,count:V,defaultValue:"{{label}}, {{count}}\uAC1C"}):$,[u]),L=o.useCallback(($,V)=>V>0?u("nav.badgeInsideLabel",{label:$,count:V,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):$,[u]),Q=o.useCallback(()=>l?.(c),[l,c]),H=o.useMemo(()=>v.find($=>!!$.key&&$.key===t)??s.find($=>$.selected||$.key&&$.key===t),[v,t,s]),O=o.useMemo(()=>[{items:[...v.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:!!$.key&&$.key===t,closeOnSelect:!0,disabled:$.state==="disabled",onClick:()=>{$.state!=="disabled"&&($.key&&a&&(a($.key),Eo(i,"BottomNav")),I())}})),...s.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===t),closeOnSelect:!0,onClick:()=>{$.onClick?.(),I()}}))]}],[v,s,t,a,I]),U=[...v,...s].reduce(($,V)=>$+Hi(V.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[l&&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:w.map(($,V)=>{const z=Hi($.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:$.icon,ariaLabel:M($.label,z),selected:!!$.key&&$.key===t,disabled:$.state==="disabled",className:"bottom-nav-item",onClick:()=>{$.key&&(a?.($.key),Eo(i,"BottomNav"))}}),z>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(z,99),size:24})})]},$.key??`__slot-${V}`)})}),B&&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:K,className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:H?.icon??"ellipsis",ariaLabel:L(H?.label??u("nav.more","\uB354\uBCF4\uAE30"),U),selected:!!H,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),U>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(U,99),size:24})}),D&&nn.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:P,ref:T,children:n.jsx(Oa,{columns:O,onClose:I})}),document.body)]})})]})]})}function qi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const l=r.charCodeAt(0);l<=32||l>=127&&l<=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 Ui(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function a2(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:l,onNotification:s,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},h="default";return l||s||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[l&&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:l,selected:a==="debug"}),s&&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:Ui(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(Et,{type:"dot",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 Gi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:l,icon:s,active:i,onClick:u,style:c,state:d,labelStyle:h}=e||{},p=a?.key??r??"",f=a?.label??l??"",b=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(Qe,{icon:b,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),m=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${m?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(m)return;const y=A.detail>0;if(y)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,y)},[m,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ui(t,f,x):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":m,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:h,children:f}),x>0&&n.jsx(Et,{type:"dot",position:"inline",number:Math.min(x,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 Ki(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}=e||{},C=f==="manager",m=o.useCallback(()=>b?.(C?"malgwi":"manager"),[b,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const k=_.current;if(!k)return;let E=null;const D=()=>{const{scrollHeight:P,clientHeight:K,scrollTop:T}=k;if(P<=K+1){A(O=>O===null?O:null);return}const M=Math.max(24,K/P*K),L=K-M,Q=P-K,H={top:Math.round(T/Q*L),height:Math.round(M)};A(O=>O&&O.top===H.top&&O.height===H.height?O:H)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),k.addEventListener("scroll",N,{passive:!0});const I=typeof ResizeObserver<"u"?new ResizeObserver(N):null;I?.observe(k);for(const P of Array.from(k.children))I?.observe(P);return()=>{E!==null&&cancelAnimationFrame(E),k.removeEventListener("scroll",N),I?.disconnect()}},[a]);const y=o.useRef(null),w=o.useCallback(k=>{const E=_.current;E&&(k.preventDefault(),y.current={y:k.clientY,top:E.scrollTop},k.currentTarget.setPointerCapture(k.pointerId))},[]),v=o.useCallback(k=>{const E=_.current,D=y.current;!E||!D||(E.scrollTop=D.top+(k.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),B=o.useCallback(k=>{y.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:w,onPointerMove:v,onPointerUp:B,onPointerCancel:B})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(k=>!k.section&&(k.key||k.label)).map((k,E)=>n.jsxs(o.Fragment,{children:[k.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Gi,{item:k,active:!!k.key&&k.key===r,state:k.disabled?"disabled":void 0,onClick:(D,N,I)=>{if(k.disabled)return;if(k.href){if(qi(k.href)&&window.open(k.href,"_blank","noopener,noreferrer"),I)try{N?.blur()}catch{}return}if(l?.(k.key),Eo(x,"SideNav"),!I)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const P=document.querySelector(".header");if(P){const K=typeof P.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&K&&P.matches(":hover"))){P.classList.add("header--force-collapsed");const T=()=>{P.classList.remove("header--force-collapsed"),P.removeEventListener("mouseenter",T)};P.addEventListener("mouseenter",T)}}}})]},k.key??`side-nav__item-${E}`)),b&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),b&&n.jsx(Gi,{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:m})]}),n.jsx(a2,{activeKey:r,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p})]})}var cr='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>',So='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>',r2='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 Yi({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?So:cr,l=r2;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:l,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 Zi({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}){const{t:C}=xe.useTranslation(),m=un("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(P=>!P.section&&(P.key||P.label)).map(P=>({key:P.key,label:typeof P.label=="string"?P.label:void 0,icon:P.icon,state:P.disabled?"disabled":void 0,badgeCount:P.badge})),[a]),g=o.useCallback(P=>{const K=a?.find(T=>T.key===P);if(!K?.disabled){if(K?.href){qi(K.href)&&window.open(K.href,"_blank","noopener,noreferrer");return}t?.(P)}},[a,t]),A=o.useMemo(()=>{const P=[];return i&&P.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&P.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&P.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),h&&P.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:h}),p&&P.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&P.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),P},[C,i,u,d,h,p,c,s]),y=o.useCallback((P,K)=>({position:"fixed",top:P.bottom+8,right:Math.max(8,window.innerWidth-P.right),zIndex:Ia(K)}),[]),w=o.useId(),{open:v,toggle:B,close:k,style:E,triggerRef:D,menuRef:N}=Fa({computeStyle:y,onScroll:"ignore",onResize:"reposition"}),I=o.useMemo(()=>[{items:A.map(P=>({label:P.label,icon:P.icon,badgeCount:P.badgeCount,selected:P.selected??(!!P.key&&P.key===e),closeOnSelect:!0,onClick:()=>{P.onClick?.(),k()}}))}],[A,e,k]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Yi,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(fe,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:B,"aria-expanded":v,"aria-controls":v?w:void 0}),!!u&&!!s&&s>0&&n.jsx(Et,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&nn.createPortal(n.jsx("div",{id:w,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(Oa,{columns:I,onClose:k})}),document.body)]})]}),n.jsx(Ki,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:h,onFeedback:p,appMode:f,onAppModeChange:b}),m&&n.jsx(Vi,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:b})]})}const o2=Zi,s2=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function Xi(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 ia(`${t.toLocaleString("ko-KR")}\uC6D0`)}return ia(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function l2(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function i2(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\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 l=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return l?l[2].toLowerCase()==="year"?`${l[1]}\uB144`:`${l[1]}\uC77C`:a||s2()}function u2(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 Ji(e){return{type:e.type??l2(e),plan:i2(e),label:e.label,price:Xi(e.price),originalPrice:Xi(e.originalPrice),discountLabel:e.discountLabel}}var c2='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>',d2='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>',Qi='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 Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},jo=new WeakMap;function p2(e){if(e)return jo.get(e)}function kn(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),jo.set(e,t))}function An(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),jo.delete(e))}const eu={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function tu(e={}){const t=Nt(eu,kn,An);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("${Qi}")`}})]})}const nu="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",pa=240;var za='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 h2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},m2=100,f2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function au(e={}){const t=Nt(h2,kn,An),a="var(--color-main)",r=270,l=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:f2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*m2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,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("${za}")`}})]})}const C2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},g2=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 y2(e={}){const t=Nt(C2,kn,An),a="#ffffff",r=270,l=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:b2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*g2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,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("${Qi}")`}})]})}const v2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function x2(e={}){const t=Nt(v2,kn,An);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("${za}")`}})]})}const _2={Logo_SpeechEar_ko:{"":cr,_mono:c2},Logo_SpeechEarManager_ko:{"":So,_mono:d2}};function w2(e,t){if(e)return _2[e]?.[t??""]??void 0}const B2={speechear:cr,manager:So},k2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},ru=10;function A2(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 ou(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 l=Math.floor(e/60);return l>0?t("passCard.remainingMinute",{n:l}):t("passCard.remainingSecond",{n:Math.floor(e)})}function N2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),l=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(x2,{}):l?n.jsx(y2,{}):n.jsx(au,{})}return n.jsx(tu,{})}function su({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:l,endDate:s,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:h=!1,textColor:p,subColor:f,copyrightColor:b,logoSrc:x,label:C,price:m,originalPrice:_,discountLabel:g,onUse:A,onRefund:y,onDelete:w}){const{t:v}=xe.useTranslation(),B=t?Ji(t):void 0,k=l??B?.type??"speechear",E=r??B?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??B?.label,N=m??(a?B?.price:void 0),I=_??(a?B?.originalPrice:void 0),P=g??B?.discountLabel,K=o.useMemo(()=>{if(N)return null;const q=t?.durationDays??u2(t?.code);if(!q||q<=0)return i!=null?{percent:null,remainingLabel:ou(i,v)}:null;const G=q*86400;let de;if(i!=null)de=i;else if((c==="active"||c==="expired")&&s){const he=new Date(s).getTime();if(Number.isNaN(he))return null;const se=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),Ce=/^(\d{4})-(\d{2})-(\d{2})/.exec(La()),ge=Math.round(se&&Ce?(Date.UTC(+se[1],+se[2]-1,+se[3])-Date.UTC(+Ce[1],+Ce[2]-1,+Ce[3]))/864e5:(he-Date.now())/864e5);de=Math.max(0,u?ge+1:ge)*86400}else c==="expired"?de=0:de=G;const Ee=A2(de),ye=Math.max(0,Math.min(100,Math.floor(Math.min(Ee,G)/G*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):ou(de,v)}},[N,c,s,i,u,t?.durationDays,t?.code,v]),T=o.useRef(null),[M,L]=o.useState({}),[Q,H]=o.useState(null),O=!!(A||y||w),U=o.useRef(!1),$=o.useRef(void 0),[V,z]=o.useState(x);o.useLayoutEffect(()=>{z(x)},[x]),o.useLayoutEffect(()=>{const q=T.current;q&&(p!==void 0&&q.style.setProperty("--pass-card-text",p),f!==void 0&&q.style.setProperty("--pass-card-sub",f),b!==void 0&&q.style.setProperty("--pass-card-copyright",b))},[p,f,b]),o.useLayoutEffect(()=>{const q=T.current;if(!q)return;const G=p2(q);if(!x){const de=k2[k],Ee=c==="expired"?"_mono":G?.logoColor??"",ye=w2(de,Ee);z(ye)}},[d,x,k,c]);const Y=q=>{const G=T.current;if(!G)return null;const{left:de,top:Ee,width:ye,height:he}=G.getBoundingClientRect(),se=(q.clientX-de)/ye-.5;return{rotateX:-((q.clientY-Ee)/he-.5)*ru,rotateY:se*ru}},S=(q,G)=>{const de=G*-.7,Ee=q*.7+10,ye=20+(Math.abs(q)+Math.abs(G))*.4;return`${de}px ${Ee}px ${ye}px rgba(0, 0, 0, 0.18)`},R=o.useCallback(q=>{if(da())return;U.current=!0,clearTimeout($.current),$.current=setTimeout(()=>{U.current=!1},200);const G=Y(q);G&&L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.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)"})},[]),F=o.useCallback(q=>{if(da())return;const G=Y(q);if(!G)return;const de=U.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.rotateY),transition:de})},[]),Z=o.useCallback(()=>{clearTimeout($.current),U.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)"})},[]),pe=o.useCallback(()=>H(null),[]),re=o.useMemo(()=>{const q=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),G=E.replace("\uC774\uC6A9\uAD8C","").replace(q==="\uC774\uC6A9\uAD8C"?"":q,"").trim(),de=G.match(/^(.*?)(일|년)$/);return de?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:de[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:de[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:G})},[E,v]),oe=o.useMemo(()=>{const q=ia(N);if(!q)return null;const G=q.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!G)return n.jsx("span",{className:"h1",children:q});const[,de,Ee,ye]=G;return n.jsxs(n.Fragment,{children:[de&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:de}),n.jsx("span",{className:"h1 pass-card__price-amount",children:Ee}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[N]),ae=o.useCallback(()=>{O&&H(q=>{if(q)return null;const G=T.current?.getBoundingClientRect();if(!G)return null;const de=50;return{left:G.left,right:G.right,width:G.width,height:G.height,x:G.x,y:G.y+de,top:G.top+de,bottom:G.bottom+de}})},[O]),W=o.useCallback(q=>{O&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),ae())},[O,ae]),ie=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),H(null)},closeOnSelect:!0}]:[],...y?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{y(),H(null)},closeOnSelect:!0}]:[],...w?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{w(),H(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:T,className:`pass-card pass-card--${c}${O?" pass-card--clickable":""}`,style:M,onMouseEnter:R,onMouseMove:F,onMouseLeave:Z,onPointerUp:q=>{q.pointerType==="touch"&&Z()},onPointerCancel:q=>{q.pointerType==="touch"&&Z()},onClick:ae,onKeyDown:O?W:void 0,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-label":e,"aria-haspopup":O?"menu":void 0,"aria-expanded":O?!!Q:void 0,children:[d??N2(k,E,D),!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:V??B2[k],className:"pass-card__logo",alt:k==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:re}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[P&&n.jsx("span",{className:"pass-card__discount body-3",children:P}),n.jsxs("div",{className:"pass-card__price",children:[I&&n.jsx("span",{className:"pass-card__price-original body-3",children:ia(I)}),oe]})]}):K?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:K.remainingLabel}),K.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:K.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(mn,{anchorRect:Q,onClose:pe,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:ie,onClose:pe,size:"small"})})]})}const E2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function D2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Nt(E2,kn,An);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("${za}")`}})]})}const S2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function j2(e={}){const t=Nt(S2,kn,An);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("${za}")`}})]})}function T2(e,t){if(e){if(t==="manager_pro")return n.jsx(j2,{});if(t==="manager_standard")return n.jsx(D2,{});if(t==="manager_lite")return n.jsx(au,{})}}function M2(e){const t=ia(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,l,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),l,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function L2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:l,onSelect:s,period:i="monthly",ownedCodes:u}=e||{},c=y=>!!y&&!!u?.includes(y),d=y=>y.onceOnly??/오픈\s*특가/.test(y.label??""),h=(l.tiers||[]).some(y=>d(y)&&c(y.code)),p=y=>{const w=y.prices?y.prices[i]:y.price;return w?(l.tiers||[]).some(v=>!!v.badge&&v.originals?.[i]===w):!1},f=l.colorToken?`var(--color-${l.colorToken})`:"var(--color-gray)",b=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=y=>y.prices?y.prices[i]:y.price,m=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB34\uB8CC"||w===b||w==="0\uC6D0"||typeof w=="string"&&/\d/.test(w)&&!/[1-9]/.test(w)}),_=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB38\uC758"||w===x}),g=l.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[l.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(Et,{label:l.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:f},children:l.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:l.tier??l.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:l.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:(l.recommendedFor||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),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:(l.features||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:m?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:()=>l.tiers?.[0]&&s?.({...l.tiers[0],productId:l.id,productTitle:l.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(l.tiers||[]).map(y=>{const w=y.label||a,v=d(y),B=v||y.openPromo===!0,k=w.replace(/^오픈\s*특가\s*/,"")||a,E=y.prices?y.prices[i]:y.price,D=y.badge?B?`${r}
853
+ ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!h)return p(y)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${y.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:y.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:M2(E)})})]},y.id);const N=l.tier??(g?l.title:void 0),I=n.jsx(su,{showPrice:!0,product:{type:A,code:y.code,name:k,label:N,price:E,originalPrice:y.originals?.[i]??void 0,discountLabel:D},bg:T2(g,l.id)}),P=()=>s?.({...y,productId:l.id,productTitle:l.title,preview:I});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:P,onKeyDown:s?K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),P())}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,children:I},y.id)})})})})]})}function $2({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 To='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 lu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function R2(){const e=Nt(lu,kn,An);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("${To}")`}})})}const iu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function P2(e={}){const t=Nt(iu,kn,An);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("${za}")`}})]})}function uu({keys:e,anchor:t="top-right",scale:a,className:r=""}){const l=Array.isArray(e)?e:[e];return n.jsx("span",{className:_e("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:l.map((s,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:s})]},`${s}-${i}`))})}const Wa=(e,t,a)=>e+(t-e)*a;function I2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:l,selectedId:s=null,answerId:i=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:h,clickable:p=!1,onSelectSpeaker:f,buttonSize:b=40,showIcon:x=!0,onCenterClick:C,centerLabel:m,centerDisabled:_=!1,centerAttention:g=!1,shortcutAnchor:A="top-right",shortcutScale:y,scaleShortcut:w=!1}){const{t:v}=xe.useTranslation(),B=Math.max(0,Math.min(1,a)),k=t/2,E=110/300,D=.18,N=q=>t*(E+(q-1)*D),I=q=>{const G=N(q.row??1),de=q.angleDeg*Math.PI/180;return{x:k+G*Math.cos(de),y:k+G*Math.sin(de)}},P=Math.max(...e.map(q=>q.row??1),1),K=t*.08,T=t*.1,M=t*.24,L=t-2*K,Q=t-T-M,H=t-M/2,O=o.useMemo(()=>[...new Set(e.map(q=>q.deg))].sort((q,G)=>q-G),[e]),U=O.length,$=Math.max(68,U>1?L/(U-1):0),V=o.useMemo(()=>new Map(O.map((q,G)=>[q,G])),[O]),z=q=>{const G=V.get(q.deg)??0,de=k+(G-(U-1)/2)*$,Ee=P>1?Math.min(68,Q/(P-1)):0,ye=Ee*(P-1),he=T+(Q-ye)/2,se=P===1?T+Q*.4:he+(P-(q.row??1))*Ee;return{x:de,y:se}},Y=q=>{const G=I(q),de=z(q);return{x:Wa(G.x,de.x,B),y:Wa(G.y,de.y,B)}},S={x:k,y:Wa(k,H,B)},R=Math.round(b*1.2),F=Math.round(Math.max(16,Math.min(80,b*.7))),Z=[],pe=new Map;for(const q of e){const G=q.row??1;pe.has(G)||pe.set(G,[]),pe.get(G).push(q)}for(const[q,G]of pe.entries()){if(G.length<2)continue;const de=[...G].sort((We,dt)=>We.deg-dt.deg),Ee=de.map(We=>Y(We)),ye=de.map(We=>We.deg),he=ye[ye.length-1]-ye[0],se=he/(ye.length-1),Ce=360-he,ge=de.length>=3&&se>0&&Ce<=se*1.5,ce=Math.round(N(q)*1e3)/1e3,Me=(We,dt,lt,at)=>{const ht=(dt.angleDeg-We.angleDeg+540)%360-180;if(ht===0)return`L ${at.x} ${at.y}`;if(B===0)return`A ${ce} ${ce} 0 0 ${ht>0?1:0} ${at.x} ${at.y}`;const Ae=(We.angleDeg+ht/2)*Math.PI/180,qe={x:k+ce*Math.cos(Ae),y:k+ce*Math.sin(Ae)},we={x:(lt.x+at.x)/2,y:(lt.y+at.y)/2},Ue={x:Wa(qe.x,we.x,B),y:Wa(qe.y,we.y,B)},ke={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${ke.x} ${ke.y} ${at.x} ${at.y}`},Oe=ge?[...de,de[0]]:de,Le=ge?[...Ee,Ee[0]]:Ee;let ze=`M ${Le[0].x} ${Le[0].y}`;for(let We=1;We<Le.length;We++)ze+=" "+Me(Oe[We-1],Oe[We],Le[We-1],Le[We]);Z.push({key:`arc-${q}`,d:ze})}const re=o.useMemo(()=>new Set(l??[]),[l]),oe=q=>({idle:"",active:v("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:v("soundCompass.state.played","\uB4E4\uC74C"),correct:v("soundCompass.state.correct","\uC815\uB2F5"),wrong:v("soundCompass.state.wrong","\uC624\uB2F5")})[q],ae=q=>{if(r===q.id)return"active";if(u){if(q.id===i)return"correct";if(q.id===s&&s!==i)return"wrong"}return re.has(q.id)?"played":"idle"},W=q=>r===q.id?"loop":u?q.id===i?"loop":null:c&&q.id===s?"once":null,ie=(q,G)=>{switch(q){case"played":case"correct":return n.jsx($s,{size:G});case"wrong":return n.jsx(qs,{size:G});default:return n.jsx(Vs,{size:G})}};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:[B===0&&e.map(q=>{const{x:G,y:de}=Y(q);return n.jsx("line",{x1:S.x,y1:S.y,x2:G,y2:de,stroke:"#dde3ec",strokeWidth:"1"},q.id)}),Z.map(q=>n.jsx("path",{d:q.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},q.key))]}),g&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:R,height:R,left:S.x-R/2,top:S.y-R/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:R,height:R,left:S.x,top:S.y},"aria-label":m,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:R,height:R,left:S.x,top:S.y},children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}),e.map((q,G)=>{const{x:de,y:Ee}=Y(q),ye=ae(q),he=W(q),se={...y!==void 0||w?{"--shortcut-badge-scale":String(y??Math.max(.75,Math.min(3,b/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:ye!=="idle"?10:1},Ce=b,ge=Math.round(Math.max(10,Math.min(56,Ce*.38))),ce=Math.round(Math.max(7,Math.min(18,Ce*.2))),Me=Math.round(Math.max(10,Math.min(56,Ce*.4))),Oe=x==="answered"&&(ye==="played"||ye==="correct"||ye==="wrong"),Le=x===!0||Oe,ze=!Oe;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...se,left:de-Ce/2,top:Ee-Ce/2},children:[he&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${ye}`+(he==="once"?" sound-compass__pulse--once":""),style:{width:Ce,height:Ce,...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?()=>f?.(q.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${ye}`,style:{width:Ce,height:Ce},"aria-label":oe(ye)?`${q.label}, ${oe(ye)}`:q.label,"aria-pressed":s!=null?q.id===s:void 0,children:[Le&&ie(ye,ge),ze&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:x===!0?ce:Me},children:G+1})]}),q.shortcut&&n.jsx(uu,{keys:q.shortcut,anchor:A,className:"sound-compass__speaker-shortcut"})]},q.id)})]})})}function F2({children:e,position:t="top-left",size:a=24,className:r=""}){return n.jsx("span",{className:_e("circle-badge","circle-badge--number",`circle-badge--${a}`,`circle-badge--${t}`,r),children:e})}function O2({orientation:e="horizontal",label:t,className:a=""}){const r=_e("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 cu({checked:e,onChange:t,name:a,value:r,disabled:l=!1,label:s,className:i=""}){const u=o.useId();return n.jsxs("label",{className:`radio${l?" radio--disabled":""} ${i}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:l,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),s&&n.jsx("span",{className:"radio__label body-2",children:s})]})}function z2({options:e,value:t,onChange:a,name:r,disabled:l=!1,direction:s="vertical",className:i="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${s} ${i}`.trim(),role:"radiogroup","aria-label":u,children:e.map(h=>n.jsx(cu,{name:d,value:h.value,checked:t===h.value,disabled:l||h.disabled,label:h.label,onChange:p=>{p&&a?.(h.value)}},h.value))})}const W2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function H2({tone:e="info",title:t,message:a,children:r,dismissible:l=!1,onDismiss:s,live:i,className:u=""}){const{t:c}=xe.useTranslation(),[d,h]=o.useState(!1),p=o.useRef(null),f=o.useCallback(()=>{const g=p.current;g&&g.contains(document.activeElement)&&sr(g),h(!0),s?.()},[s]);if(d)return null;const b=_e("alert",`alert--${e}`,u),x=i??(e==="danger"||e==="warning"?"assertive":"polite"),C=x==="assertive"?"alert":x==="polite"?"status":void 0,m=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:b,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(Qe,{icon:W2[e],size:20,className:"alert__icon"}),m&&n.jsx("span",{className:"alert__title body-2",children:t}),!m&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),m&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),l&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:f,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const V2={ready:"search",guide:"info",error:"circle-alert"};function q2(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let l=0,s=0;for(const i of a){const u=e.indexOf(i,l);u<0||(u>l&&r.push(e.slice(l,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:i},s++)),l=u+i.length)}return l<e.length&&r.push(e.slice(l)),r}function U2({status:e="guide",label:t,children:a,emphasis:r,icon:l,className:s=""}){const i=l===!1?null:l??V2[e],u=_e("search-summary",`search-summary--${e}`,s),c=t??a,d=typeof c=="string"&&r&&r.length>0?q2(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[i!=null&&n.jsx(Qe,{icon:i,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Ha({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:l,close:s}=Pa(),i=o.useRef(null),u=bo(!!r,(c,d)=>{c&&d?l(i.current?.querySelector("button")??d):s()},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=>{ca(c)||l(c.currentTarget)},onPointerLeave:c=>{ca(c)||s()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{da()||l(c.currentTarget)},onBlur:s}),r&&n.jsx(Kn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:s})]})}function G2({items:e=[],value:t,onChange:a,className:r="",size:l=40}){const s=o.useId(),{t:i}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,h=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),f=(C,m=p())=>{if(m.length===0)return;const _=(C%m.length+m.length)%m.length;m[_]?.focus(),m[_]?.click()},b=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const m=p(),_=m.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?f(_+1,m):C.key==="ArrowLeft"||C.key==="ArrowUp"?f(_-1,m):C.key==="Home"?f(0,m):f(m.length-1,m)},x=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--${l}`,role:"tablist","aria-label":i("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${s}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${s}-${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:b,children:C.label},C.key))}),x&&n.jsx("div",{id:`tabs__panel-${s}-${x.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${s}-${x.key}`,tabIndex:0,className:"tabs__panel",children:x.panel},x.key)]})}const K2={xs:12,sm:16,md:20,lg:28,xl:36};function Y2(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 Z2({src:e,name:t,size:a="md",shape:r="circle",className:l=""}){const{t:s}=xe.useTranslation(),[i,u]=o.useState(null),c=!!e&&i===e,d=t?Y2(t):"",h=!!e&&!c,p=!h&&!!d,f=t||s("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${l}`.trim(),role:"img","aria-label":f,children:[h&&n.jsx("img",{className:"avatar__image",src:e,alt:f,onError:()=>u(e??null)}),!h&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!h&&!p&&n.jsx(Qe,{icon:"user-round",size:K2[a],className:"avatar__icon"})]})}function X2(e,t){if(!t)return!0;const a=t.split(",").map(s=>s.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),l=e.type.toLowerCase();return a.some(s=>{const i=s.toLowerCase();return i.startsWith(".")?r.endsWith(i):i.endsWith("/*")?l.startsWith(i.slice(0,-1)):l===i})}function J2({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:l=!0,files:s,onRemove:i,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[h,p]=o.useState(!1),[f,b]=o.useState([]),x=s??f,C=v=>{if(!v||v.length===0)return;const B=Array.from(v).filter(E=>X2(E,t));if(B.length===0)return;const k=a?B:B.slice(0,1);if(s===void 0){const E=a?[...x,...k]:k;b(E),e?.(E)}else e?.(k)},m=v=>{v.preventDefault(),!r&&p(!0)},_=v=>{v.preventDefault(),p(!1)},g=v=>{v.preventDefault(),p(!1),!r&&C(v.dataTransfer.files)},A=v=>{const B=v.target;try{C(B.files)}finally{B.value=""}},y=()=>{r||d.current?.click()},w=v=>{if(!r&&(i?.(v),s===void 0)){const B=x.filter((k,E)=>E!==v);b(B),i||e?.(B)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:_e("file-upload__dropzone",h&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},onDragOver:m,onDragLeave:_,onDrop:g,children:[n.jsx(Qe,{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:v=>{v.stopPropagation(),y()},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:A,tabIndex:-1})]}),l&&x.length>0&&n.jsx("ul",{className:"file-upload__list",children:x.map((v,B)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:v.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:v.name}),disabled:r,onClick:()=>w(B),children:n.jsx(Qe,{icon:"x",size:14})})]},`${v.name}-${B}`))})]})}function Q2({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,l)=>{const s=l===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[s?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}),!s&&n.jsx(Qe,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},l)})})})}const ev={small:14,medium:20,large:28};function tv({value:e,onChange:t,max:a=5,readOnly:r=!1,size:l="medium",ariaLabel:s,className:i=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,h]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,f=d??p,b=ev[l],x=v=>{v!==e&&t?.(v)},C=v=>{c||x(v)},m=v=>{c||da()||h(v)},_=o.useRef(null),g=v=>{const B=Math.min(a,Math.max(1,v));x(B),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(k=>k.dataset.star===String(B))?.focus()},A=v=>{if(!c){switch(v.key){case"ArrowRight":case"ArrowUp":g((p||0)+1);break;case"ArrowLeft":case"ArrowDown":g((p||1)-1);break;case"Home":g(1);break;case"End":g(a);break;default:return}v.preventDefault()}},y=p>=1&&p<=a?Math.round(p):1,w=()=>{c||h(null)};return n.jsx("div",{className:`rating rating--${l}${c?" rating--readOnly":""} ${i}`.trim(),ref:_,onKeyDown:A,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):s??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:w,onPointerUp:v=>{v.pointerType==="touch"&&w()},onPointerCancel:v=>{v.pointerType==="touch"&&w()},children:Array.from({length:a},(v,B)=>{const k=B+1,E=Math.max(0,Math.min(1,f-B)),D=E>0&&E<1,N=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(Qe,{icon:"star",size:b,className:"rating__star rating__star--empty"}),E>0&&n.jsx("span",{className:`rating__star-fill${D?" rating__star-fill--half":""}`,style:D?{width:`${E*100}%`}:void 0,children:n.jsx(Qe,{icon:"star",size:b,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:N},k):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===k,"aria-label":u("rating.starLabel",{n:k}),"data-star":k,tabIndex:k===y?0:-1,onClick:()=>C(k),onMouseEnter:()=>m(k),children:N},k)})})}const nv=20,av=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function rv({value:e,onChange:t,palette:a=av,size:r=40,className:l="",ariaLabel:s}){const{t:i}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${l}`.trim(),role:"group","aria-label":s,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(Qe,{icon:"check",size:nv,className:"color-picker__check"})},u)})})}function du({icon:e,label:t,tooltip:a,wrapperStyle:r,color:l,bgColor:s,useHover:i=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",h=_e("category-icon",d?"category-icon--small":""),p=d?16:20,f=o.useRef(null),[b,x]=o.useState(!1),C=o.useMemo(()=>{const k=r&&typeof r=="object"?{...r}:{};return!l&&!s?k:{...k,...l?{color:l,"--t-item-fg":l}:{},...s?{"--t-item-bg":s}:{}}},[r,l,s]),m=a||t,_=i&&!!m,[g,A]=o.useState(null);o.useLayoutEffect(()=>{b&&A(f.current?.getBoundingClientRect()??null)},[b]),o.useEffect(()=>{if(!i&&b)try{x(!1)}catch{}},[i,b]),o.useEffect(()=>{if(!b)return;const k=E=>{const D=f.current;if(!D)return;const N=E.target;N&&!D.contains(N)&&x(!1)};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[b]);const y=o.useCallback(()=>{i&&x(!0)},[i]),w=o.useCallback(()=>{i&&x(!1)},[i]),v=o.useCallback(()=>x(!1),[]),B=o.useCallback(k=>{if(k.key==="Escape"){x(!1);return}(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),x(E=>!E))},[]);return n.jsxs("span",{ref:f,className:_e("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:y,onPointerLeave:w,onFocus:y,onBlur:w,onKeyDown:B,role:"button",tabIndex:0,"aria-label":typeof m=="string"?c("common.descriptionFor",{name:m,defaultValue:`${m} \uC124\uBA85`}):void 0,"aria-haspopup":!!m,"aria-expanded":b,"data-tooltip-ignore":!0,children:[n.jsx(Qe,{icon:e,label:t,className:h,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),b&&m&&n.jsx(wn,{anchorRect:g,text:typeof m=="string"?m:void 0,offset:8,onClose:v,className:"category-icon__tooltip",ariaLabel:typeof m=="string"?m:void 0})]})}let Fn=null;function dr(e){if(Fn&&Fn!==e)try{Fn()}catch{}return Fn=e,()=>{Fn===e&&(Fn=null)}}function pr(e){if(Fn===e){Fn=null;try{e()}catch{}}}function hr(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){St("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 l=!1;const s=u=>{if(!l){l=!0;try{t?.(u)}catch{}a(u)}};let i;try{i=new Audio(e)}catch{return s(!1),{el:{},stop:()=>{},done:r}}i.onended=()=>s(!0),i.onerror=()=>s(!1);try{i.play().catch(()=>s(!1))}catch{s(!1)}return{el:i,stop:()=>{try{i.pause()}catch{}s(!1)},done:r}}function ov(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 l=a.sentences||a.items||[],s=r(Array.isArray(l)?l:[]);return s.length===0&&(a.contextCode||a.context_code)&&s.push(String(a.contextCode||a.context_code)),{previewCodes:s,previewBucket:null}}function sv(e,t){const[a,r]=o.useState(!1),[l,s]=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),[f,b]=o.useState(!1),x=o.useRef([]),{previewCodes:C,previewBucket:m}=ov(e,t),_=`${C.join(",")}|${m??""}`,g=o.useMemo(()=>i.key===_?i.urls:[],[i,_]);o.useEffect(()=>{if(!C.length)return;let y=!1;return(async()=>{const w=[],v=[];for(const B of C)try{const k=yl(B,m);if(!k){w.push("");continue}let E=null;try{E=await vl(k)}catch{}if(!E)try{const D=await xl(k);D&&(E=URL.createObjectURL(D),v.push(E))}catch{}w.push(E??"")}catch{w.push("")}y?v.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}):(x.current.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}),x.current=v,u({key:_,urls:w}))})(),()=>{y=!0}},[C.join(","),m]),o.useEffect(()=>()=>{x.current.forEach(y=>{try{URL.revokeObjectURL(y)}catch{}}),x.current=[]},[]);const A=o.useCallback(async y=>{if(y.stopPropagation(),y.preventDefault(),d.current){h.current&&pr(h.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),s(-1);return}if(!g.filter(Boolean).length)return;let w=null;const v=()=>{d.current=!1,w?.stop()};h.current=v;const B=dr(v);d.current=!0,r(!0);for(let k=0;k<g.length&&d.current;k++){const E=g[k];if(E&&(s(k),w=hr(E),c.current=w.el,!await w.done))break}B(),h.current===v&&(h.current=null,d.current=!1,r(!1),s(-1))},[g]);return o.useEffect(()=>()=>{h.current&&pr(h.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:l,previewUrls:g,previewHover:f,setPreviewHover:b,previewBtnRef:p,handlePreview:A}}const lv=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 l=r;return l.sentence||l.text||l.context||l.question||l.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function Mo(e){const{index:t,type:a,trainingData:r,ariaLabel:l,depth:s,renderPopup:i,completed:u,completedIds:c,selectedIds:d,tooltipText:h,useDescriptionTooltip:p=!1,onRemove:f,hideCheckBadge:b=!1,showTypeLabel:x=!1,onComplete:C,onSelect:m,onMore:_,countLabelOverride:g,size:A="square"}=e||{},{t:y}=xe.useTranslation(),[w,v]=o.useState(!1),B=o.useRef(null),[k,E]=o.useState(!1);o.useEffect(()=>{B.current?.matches(":hover")&&E(!0)},[]);const{playing:D,playingIndex:N,previewUrls:I,previewHover:P,setPreviewHover:K,previewBtnRef:T,handlePreview:M}=sv(r,a?.key),L=o.useCallback(()=>{m?m():v(!0)},[m]),Q=o.useCallback(()=>v(!1),[]),H=o.useCallback(()=>E(!0),[]),O=o.useCallback(()=>E(!1),[]),U=o.useCallback(()=>K(!0),[K]),$=o.useCallback(()=>K(!1),[K]),[V,z]=o.useState(null);o.useLayoutEffect(()=>{P&&z(T.current?.getBoundingClientRect()??null)},[P,T]);const[Y,S]=o.useState(null);o.useLayoutEffect(()=>{k&&!w&&p&&S(B.current?.getBoundingClientRect()??null)},[k,w,p]);const R=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),L())},[L]),F=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:lv(F);return Ue&&Ue.length>0?Ue:null},[p,h,F]),pe=o.useCallback(we=>{we.stopPropagation(),f?.()},[f]),re=o.useCallback(we=>we.stopPropagation(),[]),oe=o.useCallback(we=>{typeof C=="function"&&C(we)},[C]),ae=u||(c&&r?.id!=null?c.has(String(r.id)):!1),W=!ae&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Li("speechear.popup.close",Q);const ie=ql(),q=`${a?.label||""} ${t+1}`,G=F?.title||F?.name||q;let de=a?.icon,Ee,ye="",he="";try{const we=F?.category_0||F?.category_main_code||F?.category_main,Ue=F?.category_1||F?.category_sub_code||F?.category_sub,ke=ie.find($e=>$e.key===we);ke?.icon&&(de=ke.icon),!Ee&&ke?.color&&(Ee={"--t-item-fg":ke.color}),!Ee&&F?.iconColor&&(Ee={"--t-item-fg":F.iconColor}),ye=ke?y(`topic.${ke.key}`,{defaultValue:ke.label||""}):"";try{const $e=ke?.subs?.find(je=>je.key===Ue);he=$e?y(`topic.sub.${$e.key}`,{defaultValue:$e.label||""}):""}catch{}}catch{}const se=he?`${ye} / ${he}`:ye||a?.label||G,Ce=we=>y("training.countQuestions",{n:we,count:we}),ge=we=>y("training.countSentences",{n:we,count:we});let ce="";try{if(F)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0?we=F.sentences.length:F.sentences&&(we=1),ce=ge(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(F?.questions)?we=F.questions.length:Array.isArray(F?.sentences)&&(we=F.sentences.length),ce=Ce(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(F.items)&&F.items.length>0){const Ue=F.items.reduce((ke,$e)=>{const je=$e.questionItems;return Array.isArray(je)?ke+je.length:Array.isArray($e.questions)?ke+$e.questions.length:ke},0);we=Ue>0?Ue:F.items.length}else Array.isArray(F.questions)&&F.questions.length>0?we=F.questions.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length);ce=Ce(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length),ce=ge(we)}else Array.isArray(F.items)&&(ce=F.items.length>0?Ce(F.items.length):"")}catch{}const Me=A==="row",Oe=A==="list"||Me,Le=A==="compact",ze=A==="small",We=ze&&a?.key?UC().find(we=>we.key===a.key):void 0,dt=We?Ul[We.key]:void 0,lt=We?dt?y(`trainingType.${dt}.title`,{defaultValue:We.label}):We.label??"":"",at=x&&a?.label&&a.label!==String(G)?String(a.label):ze&&lt&&lt!==String(G)?lt:"",ht=!!at,Ae=g!==void 0?g:ce,qe=[at,typeof G=="string"?G:"",Ae].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:B,className:`training-block-button${Oe?" training-block-button--list":""}${Me?" training-block-button--row":""}${Le?" training-block-button--compact":""}${ze?" training-block-button--small":""}${ae?" training-block-button--completed":""}${W?" training-block-button--selected":""}${ht&&!ze?" training-block-button--withType":""}${ze&&!ht?" training-block-button--no-type-label":""}`,onClick:L,onPointerEnter:H,onPointerLeave:O,role:"button",tabIndex:0,onKeyDown:R,"aria-label":typeof l=="string"?l:qe||void 0,title:!p&&h&&(Array.isArray(h)?h.filter(Boolean).join(`
854
+ `):h)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[x&&a?.label&&a.label!==String(G)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),ze&&lt&&lt!==String(G)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:lt}),n.jsx(du,{icon:de,label:G,tooltip:se,wrapperStyle:Ee,iconSize:ze||Le?"small":"medium"}),!b&&(ae||W)&&!(f&&k)&&n.jsx(Et,{className:f?"training-block-button__check--removable":void 0,type:"dot",icon:"check",position:"top-left",size:"medium","aria-label":ae?y("training.completed","\uD6C8\uB828 \uC644\uB8CC"):y("training.selected","\uC120\uD0DD\uB428")}),f&&n.jsx(Et,{className:`training-block-button__remove${k?" is-hover":""}`,type:"dot",icon:"remove",position:"top-left",size:"medium","aria-label":y("common.remove","\uC81C\uAC70"),onClick:pe}),n.jsx("div",{className:`training-block-button__title ${Le?"body-3":ze?"body-3b":"h3"}`,children:String(G)}),n.jsxs("div",{className:"training-block-button__description",children:[Ae?n.jsx("div",{className:`training-block-button__count ${ze?"caption-2":"caption-1"}`,children:Ae}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(Qe,{icon:"chevron-right",label:y("training.next","\uB2E4\uC74C"),className:"training-block-button__chevron-icon",imgClassName:"training-block-button__chevron-icon-image",maskClassName:"training-block-button__chevron-icon-mask",svgClassName:"training-block-button__chevron-icon-svg",size:ze?12:20})})]}),(Oe&&!Me||ze)&&I.length>0&&n.jsx("div",{ref:T,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:re,onPointerEnter:U,onPointerLeave:$,children:n.jsx(fe,{htmlType:"button",size:ze?28:32,type:"dot",icon:D?"pause":"play",variant:ze?"transparent-lightGray":"default",useBorder:!1,selected:D,ariaLabel:String(G).trim()?D?y("training.stopFor",{name:G,defaultValue:`${G} \uC815\uC9C0`}):y("training.previewFor",{name:G,defaultValue:`${G} \uBBF8\uB9AC \uB4E3\uAE30`}):D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:M})})]}),_&&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(G).trim()?y("common.moreFor",{name:G}):y("common.more","\uB354\uBCF4\uAE30")})})]}),P&&n.jsx(wn,{anchorRect:V,text:D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:$}),k&&!w&&p&&(Z?n.jsx(Kn,{anchorRect:Y,items:Z,activeIndex:N,onClose:O}):F?.subTitle?n.jsx(wn,{anchorRect:Y,text:F.subTitle,offset:8,onClose:O}):null),w&&i&&i({trainingData:F,typeKey:a?.key??"",onClose:Q,onComplete:oe,popupTitle:String(G),popupSubTitle:a?.subTitle,depth:s!=null?String(s):void 0,popupIcon:de,popupIconTooltip:String(se),popupWrapperStyle:Ee})]})}const pu=200;function iv(e){return e.itemId?(XC()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function hu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:l}){const{t:s}=xe.useTranslation(),i=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):QC(s).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(iv).filter(h=>h!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,s]);if(i.length===0)return null;const u=n.jsx("div",{className:"tooltip-training__box",children:n.jsx("div",{className:"tooltip-training__groups",children:i.flatMap(({key:c,label:d,type:h,data:p},f)=>[f>0?n.jsx("div",{className:"tooltip-training__divider"},`div-${c}`):null,n.jsxs("div",{className:"tooltip-training__section",children:[n.jsx("div",{className:"tooltip-training__section-header",children:n.jsx("span",{className:"tooltip-training__type-label body-3b",children:d})}),n.jsx("div",{className:"tooltip-training__items",children:p.map((b,x)=>n.jsx(Mo,{index:x,type:h,trainingData:b,size:"compact",hideCheckBadge:!0},String(b.id??x)))})]},c)])})});return a?n.jsx(mn,{anchorRect:a,offset:r,onClose:l,closeOnOutsideClick:!1,className:"tooltip-training",ariaLabel:s("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const uv=200;function cv({icon:e,count:t,title:a,plan:r,tooltip:l=!0,hoverAccent:s=!1,className:i="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const h=!!u||!!c||l&&!!r,p=_e("count-tile",h&&"count-tile--interactive",h&&s&&"count-tile--accent",u&&"count-tile--clickable",i),f=o.useRef(null),[b,x]=o.useState(null),C=o.useRef(null),m=o.useRef(null),_=!!(b&&r&&l),g=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),m.current&&(clearTimeout(m.current),m.current=null)},[]),A=o.useCallback(()=>{g(),x(null)},[g]),y=o.useCallback(()=>{!l||!r||(g(),C.current=setTimeout(()=>{C.current=null,x(f.current?.getBoundingClientRect()??null)},pu))},[l,r,g]),w=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!m.current&&(m.current=setTimeout(()=>{m.current=null,x(null)},uv))},[]);return o.useEffect(()=>()=>{g()},[g]),o.useEffect(()=>{(!l||!r)&&A()},[l,r,A]),o.useEffect(()=>{if(!_)return;const v=k=>k instanceof Element&&(f.current?.contains(k)||!!k.closest(".tooltip-training")),B=k=>{v(k.target)?g():w()};return document.addEventListener("pointerover",B,!0),()=>document.removeEventListener("pointerover",B,!0)},[_,g,w]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:f,className:p,onClick:u?v=>{A(),u(v)}:void 0,onKeyDown:u?v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.currentTarget.click())}:void 0,onPointerEnter:v=>{v.pointerType==="touch"||v.pointerType==="pen"?A():y()},onMouseEnter:c,onMouseLeave:v=>{w(),d?.(v)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(Qe,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),b&&r&&n.jsx(hu,{plan:r,anchorRect:b,onClose:A})]})}let Va=0,mu="",Lo="",qa=0;function fu(){return Cu(!1)}function dv(){return Cu(!0)}function Cu(e){const t=typeof document<"u";Va===0&&t&&(mu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(qa===0&&(Lo=document.body.style.paddingRight),qa++,document.body.style.paddingRight="0px"),Va++;let a=!1;return()=>{a||(a=!0,Va=Math.max(0,Va-1),e&&t&&(qa=Math.max(0,qa-1),qa===0&&(Lo?document.body.style.paddingRight=Lo:document.body.style.removeProperty("padding-right"))),Va===0&&t&&(document.body.style.overflow=mu))}}function pv(){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 hv({open:e,onClose:t,ariaLabel:a,title:r,children:l,size:s="md",closeOnBackdrop:i=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:h}){const{t:p}=xe.useTranslation(),f=o.useId(),b=o.useRef(null),x=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const g=document.activeElement,A=fu(),y=b.current;return mo(y,g),y?.focus(),()=>{A();const w=document.activeElement;(!w||w===document.body||y&&y.contains(w))&&fo(g)?.focus?.()}},[e]);const C=o.useRef(x),m=o.useRef(u);o.useEffect(()=>{C.current=x,m.current=u}),o.useEffect(()=>{if(e)return Gn(()=>{m.current&&C.current()})},[e]);const _=o.useRef(!1);return po(b,e),!e||typeof document>"u"?null:nn.createPortal(n.jsx("div",{className:_e("dialog",d),onPointerDown:i?g=>{_.current=g.target===g.currentTarget}:void 0,onMouseDown:g=>{g.target===g.currentTarget&&g.preventDefault()},onClick:i?g=>{const A=_.current;_.current=!1,A&&g.target===g.currentTarget&&x()}:void 0,children:n.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?f:void 0,tabIndex:-1,className:_e("dialog__surface",`dialog__surface--${s}`,h),onClick:g=>g.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:f,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:x,children:n.jsx(pv,{})}):null,n.jsx("div",{className:"dialog__body",children:l})]})}),document.body)}function mv({columns:e,rows:t,rowKey:a,title:r,toolbar:l,empty:s,loading:i,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),h=!i&&t.length===0;return n.jsxs("div",{className:_e("board",c),children:[r||l?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),l?n.jsx("div",{className:"board__toolbar",children:l}):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:_e("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:s??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,f)=>n.jsx("tr",{className:"board__row",children:e.map(b=>n.jsx("td",{className:_e("board__td",`board__cell--${b.align??"left"}`),children:b.render(p,f)},b.key))},a(p,f)))})]})]})}function fv({name:e,role:t,photo:a,media:r,credentials:l,size:s=190,className:i=""}){return n.jsxs("div",{className:_e("person-card",i),children:[n.jsx("div",{className:"person-card__photo",style:{width:s,height:s},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,l?.length?n.jsx("ul",{className:"person-card__credentials",children:l.map(u=>n.jsx("li",{children:u},u))}):null]})}function Cv({groups:e,className:t=""}){return n.jsx("div",{className:_e("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,l)=>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((s,i)=>n.jsx("p",{children:s},i))})]},`${r.label??""}-${l}`))})]},a.title))})}function gv({title:e,kind:t,body:a,badge:r,badgeSrc:l,footer:s,width:i,className:u=""}){const c=r??(l?n.jsx("img",{src:l,alt:""}):null);return n.jsxs("div",{className:_e("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}),s?n.jsx("div",{className:"publication-card__footer",children:s}):null]})}function bv({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const l=$a(a);return o.useEffect(()=>{const s=setTimeout(()=>l.current?.(),r);return()=>clearTimeout(s)},[r,l]),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 yv({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:l=2,tone:s="dark",className:i=""}){const u=l===1?"h1":"h2";return n.jsxs("div",{className:_e("section-header",`section-header--${s}`,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 vv({items:e,className:t=""}){return n.jsx("ul",{className:_e("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))})}function gu(e){return typeof e=="string"?e:e.label}function bu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:l,onSelectSuggestion:s,autoActiveFirst:i=!1}){const u=o.useId(),[c,d]=o.useState(!1),[h,p]=o.useState(-1),f=o.useRef(null),b=o.useMemo(()=>{if(!a.length)return[];const N=e??"";return l===!1?a:N?typeof l=="function"?l(a,N):a.filter(I=>gu(I).toLowerCase().includes(N.toLowerCase())):r?a:[]},[a,e,r,l]),[x,C]=o.useState(!1),m=o.useRef([]),_=x&&b.length===0?m.current:b;o.useEffect(()=>{_.length&&(m.current=_)},[_]);const g=o.useCallback(()=>C(!0),[]),A=o.useCallback(()=>C(!1),[]),y=i?0:-1;o.useEffect(()=>{c||p(y)},[c,y]),o.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const w=h<_.length?h:y<_.length?y:-1,v=o.useCallback(N=>{s?s(N):t?.(gu(N)),d(!1)},[t,s]),B=o.useCallback(()=>d(!0),[]),k=o.useCallback(()=>{d(!0),p(y)},[y]),E=o.useCallback(()=>{f.current=setTimeout(()=>d(!1),120)},[]),D=o.useCallback(N=>{N.nativeEvent.isComposing||N.keyCode===229||(N.key==="ArrowDown"?(N.preventDefault(),d(!0),p(I=>Math.min(_.length-1,(I<_.length?I:y)+1))):N.key==="ArrowUp"?(N.preventDefault(),p(I=>Math.max(y,(I<_.length?I:_.length)-1))):N.key==="Enter"?w>=0&&v(_[w]):N.key==="Escape"&&c&&(N.preventDefault(),d(!1)))},[_,w,c,v,y]);return{listId:u,open:c,activeIdx:w,filtered:_,handleFocus:B,handleBlur:E,handleInput:k,handleKeyDown:D,handleSelect:v,handleCompositionStart:g,handleCompositionEnd:A}}const $o=typeof window<"u"?o.useLayoutEffect:o.useEffect;function Xn(e){const{value:t,defaultValue:a,name:r,inputRef:l,onChange:s,label:i,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:h,ghostText:p,ghostHint:f,type:b="text",disabled:x=!1,readOnly:C=!1,error:m,helperText:_,maxLength:g,size:A=48,variant:y="input",fullWidth:w=!1,newline:v=!1,multiline:B=!1,rows:k=3,leftIcon:E,rightIcon:D,clearable:N=!1,list:I,showCount:P=!0,className:K="",onFocus:T,onBlur:M,onKeyDown:L,onEnter:Q,inputMode:H,autoComplete:O,autoFocus:U,suggestions:$,filterSuggestions:V,onSelectSuggestion:z,autoActiveFirst:Y,openOnFocus:S=!1}=e,R=C||x?void 0:$,{t:F}=xe.useTranslation(),Z=o.useId();!i&&!u&&St(`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 pe=`tf-${Z}`,re=`tf-helper-${Z}`,oe=o.useRef(null),ae=bu({value:t??"",onChange:s,suggestions:R??[],openOnFocus:S,filterSuggestions:V,onSelectSuggestion:z,autoActiveFirst:Y}),W=!!R&&ae.open&&ae.filtered.length>0,ie=o.useRef(null),[q,G]=o.useState(null),de=o.useCallback(()=>{const Ae=ie.current;if(!Ae||typeof window>"u")return;const qe=Ae.getBoundingClientRect(),we=230,Ue=window.innerHeight-qe.bottom<we+8&&qe.top>we+8;G({position:"fixed",left:qe.left,width:qe.width,...Ue?{bottom:window.innerHeight-qe.top+8}:{top:qe.bottom+8},zIndex:Ia(Ae)})},[]);$o(()=>{if(!W)return;de();let Ae=null;const qe=()=>{if(typeof requestAnimationFrame>"u"){de();return}Ae===null&&(Ae=requestAnimationFrame(()=>{Ae=null,de()}))},we=Ue=>{const ke=Ue.target;ke&&ke.nodeType===1&&ke.closest?.(".text-field__suggestions")||qe()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",qe),()=>{Ae!==null&&cancelAnimationFrame(Ae),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",qe)}},[W,de]);const Ee=o.useCallback(Ae=>{oe.current=Ae,typeof l=="function"?l(Ae):l&&(l.current=Ae)},[l]),ye=p?`${p}${f??F("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:h,he=t!==void 0,se=he&&b==="password",[Ce,ge]=o.useState((a??"").length),ce=he?(t??"").length:Ce,Me=o.useRef(t);$o(()=>{Me.current=t}),o.useEffect(()=>{const Ae=oe.current;if(!se||!Ae)return;const qe=t??"";Ae.value!==qe&&(Ae.value=qe)},[se,t]),o.useEffect(()=>{if(!v||!oe.current)return;const Ae=oe.current;Ae.style.height="",Ae.scrollHeight>Ae.clientHeight&&(Ae.style.height=`${Ae.scrollHeight}px`)},[t,Ce,v]);const Oe=g!=null&&ce>g,Le=A===32?16:20,ze=_e("text-field",`text-field--s${A}`,y==="display"?"text-field--display":"",w?"text-field--full-width":"",x?"text-field--disabled":"",C?"text-field--readonly":"",m?"text-field--error":"",E?"text-field--has-left-icon":"",D||N?"text-field--has-right-icon":"",K),We={id:pe,...se?{}:he?{value:t}:{defaultValue:a},ref:Ee,placeholder:ye,name:r,disabled:x,readOnly:C,autoFocus:U,maxLength:g,list:I,inputMode:H,autoComplete:O,"aria-label":!i&&u?u:void 0,"aria-required":d,"aria-invalid":!!m,"aria-describedby":[_||m?re:null,c].filter(Boolean).join(" ")||void 0,role:R?"combobox":void 0,"aria-autocomplete":R?"list":void 0,"aria-haspopup":R?"listbox":void 0,"aria-expanded":R?W:void 0,"aria-controls":W?ae.listId:void 0,"aria-activedescendant":W&&ae.activeIdx>=0?`${ae.listId}-option-${ae.activeIdx}`:void 0,onChange:Ae=>{const qe=Ae.target;he||ge(qe.value.length),s?.(qe.value),R&&ae.handleInput(),se&&queueMicrotask(()=>{const we=Me.current??"";qe.value!==we&&(qe.value=we)})},onCompositionStart:R?ae.handleCompositionStart:void 0,onCompositionEnd:R?ae.handleCompositionEnd:void 0,onFocus:(Ae=>{T?.(Ae),R&&ae.handleFocus()}),onBlur:(Ae=>{M?.(Ae),R&&ae.handleBlur()}),onKeyDown:(Ae=>{const qe=(Ae.key==="Tab"&&!Ae.shiftKey||Ae.key===" ")&&!Ae.nativeEvent.isComposing;if(p&&qe&&!C&&!x&&!(Ae.currentTarget.value??"").trim()){Ae.preventDefault();const we=Ae.currentTarget;he||(we.value=p,ge(p.length)),s?.(p);return}R&&Ae.key==="Enter"&&!Ae.nativeEvent.isComposing&&ae.activeIdx>=0?Ae.preventDefault():Q&&Ae.key==="Enter"&&!Ae.nativeEvent.isComposing&&(Ae.preventDefault(),Q()),L?.(Ae),R&&ae.handleKeyDown(Ae)})},dt=N&&!x&&!C&&ce>0,lt=()=>v?n.jsx("textarea",{...We,className:"text-field__input text-field__input--auto body-2",rows:1}):B?n.jsx("textarea",{...We,className:"text-field__input text-field__input--textarea body-2",rows:k}):n.jsx("input",{...We,type:b,className:"text-field__input body-2"}),at=y==="display"&&!v&&!B&&!!ye,ht=()=>n.jsxs(n.Fragment,{children:[lt(),at&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:ye})]});return n.jsxs("div",{ref:ie,className:ze,children:[i&&n.jsxs("label",{htmlFor:pe,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:[E&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(Qe,{icon:E,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})}),ht(),g!=null&&P&&n.jsxs("span",{className:`text-field__count caption-2${Oe?" text-field__count--over":""}`,children:[ce,"/",g]}),dt&&n.jsx(fe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:F("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:Ae=>{Ae.preventDefault()},onClick:()=>{!he&&oe.current&&(oe.current.value="",ge(0)),s?.("")},tabIndex:-1}),D&&!dt&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(Qe,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})})]}),!!R&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ae.open&&(t??"").length>0&&ae.filtered.length===0?F("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),W&&(typeof document>"u"?null:nn.createPortal(n.jsx("ul",{id:ae.listId,className:"text-field__suggestions",role:"listbox",style:q??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ae.filtered.map((Ae,qe)=>n.jsx("li",{id:`${ae.listId}-option-${qe}`,role:"option","aria-selected":qe===ae.activeIdx,className:`text-field__suggestion body-2${qe===ae.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{ae.handleSelect(Ae),oe.current?.focus()},children:typeof Ae=="string"?Ae:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:Ae.label}),Ae.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:Ae.hint})]})},typeof Ae=="string"?`${Ae}-${qe}`:Ae.id))}),document.body)),(_||m)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:re,className:"text-field__helper caption-1",role:m?"alert":void 0,children:m||_})})]})}function cn({options:e,value:t,onChange:a,placeholder:r,disabled:l=!1,block:s=!1,size:i=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:h}){const{t:p}=xe.useTranslation(),f=r??p("dropdown.placeholder","\uC120\uD0DD"),b=o.useId(),x=o.useId(),C=o.useRef(null),m=o.useCallback((T,M)=>{const L=window.innerHeight-T.bottom<260&&T.top>260;return{position:"fixed",left:T.left,minWidth:T.width,...L?{bottom:window.innerHeight-T.top+6}:{top:T.bottom+6},zIndex:Ia(M)}},[]),{open:_,setOpen:g,toggle:A,style:y,triggerRef:w,menuRef:v}=Fa({computeStyle:m}),[B,k]=o.useState(-1),E=o.useCallback(()=>k(-1),[]),D=e.find(T=>T.value===t);o.useEffect(()=>{if(_){const T=e.findIndex(M=>M.value===t);k(T>=0?T:e.length?0:-1),requestAnimationFrame(()=>{const M=v.current;if(!M)return;const L=M.querySelectorAll(".dropdown__option")[T];L&&(M.scrollTop=Math.max(0,L.offsetTop-M.clientHeight/2+L.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&k(T=>{if(T>=0&&T<e.length)return T;const M=e.findIndex(L=>L.value===t);return M>=0?M:e.length?0:-1})},[_,e.length]);const N=o.useCallback(()=>{l||A()},[l,A]),I=o.useCallback(T=>{T.disabled||l||(T.value!==t&&a?.(T.value),g(!1))},[a,g,l,t]);o.useEffect(()=>{l&&g(!1)},[l,g]);const P=o.useCallback(T=>{if(!l){if(!_){(T.key==="Enter"||T.key===" "||T.key==="ArrowDown")&&(T.preventDefault(),g(!0));return}if(T.key==="Escape"){T.preventDefault(),g(!1);return}T.key==="ArrowDown"?(T.preventDefault(),k(M=>{let L=M+1;for(;L<e.length&&e[L].disabled;)L++;return L<e.length?L:M})):T.key==="ArrowUp"?(T.preventDefault(),k(M=>{let L=M-1;for(;L>=0&&e[L].disabled;)L--;return L>=0?L:M})):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),e[B]?I(e[B]):g(!1))}},[l,_,e,B,I,g]),K=_?n.jsx("div",{ref:v,id:b,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:y,onMouseLeave:E,onMouseDown:T=>T.preventDefault(),children:e.map((T,M)=>n.jsxs("button",{id:`${b}-option-${M}`,type:"button",role:"option","aria-selected":T.value===t,className:_e("dropdown__option body-2",T.value===t?"dropdown__option--active":"",M===B?"dropdown__option--active":"",T.disabled?"dropdown__option--disabled":""),onMouseDown:L=>L.preventDefault(),onClick:()=>I(T),onMouseEnter:()=>k(M),disabled:T.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:T.value===t&&n.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2 7 5.5 10.5 12 3.5"})})}),T.label]},T.value))}):null;return n.jsxs("div",{ref:C,className:_e("dropdown",`dropdown--s${i}`,_?"dropdown--open":"",s?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:P,children:[n.jsxs("button",{ref:w,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?b:void 0,"aria-activedescendant":_&&B>=0?`${b}-option-${B}`:void 0,"aria-label":d,"aria-describedby":[d&&D?x:"",h??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:l,onClick:N,onBlur:T=>{_&&!v.current?.contains(T.relatedTarget)&&g(!1)},children:[n.jsx("span",{id:x,className:`dropdown__trigger-label body-2${D?"":" dropdown__trigger-label--placeholder"}`,children:D?D.label:f}),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"&&nn.createPortal(K,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}function mr({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:l,className:s=""}){const{t:i}=xe.useTranslation(),u=r??i("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=l??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:_e("pagination",s),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})]})}const Ua=new Map;function bn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(y=>!y.disabled)?.key??a[0]?.key,onChange:l=y=>{},className:s="",size:i=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:h,ariaLabel:p}=e||{},f=o.useRef(null),b=a.filter(y=>!y.disabled),x=o.useId(),C=a.map(y=>y.key).join("\xB7");o.useEffect(()=>{if(!(!$n||p!=null&&p!=="")){if(Ua.set(x,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Ua.size>1){const y=[...Ua.values()].sort();St(`segmented-control-unnamed:${y.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Ua.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): ${y.join(" / ")}`)}return()=>{Ua.delete(x)}}},[p,C,x]);const m=y=>{if(!b.length)return;const w=Math.max(0,b.findIndex(B=>B.key===r)),v=y==="first"?b[0]:y==="last"?b[b.length-1]:b[(w+y+b.length)%b.length];v&&(l(v.key),Array.from(f.current?.querySelectorAll("[data-segkey]")??[]).find(B=>B.dataset.segkey===v.key)?.focus())},_=y=>{switch(y.key){case"ArrowRight":case"ArrowDown":m(1);break;case"ArrowLeft":case"ArrowUp":m(-1);break;case"Home":m("first");break;case"End":m("last");break;default:return}y.preventDefault()},g=y=>{const w=v=>typeof v=="string"||typeof v=="number";if(!(!w(y.label)||y.count==null||y.count===!1||!w(y.count)))return`${y.label}, ${y.count}`},A=b.some(y=>y.key===r)?r:b[0]?.key;return n.jsx("div",{ref:f,onKeyDown:_,className:_e("segmented-control",`segmented-control--${u}`,`segmented-control--${i}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",h!=null&&"segmented-control--min",s),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(y=>n.jsx(fe,{htmlType:"button",role:"radio","aria-checked":y.key===r,"data-segkey":y.key,tabIndex:y.key===A?0:-1,label:y.label,count:y.count,ariaLabel:g(y),disabled:y.disabled,className:y.key===r?"is-selected":"",onClick:()=>{y.disabled||l(y.key)},size:i,shape:u,useBorder:!1,useBG:!1},y.key))})}function Ro({count:e,search:t,segment:a,filters:r,pageSize:l,pagination:s,actions:i,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),h=!!(t||r?.length||l||s||i);return n.jsxs("div",{className:_e("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,f)=>n.jsx(bn,{size:40,...p},p.ariaLabel??f))]}),h&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(Xn,{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,f)=>n.jsx(cn,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},f)),(l||s)&&n.jsxs("div",{className:"toolbar__pager",children:[l&&n.jsx(cn,{size:40,options:l.options,value:l.value,onChange:l.onChange,ariaLabel:l.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),s&&n.jsx(mr,{page:s.page,totalPages:s.total,onChange:s.onChange,prevLabel:s.prevLabel,nextLabel:s.nextLabel})]}),i]})})]})}function yu(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(yu).join(""):""}function xv(e){let t=e.replace(/\r\n/g,`
855
855
  `).replace(/\r/g,`
856
856
  `);t=t.replace(/^\n+/,"").replace(/\n+$/,"");const a=t.split(`
857
857
  `).map(s=>s.replace(/\t/g," ")),r=a.filter(s=>s.trim().length>0),l=r.length>0?Math.min(...r.map(s=>s.match(/^ */)?.[0].length??0)):0;return a.map(s=>s.slice(l)).join(`
858
858
  `)}const _v=new Set(["pnpm","npm","yarn","node","git","curl","docker","cat","ls","cd","rm","mv","cp","echo","export"]),wv=/^(?: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 Bv(e,t){let a=e;const r=[],l=/^(?:sh|bash|zsh|shell|console)$/.test(t.toLowerCase()),s=(i,u)=>r.push({type:i,content:u});for(;a.length>0;){const i=a.match(/^\s+/);if(i){s("whitespace",i[0]),a=a.slice(i[0].length);continue}if(!l&&a.startsWith("//")){const x=a.indexOf(`
859
859
  `),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}if(l&&a.startsWith("#")){const x=a.indexOf(`
860
- `),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){s("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){s("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){s("number",d[0]),a=a.slice(d[0].length);continue}const h=a.match(wv);if(h){s("keyword",h[0]),a=a.slice(h[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const x=p[0];s(l&&_v.has(x)?"command":"identifier",x),a=a.slice(x.length);continue}const f=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(f){s("operator",f[0]),a=a.slice(f[0].length);continue}const b=a.match(/^[()[\]{};.,]/);if(b){s("punctuation",b[0]),a=a.slice(1);continue}s("other",a[0]),a=a.slice(1)}return r}function kv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:l="default",className:s=""}){const{t:i}=xe.useTranslation(),[u,c]=o.useState(!1),d=xv(yu(e)),h=o.useRef(null);o.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=async()=>{try{if(!await HC(d))return;c(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>c(!1),2e3)}catch{}},f=Bv(d,t),b=l==="small"?"caption-1":"body-3";return n.jsxs("div",{className:_e("code-box",l==="small"?"code-box--small":"",s),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(Ce,{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:f.map((x,C)=>n.jsx("span",{className:`code-token ${x.type} ${b}`,children:x.content},C))})})]})}const Av={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function Ga(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:l=null,label:s}=e||{},i=s||t("loader.loading","Loading");if(a==="bar"){const c=l==null||!Number.isFinite(Number(l)),d=c?0:Math.max(0,Math.min(100,Number(l)));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:Av,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"})]})]})}function vu({checked:e,onChange:t,disabled:a=!1,label:r,ariaLabel:l,labelPosition:s="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:[s==="left"&&c,n.jsx("input",{id:u,type:"checkbox",role:"switch",checked:e,disabled:a,onChange:d=>t?.(d.target.checked),"aria-label":!r&&l?l:void 0}),n.jsx("span",{className:"toggle__slider"}),s==="right"&&c]})}function xu({checked:e=!1,onChange:t,disabled:a,indeterminate:r,label:l,size:s="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:_e("checkbox",s==="small"&&"checkbox--small",s==="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:f=>{t?.(f.target.checked),d.current&&(d.current.indeterminate=p.current)},disabled:a,"aria-label":!l&&c?c:void 0}),n.jsx("span",{className:"checkbox__box"}),l&&n.jsx("span",{className:"checkbox__label body-3",children:l})]})}function Nv({count:e,actions:t,onClear:a,clearLabel:r,visible:l,content:s,max:i}){const{t:u}=xe.useTranslation(),c=l!==void 0?l:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),h=o.useRef(null),p=o.useRef(null),f=o.useRef(null),b=o.useRef(c);o.useLayoutEffect(()=>{const g=p.current,A=b.current;if(b.current=c,c&&!A){const y=typeof document<"u"?document.activeElement:null;f.current=y&&y!==document.body&&!g?.contains(y)?y:null}else!c&&A&&g&&g.contains(document.activeElement)&&sr(g,f.current)},[c]);const[x,C]=o.useState(!1),m=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const g=h.current;if(!g)return;const A=E=>{m.current=E,C(E)},y=()=>{const E=g.firstElementChild??g,D=Array.from(E.children);if(D.length<2){A(!1);return}const N=D[0].offsetTop,I=D.some(L=>L.offsetTop!==N);if(!m.current){_.current=g.clientWidth,I&&A(!0);return}if(I)return;const R=D[0],Y=D[D.length-1],M=Y.offsetLeft+Y.offsetWidth-R.offsetLeft,T=_.current;(T==null||M<=T)&&A(!1)};if(y(),typeof ResizeObserver>"u")return;const w=new ResizeObserver(y);w.observe(g);const v=g.parentElement;let B=v?.clientWidth??0;const k=new ResizeObserver(()=>{const E=v?.clientWidth??0;E!==B&&(B=E,_.current=null,y())});return v&&k.observe(v),()=>{w.disconnect(),k.disconnect()}},[s,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:s??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),i!==void 0&&n.jsx(Et,{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${x?" bulk-bar__actions--stacked":""}`,children:[n.jsx(Ce,{htmlType:"button",size:40,label:d,onClick:a}),t.map((g,A)=>n.jsx(Ce,{htmlType:"button",size:40,variant:g.variant??"default",icon:g.icon,label:g.label,onClick:g.onClick},A))]})]})}const Ev=[{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 Dv(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:_e("item-actions",a),children:Ev.map(({key:r,icon:l,closeFirst:s})=>{const i=e[r];if(!i)return null;const u=r==="publish"?i.published?i.unpublish:i.publish:i;return n.jsx(Ce,{htmlType:"button",size:40,type:"dot",icon:l,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{s&&t(),u.onClick()}},r)})})}function _u(e,t){const a=()=>{if(e){const[C,m]=e.split("-");return{y:+C,m:+m-1}}const[b,x]=oo(t).split("-");return{y:+b,m:+x-1}},[r,l]=o.useState(()=>a().y),[s,i]=o.useState(()=>a().m),u=o.useRef(e);o.useEffect(()=>{if(e===u.current)return;u.current=e;const b=a();l(b.y),i(b.m)},[e]);const c=o.useRef({y:r,m:s});o.useEffect(()=>{c.current={y:r,m:s}},[r,s]);const d=o.useCallback(b=>{const x=c.current.y*12+c.current.m+b,C=Math.floor(x/12),m=x-C*12;c.current={y:C,m},l(C),i(m)},[]),h=o.useCallback(()=>d(-1),[d]),p=o.useCallback(()=>d(1),[d]),f=o.useCallback((b,x)=>{c.current={y:b,m:x},l(b),i(x)},[]);return{viewY:r,viewM:s,prevMonth:h,nextMonth:p,setViewYM:f}}function fr(e,t){return new Date(e,t+1,0).getDate()}function Sv(e,t){return new Date(e,t,1).getDay()}function Ka(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function jv(e){if(!e)return"";const[t,a,r]=e.split("-");return`${t}. ${a}. ${r}.`}function Tv(e){const t=e.replace(/\D/g,"");if(t.length!==8)return null;const a=+t.slice(0,4),r=+t.slice(4,6),l=+t.slice(6,8);if(r<1||r>12||l<1||l>31)return null;const s=new Date(a,r-1,l);return s.getFullYear()!==a||s.getMonth()!==r-1||s.getDate()!==l?null:Ka(a,r-1,l)}const Mv=1900;function Lv(e,t,a,r,l){const s=r?+r.split("-")[0]:Math.min(Mv,e),i=l?+l.split("-")[0]:Math.max(t+10,e),u=[];for(let c=s;c<=i;c++)u.push({value:String(c),label:a(c)});return u}function wu(e,t,a,r){const l=[];for(let s=1;s<=12;s++){const i=`${e}-${String(s).padStart(2,"0")}`;a&&i<a.slice(0,7)||r&&i>r.slice(0,7)||l.push({value:String(s),label:t(e,s)})}return l}function $v({value:e,onChange:t,size:a=48,min:r,max:l,disabled:s,placeholder:i,className:u,today:c}){const{t:d,i18n:h}=xe.useTranslation(),p=i??d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),f=o.useMemo(()=>d("calendar.dow",{returnObjects:!0}),[d]),b=oo(c),{viewY:x,viewM:C,prevMonth:m,nextMonth:_,setViewYM:g}=_u(e,c),A=o.useId(),y=o.useCallback((W,ie)=>{const q=window.innerHeight,K=window.innerWidth,ce=typeof document<"u"?document.getElementById(A):null,ke=Math.max(ce?.offsetHeight||0,ce?.scrollHeight||0)||300,ye=Math.max(W.width,ce?.offsetWidth||0,260),de=q-W.bottom,oe=W.top,ge=de<ke&&oe>de,he=8,pe=(Me,ze)=>Math.min(Math.max(he,Me),Math.max(he,ze));return{position:"fixed",left:pe(W.left,K-ye-he),width:W.width,minWidth:260,...ge?{top:"auto",bottom:pe(q-W.top+6,q-ke-he)}:{bottom:"auto",top:pe(W.bottom+6,q-ke-he)},zIndex:Ia(ie)}},[A]),{open:w,setOpen:v,toggle:B,style:k,triggerRef:E,menuRef:D}=Fa({computeStyle:y,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!w)return;const W=D.current;return(W?.querySelector(".date-picker__day--selected:not(:disabled)")??W?.querySelector(".date-picker__day--today:not(:disabled)")??W?.querySelector(".date-picker__day:not(:disabled)")??W?.querySelector(gn)??W)?.focus?.(),()=>{const ie=document.activeElement;(!ie||ie===document.body)&&E.current?.focus?.()}},[w,D,E]);const[N,I]=o.useState(1),R=o.useRef(null),Y=o.useRef(null);o.useEffect(()=>{if(!w)return;const W=e&&e.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+e.slice(8):b.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+b.slice(8):1;I(W)},[w]),o.useEffect(()=>{if(Y.current==null)return;const W=Y.current;Y.current=null,R.current?.querySelector(`[data-day="${W}"]`)?.focus()}),o.useEffect(()=>{I(W=>Math.min(W,fr(x,C)))},[x,C]);const M=o.useCallback(W=>{let ie=Ka(W.getFullYear(),W.getMonth(),W.getDate());r&&ie<r&&(ie=r),l&&ie>l&&(ie=l);const[q,K,ce]=ie.split("-").map(Number);(q!==x||K-1!==C)&&g(q,K-1),I(ce),Y.current=ce},[r,l,x,C,g]),T=o.useCallback(W=>{const ie=new Date(x,C,N),q=ce=>{ie.setDate(ie.getDate()+ce),M(ie)},K=ce=>{const ke=ie.getFullYear()*12+ie.getMonth()+ce,ye=Math.floor(ke/12),de=ke-ye*12;M(new Date(ye,de,Math.min(ie.getDate(),fr(ye,de))))};switch(W.key){case"ArrowLeft":q(-1);break;case"ArrowRight":q(1);break;case"ArrowUp":q(-7);break;case"ArrowDown":q(7);break;case"Home":q(-ie.getDay());break;case"End":q(6-ie.getDay());break;case"PageUp":W.shiftKey?K(-12):K(-1);break;case"PageDown":W.shiftKey?K(12):K(1);break;default:return}W.preventDefault()},[x,C,N,M]),L=o.useCallback(W=>{s||(t(Ka(x,C,W)),v(!1))},[x,C,t,v,s]);o.useEffect(()=>{s&&v(!1)},[s,v]);const Z=W=>{const ie=Ka(x,C,W);return!!(r&&ie<r||l&&ie>l)},G=(()=>{const W=fr(x,C);if(N>=1&&N<=W&&!Z(N))return N;for(let ie=1;ie<=W;ie++)if(!Z(ie))return ie;return-1})(),O=[];for(let W=0;W<Sv(x,C);W++)O.push(null);for(let W=1;W<=fr(x,C);W++)O.push(W);const U=a===64?20:a===40?16:18,$=Ol(h.language),H=W=>new Intl.DateTimeFormat($,{year:"numeric"}).format(new Date(W,0,1)),z=(W,ie)=>new Intl.DateTimeFormat($,{month:"long"}).format(new Date(W,ie-1,1)),V=Lv(x,+b.slice(0,4),H,r,l),S=wu(x,z,r,l),P=W=>{const ie=wu(W,z,r,l);if(ie.length===0)return;const q=ie.some(K=>+K.value===C+1);g(W,q?C:+ie[0].value-1)},[F,X]=o.useState(null);o.useEffect(()=>{X(null)},[e]);const se=o.useCallback(W=>{X(W);const ie=Tv(W);if(!ie||r&&ie<r||l&&ie>l)return;t(ie);const[q,K]=ie.split("-");g(+q,+K-1)},[r,l,t,g]),ae=o.useCallback(()=>{X(null)},[]),me=o.useCallback(W=>{W.key==="Enter"?(W.preventDefault(),ae(),v(!1)):W.key==="Escape"?(ae(),v(!1)):W.key==="ArrowDown"&&!w&&(W.preventDefault(),v(!0))},[ae,v,w]),ne=w?nn.createPortal(n.jsxs("div",{ref:D,id:A,className:"date-picker__dropdown",style:k,"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:m,"aria-label":d("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(Rs,{size:16,strokeWidth:2})}),n.jsxs("div",{className:"date-picker__nav-ym",children:[n.jsx(cn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYear","\uC5F0 \uC120\uD0DD"),options:V,value:String(x),onChange:W=>P(+W),size:40}),n.jsx(cn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectMonth","\uC6D4 \uC120\uD0DD"),options:S,value:String(C+1),onChange:W=>g(x,+W-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(Ps,{size:16,strokeWidth:2})})]}),n.jsxs("div",{className:"date-picker__grid",ref:R,onKeyDown:T,children:[f.map(W=>n.jsx("div",{className:"date-picker__dow caption-1",children:W},W)),O.map((W,ie)=>{if(W===null)return n.jsx("div",{},`e${ie}`);const q=Ka(x,C,W),K=q===e,ce=q===b,ke=Z(W),ye=ie%7;return n.jsx("button",{type:"button",disabled:ke,"data-day":W,tabIndex:W===G?0:-1,"aria-current":ce?"date":void 0,onClick:()=>!ke&&L(W),className:_e("date-picker__day caption-1",K&&"date-picker__day--selected",ce&&!K&&"date-picker__day--today",ke&&"date-picker__day--disabled",ye===0&&"date-picker__day--sun",ye===6&&"date-picker__day--sat"),children:W},W)})]})]}),document.body):null;return n.jsxs("div",{className:_e("date-picker",`date-picker--s${a}`,w&&"date-picker--open",u),children:[n.jsxs("div",{className:"date-picker__field",children:[n.jsx("input",{ref:E,type:"text",className:"date-picker__trigger body-2",value:F??jv(e),placeholder:p,onChange:W=>se(W.target.value),onClick:()=>!s&&!w&&B(),onKeyDown:me,onBlur:ae,disabled:s,"aria-haspopup":"dialog","aria-expanded":w,inputMode:"numeric",autoComplete:"off"}),n.jsx("button",{type:"button",className:"date-picker__icon-btn",onClick:()=>!s&&B(),disabled:s,tabIndex:-1,"aria-label":p,"aria-haspopup":"dialog","aria-expanded":w,children:n.jsx(Us,{size:U,className:"date-picker__icon",strokeWidth:1.5})})]}),ne]})}function Rv({items:e,className:t,ariaLabel:a="\uC54C\uB9BC \uAE00",titleLevel:r=4,targetBytes:l}){const s=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=l===void 0?Sl(i.sms):Sl(i.sms,l),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(s,{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?`${El}\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 ${El}\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 Pv({src:e,alt:t,className:a,style:r,tone:l,textColor:s}){const i=!l&&!!s,u=Yy(e,i),c="bl"+o.useId().replace(/[^a-zA-Z0-9]/g,"");return l?n.jsx("span",{className:_e("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":l},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):i&&u?n.jsx("span",{className:_e("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":s},dangerouslySetInnerHTML:{__html:Gy(Uy(u),c)}}):n.jsx("img",{src:e,alt:t,className:_e("brand-logo",a),style:r,draggable:!1})}function Bu({children:e,className:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useEffect(()=>{l(a.current?.parentElement??null)},[]),o.useEffect(()=>{const s=a.current;if(!s||!r)return;const i=()=>{const c=typeof window<"u"&&window.getComputedStyle(s).position==="absolute"?Math.ceil(s.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(s),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:_e("section-head-float",t),children:e})}function Po({items:e,className:t}){return n.jsx("div",{className:t?`manager-bar-chart-legend ${t}`:"manager-bar-chart-legend",children:e.map((a,r)=>n.jsxs("span",{className:"manager-bar-chart-legend-item",children:[n.jsx("span",{className:"manager-bar-chart-legend-dot",style:{background:a.color}}),a.label]},r))})}function Ya({label:e,children:t}){return e?n.jsxs("div",{className:"barchart-total barchart-total--stacked",children:[n.jsx("span",{className:"barchart-total__label body-3",children:e}),n.jsx("span",{className:"barchart-total__value",children:t})]}):n.jsx("div",{className:"barchart-total",children:t})}function Io({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:l,headRight:s,headFloat:i,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:h,ariaLabel:p,tooltip:f,totalNum:b,totalUnit:x,totalLabel:C,subRow:m,subRowAlign:_="start",className:g,inGrid:A=!1,children:y}){const{t:w}=xe.useTranslation(),v=o.useRef(null),{anchorRect:B,openAt:k,close:E}=Pa(),D=o.useCallback(()=>{f&&v.current&&k(v.current)},[f,k]),[N,I]=o.useState(!1);$o(()=>{const S=v.current;if(!S||!u)return;const P=X=>I(X>0&&X<d);if(P(S.clientWidth),typeof ResizeObserver>"u")return;const F=new ResizeObserver(X=>P(X[0].contentRect.width));return F.observe(S),()=>F.disconnect()},[u,d]);const[R,Y]=o.useState(null),M=o.useCallback(()=>Y(null),[]),T=o.useCallback(S=>{const P=S.currentTarget.getBoundingClientRect();Y(F=>F?null:{left:P.left,right:P.right,top:P.top,bottom:P.bottom,width:P.width,height:P.height,x:P.x,y:P.y})},[]),L=!!u&&N;o.useEffect(()=>{L||Y(null)},[L]);const Z=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,P)=>P===0?{...S,separatorBefore:!0}:S)]:[],G=o.useCallback(S=>{if(!h)return;const P=S.target;P&&typeof P.closest=="function"&&P.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),O=o.useCallback(S=>{h&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},[h]),U=typeof s=="function"?s({collapsed:L}):s,$=b!=null||C?n.jsxs(Ya,{label:C,children:[b!=null&&n.jsx("span",{className:"barchart-total__num h0",children:b}),x&&n.jsx("span",{className:"barchart-total__unit h5",children:x})]}):null,H=U||u?n.jsxs("div",{className:"manager-section__head-right",children:[u&&(L?n.jsx(Ce,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??w("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??w("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!R,onClick:T}):n.jsx(bn,{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})),U]}):null,z=o.useId(),V=a?`h${a}`:"div";return n.jsxs("section",{ref:v,className:["manager-section",A&&"manager-section--grid",h&&"manager-section--clickable",g].filter(Boolean).join(" "),onClick:h?G:void 0,onKeyDown:h?O:void 0,onPointerEnter:f?D:void 0,onPointerLeave:f?E:void 0,onFocus:f?D:void 0,onBlur:f?E: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?z:void 0,children:[f&&B&&n.jsx(wn,{anchorRect:{left:B.left,top:B.top+21,right:B.right,bottom:B.bottom,width:B.width,height:B.height},text:f}),i&&n.jsx(Bu,{children:i}),n.jsxs("div",{className:"manager-section__head",children:[n.jsxs("div",{className:"manager-section__title-row",children:[r&&n.jsx(et,{icon:r,label:typeof e=="string"?e:void 0,className:"manager-section__icon"}),n.jsx(V,{id:z,className:["manager-section__title",t].filter(Boolean).join(" "),children:e})]}),H,l&&n.jsx("div",{className:"manager-section__disc body-3",children:l})]}),($||m)&&n.jsxs("div",{className:["barchart-sub-row",_!=="start"&&`barchart-sub-row--${_}`].filter(Boolean).join(" "),children:[$,m]}),y,R&&n.jsx(mn,{anchorRect:R,onClose:M,ariaLabel:u?.ariaLabel??w("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:[{items:Z}],onClose:M,size:"small"})})]})}const Za=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,Fo=e=>Za(e.getFullYear(),e.getMonth()+1);function ha(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 Oo=(e,t)=>`${e}#${t}`;function yn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Iv(){const e=la();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<yn(t,a)){const i=new Date(t,a,0);t=i.getFullYear(),a=i.getMonth(),r=i.getDate()}const l=Math.floor((r-yn(t,a))/7),s=Za(t,a+1);return{monthKey:s,value:Oo(s,l)}}function Fv(e){const t=la(),a=Fo(t),r=(c,d)=>Za(c,d+1),l=new Map;l.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());l.has(d)||l.set(d,[]),l.get(d).push(c)}for(const[c,d]of[...l.entries()]){const h=ha(c);if(!h)continue;const p=h.year,f=h.month1-1,b=yn(p,f);if(!(c===a&&t.getDate()<b)&&!d.some(m=>m.date.getDate()<b))continue;const x=new Date(p,f,0),C=r(x.getFullYear(),x.getMonth());l.has(C)||l.set(C,[])}const s=new Map;for(const[c,d]of l){const h=ha(c);if(!h)continue;const p=h.year,f=h.month1-1,b=new Date(p,f+1,0).getDate(),x=d.reduce((y,w)=>Math.max(y,w.parts?.length??0,w.partsB?.length??0),0),C=d.some(y=>y.partsB),m=new Array(b+1).fill(0),_=new Array(b+1).fill(0),g=Array.from({length:b+1},()=>new Array(x).fill(0)),A=Array.from({length:b+1},()=>new Array(x).fill(0));for(const y of d){const w=y.date.getDate();if(m[w]+=y.a,_[w]+=y.b,y.parts)for(let v=0;v<x;v++)g[w][v]+=y.parts[v]??0;if(y.partsB)for(let v=0;v<x;v++)A[w][v]+=y.partsB[v]??0}s.set(c,{year:p,month:f,daysInMonth:b,partsLen:x,hasPartsB:C,dayA:m,dayB:_,dayParts:g,dayPartsB:A})}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 s){const{year:h,month:p,daysInMonth:f,dayA:b,dayB:x,dayParts:C,dayPartsB:m}=d,_=h===t.getFullYear()&&p===t.getMonth(),g=t.getDate(),A=s.get(r(p===11?h+1:h,(p+1)%12)),y=d.partsLen,w=[];for(let B=1;B<=f;B++){const k=_&&B>g;w.push({label:String(B),...k&&b[B]===0&&x[B]===0?{future:!0}:{},a:k&&b[B]===0&&x[B]===0?-1:b[B],b:x[B],...y?{parts:C[B]}:{},...y&&d.hasPartsB?{partsB:m[B]}:{}})}const v=[];for(let B=yn(h,p);B<=f;B+=7){const k=Math.max(0,B+6-f),E=k&&A?Math.max(y,A.partsLen):y,D=d.hasPartsB||!!(k&&A?.hasPartsB);let N=0,I=0;const R=new Array(E).fill(0),Y=new Array(E).fill(0);for(let T=B;T<=Math.min(B+6,f);T++){N+=b[T],I+=x[T];for(let L=0;L<y;L++)R[L]+=C[T][L],Y[L]+=m[T][L]}if(k&&A)for(let T=1;T<=k&&!i(A.year,A.month,T);T++){N+=A.dayA[T],I+=A.dayB[T];for(let L=0;L<A.partsLen;L++)R[L]+=A.dayParts[T][L],Y[L]+=A.dayPartsB[T][L]}const M=k?`${(p+1)%12+1}/${k}`:`${B+6}`;v.push({label:`${v.length+1}\uC8FC`,sublabel:`[${B}\uC77C~${M}\uC77C]`,a:N,b:I,...E?{parts:R}:{},...E&&D?{partsB:Y}:{}})}u[c]={weekly:v,daily:w}}return u}function ku(){const e=la(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let l=2024;l<=t;l++){const s=l===t?a:12;for(let i=1;i<=s;i++)r.push({value:Za(l,i),year:l,month:i})}return r.reverse()}ku();function Ov(){return ku()}function Au(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 Nu(e){const{t,i18n:a}=xe.useTranslation(),[r,l]=o.useState("week"),s=o.useMemo(()=>Ov().filter(E=>E.value in e),[e]),i=o.useMemo(()=>{const E=[];for(const D of s){const N=new Date(D.year,D.month,0).getDate(),I=yn(D.year,D.month-1),R=Math.ceil((N-I+1)/7);for(let Y=R-1;Y>=0;Y--)E.push({value:Oo(D.value,Y),monthKey:D.value,year:D.year,month:D.month,week:Y})}return E},[s]),u=o.useCallback(E=>`${ro(t,a.language,E.year,E.month)} ${Au(t,E.week)}`,[t]),c=o.useMemo(()=>s.map(E=>({value:E.value,label:ro(t,a.language,E.year,E.month)})),[t,a.language,s]),d=o.useMemo(()=>i.map(E=>({value:E.value,label:u(E)})),[i,u]),h=o.useMemo(()=>Iv(),[e]),p=o.useMemo(()=>s.find(E=>E.value===h.monthKey)?.value??s[0]?.value??"",[s,h]),f=o.useMemo(()=>i.find(E=>E.value===h.value)?.value??i[0]?.value??"",[i,h]),[b,x]=o.useState(""),[C,m]=o.useState("");o.useEffect(()=>{s.find(E=>E.value===b)||x(p)},[s,b,p]),o.useEffect(()=>{i.find(E=>E.value===C)||m(f)},[i,C,f]);const _=r==="month"?c:d,g=r==="month"?b:C,A=r==="month"?x:m,y=o.useMemo(()=>{const E=t("calendar.dow",{returnObjects:!0});return Array.isArray(E)?E:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),w=_.findIndex(E=>E.value===g),v=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E<_.length-1&&A(_[E+1].value)},[_,g,A]),B=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E>0&&A(_[E-1].value)},[_,g,A]),k=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:l,range:g,setRange:A,activeOptions:_,activeIdx:w,handlePrev:v,handleNext:B,periodOptions:k,monthRange:b,weekRange:C,weekRanges:i,DOW:y}}const xt=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function Nn(e,t=!0){return e.future===!0||t&&e.a===-1}function zv({data:e,colorA:t,colorB:a,labelA:r,labelB:l,barWidth:s=10,barGap:i=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:h,seriesLabels:p,rateLabels:f,grouped:b=!1,baseline:x,focusableBars:C=!1}){const m=!a,_=!!(h&&h.length>0),g=x,A=o.useMemo(()=>_?Math.max(0,...e.filter(O=>!Nn(O,g==null)).map(O=>b?Math.max(0,...(O.parts??[]).map(xt)):(O.parts??[]).reduce((U,$)=>U+Math.max(0,xt($)),0))):Math.max(0,...e.filter(O=>!Nn(O,g==null)).flatMap(O=>m?[xt(O.a)]:[xt(O.a),xt(O.b)])),[e,m,_,b]),y=o.useMemo(()=>{if(g==null)return 0;const O=e.filter(U=>!Nn(U,g==null)).flatMap(U=>_?(U.parts??[]).map(xt):m?[xt(U.a)]:[xt(U.a),xt(U.b)]);return Math.max(0,...O.map(U=>Math.abs(U-g)))},[e,g,_,m]),w=o.useMemo(()=>{const O=g!=null?y:A;return c??(d?O>0?O:10:Math.ceil(O/10)*10||10)},[A,y,g,c,d]),v=u,B=_?b?Math.max(1,h.length):1:m?1:2,k={"--bar-width":`${o.useMemo(()=>{const O=Math.max(1,e.length);return Math.max(2,Math.min(s,Math.round(120/(O*B)+6)))},[e.length,B,s])}px`},E={"--bar-group-gap":`${Math.max(0,i)}px`},D=o.useMemo(()=>{const O=Math.round(w/2);return g!=null?[g+w,...O!==w?[g+O]:[],g,...O!==w?[g-O]:[],g-w]:O!==w?[w,O,0]:[w,0]},[w,g]),N=O=>g!=null?1-(O-(g-w))/(2*w):1-O/w,[I,R]=o.useState(null),Y=o.useCallback(()=>R(null),[]),M=o.useCallback((O,U)=>{const $=[O.label,O.sublabel].filter(Boolean).join(" ");let H;if(_&&b&&O.rawPartsB)H=(p??[]).map((z,V)=>{const S=O.rawPartsB[V]??0;return{text:S>0?`${z}: ${U[V]??0}% (${O.rawParts?.[V]??0}/${S})`:`${z}: -`,color:(h??[])[V]}});else if(_&&b)H=(p??[]).map((z,V)=>({text:`${z}: ${Z(U[V]??0)}`,color:(h??[])[V]}));else if(_){const z=(p??[]).map((S,P)=>({text:`${S}: ${U[P]??0}`,color:(h??[])[P]})),V=z.filter((S,P)=>(U[P]??0)>0);H=V.length?V:z}else f&&!m?H=[{text:`${r} ${xt(O.a)}%`,color:t},{text:`${l} ${xt(O.b)}%`,color:a}]:f&&O.rawB!==void 0?H=[{text:`${f.total} ${O.rawB}`},{text:`${f.done} ${O.rawA??0}`,color:t}]:m?H=[{text:`${r}: ${xt(O.a)}`,color:t}]:H=[{text:`${r}: ${xt(O.a)}`,color:t},{text:`${l}: ${xt(O.b)}`,color:a}];return{title:$,items:H}},[_,b,p,h,f,m,r,l,t,a,g]),T=o.useCallback((O,U,$)=>{const H=O.getBoundingClientRect(),{title:z,items:V}=M(U,$);R({rect:{left:H.left,top:H.top,right:H.right,bottom:H.bottom,width:H.width,height:H.height},title:z,items:V})},[M]),L=o.useCallback((O,U)=>{const{title:$,items:H}=M(O,U);return[$,...H.map(z=>z.text)].filter(Boolean).join(", ")},[M]),Z=O=>g!=null&&O>g?`+${O}`:`${O}`,G=I!=null;return o.useEffect(()=>{if(!G)return;const O=()=>R(null),U=$=>{const H=$.target;H&&typeof H.closest=="function"&&H.closest(".manager-bar-chart-col")||R(null)};return window.addEventListener("scroll",O,!0),document.addEventListener("pointerdown",U,!0),()=>{window.removeEventListener("scroll",O,!0),document.removeEventListener("pointerdown",U,!0)}},[G]),n.jsxs("div",{className:"manager-bar-chart-wrap",style:E,children:[n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsx("div",{className:"manager-bar-chart-scroll",children:n.jsxs("div",{className:"manager-bar-chart-area",children:[n.jsxs("div",{className:"manager-bar-chart-plot",style:{height:v},children:[D.slice(0,-1).map((O,U)=>n.jsx("div",{className:`manager-bar-chart-gridline${g!=null&&O===g?" manager-bar-chart-gridline--baseline":""}`,style:{top:N(O)*v},children:n.jsx("span",{className:"manager-bar-chart-gridline__label caption-1",children:O})},U)),e.map((O,U)=>{const $=Nn(O,g==null),H=v/2,z=F=>g!=null?Math.min(H,Math.abs(xt(F)-g)/w*H):Math.min(v,Math.max(0,xt(F)/w*v)),V=$?0:z(O.a),S=$?0:z(O.b),P=(O.parts??[]).map(xt);return n.jsx("div",{className:`manager-bar-chart-col${b&&_?" manager-bar-chart-col--group":""}`,style:{cursor:$?"default":"pointer"},tabIndex:C&&!$?0:void 0,role:C&&!$?"img":void 0,"aria-label":C&&!$?L(O,P):void 0,onMouseEnter:$?void 0:F=>T(F.currentTarget,O,P),onFocus:$||!C?void 0:F=>T(F.currentTarget,O,P),onBlur:C?Y:void 0,onMouseLeave:Y,children:!$&&(_&&b?(h??[]).map((F,X)=>{const se=P[X]??0;if(g==null)return n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:z(se),background:F}},X);const ae=xt(se)<g;return n.jsxs("div",{className:"manager-bar-chart-slot",style:k,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:!ae&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:z(se),background:F}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:ae&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:z(se),background:F}})})]},X)}):_?n.jsx("div",{className:"manager-bar-chart-stack",style:k,children:(()=>{const F=P.reduce((se,ae,me)=>ae>0?me:se,-1);let X=v;return P.map((se,ae)=>{if(se<=0)return null;const me=Math.min(X,se/w*v);return X-=me,n.jsx("div",{className:"manager-bar-chart-stack-segment",style:{height:me,background:(h??[])[ae],borderRadius:ae===F?"6px 6px 0 0":void 0}},ae)})})()}):g!=null?n.jsx(n.Fragment,{children:[{v:xt(O.a),c:t},...m?[]:[{v:xt(O.b),c:a}]].map(({v:F,c:X},se)=>n.jsxs("div",{className:"manager-bar-chart-slot",style:k,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:F>=g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:z(F),background:X}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:F<g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:z(F),background:X}})})]},se))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:V,background:t}}),!m&&n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:S,background:a}})]}))},U)})]}),n.jsx("div",{className:"manager-bar-chart-x-axis",children:e.map((O,U)=>{const $=Nn(O,g==null);return n.jsxs("span",{className:`manager-bar-chart-x-axis__label${$?" manager-bar-chart-x-axis__label--future":""}`,children:[n.jsxs("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:[O.isToday&&n.jsx("span",{className:"manager-bar-chart-x-axis__today-dot",style:{background:t}}),O.label]}),O.sublabel&&n.jsx("span",{className:"caption-1",children:O.sublabel})]},U)})})]})})}),I&&n.jsx(Kn,{anchorRect:I.rect,title:I.title,items:I.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Eu({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:l,setRange:s,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"),f=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:"manager-section-controls",children:[n.jsx(Ce,{htmlType:"button",size:32,type:"dot",icon:"chevron-left",ariaLabel:p,showTooltipInfo:p,disabled:r===a.length-1,onClick:i}),n.jsx(cn,{value:l,onChange:s,options:a,size:40,className:"month-dropdown",ariaLabel:t("calendar.rangeSelect","\uAE30\uAC04 \uC120\uD0DD")}),n.jsx(Ce,{htmlType:"button",size:32,type:"dot",icon:"chevron-right",ariaLabel:f,showTooltipInfo:f,disabled:r<=0,onClick:u}),n.jsx(bn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:b=>h(b),size:40})]})}function zo(e,t,a,r=!0){const l=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(s,i)=>{const u=new Date(t);u.setDate(t.getDate()+i);const c=(e[Fo(u)]?.daily??[])[u.getDate()-1],d=c!=null&&Nn(c,r)||u>l;return{dt:u,entry:c,isFuture:d}})}function Wv(e,t,a,r=!0){const{period:l,monthRange:s,weekRange:i,weekRanges:u,DOW:c}=t,d=la(),h=d.getFullYear(),p=d.getMonth()+1,f=d.getDate();if(l==="month"){const C=e[s]??{weekly:[],daily:[]},m=ha(s),_=m?m.year:null,g=m?m.month1:null,A=_&&g?yn(_,g-1):1;return C.weekly.map((y,w)=>{const v=w+1;let B=y.label,k=!1,E=!1;if(_&&g){const D=A+w*7,N=new Date(_,g-1,D+6),I=N.getMonth()+1,R=N.getDate(),Y=I===g?`${R}`:`${I}/${R}`;B=a("manager.chart.weekRange",{start:D,end:Y});const M=new Date(h,p-1,f).getTime();k=M>=new Date(_,g-1,D).getTime()&&M<=N.getTime(),E=_>h||_===h&&(g>p||g===p&&D>f)}return{...y,label:B,sublabel:Au(a,v-1),isToday:k,future:y.future===!0||E||void 0,a:E?-1:y.a,b:E?0:y.b}})}const b=u.find(C=>C.value===i);if(!b)return[];const x=new Date(b.year,b.month-1,yn(b.year,b.month-1)+b.week*7);return zo(e,x,d,r).map(({dt:C,entry:m,isFuture:_})=>{const g=C.getMonth()+1,A=C.getDate(),y=C.getFullYear();return{label:g===b.month&&y===b.year?`${A}`:`${g}/${A}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:m&&m.a>0?m.a:0,b:_?0:m&&m.b>0?m.b:0,isToday:y===h&&g===p&&A===f,...m?.parts?{parts:_?m.parts.map(()=>0):m.parts}:{},...m?.partsB?{partsB:_?m.partsB.map(()=>0):m.partsB}:{}}})}const Hv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Vv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:l,data:s,colorA:i,colorB:u,labelAKey:c,labelBKey:d,showTotal:h=!1,totalUnitKey:p,totalLabelKey:f,control:b,hideControls:x=!1,rate:C=!1,rateAgg:m="dayMean",tightMax:_=!1,avgMode:g=!1,totalFormat:A,series:y,seriesMode:w="stack",loading:v=!1,onDetail:B,headExtra:k,headSegment:E,icon:D,disc:N,onClick:I,cardAriaLabel:R,cardTooltip:Y,detailSize:M=32,barGap:T,baseline:L,className:Z,inGrid:G=!1}){const{t:O}=xe.useTranslation(),U=Hv[t],$=Nu(s),H=b??$,z=o.useMemo(()=>Wv(s,H,O,L==null),[s,H,O,L]),V=w==="group"&&!!y&&y.length>0;T!=null&&!V&&St("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 z;const ne=H.period==="month"?ha(H.monthRange):null,W=la(),ie=y?.length??0,q=K=>{const ce=[],ke=[],ye=[];for(let de=0;de<ie;de++){let oe=0,ge=0,he=0;for(const pe of K){const Me=xt(pe.a[de]),ze=xt(pe.b[de]);ze<=0||(oe+=Me,ge+=ze,he+=Me/ze*100)}ce.push(m==="weighted"?ge>0?Math.round(oe/ge*100):0:K.length?Math.round(he/K.length):0),ke.push(oe),ye.push(ge)}return{pct:ce,ra:ke,rb:ye}};return z.map((K,ce)=>{let ke=K.a===-1?-1:K.b>0?Math.round(K.a/K.b*100):0;if(ne&&!Nn(K)){const de=ne.year,oe=ne.month1-1,ge=zo(s,new Date(de,oe,yn(de,oe)+ce*7),W).filter(he=>!he.isFuture);if(m==="weighted"){let he=0,pe=0;for(const{entry:Me}of ge)Me&&Me.b>0&&(he+=Me.a,pe+=Me.b);ke=pe>0?Math.round(he/pe*100):0}else ke=ge.length?Math.round(ge.reduce((he,{entry:pe})=>he+(pe&&pe.b>0?pe.a/pe.b*100:0),0)/ge.length):0}let ye=null;if(V&&!Nn(K)){let de;if(ne){const ge=ne.year,he=ne.month1-1;de=zo(s,new Date(ge,he,yn(ge,he)+ce*7),W).filter(pe=>!pe.isFuture).map(({entry:pe})=>({a:pe?.parts??[],b:pe?.partsB??[]}))}else de=[{a:K.parts??[],b:K.partsB??[]}];const oe=q(de);ye={parts:oe.pct,rawParts:oe.ra,rawPartsB:oe.rb}}return{...K,a:ke,b:K.a===-1?0:d&&K.parts&&K.parts[1]>0?Math.round(K.parts[0]/K.parts[1]*100):0,rawA:K.a===-1?-1:K.a,rawB:K.b,...ye??{}}})},[z,C,m,d,H.period,H.monthRange,s,V,y?.length]),P=o.useMemo(()=>{if(C||g){const W=(H.period==="week"?z:s[H.monthRange]?.daily??[]).filter(q=>q.a!==-1);if(W.length===0)return 0;if(C&&m==="weighted"){let q=0,K=0;for(const ce of W)ce.b>0&&(q+=ce.a,K+=ce.b);return K>0?Math.round(q/K*100):0}const ie=C?W.reduce((q,K)=>q+(K.b>0?K.a/K.b*100:0),0):W.reduce((q,K)=>q+(K.a>0?K.a:0),0);return Math.round(ie/W.length)}const ne=H.period==="month"?s[H.monthRange]?.daily??[]:S;return L!=null?ne.reduce((W,ie)=>W+(Nn(ie,!1)?0:xt(ie.a)+(d?xt(ie.b):0)),0):ne.reduce((W,ie)=>W+(ie.a>0?ie.a:0)+(d&&ie.b>0?ie.b:0),0)},[S,z,C,m,g,L,d,H.period,H.monthRange,s]),F=y&&y.length>0?y.map(ne=>({color:ne.color,label:ne.label})):[{color:i,label:O(c)},...d?[{color:u,label:O(d)}]:[]],X=t==="small",se=[X?"manager-section--compact":t==="large"?"manager-section--full":void 0,Z].filter(Boolean).join(" ")||void 0,ae=r?O(r):"",me=ae?O("trainingStatus.detailFor",{name:ae,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):O("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Io,{className:se,inGrid:G,icon:D,disc:N,onClick:I,ariaLabel:R,tooltip:Y,headSegment:E,headMenuItems:B?[{label:me,icon:"list",onClick:B,closeOnSelect:!0}]:void 0,title:O(r),titleLevel:l,titleClassName:X?"h5 chart-section-title--small":void 0,headRight:X?k??void 0:({collapsed:ne})=>n.jsxs(n.Fragment,{children:[!x&&n.jsx(Eu,{control:H}),k,B&&!ne&&n.jsx("span",{className:"manager-bar-chart-detail-btn",children:n.jsx(Ce,{htmlType:"button",size:M,type:"dot",icon:"list",ariaLabel:me,showTooltipInfo:me,onClick:B})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||g||f&&A?n.jsx(Ya,{label:X?void 0:`${O(H.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${O(f??c)}`,children:A?(A(P).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ne,W)=>/\d/.test(ne)?n.jsx("span",{className:"barchart-total__num h0",children:ne},W):n.jsx("span",{className:"barchart-total__unit h5",children:ne},W)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"barchart-total__num h0",children:P}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:O(p)})]})}):n.jsxs(Ya,{children:[n.jsx("span",{className:"barchart-total__num h0",children:P}),n.jsx("span",{className:"barchart-total__unit h5",children:O(c)}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:O(p)})]}):n.jsx("span",{}),n.jsx(Po,{items:F,className:"caption-1"})]}),children:v?n.jsx("div",{className:"manager-bar-chart-wrap manager-bar-chart-loading","aria-busy":"true",children:n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsxs("div",{className:"manager-bar-chart-area manager-bar-chart-area--loading",children:[n.jsx("div",{className:"manager-bar-chart-plot manager-bar-chart-plot--loading",style:{height:U.height},children:n.jsx(Ga,{size:32})}),n.jsx("div",{className:"manager-bar-chart-x-axis","aria-hidden":"true",children:n.jsxs("span",{className:"manager-bar-chart-x-axis__label",children:[n.jsx("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:"\xA0"}),S.some(ne=>!!ne.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(zv,{focusableBars:e,data:S,colorA:i,colorB:d?u:void 0,labelA:O(c),labelB:d?O(d):void 0,barWidth:a??U.barWidth,barGap:T,baseline:L,height:U.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:y?.map(ne=>ne.color),seriesLabels:y?.map(ne=>ne.label),rateLabels:C?{total:O("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:O("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:V})})}const Du=120,qv={left:38,right:16,top:26,bottom:24};function Uv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:l,height:s=156,fallbackWidth:i=320,insets:u,overlay:c,ariaLabel:d,className:h}){const[p,f]=o.useState(null),[b,x]=o.useState(null);o.useEffect(()=>{if(!b)return;const L=G=>f(Math.round(G)||null);if(L(b.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Z=new ResizeObserver(([G])=>L(G.contentRect.width));return Z.observe(b),()=>{Z.disconnect()}},[b]);const{payload:C,anchorRect:m,openAfterDelay:_,close:g}=zy(Du),A=o.useCallback((L,Z)=>{L&&_(L,Z.getBoundingClientRect())},[_]),y=p??i,w=s,{left:v,right:B,top:k,bottom:E}={...qv,...u},[D,N]=t,I=L=>N===D?v:v+(y-v-B)*(L-D)/(N-D),R=L=>k+(w-k-E)*(100-L)/100,Y={x:I,y:R,plot:{left:v,right:y-B,top:k,bottom:w-E,width:Math.max(0,y-v-B),height:Math.max(0,w-k-E)}},M=e.filter(L=>!L.hollow),T=l??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:x,className:_e("line-chart",h),viewBox:`0 0 ${y} ${w}`,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:v,x2:y-B,y1:R(L),y2:R(L)}),n.jsxs("text",{className:"line-chart__tick",x:v-6,y:R(L)+4,textAnchor:"end",children:[L,"%"]})]},L)),c?.(Y),a.map(L=>n.jsx("text",{className:"line-chart__tick",x:I(L.x),y:w-5,textAnchor:"middle",children:L.label},L.x)),M.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:T,points:M.map(L=>`${I(L.x)},${R(L.pct)}`).join(" ")}),e.map(L=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Z=>A(L.description,Z.currentTarget),onPointerLeave:g,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:I(L.x),cy:R(L.pct),r:12}),n.jsx("circle",{className:_e("line-chart__dot-main",L.hollow&&"is-hollow"),cx:I(L.x),cy:R(L.pct),r:4,stroke:T,fill:L.hollow?void 0:T})]},L.x))]}),C!=null&&n.jsx(mn,{anchorRect:m,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Gv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:l,tipGroups:s,start:i,className:u}){return n.jsxs("div",{className:_e("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:_e("game-intro__title",r),children:a}),l!=null&&n.jsx("p",{className:"game-intro__description body-3",children:l}),s?.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(Ce,{htmlType:"button",className:i.className,variant:"main",color:i.color,size:48,width:"100%",disabled:i.disabled,onClick:i.onClick,children:i.label})]})}const Su=(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")}`},ju=(e,t,a,r)=>({from:zl(e,t,a),to:new Date(zl(e,t,a+r).getTime()-1),fromYmd:Su(e,t,a),toYmd:Su(e,t,a+r-1)});function Kv(e,t=0){if(e.period==="month"){const l=ha(e.monthRange),s=la(),i=l?l.year:s.getFullYear(),u=(l?l.month1:s.getMonth()+1)-1+t,c=new Date(Date.UTC(i,u+1,0)).getUTCDate();return ju(i,u,1,c)}const a=e.weekRanges.find(l=>l.value===e.weekRange);if(!a){const l=new Date,s=La();return{from:l,to:l,fromYmd:s,toYmd:s}}const r=yn(a.year,a.month-1);return ju(a.year,a.month-1,r+(a.week+t)*7,7)}const Wo={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function Tu(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function Mu({done:e,total:t,segments:a,color:r="var(--color-main)",size:l="medium",strokeWidth:s,label:i="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof l=="number"?l:Wo[l].diameter,h=s??(typeof l=="number"?12:Wo[l].strokeWidth),p=d/2,f=(d-h)/2,b=2*Math.PI*f;if(a&&a.length>0){const _=a.reduce((g,A)=>{const y=g.length>0?g[g.length-1].acc:0,w=Number.isFinite(A.ratio)?A.ratio:0,v=Math.max(0,Math.min(w,1-y));return g.push({color:A.color,rotate:-90+y*360,dash:b*v,acc:y+v}),g},[]);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:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),_.map((g,A)=>g.dash>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:g.color,strokeWidth:h,strokeDasharray:`${g.dash} ${b}`,strokeLinecap:"round",transform:`rotate(${g.rotate} ${p} ${p})`},A))]})})}const x=(t??0)>0?Math.min((e??0)/t,1):0,C=b*x,m=b-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:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),x>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:r,strokeWidth:h,strokeDasharray:`${C} ${m}`,strokeLinecap:x<.02||x>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":l==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:Tu(x)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||l==="medium"?" ring-chart__label--tight":""}`,children:i})]})]})}function Yv({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:l,totalLabelKey:s,legend:i,loading:u,className:c,inGrid:d=!1,onClick:h,ariaLabel:p,tooltip:f,...b}){const{t:x}=xe.useTranslation();if(!e)return n.jsx(Mu,{...b});const C=(b.total??0)>0?Tu(Math.min((b.done??0)/b.total,1)):0,m=b.size==="small",_=typeof b.size=="number"?b.size:Wo[b.size??"medium"].diameter,g=b.size==="large",A=[c,m?"manager-section--compact":g?"manager-section--full":""].filter(Boolean).join(" ")||void 0,y=r&&n.jsx("span",{className:"chart-section-icon",children:n.jsx(et,{icon:r,className:"chart-section-icon-inner"})});return n.jsx(Io,{className:A,inGrid:d,onClick:h,ariaLabel:p,tooltip:f,title:x(e),titleLevel:t,titleClassName:m?"h5 chart-section-title--small":void 0,headRight:y||(m?void 0:a),subRow:(l||i)&&n.jsxs(n.Fragment,{children:[l?n.jsxs(Ya,{label:!m&&s?x(s):void 0,children:[n.jsx("span",{className:"barchart-total__num h0",children:C}),n.jsx("span",{className:"barchart-total__unit h5",children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Po,{items:i})]}),children:u?n.jsx("div",{className:"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(Ga,{size:32})})}):n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx(Mu,{...b,hideCenter:b.hideCenter??m})})})}function Zv({label:e,value:t,change:a,changeType:r,icon:l,tooltip:s,onClick:i,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:h,close:p}=Pa(),f=o.useCallback(()=>{s&&c.current&&h(c.current)},[s,h]),b=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),x=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(m=>{i&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())},[i]);return n.jsxs("div",{ref:c,className:`manager-stat-card${i?" manager-stat-card--clickable":""}`,onClick:i,onKeyDown:i?C:void 0,onPointerEnter:f,onPointerLeave:p,onFocus:f,onBlur:p,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":i?[e,t,x].filter(m=>m!==void 0&&m!=="").join(" "):void 0,children:[s&&d&&n.jsx(wn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:s}),n.jsxs("div",{className:"manager-stat-card__label-row",children:[n.jsx("span",{className:"manager-stat-card__label h5",children:e}),l&&n.jsx("span",{className:"manager-stat-card__icon",children:n.jsx(et,{icon:l,className:"manager-stat-card__icon-inner"})})]}),n.jsxs("div",{className:"manager-stat-card__content",children:[n.jsxs("div",{className:"manager-stat-card__left",children:[n.jsx("div",{className:"manager-stat-card__value h2",children:t}),x&&n.jsx("div",{className:`manager-stat-card__change manager-stat-card__change--${b??"neutral"} caption-1`,children:x})]}),u&&n.jsx("div",{className:"manager-stat-card__body",children:u})]})]})}function Lu({value:e,onChange:t,min:a=0,max:r=100,step:l=1,orientation:s="horizontal",size:i=24,disabled:u=!1,ariaLabel:c,length:d,className:h,label:p,formatValue:f,labelPos:b,labelAlign:x="right",showMinMax:C=!1,minLabel:m,maxLabel:_,showBgTick:g=!1,showFillTick:A=!1,tickStep:y,tickShape:w="dot"}){t&&!c&&St("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 v=Math.min(r,Math.max(a,e)),B=r>a?(v-a)/(r-a):0,k=s==="vertical",E=!t,D=z=>t?.(Number(z.target.value)),N=typeof d=="number"?`${d}px`:d,I={"--slider-ratio":String(B),"--slider-thumb":`${i}px`,...N?k?{height:N}:{width:N}:{}},R=y??l,Y=(g||A)&&R>0&&r>a?Math.floor((r-a)/R+1e-6):0;if(Y>0&&Y<=100){const z=w!=="dash",V=se=>z?`radial-gradient(circle, ${se} 0.5px, transparent 1px)`:k?`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=z?"2px":"4px",P=[],F=[],X=[];for(let se=0;se<=Y;se++){const ae=se*R/(r-a);if(ae>1+1e-6)break;const me=`${((k?1-ae:ae)*100).toFixed(4)}%`,ne=ae<=B+1e-6;if(ne?!A:!g)continue;const W=ne?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";P.push(V(W)),F.push(k?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),X.push(k?`center ${me}`:`${me} center`)}P.push(k?"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))"),F.push("100% 100%"),X.push("0 0"),I.backgroundImage=P.join(", "),I.backgroundSize=F.join(", "),I.backgroundPosition=X.join(", "),I.backgroundRepeat="no-repeat"}const M=f?f(v):p==="percent"?`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`:p==="count"?`${v} / ${r}`:v===a&&m?m:v===r&&_?_:void 0,T=n.jsx("input",{type:"range",className:_e("slider",`slider--${s}`,E&&"slider--static",!p&&!C&&h),min:a,max:r,step:l,value:v,disabled:u,readOnly:E,tabIndex:E?-1:void 0,"aria-label":c,"aria-valuetext":M,"aria-orientation":s,onChange:D,style:I});if(!p&&!C)return T;const L=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:m??a}),Z=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),G=C?n.jsxs("div",{className:_e("slider-track-group",`slider-track-group--${s}`,!p&&h),children:[k?Z:L,T,k?L:Z]}):T;if(!p)return G;const O=b??(k?"bottom":"right"),U=`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`,$=f?f(v):p==="percent"?U:p==="count"?`${v} / ${r}`:String(v),H=n.jsx("span",{className:"slider-wrap__value body-3b",children:$});return n.jsxs("div",{className:_e("slider-wrap",`slider-wrap--${s}`,`slider-wrap--label-${O}`,`slider-wrap--align-${x}`,h),children:[G,H]})}const Xv=.86,Jv=250,Ho=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Vo=(e,t,a,r)=>{const l=Ho(e,t,a,r);return`${l<0?"-":"+"}${Math.abs(l)} dB`};function qo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:l,labelPos:s,labelAlign:i="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:h=25,className:p,ariaLabel:f}){const b=o.useRef(null),x=o.useRef(null),C=o.useRef(null),m=o.useRef(null),[_,g]=o.useState(null);o.useEffect(()=>{const v=T=>{const L=Vo(T,c,d,h);C.current&&(C.current.textContent=L);const Z=b.current;Z&&(Z.setAttribute("aria-valuenow",String(Ho(T,c,d,h))),Z.setAttribute("aria-valuetext",L))},B=e??Yf(t)??(_&&_.el===t?_.node:null),k=x.current;if(!B||!k){k?.style.setProperty("--meter-level","0"),v(u);let T=!1;return!e&&t&&er(t).then(L=>{!T&&L&&g({el:t,node:L})}),()=>{T=!0}}Qr();const E=new Float32Array(B.fftSize);let D=0,N=0,I=0,R=0,Y=null;const M=T=>{const L=Zf(B,E);D=L>D?L:D*Xv;const Z=D>1e-5?20*Math.log10(D):-1/0,G=Math.max(u,Z),O=G-c,U=Math.min(1,Math.max(0,(O-d)/(h-d)));if(k.style.setProperty("--meter-level",U.toFixed(3)),N+=G,I+=1,T-R>=Jv){const $=N/I;Y=Y==null?$:Y*.6+$*.4,v(Y),N=0,I=0,R=T}m.current=requestAnimationFrame(M)};return m.current=requestAnimationFrame(M),()=>{m.current!=null&&cancelAnimationFrame(m.current),m.current=null}},[e,t,_,u,c,d,h]);const A=typeof r=="number"?`${r}px`:r,y=n.jsx("div",{className:"audio-meter__track",style:A?a==="vertical"?{height:A}:{width:A}:{},children:n.jsx("div",{ref:x,className:"audio-meter__fill"})}),w=s??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:b,className:_e("audio-meter",`audio-meter--${a}`,l&&`audio-meter--label-${w}`,l&&`audio-meter--align-${i}`,p),role:"meter","aria-label":f,"aria-valuemin":d,"aria-valuemax":h,"aria-valuenow":Ho(u,c,d,h),"aria-valuetext":Vo(u,c,d,h),children:[y,l&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Vo(u,c,d,h)})]})}const $u=260;function Ru({message:e,position:t,duration:a,onClose:r}){const[l,s]=o.useState(!1),[i,u]=o.useState(!1),c=o.useRef(i),d=o.useRef(l);o.useEffect(()=>{c.current=i},[i]),o.useEffect(()=>{d.current=l},[l]);const h=o.useRef(null),p=o.useRef(""),f=o.useRef(r);o.useEffect(()=>{f.current=r});const b=a,x=o.useRef(null),C=o.useRef(0),m=o.useRef(0),_=o.useRef(!1),g=o.useRef(null),A=o.useRef(null),y=o.useRef(null),w=o.useRef(null),v=o.useRef(()=>{});v.current=E=>{E<0||(C.current=Date.now(),m.current=E,x.current=setTimeout(()=>{x.current=null,s(!1),g.current=setTimeout(()=>{u(!1);try{f.current()}catch{}},$u)},E))};const B=o.useCallback(()=>{_.current||!x.current||(_.current=!0,clearTimeout(x.current),x.current=null,m.current=Math.max(0,m.current-(Date.now()-C.current)))},[]),k=o.useCallback(()=>{_.current&&(_.current=!1,v.current(m.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)),e){if(d.current)return b>0&&!x.current&&(_.current?m.current=b:v.current(b)),p.current=e,()=>{x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)};const E=()=>{const D=h.current;if(D)try{D.classList.remove("is-visible"),D.style.transition="none",t==="top"?D.style.transform="translateX(-50%) translateY(-16px)":D.style.transform="translateX(-50%) translateY(16px)",D.style.opacity="0",D.offsetWidth,D.style.transition="",D.classList.add("is-visible"),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null;try{D.style.opacity="",D.style.transform="",D.style.transition=""}catch{}},60)}catch{}};c.current?(E(),s(!0)):(u(!0),A.current=requestAnimationFrame(()=>{y.current=requestAnimationFrame(()=>{E(),s(!0)})})),b>0&&(_.current=!1,v.current(b))}else s(!1),g.current=setTimeout(()=>u(!1),$u);return p.current=e,()=>{x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),A.current&&cancelAnimationFrame(A.current),y.current&&cancelAnimationFrame(y.current),w.current&&clearTimeout(w.current),x.current=null,g.current=null,A.current=null,y.current=null,w.current=null}},[e,b,t]),{mounted:i,showing:l,popupRef:h,pause:B,resume:k}}function ma({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:l=2e3}){const{mounted:s,showing:i,popupRef:u,pause:c,resume:d}=Ru({message:e,position:t,duration:l,onClose:r}),h=o.useRef(null),[p,f]=o.useState(!1);if(o.useEffect(()=>{i?f(!0):s||f(!1)},[i,s]),!s)return null;const b=a==="notice"||a==="warning"?a:"normal",x=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--${b} body-2`,"aria-hidden":p||i?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?nn.createPortal(x,document.body):x}const Qv=24;function e4({value:e,max:t=100,size:a=8,color:r,trackColor:l,label:s,formatValue:i,labelPos:u,labelAlign:c="right",ariaLabel:d,className:h}){const p=Number.isFinite(t)&&t>0?t:1,f=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),b=f/p*100,x=Number.isFinite(t)&&t>0?t:0,C=u??(a>=Qv?"inside":"bottom"),m=C==="center"?"inside":C,_=m==="inside"&&(c==="left"?b>=15:c==="center"?b>=50:b>=85),g={};return r&&(g["--progress-bar-fill"]=r),l&&(g["--progress-bar-track"]=l),n.jsxs("div",{className:_e("progress-bar",`progress-bar--${a}`,`progress-bar--label-${m}`,s&&`progress-bar--align-${c}`,s&&_&&"progress-bar--label-on-fill",h),style:g,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":x,"aria-valuetext":s?i?i(f):s==="percent"?void 0:s==="raw"?String(f):`${f} / ${x}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${b}%`}})}),s&&n.jsx("span",{className:"progress-bar__label caption-1b",children:i?i(f):s==="percent"?`${Math.round(b)}%`:s==="raw"?String(f):`${f} / ${x}`})]})}const Pu={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},t4="rgba(255, 255, 255, 0.16)";function Iu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:l,variant:s="numbered",announce:i=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=un("(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}}"}),f={};if(a&&(f["--pi-inactive-bg"]=a),r&&(f["--pi-inactive-color"]=r),l&&(a||(f["--pi-inactive-bg"]=t4),r||(f["--pi-inactive-color"]="var(--color-white)")),s==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:f,role:i?"status":"img","aria-label":i?void 0:p,children:[i&&n.jsx("span",{style:Pu,children:p}),Array.from({length:e}).map((x,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<h?" done":C===h?" active":""}`},C))]});const b=i?n.jsx("span",{role:"status",style:Pu,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:f,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[h+1," / ",e]})}),b]}):n.jsxs(n.Fragment,{children:[b,n.jsx("div",{className:"progress-indicator",style:f,role:"list","aria-label":p,children:Array.from({length:e}).map((x,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 n4(e){if(!e)return[];const t=[];let a=0,r="";for(const l of e.trim()){if(l==="("?a++:l===")"&&a--,/\s/.test(l)&&a===0){r&&(t.push(r),r="");continue}r+=l}return r&&t.push(r),t}function a4({children:e,className:t,style:a,rowLabel:r,onRowClick:l}){return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:a,children:r&&l?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":r,children:e}):e})}function Uo({variant:e="default",children:t,className:a,draggable:r,onClick:l,onMouseEnter:s,onMouseLeave:i,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:h,describedBy:p,rowHasButton:f}){const b=o.useCallback(x=>{l&&x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},[l]);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(Ga,{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:l,onKeyDown:l?b:void 0,onMouseEnter:s,onMouseLeave:i,onDragStart:u,onDragEnd:c,role:"row",tabIndex:l&&!f?0:void 0,"aria-describedby":l&&!f?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 r4({dir:e}){return n.jsx(e==="asc"?Ks:Gs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function o4({children:e,onClick:t,className:a,sortDir:r,ariaSort:l,onResizeStart:s}){const i=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(r4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":l,className:_e("table-field body-3",a,r?"table-field--sorted":"",s?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:i}):i,s&&n.jsx("span",{className:"table-field__resizer",onPointerDown:s,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Go({fields:e=[],headerGroups:t,items:a=[],renderRow:r,onRowClick:l,isRowClickable:s,onRowMouseEnter:i,onRowMouseLeave:u,onRowDragStart:c,onRowDragEnd:d,draggingId:h,gridTemplateColumns:p,mobileGridTemplateColumns:f,resizable:b=!1,resizeMode:x="grow",resizeStorageKey:C,size:m="small",title:_,icon:g,count:A,collapsed:y=!1,onToggleCollapse:w,headerActions:v,empty:B,loading:k,dragOver:E=!1,onDragOver:D,onDragLeave:N,onDrop:I,renderExpandedRow:R,expandedId:Y}){const{t:M}=xe.useTranslation(),T=o.useId(),L=`table-title-${T}`,Z=`table-row-hint-${T}`,G=un("(max-width: 767px)"),O=f&&G?f:null,U=b&&!G,$=48,H=o.useRef(()=>$),z=C?`table-cols:${C}`:null,V=o.useRef(null),S=o.useRef(null),P=o.useRef(null),F=o.useRef(null),[X,se]=o.useState(!1),[ae,me]=o.useState(0),ne=o.useCallback(()=>{const re=P.current;re&&(se(re.scrollWidth>re.clientWidth+1),me(re.clientWidth))},[]),W=o.useCallback((re,Ee)=>{const Qe=re.current;Qe&&S.current&&S.current.unobserve(Qe),re.current=Ee,Ee?(!S.current&&typeof ResizeObserver<"u"&&(S.current=new ResizeObserver(()=>ne())),S.current?.observe(Ee)):!P.current&&!F.current&&(S.current?.disconnect(),S.current=null),ne()},[ne]),ie=o.useCallback(re=>W(P,re),[W]),q=o.useCallback(re=>W(F,re),[W]);o.useEffect(()=>{ne()}),o.useEffect(()=>{if(typeof window>"u")return;const re=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>ne()):null;return window.addEventListener("resize",ne),()=>{re!=null&&cancelAnimationFrame(re),window.removeEventListener("resize",ne)}},[ne]);const K=o.useRef(()=>!1),ce=o.useRef([]),ke=o.useRef(null),ye=re=>{if(!re||typeof window>"u")return null;try{const Ee=JSON.parse(window.localStorage.getItem(re)??"null");return Array.isArray(Ee)&&Ee.length>0&&Ee.every(Qe=>typeof Qe=="number"&&Number.isFinite(Qe)&&Qe>0)?Ee:null}catch{return null}},[de,oe]=o.useState(()=>ye(z)),[ge,he]=o.useState(z),[pe,Me]=o.useState(()=>ye(z)!==null);if(ge!==z){he(z);const re=ye(z);oe(re),Me(re!==null)}const ze=o.useRef(de);o.useEffect(()=>{ze.current=de},[de]);const Le=o.useCallback(re=>{const Ee=ke.current;if(!Ee)return;const Qe=ze.current;if(Qe){const qe=[...Qe];if(Ee.next!=null&&Ee.startWNext!=null){const rt=re.clientX-Ee.startX,Te=Math.max(H.current(Ee.index)-Ee.startW,Math.min(Ee.startWNext-H.current(Ee.next),rt));qe[Ee.index]=Ee.startW+Te,qe[Ee.next]=Ee.startWNext-Te}else qe[Ee.index]=Math.max(H.current(Ee.index),Ee.startW+(re.clientX-Ee.startX));ze.current=qe,oe(qe)}},[]),Fe=o.useCallback(()=>{if(ke.current=null,window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",Fe),window.removeEventListener("pointercancel",Fe),document.body.style.cursor="",document.body.style.userSelect="",z&&ze.current)try{window.localStorage.setItem(z,JSON.stringify(ze.current))}catch{}},[Le,z]),We=o.useCallback((re,Ee)=>{Ee.preventDefault(),Ee.stopPropagation();const Qe=V.current;if(!Qe)return;const qe=Array.from(Qe.children).map(Te=>Te.getBoundingClientRect().width),rt=x==="fit"?e.findIndex((Te,ut)=>ut>re&&Te.resizable!==!1):-1;ke.current=rt>=0?{index:re,startX:Ee.clientX,startW:qe[re],next:rt,startWNext:qe[rt]}:{index:re,startX:Ee.clientX,startW:qe[re]},ze.current=qe,oe(qe),Me(!0),window.addEventListener("pointermove",Le),window.addEventListener("pointerup",Fe),window.addEventListener("pointercancel",Fe),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Le,Fe,x,e]),pt=o.useCallback(()=>{const re=V.current,Ee=re?.closest(".table-wrap");if(!re||!Ee)return null;const Qe=Ee.style.getPropertyValue("--table-grid-cols");Ee.style.setProperty("--table-grid-cols",e.map((Ze,st)=>K.current(st)?ce.current[st]:"max-content").join(" "));const qe=Array.from(Ee.querySelectorAll(".table-row")).filter(Ze=>!Ze.classList.contains("table-row--loading")&&!Ze.classList.contains("table-row--empty")),rt=e.map((Ze,st)=>{let lt=re.children[st]?.getBoundingClientRect().width??0;for(const kt of qe){const Vt=kt.children[st];Vt&&(lt=Math.max(lt,Vt.getBoundingClientRect().width))}const dt=K.current(st)?parseFloat(ce.current[st]):NaN;return Number.isFinite(dt)?dt:Math.max(H.current(st),Math.ceil(lt))}),Te=window.getComputedStyle(re),ut=re.clientWidth-(parseFloat(Te.paddingLeft)||0)-(parseFloat(Te.paddingRight)||0);Qe?Ee.style.setProperty("--table-grid-cols",Qe):Ee.style.removeProperty("--table-grid-cols");let Re=rt;const ot=rt.reduce((Ze,st,lt)=>Ze+(K.current(lt)?st:0),0),ft=rt.reduce((Ze,st,lt)=>Ze+(K.current(lt)?0:st),0),Bt=ut-ot;if(ut>0&&ft>0&&Bt>0){const Ze=Bt/ft;Re=rt.map((lt,dt)=>K.current(dt)?lt:Math.max(H.current(dt),Math.round(lt*Ze)));const st=Math.round(Bt-Re.reduce((lt,dt,kt)=>lt+(K.current(kt)?0:dt),0));if(st!==0){let lt=-1;Re.forEach((dt,kt)=>{!K.current(kt)&&(lt<0||dt>Re[lt])&&(lt=kt)}),lt>=0&&(Re[lt]=Math.max(H.current(lt),Re[lt]+st))}}return Re},[e,x]),it=(re,Ee)=>re!==null&&re.length===Ee.length&&re.every((Qe,qe)=>Qe===Ee[qe]),at=o.useRef(pt);o.useEffect(()=>{at.current=pt});const[ht,Ne]=o.useState(0),Ve=a.length>0,we=`${z??""}|${ht}|${e.length}|${ae}`,Ue=!pe&&U&&z!==null&&!k?`${we}|${Ve?1:0}`:null,Ae=o.useRef(null);o.useEffect(()=>{if(Ue===null||!Ve||Ae.current===we)return;const re=at.current();re&&(Ae.current=we,oe(Ee=>it(Ee,re)?Ee:re))},[Ue]);const $e=o.useCallback(()=>{if(z)try{window.localStorage.removeItem(z)}catch{}Me(!1);const re=at.current();oe(re),ze.current=re,Ne(Ee=>Ee+1)},[z]);o.useEffect(()=>()=>{ke.current&&(window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",Fe),window.removeEventListener("pointercancel",Fe),document.body.style.cursor="",document.body.style.userSelect="")},[Le,Fe]);const Se=n4(p),Xe=Se.filter(re=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(re));Xe.length>0&&St(`table-content-track:${p}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Xe.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: ${p})`);const gt=e.findIndex(re=>!!re.sortDir);e.filter(re=>!!re.sortDir).length>1&&St("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 nt=re=>re===gt?e[re].sortDir==="asc"?"ascending":"descending":e[re].onClick?"none":void 0,Je=re=>/^\d+(\.\d+)?px$/.test(Se[re]??""),_t=re=>{const Ee=Se[re]??"",Qe=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(Ee)??/^(\d+(?:\.\d+)?)px$/.exec(Ee);return Qe?parseFloat(Qe[1]):$};K.current=Je,H.current=_t,ce.current=Se;const mt=re=>x==="fit"&&!Je(re)?"fr":"px",wt=de&&de.length===e.length&&!G,vt=O??(wt?e.map((re,Ee)=>re.resizable===!1&&Se[Ee]?Se[Ee]:`${de[Ee]}${mt(Ee)}`).join(" "):p),bt=vt?{"--table-grid-cols":vt}:void 0,Ke=_!==void 0;return n.jsxs("div",{ref:ie,className:`table-wrap table-wrap--${m}${U?" table-wrap--resizable":""}${E?" table-wrap--dragover":""}${y?" table-wrap--collapsed":""}`,style:bt,onDragOver:D,onDragLeave:N,onDrop:I,tabIndex:X?0:void 0,role:X?"region":void 0,"aria-label":X?typeof _=="string"?_:M("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!l&&n.jsx("span",{id:Z,className:"table-row-hint",children:M("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:q,role:"table","aria-labelledby":Ke&&typeof _=="string"?L:void 0,className:"table body-2",children:[Ke&&n.jsxs("div",{className:_e("table-header",w&&"table-header--clickable"),onClick:w,role:"caption",children:[w&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:y?"chevron-right":"chevron-down",ariaLabel:y?M("common.expand","\uD3BC\uCE58\uAE30"):M("common.collapse","\uC811\uAE30"),ariaExpanded:!y,className:"table-header__chevron"}),g&&n.jsx(et,{icon:g,label:typeof _=="string"?_:void 0,className:"table-header__icon"}),n.jsx("span",{id:L,className:"table-header__title h5b",children:_}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),v&&n.jsx("span",{className:"table-header__actions",onClick:re=>re.stopPropagation(),children:v})]}),!y&&n.jsxs(n.Fragment,{children:[t&&t.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:t.map((re,Ee)=>n.jsx("div",{role:"columnheader","aria-colspan":re.span,className:_e("table-field body-3",re.className),style:{gridColumn:`span ${re.span}`},children:re.label},Ee))}),n.jsxs("div",{role:"presentation",className:_e("table-fields-strip",U&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:V,children:e.map((re,Ee)=>n.jsx(o4,{onClick:re.onClick,className:re.className,sortDir:re.sortDir,ariaSort:nt(Ee),onResizeStart:U&&Ee<e.length-1&&re.resizable!==!1&&(x!=="fit"||e.some((Qe,qe)=>qe>Ee&&Qe.resizable!==!1))?Qe=>We(Ee,Qe):void 0,children:re.label},Ee))}),U&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:M("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:$e})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:k?n.jsx(Uo,{variant:"loading",colSpan:e.length||void 0}):a.length===0&&B?n.jsx(Uo,{variant:"empty",colSpan:e.length||void 0,children:B}):a.map((re,Ee)=>{const Qe=h!=null&&re.id===h,qe=!!l&&(s?s(re):!0),rt=Y!=null&&re.id!=null&&(Y instanceof Set?Y.has(re.id)||[...Y].some(Te=>String(Te)===String(re.id)):String(re.id)===String(Y));return n.jsx(Uo,{className:`${qe?" table-row--clickable":""}${c?" table-row--draggable":""}${Qe?" table-row--dragging":""}`.trim(),draggable:!!c,onClick:qe?()=>l(re):void 0,colSpan:e.length||void 0,rowHasButton:r(re).some(Te=>!!Te.rowLabel),describedBy:Z,onMouseEnter:i?Te=>i(re,Te):void 0,onMouseLeave:u?Te=>u(re,Te):void 0,onDragStart:c?Te=>c(re,Te):void 0,onDragEnd:d?Te=>d(re,Te):void 0,expandedContent:rt&&R?R(re):void 0,children:r(re).map((Te,ut)=>n.jsx(a4,{className:Te.className,style:Te.style,rowLabel:qe?Te.rowLabel:void 0,onRowClick:qe?()=>l(re):void 0,children:Te.content},ut))},re.id!=null?`${typeof re.id}:${re.id}`:`__idx:${Ee}`)})})]})]})]})}const s4={hearingAid:"hearingAid",cochlearImplant:"cochlearImplant",other:"other",\uBCF4\uCCAD\uAE30:"hearingAid",\uC778\uACF5\uC640\uC6B0:"cochlearImplant",\uAE30\uD0C0:"other"};function Fu(e){return e?s4[e]??null:null}function Ou(e){switch(Fu(e)){case"hearingAid":return"main";case"cochlearImplant":return"sub";default:return"default"}}function zu(e,t){const a=Fu(e);return a?t(`device.type.${a}`,{defaultValue:e??""}):e??""}const fa=e=>e==null?"":String(e).trim();function Ko(e,t,a,r){const l=fa(e),s=fa(t),i=fa(a);if(r&&l&&s&&i){const c=`${l.padStart(4,"0")}-${s.padStart(2,"0")}-${i.padStart(2,"0")}`,d=new Date(c);if(!Number.isNaN(d.getTime())&&d.toISOString().slice(0,10)===c){const h=Fl(c,r);if(h)return h}}const u=[l,s,i];for(;u.length>0&&u[u.length-1]==="";)u.pop();return u.join(".")}function l4(e,t,a){const r=fa(e);return r?`${r}-${fa(t).padStart(2,"0")}-${fa(a).padStart(2,"0")}`:""}function Wu(e,t){return t!=="wornAt"?String(e[t]??""):l4(e.wornYear,e.wornMonth,e.wornDay)}function i4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:l,onRelease:s,onAdd:i}){const{t:u,i18n:c}=xe.useTranslation(),d=m=>m==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:h,field:p}=Ty(),f=o.useMemo(()=>{if(!h)return e;const{key:m,asc:_}=h;return[...e].sort((g,A)=>{if(m==="worn"){const y=Number(A.worn)-Number(g.worn);return _?y:-y}return wo(Wu(g,m),Wu(A,m),_)})},[e,h]),{pageRows:b,pageSizeProps:x,paginationProps:C}=jy(f,h);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(Ro,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:x,pagination:C,actions:i&&n.jsx(Ce,{htmlType:"button",size:40,type:"bar",variant:"main",icon:"plus",label:u("customers.device.addButton","\uAE30\uAE30 \uCD94\uAC00"),onClick:i})}),n.jsx(Go,{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:b.map((m,_)=>({id:m.id??`${m.side}-${_}`,row:m})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:m})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(xu,{checked:m.worn,disabled:m.worn?!s:!l,ariaLabel:m.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?l?.(m):s?.(m)}})})},{content:n.jsx("span",{children:d(m.side)})},{content:m.device?n.jsx(Et,{size:"small",variant:Ou(m.device),fill:"soft",label:zu(m.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:m.brand})},{content:n.jsx("span",{children:m.fitType||"-"})},{content:n.jsx("span",{children:m.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Ko(m.wornYear,m.wornMonth,m.wornDay,c.language)||"-"})},...r?[{content:n.jsx("span",{className:"dlp-row-actions",children:n.jsx(Ce,{htmlType:"button",size:28,type:"bar",variant:"transparent-gray",label:u("common.delete","\uC0AD\uC81C"),onClick:_=>{_?.stopPropagation(),r(m)}})})}]:[]],onRowClick:({row:m})=>a(m),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function Hu(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 u4(e,t){return new Date(e,t+1,0).getDate()}function c4(e,t){return new Date(e,t,1).getDay()}function d4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:l}){const{t:s,i18n:i}=xe.useTranslation(),u=o.useMemo(()=>s("calendar.dow",{returnObjects:!0}),[s]),c=oo(l),[d,h]=o.useState(()=>Number(c.slice(0,4))),[p,f]=o.useState(()=>Number(c.slice(5,7))-1),[b,x]=o.useState(null),C=o.useRef(null),m=o.useMemo(()=>{const v={};return e.forEach(B=>{v[B.date]||(v[B.date]=[]),v[B.date].push(B)}),v},[e]),_=o.useMemo(()=>{const v=u4(d,p),B=c4(d,p),k=[];for(let E=0;E<B;E++)k.push(null);for(let E=1;E<=v;E++)k.push(E);for(;k.length<35;)k.push(null);return k},[d,p]),g=o.useCallback(()=>{p===0?(h(v=>v-1),f(11)):f(v=>v-1)},[p]),A=o.useCallback(()=>{p===11?(h(v=>v+1),f(0)):f(v=>v+1)},[p]),y=v=>`${d}-${String(p+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`,w=v=>y(v)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:g,"aria-label":s("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(et,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:ro(s,i.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:A,"aria-label":s("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(et,{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:s("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:s("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:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(v=>n.jsx("div",{className:"calendar-day-header body-3",children:v},v)),_.map((v,B)=>{if(v===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${B}`);const k=v,E=y(k),D=m[E]??[],N=Fl(E,i.language),I=b===E;return n.jsxs("div",{className:`calendar-cell${w(k)?" today":""}${I?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?s("calendar.addOnDate",{date:E}):void 0,"aria-current":w(k)?"date":void 0,onClick:r?()=>r(E):void 0,onKeyDown:r?R=>{R.target===R.currentTarget&&(R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),r(E)))}:void 0,onDragOver:a?R=>{R.preventDefault(),x(E)}:void 0,onDragLeave:a?R=>{R.currentTarget.contains(R.relatedTarget)||x(null)}:void 0,onDrop:a?R=>{R.preventDefault(),C.current!=null&&(a(C.current,E),C.current=null),x(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:k}),D.length>0&&(()=>{const R=[{key:"visited",label:s("calendar.legend.visited","\uBC29\uBB38"),count:D.filter(M=>(M.status??"visited")==="visited").length},{key:"scheduled",label:s("calendar.legend.scheduled","\uC608\uC57D"),count:D.filter(M=>M.status==="scheduled").length},{key:"noVisit",label:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:D.filter(M=>M.status==="noVisit").length}].filter(M=>M.count>0),Y=R.length===1&&R[0].key==="visited"?s("calendar.visitCount",{count:D.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):R.map(M=>s("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":`${N} ${Y}`,children:[R.map(M=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${M.key}`,"aria-hidden":"true"},M.key)),D.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:D.map((R,Y)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${R.status==="noVisit"?" calendar-visit-badge--no-visit":R.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?M=>{C.current=R.id,M.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,x(null)}:void 0,onClick:t?M=>{M.stopPropagation(),t(R)}:void 0,...Hu(t?()=>t(R):void 0),"aria-label":[N,R.time?Vl(R.time,s):null,R.customer,s(R.status==="noVisit"?"calendar.legend.noVisit":R.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[R.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Vl(R.time,s)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:R.customer}),R.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},R.id??Y))})]},k)})]})]})}const p4={page:"h3",pagePopup:"h4",popup:"h5"};function Ca({type:e="page",title:t,headingLevel:a=2,icon:r,action:l,disc:s,children:i,inGrid:u=!1,className:c,style:d}){const h=p4[e],p=t||s||l||r,f=a?`h${a}`:"div";return n.jsxs("div",{className:_e("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(et,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(f,{className:`section__title ${h}`,children:t}),s&&n.jsx("div",{className:"section__disc body-3",children:s})]})]}),l&&n.jsx("div",{className:"section__action",children:l})]}),i]})}let Yo=null,Vu=!1;function qu(){if(Vu||typeof document>"u")return;Vu=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(Yo="keyboard")},!0);const e=()=>{Yo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}qu();function Cr(){return qu(),Yo==="keyboard"}const gr=20;function h4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:l,renderPopup:s,completedIds:i,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:h,onRemove:p,onMore:f,sectionType:b="page"}=e||{},[,x]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],m=C.length,[_,g]=o.useState(Math.min(m,gr)),A=o.useMemo(()=>Array.isArray(l)?[...l,a?.label].filter(Boolean).join(" \xB7 "):[l||"",a?.label].filter(Boolean).join(" \xB7 "),[l,a?.label]);o.useEffect(()=>{g(Math.min(m,gr))},[m]),Li("speechear.data.updated",()=>x(B=>B+1));const y=o.useRef(null),w=o.useRef(null);function v(){const B=document.activeElement;w.current=Cr()&&B&&B.closest?.(".training-block__more")?_:null,g(k=>Math.min(m,k+gr))}return o.useEffect(()=>{const B=w.current;if(B==null)return;w.current=null;const k=document.activeElement;k&&k!==document.body||y.current?.querySelectorAll(".training-block-button")[B]?.focus()},[_]),n.jsxs(Ca,{type:b,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:y,children:(C||[]).slice(0,_).map((B,k)=>{const E=B;return n.jsx(Mo,{index:k,type:a,trainingData:E,depth:A,renderPopup:s,completedIds:i,selectedIds:u,size:d,useDescriptionTooltip:h,onRemove:typeof p=="function"&&u!=null&&E?.id!=null&&u.has(String(E.id))?()=>p(E):void 0,onComplete:typeof c=="function"&&E?.id!=null?()=>c(String(E.id)):void 0,onMore:typeof f=="function"?D=>f(E,D):void 0},E?.id!=null?`${a?.key||"t"}-${String(E.id)}`:`${a?.key||"t"}-${k}`)})}),m>gr&&_<m&&n.jsx("div",{className:"training-block__more",children:n.jsx(Ce,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:v,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function m4(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 f4({gap:e=10,count:t,className:a,children:r}){const l=o.useRef(null),[s,i]=o.useState({width:0,card:0}),u=t??m4(r);o.useLayoutEffect(()=>{const f=l.current;if(!f)return;const b=()=>{const C=f.style.maxWidth;f.style.maxWidth="none";const m=f.clientWidth;f.style.maxWidth=C;const _=f.firstElementChild?.offsetWidth??0;i(g=>g.width===m&&g.card===_?g:{width:m,card:_})};if(b(),typeof ResizeObserver>"u")return;const x=new ResizeObserver(b);return x.observe(f),()=>x.disconnect()},[u,e]);const c=s.card>0?s.card:0,d=c>0?xC(s.width,c,e):0,h=d>0?_C(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:l,className:_e("training-block-grid",h>0&&"training-block-grid--measured",a),style:p,"data-cols":h>0?h:void 0,children:r})}function Zo(e){const t=o.useRef(null),a=o.useRef(e);a.current=e;const[r,l]=o.useState({url:e,loading:!!e,failed:!1}),s=r.url===e?r:{loading:!!e,failed:!1};o.useEffect(()=>{const c=t.current;l({url:e,failed:!1,loading:!!e&&!(c?.complete&&c.naturalWidth>0)})},[e]);const i=o.useCallback(()=>{a.current===e&&l({url:e,loading:!1,failed:!1})},[e]),u=o.useCallback(()=>{a.current===e&&l({url:e,loading:!1,failed:!0})},[e]);return{imgRef:t,loading:s.loading,failed:s.failed,hasImage:!!e&&!s.failed,onLoad:i,onError:u}}var C4='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 g4=C4,Xo=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:l=!1,onSelect:s,flipDelay:i=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},h){const{t:p}=xe.useTranslation(),f=e.word||e.title||"",b=t||!f,x=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",m=e.colloquialLabel||"",[_,g]=o.useState({label:f,subLabel:C,colloquialLabel:m,homonum:e.homonum});f&&(_.label!==f||_.subLabel!==C||_.colloquialLabel!==m||!Object.is(_.homonum,e.homonum))&&g({label:f,subLabel:C,colloquialLabel:m,homonum:e.homonum});const A=o.useRef(null),y=un("(max-width: 767px)"),[w,v]=o.useState(!1),B=`${typeof x=="string"?x:x?.src??""}\0${f}`,[k,E]=o.useState({for:"",url:""}),D=k.for===B?k.url:"",N=Rl(),I=e.textOnly??(!e.image&&!!_.label&&!!N&&N.entries.length>0&&!N.byWord.has(_.label)),R=I?"":sa()?.(_.label,_.homonum)??e.image??"",{imgRef:Y,loading:M,hasImage:T,onLoad:L,onError:Z}=Zo(R);o.useEffect(()=>{let P=!1;return(async()=>{if(x){if(typeof x=="string"){if(x.startsWith("http")||x.includes("/")){E({for:B,url:x});return}}else if(typeof x=="object"&&!Array.isArray(x)){const X=x.src;if(X){E({for:B,url:X});return}}}const F=Na();if(F&&f)try{const X=await Promise.resolve(F(f));!P&&X&&E({for:B,url:X})}catch{}})(),()=>{P=!0}},[x,f,B]);const G=o.useRef(!0),O=o.useRef(null);o.useEffect(()=>(G.current=!0,()=>{G.current=!1,O.current&&pr(O.current),O.current=null;try{A.current?.pause()}catch{}A.current=null}),[]);const U=o.useCallback(()=>new Promise(P=>{if(typeof window<"u"&&window.speechSynthesis&&f){v(!0),window.speechSynthesis.cancel();const F=new SpeechSynthesisUtterance(f);F.lang="ko-KR",F.onend=()=>{v(!1);try{a?.()}catch{}P()},F.onerror=()=>{v(!1),P()},window.speechSynthesis.speak(F)}else P()}),[f,a]),$=o.useCallback(P=>{const F=hr(P,X=>{if(v(!1),X)try{a?.()}catch{}});return A.current=F.el,F.done},[a]),H=o.useCallback(async()=>{if(t||!G.current)return;const P=()=>{O.current===P&&(O.current=null);try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1)},F=dr(P);O.current=P;try{window.speechSynthesis?.cancel()}catch{}try{if(D&&(v(!0),await $(D)))return;const X=Zr();if(X&&f)try{const se=await Promise.resolve(X(f));if(!G.current||O.current!==P||se&&(v(!0),await $(se)))return}catch{}if(!G.current||O.current!==P)return;await U()}finally{F(),O.current===P&&(O.current=null)}},[t,D,f,$,U]);o.useImperativeHandle(h,()=>({play:()=>H()}),[H]);const z=P=>P.stopPropagation(),V=o.useCallback(P=>{if(P.stopPropagation(),!t){if(w){try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1);return}H()}},[t,w,H]),S=_e("training-word-card",t?"training-word-card--disabled":"",b?"training-word-card--flipped":"",r?"training-word-card--selectable":"",l?"training-word-card--selected":"");return n.jsx("div",{className:S,onClick:r&&!t?s:void 0,role:r?"button":void 0,"aria-pressed":r?l:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?P=>{P.target===P.currentTarget&&(P.key==="Enter"||P.key===" "||P.key==="Spacebar")&&(P.preventDefault(),s?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:b?"0ms":`${i}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[l&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:z,children:n.jsx(Et,{type:"dot",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:I?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):T?n.jsxs(n.Fragment,{children:[M&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:Y,className:"training-word-card__image",src:R,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:M?0:1},onLoad:L,onError:Z})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!I&&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?z:void 0,children:n.jsx(Ce,{htmlType:"button",size:y?40:48,type:y?"dot":"bar",icon:w?"pause":"play",label:y?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:w,onClick:V,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("${g4}")`}})})]})})}),b4=260;function On(e){const{t}=xe.useTranslation(),{title:a,subtitle:r,headerActions:l,headerSegment:s,children:i,buttons:u,footer:c,footerStart:d,footerEnd:h,footerNote:p,footerNoteDivider:f=!1,footerClassName:b="",footerLayout:x="center",onClose:C,closeDisabled:m=!1,beforeClose:_,closeOnBackdrop:g=!0,className:A="",ariaLabel:y,useTitle:w=!0,inline:v=!1,size:B,layer:k="modal",height:E,fillBody:D=!1,resetScrollKey:N}=e||{},[I,R]=o.useState(!1),Y=o.useRef(!1),M=o.useRef(null),T=o.useId(),L=o.useRef(null);o.useEffect(()=>{},[v,a,y,A]),o.useEffect(()=>{N!==void 0&&L.current&&(L.current.scrollTop=0)},[N]);const[Z,G]=o.useState(!1);o.useEffect(()=>{const W=L.current;if(!W)return;const ie=()=>G(W.scrollHeight>W.clientHeight+1);if(ie(),typeof ResizeObserver>"u")return;const q=new ResizeObserver(ie);q.observe(W);const K=W.firstElementChild;return K&&q.observe(K),()=>q.disconnect()},[i,N]),o.useEffect(()=>{if(!v)return fu()},[v]);const O=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{if(v)return;const W=O.current,ie=M.current;return mo(ie,W),ie&&!ie.contains(document.activeElement)&&(ie.querySelector(gn)??ie).focus(),()=>{const q=document.activeElement;(!q||q===document.body||ie&&ie.contains(q))&&fo(W)?.focus?.()}},[v]),po(M,!v);const U=o.useRef(!0),$=Co(),H=o.useRef(null);o.useEffect(()=>(U.current=!0,()=>{U.current=!1,H.current&&(clearTimeout(H.current),H.current=null)}),[]);const z=o.useCallback(()=>{!U.current||!Y.current||(Y.current=!1,R(!1))},[]),V=o.useCallback((W,ie=!1)=>{if(ie&&!U.current||Y.current)return;Y.current=!0,R(!0);const q=setTimeout(()=>{H.current===q&&(H.current=null);let K;try{K=W?W():void 0}catch{z();return}K&&typeof K.then=="function"&&K.then(()=>{setTimeout(z,120)},z)},$?0:b4);ie&&(H.current=q)},[z,$]),S=o.useCallback(()=>{m||_&&_()===!1||V(C,!0)},[V,C,m,_]),P=o.useRef(S);o.useEffect(()=>{P.current=S});const F=!v&&!!C;o.useEffect(()=>{if(F)return Gn(()=>P.current())},[F]);const X=F&&g,se=o.useRef(!1),ae=W=>{se.current=W.target===W.currentTarget},me=W=>{const ie=se.current;se.current=!1,ie&&W.target===W.currentTarget&&S()},ne=n.jsx("div",{className:`popup ${v?"popup--inline":""} ${k==="belowPagePopup"?"popup--below-page-popup":""} ${I?"popup--closing":""} ${A}`,onPointerDown:X?ae:void 0,onClick:X?me:void 0,onMouseDown:v?void 0:W=>{W.target===W.currentTarget&&W.preventDefault()},children:n.jsxs("div",{ref:M,className:`popup-panel${B?` popup-panel--${B}`:""}${E!=null?" popup-panel--has-height":""}${D?" popup-panel--fill-body":""}`,style:E!=null?{"--popup-height":typeof E=="number"?`${E}px`:E}:void 0,tabIndex:-1,role:v?void 0:"dialog","aria-modal":v?void 0:!0,"aria-labelledby":!v&&w&&a?T:void 0,"aria-label":!v&&!(w&&a)?y??(typeof a=="string"?a:void 0):void 0,children:[!w&&(l||C)?n.jsxs("div",{className:"popup-close-float",children:[l,C&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:m,ariaLabel:t("common.close","\uB2EB\uAE30")})]}):a||l||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:T,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:T,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),s&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(bn,{size:40,ariaLabel:s.ariaLabel,options:s.options.map(W=>({key:W.key,label:W.label,disabled:W.disabled})),value:s.value,onChange:s.onChange})}),n.jsxs("div",{className:"popup-header-actions",children:[l,C&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:m,ariaLabel:t("common.close","\uB2EB\uAE30")})]})]}):null,n.jsx("div",{className:"popup-content",ref:L,tabIndex:Z?0:void 0,children:n.jsx("div",{className:"popup-content__inner",children:typeof i=="function"?i({animateThen:V,closeWithAnimation:S}):i})}),p!=null&&p!==!1&&n.jsx("div",{className:`popup-footer-note caption-1${f?" popup-footer-note--divider":""}`,role:"note",children:p}),d||h?n.jsxs("div",{className:`popup-footer popup-footer--bar${b?` ${b}`:""}`,children:[n.jsx("div",{className:"popup-footer__start",children:typeof d=="function"?d({animateThen:V,closeWithAnimation:S}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof h=="function"?h({animateThen:V,closeWithAnimation:S}):h})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${x!=="center"?` popup-footer--${x}`:""}`,children:u.map((W,ie)=>n.jsx(Ce,{htmlType:"button",size:48,variant:W.variant??"default",label:W.label,disabled:W.disabled,onClick:()=>W.onClick?.({animateThen:V,closeWithAnimation:S})},ie))}):c?n.jsx("div",{className:`popup-footer${x!=="center"?` popup-footer--${x}`:""}${b?` ${b}`:""}`,children:typeof c=="function"?c({animateThen:V,closeWithAnimation:S}):c}):null]})});return v||typeof document>"u"?ne:nn.createPortal(ne,document.body)}function br(e){return String(e)}const yr=["o","triangle","x"];function Uu(e,t){return e===t?null:t}const Gu={o:"circle",triangle:"triangle",x:"x"},Ku={o:"main",triangle:"warn",x:"danger"};function y4(e){let t=0,a=0,r=0;for(const s of Object.values(e))s==="o"?t++:s==="triangle"?a++:s==="x"&&r++;const l=t+a+r;return{marked:l,o:t,triangle:a,x:r,rate:l===0?null:(t+a*.5)/l}}function Jo(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function Yu(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function v4(e,t){return!t&&e>0}const ga={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 x4(e="landscape"){St("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}=ga[e],l=document.createElement("style");l.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(l);const s=()=>{document.head.removeChild(l),window.removeEventListener("afterprint",s)};window.addEventListener("afterprint",s),window.print()}function Zu(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let l=0;l<e.length;l+=a)r.push(e.slice(l,l+a));return r}const _4={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}},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}}};function w4(e,t){const a=_4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),l=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let s,i;return e==="landscape"?(i=l,s=Math.ceil(r/i)):(s=l,i=Math.ceil(r/s)),(e==="landscape"?s<i:i<s)&&([s,i]=[i,s]),{cols:s,rows:i}}const B4={show:"word-table-block__content--cut-show",dashed:"",corner:"word-table-block__content--cut-corner",hide:""},Xu={\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"},Ju={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},Qo={\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"},es={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function Qu(e){return Object.fromEntries(Object.entries(Xu).map(([t,a])=>[t,Qo[t]?e(`wordTable.pos.${Qo[t]}`,{defaultValue:a}):a]))}function ec(e){return Object.fromEntries(Object.entries(Ju).map(([t,a])=>[t,es[t]?e(`wordSearch.filter.type.${es[t]}`,{defaultValue:a}):a]))}const k4={pos:Qo,wordType:es};function ts(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function tc(e,t,a,r){if(r!=="dashed")return{};const l=e%t,s=Math.floor(e/t),i=l<t-1,u=s<a-1;if(!i&&!u)return{};const c="#ddd",d=b=>`repeating-linear-gradient(to ${b}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,h=[],p=[],f=[];return i&&(h.push(d("bottom")),p.push("1px 100%"),f.push("right center")),u&&(h.push(d("right")),p.push("100% 1px"),f.push("center bottom")),{backgroundImage:h.join(", "),backgroundSize:p.join(", "),backgroundPosition:f.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const A4=280,N4=240,E4=280,D4=400,S4=120,j4=280;function nc(e,t){const a=o.useRef(null),[r,l]=o.useState(1),[s,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,f=Math.min(1,h,p);l(f),i(Math.max(0,(c-e*f)/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:s}}const T4=24,M4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},L4=400,ac=8;function rc({label:e,subLabel:t,colloquialLabel:a,homonum:r,showWord:l=!0,showImage:s=!0,showPronunciation:i=!0,showColloquial:u=!0,buttonSize:c=40,wordInfo:d,outerScale:h=1}){const{t:p}=xe.useTranslation(),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,m]=o.useState(1),[_,g]=o.useState(!1),[A,y]=o.useState({for:"",url:""}),[w,v]=o.useState(null),B=t&&t.length>0?t:Gf()?.(e,r)??"",k=sa()?.(e,r)??"",{imgRef:E,loading:D,failed:N,onLoad:I,onError:R}=Zo(k),Y=o.useCallback(()=>v(b.current?.getBoundingClientRect()??null),[]),M=o.useCallback(()=>v(null),[]),T=bo(!!w,P=>{P?Y():M()},b),L=o.useMemo(()=>{if(!d)return null;const P=[];return d.grade&&P.push(p("wordTable.info.grade",{n:d.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),d.syllables&&P.push(p("wordTable.info.syllables",{n:d.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),d.pos&&P.push(p("wordTable.info.pos",{v:ts(d.pos,Qu(p)),defaultValue:"\uD488\uC0AC: {{v}}"})),d.wordType&&P.push(p("wordTable.info.wordType",{v:ts(d.wordType,ec(p)),defaultValue:"\uC720\uD615: {{v}}"})),P.length?P:null},[d,p]),Z=B||e,G=A.for===Z?A.url:"";o.useEffect(()=>{const P=Na(),F=B||e;if(!P||!F)return;let X=!1;return Promise.resolve(P(F)).then(se=>{!X&&se&&y({for:F,url:se})}),()=>{X=!0}},[B,e]);const O=o.useRef(null),U=o.useRef(null);o.useEffect(()=>()=>{x.current?.pause(),U.current?.()},[]);const $=o.useCallback(P=>{if(P.stopPropagation(),_){O.current?.();return}if(!G)return;g(!0);const F=hr(G,()=>{g(!1),U.current?.()});x.current=F.el,O.current=F.stop,U.current=dr(F.stop)},[_,G]),H=s&&!!k&&!N,z=H&&l?A4:H?E4:N4,V=H&&l?D4:H?j4:S4;o.useEffect(()=>{const P=f.current;if(!P||typeof ResizeObserver>"u")return;const F=new ResizeObserver(([X])=>{const{width:se,height:ae}=X.contentRect;m(Math.min(se/z,ae/V))});return F.observe(P),()=>F.disconnect()},[z,V]);const S=c*h<T4;return n.jsxs("div",{ref:f,className:_e("word-table-cell",S&&"word-table-cell--tap-too-small",H?"word-table-cell--with-image":""),"data-ref-w":z,"data-ref-h":V,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${C})`},children:[H&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[D&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:E,className:"word-table-cell__image",src:k,alt:e,draggable:!1,style:{opacity:D?0:1},onLoad:I,onError:R})]}),l&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),i&&B&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",B,"]"]}),u&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":G,children:[n.jsx("span",{"data-play-state":"play",style:{display:_?"none":void 0},children:n.jsx(Ce,{htmlType:"button",size:c,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:p("common.play","\uC7AC\uC0DD"),ariaLabel:e?p("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):p("common.play","\uC7AC\uC0DD"),onClick:$})}),n.jsx("span",{"data-play-state":"pause",style:{display:_?void 0:"none"},children:n.jsx(Ce,{htmlType:"button",size:c,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:p("common.pause","\uBA48\uCDA4"),ariaLabel:e?p("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):p("common.pause","\uBA48\uCDA4"),onClick:$})})]}),d&&n.jsxs("div",{ref:b,className:"word-table-cell__info-button",onPointerEnter:P=>{ca(P)||Y()},onPointerLeave:P=>{ca(P)||M()},onFocus:()=>{da()||Y()},onBlur:M,children:[n.jsx(Ce,{htmlType:"button",size:c,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:p("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:P=>{P.stopPropagation(),T.touchPress()}}),w&&L&&n.jsx(Kn,{anchorRect:w,items:L,showIndex:!1})]})]})}function ba({title:e,titleIcon:t,disc:a,className:r,orientation:l="landscape",contentTypes:s=["image","word","standardPron"],cutLine:i="show",showOutline:u=!0,showDivLine:c=!0,items:d,editCells:h,count:p,activeCell:f=null,onActivateCell:b,onRemoveCell:x,onRemoveItem:C,onReorder:m,renderCellAction:_,showFillerAdd:g=!1,contentRef:A,buttonSize:y=40,brand:w,code:v,pageNumber:B,pageNumberPosition:k="right",fitHeight:E=!1,scoring:D=!1,marks:N,onMarkClick:I,scoreIndexOffset:R=0}){const Y=o.useCallback((Ae,$e)=>{I?.(R+Ae,$e)},[I,R]),M=(Ae,$e)=>{const Se=N?.[br(R+Ae)]??null;return n.jsx("div",{className:_e("word-table-cell__score",Se?"word-table-cell__score--marked":""),style:Ve>1?{transform:`translateX(-50%) scale(${Ve})`,transformOrigin:"bottom center"}:void 0,children:yr.map(Xe=>n.jsx("span",{className:_e("word-table-cell__score-slot",Se===Xe?"word-table-cell__score-slot--on":""),children:n.jsx(Ce,{htmlType:"button",size:y,type:"dot",shape:"pill",icon:Gu[Xe],variant:Se===Xe?Ku[Xe]:"default",selected:Se===Xe,useBorder:!1,...Ne?{}:{tabIndex:-1,role:"img"},showTooltipInfo:T(`wordTable.scoring.markName.${Xe}`,{defaultValue:Xe}),ariaLabel:T(`wordTable.scoring.${Xe}`,{word:$e,defaultValue:`${$e} ${Xe}`}),onClick:Ne?gt=>{gt.stopPropagation(),Y(Ae,Xe)}:void 0})},Xe))})},{t:T}=xe.useTranslation(),L=h!==void 0,Z=e!=null||!!t||!!a,G=un("(max-width: 767px)"),O=o.useRef(null),[U,$]=o.useState(null),H=d?.length??0,[z,V]=o.useState(null),[S,P]=o.useState(""),F=o.useRef(null),X=o.useRef(null),se=o.useRef(null),ae=o.useRef(null),me=o.useCallback(Ae=>{X.current=Ae,typeof A=="function"?A(Ae):A&&(A.current=Ae)},[A]),ne=o.useCallback((Ae,$e)=>{F.current=$e,m?.(Ae,$e),P(T("wordTable.reorder.moved",{n:$e+1,total:H,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[m,T,H]);o.useEffect(()=>{const Ae=F.current;Ae!=null&&(F.current=null,X.current?.querySelectorAll(".word-table-block__card:not(.word-table-block__card--filler)")?.[Ae]?.querySelector(".word-table-block__card-handle button")?.focus())}),o.useEffect(()=>()=>{ae.current?.()},[]);const W=o.useCallback((Ae,$e)=>{if(!m||!Ae.altKey||Ae.ctrlKey||Ae.metaKey)return;const Se=Ae.key==="ArrowRight";if(!Se&&Ae.key!=="ArrowLeft")return;Ae.preventDefault();const Xe=$e+(Se?1:-1);Xe<0||Xe>=H||ne($e,Xe)},[m,H,ne]),ie=o.useCallback((Ae,$e)=>{if(!m||Ae.pointerType==="mouse")return;const Se=Ae.target.closest?.("button");if(Se&&!Se.closest(".word-table-block__card-handle"))return;ae.current?.();const Xe={x:Ae.clientX,y:Ae.clientY};let gt=!1;const nt=re=>{gt&&re.cancelable&&re.preventDefault()};let Je=null,_t=null;const mt=()=>{const re=_t;if(!re)return;const Ee=document.elementFromPoint?.(re.x,re.y)?.closest?.("[data-wordtable-cell]"),Qe=Ee?Number(Ee.dataset.wordtableCell):NaN,qe=Number.isInteger(Qe)?Qe:null;se.current=qe,$(rt=>rt===qe?rt:qe)},wt=re=>{if(!gt){(Math.abs(re.clientX-Xe.x)>ac||Math.abs(re.clientY-Xe.y)>ac)&&Ke();return}if(_t={x:re.clientX,y:re.clientY},typeof requestAnimationFrame>"u"){mt();return}Je===null&&(Je=requestAnimationFrame(()=>{Je=null,mt()}))},vt=()=>{Je!==null&&(cancelAnimationFrame(Je),Je=null,mt());const re=se.current,Ee=gt;Ke(),Ee&&re!=null&&re!==$e&&ne($e,re)},bt=setTimeout(()=>{gt=!0,V($e),se.current=$e,$($e),window.addEventListener("touchmove",nt,{passive:!1})},L4);function Ke(){clearTimeout(bt),window.removeEventListener("pointermove",wt),window.removeEventListener("pointerup",vt),window.removeEventListener("pointercancel",vt),window.removeEventListener("touchmove",nt),gt=!1,Je!==null&&(cancelAnimationFrame(Je),Je=null),se.current=null,ae.current=null,V(null),$(null)}ae.current=Ke,window.addEventListener("pointermove",wt),window.addEventListener("pointerup",vt),window.addEventListener("pointercancel",vt)},[m,ne]),{width:q,height:K}=ga[l],ce=typeof E=="number"?E:E&&typeof E=="object"?G?E.narrow:E.wide:null,{scalerRef:ke,scale:ye,offset:de}=nc(q,E?K:void 0),oe=L?h?.length??0:d?.length??0,ge=Math.max(p??oe,1),{cols:he,rows:pe}=w4(l,ge),Me={word:s.length===0||s.includes("word"),image:s.length===0||s.includes("image"),pron:s.length===0||s.includes("standardPron"),colloq:s.length===0||s.includes("colloquialPron")},ze=L?(h??[]).some(Ae=>Ae!==null&&Ae.length>1):(d??[]).some(Ae=>(Ae.words??[]).length>1),Le=!!w?.show,Fe=!!w?.show&&w?.top!==!1,We=!!w?.show&&w?.bottom!==!1,pt=w?.copyright??"\xA9 IHAB, Inc. All rights reserved.",it=_e("word-table-block__content",B4[i],u&&"word-table-block__content--outline",c&&ze&&"word-table-block__content--div-line",!Le&&B&&k!=="none"&&"word-table-block__content--page-number",Fe&&"word-table-block__content--brand-top",We&&"word-table-block__content--brand-bottom"),at={transform:`scale(${1/ye})`,transformOrigin:"center center"},ht=y*yr.length+4*(yr.length-1),Ne=!!I,Ve=Ne?Math.max(1,Math.min(1/ye,q/he/ht)):1,we=n.jsxs("div",{ref:ke,className:"word-table__scaler",style:{height:K*ye},children:[n.jsx("div",{className:_e("word-table",D&&!Ne&&"word-table--score-readonly",!Z&&r),style:{width:q,height:K,transform:`scale(${ye})`,transformOrigin:"top left",marginLeft:de},children:n.jsxs("div",{ref:me,className:it,style:{gridTemplateColumns:`repeat(${he}, 1fr)`,gridTemplateRows:`repeat(${pe}, 1fr)`},children:[L?n.jsx(n.Fragment,{children:(h??[]).map((Ae,$e)=>n.jsx("div",{className:_e("word-table-block__edit-cell",Ae?"word-table-block__edit-cell--filled":"word-table-block__edit-cell--empty",f===$e?"word-table-block__edit-cell--active":""),style:tc($e,he,pe,i),children:Ae?n.jsxs(n.Fragment,{children:[Ae.map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(rc,{outerScale:ye,label:Se.word,subLabel:Se.pronunciation,colloquialLabel:Se.colloquialPronunciation,homonum:Se.homonum,showWord:Me.word,showImage:Me.image,showPronunciation:Me.pron,showColloquial:Me.colloq,buttonSize:y})]},Xe)),D&&M($e,Ae.map(Se=>Se.word).join(" / ")),x&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(Ce,{htmlType:"button",size:y,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:Ae.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:Ae.length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>x($e)})})]}):b&&n.jsx("div",{style:at,children:n.jsx(Ce,{htmlType:"button",size:"48",type:"bar",icon:"plus",label:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>b($e)})})},$e))}):n.jsxs(n.Fragment,{children:[(d??[]).map((Ae,$e)=>n.jsxs("div",{"data-wordtable-cell":m?$e:void 0,className:`word-table-block__card${m?" word-table-block__card--draggable":""}${U===$e?" word-table-block__card--drag-over":""}${z===$e?" word-table-block__card--dragging":""}`,style:tc($e,he,pe,i),draggable:!!m,onPointerDown:m?Se=>ie(Se,$e):void 0,onKeyDown:m?Se=>W(Se,$e):void 0,onDragStart:m?()=>{O.current=$e}:void 0,onDragOver:m?Se=>{Se.preventDefault(),$($e)}:void 0,onDragLeave:m?()=>$(null):void 0,onDrop:m?Se=>{Se.preventDefault(),O.current!==null&&O.current!==$e&&m(O.current,$e),O.current=null,$(null)}:void 0,onDragEnd:m?()=>{O.current=null,$(null)}:void 0,children:[(Ae.words??[]).map((Se,Xe)=>n.jsxs(o.Fragment,{children:[Xe>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(rc,{outerScale:ye,label:Se.label,subLabel:Se.subLabel,colloquialLabel:Se.colloquialLabel,homonum:Se.homonum,showWord:Me.word,showImage:Me.image,showPronunciation:Me.pron,showColloquial:Me.colloq,buttonSize:y,wordInfo:Se.grade||Se.syllables!=null||Se.pos||Se.wordType?{grade:Se.grade,syllables:Se.syllables,pos:Se.pos,wordType:Se.wordType}:void 0})]},Xe)),D&&M($e,(Ae.words??[]).map(Se=>Se.label).join(" / ")),m&&n.jsx("div",{className:"word-table-block__card-handle",children:n.jsx(Ce,{htmlType:"button",size:y,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:(Ae.words??[]).map(Se=>Se.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})}),(_||C)&&n.jsxs("div",{className:"word-table-block__card-actions",children:[_?.($e,Ae),C&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(Ce,{htmlType:"button",size:y,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(Ae.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(Ae.words??[]).length>1?T("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):T("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>C(Ae.id)})})]})]},Ae.id)),Array.from({length:Math.max(0,he*pe-(d?.length??0))}).map((Ae,$e)=>{const Se=(d?.length??0)+$e<ge;return n.jsx("div",{className:"word-table-block__card word-table-block__card--filler",children:g&&b&&Se&&n.jsx("div",{style:at,children:n.jsx(Ce,{htmlType:"button",size:y,type:"bar",icon:"plus",label:T("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>b((d?.length??0)+$e)})})},`filler-${$e}`)})]}),Fe&&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:w?.topLogo?.src??cr,alt:w?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const Ae=[w?.title&&n.jsx("span",{className:"word-table__paper-title",children:w.title},"t"),w?.owner&&n.jsx("span",{className:"word-table__owner",children:w.owner},"o"),v&&n.jsx("span",{className:"word-table__code",children:v},"c")].filter(Boolean);return Ae.length===0?null:n.jsx("span",{className:"word-table__ident",children:Ae.map(($e,Se)=>n.jsxs(o.Fragment,{children:[Se>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),$e]},Se))})})()]})}),We&&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:[w?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:w.bottomLogo.src,alt:w.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:pt})]}),n.jsxs("span",{className:"word-table__band-end",children:[w?.link&&n.jsx("span",{className:"word-table__link",children:w.link}),B&&k!=="none"&&n.jsx("span",{className:"word-table__page-count",children:T("wordTable.filter.pageIndicator",{current:B.current,total:B.total})})]})]})}),!Le&&B&&k!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${k}`,children:T("wordTable.filter.pageIndicator",{current:B.current,total:B.total})})]})}),m&&n.jsx("span",{role:"status",style:M4,children:S})]}),Ue=ce==null?we:n.jsx("div",{className:"word-table__frame",style:{height:ce},children:we});return Z?n.jsx(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",r),children:Ue}):Ue}function $4(e,t,a){const r=[];for(const l of e??[]){if(l.type==="note"||l.type==="input")continue;const s=l.displayLabel??l.label,i=R4(l,t?.[l.label],a);i!==null&&r.push(`${s} ${i}`)}return r.join(" \xB7 ")}function R4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(l=>l!==fn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(l=>P4(e,l)).join(", ")}function P4(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 En({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:l=!1,defaultCollapsed:s=!1,collapsed:i,onCollapsedChange:u,footer:c,sections:d,selected:h={},onSelect:p,align:f,sectionAlign:b,className:x}){const C=(f??(b==="vertical"?"newline":"inline"))==="inline",{t:m}=xe.useTranslation(),[_,g]=o.useState(s),A=i??_,y=()=>{const N=!A;g(N),u?.(N)},w=N=>{if(!l)return;const I=N.target;!I||typeof I.closest!="function"||I.closest(".filter-panel__collapse-toggle")||I.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||y()},v=o.useMemo(()=>r!==void 0||!A?"":$4(d,h,m("common.all","\uC804\uCCB4")),[r,A,d,h,m]),B=r??(v?n.jsx("span",{className:"filter-panel__header-summary body-3",children:v}):null),k=e||a||r||l,E=o.useId(),D=t?`h${t}`:"span";return n.jsxs("div",{className:_e("filter-panel",l?"filter-panel--collapsible":"",A?"filter-panel--collapsed":"",x),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?E:void 0,children:[k&&n.jsxs("div",{className:"filter-panel__header",onClick:l?w:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(D,{id:E,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[A?B:a,l&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:A?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:A?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),showTooltipInfo:A?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),"aria-expanded":!A,onClick:y})]})]}),!A&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:_e("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(N=>{const I=h[N.label],R=I===void 0||(Array.isArray(I)?I.length===0:!1),Y=(N.items??[]).filter(T=>T!=null);N.allOption&&Y.some(T=>(typeof T=="string"?T:T.value)===fn)&&St(`filter-panel-all-value:${N.label}`,`[FilterPanel] '${N.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${fn}' \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=T=>{const L=typeof T=="string"?T:T.value,Z=typeof T!="string"&&!!T.disabled,G=typeof T!="string"?T.labels:void 0,O=typeof T!="string"?T.displayLabel:void 0,U=typeof T!="string"?T.tooltip:void 0,$=typeof T!="string"?T.descriptionTooltip:void 0,H=typeof T!="string"?T.shape:void 0,z=Array.isArray(I)?I.includes(L):I===L;return n.jsx(Ce,{htmlType:"button",size:"keyboard",label:G??O??L,type:N.itemType??(G?"bar":L.length===1?"dot":void 0),selected:z,disabled:Z,shape:H,showTooltipInfo:!!U,tooltipInfoText:U,tooltipDescription:$,onClick:()=>p?.(L,N.label)},L)};return n.jsxs(o.Fragment,{children:[N.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:N.groupLabel}),N.groupAction]}),n.jsxs("div",{className:_e("filter-panel__section",N.layout==="row"?"filter-panel__section--row":"",N.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:N.displayLabel??N.label}),N.labelAction??(N.labelInfo?n.jsx(Ha,{...N.labelInfo}):null)]}),N.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:N.content}):N.type==="input"?n.jsx(Xn,{className:"filter-panel__textfield",placeholder:N.placeholder,ariaLabel:N.displayLabel??N.label,value:h[N.label]??"",onChange:T=>p?.(T,N.label),error:N.error}):!N.multiple&&N.display==="segmented"?n.jsx(bn,{ariaLabel:N.displayLabel??N.label,options:[...N.allOption?[{key:fn,label:N.allLabel??m("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...Y.map(T=>{const L=typeof T=="string"?T:T.value,Z=typeof T!="string"?T.displayLabel:void 0,G=typeof T!="string"?T.disabled:void 0;return{key:L,label:Z??L,disabled:G}})],value:R&&N.allOption?fn:h[N.label]??"",onChange:T=>p?.(T,N.label),size:32}):!N.multiple&&N.display==="dropdown"?n.jsx(cn,{className:"filter-panel__dropdown",ariaLabel:typeof N.label=="string"?N.label:void 0,size:40,options:[...N.allOption?[{value:fn,label:N.allLabel??m("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...Y.map(T=>{const L=typeof T=="string"?T:T.value,Z=typeof T!="string"?T.displayLabel:void 0,G=typeof T!="string"?T.disabled:void 0;return{value:L,label:Z??L,disabled:G}})],value:R&&N.allOption?fn:h[N.label],onChange:T=>p?.(T,N.label)}):n.jsxs("div",{className:N.groups?"filter-panel__item-groups":"filter-panel__items",children:[N.allOption&&!N.groups&&n.jsx(Ce,{htmlType:"button",size:"keyboard",label:N.allLabel??m("common.all","\uC804\uCCB4"),selected:R,disabled:N.allOptionDisabled,onClick:()=>p?.(fn,N.label)}),N.groups?N.groups.map((T,L)=>n.jsxs("div",{className:"filter-panel__item-group",children:[L===0&&N.allOption&&n.jsx(Ce,{htmlType:"button",size:"keyboard",label:N.allLabel??m("common.all","\uC804\uCCB4"),selected:R,disabled:N.allOptionDisabled,onClick:()=>p?.(fn,N.label)}),T.filter(Z=>Z!=null).map(M)]},L)):Y.map(M)]})]})]},N.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const I4=[1,2,3,4,5,6,7,8,9,10,11,12],oc=[8,4,2,1],sn="show",vn="hide";function sc(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:"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 lc(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 ic(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function uc(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function cc(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function dc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:sn,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:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function pc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function hc(e,t){return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[t.itemCount,...oc.filter(a=>a<t.itemCount)].map(a=>({value:`${a}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:a})})),display:"segmented"}}function mc(e,t){return e===t||!oc.includes(e)?Number.POSITIVE_INFINITY:e}function F4(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:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function fc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function Cc(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?sn:vn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?sn:vn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?sn:vn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?sn:vn}:{}}}function gc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===fn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(l=>l.includes(t)?l.filter(s=>s!==t):[...l,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===sn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===sn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===sn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===sn),!0):!1}function O4(e){return"sections"in e}function ns(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c};if(O4(e))return n.jsx(En,{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,contentTypes:f,orientation:b,showOutline:x,cutLine:C,showDivLine:m,setters:_,showCutLine:g=!1,showDivLine2:A=!1,middleSections:y=[],extraSelected:w={},onExtraSelect:v,showPaperBands:B=!1,showTopInfo:k=!0,showBottomInfo:E=!0}=e,D=[sc(t,{hasImage:h,hasColloquial:p}),lc(t),...y,ic(t),...g?[dc(t)]:[],...A?[pc(t)]:[],...B?[uc(t),cc(t)]:[]],N={...Cc(t,{contentTypes:f,orientation:b,showOutline:x,cutLine:C,showDivLine:m,showTopInfo:k,showBottomInfo:E}),...w},I=(R,Y)=>{gc(t,R,Y,_)||v?.(R,Y)};return n.jsx(En,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:D,selected:N,onSelect:I,...d,sectionAlign:"horizontal"})}function as(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function z4(e){return as(e).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function rs(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let vr=null,ya=null;function W4(e,t,a,r="",l=""){if(e.length===0||ya&&ya.iframe.isConnected&&Date.now()-ya.at<1e4)return;const s=r?rs(r):"";vr?.();let i=null;if(s){const d=document.title;document.title=s,i=()=>{document.title=d,window.removeEventListener("afterprint",i),vr===i&&(vr=null)},vr=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}ya={iframe:u,at:Date.now()},c.open(),c.write(os(e,t,a,!0,s,l)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{i?.(),setTimeout(()=>{u.remove(),ya?.iframe===u&&(ya=null)},0)})}function os(e,t,a,r=!1,l="",s=""){l=l?rs(l):"";const i=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(f=>f.cssText)}catch{return[]}}).join(`
860
+ `),C=x===-1?a:a.slice(0,x);s("comment",C),a=a.slice(C.length);continue}const u=a.match(/^\/\*[\s\S]*?\*\//);if(u){s("comment",u[0]),a=a.slice(u[0].length);continue}const c=a.match(/^(`(?:\\.|[^`])*`|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/);if(c){s("string",c[0]),a=a.slice(c[0].length);continue}const d=a.match(/^\d+(?:\.\d+)?/);if(d){s("number",d[0]),a=a.slice(d[0].length);continue}const h=a.match(wv);if(h){s("keyword",h[0]),a=a.slice(h[0].length);continue}const p=a.match(/^[A-Za-z_$][A-Za-z0-9_$-]*/);if(p){const x=p[0];s(l&&_v.has(x)?"command":"identifier",x),a=a.slice(x.length);continue}const f=a.match(/^[=+\-*/%<>!&|^~?:]+/);if(f){s("operator",f[0]),a=a.slice(f[0].length);continue}const b=a.match(/^[()[\]{};.,]/);if(b){s("punctuation",b[0]),a=a.slice(1);continue}s("other",a[0]),a=a.slice(1)}return r}function kv({children:e,language:t="bash",title:a="",showCopy:r=!0,size:l="default",className:s=""}){const{t:i}=xe.useTranslation(),[u,c]=o.useState(!1),d=xv(yu(e)),h=o.useRef(null);o.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const p=async()=>{try{if(!await HC(d))return;c(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>c(!1),2e3)}catch{}},f=Bv(d,t),b=l==="small"?"caption-1":"body-3";return n.jsxs("div",{className:_e("code-box",l==="small"?"code-box--small":"",s),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:f.map((x,C)=>n.jsx("span",{className:`code-token ${x.type} ${b}`,children:x.content},C))})})]})}const Av={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function Ga(e){const{t}=xe.useTranslation(),{variant:a="spinner",size:r=24,progress:l=null,label:s}=e||{},i=s||t("loader.loading","Loading");if(a==="bar"){const c=l==null||!Number.isFinite(Number(l)),d=c?0:Math.max(0,Math.min(100,Number(l)));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:Av,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"})]})]})}function vu({checked:e,onChange:t,disabled:a=!1,label:r,ariaLabel:l,labelPosition:s="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:[s==="left"&&c,n.jsx("input",{id:u,type:"checkbox",role:"switch",checked:e,disabled:a,onChange:d=>t?.(d.target.checked),"aria-label":!r&&l?l:void 0}),n.jsx("span",{className:"toggle__slider"}),s==="right"&&c]})}function xu({checked:e=!1,onChange:t,disabled:a,indeterminate:r,label:l,size:s="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:_e("checkbox",s==="small"&&"checkbox--small",s==="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:f=>{t?.(f.target.checked),d.current&&(d.current.indeterminate=p.current)},disabled:a,"aria-label":!l&&c?c:void 0}),n.jsx("span",{className:"checkbox__box"}),l&&n.jsx("span",{className:"checkbox__label body-3",children:l})]})}function Nv({count:e,actions:t,onClear:a,clearLabel:r,visible:l,content:s,max:i}){const{t:u}=xe.useTranslation(),c=l!==void 0?l:e>0,d=r??u("bulkBar.clearSelection","\uC120\uD0DD \uD574\uC81C"),h=o.useRef(null),p=o.useRef(null),f=o.useRef(null),b=o.useRef(c);o.useLayoutEffect(()=>{const g=p.current,A=b.current;if(b.current=c,c&&!A){const y=typeof document<"u"?document.activeElement:null;f.current=y&&y!==document.body&&!g?.contains(y)?y:null}else!c&&A&&g&&g.contains(document.activeElement)&&sr(g,f.current)},[c]);const[x,C]=o.useState(!1),m=o.useRef(!1),_=o.useRef(null);return o.useEffect(()=>{const g=h.current;if(!g)return;const A=E=>{m.current=E,C(E)},y=()=>{const E=g.firstElementChild??g,D=Array.from(E.children);if(D.length<2){A(!1);return}const N=D[0].offsetTop,I=D.some(L=>L.offsetTop!==N);if(!m.current){_.current=g.clientWidth,I&&A(!0);return}if(I)return;const P=D[0],K=D[D.length-1],T=K.offsetLeft+K.offsetWidth-P.offsetLeft,M=_.current;(M==null||T<=M)&&A(!1)};if(y(),typeof ResizeObserver>"u")return;const w=new ResizeObserver(y);w.observe(g);const v=g.parentElement;let B=v?.clientWidth??0;const k=new ResizeObserver(()=>{const E=v?.clientWidth??0;E!==B&&(B=E,_.current=null,y())});return v&&k.observe(v),()=>{w.disconnect(),k.disconnect()}},[s,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:s??n.jsx("b",{children:u("common.selectedCount",{count:e})})}),i!==void 0&&n.jsx(Et,{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${x?" bulk-bar__actions--stacked":""}`,children:[n.jsx(fe,{htmlType:"button",size:40,label:d,onClick:a}),t.map((g,A)=>n.jsx(fe,{htmlType:"button",size:40,variant:g.variant??"default",icon:g.icon,label:g.label,onClick:g.onClick},A))]})]})}const Ev=[{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 Dv(e){const{onClose:t,className:a}=e;return n.jsx("div",{className:_e("item-actions",a),children:Ev.map(({key:r,icon:l,closeFirst:s})=>{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:l,ariaLabel:u.label,showTooltipInfo:u.label,onClick:()=>{s&&t(),u.onClick()}},r)})})}function _u(e,t){const a=()=>{if(e){const[C,m]=e.split("-");return{y:+C,m:+m-1}}const[b,x]=oo(t).split("-");return{y:+b,m:+x-1}},[r,l]=o.useState(()=>a().y),[s,i]=o.useState(()=>a().m),u=o.useRef(e);o.useEffect(()=>{if(e===u.current)return;u.current=e;const b=a();l(b.y),i(b.m)},[e]);const c=o.useRef({y:r,m:s});o.useEffect(()=>{c.current={y:r,m:s}},[r,s]);const d=o.useCallback(b=>{const x=c.current.y*12+c.current.m+b,C=Math.floor(x/12),m=x-C*12;c.current={y:C,m},l(C),i(m)},[]),h=o.useCallback(()=>d(-1),[d]),p=o.useCallback(()=>d(1),[d]),f=o.useCallback((b,x)=>{c.current={y:b,m:x},l(b),i(x)},[]);return{viewY:r,viewM:s,prevMonth:h,nextMonth:p,setViewYM:f}}function fr(e,t){return new Date(e,t+1,0).getDate()}function Sv(e,t){return new Date(e,t,1).getDay()}function Ka(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function jv(e){if(!e)return"";const[t,a,r]=e.split("-");return`${t}. ${a}. ${r}.`}function Tv(e){const t=e.replace(/\D/g,"");if(t.length!==8)return null;const a=+t.slice(0,4),r=+t.slice(4,6),l=+t.slice(6,8);if(r<1||r>12||l<1||l>31)return null;const s=new Date(a,r-1,l);return s.getFullYear()!==a||s.getMonth()!==r-1||s.getDate()!==l?null:Ka(a,r-1,l)}const Mv=1900;function Lv(e,t,a,r,l){const s=r?+r.split("-")[0]:Math.min(Mv,e),i=l?+l.split("-")[0]:Math.max(t+10,e),u=[];for(let c=s;c<=i;c++)u.push({value:String(c),label:a(c)});return u}function wu(e,t,a,r){const l=[];for(let s=1;s<=12;s++){const i=`${e}-${String(s).padStart(2,"0")}`;a&&i<a.slice(0,7)||r&&i>r.slice(0,7)||l.push({value:String(s),label:t(e,s)})}return l}function $v({value:e,onChange:t,size:a=48,min:r,max:l,disabled:s,placeholder:i,className:u,today:c}){const{t:d,i18n:h}=xe.useTranslation(),p=i??d("datePicker.chooseDate","\uB0A0\uC9DC \uC120\uD0DD"),f=o.useMemo(()=>d("calendar.dow",{returnObjects:!0}),[d]),b=oo(c),{viewY:x,viewM:C,prevMonth:m,nextMonth:_,setViewYM:g}=_u(e,c),A=o.useId(),y=o.useCallback((W,ie)=>{const q=window.innerHeight,G=window.innerWidth,de=typeof document<"u"?document.getElementById(A):null,Ee=Math.max(de?.offsetHeight||0,de?.scrollHeight||0)||300,ye=Math.max(W.width,de?.offsetWidth||0,260),he=q-W.bottom,se=W.top,Ce=he<Ee&&se>he,ge=8,ce=(Me,Oe)=>Math.min(Math.max(ge,Me),Math.max(ge,Oe));return{position:"fixed",left:ce(W.left,G-ye-ge),width:W.width,minWidth:260,...Ce?{top:"auto",bottom:ce(q-W.top+6,q-Ee-ge)}:{bottom:"auto",top:ce(W.bottom+6,q-Ee-ge)},zIndex:Ia(ie)}},[A]),{open:w,setOpen:v,toggle:B,style:k,triggerRef:E,menuRef:D}=Fa({computeStyle:y,onScroll:"reposition",onResize:"reposition",ignoreOutsideClickSelector:".dropdown__menu"});o.useEffect(()=>{if(!w)return;const W=D.current;return(W?.querySelector(".date-picker__day--selected:not(:disabled)")??W?.querySelector(".date-picker__day--today:not(:disabled)")??W?.querySelector(".date-picker__day:not(:disabled)")??W?.querySelector(gn)??W)?.focus?.(),()=>{const ie=document.activeElement;(!ie||ie===document.body)&&E.current?.focus?.()}},[w,D,E]);const[N,I]=o.useState(1),P=o.useRef(null),K=o.useRef(null);o.useEffect(()=>{if(!w)return;const W=e&&e.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+e.slice(8):b.slice(0,7)===`${x}-${String(C+1).padStart(2,"0")}`?+b.slice(8):1;I(W)},[w]),o.useEffect(()=>{if(K.current==null)return;const W=K.current;K.current=null,P.current?.querySelector(`[data-day="${W}"]`)?.focus()}),o.useEffect(()=>{I(W=>Math.min(W,fr(x,C)))},[x,C]);const T=o.useCallback(W=>{let ie=Ka(W.getFullYear(),W.getMonth(),W.getDate());r&&ie<r&&(ie=r),l&&ie>l&&(ie=l);const[q,G,de]=ie.split("-").map(Number);(q!==x||G-1!==C)&&g(q,G-1),I(de),K.current=de},[r,l,x,C,g]),M=o.useCallback(W=>{const ie=new Date(x,C,N),q=de=>{ie.setDate(ie.getDate()+de),T(ie)},G=de=>{const Ee=ie.getFullYear()*12+ie.getMonth()+de,ye=Math.floor(Ee/12),he=Ee-ye*12;T(new Date(ye,he,Math.min(ie.getDate(),fr(ye,he))))};switch(W.key){case"ArrowLeft":q(-1);break;case"ArrowRight":q(1);break;case"ArrowUp":q(-7);break;case"ArrowDown":q(7);break;case"Home":q(-ie.getDay());break;case"End":q(6-ie.getDay());break;case"PageUp":W.shiftKey?G(-12):G(-1);break;case"PageDown":W.shiftKey?G(12):G(1);break;default:return}W.preventDefault()},[x,C,N,T]),L=o.useCallback(W=>{s||(t(Ka(x,C,W)),v(!1))},[x,C,t,v,s]);o.useEffect(()=>{s&&v(!1)},[s,v]);const Q=W=>{const ie=Ka(x,C,W);return!!(r&&ie<r||l&&ie>l)},H=(()=>{const W=fr(x,C);if(N>=1&&N<=W&&!Q(N))return N;for(let ie=1;ie<=W;ie++)if(!Q(ie))return ie;return-1})(),O=[];for(let W=0;W<Sv(x,C);W++)O.push(null);for(let W=1;W<=fr(x,C);W++)O.push(W);const U=a===64?20:a===40?16:18,$=Ol(h.language),V=W=>new Intl.DateTimeFormat($,{year:"numeric"}).format(new Date(W,0,1)),z=(W,ie)=>new Intl.DateTimeFormat($,{month:"long"}).format(new Date(W,ie-1,1)),Y=Lv(x,+b.slice(0,4),V,r,l),S=wu(x,z,r,l),R=W=>{const ie=wu(W,z,r,l);if(ie.length===0)return;const q=ie.some(G=>+G.value===C+1);g(W,q?C:+ie[0].value-1)},[F,Z]=o.useState(null);o.useEffect(()=>{Z(null)},[e]);const pe=o.useCallback(W=>{Z(W);const ie=Tv(W);if(!ie||r&&ie<r||l&&ie>l)return;t(ie);const[q,G]=ie.split("-");g(+q,+G-1)},[r,l,t,g]),re=o.useCallback(()=>{Z(null)},[]),oe=o.useCallback(W=>{W.key==="Enter"?(W.preventDefault(),re(),v(!1)):W.key==="Escape"?(re(),v(!1)):W.key==="ArrowDown"&&!w&&(W.preventDefault(),v(!0))},[re,v,w]),ae=w?nn.createPortal(n.jsxs("div",{ref:D,id:A,className:"date-picker__dropdown",style:k,"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:m,"aria-label":d("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(Rs,{size:16,strokeWidth:2})}),n.jsxs("div",{className:"date-picker__nav-ym",children:[n.jsx(cn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectYear","\uC5F0 \uC120\uD0DD"),options:Y,value:String(x),onChange:W=>R(+W),size:40}),n.jsx(cn,{className:"date-picker__nav-dropdown",ariaLabel:d("datePicker.selectMonth","\uC6D4 \uC120\uD0DD"),options:S,value:String(C+1),onChange:W=>g(x,+W-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(Ps,{size:16,strokeWidth:2})})]}),n.jsxs("div",{className:"date-picker__grid",ref:P,onKeyDown:M,children:[f.map(W=>n.jsx("div",{className:"date-picker__dow caption-1",children:W},W)),O.map((W,ie)=>{if(W===null)return n.jsx("div",{},`e${ie}`);const q=Ka(x,C,W),G=q===e,de=q===b,Ee=Q(W),ye=ie%7;return n.jsx("button",{type:"button",disabled:Ee,"data-day":W,tabIndex:W===H?0:-1,"aria-current":de?"date":void 0,onClick:()=>!Ee&&L(W),className:_e("date-picker__day caption-1",G&&"date-picker__day--selected",de&&!G&&"date-picker__day--today",Ee&&"date-picker__day--disabled",ye===0&&"date-picker__day--sun",ye===6&&"date-picker__day--sat"),children:W},W)})]})]}),document.body):null;return n.jsxs("div",{className:_e("date-picker",`date-picker--s${a}`,w&&"date-picker--open",u),children:[n.jsxs("div",{className:"date-picker__field",children:[n.jsx("input",{ref:E,type:"text",className:"date-picker__trigger body-2",value:F??jv(e),placeholder:p,onChange:W=>pe(W.target.value),onClick:()=>!s&&!w&&B(),onKeyDown:oe,onBlur:re,disabled:s,"aria-haspopup":"dialog","aria-expanded":w,inputMode:"numeric",autoComplete:"off"}),n.jsx("button",{type:"button",className:"date-picker__icon-btn",onClick:()=>!s&&B(),disabled:s,tabIndex:-1,"aria-label":p,"aria-haspopup":"dialog","aria-expanded":w,children:n.jsx(Us,{size:U,className:"date-picker__icon",strokeWidth:1.5})})]}),ae]})}function Rv({items:e,className:t,ariaLabel:a="\uC54C\uB9BC \uAE00",titleLevel:r=4,targetBytes:l}){const s=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=l===void 0?Sl(i.sms):Sl(i.sms,l),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(s,{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?`${El}\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 ${El}\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 Pv({src:e,alt:t,className:a,style:r,tone:l,textColor:s}){const i=!l&&!!s,u=Yy(e,i),c="bl"+o.useId().replace(/[^a-zA-Z0-9]/g,"");return l?n.jsx("span",{className:_e("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":l},children:n.jsx("img",{src:e,alt:"","aria-hidden":"true",className:"brand-logo__sizer",draggable:!1})}):i&&u?n.jsx("span",{className:_e("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":s},dangerouslySetInnerHTML:{__html:Gy(Uy(u),c)}}):n.jsx("img",{src:e,alt:t,className:_e("brand-logo",a),style:r,draggable:!1})}function Bu({children:e,className:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useEffect(()=>{l(a.current?.parentElement??null)},[]),o.useEffect(()=>{const s=a.current;if(!s||!r)return;const i=()=>{const c=typeof window<"u"&&window.getComputedStyle(s).position==="absolute"?Math.ceil(s.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(s),u.observe(r),()=>{u.disconnect(),r.style.removeProperty("--section-head-float-w")}},[r,e]),n.jsx("div",{ref:a,className:_e("section-head-float",t),children:e})}function Po({items:e,className:t}){return n.jsx("div",{className:t?`manager-bar-chart-legend ${t}`:"manager-bar-chart-legend",children:e.map((a,r)=>n.jsxs("span",{className:"manager-bar-chart-legend-item",children:[n.jsx("span",{className:"manager-bar-chart-legend-dot",style:{background:a.color}}),a.label]},r))})}function Ya({label:e,children:t}){return e?n.jsxs("div",{className:"barchart-total barchart-total--stacked",children:[n.jsx("span",{className:"barchart-total__label body-3",children:e}),n.jsx("span",{className:"barchart-total__value",children:t})]}):n.jsx("div",{className:"barchart-total",children:t})}function Io({title:e,titleClassName:t="h3",titleLevel:a=3,icon:r,disc:l,headRight:s,headFloat:i,headSegment:u,headMenuItems:c,collapseBelow:d=420,onClick:h,ariaLabel:p,tooltip:f,totalNum:b,totalUnit:x,totalLabel:C,subRow:m,subRowAlign:_="start",className:g,inGrid:A=!1,children:y}){const{t:w}=xe.useTranslation(),v=o.useRef(null),{anchorRect:B,openAt:k,close:E}=Pa(),D=o.useCallback(()=>{f&&v.current&&k(v.current)},[f,k]),[N,I]=o.useState(!1);$o(()=>{const S=v.current;if(!S||!u)return;const R=Z=>I(Z>0&&Z<d);if(R(S.clientWidth),typeof ResizeObserver>"u")return;const F=new ResizeObserver(Z=>R(Z[0].contentRect.width));return F.observe(S),()=>F.disconnect()},[u,d]);const[P,K]=o.useState(null),T=o.useCallback(()=>K(null),[]),M=o.useCallback(S=>{const R=S.currentTarget.getBoundingClientRect();K(F=>F?null:{left:R.left,right:R.right,top:R.top,bottom:R.bottom,width:R.width,height:R.height,x:R.x,y:R.y})},[]),L=!!u&&N;o.useEffect(()=>{L||K(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,R)=>R===0?{...S,separatorBefore:!0}:S)]:[],H=o.useCallback(S=>{if(!h)return;const R=S.target;R&&typeof R.closest=="function"&&R.closest('button, a, input, select, textarea, [role="radiogroup"]')||h()},[h]),O=o.useCallback(S=>{h&&S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},[h]),U=typeof s=="function"?s({collapsed:L}):s,$=b!=null||C?n.jsxs(Ya,{label:C,children:[b!=null&&n.jsx("span",{className:"barchart-total__num h0",children:b}),x&&n.jsx("span",{className:"barchart-total__unit h5",children:x})]}):null,V=U||u?n.jsxs("div",{className:"manager-section__head-right",children:[u&&(L?n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"ellipsis",ariaLabel:u.ariaLabel??w("common.more","\uB354\uBCF4\uAE30"),showTooltipInfo:u.ariaLabel??w("common.more","\uB354\uBCF4\uAE30"),"aria-haspopup":"menu","aria-expanded":!!P,onClick:M}):n.jsx(bn,{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})),U]}):null,z=o.useId(),Y=a?`h${a}`:"div";return n.jsxs("section",{ref:v,className:["manager-section",A&&"manager-section--grid",h&&"manager-section--clickable",g].filter(Boolean).join(" "),onClick:h?H:void 0,onKeyDown:h?O:void 0,onPointerEnter:f?D:void 0,onPointerLeave:f?E:void 0,onFocus:f?D:void 0,onBlur:f?E: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?z:void 0,children:[f&&B&&n.jsx(wn,{anchorRect:{left:B.left,top:B.top+21,right:B.right,bottom:B.bottom,width:B.width,height:B.height},text:f}),i&&n.jsx(Bu,{children:i}),n.jsxs("div",{className:"manager-section__head",children:[n.jsxs("div",{className:"manager-section__title-row",children:[r&&n.jsx(Qe,{icon:r,label:typeof e=="string"?e:void 0,className:"manager-section__icon"}),n.jsx(Y,{id:z,className:["manager-section__title",t].filter(Boolean).join(" "),children:e})]}),V,l&&n.jsx("div",{className:"manager-section__disc body-3",children:l})]}),($||m)&&n.jsxs("div",{className:["barchart-sub-row",_!=="start"&&`barchart-sub-row--${_}`].filter(Boolean).join(" "),children:[$,m]}),y,P&&n.jsx(mn,{anchorRect:P,onClose:T,ariaLabel:u?.ariaLabel??w("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:[{items:Q}],onClose:T,size:"small"})})]})}const Za=(e,t)=>`${e}-${String(t).padStart(2,"0")}`,Fo=e=>Za(e.getFullYear(),e.getMonth()+1);function ha(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 Oo=(e,t)=>`${e}#${t}`;function yn(e,t){const a=new Date(e,t,1).getDay();return 1+(8-(a===0?7:a))%7}function Iv(){const e=la();let t=e.getFullYear(),a=e.getMonth(),r=e.getDate();if(r<yn(t,a)){const i=new Date(t,a,0);t=i.getFullYear(),a=i.getMonth(),r=i.getDate()}const l=Math.floor((r-yn(t,a))/7),s=Za(t,a+1);return{monthKey:s,value:Oo(s,l)}}function Fv(e){const t=la(),a=Fo(t),r=(c,d)=>Za(c,d+1),l=new Map;l.set(a,[]);for(const c of e){if(isNaN(c.date.getTime()))continue;const d=r(c.date.getFullYear(),c.date.getMonth());l.has(d)||l.set(d,[]),l.get(d).push(c)}for(const[c,d]of[...l.entries()]){const h=ha(c);if(!h)continue;const p=h.year,f=h.month1-1,b=yn(p,f);if(!(c===a&&t.getDate()<b)&&!d.some(m=>m.date.getDate()<b))continue;const x=new Date(p,f,0),C=r(x.getFullYear(),x.getMonth());l.has(C)||l.set(C,[])}const s=new Map;for(const[c,d]of l){const h=ha(c);if(!h)continue;const p=h.year,f=h.month1-1,b=new Date(p,f+1,0).getDate(),x=d.reduce((y,w)=>Math.max(y,w.parts?.length??0,w.partsB?.length??0),0),C=d.some(y=>y.partsB),m=new Array(b+1).fill(0),_=new Array(b+1).fill(0),g=Array.from({length:b+1},()=>new Array(x).fill(0)),A=Array.from({length:b+1},()=>new Array(x).fill(0));for(const y of d){const w=y.date.getDate();if(m[w]+=y.a,_[w]+=y.b,y.parts)for(let v=0;v<x;v++)g[w][v]+=y.parts[v]??0;if(y.partsB)for(let v=0;v<x;v++)A[w][v]+=y.partsB[v]??0}s.set(c,{year:p,month:f,daysInMonth:b,partsLen:x,hasPartsB:C,dayA:m,dayB:_,dayParts:g,dayPartsB:A})}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 s){const{year:h,month:p,daysInMonth:f,dayA:b,dayB:x,dayParts:C,dayPartsB:m}=d,_=h===t.getFullYear()&&p===t.getMonth(),g=t.getDate(),A=s.get(r(p===11?h+1:h,(p+1)%12)),y=d.partsLen,w=[];for(let B=1;B<=f;B++){const k=_&&B>g;w.push({label:String(B),...k&&b[B]===0&&x[B]===0?{future:!0}:{},a:k&&b[B]===0&&x[B]===0?-1:b[B],b:x[B],...y?{parts:C[B]}:{},...y&&d.hasPartsB?{partsB:m[B]}:{}})}const v=[];for(let B=yn(h,p);B<=f;B+=7){const k=Math.max(0,B+6-f),E=k&&A?Math.max(y,A.partsLen):y,D=d.hasPartsB||!!(k&&A?.hasPartsB);let N=0,I=0;const P=new Array(E).fill(0),K=new Array(E).fill(0);for(let M=B;M<=Math.min(B+6,f);M++){N+=b[M],I+=x[M];for(let L=0;L<y;L++)P[L]+=C[M][L],K[L]+=m[M][L]}if(k&&A)for(let M=1;M<=k&&!i(A.year,A.month,M);M++){N+=A.dayA[M],I+=A.dayB[M];for(let L=0;L<A.partsLen;L++)P[L]+=A.dayParts[M][L],K[L]+=A.dayPartsB[M][L]}const T=k?`${(p+1)%12+1}/${k}`:`${B+6}`;v.push({label:`${v.length+1}\uC8FC`,sublabel:`[${B}\uC77C~${T}\uC77C]`,a:N,b:I,...E?{parts:P}:{},...E&&D?{partsB:K}:{}})}u[c]={weekly:v,daily:w}}return u}function ku(){const e=la(),t=e.getFullYear(),a=e.getMonth()+1,r=[];for(let l=2024;l<=t;l++){const s=l===t?a:12;for(let i=1;i<=s;i++)r.push({value:Za(l,i),year:l,month:i})}return r.reverse()}ku();function Ov(){return ku()}function Au(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 Nu(e){const{t,i18n:a}=xe.useTranslation(),[r,l]=o.useState("week"),s=o.useMemo(()=>Ov().filter(E=>E.value in e),[e]),i=o.useMemo(()=>{const E=[];for(const D of s){const N=new Date(D.year,D.month,0).getDate(),I=yn(D.year,D.month-1),P=Math.ceil((N-I+1)/7);for(let K=P-1;K>=0;K--)E.push({value:Oo(D.value,K),monthKey:D.value,year:D.year,month:D.month,week:K})}return E},[s]),u=o.useCallback(E=>`${ro(t,a.language,E.year,E.month)} ${Au(t,E.week)}`,[t]),c=o.useMemo(()=>s.map(E=>({value:E.value,label:ro(t,a.language,E.year,E.month)})),[t,a.language,s]),d=o.useMemo(()=>i.map(E=>({value:E.value,label:u(E)})),[i,u]),h=o.useMemo(()=>Iv(),[e]),p=o.useMemo(()=>s.find(E=>E.value===h.monthKey)?.value??s[0]?.value??"",[s,h]),f=o.useMemo(()=>i.find(E=>E.value===h.value)?.value??i[0]?.value??"",[i,h]),[b,x]=o.useState(""),[C,m]=o.useState("");o.useEffect(()=>{s.find(E=>E.value===b)||x(p)},[s,b,p]),o.useEffect(()=>{i.find(E=>E.value===C)||m(f)},[i,C,f]);const _=r==="month"?c:d,g=r==="month"?b:C,A=r==="month"?x:m,y=o.useMemo(()=>{const E=t("calendar.dow",{returnObjects:!0});return Array.isArray(E)?E:["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"]},[t]),w=_.findIndex(E=>E.value===g),v=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E<_.length-1&&A(_[E+1].value)},[_,g,A]),B=o.useCallback(()=>{const E=_.findIndex(D=>D.value===g);E>0&&A(_[E-1].value)},[_,g,A]),k=o.useMemo(()=>[{key:"week",label:t("manager.chart.periodWeek","\uC8FC")},{key:"month",label:t("manager.chart.periodMonth","\uC6D4")}],[t]);return{period:r,setPeriod:l,range:g,setRange:A,activeOptions:_,activeIdx:w,handlePrev:v,handleNext:B,periodOptions:k,monthRange:b,weekRange:C,weekRanges:i,DOW:y}}const xt=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function Nn(e,t=!0){return e.future===!0||t&&e.a===-1}function zv({data:e,colorA:t,colorB:a,labelA:r,labelB:l,barWidth:s=10,barGap:i=1,height:u=140,maxOverride:c,tightMax:d,seriesColors:h,seriesLabels:p,rateLabels:f,grouped:b=!1,baseline:x,focusableBars:C=!1}){const m=!a,_=!!(h&&h.length>0),g=x,A=o.useMemo(()=>_?Math.max(0,...e.filter(O=>!Nn(O,g==null)).map(O=>b?Math.max(0,...(O.parts??[]).map(xt)):(O.parts??[]).reduce((U,$)=>U+Math.max(0,xt($)),0))):Math.max(0,...e.filter(O=>!Nn(O,g==null)).flatMap(O=>m?[xt(O.a)]:[xt(O.a),xt(O.b)])),[e,m,_,b]),y=o.useMemo(()=>{if(g==null)return 0;const O=e.filter(U=>!Nn(U,g==null)).flatMap(U=>_?(U.parts??[]).map(xt):m?[xt(U.a)]:[xt(U.a),xt(U.b)]);return Math.max(0,...O.map(U=>Math.abs(U-g)))},[e,g,_,m]),w=o.useMemo(()=>{const O=g!=null?y:A;return c??(d?O>0?O:10:Math.ceil(O/10)*10||10)},[A,y,g,c,d]),v=u,B=_?b?Math.max(1,h.length):1:m?1:2,k={"--bar-width":`${o.useMemo(()=>{const O=Math.max(1,e.length);return Math.max(2,Math.min(s,Math.round(120/(O*B)+6)))},[e.length,B,s])}px`},E={"--bar-group-gap":`${Math.max(0,i)}px`},D=o.useMemo(()=>{const O=Math.round(w/2);return g!=null?[g+w,...O!==w?[g+O]:[],g,...O!==w?[g-O]:[],g-w]:O!==w?[w,O,0]:[w,0]},[w,g]),N=O=>g!=null?1-(O-(g-w))/(2*w):1-O/w,[I,P]=o.useState(null),K=o.useCallback(()=>P(null),[]),T=o.useCallback((O,U)=>{const $=[O.label,O.sublabel].filter(Boolean).join(" ");let V;if(_&&b&&O.rawPartsB)V=(p??[]).map((z,Y)=>{const S=O.rawPartsB[Y]??0;return{text:S>0?`${z}: ${U[Y]??0}% (${O.rawParts?.[Y]??0}/${S})`:`${z}: -`,color:(h??[])[Y]}});else if(_&&b)V=(p??[]).map((z,Y)=>({text:`${z}: ${Q(U[Y]??0)}`,color:(h??[])[Y]}));else if(_){const z=(p??[]).map((S,R)=>({text:`${S}: ${U[R]??0}`,color:(h??[])[R]})),Y=z.filter((S,R)=>(U[R]??0)>0);V=Y.length?Y:z}else f&&!m?V=[{text:`${r} ${xt(O.a)}%`,color:t},{text:`${l} ${xt(O.b)}%`,color:a}]:f&&O.rawB!==void 0?V=[{text:`${f.total} ${O.rawB}`},{text:`${f.done} ${O.rawA??0}`,color:t}]:m?V=[{text:`${r}: ${xt(O.a)}`,color:t}]:V=[{text:`${r}: ${xt(O.a)}`,color:t},{text:`${l}: ${xt(O.b)}`,color:a}];return{title:$,items:V}},[_,b,p,h,f,m,r,l,t,a,g]),M=o.useCallback((O,U,$)=>{const V=O.getBoundingClientRect(),{title:z,items:Y}=T(U,$);P({rect:{left:V.left,top:V.top,right:V.right,bottom:V.bottom,width:V.width,height:V.height},title:z,items:Y})},[T]),L=o.useCallback((O,U)=>{const{title:$,items:V}=T(O,U);return[$,...V.map(z=>z.text)].filter(Boolean).join(", ")},[T]),Q=O=>g!=null&&O>g?`+${O}`:`${O}`,H=I!=null;return o.useEffect(()=>{if(!H)return;const O=()=>P(null),U=$=>{const V=$.target;V&&typeof V.closest=="function"&&V.closest(".manager-bar-chart-col")||P(null)};return window.addEventListener("scroll",O,!0),document.addEventListener("pointerdown",U,!0),()=>{window.removeEventListener("scroll",O,!0),document.removeEventListener("pointerdown",U,!0)}},[H]),n.jsxs("div",{className:"manager-bar-chart-wrap",style:E,children:[n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsx("div",{className:"manager-bar-chart-scroll",children:n.jsxs("div",{className:"manager-bar-chart-area",children:[n.jsxs("div",{className:"manager-bar-chart-plot",style:{height:v},children:[D.slice(0,-1).map((O,U)=>n.jsx("div",{className:`manager-bar-chart-gridline${g!=null&&O===g?" manager-bar-chart-gridline--baseline":""}`,style:{top:N(O)*v},children:n.jsx("span",{className:"manager-bar-chart-gridline__label caption-1",children:O})},U)),e.map((O,U)=>{const $=Nn(O,g==null),V=v/2,z=F=>g!=null?Math.min(V,Math.abs(xt(F)-g)/w*V):Math.min(v,Math.max(0,xt(F)/w*v)),Y=$?0:z(O.a),S=$?0:z(O.b),R=(O.parts??[]).map(xt);return n.jsx("div",{className:`manager-bar-chart-col${b&&_?" manager-bar-chart-col--group":""}`,style:{cursor:$?"default":"pointer"},tabIndex:C&&!$?0:void 0,role:C&&!$?"img":void 0,"aria-label":C&&!$?L(O,R):void 0,onMouseEnter:$?void 0:F=>M(F.currentTarget,O,R),onFocus:$||!C?void 0:F=>M(F.currentTarget,O,R),onBlur:C?K:void 0,onMouseLeave:K,children:!$&&(_&&b?(h??[]).map((F,Z)=>{const pe=R[Z]??0;if(g==null)return n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:z(pe),background:F}},Z);const re=xt(pe)<g;return n.jsxs("div",{className:"manager-bar-chart-slot",style:k,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:!re&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:z(pe),background:F}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:re&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:z(pe),background:F}})})]},Z)}):_?n.jsx("div",{className:"manager-bar-chart-stack",style:k,children:(()=>{const F=R.reduce((pe,re,oe)=>re>0?oe:pe,-1);let Z=v;return R.map((pe,re)=>{if(pe<=0)return null;const oe=Math.min(Z,pe/w*v);return Z-=oe,n.jsx("div",{className:"manager-bar-chart-stack-segment",style:{height:oe,background:(h??[])[re],borderRadius:re===F?"6px 6px 0 0":void 0}},re)})})()}):g!=null?n.jsx(n.Fragment,{children:[{v:xt(O.a),c:t},...m?[]:[{v:xt(O.b),c:a}]].map(({v:F,c:Z},pe)=>n.jsxs("div",{className:"manager-bar-chart-slot",style:k,children:[n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--up",children:F>=g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full",style:{height:z(F),background:Z}})}),n.jsx("div",{className:"manager-bar-chart-slot__half manager-bar-chart-slot__half--down",children:F<g&&n.jsx("div",{className:"manager-bar-chart-bar manager-bar-chart-bar--full manager-bar-chart-bar--down",style:{height:z(F),background:Z}})})]},pe))}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:Y,background:t}}),!m&&n.jsx("div",{className:"manager-bar-chart-bar",style:{...k,height:S,background:a}})]}))},U)})]}),n.jsx("div",{className:"manager-bar-chart-x-axis",children:e.map((O,U)=>{const $=Nn(O,g==null);return n.jsxs("span",{className:`manager-bar-chart-x-axis__label${$?" manager-bar-chart-x-axis__label--future":""}`,children:[n.jsxs("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:[O.isToday&&n.jsx("span",{className:"manager-bar-chart-x-axis__today-dot",style:{background:t}}),O.label]}),O.sublabel&&n.jsx("span",{className:"caption-1",children:O.sublabel})]},U)})})]})})}),I&&n.jsx(Kn,{anchorRect:I.rect,title:I.title,items:I.items,showIndex:!1,closeOnOutsideClick:!1})]})}function Eu({control:e}){const{t}=xe.useTranslation(),{activeOptions:a,activeIdx:r,range:l,setRange:s,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"),f=d==="week"?t("calendar.nextWeek","\uB2E4\uC74C \uC8FC"):t("calendar.nextMonth","\uB2E4\uC74C \uB2EC");return n.jsxs("div",{className:"manager-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(cn,{value:l,onChange:s,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:f,showTooltipInfo:f,disabled:r<=0,onClick:u}),n.jsx(bn,{ariaLabel:t("calendar.periodSelect","\uAE30\uAC04 \uB2E8\uC704"),options:c,value:d,onChange:b=>h(b),size:40})]})}function zo(e,t,a,r=!0){const l=new Date(a.getFullYear(),a.getMonth(),a.getDate());return Array.from({length:7},(s,i)=>{const u=new Date(t);u.setDate(t.getDate()+i);const c=(e[Fo(u)]?.daily??[])[u.getDate()-1],d=c!=null&&Nn(c,r)||u>l;return{dt:u,entry:c,isFuture:d}})}function Wv(e,t,a,r=!0){const{period:l,monthRange:s,weekRange:i,weekRanges:u,DOW:c}=t,d=la(),h=d.getFullYear(),p=d.getMonth()+1,f=d.getDate();if(l==="month"){const C=e[s]??{weekly:[],daily:[]},m=ha(s),_=m?m.year:null,g=m?m.month1:null,A=_&&g?yn(_,g-1):1;return C.weekly.map((y,w)=>{const v=w+1;let B=y.label,k=!1,E=!1;if(_&&g){const D=A+w*7,N=new Date(_,g-1,D+6),I=N.getMonth()+1,P=N.getDate(),K=I===g?`${P}`:`${I}/${P}`;B=a("manager.chart.weekRange",{start:D,end:K});const T=new Date(h,p-1,f).getTime();k=T>=new Date(_,g-1,D).getTime()&&T<=N.getTime(),E=_>h||_===h&&(g>p||g===p&&D>f)}return{...y,label:B,sublabel:Au(a,v-1),isToday:k,future:y.future===!0||E||void 0,a:E?-1:y.a,b:E?0:y.b}})}const b=u.find(C=>C.value===i);if(!b)return[];const x=new Date(b.year,b.month-1,yn(b.year,b.month-1)+b.week*7);return zo(e,x,d,r).map(({dt:C,entry:m,isFuture:_})=>{const g=C.getMonth()+1,A=C.getDate(),y=C.getFullYear();return{label:g===b.month&&y===b.year?`${A}`:`${g}/${A}`,sublabel:c[C.getDay()]??"",future:_||void 0,a:_?-1:m&&m.a>0?m.a:0,b:_?0:m&&m.b>0?m.b:0,isToday:y===h&&g===p&&A===f,...m?.parts?{parts:_?m.parts.map(()=>0):m.parts}:{},...m?.partsB?{partsB:_?m.partsB.map(()=>0):m.partsB}:{}}})}const Hv={small:{height:100,barWidth:16},medium:{height:140,barWidth:20},large:{height:180,barWidth:24}};function Vv({focusableBars:e,size:t="medium",barWidth:a,titleKey:r,titleLevel:l,data:s,colorA:i,colorB:u,labelAKey:c,labelBKey:d,showTotal:h=!1,totalUnitKey:p,totalLabelKey:f,control:b,hideControls:x=!1,rate:C=!1,rateAgg:m="dayMean",tightMax:_=!1,avgMode:g=!1,totalFormat:A,series:y,seriesMode:w="stack",loading:v=!1,onDetail:B,headExtra:k,headSegment:E,icon:D,disc:N,onClick:I,cardAriaLabel:P,cardTooltip:K,detailSize:T=32,barGap:M,baseline:L,className:Q,inGrid:H=!1}){const{t:O}=xe.useTranslation(),U=Hv[t],$=Nu(s),V=b??$,z=o.useMemo(()=>Wv(s,V,O,L==null),[s,V,O,L]),Y=w==="group"&&!!y&&y.length>0;M!=null&&!Y&&St("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 z;const ae=V.period==="month"?ha(V.monthRange):null,W=la(),ie=y?.length??0,q=G=>{const de=[],Ee=[],ye=[];for(let he=0;he<ie;he++){let se=0,Ce=0,ge=0;for(const ce of G){const Me=xt(ce.a[he]),Oe=xt(ce.b[he]);Oe<=0||(se+=Me,Ce+=Oe,ge+=Me/Oe*100)}de.push(m==="weighted"?Ce>0?Math.round(se/Ce*100):0:G.length?Math.round(ge/G.length):0),Ee.push(se),ye.push(Ce)}return{pct:de,ra:Ee,rb:ye}};return z.map((G,de)=>{let Ee=G.a===-1?-1:G.b>0?Math.round(G.a/G.b*100):0;if(ae&&!Nn(G)){const he=ae.year,se=ae.month1-1,Ce=zo(s,new Date(he,se,yn(he,se)+de*7),W).filter(ge=>!ge.isFuture);if(m==="weighted"){let ge=0,ce=0;for(const{entry:Me}of Ce)Me&&Me.b>0&&(ge+=Me.a,ce+=Me.b);Ee=ce>0?Math.round(ge/ce*100):0}else Ee=Ce.length?Math.round(Ce.reduce((ge,{entry:ce})=>ge+(ce&&ce.b>0?ce.a/ce.b*100:0),0)/Ce.length):0}let ye=null;if(Y&&!Nn(G)){let he;if(ae){const Ce=ae.year,ge=ae.month1-1;he=zo(s,new Date(Ce,ge,yn(Ce,ge)+de*7),W).filter(ce=>!ce.isFuture).map(({entry:ce})=>({a:ce?.parts??[],b:ce?.partsB??[]}))}else he=[{a:G.parts??[],b:G.partsB??[]}];const se=q(he);ye={parts:se.pct,rawParts:se.ra,rawPartsB:se.rb}}return{...G,a:Ee,b:G.a===-1?0:d&&G.parts&&G.parts[1]>0?Math.round(G.parts[0]/G.parts[1]*100):0,rawA:G.a===-1?-1:G.a,rawB:G.b,...ye??{}}})},[z,C,m,d,V.period,V.monthRange,s,Y,y?.length]),R=o.useMemo(()=>{if(C||g){const W=(V.period==="week"?z:s[V.monthRange]?.daily??[]).filter(q=>q.a!==-1);if(W.length===0)return 0;if(C&&m==="weighted"){let q=0,G=0;for(const de of W)de.b>0&&(q+=de.a,G+=de.b);return G>0?Math.round(q/G*100):0}const ie=C?W.reduce((q,G)=>q+(G.b>0?G.a/G.b*100:0),0):W.reduce((q,G)=>q+(G.a>0?G.a:0),0);return Math.round(ie/W.length)}const ae=V.period==="month"?s[V.monthRange]?.daily??[]:S;return L!=null?ae.reduce((W,ie)=>W+(Nn(ie,!1)?0:xt(ie.a)+(d?xt(ie.b):0)),0):ae.reduce((W,ie)=>W+(ie.a>0?ie.a:0)+(d&&ie.b>0?ie.b:0),0)},[S,z,C,m,g,L,d,V.period,V.monthRange,s]),F=y&&y.length>0?y.map(ae=>({color:ae.color,label:ae.label})):[{color:i,label:O(c)},...d?[{color:u,label:O(d)}]:[]],Z=t==="small",pe=[Z?"manager-section--compact":t==="large"?"manager-section--full":void 0,Q].filter(Boolean).join(" ")||void 0,re=r?O(r):"",oe=re?O("trainingStatus.detailFor",{name:re,defaultValue:"{{name}} \uC0C1\uC138\uBCF4\uAE30"}):O("trainingStatus.detail","\uC0C1\uC138\uBCF4\uAE30");return n.jsx(Io,{className:pe,inGrid:H,icon:D,disc:N,onClick:I,ariaLabel:P,tooltip:K,headSegment:E,headMenuItems:B?[{label:oe,icon:"list",onClick:B,closeOnSelect:!0}]:void 0,title:O(r),titleLevel:l,titleClassName:Z?"h5 chart-section-title--small":void 0,headRight:Z?k??void 0:({collapsed:ae})=>n.jsxs(n.Fragment,{children:[!x&&n.jsx(Eu,{control:V}),k,B&&!ae&&n.jsx("span",{className:"manager-bar-chart-detail-btn",children:n.jsx(fe,{htmlType:"button",size:T,type:"dot",icon:"list",ariaLabel:oe,showTooltipInfo:oe,onClick:B})})]}),subRow:n.jsxs(n.Fragment,{children:[h?C||g||f&&A?n.jsx(Ya,{label:Z?void 0:`${O(V.period==="week"?"manager.chart.weeklyPrefix":"manager.chart.monthlyPrefix")} ${O(f??c)}`,children:A?(A(R).match(/([+-]?\d[\d.,]*|[^\d]+)/g)??[]).map((ae,W)=>/\d/.test(ae)?n.jsx("span",{className:"barchart-total__num h0",children:ae},W):n.jsx("span",{className:"barchart-total__unit h5",children:ae},W)):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"barchart-total__num h0",children:R}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:O(p)})]})}):n.jsxs(Ya,{children:[n.jsx("span",{className:"barchart-total__num h0",children:R}),n.jsx("span",{className:"barchart-total__unit h5",children:O(c)}),p&&n.jsx("span",{className:"barchart-total__unit h5",children:O(p)})]}):n.jsx("span",{}),n.jsx(Po,{items:F,className:"caption-1"})]}),children:v?n.jsx("div",{className:"manager-bar-chart-wrap manager-bar-chart-loading","aria-busy":"true",children:n.jsx("div",{className:"manager-bar-chart-inner",children:n.jsxs("div",{className:"manager-bar-chart-area manager-bar-chart-area--loading",children:[n.jsx("div",{className:"manager-bar-chart-plot manager-bar-chart-plot--loading",style:{height:U.height},children:n.jsx(Ga,{size:32})}),n.jsx("div",{className:"manager-bar-chart-x-axis","aria-hidden":"true",children:n.jsxs("span",{className:"manager-bar-chart-x-axis__label",children:[n.jsx("span",{className:"caption-1 manager-bar-chart-x-axis__main",children:"\xA0"}),S.some(ae=>!!ae.sublabel)&&n.jsx("span",{className:"caption-1",children:"\xA0"})]})})]})})}):n.jsx(zv,{focusableBars:e,data:S,colorA:i,colorB:d?u:void 0,labelA:O(c),labelB:d?O(d):void 0,barWidth:a??U.barWidth,barGap:M,baseline:L,height:U.height,maxOverride:C?100:void 0,tightMax:_,seriesColors:y?.map(ae=>ae.color),seriesLabels:y?.map(ae=>ae.label),rateLabels:C?{total:O("trainingStatus.today.tooltipTotal","\uC804\uCCB4"),done:O("trainingStatus.today.tooltipDone","\uC644\uB8CC")}:void 0,grouped:Y})})}const Du=120,qv={left:38,right:16,top:26,bottom:24};function Uv({points:e=[],range:t,ticks:a=[],axisTitle:r,color:l,height:s=156,fallbackWidth:i=320,insets:u,overlay:c,ariaLabel:d,className:h}){const[p,f]=o.useState(null),[b,x]=o.useState(null);o.useEffect(()=>{if(!b)return;const L=H=>f(Math.round(H)||null);if(L(b.getBoundingClientRect().width),typeof ResizeObserver>"u")return;const Q=new ResizeObserver(([H])=>L(H.contentRect.width));return Q.observe(b),()=>{Q.disconnect()}},[b]);const{payload:C,anchorRect:m,openAfterDelay:_,close:g}=zy(Du),A=o.useCallback((L,Q)=>{L&&_(L,Q.getBoundingClientRect())},[_]),y=p??i,w=s,{left:v,right:B,top:k,bottom:E}={...qv,...u},[D,N]=t,I=L=>N===D?v:v+(y-v-B)*(L-D)/(N-D),P=L=>k+(w-k-E)*(100-L)/100,K={x:I,y:P,plot:{left:v,right:y-B,top:k,bottom:w-E,width:Math.max(0,y-v-B),height:Math.max(0,w-k-E)}},T=e.filter(L=>!L.hollow),M=l??"var(--color-main)";return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{ref:x,className:_e("line-chart",h),viewBox:`0 0 ${y} ${w}`,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:v,x2:y-B,y1:P(L),y2:P(L)}),n.jsxs("text",{className:"line-chart__tick",x:v-6,y:P(L)+4,textAnchor:"end",children:[L,"%"]})]},L)),c?.(K),a.map(L=>n.jsx("text",{className:"line-chart__tick",x:I(L.x),y:w-5,textAnchor:"middle",children:L.label},L.x)),T.length>1&&n.jsx("polyline",{className:"line-chart__line",fill:"none",stroke:M,points:T.map(L=>`${I(L.x)},${P(L.pct)}`).join(" ")}),e.map(L=>n.jsxs("g",{className:"line-chart__dot",onPointerEnter:Q=>A(L.description,Q.currentTarget),onPointerLeave:g,children:[n.jsx("circle",{className:"line-chart__dot-hit",cx:I(L.x),cy:P(L.pct),r:12}),n.jsx("circle",{className:_e("line-chart__dot-main",L.hollow&&"is-hollow"),cx:I(L.x),cy:P(L.pct),r:4,stroke:M,fill:L.hollow?void 0:M})]},L.x))]}),C!=null&&n.jsx(mn,{anchorRect:m,offset:10,closeOnOutsideClick:!1,className:"line-chart__tip",role:"tooltip",ariaLabel:C,children:C})]})}function Gv({icon:e,iconSize:t=56,title:a,titleClass:r="h2",description:l,tipGroups:s,start:i,className:u}){return n.jsxs("div",{className:_e("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:_e("game-intro__title",r),children:a}),l!=null&&n.jsx("p",{className:"game-intro__description body-3",children:l}),s?.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 Su=(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")}`},ju=(e,t,a,r)=>({from:zl(e,t,a),to:new Date(zl(e,t,a+r).getTime()-1),fromYmd:Su(e,t,a),toYmd:Su(e,t,a+r-1)});function Kv(e,t=0){if(e.period==="month"){const l=ha(e.monthRange),s=la(),i=l?l.year:s.getFullYear(),u=(l?l.month1:s.getMonth()+1)-1+t,c=new Date(Date.UTC(i,u+1,0)).getUTCDate();return ju(i,u,1,c)}const a=e.weekRanges.find(l=>l.value===e.weekRange);if(!a){const l=new Date,s=La();return{from:l,to:l,fromYmd:s,toYmd:s}}const r=yn(a.year,a.month-1);return ju(a.year,a.month-1,r+(a.week+t)*7,7)}const Wo={small:{diameter:96,strokeWidth:16},medium:{diameter:120,strokeWidth:18},large:{diameter:160,strokeWidth:22}};function Tu(e){return!Number.isFinite(e)||e<=0?0:e>=1?100:Math.min(99,Math.max(1,Math.round(e*100)))}function Mu({done:e,total:t,segments:a,color:r="var(--color-main)",size:l="medium",strokeWidth:s,label:i="%",hideCenter:u=!1,hideLabel:c=!1}){const d=typeof l=="number"?l:Wo[l].diameter,h=s??(typeof l=="number"?12:Wo[l].strokeWidth),p=d/2,f=(d-h)/2,b=2*Math.PI*f;if(a&&a.length>0){const _=a.reduce((g,A)=>{const y=g.length>0?g[g.length-1].acc:0,w=Number.isFinite(A.ratio)?A.ratio:0,v=Math.max(0,Math.min(w,1-y));return g.push({color:A.color,rotate:-90+y*360,dash:b*v,acc:y+v}),g},[]);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:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),_.map((g,A)=>g.dash>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:g.color,strokeWidth:h,strokeDasharray:`${g.dash} ${b}`,strokeLinecap:"round",transform:`rotate(${g.rotate} ${p} ${p})`},A))]})})}const x=(t??0)>0?Math.min((e??0)/t,1):0,C=b*x,m=b-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:f,fill:"none",stroke:"var(--color-whiteLine)",strokeWidth:h}),x>0&&n.jsx("circle",{cx:p,cy:p,r:f,fill:"none",stroke:r,strokeWidth:h,strokeDasharray:`${C} ${m}`,strokeLinecap:x<.02||x>.98?"butt":"round",transform:`rotate(-90 ${p} ${p})`})]}),!u&&n.jsxs("div",{className:`ring-chart__center${c?"":` ${d<=96?"ring-chart__center--small":l==="medium"?"ring-chart__center--medium":"ring-chart__center--large"}`}`,children:[n.jsx("span",{className:`ring-chart__pct ${d<=96?"h2":"h1"}`,children:Tu(x)}),!c&&n.jsx("span",{className:`ring-chart__label ${d<=96?"caption-2":"caption-1"}${d<=96||l==="medium"?" ring-chart__label--tight":""}`,children:i})]})]})}function Yv({titleKey:e,titleLevel:t,headRight:a,icon:r,showTotal:l,totalLabelKey:s,legend:i,loading:u,className:c,inGrid:d=!1,onClick:h,ariaLabel:p,tooltip:f,...b}){const{t:x}=xe.useTranslation();if(!e)return n.jsx(Mu,{...b});const C=(b.total??0)>0?Tu(Math.min((b.done??0)/b.total,1)):0,m=b.size==="small",_=typeof b.size=="number"?b.size:Wo[b.size??"medium"].diameter,g=b.size==="large",A=[c,m?"manager-section--compact":g?"manager-section--full":""].filter(Boolean).join(" ")||void 0,y=r&&n.jsx("span",{className:"chart-section-icon",children:n.jsx(Qe,{icon:r,className:"chart-section-icon-inner"})});return n.jsx(Io,{className:A,inGrid:d,onClick:h,ariaLabel:p,tooltip:f,title:x(e),titleLevel:t,titleClassName:m?"h5 chart-section-title--small":void 0,headRight:y||(m?void 0:a),subRow:(l||i)&&n.jsxs(n.Fragment,{children:[l?n.jsxs(Ya,{label:!m&&s?x(s):void 0,children:[n.jsx("span",{className:"barchart-total__num h0",children:C}),n.jsx("span",{className:"barchart-total__unit h5",children:"%"})]}):n.jsx("span",{}),i&&n.jsx(Po,{items:i})]}),children:u?n.jsx("div",{className:"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(Ga,{size:32})})}):n.jsx("div",{className:"ring-chart-section-body ring-chart-section-body--offset",children:n.jsx(Mu,{...b,hideCenter:b.hideCenter??m})})})}function Zv({label:e,value:t,change:a,changeType:r,icon:l,tooltip:s,onClick:i,children:u}){const c=o.useRef(null),{anchorRect:d,openAt:h,close:p}=Pa(),f=o.useCallback(()=>{s&&c.current&&h(c.current)},[s,h]),b=r??(a===void 0?void 0:a>0?"up":a<0?"down":"neutral"),x=a===void 0?void 0:a>0?`+${a}`:`${a}`,C=o.useCallback(m=>{i&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),i())},[i]);return n.jsxs("div",{ref:c,className:`manager-stat-card${i?" manager-stat-card--clickable":""}`,onClick:i,onKeyDown:i?C:void 0,onPointerEnter:f,onPointerLeave:p,onFocus:f,onBlur:p,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":i?[e,t,x].filter(m=>m!==void 0&&m!=="").join(" "):void 0,children:[s&&d&&n.jsx(wn,{anchorRect:{left:d.left,top:d.top+21,right:d.right,bottom:d.bottom,width:d.width,height:d.height},text:s}),n.jsxs("div",{className:"manager-stat-card__label-row",children:[n.jsx("span",{className:"manager-stat-card__label h5",children:e}),l&&n.jsx("span",{className:"manager-stat-card__icon",children:n.jsx(Qe,{icon:l,className:"manager-stat-card__icon-inner"})})]}),n.jsxs("div",{className:"manager-stat-card__content",children:[n.jsxs("div",{className:"manager-stat-card__left",children:[n.jsx("div",{className:"manager-stat-card__value h2",children:t}),x&&n.jsx("div",{className:`manager-stat-card__change manager-stat-card__change--${b??"neutral"} caption-1`,children:x})]}),u&&n.jsx("div",{className:"manager-stat-card__body",children:u})]})]})}function Lu({value:e,onChange:t,min:a=0,max:r=100,step:l=1,orientation:s="horizontal",size:i=24,disabled:u=!1,ariaLabel:c,length:d,className:h,label:p,formatValue:f,labelPos:b,labelAlign:x="right",showMinMax:C=!1,minLabel:m,maxLabel:_,showBgTick:g=!1,showFillTick:A=!1,tickStep:y,tickShape:w="dot"}){t&&!c&&St("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 v=Math.min(r,Math.max(a,e)),B=r>a?(v-a)/(r-a):0,k=s==="vertical",E=!t,D=z=>t?.(Number(z.target.value)),N=typeof d=="number"?`${d}px`:d,I={"--slider-ratio":String(B),"--slider-thumb":`${i}px`,...N?k?{height:N}:{width:N}:{}},P=y??l,K=(g||A)&&P>0&&r>a?Math.floor((r-a)/P+1e-6):0;if(K>0&&K<=100){const z=w!=="dash",Y=pe=>z?`radial-gradient(circle, ${pe} 0.5px, transparent 1px)`:k?`linear-gradient(to bottom, transparent calc(50% - 2px), ${pe} calc(50% - 2px), ${pe} calc(50% + 2px), transparent calc(50% + 2px))`:`linear-gradient(to right, transparent calc(50% - 2px), ${pe} calc(50% - 2px), ${pe} calc(50% + 2px), transparent calc(50% + 2px))`,S=z?"2px":"4px",R=[],F=[],Z=[];for(let pe=0;pe<=K;pe++){const re=pe*P/(r-a);if(re>1+1e-6)break;const oe=`${((k?1-re:re)*100).toFixed(4)}%`,ae=re<=B+1e-6;if(ae?!A:!g)continue;const W=ae?"var(--slider-tick-color-on-fill, var(--color-deepWhite))":"var(--slider-tick-color, var(--color-lightGray))";R.push(Y(W)),F.push(k?`${S} var(--slider-thumb)`:`var(--slider-thumb) ${S}`),Z.push(k?`center ${oe}`:`${oe} center`)}R.push(k?"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))"),F.push("100% 100%"),Z.push("0 0"),I.backgroundImage=R.join(", "),I.backgroundSize=F.join(", "),I.backgroundPosition=Z.join(", "),I.backgroundRepeat="no-repeat"}const T=f?f(v):p==="percent"?`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`:p==="count"?`${v} / ${r}`:v===a&&m?m:v===r&&_?_:void 0,M=n.jsx("input",{type:"range",className:_e("slider",`slider--${s}`,E&&"slider--static",!p&&!C&&h),min:a,max:r,step:l,value:v,disabled:u,readOnly:E,tabIndex:E?-1:void 0,"aria-label":c,"aria-valuetext":T,"aria-orientation":s,onChange:D,style:I});if(!p&&!C)return M;const L=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:m??a}),Q=n.jsx("span",{className:"slider-wrap__minmax caption-1",children:_??r}),H=C?n.jsxs("div",{className:_e("slider-track-group",`slider-track-group--${s}`,!p&&h),children:[k?Q:L,M,k?L:Q]}):M;if(!p)return H;const O=b??(k?"bottom":"right"),U=`${Math.round(r>a?(v-a)/(r-a)*100:0)}%`,$=f?f(v):p==="percent"?U:p==="count"?`${v} / ${r}`:String(v),V=n.jsx("span",{className:"slider-wrap__value body-3b",children:$});return n.jsxs("div",{className:_e("slider-wrap",`slider-wrap--${s}`,`slider-wrap--label-${O}`,`slider-wrap--align-${x}`,h),children:[H,V]})}const Xv=.86,Jv=250,Ho=(e,t,a,r)=>Math.round(Math.min(r,Math.max(a,e-t))),Vo=(e,t,a,r)=>{const l=Ho(e,t,a,r);return`${l<0?"-":"+"}${Math.abs(l)} dB`};function qo({analyser:e,audioElement:t,orientation:a="horizontal",length:r,label:l,labelPos:s,labelAlign:i="right",floorDb:u=-60,refDb:c=-35,displayMin:d=-5,displayMax:h=25,className:p,ariaLabel:f}){const b=o.useRef(null),x=o.useRef(null),C=o.useRef(null),m=o.useRef(null),[_,g]=o.useState(null);o.useEffect(()=>{const v=M=>{const L=Vo(M,c,d,h);C.current&&(C.current.textContent=L);const Q=b.current;Q&&(Q.setAttribute("aria-valuenow",String(Ho(M,c,d,h))),Q.setAttribute("aria-valuetext",L))},B=e??Yf(t)??(_&&_.el===t?_.node:null),k=x.current;if(!B||!k){k?.style.setProperty("--meter-level","0"),v(u);let M=!1;return!e&&t&&er(t).then(L=>{!M&&L&&g({el:t,node:L})}),()=>{M=!0}}Qr();const E=new Float32Array(B.fftSize);let D=0,N=0,I=0,P=0,K=null;const T=M=>{const L=Zf(B,E);D=L>D?L:D*Xv;const Q=D>1e-5?20*Math.log10(D):-1/0,H=Math.max(u,Q),O=H-c,U=Math.min(1,Math.max(0,(O-d)/(h-d)));if(k.style.setProperty("--meter-level",U.toFixed(3)),N+=H,I+=1,M-P>=Jv){const $=N/I;K=K==null?$:K*.6+$*.4,v(K),N=0,I=0,P=M}m.current=requestAnimationFrame(T)};return m.current=requestAnimationFrame(T),()=>{m.current!=null&&cancelAnimationFrame(m.current),m.current=null}},[e,t,_,u,c,d,h]);const A=typeof r=="number"?`${r}px`:r,y=n.jsx("div",{className:"audio-meter__track",style:A?a==="vertical"?{height:A}:{width:A}:{},children:n.jsx("div",{ref:x,className:"audio-meter__fill"})}),w=s??(a==="vertical"?"bottom":"right");return n.jsxs("div",{ref:b,className:_e("audio-meter",`audio-meter--${a}`,l&&`audio-meter--label-${w}`,l&&`audio-meter--align-${i}`,p),role:"meter","aria-label":f,"aria-valuemin":d,"aria-valuemax":h,"aria-valuenow":Ho(u,c,d,h),"aria-valuetext":Vo(u,c,d,h),children:[y,l&&n.jsx("span",{ref:C,className:"audio-meter__value caption-2",children:Vo(u,c,d,h)})]})}const $u=260;function Ru({message:e,position:t,duration:a,onClose:r}){const[l,s]=o.useState(!1),[i,u]=o.useState(!1),c=o.useRef(i),d=o.useRef(l);o.useEffect(()=>{c.current=i},[i]),o.useEffect(()=>{d.current=l},[l]);const h=o.useRef(null),p=o.useRef(""),f=o.useRef(r);o.useEffect(()=>{f.current=r});const b=a,x=o.useRef(null),C=o.useRef(0),m=o.useRef(0),_=o.useRef(!1),g=o.useRef(null),A=o.useRef(null),y=o.useRef(null),w=o.useRef(null),v=o.useRef(()=>{});v.current=E=>{E<0||(C.current=Date.now(),m.current=E,x.current=setTimeout(()=>{x.current=null,s(!1),g.current=setTimeout(()=>{u(!1);try{f.current()}catch{}},$u)},E))};const B=o.useCallback(()=>{_.current||!x.current||(_.current=!0,clearTimeout(x.current),x.current=null,m.current=Math.max(0,m.current-(Date.now()-C.current)))},[]),k=o.useCallback(()=>{_.current&&(_.current=!1,v.current(m.current))},[]);return o.useEffect(()=>{if(e!==p.current&&(x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)),e){if(d.current)return b>0&&!x.current&&(_.current?m.current=b:v.current(b)),p.current=e,()=>{x.current&&(clearTimeout(x.current),x.current=null),g.current&&(clearTimeout(g.current),g.current=null)};const E=()=>{const D=h.current;if(D)try{D.classList.remove("is-visible"),D.style.transition="none",t==="top"?D.style.transform="translateX(-50%) translateY(-16px)":D.style.transform="translateX(-50%) translateY(16px)",D.style.opacity="0",D.offsetWidth,D.style.transition="",D.classList.add("is-visible"),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null;try{D.style.opacity="",D.style.transform="",D.style.transition=""}catch{}},60)}catch{}};c.current?(E(),s(!0)):(u(!0),A.current=requestAnimationFrame(()=>{y.current=requestAnimationFrame(()=>{E(),s(!0)})})),b>0&&(_.current=!1,v.current(b))}else s(!1),g.current=setTimeout(()=>u(!1),$u);return p.current=e,()=>{x.current&&clearTimeout(x.current),g.current&&clearTimeout(g.current),A.current&&cancelAnimationFrame(A.current),y.current&&cancelAnimationFrame(y.current),w.current&&clearTimeout(w.current),x.current=null,g.current=null,A.current=null,y.current=null,w.current=null}},[e,b,t]),{mounted:i,showing:l,popupRef:h,pause:B,resume:k}}function ma({message:e="",position:t="top",type:a="normal",onClose:r=()=>{},duration:l=2e3}){const{mounted:s,showing:i,popupRef:u,pause:c,resume:d}=Ru({message:e,position:t,duration:l,onClose:r}),h=o.useRef(null),[p,f]=o.useState(!1);if(o.useEffect(()=>{i?f(!0):s||f(!1)},[i,s]),!s)return null;const b=a==="notice"||a==="warning"?a:"normal",x=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--${b} body-2`,"aria-hidden":p||i?void 0:!0,children:n.jsx("span",{className:"toast__text",children:e})})});return typeof document<"u"?nn.createPortal(x,document.body):x}const Qv=24;function e4({value:e,max:t=100,size:a=8,color:r,trackColor:l,label:s,formatValue:i,labelPos:u,labelAlign:c="right",ariaLabel:d,className:h}){const p=Number.isFinite(t)&&t>0?t:1,f=Math.max(0,Math.min(Number.isFinite(e)?e:0,p)),b=f/p*100,x=Number.isFinite(t)&&t>0?t:0,C=u??(a>=Qv?"inside":"bottom"),m=C==="center"?"inside":C,_=m==="inside"&&(c==="left"?b>=15:c==="center"?b>=50:b>=85),g={};return r&&(g["--progress-bar-fill"]=r),l&&(g["--progress-bar-track"]=l),n.jsxs("div",{className:_e("progress-bar",`progress-bar--${a}`,`progress-bar--label-${m}`,s&&`progress-bar--align-${c}`,s&&_&&"progress-bar--label-on-fill",h),style:g,children:[n.jsx("div",{className:"progress-bar__track",role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":x,"aria-valuetext":s?i?i(f):s==="percent"?void 0:s==="raw"?String(f):`${f} / ${x}`:void 0,"aria-label":d,children:n.jsx("div",{className:"progress-bar__fill",style:{width:`${b}%`}})}),s&&n.jsx("span",{className:"progress-bar__label caption-1b",children:i?i(f):s==="percent"?`${Math.round(b)}%`:s==="raw"?String(f):`${f} / ${x}`})]})}const Pu={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},t4="rgba(255, 255, 255, 0.16)";function Iu({max:e,index:t,inactiveBg:a,inactiveColor:r,transparent:l,variant:s="numbered",announce:i=!1,ariaLabel:u}){const{t:c}=xe.useTranslation(),d=un("(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}}"}),f={};if(a&&(f["--pi-inactive-bg"]=a),r&&(f["--pi-inactive-color"]=r),l&&(a||(f["--pi-inactive-bg"]=t4),r||(f["--pi-inactive-color"]="var(--color-white)")),s==="dot")return n.jsxs("div",{className:"progress-indicator progress-indicator--dot",style:f,role:i?"status":"img","aria-label":i?void 0:p,children:[i&&n.jsx("span",{style:Pu,children:p}),Array.from({length:e}).map((x,C)=>n.jsx("span",{"aria-hidden":"true",className:`progress-indicator-dot--dot${C<h?" done":C===h?" active":""}`},C))]});const b=i?n.jsx("span",{role:"status",style:Pu,children:p}):null;return d?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"progress-indicator progress-indicator--mobile",style:f,role:"list","aria-label":p,children:n.jsxs("span",{role:"listitem",className:"progress-indicator-dot active body-3",children:[h+1," / ",e]})}),b]}):n.jsxs(n.Fragment,{children:[b,n.jsx("div",{className:"progress-indicator",style:f,role:"list","aria-label":p,children:Array.from({length:e}).map((x,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 n4(e){if(!e)return[];const t=[];let a=0,r="";for(const l of e.trim()){if(l==="("?a++:l===")"&&a--,/\s/.test(l)&&a===0){r&&(t.push(r),r="");continue}r+=l}return r&&t.push(r),t}function a4({children:e,className:t,style:a,rowLabel:r,onRowClick:l}){return n.jsx("div",{role:"cell",className:t?`table-cell ${t}`:"table-cell",style:a,children:r&&l?n.jsx("button",{type:"button",className:"table-cell__row-button","aria-label":r,children:e}):e})}function Uo({variant:e="default",children:t,className:a,draggable:r,onClick:l,onMouseEnter:s,onMouseLeave:i,onDragStart:u,onDragEnd:c,expandedContent:d,colSpan:h,describedBy:p,rowHasButton:f}){const b=o.useCallback(x=>{l&&x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),l())},[l]);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(Ga,{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:l,onKeyDown:l?b:void 0,onMouseEnter:s,onMouseLeave:i,onDragStart:u,onDragEnd:c,role:"row",tabIndex:l&&!f?0:void 0,"aria-describedby":l&&!f?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 r4({dir:e}){return n.jsx(e==="asc"?Ks:Gs,{className:"table-field__sort-arrow",size:16,strokeWidth:2})}function o4({children:e,onClick:t,className:a,sortDir:r,ariaSort:l,onResizeStart:s}){const i=n.jsxs(n.Fragment,{children:[e,r&&n.jsx(r4,{dir:r})]});return n.jsxs("div",{onClick:t,role:"columnheader","aria-sort":l,className:_e("table-field body-3",a,r?"table-field--sorted":"",s?"table-field--resizable":""),children:[t?n.jsx("button",{type:"button",className:"table-field__button",children:i}):i,s&&n.jsx("span",{className:"table-field__resizer",onPointerDown:s,onClick:u=>u.stopPropagation(),"aria-hidden":"true"})]})}function Go({fields:e=[],headerGroups:t,items:a=[],renderRow:r,onRowClick:l,isRowClickable:s,onRowMouseEnter:i,onRowMouseLeave:u,onRowDragStart:c,onRowDragEnd:d,draggingId:h,gridTemplateColumns:p,mobileGridTemplateColumns:f,resizable:b=!1,resizeMode:x="grow",resizeStorageKey:C,size:m="small",title:_,icon:g,count:A,collapsed:y=!1,onToggleCollapse:w,headerActions:v,empty:B,loading:k,dragOver:E=!1,onDragOver:D,onDragLeave:N,onDrop:I,renderExpandedRow:P,expandedId:K}){const{t:T}=xe.useTranslation(),M=o.useId(),L=`table-title-${M}`,Q=`table-row-hint-${M}`,H=un("(max-width: 767px)"),O=f&&H?f:null,U=b&&!H,$=48,V=o.useRef(()=>$),z=C?`table-cols:${C}`:null,Y=o.useRef(null),S=o.useRef(null),R=o.useRef(null),F=o.useRef(null),[Z,pe]=o.useState(!1),[re,oe]=o.useState(0),ae=o.useCallback(()=>{const ne=R.current;ne&&(pe(ne.scrollWidth>ne.clientWidth+1),oe(ne.clientWidth))},[]),W=o.useCallback((ne,Ne)=>{const Je=ne.current;Je&&S.current&&S.current.unobserve(Je),ne.current=Ne,Ne?(!S.current&&typeof ResizeObserver<"u"&&(S.current=new ResizeObserver(()=>ae())),S.current?.observe(Ne)):!R.current&&!F.current&&(S.current?.disconnect(),S.current=null),ae()},[ae]),ie=o.useCallback(ne=>W(R,ne),[W]),q=o.useCallback(ne=>W(F,ne),[W]);o.useEffect(()=>{ae()}),o.useEffect(()=>{if(typeof window>"u")return;const ne=typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>ae()):null;return window.addEventListener("resize",ae),()=>{ne!=null&&cancelAnimationFrame(ne),window.removeEventListener("resize",ae)}},[ae]);const G=o.useRef(()=>!1),de=o.useRef([]),Ee=o.useRef(null),ye=ne=>{if(!ne||typeof window>"u")return null;try{const Ne=JSON.parse(window.localStorage.getItem(ne)??"null");return Array.isArray(Ne)&&Ne.length>0&&Ne.every(Je=>typeof Je=="number"&&Number.isFinite(Je)&&Je>0)?Ne:null}catch{return null}},[he,se]=o.useState(()=>ye(z)),[Ce,ge]=o.useState(z),[ce,Me]=o.useState(()=>ye(z)!==null);if(Ce!==z){ge(z);const ne=ye(z);se(ne),Me(ne!==null)}const Oe=o.useRef(he);o.useEffect(()=>{Oe.current=he},[he]);const Le=o.useCallback(ne=>{const Ne=Ee.current;if(!Ne)return;const Je=Oe.current;if(Je){const Ve=[...Je];if(Ne.next!=null&&Ne.startWNext!=null){const it=ne.clientX-Ne.startX,Se=Math.max(V.current(Ne.index)-Ne.startW,Math.min(Ne.startWNext-V.current(Ne.next),it));Ve[Ne.index]=Ne.startW+Se,Ve[Ne.next]=Ne.startWNext-Se}else Ve[Ne.index]=Math.max(V.current(Ne.index),Ne.startW+(ne.clientX-Ne.startX));Oe.current=Ve,se(Ve)}},[]),ze=o.useCallback(()=>{if(Ee.current=null,window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",ze),window.removeEventListener("pointercancel",ze),document.body.style.cursor="",document.body.style.userSelect="",z&&Oe.current)try{window.localStorage.setItem(z,JSON.stringify(Oe.current))}catch{}},[Le,z]),We=o.useCallback((ne,Ne)=>{Ne.preventDefault(),Ne.stopPropagation();const Je=Y.current;if(!Je)return;const Ve=Array.from(Je.children).map(Se=>Se.getBoundingClientRect().width),it=x==="fit"?e.findIndex((Se,pt)=>pt>ne&&Se.resizable!==!1):-1;Ee.current=it>=0?{index:ne,startX:Ne.clientX,startW:Ve[ne],next:it,startWNext:Ve[it]}:{index:ne,startX:Ne.clientX,startW:Ve[ne]},Oe.current=Ve,se(Ve),Me(!0),window.addEventListener("pointermove",Le),window.addEventListener("pointerup",ze),window.addEventListener("pointercancel",ze),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[Le,ze,x,e]),dt=o.useCallback(()=>{const ne=Y.current,Ne=ne?.closest(".table-wrap");if(!ne||!Ne)return null;const Je=Ne.style.getPropertyValue("--table-grid-cols");Ne.style.setProperty("--table-grid-cols",e.map((Ge,ot)=>G.current(ot)?de.current[ot]:"max-content").join(" "));const Ve=Array.from(Ne.querySelectorAll(".table-row")).filter(Ge=>!Ge.classList.contains("table-row--loading")&&!Ge.classList.contains("table-row--empty")),it=e.map((Ge,ot)=>{let st=ne.children[ot]?.getBoundingClientRect().width??0;for(const kt of Ve){const Vt=kt.children[ot];Vt&&(st=Math.max(st,Vt.getBoundingClientRect().width))}const ct=G.current(ot)?parseFloat(de.current[ot]):NaN;return Number.isFinite(ct)?ct:Math.max(V.current(ot),Math.ceil(st))}),Se=window.getComputedStyle(ne),pt=ne.clientWidth-(parseFloat(Se.paddingLeft)||0)-(parseFloat(Se.paddingRight)||0);Je?Ne.style.setProperty("--table-grid-cols",Je):Ne.style.removeProperty("--table-grid-cols");let gt=it;const Pe=it.reduce((Ge,ot,st)=>Ge+(G.current(st)?ot:0),0),nt=it.reduce((Ge,ot,st)=>Ge+(G.current(st)?0:ot),0),vt=pt-Pe;if(pt>0&&nt>0&&vt>0){const Ge=vt/nt;gt=it.map((st,ct)=>G.current(ct)?st:Math.max(V.current(ct),Math.round(st*Ge)));const ot=Math.round(vt-gt.reduce((st,ct,kt)=>st+(G.current(kt)?0:ct),0));if(ot!==0){let st=-1;gt.forEach((ct,kt)=>{!G.current(kt)&&(st<0||ct>gt[st])&&(st=kt)}),st>=0&&(gt[st]=Math.max(V.current(st),gt[st]+ot))}}return gt},[e,x]),lt=(ne,Ne)=>ne!==null&&ne.length===Ne.length&&ne.every((Je,Ve)=>Je===Ne[Ve]),at=o.useRef(dt);o.useEffect(()=>{at.current=dt});const[ht,Ae]=o.useState(0),qe=a.length>0,we=`${z??""}|${ht}|${e.length}|${re}`,Ue=!ce&&U&&z!==null&&!k?`${we}|${qe?1:0}`:null,ke=o.useRef(null);o.useEffect(()=>{if(Ue===null||!qe||ke.current===we)return;const ne=at.current();ne&&(ke.current=we,se(Ne=>lt(Ne,ne)?Ne:ne))},[Ue]);const $e=o.useCallback(()=>{if(z)try{window.localStorage.removeItem(z)}catch{}Me(!1);const ne=at.current();se(ne),Oe.current=ne,Ae(Ne=>Ne+1)},[z]);o.useEffect(()=>()=>{Ee.current&&(window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",ze),window.removeEventListener("pointercancel",ze),document.body.style.cursor="",document.body.style.userSelect="")},[Le,ze]);const je=n4(p),Ze=je.filter(ne=>/\b(auto|min-content|max-content)\b|fit-content\(/.test(ne));Ze.length>0&&St(`table-content-track:${p}`,`[ihabdevteam-core] Table \uC758 gridTemplateColumns \uC5D0 \uB0B4\uC6A9\uC73C\uB85C \uD06C\uAE30\uAC00 \uC815\uD574\uC9C0\uB294 \uD2B8\uB799(${Ze.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: ${p})`);const yt=e.findIndex(ne=>!!ne.sortDir);e.filter(ne=>!!ne.sortDir).length>1&&St("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 et=ne=>ne===yt?e[ne].sortDir==="asc"?"ascending":"descending":e[ne].onClick?"none":void 0,Xe=ne=>/^\d+(\.\d+)?px$/.test(je[ne]??""),_t=ne=>{const Ne=je[ne]??"",Je=/^minmax\(\s*(\d+(?:\.\d+)?)px\s*,/.exec(Ne)??/^(\d+(?:\.\d+)?)px$/.exec(Ne);return Je?parseFloat(Je[1]):$};G.current=Xe,V.current=_t,de.current=je;const Ct=ne=>x==="fit"&&!Xe(ne)?"fr":"px",wt=he&&he.length===e.length&&!H,Bt=O??(wt?e.map((ne,Ne)=>ne.resizable===!1&&je[Ne]?je[Ne]:`${he[Ne]}${Ct(Ne)}`).join(" "):p),mt=Bt?{"--table-grid-cols":Bt}:void 0,rt=_!==void 0;return n.jsxs("div",{ref:ie,className:`table-wrap table-wrap--${m}${U?" table-wrap--resizable":""}${E?" table-wrap--dragover":""}${y?" table-wrap--collapsed":""}`,style:mt,onDragOver:D,onDragLeave:N,onDrop:I,tabIndex:Z?0:void 0,role:Z?"region":void 0,"aria-label":Z?typeof _=="string"?_:T("table.scrollRegion","\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C"):void 0,children:[!!l&&n.jsx("span",{id:Q,className:"table-row-hint",children:T("table.rowActionHint","\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4")}),n.jsxs("div",{ref:q,role:"table","aria-labelledby":rt&&typeof _=="string"?L:void 0,className:"table body-2",children:[rt&&n.jsxs("div",{className:_e("table-header",w&&"table-header--clickable"),onClick:w,role:"caption",children:[w&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:y?"chevron-right":"chevron-down",ariaLabel:y?T("common.expand","\uD3BC\uCE58\uAE30"):T("common.collapse","\uC811\uAE30"),ariaExpanded:!y,className:"table-header__chevron"}),g&&n.jsx(Qe,{icon:g,label:typeof _=="string"?_:void 0,className:"table-header__icon"}),n.jsx("span",{id:L,className:"table-header__title h5b",children:_}),A!==void 0&&n.jsx("span",{className:"table-header__count body-3b",children:A}),v&&n.jsx("span",{className:"table-header__actions",onClick:ne=>ne.stopPropagation(),children:v})]}),!y&&n.jsxs(n.Fragment,{children:[t&&t.length>0&&n.jsx("div",{role:"row",className:"table-fields table-fields--groups",children:t.map((ne,Ne)=>n.jsx("div",{role:"columnheader","aria-colspan":ne.span,className:_e("table-field body-3",ne.className),style:{gridColumn:`span ${ne.span}`},children:ne.label},Ne))}),n.jsxs("div",{role:"presentation",className:_e("table-fields-strip",U&&"table-fields-strip--resizable"),children:[n.jsx("div",{role:"row",className:"table-fields",ref:Y,children:e.map((ne,Ne)=>n.jsx(o4,{onClick:ne.onClick,className:ne.className,sortDir:ne.sortDir,ariaSort:et(Ne),onResizeStart:U&&Ne<e.length-1&&ne.resizable!==!1&&(x!=="fit"||e.some((Je,Ve)=>Ve>Ne&&Je.resizable!==!1))?Je=>We(Ne,Je):void 0,children:ne.label},Ne))}),U&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"chevrons-left-right-ellipsis",ariaLabel:T("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),showTooltipInfo:T("table.resetColumns","\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"),className:"table-fields__reset",onClick:$e})]}),n.jsx("div",{role:"rowgroup",className:"table-body",children:k?n.jsx(Uo,{variant:"loading",colSpan:e.length||void 0}):a.length===0&&B?n.jsx(Uo,{variant:"empty",colSpan:e.length||void 0,children:B}):a.map((ne,Ne)=>{const Je=h!=null&&ne.id===h,Ve=!!l&&(s?s(ne):!0),it=K!=null&&ne.id!=null&&(K instanceof Set?K.has(ne.id)||[...K].some(Se=>String(Se)===String(ne.id)):String(ne.id)===String(K));return n.jsx(Uo,{className:`${Ve?" table-row--clickable":""}${c?" table-row--draggable":""}${Je?" table-row--dragging":""}`.trim(),draggable:!!c,onClick:Ve?()=>l(ne):void 0,colSpan:e.length||void 0,rowHasButton:r(ne).some(Se=>!!Se.rowLabel),describedBy:Q,onMouseEnter:i?Se=>i(ne,Se):void 0,onMouseLeave:u?Se=>u(ne,Se):void 0,onDragStart:c?Se=>c(ne,Se):void 0,onDragEnd:d?Se=>d(ne,Se):void 0,expandedContent:it&&P?P(ne):void 0,children:r(ne).map((Se,pt)=>n.jsx(a4,{className:Se.className,style:Se.style,rowLabel:Ve?Se.rowLabel:void 0,onRowClick:Ve?()=>l(ne):void 0,children:Se.content},pt))},ne.id!=null?`${typeof ne.id}:${ne.id}`:`__idx:${Ne}`)})})]})]})]})}const s4={hearingAid:"hearingAid",cochlearImplant:"cochlearImplant",other:"other",\uBCF4\uCCAD\uAE30:"hearingAid",\uC778\uACF5\uC640\uC6B0:"cochlearImplant",\uAE30\uD0C0:"other"};function Fu(e){return e?s4[e]??null:null}function Ou(e){switch(Fu(e)){case"hearingAid":return"main";case"cochlearImplant":return"sub";default:return"default"}}function zu(e,t){const a=Fu(e);return a?t(`device.type.${a}`,{defaultValue:e??""}):e??""}const fa=e=>e==null?"":String(e).trim();function Ko(e,t,a,r){const l=fa(e),s=fa(t),i=fa(a);if(r&&l&&s&&i){const c=`${l.padStart(4,"0")}-${s.padStart(2,"0")}-${i.padStart(2,"0")}`,d=new Date(c);if(!Number.isNaN(d.getTime())&&d.toISOString().slice(0,10)===c){const h=Fl(c,r);if(h)return h}}const u=[l,s,i];for(;u.length>0&&u[u.length-1]==="";)u.pop();return u.join(".")}function l4(e,t,a){const r=fa(e);return r?`${r}-${fa(t).padStart(2,"0")}-${fa(a).padStart(2,"0")}`:""}function Wu(e,t){return t!=="wornAt"?String(e[t]??""):l4(e.wornYear,e.wornMonth,e.wornDay)}function i4({rows:e,loading:t,onSelect:a,onDelete:r,onWear:l,onRelease:s,onAdd:i}){const{t:u,i18n:c}=xe.useTranslation(),d=m=>m==="left"?u("device.direction.left","\uC88C"):u("device.direction.right","\uC6B0"),{sort:h,field:p}=Ty(),f=o.useMemo(()=>{if(!h)return e;const{key:m,asc:_}=h;return[...e].sort((g,A)=>{if(m==="worn"){const y=Number(A.worn)-Number(g.worn);return _?y:-y}return wo(Wu(g,m),Wu(A,m),_)})},[e,h]),{pageRows:b,pageSizeProps:x,paginationProps:C}=jy(f,h);return n.jsxs("div",{className:"dlp-side-table",children:[n.jsx(Ro,{count:{value:e.length,unit:u("customers.device.unit","\uAC1C")},pageSize:x,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(Go,{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:b.map((m,_)=>({id:m.id??`${m.side}-${_}`,row:m})),gridTemplateColumns:`56px 110px 110px minmax(120px, 1fr) 100px minmax(120px, 1fr) 110px${r?" 80px":""}`,renderRow:({row:m})=>[{content:n.jsx("span",{className:"dlp-worn-check",onClick:_=>_.stopPropagation(),children:n.jsx(xu,{checked:m.worn,disabled:m.worn?!s:!l,ariaLabel:m.worn?u("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"):u("customers.device.wear","\uCC29\uC6A9"),onChange:_=>{_?l?.(m):s?.(m)}})})},{content:n.jsx("span",{children:d(m.side)})},{content:m.device?n.jsx(Et,{size:"small",variant:Ou(m.device),fill:"soft",label:zu(m.device,u)}):n.jsx("span",{})},{content:n.jsx("span",{children:m.brand})},{content:n.jsx("span",{children:m.fitType||"-"})},{content:n.jsx("span",{children:m.productName||"-"})},{content:n.jsx("span",{className:"dlp-date",children:Ko(m.wornYear,m.wornMonth,m.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(m)}})})}]:[]],onRowClick:({row:m})=>a(m),empty:u("customers.device.historyEmpty","\uB4F1\uB85D\uB41C \uAE30\uAE30 \uC774\uB825\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})]})}function Hu(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 u4(e,t){return new Date(e,t+1,0).getDate()}function c4(e,t){return new Date(e,t,1).getDay()}function d4({visits:e=[],onVisitClick:t,onVisitMove:a,onDayClick:r,today:l}){const{t:s,i18n:i}=xe.useTranslation(),u=o.useMemo(()=>s("calendar.dow",{returnObjects:!0}),[s]),c=oo(l),[d,h]=o.useState(()=>Number(c.slice(0,4))),[p,f]=o.useState(()=>Number(c.slice(5,7))-1),[b,x]=o.useState(null),C=o.useRef(null),m=o.useMemo(()=>{const v={};return e.forEach(B=>{v[B.date]||(v[B.date]=[]),v[B.date].push(B)}),v},[e]),_=o.useMemo(()=>{const v=u4(d,p),B=c4(d,p),k=[];for(let E=0;E<B;E++)k.push(null);for(let E=1;E<=v;E++)k.push(E);for(;k.length<35;)k.push(null);return k},[d,p]),g=o.useCallback(()=>{p===0?(h(v=>v-1),f(11)):f(v=>v-1)},[p]),A=o.useCallback(()=>{p===11?(h(v=>v+1),f(0)):f(v=>v+1)},[p]),y=v=>`${d}-${String(p+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`,w=v=>y(v)===c;return n.jsxs("div",{children:[n.jsxs("div",{className:"calendar-nav",children:[n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:g,"aria-label":s("calendar.prevMonth","\uC774\uC804 \uB2EC"),children:n.jsx(Qe,{icon:"chevron-left",label:"",className:"",svgClassName:"calendar-nav__button-icon",size:18})}),n.jsx("span",{className:"calendar-nav__title h5","aria-live":"polite",children:ro(s,i.language,d,p+1)}),n.jsx("button",{type:"button",className:"calendar-nav__button",onClick:A,"aria-label":s("calendar.nextMonth","\uB2E4\uC74C \uB2EC"),children:n.jsx(Qe,{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:s("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:s("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:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]})]}),n.jsxs("div",{className:"calendar-grid",children:[u.map(v=>n.jsx("div",{className:"calendar-day-header body-3",children:v},v)),_.map((v,B)=>{if(v===null)return n.jsx("div",{className:"calendar-cell empty"},`empty-${B}`);const k=v,E=y(k),D=m[E]??[],N=Fl(E,i.language),I=b===E;return n.jsxs("div",{className:`calendar-cell${w(k)?" today":""}${I?" drag-over":""}${r?" calendar-cell--clickable":""}`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":r?s("calendar.addOnDate",{date:E}):void 0,"aria-current":w(k)?"date":void 0,onClick:r?()=>r(E):void 0,onKeyDown:r?P=>{P.target===P.currentTarget&&(P.key!=="Enter"&&P.key!==" "||(P.preventDefault(),r(E)))}:void 0,onDragOver:a?P=>{P.preventDefault(),x(E)}:void 0,onDragLeave:a?P=>{P.currentTarget.contains(P.relatedTarget)||x(null)}:void 0,onDrop:a?P=>{P.preventDefault(),C.current!=null&&(a(C.current,E),C.current=null),x(null)}:void 0,children:[n.jsx("div",{className:"calendar-cell__number body-3",children:k}),D.length>0&&(()=>{const P=[{key:"visited",label:s("calendar.legend.visited","\uBC29\uBB38"),count:D.filter(T=>(T.status??"visited")==="visited").length},{key:"scheduled",label:s("calendar.legend.scheduled","\uC608\uC57D"),count:D.filter(T=>T.status==="scheduled").length},{key:"noVisit",label:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38"),count:D.filter(T=>T.status==="noVisit").length}].filter(T=>T.count>0),K=P.length===1&&P[0].key==="visited"?s("calendar.visitCount",{count:D.length,defaultValue:"\uBC29\uBB38 {{count}}\uAC74"}):P.map(T=>s("calendar.statusCount",{label:T.label,count:T.count,defaultValue:"{{label}} {{count}}\uAC74"})).join(" \xB7 ");return n.jsxs("span",{className:"calendar-cell__visit-count caption-1","aria-label":`${N} ${K}`,children:[P.map(T=>n.jsx("span",{className:`calendar-cell__visit-dot calendar-cell__visit-dot--${T.key}`,"aria-hidden":"true"},T.key)),D.length]})})(),n.jsx("div",{className:"calendar-cell__badges",children:D.map((P,K)=>n.jsxs("div",{draggable:!!a,className:`calendar-visit-badge${P.status==="noVisit"?" calendar-visit-badge--no-visit":P.status==="scheduled"?" calendar-visit-badge--scheduled":""}${t?" calendar-visit-badge--clickable":""}${a?" calendar-visit-badge--draggable":""}`,onDragStart:a?T=>{C.current=P.id,T.dataTransfer.effectAllowed="move"}:void 0,onDragEnd:a?()=>{C.current=null,x(null)}:void 0,onClick:t?T=>{T.stopPropagation(),t(P)}:void 0,...Hu(t?()=>t(P):void 0),"aria-label":[N,P.time?Vl(P.time,s):null,P.customer,s(P.status==="noVisit"?"calendar.legend.noVisit":P.status==="scheduled"?"calendar.legend.scheduled":"calendar.legend.visited")].filter(Boolean).join(" "),children:[P.time&&n.jsx("span",{className:"calendar-visit-badge__time body-3",children:Vl(P.time,s)}),n.jsx("span",{className:"calendar-visit-badge__name body-3",children:P.customer}),P.status==="noVisit"&&n.jsx("span",{className:"calendar-visit-badge__no-visit caption-1",children:s("calendar.legend.noVisit","\uBBF8\uBC29\uBB38")})]},P.id??K))})]},k)})]})]})}const p4={page:"h3",pagePopup:"h4",popup:"h5"};function Ca({type:e="page",title:t,headingLevel:a=2,icon:r,action:l,disc:s,children:i,inGrid:u=!1,className:c,style:d}){const h=p4[e],p=t||s||l||r,f=a?`h${a}`:"div";return n.jsxs("div",{className:_e("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(Qe,{icon:r,label:typeof t=="string"?t:void 0,className:"section__icon"}),n.jsxs("div",{className:"section__title-group",children:[t&&n.jsx(f,{className:`section__title ${h}`,children:t}),s&&n.jsx("div",{className:"section__disc body-3",children:s})]})]}),l&&n.jsx("div",{className:"section__action",children:l})]}),i]})}let Yo=null,Vu=!1;function qu(){if(Vu||typeof document>"u")return;Vu=!0,document.addEventListener("keydown",t=>{t.metaKey||t.ctrlKey||t.altKey||(Yo="keyboard")},!0);const e=()=>{Yo="pointer"};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,{capture:!0,passive:!0})}qu();function Cr(){return qu(),Yo==="keyboard"}const gr=20;function h4(e){const{t}=xe.useTranslation(),{type:a,trainingDatas:r,depth:l,renderPopup:s,completedIds:i,selectedIds:u,onItemComplete:c,size:d,useDescriptionTooltip:h,onRemove:p,onMore:f,sectionType:b="page"}=e||{},[,x]=o.useState(0),C=typeof r<"u"?Array.isArray(r)?r:[]:[],m=C.length,[_,g]=o.useState(Math.min(m,gr)),A=o.useMemo(()=>Array.isArray(l)?[...l,a?.label].filter(Boolean).join(" \xB7 "):[l||"",a?.label].filter(Boolean).join(" \xB7 "),[l,a?.label]);o.useEffect(()=>{g(Math.min(m,gr))},[m]),Li("speechear.data.updated",()=>x(B=>B+1));const y=o.useRef(null),w=o.useRef(null);function v(){const B=document.activeElement;w.current=Cr()&&B&&B.closest?.(".training-block__more")?_:null,g(k=>Math.min(m,k+gr))}return o.useEffect(()=>{const B=w.current;if(B==null)return;w.current=null;const k=document.activeElement;k&&k!==document.body||y.current?.querySelectorAll(".training-block-button")[B]?.focus()},[_]),n.jsxs(Ca,{type:b,title:a?.label,icon:a?.icon,disc:a?.desc,className:"training-block",children:[n.jsx("div",{className:"training-list",ref:y,children:(C||[]).slice(0,_).map((B,k)=>{const E=B;return n.jsx(Mo,{index:k,type:a,trainingData:E,depth:A,renderPopup:s,completedIds:i,selectedIds:u,size:d,useDescriptionTooltip:h,onRemove:typeof p=="function"&&u!=null&&E?.id!=null&&u.has(String(E.id))?()=>p(E):void 0,onComplete:typeof c=="function"&&E?.id!=null?()=>c(String(E.id)):void 0,onMore:typeof f=="function"?D=>f(E,D):void 0},E?.id!=null?`${a?.key||"t"}-${String(E.id)}`:`${a?.key||"t"}-${k}`)})}),m>gr&&_<m&&n.jsx("div",{className:"training-block__more",children:n.jsx(fe,{htmlType:"button",size:48,type:"bar",icon:"plus",onClick:v,ariaLabel:t("common.loadMore","\uB354\uBCF4\uAE30"),label:t("common.loadMore","\uB354\uBCF4\uAE30"),variant:"main"})})]})}function m4(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 f4({gap:e=10,count:t,className:a,children:r}){const l=o.useRef(null),[s,i]=o.useState({width:0,card:0}),u=t??m4(r);o.useLayoutEffect(()=>{const f=l.current;if(!f)return;const b=()=>{const C=f.style.maxWidth;f.style.maxWidth="none";const m=f.clientWidth;f.style.maxWidth=C;const _=f.firstElementChild?.offsetWidth??0;i(g=>g.width===m&&g.card===_?g:{width:m,card:_})};if(b(),typeof ResizeObserver>"u")return;const x=new ResizeObserver(b);return x.observe(f),()=>x.disconnect()},[u,e]);const c=s.card>0?s.card:0,d=c>0?xC(s.width,c,e):0,h=d>0?_C(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:l,className:_e("training-block-grid",h>0&&"training-block-grid--measured",a),style:p,"data-cols":h>0?h:void 0,children:r})}function Zo(e){const t=o.useRef(null),a=o.useRef(e);a.current=e;const[r,l]=o.useState({url:e,loading:!!e,failed:!1}),s=r.url===e?r:{loading:!!e,failed:!1};o.useEffect(()=>{const c=t.current;l({url:e,failed:!1,loading:!!e&&!(c?.complete&&c.naturalWidth>0)})},[e]);const i=o.useCallback(()=>{a.current===e&&l({url:e,loading:!1,failed:!1})},[e]),u=o.useCallback(()=>{a.current===e&&l({url:e,loading:!1,failed:!0})},[e]);return{imgRef:t,loading:s.loading,failed:s.failed,hasImage:!!e&&!s.failed,onLoad:i,onError:u}}var C4='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 g4=C4,Xo=o.forwardRef(function({item:e,disabled:t=!1,onPlayDone:a,selectable:r=!1,selected:l=!1,onSelect:s,flipDelay:i=0,hideLabel:u=!1,hideAudio:c=!1,orderRank:d=null},h){const{t:p}=xe.useTranslation(),f=e.word||e.title||"",b=t||!f,x=e.audio??e.sound??e.audioKey,C=e.subLabel||e.pronunciation||"",m=e.colloquialLabel||"",[_,g]=o.useState({label:f,subLabel:C,colloquialLabel:m,homonum:e.homonum});f&&(_.label!==f||_.subLabel!==C||_.colloquialLabel!==m||!Object.is(_.homonum,e.homonum))&&g({label:f,subLabel:C,colloquialLabel:m,homonum:e.homonum});const A=o.useRef(null),y=un("(max-width: 767px)"),[w,v]=o.useState(!1),B=`${typeof x=="string"?x:x?.src??""}\0${f}`,[k,E]=o.useState({for:"",url:""}),D=k.for===B?k.url:"",N=Rl(),I=e.textOnly??(!e.image&&!!_.label&&!!N&&N.entries.length>0&&!N.byWord.has(_.label)),P=I?"":sa()?.(_.label,_.homonum)??e.image??"",{imgRef:K,loading:T,hasImage:M,onLoad:L,onError:Q}=Zo(P);o.useEffect(()=>{let R=!1;return(async()=>{if(x){if(typeof x=="string"){if(x.startsWith("http")||x.includes("/")){E({for:B,url:x});return}}else if(typeof x=="object"&&!Array.isArray(x)){const Z=x.src;if(Z){E({for:B,url:Z});return}}}const F=Na();if(F&&f)try{const Z=await Promise.resolve(F(f));!R&&Z&&E({for:B,url:Z})}catch{}})(),()=>{R=!0}},[x,f,B]);const H=o.useRef(!0),O=o.useRef(null);o.useEffect(()=>(H.current=!0,()=>{H.current=!1,O.current&&pr(O.current),O.current=null;try{A.current?.pause()}catch{}A.current=null}),[]);const U=o.useCallback(()=>new Promise(R=>{if(typeof window<"u"&&window.speechSynthesis&&f){v(!0),window.speechSynthesis.cancel();const F=new SpeechSynthesisUtterance(f);F.lang="ko-KR",F.onend=()=>{v(!1);try{a?.()}catch{}R()},F.onerror=()=>{v(!1),R()},window.speechSynthesis.speak(F)}else R()}),[f,a]),$=o.useCallback(R=>{const F=hr(R,Z=>{if(v(!1),Z)try{a?.()}catch{}});return A.current=F.el,F.done},[a]),V=o.useCallback(async()=>{if(t||!H.current)return;const R=()=>{O.current===R&&(O.current=null);try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1)},F=dr(R);O.current=R;try{window.speechSynthesis?.cancel()}catch{}try{if(D&&(v(!0),await $(D)))return;const Z=Zr();if(Z&&f)try{const pe=await Promise.resolve(Z(f));if(!H.current||O.current!==R||pe&&(v(!0),await $(pe)))return}catch{}if(!H.current||O.current!==R)return;await U()}finally{F(),O.current===R&&(O.current=null)}},[t,D,f,$,U]);o.useImperativeHandle(h,()=>({play:()=>V()}),[V]);const z=R=>R.stopPropagation(),Y=o.useCallback(R=>{if(R.stopPropagation(),!t){if(w){try{A.current?.pause()}catch{}try{window.speechSynthesis?.cancel()}catch{}v(!1);return}V()}},[t,w,V]),S=_e("training-word-card",t?"training-word-card--disabled":"",b?"training-word-card--flipped":"",r?"training-word-card--selectable":"",l?"training-word-card--selected":"");return n.jsx("div",{className:S,onClick:r&&!t?s:void 0,role:r?"button":void 0,"aria-pressed":r?l:void 0,tabIndex:r&&!t?0:void 0,"aria-disabled":r&&t?!0:void 0,onKeyDown:r&&!t?R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" "||R.key==="Spacebar")&&(R.preventDefault(),s?.())}:void 0,children:n.jsxs("div",{className:"training-word-card__flipper",style:{transitionDelay:b?"0ms":`${i}ms`},children:[n.jsxs("div",{className:"training-word-card__front",children:[l&&n.jsx("div",{className:"training-word-card__selected-badge",onClick:z,children:n.jsx(Et,{type:"dot",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:I?n.jsx("div",{className:"training-word-card__text-face",children:_.label}):M?n.jsxs(n.Fragment,{children:[T&&n.jsx("div",{className:"training-word-card__spinner"}),n.jsx("img",{ref:K,className:"training-word-card__image",src:P,alt:_.label||p("common.image","\uC774\uBBF8\uC9C0"),style:{opacity:T?0:1},onLoad:L,onError:Q})]}):n.jsx("div",{className:"training-word-card__placeholder"})}),!u&&n.jsxs("div",{className:"training-word-card__body",children:[!I&&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?z:void 0,children:n.jsx(fe,{htmlType:"button",size:y?40:48,type:y?"dot":"bar",icon:w?"pause":"play",label:y?void 0:p("training.playSound","\uC18C\uB9AC \uB4E3\uAE30"),selected:w,onClick:Y,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("${g4}")`}})})]})})}),b4=260;function On(e){const{t}=xe.useTranslation(),{title:a,subtitle:r,headerActions:l,headerSegment:s,children:i,buttons:u,footer:c,footerStart:d,footerEnd:h,footerNote:p,footerNoteDivider:f=!1,footerClassName:b="",footerLayout:x="center",onClose:C,closeDisabled:m=!1,beforeClose:_,closeOnBackdrop:g=!0,className:A="",ariaLabel:y,useTitle:w=!0,inline:v=!1,size:B,layer:k="modal",height:E,fillBody:D=!1,resetScrollKey:N}=e||{},[I,P]=o.useState(!1),K=o.useRef(!1),T=o.useRef(null),M=o.useId(),L=o.useRef(null);o.useEffect(()=>{},[v,a,y,A]),o.useEffect(()=>{N!==void 0&&L.current&&(L.current.scrollTop=0)},[N]);const[Q,H]=o.useState(!1);o.useEffect(()=>{const W=L.current;if(!W)return;const ie=()=>H(W.scrollHeight>W.clientHeight+1);if(ie(),typeof ResizeObserver>"u")return;const q=new ResizeObserver(ie);q.observe(W);const G=W.firstElementChild;return G&&q.observe(G),()=>q.disconnect()},[i,N]),o.useEffect(()=>{if(!v)return fu()},[v]);const O=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{if(v)return;const W=O.current,ie=T.current;return mo(ie,W),ie&&!ie.contains(document.activeElement)&&(ie.querySelector(gn)??ie).focus(),()=>{const q=document.activeElement;(!q||q===document.body||ie&&ie.contains(q))&&fo(W)?.focus?.()}},[v]),po(T,!v);const U=o.useRef(!0),$=Co(),V=o.useRef(null);o.useEffect(()=>(U.current=!0,()=>{U.current=!1,V.current&&(clearTimeout(V.current),V.current=null)}),[]);const z=o.useCallback(()=>{!U.current||!K.current||(K.current=!1,P(!1))},[]),Y=o.useCallback((W,ie=!1)=>{if(ie&&!U.current||K.current)return;K.current=!0,P(!0);const q=setTimeout(()=>{V.current===q&&(V.current=null);let G;try{G=W?W():void 0}catch{z();return}G&&typeof G.then=="function"&&G.then(()=>{setTimeout(z,120)},z)},$?0:b4);ie&&(V.current=q)},[z,$]),S=o.useCallback(()=>{m||_&&_()===!1||Y(C,!0)},[Y,C,m,_]),R=o.useRef(S);o.useEffect(()=>{R.current=S});const F=!v&&!!C;o.useEffect(()=>{if(F)return Gn(()=>R.current())},[F]);const Z=F&&g,pe=o.useRef(!1),re=W=>{pe.current=W.target===W.currentTarget},oe=W=>{const ie=pe.current;pe.current=!1,ie&&W.target===W.currentTarget&&S()},ae=n.jsx("div",{className:`popup ${v?"popup--inline":""} ${k==="belowPagePopup"?"popup--below-page-popup":""} ${I?"popup--closing":""} ${A}`,onPointerDown:Z?re:void 0,onClick:Z?oe:void 0,onMouseDown:v?void 0:W=>{W.target===W.currentTarget&&W.preventDefault()},children:n.jsxs("div",{ref:T,className:`popup-panel${B?` popup-panel--${B}`:""}${E!=null?" popup-panel--has-height":""}${D?" popup-panel--fill-body":""}`,style:E!=null?{"--popup-height":typeof E=="number"?`${E}px`:E}:void 0,tabIndex:-1,role:v?void 0:"dialog","aria-modal":v?void 0:!0,"aria-labelledby":!v&&w&&a?M:void 0,"aria-label":!v&&!(w&&a)?y??(typeof a=="string"?a:void 0):void 0,children:[!w&&(l||C)?n.jsxs("div",{className:"popup-close-float",children:[l,C&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:m,ariaLabel:t("common.close","\uB2EB\uAE30")})]}):a||l||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:M,className:"popup-title popup-title--left h2",children:a}):n.jsx("span",{id:M,className:"popup-title popup-title--left h2"}),r&&n.jsx("span",{className:"popup-subtitle body-3",children:r})]}),s&&n.jsx("div",{className:"popup-header-segment",children:n.jsx(bn,{size:40,ariaLabel:s.ariaLabel,options:s.options.map(W=>({key:W.key,label:W.label,disabled:W.disabled})),value:s.value,onChange:s.onChange})}),n.jsxs("div",{className:"popup-header-actions",children:[l,C&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,onClick:S,disabled:m,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:Y,closeWithAnimation:S}):i})}),p!=null&&p!==!1&&n.jsx("div",{className:`popup-footer-note caption-1${f?" popup-footer-note--divider":""}`,role:"note",children:p}),d||h?n.jsxs("div",{className:`popup-footer popup-footer--bar${b?` ${b}`:""}`,children:[n.jsx("div",{className:"popup-footer__start",children:typeof d=="function"?d({animateThen:Y,closeWithAnimation:S}):d}),n.jsx("div",{className:"popup-footer__end",children:typeof h=="function"?h({animateThen:Y,closeWithAnimation:S}):h})]}):u?.length?n.jsx("div",{className:`popup-footer popup-footer--buttons${x!=="center"?` popup-footer--${x}`:""}`,children:u.map((W,ie)=>n.jsx(fe,{htmlType:"button",size:48,variant:W.variant??"default",label:W.label,disabled:W.disabled,onClick:()=>W.onClick?.({animateThen:Y,closeWithAnimation:S})},ie))}):c?n.jsx("div",{className:`popup-footer${x!=="center"?` popup-footer--${x}`:""}${b?` ${b}`:""}`,children:typeof c=="function"?c({animateThen:Y,closeWithAnimation:S}):c}):null]})});return v||typeof document>"u"?ae:nn.createPortal(ae,document.body)}function br(e){return String(e)}const yr=["o","triangle","x"];function Uu(e,t){return e===t?null:t}const Gu={o:"circle",triangle:"triangle",x:"x"},Ku={o:"main",triangle:"warn",x:"danger"};function y4(e){let t=0,a=0,r=0;for(const s of Object.values(e))s==="o"?t++:s==="triangle"?a++:s==="x"&&r++;const l=t+a+r;return{marked:l,o:t,triangle:a,x:r,rate:l===0?null:(t+a*.5)/l}}function Jo(e){const t={};for(const[a,r]of Object.entries(e))(r==="o"||r==="triangle"||r==="x")&&(t[a]=r);return t}function Yu(e){const t=[];let a=0;for(const r of e)t.push(a),a+=r;return t}function v4(e,t){return!t&&e>0}const ga={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 x4(e="landscape"){St("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}=ga[e],l=document.createElement("style");l.textContent=`@page { size: ${t}; margin: 0; } .word-table { width: ${a} !important; height: ${r} !important; }`,document.head.appendChild(l);const s=()=>{document.head.removeChild(l),window.removeEventListener("afterprint",s)};window.addEventListener("afterprint",s),window.print()}function Zu(e,t){if(e.length===0)return[[]];const a=Math.max(1,Math.floor(t)),r=[];for(let l=0;l<e.length;l+=a)r.push(e.slice(l,l+a));return r}const _4={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}},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}}};function w4(e,t){const a=_4[e][t];if(a)return a;const r=Math.max(1,Math.ceil(t)),l=Math.max(1,Math.ceil(Math.sqrt(r*.707)));let s,i;return e==="landscape"?(i=l,s=Math.ceil(r/i)):(s=l,i=Math.ceil(r/s)),(e==="landscape"?s<i:i<s)&&([s,i]=[i,s]),{cols:s,rows:i}}const B4={show:"word-table-block__content--cut-show",dashed:"",corner:"word-table-block__content--cut-corner",hide:""},Xu={\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"},Ju={\uACE0\uC720:"\uACE0\uC720\uC5B4",\uD55C\uC790:"\uD55C\uC790\uC5B4",\uC678\uB798:"\uC678\uB798\uC5B4",\uD63C\uC885:"\uD63C\uC885\uC5B4"},Qo={\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"},es={\uACE0\uC720:"native",\uD55C\uC790:"sino",\uC678\uB798:"foreign",\uD63C\uC885:"mixed"};function Qu(e){return Object.fromEntries(Object.entries(Xu).map(([t,a])=>[t,Qo[t]?e(`wordTable.pos.${Qo[t]}`,{defaultValue:a}):a]))}function ec(e){return Object.fromEntries(Object.entries(Ju).map(([t,a])=>[t,es[t]?e(`wordSearch.filter.type.${es[t]}`,{defaultValue:a}):a]))}const k4={pos:Qo,wordType:es};function ts(e,t){return e?e.split("/").map(a=>t[a]??a).join("/"):""}function tc(e,t,a,r){if(r!=="dashed")return{};const l=e%t,s=Math.floor(e/t),i=l<t-1,u=s<a-1;if(!i&&!u)return{};const c="#ddd",d=b=>`repeating-linear-gradient(to ${b}, ${c} 0, ${c} 5px, transparent 5px, transparent 10px)`,h=[],p=[],f=[];return i&&(h.push(d("bottom")),p.push("1px 100%"),f.push("right center")),u&&(h.push(d("right")),p.push("100% 1px"),f.push("center bottom")),{backgroundImage:h.join(", "),backgroundSize:p.join(", "),backgroundPosition:f.join(", "),backgroundRepeat:"no-repeat",printColorAdjust:"exact",WebkitPrintColorAdjust:"exact"}}const A4=280,N4=240,E4=280,D4=400,S4=120,j4=280;function nc(e,t){const a=o.useRef(null),[r,l]=o.useState(1),[s,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,f=Math.min(1,h,p);l(f),i(Math.max(0,(c-e*f)/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:s}}const T4=24,M4={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},L4=400,ac=8;function rc({label:e,subLabel:t,colloquialLabel:a,homonum:r,showWord:l=!0,showImage:s=!0,showPronunciation:i=!0,showColloquial:u=!0,buttonSize:c=40,wordInfo:d,outerScale:h=1}){const{t:p}=xe.useTranslation(),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,m]=o.useState(1),[_,g]=o.useState(!1),[A,y]=o.useState({for:"",url:""}),[w,v]=o.useState(null),B=t&&t.length>0?t:Gf()?.(e,r)??"",k=sa()?.(e,r)??"",{imgRef:E,loading:D,failed:N,onLoad:I,onError:P}=Zo(k),K=o.useCallback(()=>v(b.current?.getBoundingClientRect()??null),[]),T=o.useCallback(()=>v(null),[]),M=bo(!!w,R=>{R?K():T()},b),L=o.useMemo(()=>{if(!d)return null;const R=[];return d.grade&&R.push(p("wordTable.info.grade",{n:d.grade,defaultValue:"\uB09C\uC774\uB3C4: {{n}}\uB4F1\uAE09"})),d.syllables&&R.push(p("wordTable.info.syllables",{n:d.syllables,defaultValue:"\uC74C\uC808 \uC218: {{n}}\uC74C\uC808"})),d.pos&&R.push(p("wordTable.info.pos",{v:ts(d.pos,Qu(p)),defaultValue:"\uD488\uC0AC: {{v}}"})),d.wordType&&R.push(p("wordTable.info.wordType",{v:ts(d.wordType,ec(p)),defaultValue:"\uC720\uD615: {{v}}"})),R.length?R:null},[d,p]),Q=B||e,H=A.for===Q?A.url:"";o.useEffect(()=>{const R=Na(),F=B||e;if(!R||!F)return;let Z=!1;return Promise.resolve(R(F)).then(pe=>{!Z&&pe&&y({for:F,url:pe})}),()=>{Z=!0}},[B,e]);const O=o.useRef(null),U=o.useRef(null);o.useEffect(()=>()=>{x.current?.pause(),U.current?.()},[]);const $=o.useCallback(R=>{if(R.stopPropagation(),_){O.current?.();return}if(!H)return;g(!0);const F=hr(H,()=>{g(!1),U.current?.()});x.current=F.el,O.current=F.stop,U.current=dr(F.stop)},[_,H]),V=s&&!!k&&!N,z=V&&l?A4:V?E4:N4,Y=V&&l?D4:V?j4:S4;o.useEffect(()=>{const R=f.current;if(!R||typeof ResizeObserver>"u")return;const F=new ResizeObserver(([Z])=>{const{width:pe,height:re}=Z.contentRect;m(Math.min(pe/z,re/Y))});return F.observe(R),()=>F.disconnect()},[z,Y]);const S=c*h<T4;return n.jsxs("div",{ref:f,className:_e("word-table-cell",S&&"word-table-cell--tap-too-small",V?"word-table-cell--with-image":""),"data-ref-w":z,"data-ref-h":Y,children:[n.jsxs("div",{className:"word-table-cell__inner",style:{transform:`scale(${C})`},children:[V&&n.jsxs("div",{className:"word-table-cell__image-wrap",children:[D&&n.jsx("div",{className:"word-table-cell__spinner"}),n.jsx("img",{ref:E,className:"word-table-cell__image",src:k,alt:e,draggable:!1,style:{opacity:D?0:1},onLoad:I,onError:P})]}),l&&n.jsx("span",{className:"word-table-cell__word h0",children:e}),i&&B&&n.jsxs("span",{className:"word-table-cell__sub h3",children:["[",B,"]"]}),u&&a&&n.jsxs("span",{className:"word-table-cell__colloquial h5",children:["[",a,"]"]})]}),n.jsxs("div",{className:"word-table-cell__play-button","data-audio-src":H,children:[n.jsx("span",{"data-play-state":"play",style:{display:_?"none":void 0},children:n.jsx(fe,{htmlType:"button",size:c,type:"dot",icon:"play",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:p("common.play","\uC7AC\uC0DD"),ariaLabel:e?p("common.playFor",{name:e,defaultValue:`${e} \uC7AC\uC0DD`}):p("common.play","\uC7AC\uC0DD"),onClick:$})}),n.jsx("span",{"data-play-state":"pause",style:{display:_?void 0:"none"},children:n.jsx(fe,{htmlType:"button",size:c,type:"dot",icon:"pause",useBorder:!1,selected:!0,showTooltipInfo:p("common.pause","\uBA48\uCDA4"),ariaLabel:e?p("common.pauseFor",{name:e,defaultValue:`${e} \uBA48\uCDA4`}):p("common.pause","\uBA48\uCDA4"),onClick:$})})]}),d&&n.jsxs("div",{ref:b,className:"word-table-cell__info-button",onPointerEnter:R=>{ca(R)||K()},onPointerLeave:R=>{ca(R)||T()},onFocus:()=>{da()||K()},onBlur:T,children:[n.jsx(fe,{htmlType:"button",size:c,type:"dot",icon:"info",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:!1,ariaLabel:p("wordTable.wordInfo","{{word}} \uB0B1\uB9D0 \uC815\uBCF4",{word:e}),onClick:R=>{R.stopPropagation(),M.touchPress()}}),w&&L&&n.jsx(Kn,{anchorRect:w,items:L,showIndex:!1})]})]})}function ba({title:e,titleIcon:t,disc:a,className:r,orientation:l="landscape",contentTypes:s=["image","word","standardPron"],cutLine:i="show",showOutline:u=!0,showDivLine:c=!0,items:d,editCells:h,count:p,activeCell:f=null,onActivateCell:b,onRemoveCell:x,onRemoveItem:C,onReorder:m,renderCellAction:_,showFillerAdd:g=!1,contentRef:A,buttonSize:y=40,brand:w,code:v,pageNumber:B,pageNumberPosition:k="right",fitHeight:E=!1,scoring:D=!1,marks:N,onMarkClick:I,scoreIndexOffset:P=0}){const K=o.useCallback((ke,$e)=>{I?.(P+ke,$e)},[I,P]),T=(ke,$e)=>{const je=N?.[br(P+ke)]??null;return n.jsx("div",{className:_e("word-table-cell__score",je?"word-table-cell__score--marked":""),style:qe>1?{transform:`translateX(-50%) scale(${qe})`,transformOrigin:"bottom center"}:void 0,children:yr.map(Ze=>n.jsx("span",{className:_e("word-table-cell__score-slot",je===Ze?"word-table-cell__score-slot--on":""),children:n.jsx(fe,{htmlType:"button",size:y,type:"dot",shape:"pill",icon:Gu[Ze],variant:je===Ze?Ku[Ze]:"default",selected:je===Ze,useBorder:!1,...Ae?{}:{tabIndex:-1,role:"img"},showTooltipInfo:M(`wordTable.scoring.markName.${Ze}`,{defaultValue:Ze}),ariaLabel:M(`wordTable.scoring.${Ze}`,{word:$e,defaultValue:`${$e} ${Ze}`}),onClick:Ae?yt=>{yt.stopPropagation(),K(ke,Ze)}:void 0})},Ze))})},{t:M}=xe.useTranslation(),L=h!==void 0,Q=e!=null||!!t||!!a,H=un("(max-width: 767px)"),O=o.useRef(null),[U,$]=o.useState(null),V=d?.length??0,[z,Y]=o.useState(null),[S,R]=o.useState(""),F=o.useRef(null),Z=o.useRef(null),pe=o.useRef(null),re=o.useRef(null),oe=o.useCallback(ke=>{Z.current=ke,typeof A=="function"?A(ke):A&&(A.current=ke)},[A]),ae=o.useCallback((ke,$e)=>{F.current=$e,m?.(ke,$e),R(M("wordTable.reorder.moved",{n:$e+1,total:V,defaultValue:"{{total}}\uCE78 \uAC00\uC6B4\uB370 {{n}}\uBC88\uC9F8\uB85C \uC62E\uAE40"}))},[m,M,V]);o.useEffect(()=>{const ke=F.current;ke!=null&&(F.current=null,Z.current?.querySelectorAll(".word-table-block__card:not(.word-table-block__card--filler)")?.[ke]?.querySelector(".word-table-block__card-handle button")?.focus())}),o.useEffect(()=>()=>{re.current?.()},[]);const W=o.useCallback((ke,$e)=>{if(!m||!ke.altKey||ke.ctrlKey||ke.metaKey)return;const je=ke.key==="ArrowRight";if(!je&&ke.key!=="ArrowLeft")return;ke.preventDefault();const Ze=$e+(je?1:-1);Ze<0||Ze>=V||ae($e,Ze)},[m,V,ae]),ie=o.useCallback((ke,$e)=>{if(!m||ke.pointerType==="mouse")return;const je=ke.target.closest?.("button");if(je&&!je.closest(".word-table-block__card-handle"))return;re.current?.();const Ze={x:ke.clientX,y:ke.clientY};let yt=!1;const et=ne=>{yt&&ne.cancelable&&ne.preventDefault()};let Xe=null,_t=null;const Ct=()=>{const ne=_t;if(!ne)return;const Ne=document.elementFromPoint?.(ne.x,ne.y)?.closest?.("[data-wordtable-cell]"),Je=Ne?Number(Ne.dataset.wordtableCell):NaN,Ve=Number.isInteger(Je)?Je:null;pe.current=Ve,$(it=>it===Ve?it:Ve)},wt=ne=>{if(!yt){(Math.abs(ne.clientX-Ze.x)>ac||Math.abs(ne.clientY-Ze.y)>ac)&&rt();return}if(_t={x:ne.clientX,y:ne.clientY},typeof requestAnimationFrame>"u"){Ct();return}Xe===null&&(Xe=requestAnimationFrame(()=>{Xe=null,Ct()}))},Bt=()=>{Xe!==null&&(cancelAnimationFrame(Xe),Xe=null,Ct());const ne=pe.current,Ne=yt;rt(),Ne&&ne!=null&&ne!==$e&&ae($e,ne)},mt=setTimeout(()=>{yt=!0,Y($e),pe.current=$e,$($e),window.addEventListener("touchmove",et,{passive:!1})},L4);function rt(){clearTimeout(mt),window.removeEventListener("pointermove",wt),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),window.removeEventListener("touchmove",et),yt=!1,Xe!==null&&(cancelAnimationFrame(Xe),Xe=null),pe.current=null,re.current=null,Y(null),$(null)}re.current=rt,window.addEventListener("pointermove",wt),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)},[m,ae]),{width:q,height:G}=ga[l],de=typeof E=="number"?E:E&&typeof E=="object"?H?E.narrow:E.wide:null,{scalerRef:Ee,scale:ye,offset:he}=nc(q,E?G:void 0),se=L?h?.length??0:d?.length??0,Ce=Math.max(p??se,1),{cols:ge,rows:ce}=w4(l,Ce),Me={word:s.length===0||s.includes("word"),image:s.length===0||s.includes("image"),pron:s.length===0||s.includes("standardPron"),colloq:s.length===0||s.includes("colloquialPron")},Oe=L?(h??[]).some(ke=>ke!==null&&ke.length>1):(d??[]).some(ke=>(ke.words??[]).length>1),Le=!!w?.show,ze=!!w?.show&&w?.top!==!1,We=!!w?.show&&w?.bottom!==!1,dt=w?.copyright??"\xA9 IHAB, Inc. All rights reserved.",lt=_e("word-table-block__content",B4[i],u&&"word-table-block__content--outline",c&&Oe&&"word-table-block__content--div-line",!Le&&B&&k!=="none"&&"word-table-block__content--page-number",ze&&"word-table-block__content--brand-top",We&&"word-table-block__content--brand-bottom"),at={transform:`scale(${1/ye})`,transformOrigin:"center center"},ht=y*yr.length+4*(yr.length-1),Ae=!!I,qe=Ae?Math.max(1,Math.min(1/ye,q/ge/ht)):1,we=n.jsxs("div",{ref:Ee,className:"word-table__scaler",style:{height:G*ye},children:[n.jsx("div",{className:_e("word-table",D&&!Ae&&"word-table--score-readonly",!Q&&r),style:{width:q,height:G,transform:`scale(${ye})`,transformOrigin:"top left",marginLeft:he},children:n.jsxs("div",{ref:oe,className:lt,style:{gridTemplateColumns:`repeat(${ge}, 1fr)`,gridTemplateRows:`repeat(${ce}, 1fr)`},children:[L?n.jsx(n.Fragment,{children:(h??[]).map((ke,$e)=>n.jsx("div",{className:_e("word-table-block__edit-cell",ke?"word-table-block__edit-cell--filled":"word-table-block__edit-cell--empty",f===$e?"word-table-block__edit-cell--active":""),style:tc($e,ge,ce,i),children:ke?n.jsxs(n.Fragment,{children:[ke.map((je,Ze)=>n.jsxs(o.Fragment,{children:[Ze>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(rc,{outerScale:ye,label:je.word,subLabel:je.pronunciation,colloquialLabel:je.colloquialPronunciation,homonum:je.homonum,showWord:Me.word,showImage:Me.image,showPronunciation:Me.pron,showColloquial:Me.colloq,buttonSize:y})]},Ze)),D&&T($e,ke.map(je=>je.word).join(" / ")),x&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(fe,{htmlType:"button",size:y,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:ke.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:ke.length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>x($e)})})]}):b&&n.jsx("div",{style:at,children:n.jsx(fe,{htmlType:"button",size:"48",type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>b($e)})})},$e))}):n.jsxs(n.Fragment,{children:[(d??[]).map((ke,$e)=>n.jsxs("div",{"data-wordtable-cell":m?$e:void 0,className:`word-table-block__card${m?" word-table-block__card--draggable":""}${U===$e?" word-table-block__card--drag-over":""}${z===$e?" word-table-block__card--dragging":""}`,style:tc($e,ge,ce,i),draggable:!!m,onPointerDown:m?je=>ie(je,$e):void 0,onKeyDown:m?je=>W(je,$e):void 0,onDragStart:m?()=>{O.current=$e}:void 0,onDragOver:m?je=>{je.preventDefault(),$($e)}:void 0,onDragLeave:m?()=>$(null):void 0,onDrop:m?je=>{je.preventDefault(),O.current!==null&&O.current!==$e&&m(O.current,$e),O.current=null,$(null)}:void 0,onDragEnd:m?()=>{O.current=null,$(null)}:void 0,children:[(ke.words??[]).map((je,Ze)=>n.jsxs(o.Fragment,{children:[Ze>0&&n.jsx("div",{className:"word-table-block__pair-divider"}),n.jsx(rc,{outerScale:ye,label:je.label,subLabel:je.subLabel,colloquialLabel:je.colloquialLabel,homonum:je.homonum,showWord:Me.word,showImage:Me.image,showPronunciation:Me.pron,showColloquial:Me.colloq,buttonSize:y,wordInfo:je.grade||je.syllables!=null||je.pos||je.wordType?{grade:je.grade,syllables:je.syllables,pos:je.pos,wordType:je.wordType}:void 0})]},Ze)),D&&T($e,(ke.words??[]).map(je=>je.label).join(" / ")),m&&n.jsx("div",{className:"word-table-block__card-handle",children:n.jsx(fe,{htmlType:"button",size:y,type:"dot",icon:"grip-vertical",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:M("wordTable.reorder.hint","Alt + \u2190 \u2192 \uB85C \uC21C\uC11C \uBC14\uAFB8\uAE30"),ariaLabel:M("wordTable.reorder.handle",{word:(ke.words??[]).map(je=>je.label).join(" / "),defaultValue:"{{word}} \uC21C\uC11C \uBC14\uAFB8\uAE30 (Alt + \uD654\uC0B4\uD45C)"})})}),(_||C)&&n.jsxs("div",{className:"word-table-block__card-actions",children:[_?.($e,ke),C&&n.jsx("div",{className:"word-table-block__card-close",children:n.jsx(fe,{htmlType:"button",size:y,type:"dot",icon:"x",variant:"transparent-lightGray",useBorder:!1,showTooltipInfo:(ke.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),ariaLabel:(ke.words??[]).length>1?M("wordPrint.removePair","\uB300\uB9BD\uC30D \uBE7C\uAE30"):M("wordPrint.removeWord","\uB2E8\uC5B4 \uBE7C\uAE30"),onClick:()=>C(ke.id)})})]})]},ke.id)),Array.from({length:Math.max(0,ge*ce-(d?.length??0))}).map((ke,$e)=>{const je=(d?.length??0)+$e<Ce;return n.jsx("div",{className:"word-table-block__card word-table-block__card--filler",children:g&&b&&je&&n.jsx("div",{style:at,children:n.jsx(fe,{htmlType:"button",size:y,type:"bar",icon:"plus",label:M("wordTable.addWord","\uCD94\uAC00\uD558\uAE30"),onClick:()=>b((d?.length??0)+$e)})})},`filler-${$e}`)})]}),ze&&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:w?.topLogo?.src??cr,alt:w?.topLogo?.alt??"\uB9D0\uADC0"}),(()=>{const ke=[w?.title&&n.jsx("span",{className:"word-table__paper-title",children:w.title},"t"),w?.owner&&n.jsx("span",{className:"word-table__owner",children:w.owner},"o"),v&&n.jsx("span",{className:"word-table__code",children:v},"c")].filter(Boolean);return ke.length===0?null:n.jsx("span",{className:"word-table__ident",children:ke.map(($e,je)=>n.jsxs(o.Fragment,{children:[je>0&&n.jsx("span",{className:"word-table__ident-dot","aria-hidden":"true",children:"\xB7"}),$e]},je))})})()]})}),We&&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:[w?.bottomLogo?n.jsx("img",{className:"word-table__brand-logo--ihab word-table__brand-logo--given",src:w.bottomLogo.src,alt:w.bottomLogo.alt}):n.jsx("span",{className:"word-table__brand-logo--ihab",role:"img","aria-label":"IHAB"}),n.jsx("span",{className:"word-table__copyright",children:dt})]}),n.jsxs("span",{className:"word-table__band-end",children:[w?.link&&n.jsx("span",{className:"word-table__link",children:w.link}),B&&k!=="none"&&n.jsx("span",{className:"word-table__page-count",children:M("wordTable.filter.pageIndicator",{current:B.current,total:B.total})})]})]})}),!Le&&B&&k!=="none"&&n.jsx("span",{className:`word-table__page-number body-3 word-table__page-number--${k}`,children:M("wordTable.filter.pageIndicator",{current:B.current,total:B.total})})]})}),m&&n.jsx("span",{role:"status",style:M4,children:S})]}),Ue=de==null?we:n.jsx("div",{className:"word-table__frame",style:{height:de},children:we});return Q?n.jsx(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",r),children:Ue}):Ue}function $4(e,t,a){const r=[];for(const l of e??[]){if(l.type==="note"||l.type==="input")continue;const s=l.displayLabel??l.label,i=R4(l,t?.[l.label],a);i!==null&&r.push(`${s} ${i}`)}return r.join(" \xB7 ")}function R4(e,t,a){const r=(Array.isArray(t)?t:t===void 0?[]:[t]).filter(l=>l!==fn);return r.length===0?e.allOption?e.allLabel??a:null:r.map(l=>P4(e,l)).join(", ")}function P4(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 En({title:e,titleLevel:t=2,headerAction:a,headerSummary:r,collapsible:l=!1,defaultCollapsed:s=!1,collapsed:i,onCollapsedChange:u,footer:c,sections:d,selected:h={},onSelect:p,align:f,sectionAlign:b,className:x}){const C=(f??(b==="vertical"?"newline":"inline"))==="inline",{t:m}=xe.useTranslation(),[_,g]=o.useState(s),A=i??_,y=()=>{const N=!A;g(N),u?.(N)},w=N=>{if(!l)return;const I=N.target;!I||typeof I.closest!="function"||I.closest(".filter-panel__collapse-toggle")||I.closest('button, a, input, select, textarea, label, [role="radiogroup"], [role="button"], [role="menu"]')||y()},v=o.useMemo(()=>r!==void 0||!A?"":$4(d,h,m("common.all","\uC804\uCCB4")),[r,A,d,h,m]),B=r??(v?n.jsx("span",{className:"filter-panel__header-summary body-3",children:v}):null),k=e||a||r||l,E=o.useId(),D=t?`h${t}`:"span";return n.jsxs("div",{className:_e("filter-panel",l?"filter-panel--collapsible":"",A?"filter-panel--collapsed":"",x),role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?E:void 0,children:[k&&n.jsxs("div",{className:"filter-panel__header",onClick:l?w:void 0,children:[n.jsx("div",{className:"filter-panel__title-row",children:e&&n.jsx(D,{id:E,className:"filter-panel__title h4",children:e})}),n.jsxs("div",{className:"filter-panel__header-actions",children:[A?B:a,l&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:A?"chevron-down":"chevron-up",className:"filter-panel__collapse-toggle",ariaLabel:A?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),showTooltipInfo:A?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),"aria-expanded":!A,onClick:y})]})]}),!A&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:_e("filter-panel__sections",C?"filter-panel__sections--row":""),children:d.map(N=>{const I=h[N.label],P=I===void 0||(Array.isArray(I)?I.length===0:!1),K=(N.items??[]).filter(M=>M!=null);N.allOption&&K.some(M=>(typeof M=="string"?M:M.value)===fn)&&St(`filter-panel-all-value:${N.label}`,`[FilterPanel] '${N.label}' \uC808\uC5D0 allOption \uACFC \uAC12 '${fn}' \uC778 \uBCF4\uAE30\uAC00 \uD568\uAED8 \uC788\uB2E4 \u2014 \uB450 \uC120\uD0DD\uC774 \uAD6C\uBCC4\uB418\uC9C0 \uC54A\uB294\uB2E4. \uBCF4\uAE30 \uAC12\uC744 \uBC14\uAFD4\uB77C.`);const T=M=>{const L=typeof M=="string"?M:M.value,Q=typeof M!="string"&&!!M.disabled,H=typeof M!="string"?M.labels:void 0,O=typeof M!="string"?M.displayLabel:void 0,U=typeof M!="string"?M.tooltip:void 0,$=typeof M!="string"?M.descriptionTooltip:void 0,V=typeof M!="string"?M.shape:void 0,z=Array.isArray(I)?I.includes(L):I===L;return n.jsx(fe,{htmlType:"button",size:"keyboard",label:H??O??L,type:N.itemType??(H?"bar":L.length===1?"dot":void 0),selected:z,disabled:Q,shape:V,showTooltipInfo:!!U,tooltipInfoText:U,tooltipDescription:$,onClick:()=>p?.(L,N.label)},L)};return n.jsxs(o.Fragment,{children:[N.groupLabel&&n.jsxs("div",{className:"filter-panel__group-label-row",children:[n.jsx("div",{className:"filter-panel__group-label body-2",children:N.groupLabel}),N.groupAction]}),n.jsxs("div",{className:_e("filter-panel__section",N.layout==="row"?"filter-panel__section--row":"",N.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:N.displayLabel??N.label}),N.labelAction??(N.labelInfo?n.jsx(Ha,{...N.labelInfo}):null)]}),N.type==="note"?n.jsx("div",{className:"filter-panel__note body-3",children:N.content}):N.type==="input"?n.jsx(Xn,{className:"filter-panel__textfield",placeholder:N.placeholder,ariaLabel:N.displayLabel??N.label,value:h[N.label]??"",onChange:M=>p?.(M,N.label),error:N.error}):!N.multiple&&N.display==="segmented"?n.jsx(bn,{ariaLabel:N.displayLabel??N.label,options:[...N.allOption?[{key:fn,label:N.allLabel??m("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...K.map(M=>{const L=typeof M=="string"?M:M.value,Q=typeof M!="string"?M.displayLabel:void 0,H=typeof M!="string"?M.disabled:void 0;return{key:L,label:Q??L,disabled:H}})],value:P&&N.allOption?fn:h[N.label]??"",onChange:M=>p?.(M,N.label),size:32}):!N.multiple&&N.display==="dropdown"?n.jsx(cn,{className:"filter-panel__dropdown",ariaLabel:typeof N.label=="string"?N.label:void 0,size:40,options:[...N.allOption?[{value:fn,label:N.allLabel??m("common.all","\uC804\uCCB4"),disabled:N.allOptionDisabled}]:[],...K.map(M=>{const L=typeof M=="string"?M:M.value,Q=typeof M!="string"?M.displayLabel:void 0,H=typeof M!="string"?M.disabled:void 0;return{value:L,label:Q??L,disabled:H}})],value:P&&N.allOption?fn:h[N.label],onChange:M=>p?.(M,N.label)}):n.jsxs("div",{className:N.groups?"filter-panel__item-groups":"filter-panel__items",children:[N.allOption&&!N.groups&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:N.allLabel??m("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(fn,N.label)}),N.groups?N.groups.map((M,L)=>n.jsxs("div",{className:"filter-panel__item-group",children:[L===0&&N.allOption&&n.jsx(fe,{htmlType:"button",size:"keyboard",label:N.allLabel??m("common.all","\uC804\uCCB4"),selected:P,disabled:N.allOptionDisabled,onClick:()=>p?.(fn,N.label)}),M.filter(Q=>Q!=null).map(T)]},L)):K.map(T)]})]})]},N.label)})}),c!=null&&c!==!1&&n.jsx("div",{className:"filter-panel__footer body-3",children:c})]})]})}const I4=[1,2,3,4,5,6,7,8,9,10,11,12],oc=[8,4,2,1],sn="show",vn="hide";function sc(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:"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 lc(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 ic(e){return{label:e("wordTable.filter.border","\uC678\uACFD\uC120"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function uc(e){return{label:e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function cc(e){return{label:e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function dc(e){return{label:e("wordTable.filter.cutLine","\uC808\uCDE8\uC120"),items:[{value:sn,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:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function pc(e){return{label:e("wordPrint.divLine","\uB300\uB9BD\uC120"),items:[{value:sn,displayLabel:e("wordTable.filter.show","\uD45C\uC2DC")},{value:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function hc(e,t){return{label:e(t.hasPairs?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord"),items:[t.itemCount,...oc.filter(a=>a<t.itemCount)].map(a=>({value:`${a}\uAC1C`,displayLabel:e("wordTable.filter.itemsPerPageOption",{count:a})})),display:"segmented"}}function mc(e,t){return e===t||!oc.includes(e)?Number.POSITIVE_INFINITY:e}function F4(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:vn,displayLabel:e("wordTable.filter.hide","\uBBF8\uD45C\uC2DC")}],display:"segmented"}}function fc(e){return e==="left"||e==="center"||e==="right"?e:"none"}function Cc(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?sn:vn,[e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")]:t.cutLine,[e("wordPrint.divLine","\uB300\uB9BD\uC120")]:t.showDivLine?sn:vn,...t.showTopInfo!=null?{[e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")]:t.showTopInfo?sn:vn}:{},...t.showBottomInfo!=null?{[e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")]:t.showBottomInfo?sn:vn}:{}}}function gc(e,t,a,r){return a===e("wordTable.filter.composition","\uAD6C\uC131")?t===fn?(r.setContentTypes(()=>[]),!0):(r.setContentTypes(l=>l.includes(t)?l.filter(s=>s!==t):[...l,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===sn),!0):a===e("wordTable.filter.cutLine","\uC808\uCDE8\uC120")?(r.setCutLine(t),!0):a===e("wordPrint.divLine","\uB300\uB9BD\uC120")?(r.setShowDivLine(t===sn),!0):a===e("wordTable.filter.topInfo","\uC0C1\uB2E8 \uC815\uBCF4")?(r.setShowTopInfo?.(t===sn),!0):a===e("wordTable.filter.bottomInfo","\uD558\uB2E8 \uC815\uBCF4")?(r.setShowBottomInfo?.(t===sn),!0):!1}function O4(e){return"sections"in e}function ns(e){const{t}=xe.useTranslation(),{title:a,className:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c}=e,d={collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c};if(O4(e))return n.jsx(En,{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,contentTypes:f,orientation:b,showOutline:x,cutLine:C,showDivLine:m,setters:_,showCutLine:g=!1,showDivLine2:A=!1,middleSections:y=[],extraSelected:w={},onExtraSelect:v,showPaperBands:B=!1,showTopInfo:k=!0,showBottomInfo:E=!0}=e,D=[sc(t,{hasImage:h,hasColloquial:p}),lc(t),...y,ic(t),...g?[dc(t)]:[],...A?[pc(t)]:[],...B?[uc(t),cc(t)]:[]],N={...Cc(t,{contentTypes:f,orientation:b,showOutline:x,cutLine:C,showDivLine:m,showTopInfo:k,showBottomInfo:E}),...w},I=(P,K)=>{gc(t,P,K,_)||v?.(P,K)};return n.jsx(En,{className:r,title:a??t("wordTable.filterTitle","\uD45C \uC124\uC815"),sections:D,selected:N,onSelect:I,...d,sectionAlign:"horizontal"})}function as(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function z4(e){return as(e).replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function rs(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()}let vr=null,ya=null;function W4(e,t,a,r="",l=""){if(e.length===0||ya&&ya.iframe.isConnected&&Date.now()-ya.at<1e4)return;const s=r?rs(r):"";vr?.();let i=null;if(s){const d=document.title;document.title=s,i=()=>{document.title=d,window.removeEventListener("afterprint",i),vr===i&&(vr=null)},vr=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}ya={iframe:u,at:Date.now()},c.open(),c.write(os(e,t,a,!0,s,l)),c.close(),u.contentWindow?.addEventListener("afterprint",()=>{i?.(),setTimeout(()=>{u.remove(),ya?.iframe===u&&(ya=null)},0)})}function os(e,t,a,r=!1,l="",s=""){l=l?rs(l):"";const i=Array.from(document.styleSheets).flatMap(p=>{try{return Array.from(p.cssRules).map(f=>f.cssText)}catch{return[]}}).join(`
861
861
  `),u="light",c=(()=>{try{return document.documentElement.lang||""}catch{return""}})(),d=s?`<div class="paper-head">${as(s)}</div>`:"",h=e.map(p=>{const f=p.cloneNode(!0);return f.querySelectorAll('[data-play-state="play"]').forEach(b=>b.style.display=""),f.querySelectorAll('[data-play-state="pause"]').forEach(b=>b.style.display="none"),f.querySelectorAll(".word-table-cell__score-slot:not(.word-table-cell__score-slot--on)").forEach(b=>b.remove()),f.querySelectorAll(".word-table-cell__spinner").forEach(b=>b.remove()),f.querySelectorAll("img").forEach(b=>{b.style.opacity==="0"&&(b.setAttribute("onload","this.style.opacity=''"),b.setAttribute("onerror","this.style.visibility='hidden'"))}),`<div class="paper-wrap">${d}${f.outerHTML}</div>`}).join(`
862
862
  `);return`<!DOCTYPE html>
863
863
  <html${c?` lang="${z4(c)}"`:""} data-theme="${u}">
@@ -1064,10 +1064,10 @@ ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!h)return p(
1064
1064
  `:""}
1065
1065
  <\/script>
1066
1066
  </body>
1067
- </html>`}const H4=1e3;function ss({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:l,header:s=""}){const{t:i}=xe.useTranslation(),u=o.useCallback(()=>{W4(e(),t,a,r,s)},[e,t,a,r,s]),c=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=window.open("","_blank");if(!p){l?.();return}p.document.write(os(h,t,a,!1,r,s)),p.document.close()},[e,t,a,r,l,s]),d=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=os(h,t,a,!1,r,s),f=new Blob([p],{type:"text/html;charset=utf-8"}),b=URL.createObjectURL(f),x=(r?rs(r):"")||i("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:b,download:`${x}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(b),H4)},[e,t,a,r,s,i]);return{print:u,openNewWindow:c,downloadHtml:d}}function bc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,[l,s]=o.useState("landscape"),[i,u]=o.useState(["image","word","standardPron"]),[c,d]=o.useState("show"),[h,p]=o.useState(!0),[f,b]=o.useState(!0),[x,C]=o.useState(!0),[m,_]=o.useState(!0),[g,A]=o.useState(8),[y,w]=o.useState("right"),v=e.length,B=e.some(Z=>(Z.words??[]).length>1),k=e.some(Z=>(Z.words??[]).some(G=>!!G.colloquialLabel)),E=Math.min(g,Math.max(v,1)),D=o.useMemo(()=>Zu(e,E),[e,E]),N=D.length>1,I=E,[R,Y]=o.useState(!1);o.useEffect(()=>{let Z=!1;if(!sa()){Y(!1);return}return Promise.all(e.flatMap(G=>(G.words??[]).map(O=>Nl(O.label,O.homonum)))).then(G=>{Z||Y(G.some(Boolean))},()=>{}),()=>{Z=!0}},[e]);const M=o.useMemo(()=>[sc(a,{hasImage:R,hasColloquial:k}),lc(a),...v>0?[hc(a,{hasPairs:B,itemCount:v})]:[],ic(a),...I>1?[dc(a)]:[],...B?[pc(a)]:[],...r?[uc(a),cc(a)]:[]],[a,R,k,v,B,N,I,r]),T={...Cc(a,{contentTypes:i,orientation:l,showOutline:h,cutLine:c,showDivLine:m,showTopInfo:f,showBottomInfo:x}),...v>0?{[a(B?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${E}\uAC1C`}:{},...N?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:y}:{}},L=o.useCallback((Z,G)=>{gc(a,Z,G,{setContentTypes:u,setOrientation:s,setShowOutline:p,setCutLine:d,setShowDivLine:_,setShowTopInfo:b,setShowBottomInfo:C})||(G===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||G===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?A(mc(parseInt(Z),v)):G===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&w(fc(Z)))},[a,v]);return{settings:{orientation:l,contentTypes:i,cutLine:c,showOutline:h,showDivLine:m,count:I,showTopInfo:f,showBottomInfo:x},filterSections:M,filterSelected:T,handleSelect:L,pages:D,isPaginated:N,pageNumberPosition:y}}function V4({items:e,words:t,title:a,subtitle:r,emptyText:l,buttons:s,renderButtons:i,renderFooter:u,footerClassName:c,footerLayout:d,printFileName:h,showSettings:p,autoPrint:f,className:b,onClose:x,scoring:C=!1,onScoreChange:m,printHeader:_,brand:g,code:A,beforeClose:y}){const{t:w}=xe.useTranslation(),v=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(W=>typeof W=="string"&&W.length>0).map((W,ie)=>({id:`${W}-${ie}`,words:[{label:W}]})),[e,t]),{settings:B,filterSections:k,filterSelected:E,handleSelect:D,pages:N,isPaginated:I,pageNumberPosition:R}=bc(v,{paperBands:!!g?.show}),Y=o.useMemo(()=>Yu(N.map(W=>W.length)),[N]),[M,T]=o.useState({}),L=o.useCallback((W,ie)=>{T(q=>({...q,[br(W)]:Uu(q[br(W)]??null,ie)}))},[]),Z=o.useRef(m);o.useEffect(()=>{Z.current=m});const G=o.useRef(M);o.useEffect(()=>{G.current!==M&&(G.current=M,Z.current?.(Jo(M)))},[M]);const O=o.useMemo(()=>Jo(M),[M]),U=o.useRef(null),{toastMessage:$,toastKey:H,showWarning:z,clearToast:V}=Oi("warning"),S=o.useRef([]),P=o.useCallback(()=>I?S.current.filter(W=>W!==null):U.current?[U.current]:[],[I]),{print:F,openNewWindow:X}=ss({getElements:P,paperW:ga[B.orientation].width,paperH:ga[B.orientation].height,fileName:h??"",header:_??"",onPopupBlocked:()=>z(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."))}),se=o.useMemo(()=>u?void 0:i?i({print:F,openNewWindow:X}):h?[{label:w("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>X()},{label:w("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>F()},...s??[]]:s,[u,i,h,s,w,F,X]),ae=o.useMemo(()=>u?u({print:F,openNewWindow:X}):void 0,[u,F,X]),me=o.useRef(!1),ne=o.useRef(F);return o.useEffect(()=>{ne.current=F},[F]),o.useEffect(()=>{if(!f||me.current)return;const W=window.setTimeout(()=>{me.current=!0,ne.current()},100);return()=>window.clearTimeout(W)},[f]),n.jsxs(On,{title:a??w("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:r,size:"large",className:_e("word-table-popup",b),buttons:se,footer:ae,footerClassName:c,footerLayout:d,beforeClose:y,onClose:x,children:[v.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[p&&n.jsx(ns,{sections:k,selected:E,onSelect:D}),I?n.jsx("div",{className:"word-table-popup__pages",children:N.map((W,ie)=>n.jsx(ba,{items:W,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:q=>{S.current[ie]=q},pageNumber:{current:ie+1,total:N.length},pageNumberPosition:R,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A,scoring:C,scoreIndexOffset:Y[ie],marks:O,onMarkClick:L},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(ba,{items:v,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:U,fitHeight:!0,scoring:C,marks:O,onMarkClick:L,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:l??w("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ma,{message:$,position:"top",onClose:V},H)]})}const q4=new Set(["x","triangle"]);function U4(e,t){const a=[];for(let r=0;r<e.length;r++){const l=t[String(r)];l&&q4.has(l)&&a.push(e[r])}return a}const G4=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function yc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const s=Math.floor(a);if(s===0)return{base:t,round:1};const i=(s===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${s}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:i?t.slice(0,i.index).trim():t,round:s+1}}let r=t,l=1;for(;;){const s=G4.exec(r);if(!s)break;l=Math.max(l,(s[1]?Number(s[1]):1)+1),r=r.slice(0,s.index).trim()}return{base:r,round:l}}function K4(e,t){const[,a,r]=so(t).split("-"),l=`${a}.${r}`,{base:s,round:i}=yc(typeof e=="string"?{name:e}:e),u=i>=2?`${i}\uCC28 `:"";return`${s||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${l}`}function Y4(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:yc(e).round}}function Z4(e,t){const a={};for(const[r,l]of Object.entries(t)){if(l!=="o"&&l!=="triangle"&&l!=="x")continue;const s=Number(r),i=e[s];i&&(a[r]=i)}return a}function X4(e){return e.map(t=>t.label).join(" / ")}function J4(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function vc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function Q4(e,t,a){const r=Hl(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function xc(e,t,a){return a===0?0:(e+t*.5)/a}function ex(e){const t=new Map,a=[...e].sort((l,s)=>l.scoredAt.localeCompare(s.scoredAt));for(const l of a)for(const[s,i]of Object.entries(l.marks)){const u=l.labels?.[s];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:i,latestAt:l.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=l.scoredAt,t.set(u,c)}const r=[];for(const[l,s]of t){const i=s.o+s.triangle+s.x;r.push({label:vc(l),key:l,tried:i,o:s.o,triangle:s.triangle,x:s.x,rate:xc(s.o,s.triangle,i),latest:s.latest,latestAt:s.latestAt})}return r.sort((l,s)=>l.rate-s.rate||s.tried-l.tried||on(l.label,s.label)||on(l.key??l.label,s.key??s.label)),r}function tx(e){const t=new Map;for(const r of e){const l=r.tableId??`name:${r.tableName}`,s=t.get(l)??{tableName:r.tableName,tableId:r.tableId,rows:[]};s.rows.push(r),t.set(l,s)}const a=[];for(const r of t.values()){const l=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,s=r.rows.filter(u=>l(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(s.length===0)continue;const i=s.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,h=c.filter(p=>p==="triangle").length;return xc(d,h,l(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:i,times:s.map(u=>u.scoredAt),delta:i.length>=2?i[i.length-1]-i[0]:null})}return a.sort((r,l)=>(l.times[l.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function nx(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function ax(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 rx(e){const t=new Map;let a=0,r=0;const l=e.map((i,u)=>({r:i,at:u})).sort((i,u)=>i.r.answeredAt.localeCompare(u.r.answeredAt)||ax(i.r.id,u.r.id)||i.at-u.at).map(i=>i.r);for(const i of l){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 s=[...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 s.sort((i,u)=>i.rate-u.rate||u.tried-i.tried||on(i.title,u.title)),{items:s,counted:a,skippedNoTitle:r}}function ox(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function sx(e){const t=new Map;for(const r of e){const l=t.get(r.trainingType)??[];l.push(r),t.set(r.trainingType,l)}const a=[...t.entries()].map(([r,l])=>({trainingType:r,items:l,pending:l.filter(s=>!s.latestCorrect).length}));return a.sort((r,l)=>l.pending-r.pending||r.trainingType.localeCompare(l.trainingType)),a}const ls=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function lx(e){const t=new Map;let a=0;for(const s of e){if(s.latestCorrect)continue;const i=s.setIds[0];if(!i){a++;continue}const u=`${s.trainingType}|${i}`,c=t.get(u)??{setId:i,trainingType:s.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(s,i)=>i.pending-s.pending||s.trainingType.localeCompare(i.trainingType)||s.setId.localeCompare(i.setId),l=[...t.values()];return{sentence:l.filter(s=>ls.includes(s.trainingType)).sort(r),word:l.filter(s=>!ls.includes(s.trainingType)).sort(r),noSet:a}}function ix(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const l=[];for(const s of e){const i=new Set,u=[];for(const c of s.cellLabels)r.has(c)&&!i.has(c)&&(i.add(c),u.push(c));u.length!==0&&l.push({id:s.id,name:s.name,kind:s.kind,covered:u,totalCells:s.cellLabels.length})}return l.sort((s,i)=>i.covered.length-s.covered.length||s.totalCells-i.totalCells||on(s.name,i.name)),l.slice(0,Math.max(0,a))}function ux(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function cx(e,t){const a=new Map;for(const l of e)for(const s of l.cells){const i=l.labelOf(s);a.has(i)||a.set(i,s)}const r=[];for(const l of t){const s=a.get(l);s!==void 0&&r.push(s)}return r}function is(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,l)=>String(a[l]))}function dx(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),l=a%60;return t?t(r,l):r>0&&l>0?is(Rt.t("customers.duration.minSec",{m:r,s:l,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s:l}):r>0?is(Rt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):is(Rt.t("customers.duration.sec",{s:l,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s:l})}function px(e,t){const a=[],r=new Set;for(const l of e){const s=t(l);r.has(s)||(r.add(s),a.push({key:s,value:l,pinned:!1}))}return a}function hx(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function mx(e,t){return e.filter(a=>a.key!==t)}function fx(e,t,a){const r=e.filter(d=>d.pinned),l=new Set(r.map(d=>d.key)),s=e.length-r.length,i=[],u=new Set(l);for(const d of t){if(i.length>=s)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 Cx(e){return e.map(t=>t.value)}function gx(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},l=t?.key?` icon-grid-menu__button--${t.key}`:"",s=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${l}`,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":s,children:n.jsx(et,{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:s,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function bx(e){const{categories:t=[],selected:a,onSelect:r,size:l="medium"}=e||{},s=a!==void 0,[i,u]=o.useState(()=>s?null:(t&&t[0]?.key)??null),c=s?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(s||h.current||!p)return;h.current=!0;const b=i??p;i==null&&u(b),d.current?.(b)},[s,p]);const f=o.useCallback(b=>{const x=c===b?null:b;h.current=!0,s||u(x),r?.(x)},[c,s,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${l}`,children:(t||[]).map(b=>n.jsx(gx,{category:b,isSelected:c===b.key,onClick:()=>f(b.key)},b.key))})}function yx({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const l=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(s=>n.jsx(Ce,{htmlType:"button",size:l,type:"bar",label:s.label,selected:t===s.key,className:"choice-chips__button",onClick:()=>a?.(s.key)},s.key))})})}function vx({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",l=a?.tel??"031-380-3724",{t:s}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:s("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
1067
+ </html>`}const H4=1e3;function ss({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:l,header:s=""}){const{t:i}=xe.useTranslation(),u=o.useCallback(()=>{W4(e(),t,a,r,s)},[e,t,a,r,s]),c=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=window.open("","_blank");if(!p){l?.();return}p.document.write(os(h,t,a,!1,r,s)),p.document.close()},[e,t,a,r,l,s]),d=o.useCallback(()=>{const h=e();if(h.length===0)return;const p=os(h,t,a,!1,r,s),f=new Blob([p],{type:"text/html;charset=utf-8"}),b=URL.createObjectURL(f),x=(r?rs(r):"")||i("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:b,download:`${x}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(b),H4)},[e,t,a,r,s,i]);return{print:u,openNewWindow:c,downloadHtml:d}}function bc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,[l,s]=o.useState("landscape"),[i,u]=o.useState(["image","word","standardPron"]),[c,d]=o.useState("show"),[h,p]=o.useState(!0),[f,b]=o.useState(!0),[x,C]=o.useState(!0),[m,_]=o.useState(!0),[g,A]=o.useState(8),[y,w]=o.useState("right"),v=e.length,B=e.some(Q=>(Q.words??[]).length>1),k=e.some(Q=>(Q.words??[]).some(H=>!!H.colloquialLabel)),E=Math.min(g,Math.max(v,1)),D=o.useMemo(()=>Zu(e,E),[e,E]),N=D.length>1,I=E,[P,K]=o.useState(!1);o.useEffect(()=>{let Q=!1;if(!sa()){K(!1);return}return Promise.all(e.flatMap(H=>(H.words??[]).map(O=>Nl(O.label,O.homonum)))).then(H=>{Q||K(H.some(Boolean))},()=>{}),()=>{Q=!0}},[e]);const T=o.useMemo(()=>[sc(a,{hasImage:P,hasColloquial:k}),lc(a),...v>0?[hc(a,{hasPairs:B,itemCount:v})]:[],ic(a),...I>1?[dc(a)]:[],...B?[pc(a)]:[],...r?[uc(a),cc(a)]:[]],[a,P,k,v,B,N,I,r]),M={...Cc(a,{contentTypes:i,orientation:l,showOutline:h,cutLine:c,showDivLine:m,showTopInfo:f,showBottomInfo:x}),...v>0?{[a(B?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${E}\uAC1C`}:{},...N?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:y}:{}},L=o.useCallback((Q,H)=>{gc(a,Q,H,{setContentTypes:u,setOrientation:s,setShowOutline:p,setCutLine:d,setShowDivLine:_,setShowTopInfo:b,setShowBottomInfo:C})||(H===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||H===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?A(mc(parseInt(Q),v)):H===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&w(fc(Q)))},[a,v]);return{settings:{orientation:l,contentTypes:i,cutLine:c,showOutline:h,showDivLine:m,count:I,showTopInfo:f,showBottomInfo:x},filterSections:T,filterSelected:M,handleSelect:L,pages:D,isPaginated:N,pageNumberPosition:y}}function V4({items:e,words:t,title:a,subtitle:r,emptyText:l,buttons:s,renderButtons:i,renderFooter:u,footerClassName:c,footerLayout:d,printFileName:h,showSettings:p,autoPrint:f,className:b,onClose:x,scoring:C=!1,onScoreChange:m,printHeader:_,brand:g,code:A,beforeClose:y}){const{t:w}=xe.useTranslation(),v=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(W=>typeof W=="string"&&W.length>0).map((W,ie)=>({id:`${W}-${ie}`,words:[{label:W}]})),[e,t]),{settings:B,filterSections:k,filterSelected:E,handleSelect:D,pages:N,isPaginated:I,pageNumberPosition:P}=bc(v,{paperBands:!!g?.show}),K=o.useMemo(()=>Yu(N.map(W=>W.length)),[N]),[T,M]=o.useState({}),L=o.useCallback((W,ie)=>{M(q=>({...q,[br(W)]:Uu(q[br(W)]??null,ie)}))},[]),Q=o.useRef(m);o.useEffect(()=>{Q.current=m});const H=o.useRef(T);o.useEffect(()=>{H.current!==T&&(H.current=T,Q.current?.(Jo(T)))},[T]);const O=o.useMemo(()=>Jo(T),[T]),U=o.useRef(null),{toastMessage:$,toastKey:V,showWarning:z,clearToast:Y}=Oi("warning"),S=o.useRef([]),R=o.useCallback(()=>I?S.current.filter(W=>W!==null):U.current?[U.current]:[],[I]),{print:F,openNewWindow:Z}=ss({getElements:R,paperW:ga[B.orientation].width,paperH:ga[B.orientation].height,fileName:h??"",header:_??"",onPopupBlocked:()=>z(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."))}),pe=o.useMemo(()=>u?void 0:i?i({print:F,openNewWindow:Z}):h?[{label:w("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>Z()},{label:w("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>F()},...s??[]]:s,[u,i,h,s,w,F,Z]),re=o.useMemo(()=>u?u({print:F,openNewWindow:Z}):void 0,[u,F,Z]),oe=o.useRef(!1),ae=o.useRef(F);return o.useEffect(()=>{ae.current=F},[F]),o.useEffect(()=>{if(!f||oe.current)return;const W=window.setTimeout(()=>{oe.current=!0,ae.current()},100);return()=>window.clearTimeout(W)},[f]),n.jsxs(On,{title:a??w("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:r,size:"large",className:_e("word-table-popup",b),buttons:pe,footer:re,footerClassName:c,footerLayout:d,beforeClose:y,onClose:x,children:[v.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[p&&n.jsx(ns,{sections:k,selected:E,onSelect:D}),I?n.jsx("div",{className:"word-table-popup__pages",children:N.map((W,ie)=>n.jsx(ba,{items:W,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:q=>{S.current[ie]=q},pageNumber:{current:ie+1,total:N.length},pageNumberPosition:P,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A,scoring:C,scoreIndexOffset:K[ie],marks:O,onMarkClick:L},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(ba,{items:v,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:U,fitHeight:!0,scoring:C,marks:O,onMarkClick:L,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:l??w("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ma,{message:$,position:"top",onClose:Y},V)]})}const q4=new Set(["x","triangle"]);function U4(e,t){const a=[];for(let r=0;r<e.length;r++){const l=t[String(r)];l&&q4.has(l)&&a.push(e[r])}return a}const G4=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function yc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const s=Math.floor(a);if(s===0)return{base:t,round:1};const i=(s===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${s}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:i?t.slice(0,i.index).trim():t,round:s+1}}let r=t,l=1;for(;;){const s=G4.exec(r);if(!s)break;l=Math.max(l,(s[1]?Number(s[1]):1)+1),r=r.slice(0,s.index).trim()}return{base:r,round:l}}function K4(e,t){const[,a,r]=so(t).split("-"),l=`${a}.${r}`,{base:s,round:i}=yc(typeof e=="string"?{name:e}:e),u=i>=2?`${i}\uCC28 `:"";return`${s||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${l}`}function Y4(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:yc(e).round}}function Z4(e,t){const a={};for(const[r,l]of Object.entries(t)){if(l!=="o"&&l!=="triangle"&&l!=="x")continue;const s=Number(r),i=e[s];i&&(a[r]=i)}return a}function X4(e){return e.map(t=>t.label).join(" / ")}function J4(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function vc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function Q4(e,t,a){const r=Hl(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function xc(e,t,a){return a===0?0:(e+t*.5)/a}function ex(e){const t=new Map,a=[...e].sort((l,s)=>l.scoredAt.localeCompare(s.scoredAt));for(const l of a)for(const[s,i]of Object.entries(l.marks)){const u=l.labels?.[s];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:i,latestAt:l.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=l.scoredAt,t.set(u,c)}const r=[];for(const[l,s]of t){const i=s.o+s.triangle+s.x;r.push({label:vc(l),key:l,tried:i,o:s.o,triangle:s.triangle,x:s.x,rate:xc(s.o,s.triangle,i),latest:s.latest,latestAt:s.latestAt})}return r.sort((l,s)=>l.rate-s.rate||s.tried-l.tried||on(l.label,s.label)||on(l.key??l.label,s.key??s.label)),r}function tx(e){const t=new Map;for(const r of e){const l=r.tableId??`name:${r.tableName}`,s=t.get(l)??{tableName:r.tableName,tableId:r.tableId,rows:[]};s.rows.push(r),t.set(l,s)}const a=[];for(const r of t.values()){const l=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,s=r.rows.filter(u=>l(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(s.length===0)continue;const i=s.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,h=c.filter(p=>p==="triangle").length;return xc(d,h,l(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:i,times:s.map(u=>u.scoredAt),delta:i.length>=2?i[i.length-1]-i[0]:null})}return a.sort((r,l)=>(l.times[l.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function nx(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function ax(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 rx(e){const t=new Map;let a=0,r=0;const l=e.map((i,u)=>({r:i,at:u})).sort((i,u)=>i.r.answeredAt.localeCompare(u.r.answeredAt)||ax(i.r.id,u.r.id)||i.at-u.at).map(i=>i.r);for(const i of l){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 s=[...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 s.sort((i,u)=>i.rate-u.rate||u.tried-i.tried||on(i.title,u.title)),{items:s,counted:a,skippedNoTitle:r}}function ox(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function sx(e){const t=new Map;for(const r of e){const l=t.get(r.trainingType)??[];l.push(r),t.set(r.trainingType,l)}const a=[...t.entries()].map(([r,l])=>({trainingType:r,items:l,pending:l.filter(s=>!s.latestCorrect).length}));return a.sort((r,l)=>l.pending-r.pending||r.trainingType.localeCompare(l.trainingType)),a}const ls=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function lx(e){const t=new Map;let a=0;for(const s of e){if(s.latestCorrect)continue;const i=s.setIds[0];if(!i){a++;continue}const u=`${s.trainingType}|${i}`,c=t.get(u)??{setId:i,trainingType:s.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(s,i)=>i.pending-s.pending||s.trainingType.localeCompare(i.trainingType)||s.setId.localeCompare(i.setId),l=[...t.values()];return{sentence:l.filter(s=>ls.includes(s.trainingType)).sort(r),word:l.filter(s=>!ls.includes(s.trainingType)).sort(r),noSet:a}}function ix(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const l=[];for(const s of e){const i=new Set,u=[];for(const c of s.cellLabels)r.has(c)&&!i.has(c)&&(i.add(c),u.push(c));u.length!==0&&l.push({id:s.id,name:s.name,kind:s.kind,covered:u,totalCells:s.cellLabels.length})}return l.sort((s,i)=>i.covered.length-s.covered.length||s.totalCells-i.totalCells||on(s.name,i.name)),l.slice(0,Math.max(0,a))}function ux(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function cx(e,t){const a=new Map;for(const l of e)for(const s of l.cells){const i=l.labelOf(s);a.has(i)||a.set(i,s)}const r=[];for(const l of t){const s=a.get(l);s!==void 0&&r.push(s)}return r}function is(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,l)=>String(a[l]))}function dx(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),l=a%60;return t?t(r,l):r>0&&l>0?is(Rt.t("customers.duration.minSec",{m:r,s:l,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s:l}):r>0?is(Rt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):is(Rt.t("customers.duration.sec",{s:l,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s:l})}function px(e,t){const a=[],r=new Set;for(const l of e){const s=t(l);r.has(s)||(r.add(s),a.push({key:s,value:l,pinned:!1}))}return a}function hx(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function mx(e,t){return e.filter(a=>a.key!==t)}function fx(e,t,a){const r=e.filter(d=>d.pinned),l=new Set(r.map(d=>d.key)),s=e.length-r.length,i=[],u=new Set(l);for(const d of t){if(i.length>=s)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 Cx(e){return e.map(t=>t.value)}function gx(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},l=t?.key?` icon-grid-menu__button--${t.key}`:"",s=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${l}`,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":s,children:n.jsx(Qe,{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:s,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function bx(e){const{categories:t=[],selected:a,onSelect:r,size:l="medium"}=e||{},s=a!==void 0,[i,u]=o.useState(()=>s?null:(t&&t[0]?.key)??null),c=s?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(s||h.current||!p)return;h.current=!0;const b=i??p;i==null&&u(b),d.current?.(b)},[s,p]);const f=o.useCallback(b=>{const x=c===b?null:b;h.current=!0,s||u(x),r?.(x)},[c,s,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${l}`,children:(t||[]).map(b=>n.jsx(gx,{category:b,isSelected:c===b.key,onClick:()=>f(b.key)},b.key))})}function yx({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const l=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(s=>n.jsx(fe,{htmlType:"button",size:l,type:"bar",label:s.label,selected:t===s.key,className:"choice-chips__button",onClick:()=>a?.(s.key)},s.key))})})}function vx({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",l=a?.tel??"031-380-3724",{t:s}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:s("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
1068
1068
  \uC2E0\uB8B0\uB97C \uC313\uACE0
1069
1069
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`).split(`
1070
- `).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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:To,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:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("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:s("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",l]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function xx({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:l,className:s,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),h=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),b=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const y=document.getElementById(b);y&&y.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=y=>{y.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,b]);const C=i?`${i} landing-header__inner`:"landing-header__inner",m=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"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((_,g)=>n.jsx("span",{children:m(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[l,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":b,"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:b,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:m(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function _x({children:e,action:t,onClick:a,className:r}){const l=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:l,onClick:a,...Hu(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function wx({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),l=o.useRef(null),s=o.useCallback(()=>{const C=t.current,m=C.phase!=="sound"&&C.at>0;l.current=m?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=l.current;return l.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,m,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:m,at:Date.now()-Math.max(0,_)},new Promise(A=>{const y=setTimeout(()=>{r.current===y&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=y})},[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},[]),f=o.useCallback(()=>a.current,[]),b=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:b,abort:u,waitPad:c,enterSound:d,leave:h,pause:s,resume:i,__bumpGenerationForTest:x}),[p,f,b,u,c,d,h,s,i,x])}const va=9,Bx=e=>Math.round(Math.min(va,Math.max(0,e))/va*100),kx=e=>e/100*va,Xa=2,_c=.1,Ax=e=>Math.min(Xa,Math.max(0,e)),Nx=.1,Ex=e=>Math.round(e*1e6)/1e6;function Ja(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return Ax(t);const a=Math.min(va,Math.max(0,Number(e.level)||0))/va,r=Number(e.mainVolume);return r>0?a>0?Ex(Math.min(Xa,Math.max(Nx,a/r))):0:1}const wc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Bc(e){return wc(e)}function us(e){return wc(e)*Ja(e)}function cs(e,t=Vf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,us(e)/a)}function Jn(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=Ja({level:a.level,mainVolume:a.mainVolume})),a}const Qn={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},ds=o.createContext(null);function xr(){return o.useContext(ds)}const ps=e=>`${Hf()}/${e}`,kc=e=>Array.from({length:10},(t,a)=>ps(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),_r={get defaultNoise(){return ps("noise1.mp3")},get street(){return kc("noise2")},get restaurant(){return kc("noise3")},get buzz(){return ps("noise4.mp3")}};function Dx(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return _r.defaultNoise;case"street":return _r.street[t];case"restaurant":return _r.restaurant[t];case"buzz":return _r.buzz;default:return null}}function Sx({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const l=o.useRef(e?.registerAnalyser);l.current=e?.registerAnalyser;const s=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),h=o.useRef(null),p=o.useRef(null),f=o.useRef(0),b=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]),m=o.useCallback((w,v=250)=>{const B=s.current;if(!B)return;const k=d.current;if(k){d.current=null;try{B.pause()}catch{}B.src=k,B.load()}if(!B.src)return;f.current+=1,C();try{Qr(),er(B).then(I=>{if(s.current===B)try{l.current?.("noise",I)}catch{}})}catch{}const E=B.paused?0:tr(B);B.paused&&In(B,0),B.play().catch(()=>{});const D=performance.now(),N=()=>{const I=Math.min(1,(performance.now()-D)/v);try{In(B,E+(w-E)*I)}catch{}I<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((w=250,v)=>{const B=s.current;if(!B||B.paused){v?.();return}const k=++f.current;C();const E=performance.now(),D=tr(B),N=()=>{const I=Math.min(1,(performance.now()-E)/w);try{In(B,D*(1-I))}catch{}if(I<1)p.current=requestAnimationFrame(N);else{p.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);try{B.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),b.current=setTimeout(()=>{if(b.current=null,f.current===k){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{B.paused||(In(B,0),B.pause(),v?.())}catch{}}},w+150)},[C]);o.useEffect(()=>{const w=document.createElement("audio");return w.loop=!0,w.crossOrigin="anonymous",s.current=w,()=>{C();try{w.pause(),w.removeAttribute("src"),w.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?cs(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let w=0;const v=setInterval(()=>{const B=s.current;if(!B||B.paused){w=0;return}const k=t.current;if(k&&!k.paused&&!k.ended||x()||a.current==="playing"){w=0;return}w+=1,w>=2&&(w=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const w=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const B=t.current,k=!!B&&!B.paused&&!B.ended||x()||a.current==="playing",E=h.current;k&&E?.enabled&&E.volume>0&&m(E.volume)};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)},[C,m,t,a,x]),o.useEffect(()=>{h.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const y=o.useRef(null);return o.useEffect(()=>()=>{y.current?.(),y.current=null},[]),o.useEffect(()=>{const w=e?.settings,v=s.current;if(!v)return;const B=w?cs(w):0;if(!w||!w.enabled||B===0){_();return}if(c.current!==w.type){const k=Dx(w.type);k&&(c.current=w.type,u(k),d.current=k,_(150,()=>{if(d.current!==k)return;d.current=null,v.src=k,v.load();const E=t.current;if(E&&!E.paused||x()){y.current?.();const D=()=>{v.removeEventListener("canplay",D),y.current===N&&(y.current=null);const I=t.current,R=h.current;(I&&!I.paused&&!I.ended||x())&&R?.enabled&&R.volume>0&&m(R.volume)},N=()=>v.removeEventListener("canplay",D);y.current=N,v.addEventListener("canplay",D)}}))}else{const k=t.current,E=!!k&&!k.paused&&!k.ended||x()||a.current==="playing";if(E&&d.current)m(B);else if(E&&v.paused&&v.src)m(B);else if(!v.paused)if(!E)_();else{C();const D=tr(v),N=performance.now(),I=()=>{const R=Math.min(1,(performance.now()-N)/150);try{In(v,D+(B-D)*R)}catch{}R<1?p.current=requestAnimationFrame(I):p.current=null};p.current=requestAnimationFrame(I)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,m,_,t,a,h,x]),o.useEffect(()=>{const w=s.current;if(w)try{w.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:i,noiseSettingsRef:h,cancelNoiseFade:C,fadeInNoise:m,fadeOutNoise:_}}function jx({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:l,setProgress:s,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:h,onDoneRef:p,handleEndRef:f}){const b=o.useRef(null),x=o.useRef(0),C=o.useRef(null),m=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{m.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(w,v=1)=>{try{const B=(w||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(w||"").length);return Math.max(700,Math.round(B*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(w=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,B=++m.current;try{try{v.cancel()}catch{}const k=w??e,E=Array.isArray(k)?k.filter(M=>!!M):[k||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((M,T)=>M+g(T,D||1),0),b.current=performance.now(),s(0),i("playing"),u("playMode");const N=h.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const I=()=>{try{const M=b.current||performance.now(),T=performance.now()-M,L=x.current||1200,Z=Math.min(1,T/L);try{r.current&&(r.current.style.left=`${Z*100}%`),l.current&&l.current.style.setProperty("--progress",String(Z))}catch{}Z<1&&(C.current=requestAnimationFrame(I))}catch{}},R=()=>{if(B===m.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),i("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},Y=M=>{const T=new SpeechSynthesisUtterance(E[M]);try{T.rate=D}catch{}try{T.volume=Math.max(0,Math.min(1,a))}catch{}T.onend=()=>{if(B===m.current){if(M<E.length-1){try{Y(M+1)}catch{R()}return}R()}},T.onerror=()=>{R()},T.onstart=()=>{if(!(M>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(I)}catch{}},_.current=!0,v.speak(T)};try{Y(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,l,s,i,u,h,p,f]),y=o.useCallback(()=>{m.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),b.current=null}catch{}i("stopped"),u("active"),s(0)},[d,i,u,s]);return{startTTS:A,stopTTS:y}}const Tx=.01,Mx=.3;async function Lx(e,t,a,r=!1){let l=null;try{const s=window.AudioContext||window.webkitAudioContext;l=new s;const i=await l.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const b=Math.floor(Mx*i.sampleRate),x=Math.min(u.length,b);for(;c<x&&Math.abs(u[c])<=Tx;)c++;c>=x&&(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),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((b,x)=>{const C=c+x*f,m=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<m;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{l?.close?.()}catch{}}}async function Ac(e,t,a,r=!1){try{const l=await fetch(e);if(l.ok===!1)return null;const s=await l.arrayBuffer();return await Lx(s,t,a,r)}catch(l){try{const s=$l(l)}catch{}return null}}const hs=45,$x=74,Rx=2;function wr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Br(e){return wr(e)/45}const Px=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Nc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Ec({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Nc(t),l=Nc(a),s=[];let i=0;return e.forEach((u,c)=>{for(const[d,h]of[["lead",r],["sound",Px(u)],["tail",l]])s.push({kind:d,track:c,startMs:i,durMs:h}),i+=h}),{segments:s,totalMs:i,trackCount:e.length}}function Dc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,l,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:l,tail:s,totalMs:r.durMs+l.durMs+s.durMs}}function Ix(e,t){const a=Dc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],l=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+l)/a.totalMs))}function Fx(e,t,a){const r=Math.max(0,Math.floor(a)),l=Dc(e,t);if(!l||r===0||!(l.totalMs>0)||l.lead.durMs===0&&l.tail.durMs===0||!(l.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(l.lead.durMs/l.totalMs*r),i=Math.round(l.tail.durMs/l.totalMs*r),u=Math.max(1,r-s-i),c=s+u+i-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function Ox({currentTime:e,sources:t,index:a,audioDuration:r}){const l=a||0,s=Array.isArray(t)&&t.length>0?t[l]:void 0,i=s?s.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 zx({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:l,tailMs:s}){const i=Ec({durationsSec:[r],leadInMs:l,tailMs:s});return Ix(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Wx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return Fx(Ec({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function Hx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Vx({ended:e,completedByEnd:t}){return!!e||!!t}function qx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Ux(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function Gx(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],l=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const i=s;l.push({code:i.code??null,src:i.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){l.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const i=String(s),u=a(i,t);u&&l.push({code:i,resolvedPath:u})}}return l}function Kx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Sc(a)!==Sc(t):!0}function Sc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const jc=4,Yx=Br(jc/hs);function Zx(e){const{src:t,segments:a,progress:r=0,waveProgressRef:l,noiseSrc:s,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:h,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:b=0,trackDurationSec:x=0}=e,C=o.useRef(null),m=o.useRef(null),[_,g]=o.useState(null),[A,y]=o.useState(!1),[w,v]=o.useState(null),[B,k]=o.useState(2),[E,D]=o.useState(0),[N,I]=o.useState(null),[R,Y]=o.useState(!1),[M,T]=o.useState(!1),L=3,Z=3,G=1,O=300,U=o.useRef(0),$=o.useCallback(()=>{const ye=C.current,de=m&&m.current?m.current:ye?ye.closest(".audio-player__wave"):null,oe=de?de.getBoundingClientRect():ye?ye.getBoundingClientRect():null,ge=oe?oe.width:0,he=oe?Math.max(100,oe.width):320,pe=oe?oe.height:0,Me=Math.max(G,Math.min(O,Math.floor((he+Z)/(L+Z)))),ze=Me*L,Le=Math.max(0,Me-1),Fe=Math.max(0,Le>0?(he-ze)/Le:Z);return{bars:Me,gap:Fe,height:pe,width:ge}},[]),H=o.useRef(void 0),z=o.useRef(null),V=o.useCallback(async(ye,de,{quiet:oe=!1}={})=>{const ge=++U.current,he=()=>U.current===ge;try{if(oe||y(!1),H.current=ye,!ye){he()&&g(null);return}let pe=de;if(!pe)try{for(let Le=0;Le<4&&!(C.current||m.current);Le++)await new Promise(Fe=>requestAnimationFrame(Fe));await new Promise(Le=>requestAnimationFrame(Le));const ze=$();ze.height>0&&D(ze.height),pe=ze.bars,k(ze.gap)}catch{pe=120}z.current=pe;const Me=await Ac(ye,pe);if(!he())return;if(!Me){g(null),y(!1);return}g(Me),v(pe),y(!0)}catch{if(!he())return;g(null),y(!1)}},[y,g,D,k,v,$]);o.useEffect(()=>{const ye=m.current;if(!ye||typeof ResizeObserver>"u")return;let de=null;const oe=new ResizeObserver(()=>{de!==null&&cancelAnimationFrame(de),de=requestAnimationFrame(()=>{de=null;try{const ge=$();if(ge.width<=0||(ge.height>0&&D(ge.height),z.current===null||ge.bars===z.current))return;const he=H.current;k(ge.gap),he?V(he,ge.bars,{quiet:!0}).catch(()=>{}):z.current=ge.bars}catch{}})});return oe.observe(ye),()=>{oe.disconnect(),de!==null&&cancelAnimationFrame(de)}},[$,V]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;V(typeof ye=="string"?ye:void 0).catch(()=>{}),T(!1)},[t,a,V]),o.useEffect(()=>{let ye=!1;if(Y(!1),I(null),!s||!w)return;const de=c>0?c*(u||1):void 0;return Ac(s,w,de,!0).then(oe=>{ye||(I(oe),oe||Y(!0))}).catch(()=>{ye||(I(null),Y(!0))}),()=>{ye=!0}},[s,w,c,u]);const S=Math.max(0,Math.min(1,d)),P=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=w||40,X=o.useMemo(()=>Wx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:b}),[F,x,f,b]),se=o.useMemo(()=>Array.from({length:F}).map((ye,de)=>{const oe=de>=X.lead&&de<X.lead+X.sound,ge=X.sound>0&&oe?Math.min(F-1,Math.round((de-X.lead)/X.sound*F)):-1,he=oe?_&&_[ge]!=null?_[ge]:null:_?0:null,pe=he==null?null:Math.min(1,he/P*S),Me=pe!=null&&E>0&&wr(pe)<=jc,ze=pe==null?.15:Me?0:Br(pe),Le=Me,Fe=F>1?de/(F-1):0;return n.jsx("div",{className:Le?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":ze,"--i":de,"--mix":Fe}},de)}),[F,_,P,S,E,X]),ae={"--progress":String(Math.max(0,Math.min(1,r)))},me=o.useMemo(()=>N&&N.length&&Math.max(...N.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[N]),ne=S*Math.max(0,i),W=!s||!N||!N.length?1:Math.max(1,ne),ie={"--bar-gap":`${B}px`,"--wave-h":`${wr(W)}px`,"--wave-h1":`${hs}px`},q=A&&(s?!!N||R:!0);o.useEffect(()=>{q&&T(!0)},[q]);const K=M?A:q;o.useEffect(()=>{h?.(K)},[K,h]);const ce=w||40,ke=o.useMemo(()=>Array.from({length:ce}).map((ye,de)=>{const oe=N&&N[de]!=null?N[de]:null,ge=oe==null?0:Math.abs(oe)/me*ne,he=Math.max(Yx,Br(ge)),pe=ce>1?de/(ce-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":he,"--i":de,"--mix":pe}},de)}),[ce,N,me,ne,E]);return n.jsxs("div",{className:"audio-player__wave",ref:m,style:ie,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${q?"is-ready":""}`,"aria-hidden":"true",children:ke}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${K?"is-ready":""}`,ref:C,children:se}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${K?"is-ready":""}`,ref:l,style:ae,children:se})]})]})}const Tc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function ms(e,t){return new Promise((a,r)=>{const l=document.createElement("audio");let s=!1;const i=()=>{try{l.removeAttribute("src"),l.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(l.duration)&&l.duration||0;i(),a(d)},c=d=>{s||(s=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};l.addEventListener("loadedmetadata",u),l.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),l.src=e})}const Xx=2e3;function Mc(e,t=Xx){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.addEventListener("canplay",l,{once:!0}),e.addEventListener("error",l,{once:!0}),setTimeout(l,t)})}function Jx({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),l=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!l.current.length)return;const d=l.current;l.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),l.current=l.current.filter(f=>f!==d),c(p)},h=setTimeout(()=>d(!0),a);l.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=l.current;l.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:i}}function Qx(){const e=o.useRef([]),t=o.useCallback(l=>(e.current.push(l),l),[]),a=o.useCallback(l=>{const s=new Set([...l].filter(Boolean));e.current=e.current.filter(i=>{if(s.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const l of e.current)try{URL.revokeObjectURL(l)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function e_({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),l=o.useCallback(()=>r(null),[]),s=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",l),()=>document.removeEventListener("mousedown",l)},[a,l]),{ref:t,rect:a,show:s,hide:l}}function t_(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 n_=400,a_=2e3,Lc=5;function r_({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:l,sequencer:s,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)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if($n){const m=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&m-x>n_){const _=h.current===null||m-h.current>a_;if(h.current=m,_&&d.current<Lc){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(m-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="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.",g>=Lc?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=m}try{const m=e.current,_=Array.isArray(r.current)?r.current[l.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:t_(m),y=t.current,w=(i||0)>0||(u||0)>0,v=w&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{y&&y.style.visibility!=="hidden"&&(y.style.visibility="hidden")}catch{}else{const B=g?_.duration:A||0;$n&&v&&!(B>0)&&St("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 k=w?zx({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:m&&typeof m.currentTime=="number"?m.currentTime:0,trackDurationSec:B,leadInMs:i||0,tailMs:u||0}):Ox({currentTime:m&&typeof m.currentTime=="number"?m.currentTime:0,sources:r.current,index:l.current,audioDuration:A??0});try{y&&(y.style.visibility&&(y.style.visibility=""),y.style.left=`${k*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(k))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,l,s,i,u]),b=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:b}}function fs({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:l=!1,ttsText:s=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:h=0}){const{t:p}=xe.useTranslation(),f=e,b=xr(),x=o.useRef(b?.registerAnalyser);o.useEffect(()=>{x.current=b?.registerAnalyser});const C=o.useRef(null),m=o.useRef(null),_=o.useRef(null),g=Qx(),A=o.useRef(null),y=o.useRef(!1),w=o.useRef(null),{ref:v,rect:B,show:k,hide:E}=e_();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[I,R]=o.useState("idle"),[Y,M]=o.useState("stopped"),T=o.useRef("stopped");o.useEffect(()=>{T.current=Y},[Y]);const[L,Z]=o.useState(0),[G,O]=o.useState("active"),U=o.useRef(!1);o.useEffect(()=>{if(G!=="playMode"||!U.current)return;U.current=!1;const J=typeof document<"u"?document.activeElement:null;if(J&&J!==document.body)return;const ue=_.current?.querySelectorAll("button")[1];try{ue?.focus()}catch{}},[G]);const[$,H]=o.useState(null),[z,V]=o.useState(null),[S,P]=o.useState(0),[F,X]=o.useState(!1),[se,ae]=o.useState(0),me=b?.playbackRate??1,ne=b?.mainVolume??1,W=b?us(b.settings):0,ie=b?Bc(b.settings):ne,[q,K]=o.useState("idle"),[ce,ke]=o.useState(""),[ye]=o.useState("top"),de=o.useRef(null),oe=o.useRef(0),ge=o.useRef(null),he=o.useRef(!0),pe=wx({mountedRef:he}),Me=o.useRef(null),ze=o.useRef(d),Le=o.useRef(h);o.useEffect(()=>{ze.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Le.current=Math.max(0,h||0)},[h]);const{start:Fe,stop:We,settleTo:pt}=r_({audioRef:C,fillRef:m,waveProgressRef:ge,sourcesRef:de,currentIndexRef:oe,sequencer:pe,leadInMs:d,tailMs:h}),{onReadyChange:it,waitForReady:at,markNotReady:ht}=Jx({showSoundWaveForm:u,showNoiseWaveForm:c}),Ne=o.useRef(null),Ve=o.useRef(l),we=o.useRef(r),Ue=o.useRef(null),Ae=o.useRef(!1),[$e,Se]=o.useState(!1),Xe=o.useCallback(J=>{Ae.current=J,Se(J)},[]),gt=o.useRef(null),{activeNoiseUrl:nt,noiseSettingsRef:Je,fadeInNoise:_t,fadeOutNoise:mt}=Sx({noisePlayer:b,audioRef:C,playbackStateRef:T,sequencer:pe}),{startTTS:wt,stopTTS:vt}=jx({ttsText:s,playbackRate:me,mainVolume:ie,fillRef:m,waveProgressRef:ge,setProgress:Z,setPlaybackState:M,setStateLocal:O,fadeInNoise:_t,fadeOutNoise:mt,noiseSettingsRef:Je,onDoneRef:we,handleEndRef:gt});o.useEffect(()=>{rt.current=vt});const bt=J=>{if(typeof window>"u"||!window.speechSynthesis){try{ke(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}wt(J);return}ot("tts"),wt(J)},Ke=Array.isArray(t)?t.filter(Boolean):t?[t]:[],re=(!Ke||Ke.length===0)&&!!s,Ee=Array.isArray($)&&$.length>0?$:Array.isArray(z)&&z.length>0?z:null,Qe=Math.max(Array.isArray(Ee)?Ee.length:0,Ke.length);o.useEffect(()=>(he.current=!0,()=>{he.current=!1}),[]);const qe=()=>{pe.abort()},rt=o.useRef(null),Te=o.useRef(null),ut=o.useRef(null),Re=o.useRef(null);Re.current||(Re.current=()=>{ut.current=null;const J=C.current;if(Te.current==="audio"&&J&&(!J.paused||pe.isRunning())){qe();try{J.pause()}catch{}he.current&&(M("paused"),We(),mt())}else if(Te.current==="tts")try{rt.current?.()}catch{}});const ot=J=>{Te.current=J,ut.current=dr(Re.current)},ft=()=>{ut.current?.(),ut.current=null};o.useEffect(()=>()=>{Re.current&&pr(Re.current)},[]);const Bt=o.useRef(me);o.useEffect(()=>{Bt.current=me||1},[me]);const Ze=o.useCallback(J=>{const ue=Bt.current||1;try{J.defaultPlaybackRate=ue}catch{}try{J.playbackRate=ue}catch{}},[]),st=o.useCallback((J,ue)=>{if(!Kx(J,ue)){try{J.currentTime=0}catch{}Ze(J);return}J.src=ue,Ze(J),J.load(),Ze(J)},[Ze]),lt=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),K("idle")},[]),dt=o.useCallback(async(J,ue=3,ee=50,ve=0)=>{lt();const Pe=pe.generation(),He=!!J&&J.currentTime>0&&!J.ended,tt=Math.max(0,ze.current-Math.max(0,ve));if(tt>0&&!He){ot("audio"),Fe(),M("playing");const Ct=Je.current;if(Ct?.enabled&&(Ct.volume??0)>0)try{_t(Ct.volume)}catch{}if(!await pe.waitPad(tt,"lead",ve)||!he.current||!pe.isCurrent(Pe))return!1}pe.enterSound();for(let Ct=0;Ct<ue;Ct++){if(!he.current||!pe.isCurrent(Pe))return!1;try{return ot("audio"),await J.play(),!0}catch(be){if((be instanceof Error||typeof be=="object"&&be&&"name"in be?be.name:void 0)==="AbortError"){if(!pe.isCurrent(Pe))return!1;await new Promise(j=>setTimeout(j,ee));continue}try{ke(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{ke(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,Fe,pe,_t,Je,lt]),kt=o.useCallback(J=>{const ue=pe.generation(),ee=Math.max(0,Le.current-Math.max(0,J));Fe();const ve=Je.current;if(ve?.enabled&&(ve.volume??0)>0)try{_t(ve.volume)}catch{}const Pe=()=>{try{Me.current?.()}catch{}};if(ee<=0){pe.leave(),Pe();return}pe.waitPad(ee,"tail",J).then(He=>{pe.leave(),He&&pe.isCurrent(ue)&&Pe()}).catch(()=>{})},[pe,Fe,_t,Je]),Vt=o.useCallback(()=>{const J=C.current;if(!J)return;const ue=()=>{M("playing"),O("playMode"),X(!0),Fe();try{Qr(),er(J).then(He=>{if(he.current)try{x.current?.("main",He)}catch{}})}catch{}const Pe=Je.current;Pe?.enabled&&(Pe?.volume??0)>0&&_t(Pe.volume)},ee=()=>{Vx({ended:!!J?.ended,completedByEnd:Ae.current})||(M("paused"),We(),mt())},ve=()=>{const Pe=()=>{try{const He=de.current,tt=Hx(He,oe.current);if(tt!==null){oe.current=tt,P(tt),X(!0);const Ct=He?.[tt]&&He[tt].src;if(Ct&&J){st(J,Ct),dt(J).catch(()=>{});return}}}catch{}M("stopped"),Z(1);try{if(J)try{J.currentTime=0}catch{}}catch{}We(),X(!1),mt();try{!Ve.current&&gt.current&&gt.current()}catch{}};if(Me.current=Pe,Le.current>0){Fe(),pe.waitPad(Le.current,"tail").then(He=>{pe.leave(),He&&Pe()}).catch(()=>{});return}Pe()};return J.addEventListener("play",ue),J.addEventListener("pause",ee),J.addEventListener("ended",ve),()=>{try{J.removeEventListener("play",ue),J.removeEventListener("pause",ee),J.removeEventListener("ended",ve),We()}catch{}}},[_t,mt,dt,Je,Fe,We,pe]);o.useEffect(()=>Vt(),[Vt]),o.useEffect(()=>{Ve.current=l},[l]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(l||G!=="active")return;const J=w.current;if(!J)return;let ue=null;const ee=requestAnimationFrame(()=>{try{const ve=J.getTotalLength();if(!ve)return;const Pe=ve*.2;J.style.strokeDasharray=`${ve-Pe} ${Pe}`;const He="triFlow_"+Math.random().toString(36).slice(2);ue=document.createElement("style"),ue.textContent=`@keyframes ${He}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ve}}}`,document.head.appendChild(ue),J.style.animation=`${He} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ee),ue?.remove()}},[G,l]),o.useEffect(()=>{de.current=$},[$]),o.useEffect(()=>{oe.current=S},[S]),o.useEffect(()=>{const J=_.current,ue=A.current;if(!J||!ue)return;let ee=null;const ve=32,Pe=60,He=()=>{try{const Ct=Array.from(J.querySelectorAll(":scope > .button"));let be=0;Ct.forEach(Ie=>{if(Ie===ue)return;const Ye=Ie.getBoundingClientRect();be+=Ye.width});const j=J.getBoundingClientRect().width,Q=Math.max(0,Math.floor(j-be-8)),fe=Qe;if(!fe||Q<=0){Array.from(ue.children).forEach(Ie=>{try{Ie.style.width=""}catch{}});return}let De=Math.floor(Q/fe);De>Pe&&(De=Pe),De<ve&&(De=Math.max(ve,Math.floor(Q/fe))),Array.from(ue.querySelectorAll(".button")).forEach(Ie=>{try{Ie.style.width=`${De}px`}catch{}})}catch{}},tt=requestAnimationFrame(He);try{ee=new ResizeObserver(()=>{requestAnimationFrame(He)}),ee.observe(J),ee.observe(ue),window.addEventListener("resize",He)}catch{}return()=>{try{cancelAnimationFrame(tt)}catch{}try{ee&&(ee.disconnect(),ee=null)}catch{}try{window.removeEventListener("resize",He)}catch{}}},[$,z,Qe]),o.useEffect(()=>()=>{try{Ne.current&&(clearTimeout(Ne.current),Ne.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const en=(J,ue)=>{H(J),ae(ue),ht(),V(qx(J)),de.current=J},Cn=()=>{O("playMode"),P(0),X(!0)},jn=async(J,ue)=>{Xe(!1),y.current=!1,st(J,ue),await Mc(J),await at()!==!1&&(N(!1),Cn(),await dt(J))},Wn=async(J,ue=!1)=>{const ee=C.current;N(!0),R("measuring_duration");try{const ve=await ms(J,{timeoutMs:1e4,rejectOnError:!0});en([{src:J,objectUrl:null,duration:ve}],ve),R("ready"),ue&&ee&&await jn(ee,J)}finally{y.current=!1,N(!1)}},Hn=async(J,ue=!1)=>{const ee=C.current;N(!0),R("measuring_duration");try{const ve=await Promise.all(J.map(He=>ms(He,{timeoutMs:1e4})));if(!he.current)return;const Pe=J.map((He,tt)=>({src:He,objectUrl:null,duration:ve[tt]||0}));en(Pe,Ux(Pe)),R("ready"),ue&&ee&&Pe.length>0&&await jn(ee,Pe[0].src)}finally{y.current=!1,N(!1)}},qt=async(J=!1,ue=!0)=>{const ee=C.current,ve=t?Array.isArray(t)?t:[t]:[];if(!ve||ve.length===0||!ve.some(Boolean))return!1;if(y.current)return null;y.current=!0,ue&&N(!0),R("resolving");try{const Pe=Gx(t,a,yl),He=[];let tt=0;for(const Ct of Pe){let be=Ct.src??null,j=null;if(!be&&Ct.resolvedPath){try{R("getting_signed_url"),be=await vl(Ct.resolvedPath)}catch{be=null}if(!he.current)return!1;if(!be)try{R("downloading");const fe=await xl(Ct.resolvedPath);if(!he.current)return!1;if(fe){const De=fe instanceof Blob?fe:new Blob([fe]);j=g.track(URL.createObjectURL(De)),be=j}}catch{R("error");try{ke(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),O("active")}catch{}}}if(!be)continue;let Q=0;try{R("measuring_duration"),Q=await ms(be,{timeoutMs:3e3})}catch{Q=0}if(!he.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const fe of He)if(fe.objectUrl)try{URL.revokeObjectURL(fe.objectUrl)}catch{}return!1}tt+=Q||0,He.push({...Ct,src:be,objectUrl:j,duration:Q})}if(en(He,tt),He.length>0&&J&&ee){const Ct=He[0];Xe(!1);try{g.keepOnly(He.map(be=>be.objectUrl))}catch{}if(R("ready"),y.current=!1,Ct.src&&ee)try{if(st(ee,Ct.src),await Mc(ee),await at()===!1)return!1;ue&&N(!1),Cn(),ee&&await dt(ee)}catch{ue&&N(!1)}else ue&&N(!1);O("playMode"),P(0),X(!0)}return He.length>0}finally{y.current=!1,ue&&N(!1),R(Pe=>Pe==="ready"?"ready":"idle")}},dn=async J=>{const ue=pe.isRunning();if(J.paused&&!ue){if(Ae.current){await Lt();return}const ee=pe.resume();if(ee){if(M("playing"),ee.phase==="tail"){kt(ee.elapsed);return}await dt(J,3,50,ee.elapsed);return}await dt(J),M("playing")}else pe.pause(),qe(),J.pause(),M("paused"),ue&&(We(),mt())},Ut=async()=>{const J=C.current;if(!(!J&&!re)){if(re){const ue=window.speechSynthesis;if(G==="active"){const ee=Na(),ve=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ee&&ve.length>0){if(y.current)return;O("load"),N(!0),R("synthesizing"),y.current=!0;try{const Pe=await Promise.all(ve.map(He=>Promise.resolve(ee(He))));Pe.length>1?await Hn(Pe,!0):await Wn(Pe[0],!0)}catch{y.current=!1,N(!1),O("active"),bt(ve.length>0?ve:void 0)}return}bt(ve.length>0?ve:void 0);return}if(G==="playMode"){const ee=!!ue&&(ue.speaking||ue.paused)&&!(J&&(J.currentSrc||J.getAttribute("src")));if(J&&!ee){await dn(J);return}try{if(ue&&ue.paused)try{ot("tts"),ue.resume(),M("playing")}catch{}else try{ue.pause(),M("paused")}catch{}}catch{}}return}if(G==="active"){if(l&&Array.isArray(de.current)&&de.current.length>0){const ee=de.current[0];try{if(ee.src&&J)try{st(J,ee.src),Cn(),J&&await dt(J)}catch{}Cn();return}catch{}}O("load");let ue;try{ue=await qt(!0)}catch{ue=!1}if(ue===!1&&he.current){try{ke(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}O("active")}return}if(G!=="load"&&(G==="playMode"||G==="active"))try{J&&await dn(J)}catch(ue){(ue instanceof Error||typeof ue=="object"&&ue&&"name"in ue)&&ue.name}}},Lt=async()=>{const J=C.current;if(J)try{const ue=de.current;if(Array.isArray(ue)&&ue.length>1){await Ft(0);return}Xe(!1);try{J.currentTime=0}catch{}J&&await dt(J),M("playing"),O("playMode")}catch{}},Tn=()=>{qe(),ft(),rt.current?.();const J=C.current;try{if(J){try{J.pause()}catch{}try{J.currentTime=0}catch{}}}catch{}mt(),M("stopped"),O("active"),Z(0),X(!1)},ln=async(J,{sameSegment:ue=!1}={})=>{qe();const ee=pe.generation(),ve=C.current,Pe=de.current?.[J]?.src;try{if(Xe(!1),P(J),X(!0),oe.current=J,!Pe||!ve||(ue||ht(),st(ve,Pe),!ue&&await at()===!1)||!pe.isCurrent(ee)||(await dt(ve),!pe.isCurrent(ee)))return;M("playing"),O("playMode")}catch{}},Mn=async()=>{const J=de.current,ue=oe.current||0;if(!J||ue<=0){await Lt();return}await ln(ue-1)},Ln=async()=>{const J=de.current,ue=oe.current||0;if(!J||ue>=J.length-1){Tn();return}await ln(ue+1)},xn=()=>{if(Ae.current)return;const J=200,ue=340;Xe(!0),qe(),ft();try{Z(1)}catch{}pt(1);try{K("hold")}catch{}try{const ee=C.current,ve=re&&!!ee?.src;if(!re||ve){if(ee){ee.pause();try{ee.currentTime=0}catch{}}}else vt();mt()}catch{}try{M("stopped")}catch{}if(X(!1),!Ve.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{K("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{K("idle")}catch{}Ue.current=null},ue)},J)}catch{}};o.useEffect(()=>{gt.current=xn});const Gt=o.useCallback(()=>ke(""),[]),Ft=async J=>{(de.current||[])[J]&&await ln(J,{sameSegment:J===oe.current})},$t=Y==="playing",pn=o.useMemo(()=>{if(!z||z.length<=1)return z;const J=z[S];return J?[J]:z},[z,S]),Ot=l===!0;o.useEffect(()=>{try{const J=C.current;J&&typeof J.playbackRate=="number"&&Ze(J)}catch{}},[me,Ze]);const tn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const J=C.current;if(!J)return;const ue=Math.max(0,Math.min(1,ie)),ee=tn.current,ve=()=>{ee.raf!==null&&(cancelAnimationFrame(ee.raf),ee.raf=null),ee.timer!==null&&(clearTimeout(ee.timer),ee.timer=null)};ve();const Pe=tr(J);if(J.paused||Math.abs(Pe-ue)<.001||typeof requestAnimationFrame!="function"){try{In(J,ue)}catch{}return}const He=performance.now(),tt=()=>{const Ct=Math.min(1,(performance.now()-He)/150);try{In(J,Pe+(ue-Pe)*Ct)}catch{}ee.raf=Ct<1?requestAnimationFrame(tt):null};return ee.raf=requestAnimationFrame(tt),ee.timer=setTimeout(()=>{ve();try{In(J,ue)}catch{}},200),ve},[ie]);const Tt=q==="hold",Kt=q==="out",le=G==="playMode"&&!D&&!$e||Tt||Kt,Be=Y!=="stopped"||Tt||Kt,je=Y==="paused",Ge=Math.max(0,Math.min(100,(L||0)*100)),Oe=_e("audio-player__fill",le?"is-visible":"",Be?"is-expanded":"",je?"is-paused":"",Kt?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${$t?"is-playing":""} ${D?"is-loading":""} ${G!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Tc[I]?"status":void 0,"aria-live":Tc[I]?"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,G==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{U.current=Cr(),E(),Ut()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:k,onMouseLeave:E,onFocus:k,onBlur:E,children:n.jsx("span",{ref:v,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:w,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,B&&n.jsx(wn,{anchorRect:B,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${G==="playMode"||$t?"is-visible":""}`,inert:!(G==="playMode"||$t)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:Mn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:G!=="playMode"}),n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:$t?"pause":"play",onClick:Ut,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":$t,width:"60px",variant:"transparent-white",disabled:G!=="playMode"}),n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Tn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:G!=="playMode"}),Qe>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:Qe}).map((J,ue)=>n.jsx(Ce,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ue+1),onClick:()=>{try{Ft(ue)}catch{}},ariaLabel:p("training.sourcePlay",{n:ue+1}),variant:"transparent-white",selected:F&&S===ue,disabled:G!=="playMode"||!(Array.isArray($)&&$[ue]),showTooltipInfo:!0},ue))}):null,!Array.isArray($)||$.length<=1?n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Lt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:G!=="playMode"}):null,n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Ln,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:G!=="playMode"}),n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:xn,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:G!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Oe,ref:m,style:{left:`${Ge}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(Zx,{segments:pn,progress:L,totalDuration:se,waveProgressRef:ge,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:$?.[S]?.duration??0,noiseSrc:c&&b?.settings.enabled&&W>0?nt:null,noiseRatio:b?Ja(b.settings):0,noiseSpeed:b?.settings.speed??1,mainVolume:ne,onReadyChange:it})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(et,{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(ma,{message:ce,position:ye,onClose:Gt})]})}function kr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:l=null,onClose:s,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:f,canDecrease:b,fontSize:x,lineHeight:C}=Mi({storageKey:"tooltip-fontScale"}),m=o.useCallback(()=>d(w=>w==="dark"?"light":"dark"),[]),_=o.useCallback(w=>{try{w.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},y=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((w,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:w})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__buttons",children:[n.jsx(Ce,{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:!b}),n.jsx(Ce,{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:!f}),n.jsx(Ce,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:m,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(Ce,{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 l?n.jsx(mn,{anchorRect:l,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:y}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:y})}function $c({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(et,{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 Rc(e,t,a){const r=o.useRef(t),l=o.useRef(a);o.useEffect(()=>{r.current=t,l.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,i=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(gn)).find(h=>!h.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=l.current();if(d)try{d.focus()}catch{}}}},[e])}function Pc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:l=!1,onPreviewTextBtn:s,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:h=!1}){const{t:p}=xe.useTranslation(),f=un("(max-width: 767px)"),b=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[m,_]=o.useState(!1),[g,A]=o.useState(null),[y,w]=o.useState(null);Rc(m&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const B=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(D=>typeof D=="string"||typeof D=="number")?i.join(""):"",[i]),k=o.useCallback(()=>{_(!1),A(null),w(null)},[]);o.useEffect(()=>{if(!m)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){k();return}w(typeof D<"u"&&D!==null?D:null)},[B]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(w(typeof D<"u"&&D!==null?D:i),!C.current){_(N=>!N);return}if(m)_(!1),A(null),w(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,i,m]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:b,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),l||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(Ce,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?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}),l&&n.jsx("div",{ref:C,children:n.jsx(Ce,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:m?"is-selected":void 0,"aria-expanded":m,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof s!="function"})})]}),m&&n.jsx(kr,{text:y??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:k,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function Cs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function ea({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:l={},children:s,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:h}=xe.useTranslation(),[p,f]=o.useState(()=>Cs(e,t));o.useEffect(()=>{const v=Cs(e,t);if(v!==p){const B=setTimeout(()=>f(v),0);return()=>clearTimeout(B)}},[e,t,p]);const b=o.useCallback((...v)=>{Cs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[m,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const B=v;if(typeof v=="object"&&(B.currentTarget||B.target)&&(B.nativeEvent||B.type)){const D=B.currentTarget??B.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const k=v;if(k&&typeof k.getBoundingClientRect=="function")return k.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:B="",label:k="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const I=g(v);_({text:B,label:k,anchorRect:I,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),y=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),w=o.Children.map(s,v=>{if(o.isValidElement(v)){const B=v;if(typeof B.type=="string")return B;const k=B.props??{},E=typeof k.onDone=="function"?k.onDone:b,D=typeof k.disabled=="boolean";let N=p==="disabled";return D&&(N=!!k.disabled),o.cloneElement(B,{onDone:E,disabled:N,showTooltip:A,hideTooltip:y})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx($c,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Pc,{state:p,title:r,...l,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}),w]}),x?n.jsx(mn,{anchorRect:m.anchorRect,backdrop:m.backdrop,onClose:y,ariaLabel:h("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(kr,{text:m.text,onClose:y})}):null]})}function Ic({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[l,s]=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(R=>R==="dark"?"light":"dark"),{increase:d,decrease:h,canIncrease:p,canDecrease:f,fontSize:b,lineHeight:x}=Mi({storageKey:"textbox_fontScale"}),[C,m]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=Cr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),y=o.useCallback(()=>m(""),[]),w=R=>{try{m(R)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const R=setTimeout(()=>s(t),0);return()=>clearTimeout(R)}},[t]);const B=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[k,E]=o.useState(B);k!==B&&(E(B),s("disabled"));const D=t==="disabled"?l:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",I=o.useMemo(()=>({fontSize:`${b}px`,lineHeight:`${x}px`}),[b,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const R=document.activeElement;R&&R!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&i==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(Ce,{htmlType:"button",size:48,type:"bar",onClick:A,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":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:I,children:B})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(Ce,{htmlType:"button",size:32,type:"dot",onClick:h,onDisabledClick:()=>w(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:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(Ce,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>w(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,...!v&&{width:"60px"}}),n.jsx(Ce,{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(ma,{message:C,position:"top",onClose:y})]})}function ta(e){return e==="active"||e==="done"}function gs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,useTitleFaded:s,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:h,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:b=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:m}=xe.useTranslation(),_=l??m("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",y=Array.isArray(h)&&h.length?h:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,w=d?d.join("||"):"",v=h?h.join("||"):"",[B,k]=o.useState(()=>Array.isArray(y)?C?Ta(y):y.slice():void 0);o.useEffect(()=>{Array.isArray(y)&&y.length?k(C?Ta(y):y.slice()):k(void 0)},[c,w,v,C]);const[E,D]=o.useState(null),[N,I]=o.useState(()=>new Set);o.useEffect(()=>{D(null),I(new Set)},[v,c,w]);const R=o.useRef(void 0);o.useEffect(()=>{const T=R.current;typeof T=="number"&&typeof t=="number"&&typeof e=="number"&&T>=e&&t<e&&(D(null),I(new Set)),R.current=t},[t,e]);const Y=o.useCallback(T=>{if(!ta(A))return;const L=B?.[T];if(L==null)return;const Z=L;if(p){const G=new Set(N);G.has(Z)?G.delete(Z):G.add(Z),I(G),typeof u=="function"&&u({selectedValues:[...G],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...G],__ts:Date.now()})}else D(Z),typeof u=="function"&&u({selectedIndex:T,selectedValue:Z,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:T,selectedValue:Z,__ts:Date.now()})},[B,A,p,u,N]),M=`training-step__buttons${Array.isArray(B)&&B.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:M,children:Array.isArray(B)&&B.length>0?B.map((T,L)=>n.jsx(Ce,{htmlType:"button",size:56,type:"bar",onClick:()=>Y(L),ariaLabel:String(T),label:T,useLabel:!0,icon:x?x[String(T)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(T):E===T,useDisabledCovered:b,minWidth:0},String(T))):null})})}function bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),h=l??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,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",b=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,m]=o.useState(c??null),_=`${String(b)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&m(null));const[y,w]=o.useState(c);Object.is(y,c)||(w(c),m(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&m(null),v.current=t},[t,e,c]);const B=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof i=="function"&&i(N),ta(f)&&typeof s=="function"&&s(N)},[i,f,s]),k=o.useCallback(()=>{ta(f)&&(m(!1),B(!1))},[B,f]),E=o.useCallback(()=>{ta(f)&&(m(!0),B(!0))},[B,f]);return n.jsxs(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:h,onDone:s,useTitleFaded:!1,children:[n.jsx(Ic,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(Ce,{htmlType:"button",size:56,type:"bar",onClick:()=>{ta(f)&&(m(N),B&&B(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(Ce,{htmlType:"button",size:56,type:"bar",onClick:k,disabled:f==="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(Ce,{htmlType:"button",size:56,type:"bar",onClick:E,disabled:f==="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 ys({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:l,btnLabel:s,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:h,disabled:p,_pageIndex:f,showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:m}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,title:g,onDone:l,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:h},children:n.jsx(fs,{soundSrc:i,ttsText:i?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:m},`audio-p${f??0}-s${e}`)})}const o_=[];function vs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=o_}){const{t:c}=xe.useTranslation(),d=l??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),h=V=>typeof V=="string"?V:V&&(V.context||V.sentence||V.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[b,x]=o.useState(()=>(p||[]).map((V,S)=>({id:S,text:h(V)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),m=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const V=Array.isArray(u)?u:[];f(V);const S=(P=>{const F=(P||[]).map((me,ne)=>({id:ne,text:h(me)}));if(F.length<=1)return F;const X=(me,ne)=>{if(me.length!==ne.length)return!1;for(let W=0;W<me.length;W++)if(me[W].text!==ne[W].text)return!1;return!0};let se=Ta(F),ae=0;for(;X(se,F)&&ae<20;)se=Ta(F),ae+=1;return se})(V);x(S);try{if(typeof i=="function"){const P=S.filter((F,X)=>F.text===h(V[X])).length;i({shuffled:S,score:P,total:(V||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const P=S.filter((F,X)=>F.text===h(V[X])).length;g.current=u,s({shuffled:S,score:P,total:(V||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const V=Array.isArray(u)?u:[],S=b.filter((P,F)=>P.text===h(V[F])).length;s({shuffled:b,score:S,total:V.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(V,S)=>{const P=[...b],F=V+S;if(F<0||F>=P.length)return;const X=P[F];P[F]=P[V],P[V]=X,Z(P);try{if(typeof s=="function"&&C==="active"){const se=P.filter((ae,me)=>ae.text===h(p[me])).length;s({shuffled:P,score:se,total:(p||[]).length,__ts:Date.now()})}}catch{}},[y,w]=o.useState(null),v=o.useRef(null),B=o.useRef(null),k=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),I=o.useRef(null),R=o.useRef({dx:0,dy:0}),Y=()=>{if(I.current!==null)return;const V=()=>{if(!v.current){I.current=null;return}I.current=requestAnimationFrame(V);const S=N.current,P=R.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-P.dx}px, ${S.y-P.dy}px, 0)`)};I.current=requestAnimationFrame(V)},M=o.useRef(new Map),T=o.useRef(new Map),L=()=>{const V=new Map;return M.current.forEach((S,P)=>{S&&S.getBoundingClientRect&&V.set(P,S.getBoundingClientRect())}),V},Z=V=>{const S=L();x(V);try{if(typeof i=="function"){const P=V.filter((F,X)=>F.text===h(p[X])).length;i({shuffled:V,score:P,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const P=L();V.forEach(F=>{const X=S.get(F.id),se=P.get(F.id),ae=M.current.get(F.id);if(!ae||!X||!se)return;const me=X.top-se.top;me&&(ae.style.transition="none",ae.style.transform=`translateY(${me}px)`,requestAnimationFrame(()=>{ae.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",ae.style.transform="";const ne=()=>{ae.style.transition="",ae.removeEventListener("transitionend",ne)};ae.addEventListener("transitionend",ne)}))})})},G=(V,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(V))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const P=document.createElement("div");P.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(P),S.dataTransfer?.setDragImage(P,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(P)}catch{}})}catch{}}catch{}w(V);try{const P=b[V],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=P&&P.text?P.text:"",document.body.appendChild(F),v.current=F;const X=M.current.get(P.id);let se=S.clientX||0,ae=S.clientY||0;try{if(X&&X.getBoundingClientRect){const K=X.getBoundingClientRect();se=K.left+K.width/2,ae=K.top+K.height/2}}catch{}const me=F.getBoundingClientRect(),ne=me.width/2,W=me.height/2;R.current={dx:ne,dy:W},F.style.transition="none",N.current={x:se,y:ae},F.style.transform=`translate3d(${se-ne}px, ${ae-W}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}Y()});const ie=K=>{const ce=K;N.current={x:ce.clientX,y:ce.clientY},Y()};k.current=ie,document.addEventListener("mousemove",ie);const q=K=>{const ce=K;N.current={x:ce.clientX,y:ce.clientY},Y()};B.current=q,document.addEventListener("dragover",q);try{S.dataTransfer?.setData("text/plain",String(V));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:V}))}catch{}}catch{}}catch{}},O=(V,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const P=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(P&&E.current!==P){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{P.classList.add("drag-over")}catch{}E.current=P}}catch{}},U=(V,S)=>{S.preventDefault();const P=S.dataTransfer?.getData("text/plain")||"",F=P?parseInt(P,10):y,X=V;if(typeof F!="number"||isNaN(F)||F===X){w(null),z(),$();return}const se=EC(b,F,X);Z(se),w(null),$();try{if(typeof s=="function"&&C==="active"){const ae=se.filter((me,ne)=>me.text===h(p[ne])).length;s({shuffled:se,score:ae,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const ae=document.querySelectorAll(".order-list .order-list__item")[X];if(!ae)return;const me=ae.querySelector(".order-list__slot")||ae;try{me.classList.add("pulse"),me.offsetHeight,me.classList.add("to-dark");const ne=()=>{me.classList.remove("pulse","to-dark"),me.removeEventListener("transitionend",ne)};me.addEventListener("transitionend",ne)}catch{}})}catch{}z()},$=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}B.current&&(document.removeEventListener("dragover",B.current),B.current=null),k.current&&(document.removeEventListener("mousemove",k.current),k.current=null),I.current!==null&&(cancelAnimationFrame(I.current),I.current=null)},H=()=>{w(null),z(),$()};o.useEffect(()=>()=>$(),[]);const z=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(V=>V.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const V=Math.max(1,(b||[]).length);b.forEach((S,P)=>{const F=T.current.get(S.id);if(!F)return;let X=50;V>1&&(X=Math.round(P/(V-1)*100));try{F.style.setProperty("--marker-pos",X+"%")}catch{}})}catch{}},[b]),o.useEffect(()=>()=>{$(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:b.map((V,S)=>{const P=Math.max(1,(b||[]).length),F=P>1?Math.round(S/(P-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":F+"%"},ref:X=>{const se=T.current;X?se.set(V.id,X):se.delete(V.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:X=>{const se=M.current;X?se.set(V.id,X):se.delete(V.id)},className:`order-list__draggable ${y===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:m,onDragStart:m?X=>G(S,X):void 0,onDragEnter:m?X=>O(S,X):void 0,onDragOver:m?X=>O(S,X):void 0,onDragLeave:m?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const X=document.querySelectorAll(".order-list .order-list__item");X&&X[S]&&(X[S].classList.remove("drag-over"),E.current===X[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:m?X=>U(S,X):void 0,onDragEnd:m?H:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:V.text}),m?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(Ce,{htmlType:"button",size:32,type:"dot",onClick:()=>A(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(Ce,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===b.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},V.id)})})})}const s_=8e3;function l_(e,t){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.then(l,l),setTimeout(l,t)})}function Fc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:h=!1,maxCards:p,playAllGapMs:f=0}){const{t:b}=xe.useTranslation(),x=l??b("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]),m=p??3,_=(C||[]).slice(0,m);(C||[]).length>m&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${m} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[y,w]=o.useState(null),v=o.useRef([]),[B,k]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{w(null)},[N]);const I=o.useRef(void 0);o.useEffect(()=>{const L=I.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&w(null),I.current=t},[t,e]);const R=o.useCallback((L,Z)=>{if(c)return;const G={item:L,index:Z,__ts:Date.now()};try{typeof i=="function"&&i(G)}catch{}if(A==="active"&&typeof s=="function")try{s(G)}catch{}},[c,i,A,s]),Y=o.useRef(f);o.useEffect(()=>{Y.current=Math.max(0,f||0)},[f]);const M=o.useCallback(async()=>{if(B||A==="disabled")return;k(!0);let L=!1;const Z=new Promise(G=>{E.current=()=>{L=!0,G()}});try{for(let G=0;G<_.length&&!(!D.current||L);G++){const O=v.current[G];if(!O)continue;await Promise.race([l_(O.play(),s_),Z]);const U=Math.max(0,Y.current||0);U>0&&G<_.length-1&&!L&&D.current&&await Promise.race([new Promise($=>{setTimeout($,U)}),Z])}}finally{E.current=null,k(!1)}},[B,A,_.length]),T=o.useCallback((L,Z)=>{if(!ta(A))return;w(Z);const G={selectedValue:L.word||L.title||"",selectedIndex:Z,item:L,__ts:Date.now()};try{typeof i=="function"&&i(G)}catch{}if(typeof s=="function")try{s(G)}catch{}},[i,A,s]);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:M,playAllActive:B},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Z=E.current;if(!Z)return;const G=L.target;G&&typeof G.closest=="function"&&G.closest(".training-word-card__bottom")&&Z()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:b("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((L,Z)=>n.jsx(Xo,{ref:G=>{v.current[Z]=G},item:L,disabled:A==="disabled",onPlayDone:()=>R(L,Z),selectable:c,selected:c&&y===Z,onSelect:c?()=>T(L,Z):void 0,flipDelay:Z*120,hideLabel:d,hideAudio:h},L&&L.id||Z))})})}const i_=160,Oc=()=>{};function Dn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:y,children:w,align:v="horizontal",icon:B,useFullWidth:k=!1}=e,E=D=>{y&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),y())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",k?"panel-row--label-fixed panel-row--fill":"",y?"panel-row--clickable":""),onClick:y,onKeyDown:y?E:void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[B!=null&&n.jsx("div",{className:"panel-row__icon",children:B}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:w})]})}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(Ga,{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:l,onClick:s,required:i,error:u,align:c="horizontal",useFullWidth:d=!1,icon:h}=e,p=a==="button"?void 0:s;let f=null;const b=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(vu,{checked:g.checked,onChange:g.onChange,id:b})}else if(a==="segmented"){const g=e;f=n.jsx(bn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((y,w)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(cn,{options:y.options,value:y.value,onChange:y.onChange,placeholder:y.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:y.ariaLabel??([r,y.placeholder].filter(Boolean).join(" ")||void 0)})},w))}):n.jsx(cn,{options:g.options??[],value:g.value??"",onChange:g.onChange??Oc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,y)=>n.jsx(Ce,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},y))}):f=n.jsx(Ce,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??Oc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,ghostHint:g.ghostHint,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:i,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const m=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",m?"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:[b?n.jsxs("label",{htmlFor:b,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:"*"})]}),l&&n.jsx("div",{className:"panel-row__sub caption-1",children:l})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function zc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function u_({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:l}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const i=e[s],u=s==="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(Ce,{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(s)})]}),i?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[i.device&&n.jsx(Et,{size:"small",variant:Ou(i.device),fill:"soft",label:zu(i.device,r)}),zc(i)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:zc(i)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:i.productName||i.brand}),Ko(i.wornYear,i.wornMonth,i.wornDay,l.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Ko(i.wornYear,i.wornMonth,i.wornDay,l.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Ar({title:e,titleLevel:t=2,icon:a,disc:r,actions:l,size:s="medium",minHeight:i,maxWidth:u,className:c,scrollable:d,scrollbarGutter:h="auto",compactRows:p=!1,useBorder:f=!0,useBg:b=!0,useRowBorder:x=!0,labelWidth:C,form:m=!1,loading:_,empty:g,children:A}){const y=_e("panel",`panel--${s}`,m?"panel--form":"",i!==void 0?"panel--fill":"",f?"":"panel--no-border",b?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),w={};i!==void 0&&(w.minHeight=i),u!==void 0&&(w.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(w["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:y,style:Object.keys(w).length?w:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(et,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),l&&n.jsx("div",{className:"panel__actions",children:l})]}),_?n.jsx(Dn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Dn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",h==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function c_({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:l,style:s,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 f=new ResizeObserver(([b])=>d(b.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const h=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",l),style:{"--panel-grid-cols":h?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:i})}function d_(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 Wc(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"}]}d_(Rt.t.bind(Rt)),Wc(Rt.t.bind(Rt));const Nr="none",p_=.5,h_=1.5,m_=.25;function xs({title:e,valueLabel:t,value:a,min:r,max:l,step:s,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(Dn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Lu,{value:a,onChange:d,min:r,max:l,step:s,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function Hc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),l=un("(max-width: 767px)")?40:24,s=xr(),i=Ja(s?.settings??Qn),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,h=s?.mainVolume??1,p=Math.round(h*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),b=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Xa,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===Nr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),m=[{key:Nr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Wc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(mn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__header",children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(Ce,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Ar,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(xs,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:l,onChange:f}),n.jsx(xs,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:p_,max:h_,step:m_,size:l,onChange:b}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Dn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(bn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:m,value:c?u:Nr,onChange:C})}),n.jsx(xs,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:Xa,step:_c,size:l,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Dn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(bn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:m,value:Nr,onChange:()=>{}})})})]})})}function Vc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:l=0,stepCount:s=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:h}=xe.useTranslation(),[p,f]=o.useState(!1),[b,x]=o.useState(null),[C,m]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=xr(),y=u>0,w=y&&i<u-1,v=!y||i>=u-1,B=l===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const k=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=_?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Z=g?.current?.getBoundingClientRect();Z&&x(Z),t?.(),f(!0)},[p,t]),N=un("(max-width: 767px)"),I=o.useRef(null),[R,Y]=o.useState(null),M=o.useCallback(()=>{m(Z=>{const G=!Z;return Y(G?I.current?.getBoundingClientRect()??null:null),G})},[]),T=o.useCallback(()=>{m(!1),Y(null)},[]);o.useEffect(()=>{c&&(m(!1),Y(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(qo,{analyser:A?.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(qo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.noise","\uC18C\uC74C")})]})]});return Rc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.current].map(Z=>Z?.querySelector("button")??null).find(Z=>!!Z&&Z.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(Ce,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:E,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:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(Ce,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:I,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(Ce,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:M,selected:C,"aria-expanded":N?C:void 0,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:L})]}),e&&C&&N&&R&&n.jsx(mn,{anchorRect:R,onClose:T,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:[v&&n.jsx(Ce,{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:!B}),w&&n.jsx(Ce,{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:!B})]}),e&&p&&n.jsx(Hc,{anchorRect:b,onClose:k,hideNoiseRows:d})]})}function qc({title:e,subtitle:t,desc:a,depth:r,icon:l,wrapperStyle:s,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:h,onBack:p,onClose:f}){const{t:b}=xe.useTranslation(),x=un("(max-width: 767px)"),C=Number.isInteger(h)?h:u||0,m=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,y=typeof t=="string"?t.trim():t,w=!!(A||y),v=w?A||y:b("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),B=g||(A?t:void 0),k=x&&typeof B=="string"&&(B.includes(" \xB7 ")||B.includes(" / "))?B.split(/\s[·/]\s/).pop():B,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(Ce,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:b("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:l?n.jsx(du,{icon:l,label:e,tooltip:i,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[k?n.jsx("span",{className:"pp-title__depth caption-1",children:k}):null,n.jsx("span",{className:`pp-title__title h2${w?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Iu,{max:Math.max(0,m??0),index:Math.max(0,C??0)})]})}function f_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function C_(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 Uc=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Gc(e,t,a){const r=e,l=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=ql().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:l,label:r?.title||l,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Uc(`topic.${s.key}`,s.label):void 0,i?Uc(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function _s(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Kc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,l=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(l).toISOString()}:{}}}function g_(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function b_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:l=[],emptyMessage:s,buildResults:i,metaPatch:u}){const c=Gc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},h=t?.id||t?.title||l.length;return{id:`${e}:${h}`,meta:{...c,...d},pages:l,emptyMessage:s,buildResults:i}}function y_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function v_(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 x_(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 Yc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function __(e,t,a,r){return Yc(e,t*a+r)}function w_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const l=e;if(Array.isArray(l.selectedValues))return r.every(s=>l.selectedValues.includes(s))&&l.selectedValues.every(s=>r.includes(s));if(typeof l.correct=="boolean")return l.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(l=>String(l)===String(a[t]));if(typeof t<"u")return r.some(l=>String(l)===String(t))}}function B_(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 Zc=o.createContext(null);function k_(){const e=o.useContext(Zc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function A_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,choices:s=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,h=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),b=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[b]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const m=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!ta(h))return;const y=p;let w;if(y[A]!=null){const B=y[A];w=y.map(k=>k!==null&&k>=B?null:k)}else w=[...y],w[A]=m;f(w);const v={selectedOrder:w,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(y[A]==null&&w.length>0&&w.every(B=>B!==null))try{typeof i=="function"&&i(v)}catch{}},[h,p,m,u,i,s]),g=l??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,y)=>n.jsx(Xo,{item:{word:A},disabled:h==="disabled",selectable:!0,selected:p[y]!==null,orderRank:p[y],onSelect:()=>_(y),flipDelay:y*120,hideLabel:!1,hideAudio:!0},`${A}-${y}`))})})}function Er(e){return null}Er.__isTrainingPage=!0;function xa(e,t){const a=k_();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 Xc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i}=xa(e,t);return n.jsx(ys,{...a,index:r,stepIndex:l,isLast:s,onDone:i})}function Jc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(gs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function Qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(bs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function ed({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(vs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function td({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(Fc,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function N_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(A_,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}const nd=3e4,E_=/^(https?:|blob:|data:audio|\/|\.\/)/;function ad(e){return typeof e=="string"&&E_.test(e)?e:null}const D_=e=>typeof e=="string"&&e.trim()!==""?e:null,ws=Symbol("timed-out");function S_(e,t){if(t<=0)return Promise.resolve(ws);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(ws),t)})]).finally(()=>clearTimeout(a))}function j_(e){return e?Na()||Zr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function T_(e,t){const a=[],r=ad(t);r&&a.push({kind:"raw",resolve:async()=>r});const l=(e??"").trim();if(!l)return a;for(const[s,i]of[["urlResolver",Na()],["fallbackUrlResolver",Zr()]])i&&a.push({kind:s,resolve:async u=>{let c;try{c=await S_(i(l),u)}catch(h){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,h),null}return c===ws?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${nd}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):D_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \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 M_(){return Date.now()+nd}const L_=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function $_(e){St("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 Dr(...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 l of r){if(typeof l=="string"&&l.trim().length)return l.trim();if(typeof l=="number"||typeof l=="boolean")return String(l)}}}return null}function R_(e){return Dr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function P_(e){return ad(Dr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function rd(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=Dr(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 od(e){const{score:t,contextsLength:a,results:r=[],subtitle:l,onReplay:s,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),h=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=rd(D),I=Dr(D?.wording,D?.label);return N===!0?{variant:"main",label:I??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:I??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:I??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),b=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),m=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{m.current?.(),m.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const y=o.useRef(0),w=(D,N)=>{if(!$n)return;const I=Math.round(performance.now()-y.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${I}ms ${D}`,N??"")},v=o.useRef(0),B=o.useCallback((D,N,I)=>{A();const R=++v.current,Y=()=>v.current===R;y.current=$n?performance.now():0,w(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:I}),g(D),m.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Kr()};const M=G=>{w("\uD2BC\uB2E4",G);const O=hr(G,U=>{w(`\uB05D\uB0AC\uB2E4 \u2014 ${U?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:Y()}),U&&Y()&&(m.current=null,g(null))});return m.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,O.stop(),Kr()},O.done},T=T_(N,I);w("\uCC28\uB840",T.map(G=>G.kind));const L=T[0]?.kind==="raw",Z=L?M(I):Promise.resolve(!1);(async()=>{if(await Z||!Y())return;const G=M_(),O=L?T.slice(1):T;for(let U=0;U<O.length;U++){if(!Y())return;w(`${O[U].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const $=await O[U].resolve(L_(G,O.length-U));if(w(`${O[U].kind} \uAC00 \uB2F5\uD588\uB2E4`,$),!Y()||$&&(await M($)||!Y()))return}Y()&&(w("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),$_(N),m.current=()=>{v.current++,Kr()},w("\uB0AD\uB3C5\uD55C\uB2E4"),Pf(N,{onEnd:()=>{Y()&&(m.current=null,g(null))}}))})()},[A]),k=o.useMemo(()=>C.map(D=>{const N=D??{},I=R_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:R,label:Y}=f(N),M=Array.isArray(N.corrects)?N.corrects:[],T=M.length?M.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,L=typeof N.selectedText=="string"?N.selectedText:null,Z=rd(N)===!0,G=P_(N),O=!!G||j_(I);return{problem:I,variant:R,label:Y,answer:T,selectedText:L,isCorrect:Z,sound:G,canHear:O}}),[C,f,d]),E=o.useMemo(()=>k.some(D=>D.answer!==null||D.selectedText!==null),[k]);return n.jsx(On,{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:D,closeWithAnimation:N})=>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(Ce,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>D(s)}),n.jsx(Ce,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,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.")}),l&&n.jsx("p",{className:"trp-result__subtitle body-3",children:l}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:b}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:b})]})})]}),k.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" 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")}),E&&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")})]}),k.map((D,N)=>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(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(Ce,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():B(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.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:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(Et,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const Bs=new Set;function I_(e){o.useEffect(()=>{if(!e||Bs.has(e))return;Bs.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,l=0,s=0;const i=()=>{const h=Date.now();a==null&&(a=h),r==null&&(r=h)},u=()=>{r!=null&&(l+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const h=l-s;if(h<1e3||s===0&&l<5e3)return;const p=Date.now(),f=p-h;s=l,jC({trainingType:e,startedAt:new Date(f).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(),Bs.delete(e)}},[e])}function Sr(e,t){return e&&e.id||`page-${t??0}`}function jr(e,t){return e&&e.key||`step-${t??0}`}function Tr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function F_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const O_=300,z_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Sn=Object.freeze({}),sd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function ks(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,l=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?l:null,total:r}}const W_=e=>n.jsx(od,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function H_(e){const{scenario:t,title:a,subTitle:r,depth:l,icon:s,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:h,stepCount:p,onBack:f,onComplete:b,onRoundFinished:x,onNext:C,onSettings:m,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:y,buildResults:w,onResult:v,typeKey:B,entryPoint:k,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:I,hideNoiseRows:R=!1}=e;I_(B&&!sd.has(B)?B:"");const Y=o.useRef(0);o.useEffect(()=>{Y.current=Date.now()},[]);const{t:M}=xe.useTranslation(),T=v,L=!!t,Z=t?.id||null,G=t?.meta||{},O=Array.isArray(t?.pages)?t.pages:[],U=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],$=U.length>0,H=le=>le===Er||le?.__isTrainingPage===!0,z=$&&U.some(le=>H(le.type)),V=z?U.filter(le=>H(le.type)).map((le,Be)=>{const je=le.props||{};return{id:`children-page-${Be}`,steps:o.Children.toArray(je.children).filter(o.isValidElement),pageTop:je.pageTop||je.top||null,pageBottom:je.pageBottom||je.bottom||null}}):[{id:"children-page-0",steps:U}],S=$&&!L&&typeof g!="function",P=S?Math.max(1,V.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 le=document.body;return le.dataset.ihabTrainingPopupCount=String(Number(le.dataset.ihabTrainingPopupCount||"0")+1),le.classList.add("ihab-training-popup-open"),()=>{const Be=Number(le.dataset.ihabTrainingPopupCount||"1")-1;Be>0?le.dataset.ihabTrainingPopupCount=String(Be):(delete le.dataset.ihabTrainingPopupCount,le.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return dv()},[]);const[F,X]=o.useState({...Qn,enabled:!1}),se=o.useRef(F);o.useEffect(()=>{se.current=F},[F]);const ae=o.useRef(I),me=o.useRef(!1),ne=o.useRef(null);o.useEffect(()=>{let le=!1;const Be=je=>{if(le)return;me.current=!0;const Ge=je?Jn({...Qn,enabled:!1},je):{...Qn},Oe=ne.current;ne.current=null;const J=Oe?Jn(Ge,Oe):Ge;se.current=J,X(J),Oe&&!ae.current&&io(J),rr(J);const ue=ae.current;if(ue){const ee=typeof ue=="function"?ue(J):ue,ve=Jn(J,ee);se.current=ve,X(ve),rr(ve)}};return WC().then(je=>{if(le){const Ge=ne.current;if(ne.current=null,Ge&&!ae.current){const Oe=je?Jn({...Qn,enabled:!1},je):{...Qn};io(Jn(Oe,Ge))}return}Be(je)}),()=>{le=!0}},[]);const[W,ie]=o.useState(null),[q,K]=o.useState(null),ce=o.useCallback((le,Be)=>{le==="main"?ie(Be):K(Be)},[]),ke=o.useRef(null),ye=o.useRef(null),de=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const le=ke.current;ke.current=null,le&&io(le)},[]);o.useEffect(()=>{if(typeof window>"u")return;const le=()=>{document.visibilityState==="hidden"&&de()};return window.addEventListener("pagehide",de),document.addEventListener("visibilitychange",le),()=>{window.removeEventListener("pagehide",de),document.removeEventListener("visibilitychange",le),de()}},[de]);const oe=o.useCallback(le=>{const Be=Jn(se.current,le);if(se.current=Be,X(Be),!me.current){ne.current={...ne.current??{},...le},rr(Be);return}ae.current||(ke.current=Be,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(de,O_)),rr(Be)},[de]),ge=F.mainSpeed,he=F.mainVolume,pe=o.useCallback(le=>oe({mainSpeed:le}),[oe]),Me=o.useCallback(le=>oe({mainVolume:le}),[oe]),ze=o.useMemo(()=>({settings:F,setSettings:oe,registerAnalyser:ce,mainAnalyser:W,noiseAnalyser:q,playbackRate:ge,setPlaybackRate:pe,mainVolume:he,setMainVolume:Me}),[F,oe,ce,W,q,ge,pe,he,Me]),Le=o.useRef(null),[Fe,We]=o.useState(0),pt=o.useRef([]),[it,at]=o.useState("center"),[ht,Ne]=o.useState(!1),Ve=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(le=>{Ve.current||(Ve.current=!0,Ne(!0),we.current=setTimeout(()=>{try{le()}catch{Ve.current=!1,Ne(!1)}},z_()?0:i_))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const Ae=o.useRef(f);o.useEffect(()=>{Ae.current=f});const $e=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const le=Le.current,Be=$e.current;if(mo(le,Be),le){const je=Array.from(le.querySelectorAll(gn)).filter(Ge=>!Ge.closest('[aria-hidden="true"]'))[0];if(je)try{je.focus()}catch{}}return()=>{const je=document.activeElement;if(!je||je===document.body||le&&le.contains(je))try{fo(Be)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const le=Ae.current;typeof le=="function"&&le()})),[Ue]),po(Le,!0);const[Se,Xe]=o.useState(!1),gt=o.useRef(!1),[nt,Je]=o.useState(null),_t=o.useRef(0),mt=o.useRef(0),wt=()=>{_t.current+=1,mt.current+=1,Je(null)},[vt,bt]=o.useState(""),[Ke,re]=o.useState(()=>Tr()),Ee=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(re(Tr()),wt())},[L,Z,S]),o.useEffect(()=>{S&&re(le=>{const Be=Math.max(0,Math.min(le.pageIndex,Math.max(0,P-1)));return Be!==le.pageIndex?{...le,pageIndex:Be,stepIndex:0}:le})},[S,P]);const Qe=S?Math.max(0,Math.min(Ke.pageIndex,P-1)):0,qe=S?V[Qe]:null,rt=S&&qe&&Array.isArray(qe.steps)?qe.steps:[],Te=L?Ke.pageIndex:S?Qe:typeof c=="number"?c:0,ut=L?O[Math.max(0,Math.min(Ke.pageIndex,Math.max(0,O.length-1)))]:null,Re=L&&ut&&Array.isArray(ut.steps)?ut.steps:[],ot=L?Re.length:S?rt.length:typeof p=="number"?p:0,ft=L||S?Math.max(0,Math.min(Ke.stepIndex,Math.max(0,ot))):typeof h=="number"?h:0,Bt=L?O.length:S?P:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const le=L?Sr(ut,Te):qe?.id||`children-page-${Te??0}`,Be=new Date().toISOString();for(let je=0;je<=ft;je+=1){const Ge=L?jr(Re[je],je):`step-${je}`,Oe=dt(le,Ge);lt.current.has(Oe)||lt.current.set(Oe,Be)}},[L,S,Te,ft,qe?.id]),o.useLayoutEffect(()=>{const le=Ee.current;if(typeof Te=="number"&&le!==null&&Te!==le&&Te>le)try{bt(M("training.problemNotice",{n:Te+1}))}catch{}Ee.current=typeof Te=="number"?Te:Ee.current},[Te,c,M]),o.useLayoutEffect(()=>{const le=Le.current;if(!le)return;const Be=()=>le.querySelector(".page-popup__scroll");let je=null,Ge=null,Oe=null;const J=He=>{const tt=Be();if(!tt)return;const Ct=tt.scrollHeight<=tt.clientHeight;if(at(Ct?"center":"top"),He&&!gt.current){gt.current=!0;try{Xe(!0)}catch{}try{ve.disconnect()}catch{}}},ue=()=>{je!==null&&cancelAnimationFrame(je),je=requestAnimationFrame(()=>{Ge!==null&&clearTimeout(Ge),Ge=setTimeout(()=>J(!0),60)})},ee=()=>{Oe!==null&&cancelAnimationFrame(Oe),Oe=requestAnimationFrame(()=>J(!1))};ue(),window.addEventListener("resize",ee);const ve=new MutationObserver(ue);ve.observe(le,{childList:!0,subtree:!0,attributes:!0});const Pe=setTimeout(()=>{gt.current||J(!0)},400);return()=>{window.removeEventListener("resize",ee),je!==null&&cancelAnimationFrame(je),Ge!==null&&clearTimeout(Ge),Oe!==null&&cancelAnimationFrame(Oe),clearTimeout(Pe);try{ve.disconnect()}catch{}}},[Le]);const Ze=o.useCallback(le=>{Le.current&&(Le.current._childOnNext=le)},[]),st=o.useCallback(le=>{Le.current&&(Le.current._childOnResult=le)},[]),lt=o.useRef(new Map),dt=(le,Be)=>`${le}\0${Be}`,kt=o.useCallback((le,Be,je)=>{re(Ge=>{const Oe=Ge.answersByPage[le]||{},J=Oe[Be],ue=_s(je),ee=_s(J);if(J&&ee>ue)return Ge;const ve=Kc(je,lt.current.get(dt(le,Be)),ue);return{...Ge,answersByPage:{...Ge.answersByPage,[le]:{...Oe,[Be]:ve}}}})},[re]),Vt=o.useCallback((le,Be,je)=>{const Ge=Sr(ut,Te),Oe=jr(le,Be);kt(Ge,Oe,je)},[ut,Te,kt]),en=o.useCallback((le,Be,je)=>{const Ge=Sr(ut,Te),Oe=jr(le,Be);kt(Ge,Oe,je),!je?.allowChange&&le?.autoAdvance!==!1&&re(J=>({...J,stepIndex:Math.max(J.stepIndex,Be+1)}))},[ut,Te,kt,re]),Cn=o.useCallback((le,Be)=>{const je=qe?.id||`children-page-${Te??0}`,Ge=typeof Be=="number"?Be:ft??0,Oe=`step-${Ge}`;kt(je,Oe,le),le?.allowChange||re(J=>({...J,stepIndex:Math.max(J.stepIndex,Ge+1)}))},[qe,Te,ft,kt,re]),jn=o.useCallback((le,Be)=>{const je=qe?.id||`children-page-${Te??0}`,Ge=`step-${typeof Be=="number"?Be:ft??0}`;kt(je,Ge,le)},[qe,Te,ft,kt]),Wn=S?{currentPageIndex:Te??0,currentStepIndex:ft??0,totalStepsInPage:rt.length,handleStepDone:Cn,handleStepChange:jn}:null,Hn=async()=>{const le=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:O,flowState:Ke,answersByPage:Ke.answersByPage})):null;return typeof T=="function"&&await Promise.resolve(T(le))||le},qt=async()=>{const le=qe?.id||`children-page-${Ke.pageIndex}`,Be=Ke.answersByPage[le]||{},je=z?(()=>{const J={};let ue=0;return V.forEach(ee=>{const ve=Ke.answersByPage[ee.id]||{},Pe=Array.isArray(ee.steps)?ee.steps.length:0;for(let He=0;He<Pe;He+=1){const tt=ve[`step-${He}`];typeof tt<"u"&&(J[`step-${ue+He}`]=tt)}ue+=Pe}),J})():Be;if(typeof w=="function"){const J=await Promise.resolve(w(je,{pageAnswers:Be,answersByPage:Ke.answersByPage,pages:V,currentPageId:le}));return typeof T=="function"&&await Promise.resolve(T(J))||J}const Ge=Object.entries(Be).map(([J,ue],ee)=>({index:ee,key:J,payload:ue})),Oe={results:Ge,answers:Ge,score:0};return typeof T=="function"&&await Promise.resolve(T(Oe))||Oe},dn=()=>{const le=++_t.current,Be=()=>le!==_t.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 Oe=Hn();Je(Sn);const J=Oe;Promise.resolve(J).then(ue=>{Be()||Je(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Je({isEmpty:!0})});return}if(S){const Oe=qt();Je(Sn);const J=Oe;Promise.resolve(J).then(ue=>{Be()||Je(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Je({isEmpty:!0})});return}const je=Le.current&&Le.current._childOnResult,Ge=Oe=>{try{return Oe?Oe():void 0}catch{return}};if(typeof je=="function"){const Oe=Ge(je);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?Je(Oe):Je(Oe&&typeof Oe.then=="function"?Sn:{});const J=()=>{Be()||Je(ue=>ue===Sn?{}:ue)};Promise.resolve(Oe).then(ue=>{ue&&!Be()?Je(ue):J()}).catch(ue=>{J()});return}if(typeof T=="function"){const Oe=Ge(T);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Oe&&typeof Oe.then!="function"?Je(Oe):Je(Oe&&typeof Oe.then=="function"?Sn:{});const J=()=>{Be()||Je(ue=>ue===Sn?{}:ue)};Promise.resolve(Oe).then(ue=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}ue&&!Be()?Je(ue):J()}).catch(ue=>{console.error("viewResults external handler failed",ue),J()});return}},Ut=()=>{if(L){if(typeof Te=="number"&&typeof Bt=="number"&&Te<Bt-1){re(Be=>({...Be,pageIndex:Be.pageIndex+1,stepIndex:0}));return}return dn()}if(S){const Be=rt.length;if(typeof ft=="number"&&ft<Be-1){re(je=>({...je,stepIndex:je.stepIndex+1}));return}if(typeof Te=="number"&&typeof Bt=="number"&&Te<Bt-1){re(je=>({...je,pageIndex:je.pageIndex+1,stepIndex:0}));return}return dn()}if(typeof C=="function"){try{C()}catch{}return}const le=Le.current&&Le.current._childOnNext;if(typeof le=="function"){try{le()}catch{}return}},Lt=L?G.title||G.label||A||M("common.popup","\uD31D\uC5C5"):a||y||(Array.isArray(l)?l[l.length-1]:void 0)||A||M("common.popup","\uD31D\uC5C5"),Tn=A||Lt,ln=L?G.title??G.label??Lt:a??y??Lt,Mn=(le,Be)=>{const je=Sr(ut,Te),Ge=jr(le,Be),Oe=Ke.answersByPage[je]?.[Ge],J=F_(le,{page:ut,pageIndex:Te,step:le,stepIndex:Be,storedPayload:Oe,answersByPage:Ke.answersByPage,flowState:Ke}),ue={key:Ge,index:Be,stepIndex:ft,isLast:Be===Re.length-1};switch(le?.type){case"listen":return n.jsx(ys,{...ue,...J,onDone:ee=>en(le,Be,ee)});case"confirm":return n.jsx(gs,{...ue,...J,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"confirmWithText":return n.jsx(bs,{...ue,...J,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"orderList":return n.jsx(vs,{...ue,...J,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});default:return null}},Ln=o.useRef(void 0);o.useEffect(()=>{const le=Ln.current;if(Ln.current=Te,le===void 0||le===Te||!Cr())return;const Be=Le.current;if(!Be)return;const je=document.activeElement;if(!(!je||je===document.body||!Be.contains(je)||je.disabled===!0))return;const Ge=Be.querySelector(`.training-steps ${gn.split(", ").join(", .training-steps ")}`)??Array.from(Be.querySelectorAll(gn)).find(Oe=>!Oe.closest('[aria-hidden="true"]'));try{Ge?.focus()}catch{}},[Te]);const xn=L?O.length>0?n.jsx("div",{className:"training-steps",children:Re.map((le,Be)=>Mn(le,Be))},`replay-${Fe}`):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,Gt=S?n.jsxs(Zc.Provider,{value:Wn,children:[qe?.pageTop?n.jsx("div",{className:"training-page-top",children:qe.pageTop}):null,n.jsx("div",{className:"training-steps",children:rt.map((le,Be)=>{const je=le;return o.cloneElement(je,{...je.props,_stepIndex:Be,_totalSteps:rt.length,_stepKey:`step-${Be}`,_pageIndex:Te})})},`replay-${Fe}`),qe?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:qe.pageBottom}):null]}):null,Ft=o.useRef(-1),$t=o.useCallback(()=>{if(!B)return;const le=nt,{results:Be,correct:je,total:Ge}=ks(nt),Oe={correct:je,total:Ge,attempt:pt.current.length+1,previousAttempts:[...pt.current]};if(Ft.current===mt.current)return Oe;Ft.current=mt.current,TC({items:zC(Be),category:sd.has(B)?"sentence":"word",trainingType:B,entryPoint:k??"sentence",itemRef:D??null,correct:je,total:Ge,score:typeof le?.score=="number"?le.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-Y.current)/1e3)),dailyTotal:E??null});try{x?.(Oe)}catch{}return Oe},[B,k,E,D,nt,x]);o.useEffect(()=>{!nt||nt===Sn||nt?.isEmpty||(ks(nt).total??0)>0&&$t()},[nt,$t]);const pn=o.useCallback(()=>{const le=$t();wt(),Ue(()=>{typeof b=="function"&&b(le),typeof f=="function"&&f()})},[b,f,$t,Je,Ue]),Ot=o.useCallback(()=>bt(""),[bt]),tn=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),Tt=n.jsxs("div",{className:`page-popup${ht?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Tn,children:[n.jsxs("div",{ref:Le,className:`page-popup__panel ${Se?"":"page-popup__panel--measuring"} ${it==="center"?"page-popup__panel--center":it==="top"?"page-popup__panel--top":""}`,children:[n.jsx(qc,{title:ln,subtitle:L?G.subtitle||G.label:Array.isArray(l)?l.join(" / "):void 0,desc:L?void 0:r,depth:L?G.depth:l,icon:L?G.icon:s,wrapperStyle:L?G.wrapperStyle:i,iconTooltip:L?G.iconTooltip:u,progressMax:Bt,progressIndex:Te,pageIndex:Te,pageCount:Bt,onBack:tn,onClose:tn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${it==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Gt:L?xn:typeof g=="function"?g({registerOnNext:Ze,registerOnResult:st,panelRef:Le,setResultOverlay:Je}):g})}),n.jsx(Vc,{onSettings:m,onNext:Ut,onResult:dn,useNoiseSettingBtn:!!(L?G.useNoiseSetting??!0:_),stepIndex:ft,stepCount:ot,pageIndex:Te,pageCount:Bt,resultOpen:!!(nt&&!nt.isEmpty),hideNoiseRows:R})]}),nt&&!nt.isEmpty&&(N??W_)({score:nt.score,results:nt.results||nt.answers||[],contextsLength:nt.results?nt.results.length:nt.answers?nt.answers.length:0,onReplay:()=>{if(Y.current=Date.now(),nt!==Sn){const{correct:le,total:Be}=ks(nt);pt.current.push({correct:le,total:Be})}if(wt(),We(le=>le+1),L){if(re(Tr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){re(Tr());return}try{const le=Le.current&&Le.current._childOnResult;typeof le=="function"&&le({replay:!0})}catch{}},onClose:pn,pending:nt===Sn}),nt?.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(Ce,{htmlType:"button",variant:"main",size:48,onClick:pn,label:M("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ma,{message:vt,position:"top",onClose:Ot})]}),Kt=n.jsx(ds.Provider,{value:ze,children:Tt});return typeof document<"u"&&document.body?nn.createPortal(Kt,document.body):Kt}const zn=H_;zn.Page=Er,zn.ListenStep=Xc,zn.ConfirmStep=Jc,zn.ConfirmWithTextStep=Qc,zn.OrderListStep=ed,zn.CardStep=td,zn.CardOrderStep=N_;function V_({label:e,homonum:t}){const a=sa()?.(e,t)??"",{imgRef:r,loading:l,hasImage:s,onLoad:i,onError:u}=Zo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[l&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:l?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function ld({words:e,anchorRect:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),l({left:c,top:d})},[t]),!t||e.length===0?null:nn.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(V_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function q_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:l,groups:s,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:h,onPrintEmpty:p,className:f,emptyHint:b,sectionType:x="page",disc:C}){const{t:m,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:y,close:w}=Pa(),[v,B]=o.useState(null),k=o.useCallback(()=>{w(),B(null)},[w]);Oy(k,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,I=r===void 0&&t===void 0,R=N?"match":I?"original":"ganada",[Y,M]=o.useState(()=>R),[T,L]=o.useState("50"),[Z,G]=o.useState(1),[O,U]=o.useState(N);O!==N&&(U(N),M(R));const $=Y==="match"&&!N||Y==="original"&&!I?R:Y,H=o.useMemo(()=>[...N?[{value:"match",label:m("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...I?[{value:"original",label:m("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:m("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:m("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:m("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:m("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:m("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:m("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[m,N,I]),z=o.useMemo(()=>["10","25","50","100"].map(oe=>({value:oe,label:m("wordSearch.pageSize",{count:Number(oe),defaultValue:`${oe}\uAC1C\uC529 \uBCF4\uAE30`})})),[m]),V=oe=>oe.words?.[0],S=o.useMemo(()=>{const oe=[...D].length,ge=mC(D),he=new Map;return pe=>{let Me=he.get(pe);return Me===void 0&&(Me=ge((pe.words?.[0]?.label??"").slice(0,oe))?0:1,he.set(pe,Me)),Me}},[D]),P=o.useCallback((oe,ge)=>{const he=ze=>V(ze)?.label??"",pe=ze=>V(ze)?.syllables??[...he(ze)].length,Me=ze=>(ze.words??[]).reduce((Le,Fe)=>{const We=parseInt(Fe.grade??"",10);return Number.isFinite(We)&&We<Le?We:Le},999);switch($){case"match":return S(oe)-S(ge)||on(he(oe),he(ge));case"ganada":return on(he(oe),he(ge));case"ganada_desc":return on(he(ge),he(oe));case"syllable":return pe(oe)-pe(ge)||on(he(oe),he(ge));case"syllable_desc":return pe(ge)-pe(oe)||on(he(oe),he(ge));case"grade":return Me(oe)-Me(ge)||on(he(oe),he(ge));case"grade_desc":return Me(ge)-Me(oe)||on(he(oe),he(ge));default:return 0}},[$,S]),F=o.useMemo(()=>l.slice().sort(P),[l,P]),X=Number(T)||10,se=o.useMemo(()=>(s??[]).flatMap(oe=>oe.items.slice().sort(P).map(ge=>({item:ge,label:oe.label}))),[s,P]),ae=s?se.length:F.length,me=Math.max(1,Math.ceil(ae/X)),ne=Math.min(Z,me),W=o.useMemo(()=>F.slice((ne-1)*X,ne*X),[F,ne,X]),ie=o.useId(),q=o.useMemo(()=>{if(!s)return null;const oe=se.slice((ne-1)*X,ne*X),ge=new Map;for(const{item:he,label:pe}of oe)ge.has(pe)||ge.set(pe,[]),ge.get(pe).push(he);return[...ge.entries()].map(([he,pe])=>({label:he,items:pe}))},[s,se,ne,X]);o.useEffect(()=>{G(1)},[Y,T,ae,r]);const K=ae>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(cn,{size:40,options:H,value:$,onChange:M,ariaLabel:m("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(cn,{size:40,options:z,value:T,onChange:L,ariaLabel:m("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(mr,{page:ne,totalPages:me,onChange:G})]}):void 0,ce=oe=>{u&&u(oe)},ke=t!==void 0&&a?n.jsxs(n.Fragment,{children:[m("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),m("wordSearch.resultTitleSuffix",{unit:g?kC(a):a})]}):void 0,ye=t!==void 0&&t>0&&c!==void 0&&a?m("wordSearch.resultDisc",{unit:g?NC(a):a,max:c,selected:i.length}):void 0,de=C??ye;return n.jsxs(Ca,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(ke||K||de)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(et,{icon:e,className:"word-search-result-block__head-icon"}),ke&&n.jsx("span",{className:"word-search-result-block__title h3",children:ke})]}),K&&n.jsx("div",{className:"word-search-result-block__head-actions",children:K}),de&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:de})]}),(s?s.length===0:l.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:m("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),b&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:b})]}),s?(q??[]).map(oe=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${ie}-${oe.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${ie}-${oe.label}`,children:oe.label}),n.jsx("div",{className:"word-search-result-block__items",children:oe.items.map(ge=>{const he=i.includes(ge.id);return n.jsx("div",{onMouseEnter:pe=>{y(pe.currentTarget),B(ge.words??[])},onMouseLeave:k,children:n.jsx(Ce,{htmlType:"button",size:"word",align:"grid",label:(ge.words??[]).map(pe=>pe.label),subLabel:(ge.words??[]).some(pe=>pe.subLabel)?(ge.words??[]).map(pe=>pe.subLabel):void 0,selected:he,onClick:()=>ce(ge.id),minWidth:200})},ge.id)})})]},oe.label)):n.jsx("div",{className:"word-search-result-block__items",children:W.map(oe=>{const ge=i.includes(oe.id);return n.jsx("div",{onMouseEnter:he=>{y(he.currentTarget),B(oe.words??[])},onMouseLeave:k,children:n.jsx(Ce,{htmlType:"button",size:"word",align:"grid",label:(oe.words??[]).map(he=>he.label),subLabel:(oe.words??[]).some(he=>he.subLabel)?(oe.words??[]).map(he=>he.subLabel):void 0,selected:ge,onClick:()=>ce(oe.id),minWidth:200})},oe.id)})}),v&&A&&n.jsx(ld,{words:v,anchorRect:A})]}),me>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(mr,{page:ne,totalPages:me,onChange:G})}),(d||h)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",label:m("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(Ce,{htmlType:"button",size:"56",type:"bar",variant:"main",label:m("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:h})})]})]})}function U_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,l=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:l}})}function G_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:l=4,minCount:s=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:h,title:p,titleIcon:f,disc:b,showInfoButton:x=!0,onClearPhoneme:C,onSearch:m,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:y=!1,pairMode:w=!1,sectionType:v="page",beforeSearchContent:B,beforeContent:k,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:I}=xe.useTranslation(),R=o.useMemo(()=>I("wordPairs.infoNotes",{returnObjects:!0}),[I]),Y=o.useMemo(()=>Array.from({length:l-s+1},(S,P)=>{const F=s+P;return{key:String(F),label:I("wordPairs.count",{n:F})}}),[I,l,s]),M=o.useMemo(()=>I("wordPairs.ordinals",{returnObjects:!0}),[I]),T=o.useCallback(S=>N?I("wordPairs.phonemeOrdinalLabel",{ordinal:M[S-1]??S}):a===1?I("wordPairs.phonemeSingleLabel","\uC74C\uC808"):I("wordPairs.phonemeN",{n:S}),[N,M,a,I]),L=o.useCallback(S=>N?I("wordPairs.phonemeContrastOrdinalLabel",{ordinal:M[S-1]??S}):a===1?I("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):I("wordPairs.phonemeContrast",{n:S}),[N,M,a,I]),Z=o.useCallback((S,P)=>P?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:G,toggleAt:O,close:U}=Pa(),$=o.useCallback(S=>r(Number(S)),[r]),H=un("(max-width: 767px)"),z=o.useCallback(S=>U_(S,e).map(({label:P,value:F,displayLabel:X})=>{const se=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"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${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),se&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:X??P})]},P)}),[e,d]),V=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(Ce,{htmlType:"button",size:40,type:H?"dot":void 0,icon:"info",label:H?void 0:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:G?"is-selected":void 0,"aria-expanded":!!G,"aria-haspopup":"dialog",onClick:S=>O(S.currentTarget)})}),G&&n.jsx(Kn,{title:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:R,anchorRect:G,onClose:U})]});return n.jsxs(Ca,{type:v,title:p,icon:f,disc:b,action:x?V:void 0,className:_e("phoneme-select-block",h),children:[k,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(bn,{options:Y,value:String(a),onChange:$,size:40,ariaLabel:I("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:w?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,P)=>{const F=t[P*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:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:T(P+1)})]},P)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:I("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,P)=>{const F=t[P*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:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(P+1)})]},P)})})]}):t.map((S,P)=>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:z(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:T(P+1)})]},P))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:w?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,P)=>{const F=t[P*2]??{};return n.jsx(En,{title:Z(T(P+1),P===0),sections:u?u(F,P*2):i,selected:F,onSelect:c?.(P*2),align:"newline"},P)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,P)=>{const F=t[P*2+1]??{};return n.jsx(En,{title:L(P+1),sections:u?u(F,P*2+1):i,selected:F,onSelect:c?.(P*2+1),align:"newline"},P)})})]}):t.map((S,P)=>n.jsx(En,{title:Z(T(P+1),P===0),sections:u?u(S,P):i,selected:S,onSelect:c?.(P),align:"newline"},P))})}),B&&n.jsx("div",{className:"phoneme-select-block__before-search",children:B}),(C||m||y)&&(()=>{const S=t.every(P=>{const F=cC(P);return Object.entries(F).every(([X,se])=>!se||X==="coda"&&se===jl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",label:I("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),m?n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:y?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||y,onDisabledClick:y?()=>{}:void 0,"aria-busy":y||void 0,onClick:m}):y?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:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function K_({title:e,sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:h}){const{t:p}=xe.useTranslation();return n.jsx(En,{className:h,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function Y_({title:e,headerAction:t,sections:a,selected:r,onSelect:l,className:s}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(En,{className:s,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:l,align:"newline"})}function Z_({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:l,positionCount:s,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:h}=xe.useTranslation(),p={searchMode:h("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:h("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:h("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:h("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:h("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:h("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:h("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:h("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:h("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:h("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:h("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=m=>h("wordPairs.count",{n:m}),b=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ha,{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(Ha,{items:h("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ha,{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.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(m,_)=>{_===p.searchMode?a(m===p.explicit?"explicit":m===p.pick?"pick":"include"):_===p.phonemeOrder?l(m===p.orderMatch?"ordered":"unordered"):_===p.count?i(m===f(2)?2:1):_===p.inputMode&&c(m===p.pronInput?"phoneme":"word")};return n.jsx(En,{className:d,title:e??h("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:b,selected:x,onSelect:C,align:"inline"})}function X_(e){const{title:t,items:a,columns:r,resizeStorageKey:l,gridTemplateColumns:s,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:h=!0,selectedId:p,selectedIds:f,onSelect:b,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:m,emptyText:_,noMatchText:g,countLabel:A,topContent:y,className:w=""}=e,{t:v}=xe.useTranslation(),B=u??v("common.search","\uAC80\uC0C9"),k=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[I,R]=o.useState(d??r[0]?.key??""),[Y,M]=o.useState(h),[T,L]=o.useState(String(m??C[0]??10)),[Z,G]=o.useState(1);o.useEffect(()=>{G(1)},[D,T]);const O=c!==null,U=o.useCallback((ae,me)=>{if(!me)return!0;const ne=me.toLowerCase();return r.some(W=>{const ie=ae[W.key];return ie==null?!1:String(ie).toLowerCase().includes(ne)})},[r]),$=c??U,H=o.useMemo(()=>{const ae=O?a.filter(me=>$(me,D)):a;return I?[...ae].sort((me,ne)=>{const W=me[I],ie=ne[I];return W===ie?0:wo(W,ie,Y)}):ae},[a,D,I,Y,O,$]),z=Math.max(1,Math.ceil(H.length/Number(T)));Z>z&&G(z);const V=Math.min(Z,z),S=H.slice((V-1)*Number(T),V*Number(T)),P=o.useCallback(ae=>{I===ae?M(me=>!me):(R(ae),M(!0)),G(1)},[I]),F=o.useMemo(()=>{if(typeof A=="function"){const ae=H.length,me=A(ae);if(typeof me=="string"){const ne=me.lastIndexOf(String(ae));if(ne>=0)return{prefix:me.slice(0,ne),suffix:me.slice(ne+String(ae).length)}}return{label:me}}if(typeof A=="string"&&A.includes("{n}")){const[ae,me]=A.split("{n}");return{prefix:ae,suffix:me}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,H.length,v]),X=o.useMemo(()=>r.map(ae=>({label:ae.label,onClick:ae.sortable!==!1?()=>P(ae.key):void 0,className:ae.className,sortDir:ae.sortable!==!1&&I===ae.key?Y?"asc":"desc":null})),[r,I,Y,P]),se=o.useMemo(()=>C.map(ae=>({value:String(ae),label:v("common.pageSizeLabel",{n:ae})})),[C,v]);return n.jsxs(On,{className:`popup-list ${w}`,title:t,onClose:x,children:[y,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(Ro,{count:"label"in F?void 0:{value:H.length,prefix:F.prefix,suffix:F.suffix},search:O?{value:D,onChange:N,placeholder:B}:void 0,pageSize:{options:se,value:T,onChange:L},pagination:{page:V,total:z,onChange:G}}),n.jsx(Go,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:l,fields:X,items:S,onRowClick:b,renderRow:ae=>{const me=f!=null?ae.id!=null&&f.has(ae.id):p!=null&&ae.id===p;return r.map(ne=>({content:ne.render?ne.render(ae):ae[ne.key]??"",className:_e(ne.className,me&&"popup-list__row--selected")}))},empty:O&&D!==""&&a.length>0?E:k})]})}function id(e){const{title:t,message:a,topContent:r,details:l,children:s,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:h="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:b=!0,onClose:x,inline:C,size:m="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),y=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=y.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),I=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];I&&!I.disabled&&I.focus()},[]);const w=o.useRef(!1),[v,B]=o.useState(!1),k=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(w.current)return;w.current=!0;const N=typeof document<"u"?document.activeElement:null;B(!0);let I=!1;try{I=await D()}catch(R){typeof console<"u"&&console.error(R)}finally{I||(w.current=!1,B(!1),requestAnimationFrame(()=>{const R=document.activeElement;(!R||R===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(On,{title:t,onClose:x,closeDisabled:v,inline:C,size:m,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);await d.onClick(N.close);const I=d.closeOnClick??!0;return I&&D(),I||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:i??A("common.confirm","\uD655\uC778"),variant:h,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);return await f(N.close),b&&D(),b||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),l&&l.length>0&&n.jsx(Ar,{children:l.map((D,N)=>n.jsx(Dn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:y,className:"body-2 confirm-popup__message",children:a}),s]})}function J_(e,t,a={}){const{t:r}=xe.useTranslation(),[l,s]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(s(!0),!1):!0,[e]),d=l?n.jsx(id,{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:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function Q_({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(""),[s,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 x=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),x()}catch(m){c($l(m)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),b=x=>{l(x.target.value),c(null)};return n.jsx(On,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>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:b,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:h,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const ud=["var(--color-main)","var(--color-sub)"],ew=2e3;function tw(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 As({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:l,trigger:s=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),m=t-C,_=(g,A)=>Array.from({length:g}).map((y,w)=>{const v=6+Math.random()*12,B=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),k=ud[Math.floor(Math.random()*ud.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,I=Math.cos(N)*D,R=Math.sin(N)*D*1.35,Y=Math.random()*720-360,M=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),T=Math.random()>.7?"50%":"3px";return{id:`${A}-${w}`,side:A,size:B,color:k,delay:E,vx:I,vy:R,angularVel:Y,life:M,borderRadius:T}});return[..._(C,"left"),..._(m,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),h=o.useRef(l);o.useEffect(()=>{h.current=l},[l]);const p=o.useRef(null),f=o.useRef(null),b=()=>{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"&&f.current==null&&(f.current=b()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const U=setTimeout(()=>h.current?.(),0);return()=>clearTimeout(U)}const C=1200,m=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=U=>Math.max(40,(U||window.innerWidth)*.02),y=_?.width||window.innerWidth||375,w=_?.height||window.innerHeight||812,v=U=>{const $=[...U].sort((H,z)=>H-z);return $[Math.floor($.length/2)]||1},B=v(i.map(U=>Math.abs(U.vy))),k=v(i.map(U=>Math.abs(U.vx))),E=Math.sqrt(2*C*(w*.72+g))/B,D=B*E/C,N=y*.5/(k*D),I=(U,$,H)=>Math.min(H,Math.max($,U)),R=I(E,.8,2.4),Y=I(N,.7,2.2),M=a>0?a/ew:1,T=i.map(U=>({...U,life:U.life*M,vx:U.vx*Y,vy:U.vy*R,startTime:m+U.delay,ended:!1})),L=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Z=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},G=U=>{let $=!1;for(const H of T){const z=c.current[H.id];if(!z||!z)continue;if(U<H.startTime){z.style.display="none",$=!0;continue}if(!H._inited){const W=H.side==="left"?L.x:Z.x,ie=H.side==="left"?L.y:Z.y;z.style.left=`${W}px`,z.style.top=`${ie}px`,z.style.transform="translate3d(0px, 0px, 0)",z.style.display="block",z.style.zIndex="100000",typeof H.color=="string"&&H.color.startsWith("var(")&&(z.style.background=tw(z,H.color)??"#FF0060"),H._inited=!0}const V=(U-H.startTime)/1e3;if(V<0)continue;const S=H.life/1e3;if(V>=S){z.style.opacity="0",z.style.display="none",H.ended=!0;continue}$=!0;const P=H.side==="left"?L.x:Z.x,F=H.side==="left"?L.y:Z.y,X=P+H.vx*V,se=F+H.vy*V+.5*C*V*V,ae=(H.angularVel||0)*V,me=X-P,ne=se-F;z.style.transform=`translate3d(${me}px, ${ne}px, 0) rotate(${ae}deg)`,z.style.opacity=`${Math.max(0,1-V/S)}`}$?d.current=requestAnimationFrame(G):h.current?.()};d.current=requestAnimationFrame(G);const O=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const U=document.createElement("div");U.className="party-container",U.style.position="fixed",U.style.inset="0",U.style.pointerEvents="none",U.style.overflow="visible",U.style.zIndex="2147483647";for(const $ of i){const H=document.createElement("span");H.className=`confetti confetti--${$.side}`,H.setAttribute("aria-hidden","true"),H.style.display="none",H.style.position="fixed",H.style.left="0px",H.style.top="0px",H.style.width=`${$.size}px`,H.style.height=`${Math.max(4,$.size*.6)}px`,H.style.background=$.color,H.style.borderRadius=$.borderRadius,H.style.transform="translate3d(0,0,0)",H.style.opacity="0",U.appendChild(H),c.current[$.id]=H}(document.body||f.current).appendChild(U),p.current=U}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(O),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,i]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:m=>{c.current[C.id]=m},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}-${s}`))});return typeof document<"u"?nn.createPortal(x,f.current||document.body):x}const Ns=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function nw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Ns(u.count),strength:Ns(u.strength),duration:Ns(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const l=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(As,{active:t,trigger:e}),a&&n.jsx(As,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:l})]})}function aw({title:e,sub:t,rightAction:a,titleAction:r,badge:l,badgeVariant:s="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:h}=xe.useTranslation();Ay(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(Ce,{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}),l&&n.jsx("div",{className:"page-title__badge",children:n.jsx(Et,{label:l,size:"small",variant:s,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 rw(e){return e??""}const cd=o.createContext({words:[],loading:!1});function ow(){return o.useContext(cd)}function sw({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const h=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,l,s,i,u,c]);return n.jsx(cd.Provider,{value:h,children:d})}function lw({items:e,actions:t,columns:a,flat:r=!1,className:l,style:s}){const i=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",l),style:{"--summary-strip-cols":String(i),...s},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 iw=(e,t)=>`${e} / ${t}`;function uw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:l=iw,pageWidth:s,pageHeight:i,margin:u,className:c,style:d}){const{t:h}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,m]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const M=p.current;if(!M)return;const T=()=>g(M.scrollWidth>M.clientWidth+1);if(T(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(T);return L.observe(M),()=>L.disconnect()},[C]);const A=e.map(M=>`${M.id}\0${M.section??""}\0${M.group??""}`).join(""),y=C&&C.shape===A?C.pages:null,[w,v]=o.useState(0);o.useEffect(()=>{const M=x.current;if(!M||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>v(M.offsetHeight));return T.observe(M),()=>T.disconnect()},[]);const[B,k]=o.useState(0);o.useEffect(()=>{const M=f.current;if(!M||typeof ResizeObserver>"u")return;let T=null;const L=typeof requestAnimationFrame=="function"?O=>requestAnimationFrame(O):O=>setTimeout(O,16),Z=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:O=>clearTimeout(O),G=new ResizeObserver(()=>{T==null&&(T=L(()=>{T=null,k(O=>O+1)}))});return Array.from(M.children).forEach(O=>G.observe(O)),()=>{G.disconnect(),T!=null&&Z(T)}},[A]),o.useLayoutEffect(()=>{const M=f.current,T=x.current;if(!M||!T)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Z=new Map;b.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Z.set(S.dataset.chromeSection??"",L(S))});const G=S=>L(T)-(Z.get(S??"")??0),O=Array.from(M.children).map(S=>L(S)),U=[];e.forEach((S,P)=>{const F=U[U.length-1],X=F?e[F[0]]:void 0;X&&S.group!=null&&X.group===S.group&&X.section===S.section?F.push(P):U.push([P])});const $=[];let H=[],z=0;const V=()=>{H.length&&$.push(H),H=[],z=0};U.forEach(S=>{const P=S.reduce((X,se)=>X+O[se],0),F=G(e[S[0]].section);H.length&&e[H[0]].section!==e[S[0]].section&&V(),P>F?S.forEach(X=>{H.length&&z+O[X]>F+.01&&V(),H.push(X),z+=O[X]}):(H.length&&z+P>F+.01&&V(),S.forEach(X=>H.push(X)),z+=P)}),V(),m(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify($)?S:{shape:A,pages:$})},[A,w,s,i,u,B]);const E=To,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),I=(M,T,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:N}),n.jsx("span",{className:"report-doc__page-no",children:l(M,T)})]})}),R=Array.from(new Set(e.map(M=>M.section??""))),Y={...s?{"--report-page-w":s}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:Y,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:x,className:"report-doc__ruler"}),n.jsx("div",{ref:b,children:R.map(M=>{const T=I(1,1,M||void 0);return n.jsxs("div",{"data-chrome-section":M,children:[T.header,T.footer]},M)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(M=>n.jsx("div",{children:M.content},M.id))})]}),y&&n.jsx("div",{className:"report-doc__pages",children:y.map((M,T)=>{const{header:L,footer:Z}=I(T+1,y.length,e[M[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,M.map(G=>n.jsx("div",{children:e[G].content},e[G].id)),Z]},T)})})]})}function cw({title:e,fields:t,columns:a=4,className:r,style:l}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...l},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},i))})]})}const na=new Map;let Mr=null;const dw=12;function pw(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 Lr(){const e=new Map;for(const t of na.keys()){if(!t.isConnected)continue;const a=pw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,l)=>r.compareDocumentPosition(l)&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 l=r.getBoundingClientRect().height;l>0&&(a+=l+dw)}}}function hw(e){return typeof window>"u"?()=>{}:(na.set(e,(na.get(e)??0)+1),na.get(e)===1&&typeof ResizeObserver<"u"&&(Mr??(Mr=new ResizeObserver(()=>Lr())),Mr.observe(e)),Lr(),()=>{const t=(na.get(e)??1)-1;if(t>0){na.set(e,t),Lr();return}na.delete(e),Mr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Lr()})}function mw({title:e,message:t,actionLabel:a,onAction:r,icon:l,onClose:s,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),h=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,b=f?hw(f):null;return()=>{b?.(),h.current&&p&&p.contains(document.activeElement)&&sr(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",i),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{h.current=!0,s()},"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:l??n.jsx(Fs,{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(Ce,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function fw({title:e,titleLevel:t=3,description:a,topActions:r,children:l,footerLeft:s,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:h,onDragEnd:p,className:f}){const b=t?`h${t}`:"div",x=s!=null||i!=null,C=l!=null&&l!==!1,m=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?m: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(b,{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:l}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function Cw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:l,beforeSort:s,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:h=!1,onDragOver:p,onDragLeave:f,onDrop:b,children:x,className:C}){const{t:m}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=l!=null,y=_e("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:y,onDragOver:p,onDragLeave:f,onDrop:b,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:[A&&n.jsx(Ce,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?m("common.expandFor",{name:e}):m("common.collapseFor",{name:e}):r?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:l}),typeof e=="string"?n.jsx(g,{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}),(s!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:w=>w.stopPropagation(),children:[s,i&&n.jsx(cn,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?m("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:x}))]})}const gw="speechear:saved_word_tables";function bw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function yw(){try{const e=localStorage.getItem(gw);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(bw):[]}catch{return[]}}function dd(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 Es(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function vw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let l=2;t.has(r);l++)r=`${a.id}~${l}`;return t.add(r),r===a.id?a:{...a,id:r}})}function xw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:l,filterDefaultCollapsed:s,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:h,items:p,onSaveComplete:f,onLoad:b,onRemoveItem:x,onReset:C,resetLabel:m,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:y,onAddItem:w,className:v,renderSavePopup:B,renderWordSearch:k,hideControls:E,saveOnly:D,tableName:N,nameValue:I,onNameChange:R,descriptionValue:Y,onDescriptionChange:M,namePlaceholder:T,descriptionPlaceholder:L,existingNames:Z,editingName:G,onCancel:O,initialItemsPerPage:U,renderCellAction:$,actionsLeftExtra:H}){const{t:z}=xe.useTranslation(),V=m??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,P=!!R,[F,X]=o.useState([]),se=(I??"").trim(),ae=se||(T??"").trim(),me=(Y??"").trim()||(L??"").trim(),ne=(Z??[]).map(ee=>ee.trim().toLowerCase()),W=[G?.trim().toLowerCase(),...F].filter(ee=>!!ee),ie=[...ne];for(const ee of W){const ve=ie.indexOf(ee);ve!==-1&&ie.splice(ve,1)}const q=se!==""&&ie.includes(se.toLowerCase()),[K,ce]=o.useState(Array(4).fill(null)),[ke,ye]=o.useState(4),[de,oe]=o.useState(null),ge=K.slice(0,ke),he=!!d?.show,[pe,Me]=o.useState(!0),[ze,Le]=o.useState(!0),Fe=d&&{...d,top:pe,bottom:ze},[We,pt]=o.useState("landscape"),[it,at]=o.useState(["image","word","standardPron"]),[ht,Ne]=o.useState("show"),[Ve,we]=o.useState(!0),[Ue,Ae]=o.useState(!0),$e=o.useRef(null),Se=o.useRef([]),[Xe,gt]=o.useState(U==="all"?Number.POSITIVE_INFINITY:U??8),[nt,Je]=o.useState("right"),[_t,mt]=o.useState(!1),[wt,vt]=o.useState(!1),{toastMessage:bt,toastType:Ke,showWarning:re,clearToast:Ee}=Oi("warning"),Qe=o.useCallback(()=>oe(null),[oe]);w&&!S&&!y&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[qe,rt]=o.useState(()=>Math.max(p?.length??1,1)),Te=S?ke:y?Math.max(qe,p?.length??1,1):Math.max(p?.length??0,1),{width:ut,height:Re}=ga[We],ot=!S&&!y,ft=p?.length??0,Bt=Math.min(Xe,Math.max(ft,1)),Ze=ot?Bt:Te,st=ot?Zu(p??[],Ze):null,lt=!!st&&st.length>1,dt=S?ge.some(ee=>ee!==null&&ee.length>1):(p??[]).some(ee=>(ee.words??[]).length>1),kt=N?.trim()||`${Hl(La())} ${dt?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Vt=o.useCallback(()=>lt?Se.current.filter(ee=>ee!==null):$e.current?[$e.current]:[],[lt]),{print:en,openNewWindow:Cn,downloadHtml:jn}=ss({getElements:Vt,paperW:ut,paperH:Re,fileName:kt,onPopupBlocked:()=>{re(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."))}}),Wn=ee=>{ye(ee),ce(ve=>ve.length>=ee?ve:[...ve,...Array(ee-ve.length).fill(null)]),oe(null)},Hn=ee=>{ce(ve=>{const Pe=[...ve];return Pe[ee]=null,Pe}),de===ee&&oe(null)},qt=ee=>{if(de===null)return;const ve=de;ce(He=>{const tt=[...He];return tt[ve]=ee.length>0?ee:null,tt});const Pe=ge.findIndex((He,tt)=>tt>ve&&He===null);oe(Pe!==-1?Pe:null)},dn=S?ge.some(ee=>ee?.some(ve=>!!ve.colloquialPronunciation)):(p??[]).some(ee=>(ee.words??[]).some(ve=>!!ve.colloquialLabel)),Ut=o.useMemo(()=>sa()?S?K.slice(0,ke).flatMap(ee=>(ee??[]).map(ve=>[ve.word,ve.homonum])):(p??[]).flatMap(ee=>(ee.words??[]).map(ve=>[ve.label,ve.homonum])):[],[S,K,ke,p]),[Lt,Tn]=o.useState(!1);o.useEffect(()=>{if(Ut.length===0)return;let ee=!1;return Promise.all(Ut.map(([ve,Pe])=>Nl(ve,Pe))).then(ve=>{ee||Tn(ve.some(Boolean))},()=>{}),()=>{ee=!0}},[Ut]);const ln=Ut.length>0&&Lt,Mn=o.useMemo(()=>[...S||y?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:I4.map(ee=>({value:`${ee}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ee})})),display:"segmented"}]:[],...ot&&(p?.length??0)>0?[hc(z,{hasPairs:dt,itemCount:ft})]:[],...lt?[F4(z)]:[]],[z,S,y,ot,p?.length,dt,ft,lt]),Ln={...S||y?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Te}\uCE78`}:{},...ot&&(p?.length??0)>0?{[z(dt?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${Bt}\uAC1C`}:{},...lt?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:nt}:{}},xn=(ee,ve)=>{ve===z("wordTable.filter.columns","\uCE78 \uC218")?S?Wn(parseInt(ee)):rt(parseInt(ee)):ve===z(dt?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?gt(mc(parseInt(ee),ft)):ve===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&Je(fc(ee))},Gt=S?vw(ge.filter(ee=>ee!==null&&ee.length>0).map(ee=>({id:Es(ee),words:ee.map(dd)}))):p??[],Ft=()=>{S&&ce(ee=>ee.length>ke?ee.slice(0,ke):ee)},$t=(ee=!1)=>{if(vt(ee),P&&f){const ve=ae.trim().toLowerCase();ve&&X(Pe=>Pe.includes(ve)?Pe:[...Pe,ve]),f(ae,Gt,me||void 0,ee),Ft();return}if(D&&f){f("",Gt,void 0,ee),Ft();return}if(f){mt(!0);return}jn()},[pn,Ot]=o.useState(!1),[tn,Tt]=o.useState(""),Kt=tn.trim(),le=Kt!==""&&ne.includes(Kt.toLowerCase()),Be=()=>{Tt(ae?z("wordTable.save.copyName",{name:ae,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},je=()=>{!Kt||le||!f||(f(Kt,Gt,me||void 0,!0),Ft(),Ot(!1))},Ge=Gt.length===0,Oe=Ge||P&&(ae===""||q),J=()=>{if(Ge){re(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(P&&ae===""){re(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}P&&q&&re(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},ue=n.jsx(ba,{items:Gt,orientation:We,contentTypes:it,cutLine:ht,showOutline:Ve,showDivLine:Ue,count:Te});return n.jsxs(n.Fragment,{children:[n.jsxs(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[pn&&n.jsx(On,{size:"small",title:g??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ee})=>n.jsxs(n.Fragment,{children:[n.jsx(Ce,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ee}),n.jsx(Ce,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Kt||le,onClick:je})]}),children:n.jsx(Xn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:tn,onChange:Tt,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:je,error:le?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),_t&&f&&B?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:ue,previewW:ut,previewH:Re,items:Gt,existingNames:yw().map(ee=>ee.name),saveAsNew:wt,onSave:(ee,ve)=>{f(ee,Gt,ve,wt),Ft(),mt(!1)},onCancel:()=>mt(!1)}),(S||w)&&de!==null&&k?.({cellIndex:de,onConfirm:S?qt:ee=>{if(w){const ve=ee[0];if(ve){const Pe=new Set((p??[]).map(tt=>tt.id));let He=Es([ve]);for(let tt=2;Pe.has(He);tt++)He=`${Es([ve])}~${tt}`;w({id:He,words:[dd(ve)]})}}oe(null)},onClose:Qe}),!E&&n.jsx(ns,{title:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:ln,hasColloquial:dn,contentTypes:it,orientation:We,showOutline:Ve,cutLine:ht,showDivLine:Ue,setters:{setContentTypes:at,setOrientation:pt,setShowOutline:we,setCutLine:Ne,setShowDivLine:Ae,setShowTopInfo:Me,setShowBottomInfo:Le},showCutLine:(ot?Ze:Te)>1,showDivLine2:dt,middleSections:Mn,extraSelected:Ln,onExtraSelect:xn,showPaperBands:he,showTopInfo:pe,showBottomInfo:ze}),lt&&st?n.jsx("div",{className:"word-table-block__pages",children:st.map((ee,ve)=>n.jsx(ba,{orientation:We,contentTypes:it,cutLine:ht,showOutline:Ve,showDivLine:Ue,count:Ze,items:ee,onRemoveItem:x,onReorder:A&&((Pe,He)=>A(Pe+ve*Ze,He+ve*Ze)),renderCellAction:$&&((Pe,He)=>$(Pe+ve*Ze,He)),brand:Fe,code:h,contentRef:Pe=>{Se.current[ve]=Pe},pageNumber:{current:ve+1,total:st.length},pageNumberPosition:nt},ve))}):n.jsx(ba,{orientation:We,contentTypes:it,cutLine:ht,showOutline:Ve,showDivLine:Ue,count:Te,items:S?void 0:p??[],editCells:S?ge:void 0,activeCell:de,onActivateCell:S||w?oe:void 0,onRemoveCell:S?Hn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:$,brand:Fe,code:h,showFillerAdd:!!w,contentRef:$e}),!E&&!D&&(C||H!=null)&&n.jsxs("div",{className:"word-table-block__table-actions",children:[C&&n.jsx(Ce,{htmlType:"button",size:48,type:"bar",label:V,onClick:C}),H]}),P&&!E&&n.jsxs(Ar,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Dn,{variant:"custom",label:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:I??"",onChange:R,placeholder:T?T+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:q?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(I??"").trim()&&(T??"").trim()&&(ee.preventDefault(),R?.(T??""))}})}),n.jsx(Dn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:Y??"",onChange:M,placeholder:L?L+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:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(Y??"").trim()&&(L??"").trim()&&(ee.preventDefault(),M?.(L??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&b&&n.jsx(Ce,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:b}),!D&&n.jsx(Ce,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Cn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[O&&n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:O}),!D&&n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:en}),g&&n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>P?Be():$t(!0),disabled:Ge,onDisabledClick:()=>{re(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(Ce,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>$t(!1),disabled:Oe,onDisabledClick:J})]})]}),n.jsx(ma,{message:bt,type:Ke,onClose:Ee})]})}function pd({items:e,className:t}){const a=e.length,r=a<=3?1:2,l=Math.ceil(a/r)||1,s=r*l;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(i,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,h)=>n.jsxs(o.Fragment,{children:[h>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},h))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function _w({items:e,name:t,description:a,createdAt:r,code:l,published:s,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:h,publishedAt:p,likeCount:f,downloadCount:b,onPublisherClick:x,selected:C,onClick:m,onMore:_,titleNode:g,className:A}){const{t:y}=xe.useTranslation(),w=g!=null,v=h!=null||p!=null||f!=null||b!=null,B=k=>{k.target===k.currentTarget&&!w&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),m?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":l?`${t} (${l})`:t,onClick:w?void 0:m,onKeyDown:B,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":y("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(pd,{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:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!w&&n.jsx(Ce,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:y("common.moreFor",{name:t}),onClick:k=>{k.stopPropagation(),_(k)}})]}),(l||r||s||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?Wl(r,y):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(Et,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??y("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(Et,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??y("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),l&&n.jsx("span",{className:"word-table-button__code caption-1",children:l})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[h&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":y("wordTable.publisherFilter",{name:h,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:k=>{k.stopPropagation(),x()},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:Wl(p,y)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":y("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),b!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(b),"aria-label":y("common.downloadCount",{count:b,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${b}`})})]})]})]})}/**
1070
+ `).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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:To,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:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("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:s("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",l]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function xx({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:l,className:s,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),h=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),b=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const y=document.getElementById(b);y&&y.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=y=>{y.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,b]);const C=i?`${i} landing-header__inner`:"landing-header__inner",m=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"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((_,g)=>n.jsx("span",{children:m(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[l,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":b,"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:b,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:m(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function _x({children:e,action:t,onClick:a,className:r}){const l=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:l,onClick:a,...Hu(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function wx({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),l=o.useRef(null),s=o.useCallback(()=>{const C=t.current,m=C.phase!=="sound"&&C.at>0;l.current=m?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=l.current;return l.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,m,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:m,at:Date.now()-Math.max(0,_)},new Promise(A=>{const y=setTimeout(()=>{r.current===y&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=y})},[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},[]),f=o.useCallback(()=>a.current,[]),b=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:b,abort:u,waitPad:c,enterSound:d,leave:h,pause:s,resume:i,__bumpGenerationForTest:x}),[p,f,b,u,c,d,h,s,i,x])}const va=9,Bx=e=>Math.round(Math.min(va,Math.max(0,e))/va*100),kx=e=>e/100*va,Xa=2,_c=.1,Ax=e=>Math.min(Xa,Math.max(0,e)),Nx=.1,Ex=e=>Math.round(e*1e6)/1e6;function Ja(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return Ax(t);const a=Math.min(va,Math.max(0,Number(e.level)||0))/va,r=Number(e.mainVolume);return r>0?a>0?Ex(Math.min(Xa,Math.max(Nx,a/r))):0:1}const wc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Bc(e){return wc(e)}function us(e){return wc(e)*Ja(e)}function cs(e,t=Vf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,us(e)/a)}function Jn(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=Ja({level:a.level,mainVolume:a.mainVolume})),a}const Qn={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},ds=o.createContext(null);function xr(){return o.useContext(ds)}const ps=e=>`${Hf()}/${e}`,kc=e=>Array.from({length:10},(t,a)=>ps(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),_r={get defaultNoise(){return ps("noise1.mp3")},get street(){return kc("noise2")},get restaurant(){return kc("noise3")},get buzz(){return ps("noise4.mp3")}};function Dx(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return _r.defaultNoise;case"street":return _r.street[t];case"restaurant":return _r.restaurant[t];case"buzz":return _r.buzz;default:return null}}function Sx({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const l=o.useRef(e?.registerAnalyser);l.current=e?.registerAnalyser;const s=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),h=o.useRef(null),p=o.useRef(null),f=o.useRef(0),b=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]),m=o.useCallback((w,v=250)=>{const B=s.current;if(!B)return;const k=d.current;if(k){d.current=null;try{B.pause()}catch{}B.src=k,B.load()}if(!B.src)return;f.current+=1,C();try{Qr(),er(B).then(I=>{if(s.current===B)try{l.current?.("noise",I)}catch{}})}catch{}const E=B.paused?0:tr(B);B.paused&&In(B,0),B.play().catch(()=>{});const D=performance.now(),N=()=>{const I=Math.min(1,(performance.now()-D)/v);try{In(B,E+(w-E)*I)}catch{}I<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((w=250,v)=>{const B=s.current;if(!B||B.paused){v?.();return}const k=++f.current;C();const E=performance.now(),D=tr(B),N=()=>{const I=Math.min(1,(performance.now()-E)/w);try{In(B,D*(1-I))}catch{}if(I<1)p.current=requestAnimationFrame(N);else{p.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);try{B.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),b.current=setTimeout(()=>{if(b.current=null,f.current===k){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{B.paused||(In(B,0),B.pause(),v?.())}catch{}}},w+150)},[C]);o.useEffect(()=>{const w=document.createElement("audio");return w.loop=!0,w.crossOrigin="anonymous",s.current=w,()=>{C();try{w.pause(),w.removeAttribute("src"),w.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?cs(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let w=0;const v=setInterval(()=>{const B=s.current;if(!B||B.paused){w=0;return}const k=t.current;if(k&&!k.paused&&!k.ended||x()||a.current==="playing"){w=0;return}w+=1,w>=2&&(w=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const w=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const B=t.current,k=!!B&&!B.paused&&!B.ended||x()||a.current==="playing",E=h.current;k&&E?.enabled&&E.volume>0&&m(E.volume)};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)},[C,m,t,a,x]),o.useEffect(()=>{h.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const y=o.useRef(null);return o.useEffect(()=>()=>{y.current?.(),y.current=null},[]),o.useEffect(()=>{const w=e?.settings,v=s.current;if(!v)return;const B=w?cs(w):0;if(!w||!w.enabled||B===0){_();return}if(c.current!==w.type){const k=Dx(w.type);k&&(c.current=w.type,u(k),d.current=k,_(150,()=>{if(d.current!==k)return;d.current=null,v.src=k,v.load();const E=t.current;if(E&&!E.paused||x()){y.current?.();const D=()=>{v.removeEventListener("canplay",D),y.current===N&&(y.current=null);const I=t.current,P=h.current;(I&&!I.paused&&!I.ended||x())&&P?.enabled&&P.volume>0&&m(P.volume)},N=()=>v.removeEventListener("canplay",D);y.current=N,v.addEventListener("canplay",D)}}))}else{const k=t.current,E=!!k&&!k.paused&&!k.ended||x()||a.current==="playing";if(E&&d.current)m(B);else if(E&&v.paused&&v.src)m(B);else if(!v.paused)if(!E)_();else{C();const D=tr(v),N=performance.now(),I=()=>{const P=Math.min(1,(performance.now()-N)/150);try{In(v,D+(B-D)*P)}catch{}P<1?p.current=requestAnimationFrame(I):p.current=null};p.current=requestAnimationFrame(I)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,m,_,t,a,h,x]),o.useEffect(()=>{const w=s.current;if(w)try{w.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:i,noiseSettingsRef:h,cancelNoiseFade:C,fadeInNoise:m,fadeOutNoise:_}}function jx({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:l,setProgress:s,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:h,onDoneRef:p,handleEndRef:f}){const b=o.useRef(null),x=o.useRef(0),C=o.useRef(null),m=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{m.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(w,v=1)=>{try{const B=(w||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(w||"").length);return Math.max(700,Math.round(B*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(w=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,B=++m.current;try{try{v.cancel()}catch{}const k=w??e,E=Array.isArray(k)?k.filter(T=>!!T):[k||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((T,M)=>T+g(M,D||1),0),b.current=performance.now(),s(0),i("playing"),u("playMode");const N=h.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const I=()=>{try{const T=b.current||performance.now(),M=performance.now()-T,L=x.current||1200,Q=Math.min(1,M/L);try{r.current&&(r.current.style.left=`${Q*100}%`),l.current&&l.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(I))}catch{}},P=()=>{if(B===m.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),i("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},K=T=>{const M=new SpeechSynthesisUtterance(E[T]);try{M.rate=D}catch{}try{M.volume=Math.max(0,Math.min(1,a))}catch{}M.onend=()=>{if(B===m.current){if(T<E.length-1){try{K(T+1)}catch{P()}return}P()}},M.onerror=()=>{P()},M.onstart=()=>{if(!(T>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(I)}catch{}},_.current=!0,v.speak(M)};try{K(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,l,s,i,u,h,p,f]),y=o.useCallback(()=>{m.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),b.current=null}catch{}i("stopped"),u("active"),s(0)},[d,i,u,s]);return{startTTS:A,stopTTS:y}}const Tx=.01,Mx=.3;async function Lx(e,t,a,r=!1){let l=null;try{const s=window.AudioContext||window.webkitAudioContext;l=new s;const i=await l.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const b=Math.floor(Mx*i.sampleRate),x=Math.min(u.length,b);for(;c<x&&Math.abs(u[c])<=Tx;)c++;c>=x&&(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),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((b,x)=>{const C=c+x*f,m=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<m;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{l?.close?.()}catch{}}}async function Ac(e,t,a,r=!1){try{const l=await fetch(e);if(l.ok===!1)return null;const s=await l.arrayBuffer();return await Lx(s,t,a,r)}catch(l){try{const s=$l(l)}catch{}return null}}const hs=45,$x=74,Rx=2;function wr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Br(e){return wr(e)/45}const Px=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Nc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Ec({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Nc(t),l=Nc(a),s=[];let i=0;return e.forEach((u,c)=>{for(const[d,h]of[["lead",r],["sound",Px(u)],["tail",l]])s.push({kind:d,track:c,startMs:i,durMs:h}),i+=h}),{segments:s,totalMs:i,trackCount:e.length}}function Dc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,l,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:l,tail:s,totalMs:r.durMs+l.durMs+s.durMs}}function Ix(e,t){const a=Dc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],l=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+l)/a.totalMs))}function Fx(e,t,a){const r=Math.max(0,Math.floor(a)),l=Dc(e,t);if(!l||r===0||!(l.totalMs>0)||l.lead.durMs===0&&l.tail.durMs===0||!(l.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(l.lead.durMs/l.totalMs*r),i=Math.round(l.tail.durMs/l.totalMs*r),u=Math.max(1,r-s-i),c=s+u+i-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function Ox({currentTime:e,sources:t,index:a,audioDuration:r}){const l=a||0,s=Array.isArray(t)&&t.length>0?t[l]:void 0,i=s?s.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 zx({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:l,tailMs:s}){const i=Ec({durationsSec:[r],leadInMs:l,tailMs:s});return Ix(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Wx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return Fx(Ec({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function Hx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Vx({ended:e,completedByEnd:t}){return!!e||!!t}function qx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Ux(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function Gx(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],l=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const i=s;l.push({code:i.code??null,src:i.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){l.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const i=String(s),u=a(i,t);u&&l.push({code:i,resolvedPath:u})}}return l}function Kx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Sc(a)!==Sc(t):!0}function Sc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const jc=4,Yx=Br(jc/hs);function Zx(e){const{src:t,segments:a,progress:r=0,waveProgressRef:l,noiseSrc:s,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:h,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:b=0,trackDurationSec:x=0}=e,C=o.useRef(null),m=o.useRef(null),[_,g]=o.useState(null),[A,y]=o.useState(!1),[w,v]=o.useState(null),[B,k]=o.useState(2),[E,D]=o.useState(0),[N,I]=o.useState(null),[P,K]=o.useState(!1),[T,M]=o.useState(!1),L=3,Q=3,H=1,O=300,U=o.useRef(0),$=o.useCallback(()=>{const ye=C.current,he=m&&m.current?m.current:ye?ye.closest(".audio-player__wave"):null,se=he?he.getBoundingClientRect():ye?ye.getBoundingClientRect():null,Ce=se?se.width:0,ge=se?Math.max(100,se.width):320,ce=se?se.height:0,Me=Math.max(H,Math.min(O,Math.floor((ge+Q)/(L+Q)))),Oe=Me*L,Le=Math.max(0,Me-1),ze=Math.max(0,Le>0?(ge-Oe)/Le:Q);return{bars:Me,gap:ze,height:ce,width:Ce}},[]),V=o.useRef(void 0),z=o.useRef(null),Y=o.useCallback(async(ye,he,{quiet:se=!1}={})=>{const Ce=++U.current,ge=()=>U.current===Ce;try{if(se||y(!1),V.current=ye,!ye){ge()&&g(null);return}let ce=he;if(!ce)try{for(let Le=0;Le<4&&!(C.current||m.current);Le++)await new Promise(ze=>requestAnimationFrame(ze));await new Promise(Le=>requestAnimationFrame(Le));const Oe=$();Oe.height>0&&D(Oe.height),ce=Oe.bars,k(Oe.gap)}catch{ce=120}z.current=ce;const Me=await Ac(ye,ce);if(!ge())return;if(!Me){g(null),y(!1);return}g(Me),v(ce),y(!0)}catch{if(!ge())return;g(null),y(!1)}},[y,g,D,k,v,$]);o.useEffect(()=>{const ye=m.current;if(!ye||typeof ResizeObserver>"u")return;let he=null;const se=new ResizeObserver(()=>{he!==null&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;try{const Ce=$();if(Ce.width<=0||(Ce.height>0&&D(Ce.height),z.current===null||Ce.bars===z.current))return;const ge=V.current;k(Ce.gap),ge?Y(ge,Ce.bars,{quiet:!0}).catch(()=>{}):z.current=Ce.bars}catch{}})});return se.observe(ye),()=>{se.disconnect(),he!==null&&cancelAnimationFrame(he)}},[$,Y]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;Y(typeof ye=="string"?ye:void 0).catch(()=>{}),M(!1)},[t,a,Y]),o.useEffect(()=>{let ye=!1;if(K(!1),I(null),!s||!w)return;const he=c>0?c*(u||1):void 0;return Ac(s,w,he,!0).then(se=>{ye||(I(se),se||K(!0))}).catch(()=>{ye||(I(null),K(!0))}),()=>{ye=!0}},[s,w,c,u]);const S=Math.max(0,Math.min(1,d)),R=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=w||40,Z=o.useMemo(()=>Wx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:b}),[F,x,f,b]),pe=o.useMemo(()=>Array.from({length:F}).map((ye,he)=>{const se=he>=Z.lead&&he<Z.lead+Z.sound,Ce=Z.sound>0&&se?Math.min(F-1,Math.round((he-Z.lead)/Z.sound*F)):-1,ge=se?_&&_[Ce]!=null?_[Ce]:null:_?0:null,ce=ge==null?null:Math.min(1,ge/R*S),Me=ce!=null&&E>0&&wr(ce)<=jc,Oe=ce==null?.15:Me?0:Br(ce),Le=Me,ze=F>1?he/(F-1):0;return n.jsx("div",{className:Le?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":Oe,"--i":he,"--mix":ze}},he)}),[F,_,R,S,E,Z]),re={"--progress":String(Math.max(0,Math.min(1,r)))},oe=o.useMemo(()=>N&&N.length&&Math.max(...N.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[N]),ae=S*Math.max(0,i),W=!s||!N||!N.length?1:Math.max(1,ae),ie={"--bar-gap":`${B}px`,"--wave-h":`${wr(W)}px`,"--wave-h1":`${hs}px`},q=A&&(s?!!N||P:!0);o.useEffect(()=>{q&&M(!0)},[q]);const G=T?A:q;o.useEffect(()=>{h?.(G)},[G,h]);const de=w||40,Ee=o.useMemo(()=>Array.from({length:de}).map((ye,he)=>{const se=N&&N[he]!=null?N[he]:null,Ce=se==null?0:Math.abs(se)/oe*ae,ge=Math.max(Yx,Br(Ce)),ce=de>1?he/(de-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":ge,"--i":he,"--mix":ce}},he)}),[de,N,oe,ae,E]);return n.jsxs("div",{className:"audio-player__wave",ref:m,style:ie,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${q?"is-ready":""}`,"aria-hidden":"true",children:Ee}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${G?"is-ready":""}`,ref:C,children:pe}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${G?"is-ready":""}`,ref:l,style:re,children:pe})]})]})}const Tc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function ms(e,t){return new Promise((a,r)=>{const l=document.createElement("audio");let s=!1;const i=()=>{try{l.removeAttribute("src"),l.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(l.duration)&&l.duration||0;i(),a(d)},c=d=>{s||(s=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};l.addEventListener("loadedmetadata",u),l.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),l.src=e})}const Xx=2e3;function Mc(e,t=Xx){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.addEventListener("canplay",l,{once:!0}),e.addEventListener("error",l,{once:!0}),setTimeout(l,t)})}function Jx({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),l=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!l.current.length)return;const d=l.current;l.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),l.current=l.current.filter(f=>f!==d),c(p)},h=setTimeout(()=>d(!0),a);l.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=l.current;l.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:i}}function Qx(){const e=o.useRef([]),t=o.useCallback(l=>(e.current.push(l),l),[]),a=o.useCallback(l=>{const s=new Set([...l].filter(Boolean));e.current=e.current.filter(i=>{if(s.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const l of e.current)try{URL.revokeObjectURL(l)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function e_({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),l=o.useCallback(()=>r(null),[]),s=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",l),()=>document.removeEventListener("mousedown",l)},[a,l]),{ref:t,rect:a,show:s,hide:l}}function t_(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 n_=400,a_=2e3,Lc=5;function r_({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:l,sequencer:s,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)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if($n){const m=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&m-x>n_){const _=h.current===null||m-h.current>a_;if(h.current=m,_&&d.current<Lc){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(m-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="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.",g>=Lc?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=m}try{const m=e.current,_=Array.isArray(r.current)?r.current[l.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:t_(m),y=t.current,w=(i||0)>0||(u||0)>0,v=w&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{y&&y.style.visibility!=="hidden"&&(y.style.visibility="hidden")}catch{}else{const B=g?_.duration:A||0;$n&&v&&!(B>0)&&St("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 k=w?zx({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:m&&typeof m.currentTime=="number"?m.currentTime:0,trackDurationSec:B,leadInMs:i||0,tailMs:u||0}):Ox({currentTime:m&&typeof m.currentTime=="number"?m.currentTime:0,sources:r.current,index:l.current,audioDuration:A??0});try{y&&(y.style.visibility&&(y.style.visibility=""),y.style.left=`${k*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(k))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,l,s,i,u]),b=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:b}}function fs({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:l=!1,ttsText:s=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:h=0}){const{t:p}=xe.useTranslation(),f=e,b=xr(),x=o.useRef(b?.registerAnalyser);o.useEffect(()=>{x.current=b?.registerAnalyser});const C=o.useRef(null),m=o.useRef(null),_=o.useRef(null),g=Qx(),A=o.useRef(null),y=o.useRef(!1),w=o.useRef(null),{ref:v,rect:B,show:k,hide:E}=e_();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[I,P]=o.useState("idle"),[K,T]=o.useState("stopped"),M=o.useRef("stopped");o.useEffect(()=>{M.current=K},[K]);const[L,Q]=o.useState(0),[H,O]=o.useState("active"),U=o.useRef(!1);o.useEffect(()=>{if(H!=="playMode"||!U.current)return;U.current=!1;const X=typeof document<"u"?document.activeElement:null;if(X&&X!==document.body)return;const ue=_.current?.querySelectorAll("button")[1];try{ue?.focus()}catch{}},[H]);const[$,V]=o.useState(null),[z,Y]=o.useState(null),[S,R]=o.useState(0),[F,Z]=o.useState(!1),[pe,re]=o.useState(0),oe=b?.playbackRate??1,ae=b?.mainVolume??1,W=b?us(b.settings):0,ie=b?Bc(b.settings):ae,[q,G]=o.useState("idle"),[de,Ee]=o.useState(""),[ye]=o.useState("top"),he=o.useRef(null),se=o.useRef(0),Ce=o.useRef(null),ge=o.useRef(!0),ce=wx({mountedRef:ge}),Me=o.useRef(null),Oe=o.useRef(d),Le=o.useRef(h);o.useEffect(()=>{Oe.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Le.current=Math.max(0,h||0)},[h]);const{start:ze,stop:We,settleTo:dt}=r_({audioRef:C,fillRef:m,waveProgressRef:Ce,sourcesRef:he,currentIndexRef:se,sequencer:ce,leadInMs:d,tailMs:h}),{onReadyChange:lt,waitForReady:at,markNotReady:ht}=Jx({showSoundWaveForm:u,showNoiseWaveForm:c}),Ae=o.useRef(null),qe=o.useRef(l),we=o.useRef(r),Ue=o.useRef(null),ke=o.useRef(!1),[$e,je]=o.useState(!1),Ze=o.useCallback(X=>{ke.current=X,je(X)},[]),yt=o.useRef(null),{activeNoiseUrl:et,noiseSettingsRef:Xe,fadeInNoise:_t,fadeOutNoise:Ct}=Sx({noisePlayer:b,audioRef:C,playbackStateRef:M,sequencer:ce}),{startTTS:wt,stopTTS:Bt}=jx({ttsText:s,playbackRate:oe,mainVolume:ie,fillRef:m,waveProgressRef:Ce,setProgress:Q,setPlaybackState:T,setStateLocal:O,fadeInNoise:_t,fadeOutNoise:Ct,noiseSettingsRef:Xe,onDoneRef:we,handleEndRef:yt});o.useEffect(()=>{it.current=Bt});const mt=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Ee(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}wt(X);return}Pe("tts"),wt(X)},rt=Array.isArray(t)?t.filter(Boolean):t?[t]:[],ne=(!rt||rt.length===0)&&!!s,Ne=Array.isArray($)&&$.length>0?$:Array.isArray(z)&&z.length>0?z:null,Je=Math.max(Array.isArray(Ne)?Ne.length:0,rt.length);o.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const Ve=()=>{ce.abort()},it=o.useRef(null),Se=o.useRef(null),pt=o.useRef(null),gt=o.useRef(null);gt.current||(gt.current=()=>{pt.current=null;const X=C.current;if(Se.current==="audio"&&X&&(!X.paused||ce.isRunning())){Ve();try{X.pause()}catch{}ge.current&&(T("paused"),We(),Ct())}else if(Se.current==="tts")try{it.current?.()}catch{}});const Pe=X=>{Se.current=X,pt.current=dr(gt.current)},nt=()=>{pt.current?.(),pt.current=null};o.useEffect(()=>()=>{gt.current&&pr(gt.current)},[]);const vt=o.useRef(oe);o.useEffect(()=>{vt.current=oe||1},[oe]);const Ge=o.useCallback(X=>{const ue=vt.current||1;try{X.defaultPlaybackRate=ue}catch{}try{X.playbackRate=ue}catch{}},[]),ot=o.useCallback((X,ue)=>{if(!Kx(X,ue)){try{X.currentTime=0}catch{}Ge(X);return}X.src=ue,Ge(X),X.load(),Ge(X)},[Ge]),st=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),G("idle")},[]),ct=o.useCallback(async(X,ue=3,ee=50,ve=0)=>{st();const Re=ce.generation(),He=!!X&&X.currentTime>0&&!X.ended,tt=Math.max(0,Oe.current-Math.max(0,ve));if(tt>0&&!He){Pe("audio"),ze(),T("playing");const ft=Xe.current;if(ft?.enabled&&(ft.volume??0)>0)try{_t(ft.volume)}catch{}if(!await ce.waitPad(tt,"lead",ve)||!ge.current||!ce.isCurrent(Re))return!1}ce.enterSound();for(let ft=0;ft<ue;ft++){if(!ge.current||!ce.isCurrent(Re))return!1;try{return Pe("audio"),await X.play(),!0}catch(be){if((be instanceof Error||typeof be=="object"&&be&&"name"in be?be.name:void 0)==="AbortError"){if(!ce.isCurrent(Re))return!1;await new Promise(j=>setTimeout(j,ee));continue}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,ze,ce,_t,Xe,st]),kt=o.useCallback(X=>{const ue=ce.generation(),ee=Math.max(0,Le.current-Math.max(0,X));ze();const ve=Xe.current;if(ve?.enabled&&(ve.volume??0)>0)try{_t(ve.volume)}catch{}const Re=()=>{try{Me.current?.()}catch{}};if(ee<=0){ce.leave(),Re();return}ce.waitPad(ee,"tail",X).then(He=>{ce.leave(),He&&ce.isCurrent(ue)&&Re()}).catch(()=>{})},[ce,ze,_t,Xe]),Vt=o.useCallback(()=>{const X=C.current;if(!X)return;const ue=()=>{T("playing"),O("playMode"),Z(!0),ze();try{Qr(),er(X).then(He=>{if(ge.current)try{x.current?.("main",He)}catch{}})}catch{}const Re=Xe.current;Re?.enabled&&(Re?.volume??0)>0&&_t(Re.volume)},ee=()=>{Vx({ended:!!X?.ended,completedByEnd:ke.current})||(T("paused"),We(),Ct())},ve=()=>{const Re=()=>{try{const He=he.current,tt=Hx(He,se.current);if(tt!==null){se.current=tt,R(tt),Z(!0);const ft=He?.[tt]&&He[tt].src;if(ft&&X){ot(X,ft),ct(X).catch(()=>{});return}}}catch{}T("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}We(),Z(!1),Ct();try{!qe.current&&yt.current&&yt.current()}catch{}};if(Me.current=Re,Le.current>0){ze(),ce.waitPad(Le.current,"tail").then(He=>{ce.leave(),He&&Re()}).catch(()=>{});return}Re()};return X.addEventListener("play",ue),X.addEventListener("pause",ee),X.addEventListener("ended",ve),()=>{try{X.removeEventListener("play",ue),X.removeEventListener("pause",ee),X.removeEventListener("ended",ve),We()}catch{}}},[_t,Ct,ct,Xe,ze,We,ce]);o.useEffect(()=>Vt(),[Vt]),o.useEffect(()=>{qe.current=l},[l]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(l||H!=="active")return;const X=w.current;if(!X)return;let ue=null;const ee=requestAnimationFrame(()=>{try{const ve=X.getTotalLength();if(!ve)return;const Re=ve*.2;X.style.strokeDasharray=`${ve-Re} ${Re}`;const He="triFlow_"+Math.random().toString(36).slice(2);ue=document.createElement("style"),ue.textContent=`@keyframes ${He}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ve}}}`,document.head.appendChild(ue),X.style.animation=`${He} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ee),ue?.remove()}},[H,l]),o.useEffect(()=>{he.current=$},[$]),o.useEffect(()=>{se.current=S},[S]),o.useEffect(()=>{const X=_.current,ue=A.current;if(!X||!ue)return;let ee=null;const ve=32,Re=60,He=()=>{try{const ft=Array.from(X.querySelectorAll(":scope > .button"));let be=0;ft.forEach(Ie=>{if(Ie===ue)return;const Ye=Ie.getBoundingClientRect();be+=Ye.width});const j=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(j-be-8)),me=Je;if(!me||J<=0){Array.from(ue.children).forEach(Ie=>{try{Ie.style.width=""}catch{}});return}let De=Math.floor(J/me);De>Re&&(De=Re),De<ve&&(De=Math.max(ve,Math.floor(J/me))),Array.from(ue.querySelectorAll(".button")).forEach(Ie=>{try{Ie.style.width=`${De}px`}catch{}})}catch{}},tt=requestAnimationFrame(He);try{ee=new ResizeObserver(()=>{requestAnimationFrame(He)}),ee.observe(X),ee.observe(ue),window.addEventListener("resize",He)}catch{}return()=>{try{cancelAnimationFrame(tt)}catch{}try{ee&&(ee.disconnect(),ee=null)}catch{}try{window.removeEventListener("resize",He)}catch{}}},[$,z,Je]),o.useEffect(()=>()=>{try{Ae.current&&(clearTimeout(Ae.current),Ae.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const en=(X,ue)=>{V(X),re(ue),ht(),Y(qx(X)),he.current=X},Cn=()=>{O("playMode"),R(0),Z(!0)},jn=async(X,ue)=>{Ze(!1),y.current=!1,ot(X,ue),await Mc(X),await at()!==!1&&(N(!1),Cn(),await ct(X))},Wn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await ms(X,{timeoutMs:1e4,rejectOnError:!0});en([{src:X,objectUrl:null,duration:ve}],ve),P("ready"),ue&&ee&&await jn(ee,X)}finally{y.current=!1,N(!1)}},Hn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await Promise.all(X.map(He=>ms(He,{timeoutMs:1e4})));if(!ge.current)return;const Re=X.map((He,tt)=>({src:He,objectUrl:null,duration:ve[tt]||0}));en(Re,Ux(Re)),P("ready"),ue&&ee&&Re.length>0&&await jn(ee,Re[0].src)}finally{y.current=!1,N(!1)}},qt=async(X=!1,ue=!0)=>{const ee=C.current,ve=t?Array.isArray(t)?t:[t]:[];if(!ve||ve.length===0||!ve.some(Boolean))return!1;if(y.current)return null;y.current=!0,ue&&N(!0),P("resolving");try{const Re=Gx(t,a,yl),He=[];let tt=0;for(const ft of Re){let be=ft.src??null,j=null;if(!be&&ft.resolvedPath){try{P("getting_signed_url"),be=await vl(ft.resolvedPath)}catch{be=null}if(!ge.current)return!1;if(!be)try{P("downloading");const me=await xl(ft.resolvedPath);if(!ge.current)return!1;if(me){const De=me instanceof Blob?me:new Blob([me]);j=g.track(URL.createObjectURL(De)),be=j}}catch{P("error");try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),O("active")}catch{}}}if(!be)continue;let J=0;try{P("measuring_duration"),J=await ms(be,{timeoutMs:3e3})}catch{J=0}if(!ge.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const me of He)if(me.objectUrl)try{URL.revokeObjectURL(me.objectUrl)}catch{}return!1}tt+=J||0,He.push({...ft,src:be,objectUrl:j,duration:J})}if(en(He,tt),He.length>0&&X&&ee){const ft=He[0];Ze(!1);try{g.keepOnly(He.map(be=>be.objectUrl))}catch{}if(P("ready"),y.current=!1,ft.src&&ee)try{if(ot(ee,ft.src),await Mc(ee),await at()===!1)return!1;ue&&N(!1),Cn(),ee&&await ct(ee)}catch{ue&&N(!1)}else ue&&N(!1);O("playMode"),R(0),Z(!0)}return He.length>0}finally{y.current=!1,ue&&N(!1),P(Re=>Re==="ready"?"ready":"idle")}},dn=async X=>{const ue=ce.isRunning();if(X.paused&&!ue){if(ke.current){await Lt();return}const ee=ce.resume();if(ee){if(T("playing"),ee.phase==="tail"){kt(ee.elapsed);return}await ct(X,3,50,ee.elapsed);return}await ct(X),T("playing")}else ce.pause(),Ve(),X.pause(),T("paused"),ue&&(We(),Ct())},Ut=async()=>{const X=C.current;if(!(!X&&!ne)){if(ne){const ue=window.speechSynthesis;if(H==="active"){const ee=Na(),ve=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ee&&ve.length>0){if(y.current)return;O("load"),N(!0),P("synthesizing"),y.current=!0;try{const Re=await Promise.all(ve.map(He=>Promise.resolve(ee(He))));Re.length>1?await Hn(Re,!0):await Wn(Re[0],!0)}catch{y.current=!1,N(!1),O("active"),mt(ve.length>0?ve:void 0)}return}mt(ve.length>0?ve:void 0);return}if(H==="playMode"){const ee=!!ue&&(ue.speaking||ue.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!ee){await dn(X);return}try{if(ue&&ue.paused)try{Pe("tts"),ue.resume(),T("playing")}catch{}else try{ue.pause(),T("paused")}catch{}}catch{}}return}if(H==="active"){if(l&&Array.isArray(he.current)&&he.current.length>0){const ee=he.current[0];try{if(ee.src&&X)try{ot(X,ee.src),Cn(),X&&await ct(X)}catch{}Cn();return}catch{}}O("load");let ue;try{ue=await qt(!0)}catch{ue=!1}if(ue===!1&&ge.current){try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}O("active")}return}if(H!=="load"&&(H==="playMode"||H==="active"))try{X&&await dn(X)}catch(ue){(ue instanceof Error||typeof ue=="object"&&ue&&"name"in ue)&&ue.name}}},Lt=async()=>{const X=C.current;if(X)try{const ue=he.current;if(Array.isArray(ue)&&ue.length>1){await Ft(0);return}Ze(!1);try{X.currentTime=0}catch{}X&&await ct(X),T("playing"),O("playMode")}catch{}},Tn=()=>{Ve(),nt(),it.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}Ct(),T("stopped"),O("active"),Q(0),Z(!1)},ln=async(X,{sameSegment:ue=!1}={})=>{Ve();const ee=ce.generation(),ve=C.current,Re=he.current?.[X]?.src;try{if(Ze(!1),R(X),Z(!0),se.current=X,!Re||!ve||(ue||ht(),ot(ve,Re),!ue&&await at()===!1)||!ce.isCurrent(ee)||(await ct(ve),!ce.isCurrent(ee)))return;T("playing"),O("playMode")}catch{}},Mn=async()=>{const X=he.current,ue=se.current||0;if(!X||ue<=0){await Lt();return}await ln(ue-1)},Ln=async()=>{const X=he.current,ue=se.current||0;if(!X||ue>=X.length-1){Tn();return}await ln(ue+1)},xn=()=>{if(ke.current)return;const X=200,ue=340;Ze(!0),Ve(),nt();try{Q(1)}catch{}dt(1);try{G("hold")}catch{}try{const ee=C.current,ve=ne&&!!ee?.src;if(!ne||ve){if(ee){ee.pause();try{ee.currentTime=0}catch{}}}else Bt();Ct()}catch{}try{T("stopped")}catch{}if(Z(!1),!qe.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{G("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{G("idle")}catch{}Ue.current=null},ue)},X)}catch{}};o.useEffect(()=>{yt.current=xn});const Gt=o.useCallback(()=>Ee(""),[]),Ft=async X=>{(he.current||[])[X]&&await ln(X,{sameSegment:X===se.current})},$t=K==="playing",pn=o.useMemo(()=>{if(!z||z.length<=1)return z;const X=z[S];return X?[X]:z},[z,S]),Ot=l===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Ge(X)}catch{}},[oe,Ge]);const tn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ue=Math.max(0,Math.min(1,ie)),ee=tn.current,ve=()=>{ee.raf!==null&&(cancelAnimationFrame(ee.raf),ee.raf=null),ee.timer!==null&&(clearTimeout(ee.timer),ee.timer=null)};ve();const Re=tr(X);if(X.paused||Math.abs(Re-ue)<.001||typeof requestAnimationFrame!="function"){try{In(X,ue)}catch{}return}const He=performance.now(),tt=()=>{const ft=Math.min(1,(performance.now()-He)/150);try{In(X,Re+(ue-Re)*ft)}catch{}ee.raf=ft<1?requestAnimationFrame(tt):null};return ee.raf=requestAnimationFrame(tt),ee.timer=setTimeout(()=>{ve();try{In(X,ue)}catch{}},200),ve},[ie]);const Tt=q==="hold",Kt=q==="out",le=H==="playMode"&&!D&&!$e||Tt||Kt,Be=K!=="stopped"||Tt||Kt,Te=K==="paused",Ke=Math.max(0,Math.min(100,(L||0)*100)),Fe=_e("audio-player__fill",le?"is-visible":"",Be?"is-expanded":"",Te?"is-paused":"",Kt?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${$t?"is-playing":""} ${D?"is-loading":""} ${H!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Tc[I]?"status":void 0,"aria-live":Tc[I]?"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,H==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{U.current=Cr(),E(),Ut()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:k,onMouseLeave:E,onFocus:k,onBlur:E,children:n.jsx("span",{ref:v,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:w,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,B&&n.jsx(wn,{anchorRect:B,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${H==="playMode"||$t?"is-visible":""}`,inert:!(H==="playMode"||$t)||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:Mn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:$t?"pause":"play",onClick:Ut,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":$t,width:"60px",variant:"transparent-white",disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Tn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),Je>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:Je}).map((X,ue)=>n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ue+1),onClick:()=>{try{Ft(ue)}catch{}},ariaLabel:p("training.sourcePlay",{n:ue+1}),variant:"transparent-white",selected:F&&S===ue,disabled:H!=="playMode"||!(Array.isArray($)&&$[ue]),showTooltipInfo:!0},ue))}):null,!Array.isArray($)||$.length<=1?n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Lt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"}):null,n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Ln,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:xn,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Fe,ref:m,style:{left:`${Ke}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(Zx,{segments:pn,progress:L,totalDuration:pe,waveProgressRef:Ce,showSoundWaveForm:u,leadInMs:d,tailMs:h,trackDurationSec:$?.[S]?.duration??0,noiseSrc:c&&b?.settings.enabled&&W>0?et:null,noiseRatio:b?Ja(b.settings):0,noiseSpeed:b?.settings.speed??1,mainVolume:ae,onReadyChange:lt})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(Qe,{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(ma,{message:de,position:ye,onClose:Gt})]})}function kr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:l=null,onClose:s,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:f,canDecrease:b,fontSize:x,lineHeight:C}=Mi({storageKey:"tooltip-fontScale"}),m=o.useCallback(()=>d(w=>w==="dark"?"light":"dark"),[]),_=o.useCallback(w=>{try{w.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},y=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((w,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:w})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__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:!b}),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:!f}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:m,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 l?n.jsx(mn,{anchorRect:l,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:y}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:y})}function $c({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(Qe,{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 Rc(e,t,a){const r=o.useRef(t),l=o.useRef(a);o.useEffect(()=>{r.current=t,l.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,i=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(gn)).find(h=>!h.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=l.current();if(d)try{d.focus()}catch{}}}},[e])}function Pc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:l=!1,onPreviewTextBtn:s,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:h=!1}){const{t:p}=xe.useTranslation(),f=un("(max-width: 767px)"),b=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[m,_]=o.useState(!1),[g,A]=o.useState(null),[y,w]=o.useState(null);Rc(m&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const B=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(D=>typeof D=="string"||typeof D=="number")?i.join(""):"",[i]),k=o.useCallback(()=>{_(!1),A(null),w(null)},[]);o.useEffect(()=>{if(!m)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){k();return}w(typeof D<"u"&&D!==null?D:null)},[B]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(w(typeof D<"u"&&D!==null?D:i),!C.current){_(N=>!N);return}if(m)_(!1),A(null),w(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,i,m]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:b,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),l||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?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}),l&&n.jsx("div",{ref:C,children:n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:m?"is-selected":void 0,"aria-expanded":m,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof s!="function"})})]}),m&&n.jsx(kr,{text:y??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:k,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function Cs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function ea({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:l={},children:s,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:h}=xe.useTranslation(),[p,f]=o.useState(()=>Cs(e,t));o.useEffect(()=>{const v=Cs(e,t);if(v!==p){const B=setTimeout(()=>f(v),0);return()=>clearTimeout(B)}},[e,t,p]);const b=o.useCallback((...v)=>{Cs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[m,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const B=v;if(typeof v=="object"&&(B.currentTarget||B.target)&&(B.nativeEvent||B.type)){const D=B.currentTarget??B.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const k=v;if(k&&typeof k.getBoundingClientRect=="function")return k.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:B="",label:k="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const I=g(v);_({text:B,label:k,anchorRect:I,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),y=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),w=o.Children.map(s,v=>{if(o.isValidElement(v)){const B=v;if(typeof B.type=="string")return B;const k=B.props??{},E=typeof k.onDone=="function"?k.onDone:b,D=typeof k.disabled=="boolean";let N=p==="disabled";return D&&(N=!!k.disabled),o.cloneElement(B,{onDone:E,disabled:N,showTooltip:A,hideTooltip:y})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx($c,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Pc,{state:p,title:r,...l,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}),w]}),x?n.jsx(mn,{anchorRect:m.anchorRect,backdrop:m.backdrop,onClose:y,ariaLabel:h("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(kr,{text:m.text,onClose:y})}):null]})}function Ic({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[l,s]=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(P=>P==="dark"?"light":"dark"),{increase:d,decrease:h,canIncrease:p,canDecrease:f,fontSize:b,lineHeight:x}=Mi({storageKey:"textbox_fontScale"}),[C,m]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=Cr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),y=o.useCallback(()=>m(""),[]),w=P=>{try{m(P)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const P=setTimeout(()=>s(t),0);return()=>clearTimeout(P)}},[t]);const B=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[k,E]=o.useState(B);k!==B&&(E(B),s("disabled"));const D=t==="disabled"?l:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",I=o.useMemo(()=>({fontSize:`${b}px`,lineHeight:`${x}px`}),[b,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const P=document.activeElement;P&&P!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&i==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(fe,{htmlType:"button",size:48,type:"bar",onClick:A,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":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:I,children:B})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:h,onDisabledClick:()=>w(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:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>w(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,...!v&&{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(ma,{message:C,position:"top",onClose:y})]})}function ta(e){return e==="active"||e==="done"}function gs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,useTitleFaded:s,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:h,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:b=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:m}=xe.useTranslation(),_=l??m("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",y=Array.isArray(h)&&h.length?h:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,w=d?d.join("||"):"",v=h?h.join("||"):"",[B,k]=o.useState(()=>Array.isArray(y)?C?Ta(y):y.slice():void 0);o.useEffect(()=>{Array.isArray(y)&&y.length?k(C?Ta(y):y.slice()):k(void 0)},[c,w,v,C]);const[E,D]=o.useState(null),[N,I]=o.useState(()=>new Set);o.useEffect(()=>{D(null),I(new Set)},[v,c,w]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&(D(null),I(new Set)),P.current=t},[t,e]);const K=o.useCallback(M=>{if(!ta(A))return;const L=B?.[M];if(L==null)return;const Q=L;if(p){const H=new Set(N);H.has(Q)?H.delete(Q):H.add(Q),I(H),typeof u=="function"&&u({selectedValues:[...H],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...H],__ts:Date.now()})}else D(Q),typeof u=="function"&&u({selectedIndex:M,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:M,selectedValue:Q,__ts:Date.now()})},[B,A,p,u,N]),T=`training-step__buttons${Array.isArray(B)&&B.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:T,children:Array.isArray(B)&&B.length>0?B.map((M,L)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>K(L),ariaLabel:String(M),label:M,useLabel:!0,icon:x?x[String(M)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(M):E===M,useDisabledCovered:b,minWidth:0},String(M))):null})})}function bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),h=l??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,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",b=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,m]=o.useState(c??null),_=`${String(b)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&m(null));const[y,w]=o.useState(c);Object.is(y,c)||(w(c),m(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&m(null),v.current=t},[t,e,c]);const B=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof i=="function"&&i(N),ta(f)&&typeof s=="function"&&s(N)},[i,f,s]),k=o.useCallback(()=>{ta(f)&&(m(!1),B(!1))},[B,f]),E=o.useCallback(()=>{ta(f)&&(m(!0),B(!0))},[B,f]);return n.jsxs(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:h,onDone:s,useTitleFaded:!1,children:[n.jsx(Ic,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>{ta(f)&&(m(N),B&&B(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:k,disabled:f==="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:E,disabled:f==="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 ys({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:l,btnLabel:s,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:h,disabled:p,_pageIndex:f,showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:m}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,title:g,onDone:l,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:h},children:n.jsx(fs,{soundSrc:i,ttsText:i?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:m},`audio-p${f??0}-s${e}`)})}const o_=[];function vs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=o_}){const{t:c}=xe.useTranslation(),d=l??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),h=Y=>typeof Y=="string"?Y:Y&&(Y.context||Y.sentence||Y.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[b,x]=o.useState(()=>(p||[]).map((Y,S)=>({id:S,text:h(Y)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),m=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const Y=Array.isArray(u)?u:[];f(Y);const S=(R=>{const F=(R||[]).map((oe,ae)=>({id:ae,text:h(oe)}));if(F.length<=1)return F;const Z=(oe,ae)=>{if(oe.length!==ae.length)return!1;for(let W=0;W<oe.length;W++)if(oe[W].text!==ae[W].text)return!1;return!0};let pe=Ta(F),re=0;for(;Z(pe,F)&&re<20;)pe=Ta(F),re+=1;return pe})(Y);x(S);try{if(typeof i=="function"){const R=S.filter((F,Z)=>F.text===h(Y[Z])).length;i({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const R=S.filter((F,Z)=>F.text===h(Y[Z])).length;g.current=u,s({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const Y=Array.isArray(u)?u:[],S=b.filter((R,F)=>R.text===h(Y[F])).length;s({shuffled:b,score:S,total:Y.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(Y,S)=>{const R=[...b],F=Y+S;if(F<0||F>=R.length)return;const Z=R[F];R[F]=R[Y],R[Y]=Z,Q(R);try{if(typeof s=="function"&&C==="active"){const pe=R.filter((re,oe)=>re.text===h(p[oe])).length;s({shuffled:R,score:pe,total:(p||[]).length,__ts:Date.now()})}}catch{}},[y,w]=o.useState(null),v=o.useRef(null),B=o.useRef(null),k=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),I=o.useRef(null),P=o.useRef({dx:0,dy:0}),K=()=>{if(I.current!==null)return;const Y=()=>{if(!v.current){I.current=null;return}I.current=requestAnimationFrame(Y);const S=N.current,R=P.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-R.dx}px, ${S.y-R.dy}px, 0)`)};I.current=requestAnimationFrame(Y)},T=o.useRef(new Map),M=o.useRef(new Map),L=()=>{const Y=new Map;return T.current.forEach((S,R)=>{S&&S.getBoundingClientRect&&Y.set(R,S.getBoundingClientRect())}),Y},Q=Y=>{const S=L();x(Y);try{if(typeof i=="function"){const R=Y.filter((F,Z)=>F.text===h(p[Z])).length;i({shuffled:Y,score:R,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const R=L();Y.forEach(F=>{const Z=S.get(F.id),pe=R.get(F.id),re=T.current.get(F.id);if(!re||!Z||!pe)return;const oe=Z.top-pe.top;oe&&(re.style.transition="none",re.style.transform=`translateY(${oe}px)`,requestAnimationFrame(()=>{re.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",re.style.transform="";const ae=()=>{re.style.transition="",re.removeEventListener("transitionend",ae)};re.addEventListener("transitionend",ae)}))})})},H=(Y,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(Y))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const R=document.createElement("div");R.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(R),S.dataTransfer?.setDragImage(R,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(R)}catch{}})}catch{}}catch{}w(Y);try{const R=b[Y],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=R&&R.text?R.text:"",document.body.appendChild(F),v.current=F;const Z=T.current.get(R.id);let pe=S.clientX||0,re=S.clientY||0;try{if(Z&&Z.getBoundingClientRect){const G=Z.getBoundingClientRect();pe=G.left+G.width/2,re=G.top+G.height/2}}catch{}const oe=F.getBoundingClientRect(),ae=oe.width/2,W=oe.height/2;P.current={dx:ae,dy:W},F.style.transition="none",N.current={x:pe,y:re},F.style.transform=`translate3d(${pe-ae}px, ${re-W}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}K()});const ie=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};k.current=ie,document.addEventListener("mousemove",ie);const q=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};B.current=q,document.addEventListener("dragover",q);try{S.dataTransfer?.setData("text/plain",String(Y));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:Y}))}catch{}}catch{}}catch{}},O=(Y,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const R=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(R&&E.current!==R){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{R.classList.add("drag-over")}catch{}E.current=R}}catch{}},U=(Y,S)=>{S.preventDefault();const R=S.dataTransfer?.getData("text/plain")||"",F=R?parseInt(R,10):y,Z=Y;if(typeof F!="number"||isNaN(F)||F===Z){w(null),z(),$();return}const pe=EC(b,F,Z);Q(pe),w(null),$();try{if(typeof s=="function"&&C==="active"){const re=pe.filter((oe,ae)=>oe.text===h(p[ae])).length;s({shuffled:pe,score:re,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const re=document.querySelectorAll(".order-list .order-list__item")[Z];if(!re)return;const oe=re.querySelector(".order-list__slot")||re;try{oe.classList.add("pulse"),oe.offsetHeight,oe.classList.add("to-dark");const ae=()=>{oe.classList.remove("pulse","to-dark"),oe.removeEventListener("transitionend",ae)};oe.addEventListener("transitionend",ae)}catch{}})}catch{}z()},$=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}B.current&&(document.removeEventListener("dragover",B.current),B.current=null),k.current&&(document.removeEventListener("mousemove",k.current),k.current=null),I.current!==null&&(cancelAnimationFrame(I.current),I.current=null)},V=()=>{w(null),z(),$()};o.useEffect(()=>()=>$(),[]);const z=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(Y=>Y.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const Y=Math.max(1,(b||[]).length);b.forEach((S,R)=>{const F=M.current.get(S.id);if(!F)return;let Z=50;Y>1&&(Z=Math.round(R/(Y-1)*100));try{F.style.setProperty("--marker-pos",Z+"%")}catch{}})}catch{}},[b]),o.useEffect(()=>()=>{$(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:b.map((Y,S)=>{const R=Math.max(1,(b||[]).length),F=R>1?Math.round(S/(R-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":F+"%"},ref:Z=>{const pe=M.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:Z=>{const pe=T.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},className:`order-list__draggable ${y===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:m,onDragStart:m?Z=>H(S,Z):void 0,onDragEnter:m?Z=>O(S,Z):void 0,onDragOver:m?Z=>O(S,Z):void 0,onDragLeave:m?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const Z=document.querySelectorAll(".order-list .order-list__item");Z&&Z[S]&&(Z[S].classList.remove("drag-over"),E.current===Z[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:m?Z=>U(S,Z):void 0,onDragEnd:m?V:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:Y.text}),m?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(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:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===b.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},Y.id)})})})}const s_=8e3;function l_(e,t){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.then(l,l),setTimeout(l,t)})}function Fc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:h=!1,maxCards:p,playAllGapMs:f=0}){const{t:b}=xe.useTranslation(),x=l??b("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]),m=p??3,_=(C||[]).slice(0,m);(C||[]).length>m&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${m} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[y,w]=o.useState(null),v=o.useRef([]),[B,k]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{w(null)},[N]);const I=o.useRef(void 0);o.useEffect(()=>{const L=I.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&w(null),I.current=t},[t,e]);const P=o.useCallback((L,Q)=>{if(c)return;const H={item:L,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(A==="active"&&typeof s=="function")try{s(H)}catch{}},[c,i,A,s]),K=o.useRef(f);o.useEffect(()=>{K.current=Math.max(0,f||0)},[f]);const T=o.useCallback(async()=>{if(B||A==="disabled")return;k(!0);let L=!1;const Q=new Promise(H=>{E.current=()=>{L=!0,H()}});try{for(let H=0;H<_.length&&!(!D.current||L);H++){const O=v.current[H];if(!O)continue;await Promise.race([l_(O.play(),s_),Q]);const U=Math.max(0,K.current||0);U>0&&H<_.length-1&&!L&&D.current&&await Promise.race([new Promise($=>{setTimeout($,U)}),Q])}}finally{E.current=null,k(!1)}},[B,A,_.length]),M=o.useCallback((L,Q)=>{if(!ta(A))return;w(Q);const H={selectedValue:L.word||L.title||"",selectedIndex:Q,item:L,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(typeof s=="function")try{s(H)}catch{}},[i,A,s]);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!h&&_.length>0,onPlayAll:T,playAllActive:B},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Q=E.current;if(!Q)return;const H=L.target;H&&typeof H.closest=="function"&&H.closest(".training-word-card__bottom")&&Q()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:b("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((L,Q)=>n.jsx(Xo,{ref:H=>{v.current[Q]=H},item:L,disabled:A==="disabled",onPlayDone:()=>P(L,Q),selectable:c,selected:c&&y===Q,onSelect:c?()=>M(L,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:h},L&&L.id||Q))})})}const i_=160,Oc=()=>{};function Dn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:y,children:w,align:v="horizontal",icon:B,useFullWidth:k=!1}=e,E=D=>{y&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),y())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",k?"panel-row--label-fixed panel-row--fill":"",y?"panel-row--clickable":""),onClick:y,onKeyDown:y?E:void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[B!=null&&n.jsx("div",{className:"panel-row__icon",children:B}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:w})]})}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(Ga,{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:l,onClick:s,required:i,error:u,align:c="horizontal",useFullWidth:d=!1,icon:h}=e,p=a==="button"?void 0:s;let f=null;const b=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(vu,{checked:g.checked,onChange:g.onChange,id:b})}else if(a==="segmented"){const g=e;f=n.jsx(bn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((y,w)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(cn,{options:y.options,value:y.value,onChange:y.onChange,placeholder:y.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:y.ariaLabel??([r,y.placeholder].filter(Boolean).join(" ")||void 0)})},w))}):n.jsx(cn,{options:g.options??[],value:g.value??"",onChange:g.onChange??Oc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,y)=>n.jsx(fe,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},y))}):f=n.jsx(fe,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??Oc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,ghostHint:g.ghostHint,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:i,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const m=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",m?"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:[b?n.jsxs("label",{htmlFor:b,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:"*"})]}),l&&n.jsx("div",{className:"panel-row__sub caption-1",children:l})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function zc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function u_({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:l}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const i=e[s],u=s==="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(s)})]}),i?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[i.device&&n.jsx(Et,{size:"small",variant:Ou(i.device),fill:"soft",label:zu(i.device,r)}),zc(i)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:zc(i)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:i.productName||i.brand}),Ko(i.wornYear,i.wornMonth,i.wornDay,l.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Ko(i.wornYear,i.wornMonth,i.wornDay,l.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Ar({title:e,titleLevel:t=2,icon:a,disc:r,actions:l,size:s="medium",minHeight:i,maxWidth:u,className:c,scrollable:d,scrollbarGutter:h="auto",compactRows:p=!1,useBorder:f=!0,useBg:b=!0,useRowBorder:x=!0,labelWidth:C,form:m=!1,loading:_,empty:g,children:A}){const y=_e("panel",`panel--${s}`,m?"panel--form":"",i!==void 0?"panel--fill":"",f?"":"panel--no-border",b?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),w={};i!==void 0&&(w.minHeight=i),u!==void 0&&(w.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(w["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:y,style:Object.keys(w).length?w:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(Qe,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),l&&n.jsx("div",{className:"panel__actions",children:l})]}),_?n.jsx(Dn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Dn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",h==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function c_({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:l,style:s,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 f=new ResizeObserver(([b])=>d(b.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const h=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",l),style:{"--panel-grid-cols":h?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:i})}function d_(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 Wc(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"}]}d_(Rt.t.bind(Rt)),Wc(Rt.t.bind(Rt));const Nr="none",p_=.5,h_=1.5,m_=.25;function xs({title:e,valueLabel:t,value:a,min:r,max:l,step:s,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(Dn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Lu,{value:a,onChange:d,min:r,max:l,step:s,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function Hc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),l=un("(max-width: 767px)")?40:24,s=xr(),i=Ja(s?.settings??Qn),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,h=s?.mainVolume??1,p=Math.round(h*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),b=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Xa,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===Nr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),m=[{key:Nr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Wc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(mn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__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(Ar,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(xs,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:l,onChange:f}),n.jsx(xs,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:p_,max:h_,step:m_,size:l,onChange:b}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Dn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(bn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:m,value:c?u:Nr,onChange:C})}),n.jsx(xs,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:Xa,step:_c,size:l,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Dn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(bn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:m,value:Nr,onChange:()=>{}})})})]})})}function Vc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:l=0,stepCount:s=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:h}=xe.useTranslation(),[p,f]=o.useState(!1),[b,x]=o.useState(null),[C,m]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=xr(),y=u>0,w=y&&i<u-1,v=!y||i>=u-1,B=l===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const k=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=_?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=g?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),N=un("(max-width: 767px)"),I=o.useRef(null),[P,K]=o.useState(null),T=o.useCallback(()=>{m(Q=>{const H=!Q;return K(H?I.current?.getBoundingClientRect()??null:null),H})},[]),M=o.useCallback(()=>{m(!1),K(null)},[]);o.useEffect(()=>{c&&(m(!1),K(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(qo,{analyser:A?.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(qo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:h("training.meter.noise","\uC18C\uC74C")})]})]});return Rc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.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:E,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:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:h("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:I,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:T,selected:C,"aria-expanded":N?C:void 0,ariaLabel:h("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:L})]}),e&&C&&N&&P&&n.jsx(mn,{anchorRect:P,onClose:M,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:[v&&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:!B}),w&&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:!B})]}),e&&p&&n.jsx(Hc,{anchorRect:b,onClose:k,hideNoiseRows:d})]})}function qc({title:e,subtitle:t,desc:a,depth:r,icon:l,wrapperStyle:s,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:h,onBack:p,onClose:f}){const{t:b}=xe.useTranslation(),x=un("(max-width: 767px)"),C=Number.isInteger(h)?h:u||0,m=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,y=typeof t=="string"?t.trim():t,w=!!(A||y),v=w?A||y:b("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),B=g||(A?t:void 0),k=x&&typeof B=="string"&&(B.includes(" \xB7 ")||B.includes(" / "))?B.split(/\s[·/]\s/).pop():B,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);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:b("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:l?n.jsx(du,{icon:l,label:e,tooltip:i,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[k?n.jsx("span",{className:"pp-title__depth caption-1",children:k}):null,n.jsx("span",{className:`pp-title__title h2${w?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Iu,{max:Math.max(0,m??0),index:Math.max(0,C??0)})]})}function f_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function C_(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 Uc=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Gc(e,t,a){const r=e,l=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=ql().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:l,label:r?.title||l,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Uc(`topic.${s.key}`,s.label):void 0,i?Uc(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function _s(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Kc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,l=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(l).toISOString()}:{}}}function g_(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function b_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:l=[],emptyMessage:s,buildResults:i,metaPatch:u}){const c=Gc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},h=t?.id||t?.title||l.length;return{id:`${e}:${h}`,meta:{...c,...d},pages:l,emptyMessage:s,buildResults:i}}function y_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function v_(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 x_(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 Yc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function __(e,t,a,r){return Yc(e,t*a+r)}function w_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const l=e;if(Array.isArray(l.selectedValues))return r.every(s=>l.selectedValues.includes(s))&&l.selectedValues.every(s=>r.includes(s));if(typeof l.correct=="boolean")return l.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(l=>String(l)===String(a[t]));if(typeof t<"u")return r.some(l=>String(l)===String(t))}}function B_(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 Zc=o.createContext(null);function k_(){const e=o.useContext(Zc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function A_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,choices:s=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,h=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),b=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[b]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const m=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!ta(h))return;const y=p;let w;if(y[A]!=null){const B=y[A];w=y.map(k=>k!==null&&k>=B?null:k)}else w=[...y],w[A]=m;f(w);const v={selectedOrder:w,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(y[A]==null&&w.length>0&&w.every(B=>B!==null))try{typeof i=="function"&&i(v)}catch{}},[h,p,m,u,i,s]),g=l??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,y)=>n.jsx(Xo,{item:{word:A},disabled:h==="disabled",selectable:!0,selected:p[y]!==null,orderRank:p[y],onSelect:()=>_(y),flipDelay:y*120,hideLabel:!1,hideAudio:!0},`${A}-${y}`))})})}function Er(e){return null}Er.__isTrainingPage=!0;function xa(e,t){const a=k_();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 Xc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i}=xa(e,t);return n.jsx(ys,{...a,index:r,stepIndex:l,isLast:s,onDone:i})}function Jc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(gs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function Qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(bs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function ed({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(vs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function td({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(Fc,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function N_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(A_,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}const nd=3e4,E_=/^(https?:|blob:|data:audio|\/|\.\/)/;function ad(e){return typeof e=="string"&&E_.test(e)?e:null}const D_=e=>typeof e=="string"&&e.trim()!==""?e:null,ws=Symbol("timed-out");function S_(e,t){if(t<=0)return Promise.resolve(ws);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(ws),t)})]).finally(()=>clearTimeout(a))}function j_(e){return e?Na()||Zr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function T_(e,t){const a=[],r=ad(t);r&&a.push({kind:"raw",resolve:async()=>r});const l=(e??"").trim();if(!l)return a;for(const[s,i]of[["urlResolver",Na()],["fallbackUrlResolver",Zr()]])i&&a.push({kind:s,resolve:async u=>{let c;try{c=await S_(i(l),u)}catch(h){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,h),null}return c===ws?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${nd}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):D_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \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 M_(){return Date.now()+nd}const L_=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function $_(e){St("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 Dr(...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 l of r){if(typeof l=="string"&&l.trim().length)return l.trim();if(typeof l=="number"||typeof l=="boolean")return String(l)}}}return null}function R_(e){return Dr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function P_(e){return ad(Dr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function rd(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=Dr(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 od(e){const{score:t,contextsLength:a,results:r=[],subtitle:l,onReplay:s,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),h=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=rd(D),I=Dr(D?.wording,D?.label);return N===!0?{variant:"main",label:I??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:I??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:I??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),b=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),m=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{m.current?.(),m.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const y=o.useRef(0),w=(D,N)=>{if(!$n)return;const I=Math.round(performance.now()-y.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${I}ms ${D}`,N??"")},v=o.useRef(0),B=o.useCallback((D,N,I)=>{A();const P=++v.current,K=()=>v.current===P;y.current=$n?performance.now():0,w(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:I}),g(D),m.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Kr()};const T=H=>{w("\uD2BC\uB2E4",H);const O=hr(H,U=>{w(`\uB05D\uB0AC\uB2E4 \u2014 ${U?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:K()}),U&&K()&&(m.current=null,g(null))});return m.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,O.stop(),Kr()},O.done},M=T_(N,I);w("\uCC28\uB840",M.map(H=>H.kind));const L=M[0]?.kind==="raw",Q=L?T(I):Promise.resolve(!1);(async()=>{if(await Q||!K())return;const H=M_(),O=L?M.slice(1):M;for(let U=0;U<O.length;U++){if(!K())return;w(`${O[U].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const $=await O[U].resolve(L_(H,O.length-U));if(w(`${O[U].kind} \uAC00 \uB2F5\uD588\uB2E4`,$),!K()||$&&(await T($)||!K()))return}K()&&(w("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),$_(N),m.current=()=>{v.current++,Kr()},w("\uB0AD\uB3C5\uD55C\uB2E4"),Pf(N,{onEnd:()=>{K()&&(m.current=null,g(null))}}))})()},[A]),k=o.useMemo(()=>C.map(D=>{const N=D??{},I=R_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:P,label:K}=f(N),T=Array.isArray(N.corrects)?N.corrects:[],M=T.length?T.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,L=typeof N.selectedText=="string"?N.selectedText:null,Q=rd(N)===!0,H=P_(N),O=!!H||j_(I);return{problem:I,variant:P,label:K,answer:M,selectedText:L,isCorrect:Q,sound:H,canHear:O}}),[C,f,d]),E=o.useMemo(()=>k.some(D=>D.answer!==null||D.selectedText!==null),[k]);return n.jsx(On,{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:D,closeWithAnimation:N})=>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:()=>D(s)}),n.jsx(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,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.")}),l&&n.jsx("p",{className:"trp-result__subtitle body-3",children:l}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:b}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:b})]})})]}),k.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" 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")}),E&&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")})]}),k.map((D,N)=>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(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(fe,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():B(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.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:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(Et,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const Bs=new Set;function I_(e){o.useEffect(()=>{if(!e||Bs.has(e))return;Bs.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,l=0,s=0;const i=()=>{const h=Date.now();a==null&&(a=h),r==null&&(r=h)},u=()=>{r!=null&&(l+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const h=l-s;if(h<1e3||s===0&&l<5e3)return;const p=Date.now(),f=p-h;s=l,jC({trainingType:e,startedAt:new Date(f).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(),Bs.delete(e)}},[e])}function Sr(e,t){return e&&e.id||`page-${t??0}`}function jr(e,t){return e&&e.key||`step-${t??0}`}function Tr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function F_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const O_=300,z_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Sn=Object.freeze({}),sd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function ks(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,l=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?l:null,total:r}}const W_=e=>n.jsx(od,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function H_(e){const{scenario:t,title:a,subTitle:r,depth:l,icon:s,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:h,stepCount:p,onBack:f,onComplete:b,onRoundFinished:x,onNext:C,onSettings:m,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:y,buildResults:w,onResult:v,typeKey:B,entryPoint:k,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:I,hideNoiseRows:P=!1}=e;I_(B&&!sd.has(B)?B:"");const K=o.useRef(0);o.useEffect(()=>{K.current=Date.now()},[]);const{t:T}=xe.useTranslation(),M=v,L=!!t,Q=t?.id||null,H=t?.meta||{},O=Array.isArray(t?.pages)?t.pages:[],U=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],$=U.length>0,V=le=>le===Er||le?.__isTrainingPage===!0,z=$&&U.some(le=>V(le.type)),Y=z?U.filter(le=>V(le.type)).map((le,Be)=>{const Te=le.props||{};return{id:`children-page-${Be}`,steps:o.Children.toArray(Te.children).filter(o.isValidElement),pageTop:Te.pageTop||Te.top||null,pageBottom:Te.pageBottom||Te.bottom||null}}):[{id:"children-page-0",steps:U}],S=$&&!L&&typeof g!="function",R=S?Math.max(1,Y.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 le=document.body;return le.dataset.ihabTrainingPopupCount=String(Number(le.dataset.ihabTrainingPopupCount||"0")+1),le.classList.add("ihab-training-popup-open"),()=>{const Be=Number(le.dataset.ihabTrainingPopupCount||"1")-1;Be>0?le.dataset.ihabTrainingPopupCount=String(Be):(delete le.dataset.ihabTrainingPopupCount,le.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return dv()},[]);const[F,Z]=o.useState({...Qn,enabled:!1}),pe=o.useRef(F);o.useEffect(()=>{pe.current=F},[F]);const re=o.useRef(I),oe=o.useRef(!1),ae=o.useRef(null);o.useEffect(()=>{let le=!1;const Be=Te=>{if(le)return;oe.current=!0;const Ke=Te?Jn({...Qn,enabled:!1},Te):{...Qn},Fe=ae.current;ae.current=null;const X=Fe?Jn(Ke,Fe):Ke;pe.current=X,Z(X),Fe&&!re.current&&io(X),rr(X);const ue=re.current;if(ue){const ee=typeof ue=="function"?ue(X):ue,ve=Jn(X,ee);pe.current=ve,Z(ve),rr(ve)}};return WC().then(Te=>{if(le){const Ke=ae.current;if(ae.current=null,Ke&&!re.current){const Fe=Te?Jn({...Qn,enabled:!1},Te):{...Qn};io(Jn(Fe,Ke))}return}Be(Te)}),()=>{le=!0}},[]);const[W,ie]=o.useState(null),[q,G]=o.useState(null),de=o.useCallback((le,Be)=>{le==="main"?ie(Be):G(Be)},[]),Ee=o.useRef(null),ye=o.useRef(null),he=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const le=Ee.current;Ee.current=null,le&&io(le)},[]);o.useEffect(()=>{if(typeof window>"u")return;const le=()=>{document.visibilityState==="hidden"&&he()};return window.addEventListener("pagehide",he),document.addEventListener("visibilitychange",le),()=>{window.removeEventListener("pagehide",he),document.removeEventListener("visibilitychange",le),he()}},[he]);const se=o.useCallback(le=>{const Be=Jn(pe.current,le);if(pe.current=Be,Z(Be),!oe.current){ae.current={...ae.current??{},...le},rr(Be);return}re.current||(Ee.current=Be,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(he,O_)),rr(Be)},[he]),Ce=F.mainSpeed,ge=F.mainVolume,ce=o.useCallback(le=>se({mainSpeed:le}),[se]),Me=o.useCallback(le=>se({mainVolume:le}),[se]),Oe=o.useMemo(()=>({settings:F,setSettings:se,registerAnalyser:de,mainAnalyser:W,noiseAnalyser:q,playbackRate:Ce,setPlaybackRate:ce,mainVolume:ge,setMainVolume:Me}),[F,se,de,W,q,Ce,ce,ge,Me]),Le=o.useRef(null),[ze,We]=o.useState(0),dt=o.useRef([]),[lt,at]=o.useState("center"),[ht,Ae]=o.useState(!1),qe=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(le=>{qe.current||(qe.current=!0,Ae(!0),we.current=setTimeout(()=>{try{le()}catch{qe.current=!1,Ae(!1)}},z_()?0:i_))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const ke=o.useRef(f);o.useEffect(()=>{ke.current=f});const $e=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const le=Le.current,Be=$e.current;if(mo(le,Be),le){const Te=Array.from(le.querySelectorAll(gn)).filter(Ke=>!Ke.closest('[aria-hidden="true"]'))[0];if(Te)try{Te.focus()}catch{}}return()=>{const Te=document.activeElement;if(!Te||Te===document.body||le&&le.contains(Te))try{fo(Be)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const le=ke.current;typeof le=="function"&&le()})),[Ue]),po(Le,!0);const[je,Ze]=o.useState(!1),yt=o.useRef(!1),[et,Xe]=o.useState(null),_t=o.useRef(0),Ct=o.useRef(0),wt=()=>{_t.current+=1,Ct.current+=1,Xe(null)},[Bt,mt]=o.useState(""),[rt,ne]=o.useState(()=>Tr()),Ne=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(ne(Tr()),wt())},[L,Q,S]),o.useEffect(()=>{S&&ne(le=>{const Be=Math.max(0,Math.min(le.pageIndex,Math.max(0,R-1)));return Be!==le.pageIndex?{...le,pageIndex:Be,stepIndex:0}:le})},[S,R]);const Je=S?Math.max(0,Math.min(rt.pageIndex,R-1)):0,Ve=S?Y[Je]:null,it=S&&Ve&&Array.isArray(Ve.steps)?Ve.steps:[],Se=L?rt.pageIndex:S?Je:typeof c=="number"?c:0,pt=L?O[Math.max(0,Math.min(rt.pageIndex,Math.max(0,O.length-1)))]:null,gt=L&&pt&&Array.isArray(pt.steps)?pt.steps:[],Pe=L?gt.length:S?it.length:typeof p=="number"?p:0,nt=L||S?Math.max(0,Math.min(rt.stepIndex,Math.max(0,Pe))):typeof h=="number"?h:0,vt=L?O.length:S?R:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const le=L?Sr(pt,Se):Ve?.id||`children-page-${Se??0}`,Be=new Date().toISOString();for(let Te=0;Te<=nt;Te+=1){const Ke=L?jr(gt[Te],Te):`step-${Te}`,Fe=ct(le,Ke);st.current.has(Fe)||st.current.set(Fe,Be)}},[L,S,Se,nt,Ve?.id]),o.useLayoutEffect(()=>{const le=Ne.current;if(typeof Se=="number"&&le!==null&&Se!==le&&Se>le)try{mt(T("training.problemNotice",{n:Se+1}))}catch{}Ne.current=typeof Se=="number"?Se:Ne.current},[Se,c,T]),o.useLayoutEffect(()=>{const le=Le.current;if(!le)return;const Be=()=>le.querySelector(".page-popup__scroll");let Te=null,Ke=null,Fe=null;const X=He=>{const tt=Be();if(!tt)return;const ft=tt.scrollHeight<=tt.clientHeight;if(at(ft?"center":"top"),He&&!yt.current){yt.current=!0;try{Ze(!0)}catch{}try{ve.disconnect()}catch{}}},ue=()=>{Te!==null&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Ke!==null&&clearTimeout(Ke),Ke=setTimeout(()=>X(!0),60)})},ee=()=>{Fe!==null&&cancelAnimationFrame(Fe),Fe=requestAnimationFrame(()=>X(!1))};ue(),window.addEventListener("resize",ee);const ve=new MutationObserver(ue);ve.observe(le,{childList:!0,subtree:!0,attributes:!0});const Re=setTimeout(()=>{yt.current||X(!0)},400);return()=>{window.removeEventListener("resize",ee),Te!==null&&cancelAnimationFrame(Te),Ke!==null&&clearTimeout(Ke),Fe!==null&&cancelAnimationFrame(Fe),clearTimeout(Re);try{ve.disconnect()}catch{}}},[Le]);const Ge=o.useCallback(le=>{Le.current&&(Le.current._childOnNext=le)},[]),ot=o.useCallback(le=>{Le.current&&(Le.current._childOnResult=le)},[]),st=o.useRef(new Map),ct=(le,Be)=>`${le}\0${Be}`,kt=o.useCallback((le,Be,Te)=>{ne(Ke=>{const Fe=Ke.answersByPage[le]||{},X=Fe[Be],ue=_s(Te),ee=_s(X);if(X&&ee>ue)return Ke;const ve=Kc(Te,st.current.get(ct(le,Be)),ue);return{...Ke,answersByPage:{...Ke.answersByPage,[le]:{...Fe,[Be]:ve}}}})},[ne]),Vt=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te)},[pt,Se,kt]),en=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te),!Te?.allowChange&&le?.autoAdvance!==!1&&ne(X=>({...X,stepIndex:Math.max(X.stepIndex,Be+1)}))},[pt,Se,kt,ne]),Cn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=typeof Be=="number"?Be:nt??0,Fe=`step-${Ke}`;kt(Te,Fe,le),le?.allowChange||ne(X=>({...X,stepIndex:Math.max(X.stepIndex,Ke+1)}))},[Ve,Se,nt,kt,ne]),jn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=`step-${typeof Be=="number"?Be:nt??0}`;kt(Te,Ke,le)},[Ve,Se,nt,kt]),Wn=S?{currentPageIndex:Se??0,currentStepIndex:nt??0,totalStepsInPage:it.length,handleStepDone:Cn,handleStepChange:jn}:null,Hn=async()=>{const le=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:O,flowState:rt,answersByPage:rt.answersByPage})):null;return typeof M=="function"&&await Promise.resolve(M(le))||le},qt=async()=>{const le=Ve?.id||`children-page-${rt.pageIndex}`,Be=rt.answersByPage[le]||{},Te=z?(()=>{const X={};let ue=0;return Y.forEach(ee=>{const ve=rt.answersByPage[ee.id]||{},Re=Array.isArray(ee.steps)?ee.steps.length:0;for(let He=0;He<Re;He+=1){const tt=ve[`step-${He}`];typeof tt<"u"&&(X[`step-${ue+He}`]=tt)}ue+=Re}),X})():Be;if(typeof w=="function"){const X=await Promise.resolve(w(Te,{pageAnswers:Be,answersByPage:rt.answersByPage,pages:Y,currentPageId:le}));return typeof M=="function"&&await Promise.resolve(M(X))||X}const Ke=Object.entries(Be).map(([X,ue],ee)=>({index:ee,key:X,payload:ue})),Fe={results:Ke,answers:Ke,score:0};return typeof M=="function"&&await Promise.resolve(M(Fe))||Fe},dn=()=>{const le=++_t.current,Be=()=>le!==_t.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 Fe=Hn();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}if(S){const Fe=qt();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}const Te=Le.current&&Le.current._childOnResult,Ke=Fe=>{try{return Fe?Fe():void 0}catch{return}};if(typeof Te=="function"){const Fe=Ke(Te);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{ue&&!Be()?Xe(ue):X()}).catch(ue=>{X()});return}if(typeof M=="function"){const Fe=Ke(M);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}ue&&!Be()?Xe(ue):X()}).catch(ue=>{console.error("viewResults external handler failed",ue),X()});return}},Ut=()=>{if(L){if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){ne(Be=>({...Be,pageIndex:Be.pageIndex+1,stepIndex:0}));return}return dn()}if(S){const Be=it.length;if(typeof nt=="number"&&nt<Be-1){ne(Te=>({...Te,stepIndex:Te.stepIndex+1}));return}if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){ne(Te=>({...Te,pageIndex:Te.pageIndex+1,stepIndex:0}));return}return dn()}if(typeof C=="function"){try{C()}catch{}return}const le=Le.current&&Le.current._childOnNext;if(typeof le=="function"){try{le()}catch{}return}},Lt=L?H.title||H.label||A||T("common.popup","\uD31D\uC5C5"):a||y||(Array.isArray(l)?l[l.length-1]:void 0)||A||T("common.popup","\uD31D\uC5C5"),Tn=A||Lt,ln=L?H.title??H.label??Lt:a??y??Lt,Mn=(le,Be)=>{const Te=Sr(pt,Se),Ke=jr(le,Be),Fe=rt.answersByPage[Te]?.[Ke],X=F_(le,{page:pt,pageIndex:Se,step:le,stepIndex:Be,storedPayload:Fe,answersByPage:rt.answersByPage,flowState:rt}),ue={key:Ke,index:Be,stepIndex:nt,isLast:Be===gt.length-1};switch(le?.type){case"listen":return n.jsx(ys,{...ue,...X,onDone:ee=>en(le,Be,ee)});case"confirm":return n.jsx(gs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"confirmWithText":return n.jsx(bs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"orderList":return n.jsx(vs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});default:return null}},Ln=o.useRef(void 0);o.useEffect(()=>{const le=Ln.current;if(Ln.current=Se,le===void 0||le===Se||!Cr())return;const Be=Le.current;if(!Be)return;const Te=document.activeElement;if(!(!Te||Te===document.body||!Be.contains(Te)||Te.disabled===!0))return;const Ke=Be.querySelector(`.training-steps ${gn.split(", ").join(", .training-steps ")}`)??Array.from(Be.querySelectorAll(gn)).find(Fe=>!Fe.closest('[aria-hidden="true"]'));try{Ke?.focus()}catch{}},[Se]);const xn=L?O.length>0?n.jsx("div",{className:"training-steps",children:gt.map((le,Be)=>Mn(le,Be))},`replay-${ze}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||T("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Gt=S?n.jsxs(Zc.Provider,{value:Wn,children:[Ve?.pageTop?n.jsx("div",{className:"training-page-top",children:Ve.pageTop}):null,n.jsx("div",{className:"training-steps",children:it.map((le,Be)=>{const Te=le;return o.cloneElement(Te,{...Te.props,_stepIndex:Be,_totalSteps:it.length,_stepKey:`step-${Be}`,_pageIndex:Se})})},`replay-${ze}`),Ve?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Ve.pageBottom}):null]}):null,Ft=o.useRef(-1),$t=o.useCallback(()=>{if(!B)return;const le=et,{results:Be,correct:Te,total:Ke}=ks(et),Fe={correct:Te,total:Ke,attempt:dt.current.length+1,previousAttempts:[...dt.current]};if(Ft.current===Ct.current)return Fe;Ft.current=Ct.current,TC({items:zC(Be),category:sd.has(B)?"sentence":"word",trainingType:B,entryPoint:k??"sentence",itemRef:D??null,correct:Te,total:Ke,score:typeof le?.score=="number"?le.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-K.current)/1e3)),dailyTotal:E??null});try{x?.(Fe)}catch{}return Fe},[B,k,E,D,et,x]);o.useEffect(()=>{!et||et===Sn||et?.isEmpty||(ks(et).total??0)>0&&$t()},[et,$t]);const pn=o.useCallback(()=>{const le=$t();wt(),Ue(()=>{typeof b=="function"&&b(le),typeof f=="function"&&f()})},[b,f,$t,Xe,Ue]),Ot=o.useCallback(()=>mt(""),[mt]),tn=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),Tt=n.jsxs("div",{className:`page-popup${ht?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Tn,children:[n.jsxs("div",{ref:Le,className:`page-popup__panel ${je?"":"page-popup__panel--measuring"} ${lt==="center"?"page-popup__panel--center":lt==="top"?"page-popup__panel--top":""}`,children:[n.jsx(qc,{title:ln,subtitle:L?H.subtitle||H.label:Array.isArray(l)?l.join(" / "):void 0,desc:L?void 0:r,depth:L?H.depth:l,icon:L?H.icon:s,wrapperStyle:L?H.wrapperStyle:i,iconTooltip:L?H.iconTooltip:u,progressMax:vt,progressIndex:Se,pageIndex:Se,pageCount:vt,onBack:tn,onClose:tn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${lt==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Gt:L?xn:typeof g=="function"?g({registerOnNext:Ge,registerOnResult:ot,panelRef:Le,setResultOverlay:Xe}):g})}),n.jsx(Vc,{onSettings:m,onNext:Ut,onResult:dn,useNoiseSettingBtn:!!(L?H.useNoiseSetting??!0:_),stepIndex:nt,stepCount:Pe,pageIndex:Se,pageCount:vt,resultOpen:!!(et&&!et.isEmpty),hideNoiseRows:P})]}),et&&!et.isEmpty&&(N??W_)({score:et.score,results:et.results||et.answers||[],contextsLength:et.results?et.results.length:et.answers?et.answers.length:0,onReplay:()=>{if(K.current=Date.now(),et!==Sn){const{correct:le,total:Be}=ks(et);dt.current.push({correct:le,total:Be})}if(wt(),We(le=>le+1),L){if(ne(Tr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){ne(Tr());return}try{const le=Le.current&&Le.current._childOnResult;typeof le=="function"&&le({replay:!0})}catch{}},onClose:pn,pending:et===Sn}),et?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(fe,{htmlType:"button",variant:"main",size:48,onClick:pn,label:T("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ma,{message:Bt,position:"top",onClose:Ot})]}),Kt=n.jsx(ds.Provider,{value:Oe,children:Tt});return typeof document<"u"&&document.body?nn.createPortal(Kt,document.body):Kt}const zn=H_;zn.Page=Er,zn.ListenStep=Xc,zn.ConfirmStep=Jc,zn.ConfirmWithTextStep=Qc,zn.OrderListStep=ed,zn.CardStep=td,zn.CardOrderStep=N_;function V_({label:e,homonum:t}){const a=sa()?.(e,t)??"",{imgRef:r,loading:l,hasImage:s,onLoad:i,onError:u}=Zo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[l&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:l?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function ld({words:e,anchorRect:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),l({left:c,top:d})},[t]),!t||e.length===0?null:nn.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(V_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function q_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:l,groups:s,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:h,onPrintEmpty:p,className:f,emptyHint:b,sectionType:x="page",disc:C}){const{t:m,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:y,close:w}=Pa(),[v,B]=o.useState(null),k=o.useCallback(()=>{w(),B(null)},[w]);Oy(k,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,I=r===void 0&&t===void 0,P=N?"match":I?"original":"ganada",[K,T]=o.useState(()=>P),[M,L]=o.useState("50"),[Q,H]=o.useState(1),[O,U]=o.useState(N);O!==N&&(U(N),T(P));const $=K==="match"&&!N||K==="original"&&!I?P:K,V=o.useMemo(()=>[...N?[{value:"match",label:m("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...I?[{value:"original",label:m("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:m("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:m("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:m("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:m("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:m("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:m("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[m,N,I]),z=o.useMemo(()=>["10","25","50","100"].map(se=>({value:se,label:m("wordSearch.pageSize",{count:Number(se),defaultValue:`${se}\uAC1C\uC529 \uBCF4\uAE30`})})),[m]),Y=se=>se.words?.[0],S=o.useMemo(()=>{const se=[...D].length,Ce=mC(D),ge=new Map;return ce=>{let Me=ge.get(ce);return Me===void 0&&(Me=Ce((ce.words?.[0]?.label??"").slice(0,se))?0:1,ge.set(ce,Me)),Me}},[D]),R=o.useCallback((se,Ce)=>{const ge=Oe=>Y(Oe)?.label??"",ce=Oe=>Y(Oe)?.syllables??[...ge(Oe)].length,Me=Oe=>(Oe.words??[]).reduce((Le,ze)=>{const We=parseInt(ze.grade??"",10);return Number.isFinite(We)&&We<Le?We:Le},999);switch($){case"match":return S(se)-S(Ce)||on(ge(se),ge(Ce));case"ganada":return on(ge(se),ge(Ce));case"ganada_desc":return on(ge(Ce),ge(se));case"syllable":return ce(se)-ce(Ce)||on(ge(se),ge(Ce));case"syllable_desc":return ce(Ce)-ce(se)||on(ge(se),ge(Ce));case"grade":return Me(se)-Me(Ce)||on(ge(se),ge(Ce));case"grade_desc":return Me(Ce)-Me(se)||on(ge(se),ge(Ce));default:return 0}},[$,S]),F=o.useMemo(()=>l.slice().sort(R),[l,R]),Z=Number(M)||10,pe=o.useMemo(()=>(s??[]).flatMap(se=>se.items.slice().sort(R).map(Ce=>({item:Ce,label:se.label}))),[s,R]),re=s?pe.length:F.length,oe=Math.max(1,Math.ceil(re/Z)),ae=Math.min(Q,oe),W=o.useMemo(()=>F.slice((ae-1)*Z,ae*Z),[F,ae,Z]),ie=o.useId(),q=o.useMemo(()=>{if(!s)return null;const se=pe.slice((ae-1)*Z,ae*Z),Ce=new Map;for(const{item:ge,label:ce}of se)Ce.has(ce)||Ce.set(ce,[]),Ce.get(ce).push(ge);return[...Ce.entries()].map(([ge,ce])=>({label:ge,items:ce}))},[s,pe,ae,Z]);o.useEffect(()=>{H(1)},[K,M,re,r]);const G=re>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(cn,{size:40,options:V,value:$,onChange:T,ariaLabel:m("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(cn,{size:40,options:z,value:M,onChange:L,ariaLabel:m("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(mr,{page:ae,totalPages:oe,onChange:H})]}):void 0,de=se=>{u&&u(se)},Ee=t!==void 0&&a?n.jsxs(n.Fragment,{children:[m("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),m("wordSearch.resultTitleSuffix",{unit:g?kC(a):a})]}):void 0,ye=t!==void 0&&t>0&&c!==void 0&&a?m("wordSearch.resultDisc",{unit:g?NC(a):a,max:c,selected:i.length}):void 0,he=C??ye;return n.jsxs(Ca,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(Ee||G||he)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(Qe,{icon:e,className:"word-search-result-block__head-icon"}),Ee&&n.jsx("span",{className:"word-search-result-block__title h3",children:Ee})]}),G&&n.jsx("div",{className:"word-search-result-block__head-actions",children:G}),he&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:he})]}),(s?s.length===0:l.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:m("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),b&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:b})]}),s?(q??[]).map(se=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${ie}-${se.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${ie}-${se.label}`,children:se.label}),n.jsx("div",{className:"word-search-result-block__items",children:se.items.map(Ce=>{const ge=i.includes(Ce.id);return n.jsx("div",{onMouseEnter:ce=>{y(ce.currentTarget),B(Ce.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(Ce.words??[]).map(ce=>ce.label),subLabel:(Ce.words??[]).some(ce=>ce.subLabel)?(Ce.words??[]).map(ce=>ce.subLabel):void 0,selected:ge,onClick:()=>de(Ce.id),minWidth:200})},Ce.id)})})]},se.label)):n.jsx("div",{className:"word-search-result-block__items",children:W.map(se=>{const Ce=i.includes(se.id);return n.jsx("div",{onMouseEnter:ge=>{y(ge.currentTarget),B(se.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(se.words??[]).map(ge=>ge.label),subLabel:(se.words??[]).some(ge=>ge.subLabel)?(se.words??[]).map(ge=>ge.subLabel):void 0,selected:Ce,onClick:()=>de(se.id),minWidth:200})},se.id)})}),v&&A&&n.jsx(ld,{words:v,anchorRect:A})]}),oe>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(mr,{page:ae,totalPages:oe,onChange:H})}),(d||h)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:m("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:m("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:h})})]})]})}function U_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,l=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:l}})}function G_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:l=4,minCount:s=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:h,title:p,titleIcon:f,disc:b,showInfoButton:x=!0,onClearPhoneme:C,onSearch:m,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:y=!1,pairMode:w=!1,sectionType:v="page",beforeSearchContent:B,beforeContent:k,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:I}=xe.useTranslation(),P=o.useMemo(()=>I("wordPairs.infoNotes",{returnObjects:!0}),[I]),K=o.useMemo(()=>Array.from({length:l-s+1},(S,R)=>{const F=s+R;return{key:String(F),label:I("wordPairs.count",{n:F})}}),[I,l,s]),T=o.useMemo(()=>I("wordPairs.ordinals",{returnObjects:!0}),[I]),M=o.useCallback(S=>N?I("wordPairs.phonemeOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeSingleLabel","\uC74C\uC808"):I("wordPairs.phonemeN",{n:S}),[N,T,a,I]),L=o.useCallback(S=>N?I("wordPairs.phonemeContrastOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):I("wordPairs.phonemeContrast",{n:S}),[N,T,a,I]),Q=o.useCallback((S,R)=>R?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:H,toggleAt:O,close:U}=Pa(),$=o.useCallback(S=>r(Number(S)),[r]),V=un("(max-width: 767px)"),z=o.useCallback(S=>U_(S,e).map(({label:R,value:F,displayLabel:Z})=>{const pe=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"phoneme-select-block__cell-jamo-part--empty",pe?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),pe&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:Z??R})]},R)}),[e,d]),Y=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:V?"dot":void 0,icon:"info",label:V?void 0:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:H?"is-selected":void 0,"aria-expanded":!!H,"aria-haspopup":"dialog",onClick:S=>O(S.currentTarget)})}),H&&n.jsx(Kn,{title:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:P,anchorRect:H,onClose:U})]});return n.jsxs(Ca,{type:v,title:p,icon:f,disc:b,action:x?Y:void 0,className:_e("phoneme-select-block",h),children:[k,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(bn,{options:K,value:String(a),onChange:$,size:40,ariaLabel:I("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:w?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:I("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(R+1)})]},R)})})]}):t.map((S,R)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:w?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,R)=>{const F=t[R*2]??{};return n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(F,R*2):i,selected:F,onSelect:c?.(R*2),align:"newline"},R)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsx(En,{title:L(R+1),sections:u?u(F,R*2+1):i,selected:F,onSelect:c?.(R*2+1),align:"newline"},R)})})]}):t.map((S,R)=>n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(S,R):i,selected:S,onSelect:c?.(R),align:"newline"},R))})}),B&&n.jsx("div",{className:"phoneme-select-block__before-search",children:B}),(C||m||y)&&(()=>{const S=t.every(R=>{const F=cC(R);return Object.entries(F).every(([Z,pe])=>!pe||Z==="coda"&&pe===jl)});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:I("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),m?n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:y?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||y,onDisabledClick:y?()=>{}:void 0,"aria-busy":y||void 0,onClick:m}):y?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:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function K_({title:e,sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:h}){const{t:p}=xe.useTranslation();return n.jsx(En,{className:h,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function Y_({title:e,headerAction:t,sections:a,selected:r,onSelect:l,className:s}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(En,{className:s,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:l,align:"newline"})}function Z_({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:l,positionCount:s,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:h}=xe.useTranslation(),p={searchMode:h("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:h("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:h("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:h("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:h("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:h("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:h("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:h("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:h("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:h("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:h("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=m=>h("wordPairs.count",{n:m}),b=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ha,{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(Ha,{items:h("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ha,{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.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(m,_)=>{_===p.searchMode?a(m===p.explicit?"explicit":m===p.pick?"pick":"include"):_===p.phonemeOrder?l(m===p.orderMatch?"ordered":"unordered"):_===p.count?i(m===f(2)?2:1):_===p.inputMode&&c(m===p.pronInput?"phoneme":"word")};return n.jsx(En,{className:d,title:e??h("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:b,selected:x,onSelect:C,align:"inline"})}function X_(e){const{title:t,items:a,columns:r,resizeStorageKey:l,gridTemplateColumns:s,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:h=!0,selectedId:p,selectedIds:f,onSelect:b,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:m,emptyText:_,noMatchText:g,countLabel:A,topContent:y,className:w=""}=e,{t:v}=xe.useTranslation(),B=u??v("common.search","\uAC80\uC0C9"),k=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[I,P]=o.useState(d??r[0]?.key??""),[K,T]=o.useState(h),[M,L]=o.useState(String(m??C[0]??10)),[Q,H]=o.useState(1);o.useEffect(()=>{H(1)},[D,M]);const O=c!==null,U=o.useCallback((re,oe)=>{if(!oe)return!0;const ae=oe.toLowerCase();return r.some(W=>{const ie=re[W.key];return ie==null?!1:String(ie).toLowerCase().includes(ae)})},[r]),$=c??U,V=o.useMemo(()=>{const re=O?a.filter(oe=>$(oe,D)):a;return I?[...re].sort((oe,ae)=>{const W=oe[I],ie=ae[I];return W===ie?0:wo(W,ie,K)}):re},[a,D,I,K,O,$]),z=Math.max(1,Math.ceil(V.length/Number(M)));Q>z&&H(z);const Y=Math.min(Q,z),S=V.slice((Y-1)*Number(M),Y*Number(M)),R=o.useCallback(re=>{I===re?T(oe=>!oe):(P(re),T(!0)),H(1)},[I]),F=o.useMemo(()=>{if(typeof A=="function"){const re=V.length,oe=A(re);if(typeof oe=="string"){const ae=oe.lastIndexOf(String(re));if(ae>=0)return{prefix:oe.slice(0,ae),suffix:oe.slice(ae+String(re).length)}}return{label:oe}}if(typeof A=="string"&&A.includes("{n}")){const[re,oe]=A.split("{n}");return{prefix:re,suffix:oe}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,V.length,v]),Z=o.useMemo(()=>r.map(re=>({label:re.label,onClick:re.sortable!==!1?()=>R(re.key):void 0,className:re.className,sortDir:re.sortable!==!1&&I===re.key?K?"asc":"desc":null})),[r,I,K,R]),pe=o.useMemo(()=>C.map(re=>({value:String(re),label:v("common.pageSizeLabel",{n:re})})),[C,v]);return n.jsxs(On,{className:`popup-list ${w}`,title:t,onClose:x,children:[y,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(Ro,{count:"label"in F?void 0:{value:V.length,prefix:F.prefix,suffix:F.suffix},search:O?{value:D,onChange:N,placeholder:B}:void 0,pageSize:{options:pe,value:M,onChange:L},pagination:{page:Y,total:z,onChange:H}}),n.jsx(Go,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:l,fields:Z,items:S,onRowClick:b,renderRow:re=>{const oe=f!=null?re.id!=null&&f.has(re.id):p!=null&&re.id===p;return r.map(ae=>({content:ae.render?ae.render(re):re[ae.key]??"",className:_e(ae.className,oe&&"popup-list__row--selected")}))},empty:O&&D!==""&&a.length>0?E:k})]})}function id(e){const{title:t,message:a,topContent:r,details:l,children:s,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:h="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:b=!0,onClose:x,inline:C,size:m="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),y=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=y.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),I=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];I&&!I.disabled&&I.focus()},[]);const w=o.useRef(!1),[v,B]=o.useState(!1),k=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(w.current)return;w.current=!0;const N=typeof document<"u"?document.activeElement:null;B(!0);let I=!1;try{I=await D()}catch(P){typeof console<"u"&&console.error(P)}finally{I||(w.current=!1,B(!1),requestAnimationFrame(()=>{const P=document.activeElement;(!P||P===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(On,{title:t,onClose:x,closeDisabled:v,inline:C,size:m,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);await d.onClick(N.close);const I=d.closeOnClick??!0;return I&&D(),I||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:i??A("common.confirm","\uD655\uC778"),variant:h,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);return await f(N.close),b&&D(),b||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),l&&l.length>0&&n.jsx(Ar,{children:l.map((D,N)=>n.jsx(Dn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:y,className:"body-2 confirm-popup__message",children:a}),s]})}function J_(e,t,a={}){const{t:r}=xe.useTranslation(),[l,s]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(s(!0),!1):!0,[e]),d=l?n.jsx(id,{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:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function Q_({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(""),[s,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 x=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),x()}catch(m){c($l(m)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),b=x=>{l(x.target.value),c(null)};return n.jsx(On,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>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:b,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:h,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const ud=["var(--color-main)","var(--color-sub)"],ew=2e3;function tw(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 As({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:l,trigger:s=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),m=t-C,_=(g,A)=>Array.from({length:g}).map((y,w)=>{const v=6+Math.random()*12,B=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),k=ud[Math.floor(Math.random()*ud.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,I=Math.cos(N)*D,P=Math.sin(N)*D*1.35,K=Math.random()*720-360,T=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),M=Math.random()>.7?"50%":"3px";return{id:`${A}-${w}`,side:A,size:B,color:k,delay:E,vx:I,vy:P,angularVel:K,life:T,borderRadius:M}});return[..._(C,"left"),..._(m,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),h=o.useRef(l);o.useEffect(()=>{h.current=l},[l]);const p=o.useRef(null),f=o.useRef(null),b=()=>{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"&&f.current==null&&(f.current=b()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const U=setTimeout(()=>h.current?.(),0);return()=>clearTimeout(U)}const C=1200,m=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=U=>Math.max(40,(U||window.innerWidth)*.02),y=_?.width||window.innerWidth||375,w=_?.height||window.innerHeight||812,v=U=>{const $=[...U].sort((V,z)=>V-z);return $[Math.floor($.length/2)]||1},B=v(i.map(U=>Math.abs(U.vy))),k=v(i.map(U=>Math.abs(U.vx))),E=Math.sqrt(2*C*(w*.72+g))/B,D=B*E/C,N=y*.5/(k*D),I=(U,$,V)=>Math.min(V,Math.max($,U)),P=I(E,.8,2.4),K=I(N,.7,2.2),T=a>0?a/ew:1,M=i.map(U=>({...U,life:U.life*T,vx:U.vx*K,vy:U.vy*P,startTime:m+U.delay,ended:!1})),L=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Q=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},H=U=>{let $=!1;for(const V of M){const z=c.current[V.id];if(!z||!z)continue;if(U<V.startTime){z.style.display="none",$=!0;continue}if(!V._inited){const W=V.side==="left"?L.x:Q.x,ie=V.side==="left"?L.y:Q.y;z.style.left=`${W}px`,z.style.top=`${ie}px`,z.style.transform="translate3d(0px, 0px, 0)",z.style.display="block",z.style.zIndex="100000",typeof V.color=="string"&&V.color.startsWith("var(")&&(z.style.background=tw(z,V.color)??"#FF0060"),V._inited=!0}const Y=(U-V.startTime)/1e3;if(Y<0)continue;const S=V.life/1e3;if(Y>=S){z.style.opacity="0",z.style.display="none",V.ended=!0;continue}$=!0;const R=V.side==="left"?L.x:Q.x,F=V.side==="left"?L.y:Q.y,Z=R+V.vx*Y,pe=F+V.vy*Y+.5*C*Y*Y,re=(V.angularVel||0)*Y,oe=Z-R,ae=pe-F;z.style.transform=`translate3d(${oe}px, ${ae}px, 0) rotate(${re}deg)`,z.style.opacity=`${Math.max(0,1-Y/S)}`}$?d.current=requestAnimationFrame(H):h.current?.()};d.current=requestAnimationFrame(H);const O=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const U=document.createElement("div");U.className="party-container",U.style.position="fixed",U.style.inset="0",U.style.pointerEvents="none",U.style.overflow="visible",U.style.zIndex="2147483647";for(const $ of i){const V=document.createElement("span");V.className=`confetti confetti--${$.side}`,V.setAttribute("aria-hidden","true"),V.style.display="none",V.style.position="fixed",V.style.left="0px",V.style.top="0px",V.style.width=`${$.size}px`,V.style.height=`${Math.max(4,$.size*.6)}px`,V.style.background=$.color,V.style.borderRadius=$.borderRadius,V.style.transform="translate3d(0,0,0)",V.style.opacity="0",U.appendChild(V),c.current[$.id]=V}(document.body||f.current).appendChild(U),p.current=U}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(O),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,i]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:m=>{c.current[C.id]=m},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}-${s}`))});return typeof document<"u"?nn.createPortal(x,f.current||document.body):x}const Ns=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function nw({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Ns(u.count),strength:Ns(u.strength),duration:Ns(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const l=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(As,{active:t,trigger:e}),a&&n.jsx(As,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:l})]})}function aw({title:e,sub:t,rightAction:a,titleAction:r,badge:l,badgeVariant:s="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:h}=xe.useTranslation();Ay(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}),l&&n.jsx("div",{className:"page-title__badge",children:n.jsx(Et,{label:l,size:"small",variant:s,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 rw(e){return e??""}const cd=o.createContext({words:[],loading:!1});function ow(){return o.useContext(cd)}function sw({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const h=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,l,s,i,u,c]);return n.jsx(cd.Provider,{value:h,children:d})}function lw({items:e,actions:t,columns:a,flat:r=!1,className:l,style:s}){const i=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",l),style:{"--summary-strip-cols":String(i),...s},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 iw=(e,t)=>`${e} / ${t}`;function uw({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:l=iw,pageWidth:s,pageHeight:i,margin:u,className:c,style:d}){const{t:h}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,m]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const T=p.current;if(!T)return;const M=()=>g(T.scrollWidth>T.clientWidth+1);if(M(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(M);return L.observe(T),()=>L.disconnect()},[C]);const A=e.map(T=>`${T.id}\0${T.section??""}\0${T.group??""}`).join(""),y=C&&C.shape===A?C.pages:null,[w,v]=o.useState(0);o.useEffect(()=>{const T=x.current;if(!T||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>v(T.offsetHeight));return M.observe(T),()=>M.disconnect()},[]);const[B,k]=o.useState(0);o.useEffect(()=>{const T=f.current;if(!T||typeof ResizeObserver>"u")return;let M=null;const L=typeof requestAnimationFrame=="function"?O=>requestAnimationFrame(O):O=>setTimeout(O,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:O=>clearTimeout(O),H=new ResizeObserver(()=>{M==null&&(M=L(()=>{M=null,k(O=>O+1)}))});return Array.from(T.children).forEach(O=>H.observe(O)),()=>{H.disconnect(),M!=null&&Q(M)}},[A]),o.useLayoutEffect(()=>{const T=f.current,M=x.current;if(!T||!M)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Q=new Map;b.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Q.set(S.dataset.chromeSection??"",L(S))});const H=S=>L(M)-(Q.get(S??"")??0),O=Array.from(T.children).map(S=>L(S)),U=[];e.forEach((S,R)=>{const F=U[U.length-1],Z=F?e[F[0]]:void 0;Z&&S.group!=null&&Z.group===S.group&&Z.section===S.section?F.push(R):U.push([R])});const $=[];let V=[],z=0;const Y=()=>{V.length&&$.push(V),V=[],z=0};U.forEach(S=>{const R=S.reduce((Z,pe)=>Z+O[pe],0),F=H(e[S[0]].section);V.length&&e[V[0]].section!==e[S[0]].section&&Y(),R>F?S.forEach(Z=>{V.length&&z+O[Z]>F+.01&&Y(),V.push(Z),z+=O[Z]}):(V.length&&z+R>F+.01&&Y(),S.forEach(Z=>V.push(Z)),z+=R)}),Y(),m(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify($)?S:{shape:A,pages:$})},[A,w,s,i,u,B]);const E=To,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),I=(T,M,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:N}),n.jsx("span",{className:"report-doc__page-no",children:l(T,M)})]})}),P=Array.from(new Set(e.map(T=>T.section??""))),K={...s?{"--report-page-w":s}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:K,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:x,className:"report-doc__ruler"}),n.jsx("div",{ref:b,children:P.map(T=>{const M=I(1,1,T||void 0);return n.jsxs("div",{"data-chrome-section":T,children:[M.header,M.footer]},T)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(T=>n.jsx("div",{children:T.content},T.id))})]}),y&&n.jsx("div",{className:"report-doc__pages",children:y.map((T,M)=>{const{header:L,footer:Q}=I(M+1,y.length,e[T[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,T.map(H=>n.jsx("div",{children:e[H].content},e[H].id)),Q]},M)})})]})}function cw({title:e,fields:t,columns:a=4,className:r,style:l}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...l},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},i))})]})}const na=new Map;let Mr=null;const dw=12;function pw(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 Lr(){const e=new Map;for(const t of na.keys()){if(!t.isConnected)continue;const a=pw(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,l)=>r.compareDocumentPosition(l)&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 l=r.getBoundingClientRect().height;l>0&&(a+=l+dw)}}}function hw(e){return typeof window>"u"?()=>{}:(na.set(e,(na.get(e)??0)+1),na.get(e)===1&&typeof ResizeObserver<"u"&&(Mr??(Mr=new ResizeObserver(()=>Lr())),Mr.observe(e)),Lr(),()=>{const t=(na.get(e)??1)-1;if(t>0){na.set(e,t),Lr();return}na.delete(e),Mr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Lr()})}function mw({title:e,message:t,actionLabel:a,onAction:r,icon:l,onClose:s,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),h=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,b=f?hw(f):null;return()=>{b?.(),h.current&&p&&p.contains(document.activeElement)&&sr(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",i),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{h.current=!0,s()},"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:l??n.jsx(Fs,{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 fw({title:e,titleLevel:t=3,description:a,topActions:r,children:l,footerLeft:s,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:h,onDragEnd:p,className:f}){const b=t?`h${t}`:"div",x=s!=null||i!=null,C=l!=null&&l!==!1,m=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?m: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(b,{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:l}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function Cw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:l,beforeSort:s,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:h=!1,onDragOver:p,onDragLeave:f,onDrop:b,children:x,className:C}){const{t:m}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=l!=null,y=_e("training-card-group",h&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:y,onDragOver:p,onDragLeave:f,onDrop:b,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:[A&&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?m("common.expandFor",{name:e}):m("common.collapseFor",{name:e}):r?m("common.expand","\uD3BC\uCE58\uAE30"):m("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:l}),typeof e=="string"?n.jsx(g,{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}),(s!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:w=>w.stopPropagation(),children:[s,i&&n.jsx(cn,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?m("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:x}))]})}const gw="speechear:saved_word_tables";function bw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function yw(){try{const e=localStorage.getItem(gw);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(bw):[]}catch{return[]}}function dd(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 Es(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function vw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let l=2;t.has(r);l++)r=`${a.id}~${l}`;return t.add(r),r===a.id?a:{...a,id:r}})}function xw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:l,filterDefaultCollapsed:s,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:h,items:p,onSaveComplete:f,onLoad:b,onRemoveItem:x,onReset:C,resetLabel:m,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:y,onAddItem:w,className:v,renderSavePopup:B,renderWordSearch:k,hideControls:E,saveOnly:D,tableName:N,nameValue:I,onNameChange:P,descriptionValue:K,onDescriptionChange:T,namePlaceholder:M,descriptionPlaceholder:L,existingNames:Q,editingName:H,onCancel:O,initialItemsPerPage:U,renderCellAction:$,actionsLeftExtra:V}){const{t:z}=xe.useTranslation(),Y=m??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,R=!!P,[F,Z]=o.useState([]),pe=(I??"").trim(),re=pe||(M??"").trim(),oe=(K??"").trim()||(L??"").trim(),ae=(Q??[]).map(ee=>ee.trim().toLowerCase()),W=[H?.trim().toLowerCase(),...F].filter(ee=>!!ee),ie=[...ae];for(const ee of W){const ve=ie.indexOf(ee);ve!==-1&&ie.splice(ve,1)}const q=pe!==""&&ie.includes(pe.toLowerCase()),[G,de]=o.useState(Array(4).fill(null)),[Ee,ye]=o.useState(4),[he,se]=o.useState(null),Ce=G.slice(0,Ee),ge=!!d?.show,[ce,Me]=o.useState(!0),[Oe,Le]=o.useState(!0),ze=d&&{...d,top:ce,bottom:Oe},[We,dt]=o.useState("landscape"),[lt,at]=o.useState(["image","word","standardPron"]),[ht,Ae]=o.useState("show"),[qe,we]=o.useState(!0),[Ue,ke]=o.useState(!0),$e=o.useRef(null),je=o.useRef([]),[Ze,yt]=o.useState(U==="all"?Number.POSITIVE_INFINITY:U??8),[et,Xe]=o.useState("right"),[_t,Ct]=o.useState(!1),[wt,Bt]=o.useState(!1),{toastMessage:mt,toastType:rt,showWarning:ne,clearToast:Ne}=Oi("warning"),Je=o.useCallback(()=>se(null),[se]);w&&!S&&!y&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[Ve,it]=o.useState(()=>Math.max(p?.length??1,1)),Se=S?Ee:y?Math.max(Ve,p?.length??1,1):Math.max(p?.length??0,1),{width:pt,height:gt}=ga[We],Pe=!S&&!y,nt=p?.length??0,vt=Math.min(Ze,Math.max(nt,1)),Ge=Pe?vt:Se,ot=Pe?Zu(p??[],Ge):null,st=!!ot&&ot.length>1,ct=S?Ce.some(ee=>ee!==null&&ee.length>1):(p??[]).some(ee=>(ee.words??[]).length>1),kt=N?.trim()||`${Hl(La())} ${ct?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Vt=o.useCallback(()=>st?je.current.filter(ee=>ee!==null):$e.current?[$e.current]:[],[st]),{print:en,openNewWindow:Cn,downloadHtml:jn}=ss({getElements:Vt,paperW:pt,paperH:gt,fileName:kt,onPopupBlocked:()=>{ne(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."))}}),Wn=ee=>{ye(ee),de(ve=>ve.length>=ee?ve:[...ve,...Array(ee-ve.length).fill(null)]),se(null)},Hn=ee=>{de(ve=>{const Re=[...ve];return Re[ee]=null,Re}),he===ee&&se(null)},qt=ee=>{if(he===null)return;const ve=he;de(He=>{const tt=[...He];return tt[ve]=ee.length>0?ee:null,tt});const Re=Ce.findIndex((He,tt)=>tt>ve&&He===null);se(Re!==-1?Re:null)},dn=S?Ce.some(ee=>ee?.some(ve=>!!ve.colloquialPronunciation)):(p??[]).some(ee=>(ee.words??[]).some(ve=>!!ve.colloquialLabel)),Ut=o.useMemo(()=>sa()?S?G.slice(0,Ee).flatMap(ee=>(ee??[]).map(ve=>[ve.word,ve.homonum])):(p??[]).flatMap(ee=>(ee.words??[]).map(ve=>[ve.label,ve.homonum])):[],[S,G,Ee,p]),[Lt,Tn]=o.useState(!1);o.useEffect(()=>{if(Ut.length===0)return;let ee=!1;return Promise.all(Ut.map(([ve,Re])=>Nl(ve,Re))).then(ve=>{ee||Tn(ve.some(Boolean))},()=>{}),()=>{ee=!0}},[Ut]);const ln=Ut.length>0&&Lt,Mn=o.useMemo(()=>[...S||y?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:I4.map(ee=>({value:`${ee}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ee})})),display:"segmented"}]:[],...Pe&&(p?.length??0)>0?[hc(z,{hasPairs:ct,itemCount:nt})]:[],...st?[F4(z)]:[]],[z,S,y,Pe,p?.length,ct,nt,st]),Ln={...S||y?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Se}\uCE78`}:{},...Pe&&(p?.length??0)>0?{[z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${vt}\uAC1C`}:{},...st?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:et}:{}},xn=(ee,ve)=>{ve===z("wordTable.filter.columns","\uCE78 \uC218")?S?Wn(parseInt(ee)):it(parseInt(ee)):ve===z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?yt(mc(parseInt(ee),nt)):ve===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&Xe(fc(ee))},Gt=S?vw(Ce.filter(ee=>ee!==null&&ee.length>0).map(ee=>({id:Es(ee),words:ee.map(dd)}))):p??[],Ft=()=>{S&&de(ee=>ee.length>Ee?ee.slice(0,Ee):ee)},$t=(ee=!1)=>{if(Bt(ee),R&&f){const ve=re.trim().toLowerCase();ve&&Z(Re=>Re.includes(ve)?Re:[...Re,ve]),f(re,Gt,oe||void 0,ee),Ft();return}if(D&&f){f("",Gt,void 0,ee),Ft();return}if(f){Ct(!0);return}jn()},[pn,Ot]=o.useState(!1),[tn,Tt]=o.useState(""),Kt=tn.trim(),le=Kt!==""&&ae.includes(Kt.toLowerCase()),Be=()=>{Tt(re?z("wordTable.save.copyName",{name:re,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},Te=()=>{!Kt||le||!f||(f(Kt,Gt,oe||void 0,!0),Ft(),Ot(!1))},Ke=Gt.length===0,Fe=Ke||R&&(re===""||q),X=()=>{if(Ke){ne(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(R&&re===""){ne(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}R&&q&&ne(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},ue=n.jsx(ba,{items:Gt,orientation:We,contentTypes:lt,cutLine:ht,showOutline:qe,showDivLine:Ue,count:Se});return n.jsxs(n.Fragment,{children:[n.jsxs(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[pn&&n.jsx(On,{size:"small",title:g??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ee})=>n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ee}),n.jsx(fe,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Kt||le,onClick:Te})]}),children:n.jsx(Xn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:tn,onChange:Tt,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:Te,error:le?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),_t&&f&&B?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:ue,previewW:pt,previewH:gt,items:Gt,existingNames:yw().map(ee=>ee.name),saveAsNew:wt,onSave:(ee,ve)=>{f(ee,Gt,ve,wt),Ft(),Ct(!1)},onCancel:()=>Ct(!1)}),(S||w)&&he!==null&&k?.({cellIndex:he,onConfirm:S?qt:ee=>{if(w){const ve=ee[0];if(ve){const Re=new Set((p??[]).map(tt=>tt.id));let He=Es([ve]);for(let tt=2;Re.has(He);tt++)He=`${Es([ve])}~${tt}`;w({id:He,words:[dd(ve)]})}}se(null)},onClose:Je}),!E&&n.jsx(ns,{title:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:ln,hasColloquial:dn,contentTypes:lt,orientation:We,showOutline:qe,cutLine:ht,showDivLine:Ue,setters:{setContentTypes:at,setOrientation:dt,setShowOutline:we,setCutLine:Ae,setShowDivLine:ke,setShowTopInfo:Me,setShowBottomInfo:Le},showCutLine:(Pe?Ge:Se)>1,showDivLine2:ct,middleSections:Mn,extraSelected:Ln,onExtraSelect:xn,showPaperBands:ge,showTopInfo:ce,showBottomInfo:Oe}),st&&ot?n.jsx("div",{className:"word-table-block__pages",children:ot.map((ee,ve)=>n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:ht,showOutline:qe,showDivLine:Ue,count:Ge,items:ee,onRemoveItem:x,onReorder:A&&((Re,He)=>A(Re+ve*Ge,He+ve*Ge)),renderCellAction:$&&((Re,He)=>$(Re+ve*Ge,He)),brand:ze,code:h,contentRef:Re=>{je.current[ve]=Re},pageNumber:{current:ve+1,total:ot.length},pageNumberPosition:et},ve))}):n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:ht,showOutline:qe,showDivLine:Ue,count:Se,items:S?void 0:p??[],editCells:S?Ce:void 0,activeCell:he,onActivateCell:S||w?se:void 0,onRemoveCell:S?Hn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:$,brand:ze,code:h,showFillerAdd:!!w,contentRef:$e}),!E&&!D&&(C||V!=null)&&n.jsxs("div",{className:"word-table-block__table-actions",children:[C&&n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:Y,onClick:C}),V]}),R&&!E&&n.jsxs(Ar,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Dn,{variant:"custom",label:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:I??"",onChange:P,placeholder:M?M+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:q?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(I??"").trim()&&(M??"").trim()&&(ee.preventDefault(),P?.(M??""))}})}),n.jsx(Dn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:K??"",onChange:T,placeholder:L?L+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:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(K??"").trim()&&(L??"").trim()&&(ee.preventDefault(),T?.(L??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&b&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:b}),!D&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Cn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[O&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:O}),!D&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:en}),g&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>R?Be():$t(!0),disabled:Ke,onDisabledClick:()=>{ne(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:_??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>$t(!1),disabled:Fe,onDisabledClick:X})]})]}),n.jsx(ma,{message:mt,type:rt,onClose:Ne})]})}function pd({items:e,className:t}){const a=e.length,r=a<=3?1:2,l=Math.ceil(a/r)||1,s=r*l;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(i,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,h)=>n.jsxs(o.Fragment,{children:[h>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},h))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function _w({items:e,name:t,description:a,createdAt:r,code:l,published:s,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:h,publishedAt:p,likeCount:f,downloadCount:b,onPublisherClick:x,selected:C,onClick:m,onMore:_,titleNode:g,className:A}){const{t:y}=xe.useTranslation(),w=g!=null,v=h!=null||p!=null||f!=null||b!=null,B=k=>{k.target===k.currentTarget&&!w&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),m?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":l?`${t} (${l})`:t,onClick:w?void 0:m,onKeyDown:B,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":y("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(pd,{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:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!w&&n.jsx(fe,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:y("common.moreFor",{name:t}),onClick:k=>{k.stopPropagation(),_(k)}})]}),(l||r||s||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?Wl(r,y):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(Et,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??y("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(Et,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??y("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),l&&n.jsx("span",{className:"word-table-button__code caption-1",children:l})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[h&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":y("wordTable.publisherFilter",{name:h,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:k=>{k.stopPropagation(),x()},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:Wl(p,y)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":y("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),b!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(b),"aria-label":y("common.downloadCount",{count:b,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${b}`})})]})]})]})}/**
1071
1071
  * @license lucide-react v1.38.0 - ISC
1072
1072
  *
1073
1073
  * This source code is licensed under the ISC license.
@@ -1077,4 +1077,4 @@ ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!h)return p(
1077
1077
  *
1078
1078
  * This source code is licensed under the ISC license.
1079
1079
  * See the LICENSE file in the root directory of this source tree.
1080
- */const kw=[["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"}]],Aw=te("circle-x",kw);function Nw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function Ds({icon:e,label:t,state:a,pct:r,subText:l}){const{t:s}=xe.useTranslation(),i=a==="done",u=a==="pending",c=a==="error",d=i?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${i?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:i?n.jsx(Hs,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(Aw,{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(Et,{variant:"sub",fill:"soft",size:"small",label:s("common.done","\uC644\uB8CC")}):c?n.jsx(Et,{variant:"danger",fill:"soft",size:"small",label:s("common.failed","\uC2E4\uD328")}):(l||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[l,l&&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 Ew({title:e,progress:t,onDone:a,onRetry:r,onClose:l,inline:s}){const{t:i}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:h,imageDone:p,imageTotal:f,pairPercent:b}=t,x=Nw(u),C=u==="done",m=!!c;function _(B){return m&&x===B?"error":x>B?"done":x===B?"active":"pending"}const g=_(1),A=_(2),y=_(3),w=u==="image-match"&&f?Math.round((p??0)/f*100):void 0,v=o.useMemo(()=>{if(A!=="done"){if(u==="image-list")return i("wordData.checkingPage",{page:h??1});if(u==="image-match"&&f)return i("wordData.imageCount",{done:uo(p),total:uo(f)})}},[A,u,h,f,p,i]);return n.jsx(On,{inline:s,className:"popup--word-data-update",title:e,footer:m&&r?n.jsx(Ce,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):m?n.jsx(Ce,{htmlType:"button",size:56,variant:"main",onClick:l??a,children:i("common.close","\uB2EB\uAE30")}):n.jsx(Ce,{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(Ds,{icon:n.jsx(Is,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:g,subText:g==="active"?i("wordData.downloadingCount",{n:uo(d),count:d}):void 0}),n.jsx(Ds,{icon:n.jsx(Bw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:A,pct:w,subText:v}),n.jsx(Ds,{icon:n.jsx(zs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:y,pct:y==="active"?b??0:void 0,subText:void 0})]})})}function Dw({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(null),[s,i]=o.useState(null),u=b=>{let x=null;b==="noise"?x={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}]}:b==="short"?x={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}]}:b==="long"?x={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}]}:b==="order"&&(x={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(x),l(b)},c=o.useCallback(()=>{l(null),i(null)},[]),d=o.useCallback(()=>u("noise"),[]),h=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),f=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:f,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&s?t?.({score:s.score,contextsLength:s.contextsLength,results:s.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=Qy,exports.ActionCard=my,exports.Alert=H2,exports.AppHeader=o2,exports.AudioMeter=qo,exports.AudioPlayer=fs,exports.Avatar=Z2,exports.Badge=Et,exports.BarChart=Vv,exports.BarChartControls=Eu,exports.Board=mv,exports.BottomNav=Vi,exports.BrandIdentity=Yi,exports.BrandLogo=Pv,exports.Breadcrumb=Q2,exports.BulkBar=Nv,exports.Button=Ce,exports.CORE_VERSION=ry,exports.Calendar=d4,exports.CardStep=td,exports.ChartLegend=Po,exports.ChartSection=Io,exports.ChartTotal=Ya,exports.Checkbox=xu,exports.ChoiceChips=yx,exports.CircleBadge=F2,exports.CodeBox=kv,exports.ColorPicker=rv,exports.CompanyMeta=vv,exports.ConfirmPopup=id,exports.ConfirmStep=Jc,exports.ConfirmWithTextStep=Qc,exports.ContrastFilterPanel=Z_,exports.CoreScope=fy,exports.CountTile=cv,exports.CouponInputPopup=Q_,exports.DEFAULT_NOISE_SETTINGS=Qn,exports.DatePicker=$v,exports.DebugResultLauncher=Dw,exports.DescriptionTooltip=Kn,exports.DeviceSideTable=i4,exports.Dialog=hv,exports.Divider=O2,exports.Dropdown=cn,exports.EffectPartyPopper=As,exports.EffectPartyPopperHost=nw,exports.EmptyState=py,exports.ErrorState=hy,exports.FILTER_ALL_VALUE=fn,exports.FileUpload=J2,exports.FilterPanel=En,exports.FilterSectionInfo=Ha,exports.Footer=vx,exports.GameIntro=Gv,exports.Header=Zi,exports.Icon=et,exports.IconGridMenu=bx,exports.IconRenderer=et,exports.InfoTooltip=wn,exports.ItemActions=Dv,exports.LEVEL_MAX=va,exports.LINE_CHART_HOVER_DELAY_MS=Du,exports.LandingBottomSticky=_x,exports.LandingHeader=xx,exports.LineChart=Uv,exports.ListPopup=X_,exports.ListenStep=Xc,exports.Loader=Ga,exports.MARKS=yr,exports.MARK_ICON=Gu,exports.MARK_VARIANT=Ku,exports.MediaQueryOverrideContext=ei,exports.MenuTooltip=Oa,exports.NOISE_RATIO_MAX=Xa,exports.NOISE_RATIO_STEP=_c,exports.NoisePlayerContext=ds,exports.NoiseSettingsTooltip=Hc,exports.NoticeBox=gy,exports.NotifyTextPreview=Rv,exports.OrderListStep=ed,exports.PASS_CARD_BG_VARS=Zn,exports.POS_LABEL=Xu,exports.PROMO_BANNER_BG_COMPONENTS=Ti,exports.PROMO_BANNER_BG_OPTIONS=By,exports.PROMO_BANNER_BG_VARS=Ra,exports.Page=Er,exports.PageTitle=aw,exports.Pagination=mr,exports.Panel=Ar,exports.PanelGrid=c_,exports.PanelRow=Dn,exports.PanelRowDevice=u_,exports.PassCard=su,exports.PassCardBg=$2,exports.PassCardBgIHAB=R2,exports.PassCardBgLeftColorGrid=P2,exports.PassCardBgTwoCircle=tu,exports.PaymentPlan=L2,exports.PersonCard=fv,exports.PhonemeFilterPanel=Y_,exports.PhonemeSelectBlock=G_,exports.Popup=On,exports.ProgressBar=e4,exports.ProgressIndicator=Iu,exports.PromoBanner=Zy,exports.PromoBannerBgDark=gi,exports.PromoBannerBgDeep=di,exports.PromoBannerBgDiagonal=xi,exports.PromoBannerBgDots=wi,exports.PromoBannerBgInstagram=ji,exports.PromoBannerBgMain=oi,exports.PromoBannerBgNaver=Di,exports.PromoBannerBgOutline=ki,exports.PromoBannerBgRadial=yi,exports.PromoBannerBgSoft=li,exports.PromoBannerBgSoftSub=hi,exports.PromoBannerBgSub=ui,exports.PromoBannerBgSuccess=Ni,exports.PromoBannerBgWarm=fi,exports.PublicationCard=gv,exports.Radio=cu,exports.RadioGroup=z2,exports.Rating=tv,exports.ReportDocument=uw,exports.ReportInfoPanel=cw,exports.RingChart=Yv,exports.SENTENCE_TRAINING_TYPES=ls,exports.SearchSummary=U2,exports.Section=Ca,exports.SectionHeadFloat=Bu,exports.SectionHeader=yv,exports.SegmentedControl=bn,exports.ShortcutBadge=uu,exports.SideNav=Ki,exports.Slider=Lu,exports.SoundCompass=I2,exports.SplashLogo=bv,exports.StatChart=Zv,exports.SummaryStrip=lw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=pu,exports.Table=Go,exports.TableFilterPanel=ns,exports.Tabs=G2,exports.TextBoxTooltip=kr,exports.TextField=Xn,exports.Timeline=Cv,exports.Toast=ma,exports.Toggle=vu,exports.Toolbar=Ro,exports.Tooltip=mn,exports.TooltipInfo=wn,exports.TooltipTextBox=kr,exports.TopBanner=Xy,exports.TrainingBlock=h4,exports.TrainingBlockButton=Mo,exports.TrainingBlockGrid=f4,exports.TrainingCard=fw,exports.TrainingCardGroup=Cw,exports.TrainingPagePopup=zn,exports.TrainingPagePopupBottom=Vc,exports.TrainingPagePopupTitle=qc,exports.TrainingResultPopup=od,exports.TrainingStep=ea,exports.TrainingStepAudioPlayer=fs,exports.TrainingStepBullet=$c,exports.TrainingStepCard=Fc,exports.TrainingStepConfirm=gs,exports.TrainingStepConfirmWithText=bs,exports.TrainingStepListen=ys,exports.TrainingStepOrderList=vs,exports.TrainingStepTextBox=Ic,exports.TrainingStepTitle=Pc,exports.TrainingTooltip=hu,exports.TrainingWordCard=Xo,exports.UpdateAlert=mw,exports.WAVE_A_MAX=Rx,exports.WAVE_H1_PX=hs,exports.WAVE_HMAX_PX=$x,exports.WORD_LABEL_I18N_KEYS=k4,exports.WORD_TABLE_PAPER=ga,exports.WORD_TYPE_LABEL=Ju,exports.WordDataProvider=sw,exports.WordDataUpdatePopup=Ew,exports.WordImageTooltip=ld,exports.WordSearchFilterPanel=K_,exports.WordSearchResultBlock=q_,exports.WordTable=ba,exports.WordTableBlock=xw,exports.WordTableButton=_w,exports.WordTablePopup=V4,exports.WordTableThumbnail=pd,exports.buildMonthChartData=Fv,exports.cellKey=J4,exports.cellLabel=X4,exports.cellsForLabels=cx,exports.clearPassCardBgTheme=An,exports.clearPromoBannerBgTheme=Ht,exports.closeTrainingPopup=f_,exports.companyTypeLabel=rw,exports.createTrainingScenario=b_,exports.cx=_e,exports.deriveNoiseContexts=B_,exports.derivePassCard=Ji,exports.draftValues=Cx,exports.effectiveNoiseVolume=us,exports.effectiveSpeechVolume=Bc,exports.expandSlashLabel=ts,exports.formatDuration=dx,exports.getControlDateRange=Kv,exports.getPayloadTimestamp=_s,exports.getPromoBannerBgTheme=vo,exports.getSelectedFromPayload=v_,exports.getSelectedText=x_,exports.getStepPayload=Yc,exports.getSteppedPayload=__,exports.injectPassCardBgTheme=kn,exports.injectPromoBannerBgTheme=Wt,exports.isSelectionCorrect=w_,exports.labelOfCellKey=vc,exports.labelsForSave=Z4,exports.levelToPct=Bx,exports.markAfterClick=Uu,exports.marksForSave=Jo,exports.mergeNoiseSettings=Jn,exports.missesByType=sx,exports.monthKeyOf=Za,exports.monthKeyOfDate=Fo,exports.nextFocus=nx,exports.nextMisses=ox,exports.noiseElementVolume=cs,exports.noiseRatioOf=Ja,exports.pageStartIndexes=Yu,exports.parseMonthKey=ha,exports.passCardBgIhabTheme=lu,exports.passCardBgLeftColorGridTheme=iu,exports.passCardBgTwoCircleTheme=eu,exports.pctToLevel=kx,exports.posLabels=Qu,exports.printWordTable=x4,exports.promoBannerBgDarkTheme=Ci,exports.promoBannerBgDeepTheme=ci,exports.promoBannerBgDiagonalTheme=vi,exports.promoBannerBgDotsTheme=_i,exports.promoBannerBgInstagramTheme=Si,exports.promoBannerBgMainTheme=ri,exports.promoBannerBgNaverTheme=Ei,exports.promoBannerBgOutlineTheme=Bi,exports.promoBannerBgRadialTheme=bi,exports.promoBannerBgSoftSubTheme=pi,exports.promoBannerBgSoftTheme=si,exports.promoBannerBgSubTheme=ii,exports.promoBannerBgSuccessTheme=Ai,exports.promoBannerBgWarmTheme=mi,exports.recommendTables=ix,exports.regenerateUnpinned=fx,exports.removeItem=mx,exports.resolveTrainingItems=g_,exports.resolveTrainingPopupMeta=Gc,exports.reviewCells=U4,exports.reviewMeta=Y4,exports.reviewSetPlan=lx,exports.reviewTableName=K4,exports.scoreKey=br,exports.scoreSheetHeader=Q4,exports.shouldConfirmDiscard=v4,exports.splitTrainingVariants=C_,exports.summarize=y4,exports.summarizeMisses=rx,exports.tableTrends=tx,exports.toDraft=px,exports.toTrainingText=y_,exports.togglePin=hx,exports.uncoveredLabels=ux,exports.useAnchoredMenu=Fa,exports.useBarChartControl=Nu,exports.useCalendarMonth=_u,exports.useComboboxSuggestions=bu,exports.useDiscardGuard=J_,exports.useFitScale=nc,exports.useNoisePlayer=xr,exports.useSoundCompassExam=Wy,exports.useToastLifecycle=Ru,exports.useWordData=ow,exports.useWordTableDisplaySettings=bc,exports.useWordTablePrint=ss,exports.waveBarPx=wr,exports.waveBarVal=Br,exports.weakItems=ex,exports.weekValueOf=Oo,exports.withStepTimes=Kc,exports.wordTypeLabels=ec;
1080
+ */const kw=[["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"}]],Aw=te("circle-x",kw);function Nw(e){return{idle:0,"word-download":1,"image-list":2,"image-match":2,"pair-build":3,done:4}[e]??0}function Ds({icon:e,label:t,state:a,pct:r,subText:l}){const{t:s}=xe.useTranslation(),i=a==="done",u=a==="pending",c=a==="error",d=i?100:r??0;return n.jsxs("div",{className:"wdup-phase-card",children:[n.jsx("div",{className:`wdup-phase-card__icon${i?" wdup-phase-card__icon--done":c?" wdup-phase-card__icon--error":""}`,children:i?n.jsx(Hs,{size:22,color:"white",strokeWidth:2.5}):c?n.jsx(Aw,{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(Et,{variant:"sub",fill:"soft",size:"small",label:s("common.done","\uC644\uB8CC")}):c?n.jsx(Et,{variant:"danger",fill:"soft",size:"small",label:s("common.failed","\uC2E4\uD328")}):(l||r!==void 0)&&n.jsxs("span",{className:"wdup-phase-card__sub body-3",children:[l,l&&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 Ew({title:e,progress:t,onDone:a,onRetry:r,onClose:l,inline:s}){const{t:i}=xe.useTranslation(),{phase:u,error:c,wordCount:d,imagePage:h,imageDone:p,imageTotal:f,pairPercent:b}=t,x=Nw(u),C=u==="done",m=!!c;function _(B){return m&&x===B?"error":x>B?"done":x===B?"active":"pending"}const g=_(1),A=_(2),y=_(3),w=u==="image-match"&&f?Math.round((p??0)/f*100):void 0,v=o.useMemo(()=>{if(A!=="done"){if(u==="image-list")return i("wordData.checkingPage",{page:h??1});if(u==="image-match"&&f)return i("wordData.imageCount",{done:uo(p),total:uo(f)})}},[A,u,h,f,p,i]);return n.jsx(On,{inline:s,className:"popup--word-data-update",title:e,footer:m&&r?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:r,children:i("common.retry","\uB2E4\uC2DC \uC2DC\uB3C4")}):m?n.jsx(fe,{htmlType:"button",size:56,variant:"main",onClick:l??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(Ds,{icon:n.jsx(Is,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseWordDownload","\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC"),state:g,subText:g==="active"?i("wordData.downloadingCount",{n:uo(d),count:d}):void 0}),n.jsx(Ds,{icon:n.jsx(Bw,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phaseImageCheck","\uC774\uBBF8\uC9C0 \uD655\uC778"),state:A,pct:w,subText:v}),n.jsx(Ds,{icon:n.jsx(zs,{size:22,color:"var(--color-main, #29b6c8)",strokeWidth:1.8}),label:i("wordData.phasePairAnalysis","\uB2E8\uC5B4\uC30D \uBD84\uC11D"),state:y,pct:y==="active"?b??0:void 0,subText:void 0})]})})}function Dw({enabled:e=!1,renderResultPopup:t}={}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(null),[s,i]=o.useState(null),u=b=>{let x=null;b==="noise"?x={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}]}:b==="short"?x={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}]}:b==="long"?x={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}]}:b==="order"&&(x={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(x),l(b)},c=o.useCallback(()=>{l(null),i(null)},[]),d=o.useCallback(()=>u("noise"),[]),h=o.useCallback(()=>u("short"),[]),p=o.useCallback(()=>u("long"),[]),f=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:f,children:a("debug.showResult",{type:"Order",defaultValue:"{{type}} \uACB0\uACFC\uBCF4\uAE30"})})]}),r&&s?t?.({score:s.score,contextsLength:s.contextsLength,results:s.results,onReplay:c,onClose:c}):null]}):null}exports.Accordion=Qy,exports.ActionCard=my,exports.Alert=H2,exports.AppHeader=o2,exports.AudioMeter=qo,exports.AudioPlayer=fs,exports.Avatar=Z2,exports.Badge=Et,exports.BarChart=Vv,exports.BarChartControls=Eu,exports.Board=mv,exports.BottomNav=Vi,exports.BrandIdentity=Yi,exports.BrandLogo=Pv,exports.Breadcrumb=Q2,exports.BulkBar=Nv,exports.Button=fe,exports.CORE_VERSION=ry,exports.Calendar=d4,exports.CardStep=td,exports.ChartLegend=Po,exports.ChartSection=Io,exports.ChartTotal=Ya,exports.Checkbox=xu,exports.ChoiceChips=yx,exports.CircleBadge=F2,exports.CodeBox=kv,exports.ColorPicker=rv,exports.CompanyMeta=vv,exports.ConfirmPopup=id,exports.ConfirmStep=Jc,exports.ConfirmWithTextStep=Qc,exports.ContrastFilterPanel=Z_,exports.CoreScope=fy,exports.CountTile=cv,exports.CouponInputPopup=Q_,exports.DEFAULT_NOISE_SETTINGS=Qn,exports.DatePicker=$v,exports.DebugResultLauncher=Dw,exports.DescriptionTooltip=Kn,exports.DeviceSideTable=i4,exports.Dialog=hv,exports.Divider=O2,exports.Dropdown=cn,exports.EffectPartyPopper=As,exports.EffectPartyPopperHost=nw,exports.EmptyState=py,exports.ErrorState=hy,exports.FILTER_ALL_VALUE=fn,exports.FileUpload=J2,exports.FilterPanel=En,exports.FilterSectionInfo=Ha,exports.Footer=vx,exports.GameIntro=Gv,exports.Header=Zi,exports.Icon=Qe,exports.IconGridMenu=bx,exports.IconRenderer=Qe,exports.InfoTooltip=wn,exports.ItemActions=Dv,exports.LEVEL_MAX=va,exports.LINE_CHART_HOVER_DELAY_MS=Du,exports.LandingBottomSticky=_x,exports.LandingHeader=xx,exports.LineChart=Uv,exports.ListPopup=X_,exports.ListenStep=Xc,exports.Loader=Ga,exports.MARKS=yr,exports.MARK_ICON=Gu,exports.MARK_VARIANT=Ku,exports.MediaQueryOverrideContext=ei,exports.MenuTooltip=Oa,exports.NOISE_RATIO_MAX=Xa,exports.NOISE_RATIO_STEP=_c,exports.NoisePlayerContext=ds,exports.NoiseSettingsTooltip=Hc,exports.NoticeBox=gy,exports.NotifyTextPreview=Rv,exports.OrderListStep=ed,exports.PASS_CARD_BG_VARS=Zn,exports.POS_LABEL=Xu,exports.PROMO_BANNER_BG_COMPONENTS=Ti,exports.PROMO_BANNER_BG_OPTIONS=By,exports.PROMO_BANNER_BG_VARS=Ra,exports.Page=Er,exports.PageTitle=aw,exports.Pagination=mr,exports.Panel=Ar,exports.PanelGrid=c_,exports.PanelRow=Dn,exports.PanelRowDevice=u_,exports.PassCard=su,exports.PassCardBg=$2,exports.PassCardBgIHAB=R2,exports.PassCardBgLeftColorGrid=P2,exports.PassCardBgTwoCircle=tu,exports.PaymentPlan=L2,exports.PersonCard=fv,exports.PhonemeFilterPanel=Y_,exports.PhonemeSelectBlock=G_,exports.Popup=On,exports.ProgressBar=e4,exports.ProgressIndicator=Iu,exports.PromoBanner=Zy,exports.PromoBannerBgDark=gi,exports.PromoBannerBgDeep=di,exports.PromoBannerBgDiagonal=xi,exports.PromoBannerBgDots=wi,exports.PromoBannerBgInstagram=ji,exports.PromoBannerBgMain=oi,exports.PromoBannerBgNaver=Di,exports.PromoBannerBgOutline=ki,exports.PromoBannerBgRadial=yi,exports.PromoBannerBgSoft=li,exports.PromoBannerBgSoftSub=hi,exports.PromoBannerBgSub=ui,exports.PromoBannerBgSuccess=Ni,exports.PromoBannerBgWarm=fi,exports.PublicationCard=gv,exports.Radio=cu,exports.RadioGroup=z2,exports.Rating=tv,exports.ReportDocument=uw,exports.ReportInfoPanel=cw,exports.RingChart=Yv,exports.SENTENCE_TRAINING_TYPES=ls,exports.SearchSummary=U2,exports.Section=Ca,exports.SectionHeadFloat=Bu,exports.SectionHeader=yv,exports.SegmentedControl=bn,exports.ShortcutBadge=uu,exports.SideNav=Ki,exports.Slider=Lu,exports.SoundCompass=I2,exports.SplashLogo=bv,exports.StatChart=Zv,exports.SummaryStrip=lw,exports.TRAINING_TOOLTIP_HOVER_DELAY_MS=pu,exports.Table=Go,exports.TableFilterPanel=ns,exports.Tabs=G2,exports.TextBoxTooltip=kr,exports.TextField=Xn,exports.Timeline=Cv,exports.Toast=ma,exports.Toggle=vu,exports.Toolbar=Ro,exports.Tooltip=mn,exports.TooltipInfo=wn,exports.TooltipTextBox=kr,exports.TopBanner=Xy,exports.TrainingBlock=h4,exports.TrainingBlockButton=Mo,exports.TrainingBlockGrid=f4,exports.TrainingCard=fw,exports.TrainingCardGroup=Cw,exports.TrainingPagePopup=zn,exports.TrainingPagePopupBottom=Vc,exports.TrainingPagePopupTitle=qc,exports.TrainingResultPopup=od,exports.TrainingStep=ea,exports.TrainingStepAudioPlayer=fs,exports.TrainingStepBullet=$c,exports.TrainingStepCard=Fc,exports.TrainingStepConfirm=gs,exports.TrainingStepConfirmWithText=bs,exports.TrainingStepListen=ys,exports.TrainingStepOrderList=vs,exports.TrainingStepTextBox=Ic,exports.TrainingStepTitle=Pc,exports.TrainingTooltip=hu,exports.TrainingWordCard=Xo,exports.UpdateAlert=mw,exports.WAVE_A_MAX=Rx,exports.WAVE_H1_PX=hs,exports.WAVE_HMAX_PX=$x,exports.WORD_LABEL_I18N_KEYS=k4,exports.WORD_TABLE_PAPER=ga,exports.WORD_TYPE_LABEL=Ju,exports.WordDataProvider=sw,exports.WordDataUpdatePopup=Ew,exports.WordImageTooltip=ld,exports.WordSearchFilterPanel=K_,exports.WordSearchResultBlock=q_,exports.WordTable=ba,exports.WordTableBlock=xw,exports.WordTableButton=_w,exports.WordTablePopup=V4,exports.WordTableThumbnail=pd,exports.buildMonthChartData=Fv,exports.cellKey=J4,exports.cellLabel=X4,exports.cellsForLabels=cx,exports.clearPassCardBgTheme=An,exports.clearPromoBannerBgTheme=Ht,exports.closeTrainingPopup=f_,exports.companyTypeLabel=rw,exports.createTrainingScenario=b_,exports.cx=_e,exports.deriveNoiseContexts=B_,exports.derivePassCard=Ji,exports.draftValues=Cx,exports.effectiveNoiseVolume=us,exports.effectiveSpeechVolume=Bc,exports.expandSlashLabel=ts,exports.formatDuration=dx,exports.getControlDateRange=Kv,exports.getPayloadTimestamp=_s,exports.getPromoBannerBgTheme=vo,exports.getSelectedFromPayload=v_,exports.getSelectedText=x_,exports.getStepPayload=Yc,exports.getSteppedPayload=__,exports.injectPassCardBgTheme=kn,exports.injectPromoBannerBgTheme=Wt,exports.isSelectionCorrect=w_,exports.labelOfCellKey=vc,exports.labelsForSave=Z4,exports.levelToPct=Bx,exports.markAfterClick=Uu,exports.marksForSave=Jo,exports.mergeNoiseSettings=Jn,exports.missesByType=sx,exports.monthKeyOf=Za,exports.monthKeyOfDate=Fo,exports.nextFocus=nx,exports.nextMisses=ox,exports.noiseElementVolume=cs,exports.noiseRatioOf=Ja,exports.pageStartIndexes=Yu,exports.parseMonthKey=ha,exports.passCardBgIhabTheme=lu,exports.passCardBgLeftColorGridTheme=iu,exports.passCardBgTwoCircleTheme=eu,exports.pctToLevel=kx,exports.posLabels=Qu,exports.printWordTable=x4,exports.promoBannerBgDarkTheme=Ci,exports.promoBannerBgDeepTheme=ci,exports.promoBannerBgDiagonalTheme=vi,exports.promoBannerBgDotsTheme=_i,exports.promoBannerBgInstagramTheme=Si,exports.promoBannerBgMainTheme=ri,exports.promoBannerBgNaverTheme=Ei,exports.promoBannerBgOutlineTheme=Bi,exports.promoBannerBgRadialTheme=bi,exports.promoBannerBgSoftSubTheme=pi,exports.promoBannerBgSoftTheme=si,exports.promoBannerBgSubTheme=ii,exports.promoBannerBgSuccessTheme=Ai,exports.promoBannerBgWarmTheme=mi,exports.recommendTables=ix,exports.regenerateUnpinned=fx,exports.removeItem=mx,exports.resolveTrainingItems=g_,exports.resolveTrainingPopupMeta=Gc,exports.reviewCells=U4,exports.reviewMeta=Y4,exports.reviewSetPlan=lx,exports.reviewTableName=K4,exports.scoreKey=br,exports.scoreSheetHeader=Q4,exports.shouldConfirmDiscard=v4,exports.splitTrainingVariants=C_,exports.summarize=y4,exports.summarizeMisses=rx,exports.tableTrends=tx,exports.toDraft=px,exports.toTrainingText=y_,exports.togglePin=hx,exports.uncoveredLabels=ux,exports.useAnchoredMenu=Fa,exports.useBarChartControl=Nu,exports.useCalendarMonth=_u,exports.useComboboxSuggestions=bu,exports.useDiscardGuard=J_,exports.useFitScale=nc,exports.useNoisePlayer=xr,exports.useSoundCompassExam=Wy,exports.useToastLifecycle=Ru,exports.useWordData=ow,exports.useWordTableDisplaySettings=bc,exports.useWordTablePrint=ss,exports.waveBarPx=wr,exports.waveBarVal=Br,exports.weakItems=ex,exports.weekValueOf=Oo,exports.withStepTimes=Kc,exports.wordTypeLabels=ec;