@rainbow-robotics/preview-host 1.3.8-dev.2 → 1.3.8-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AmrCapabilityControl.C4xiLjRl.js → AmrCapabilityControl.DP3e5iv2.js} +1 -1
- package/dist/assets/{RbLocalizationProvider.DXsc16pV.js → RbLocalizationProvider.s0vAzBAv.js} +1 -1
- package/dist/assets/{__federation_expose_App.BMXng8Ke.js → __federation_expose_App.Bqy6IUtK.js} +233 -233
- package/dist/assets/__federation_fn_import.DdkEuT6t.js +2 -2
- package/dist/assets/{cssMode.DSgEs3Fy.js → cssMode.D4goIV7A.js} +1 -1
- package/dist/assets/{freemarker2.Di820O1V.js → freemarker2.CLWibmwl.js} +1 -1
- package/dist/assets/{handlebars.8PwOoFy6.js → handlebars.rFBV_WV6.js} +1 -1
- package/dist/assets/{html.400C3t45.js → html.BXMRa22D.js} +1 -1
- package/dist/assets/{htmlMode.CRheDnup.js → htmlMode.pCIx3J4F.js} +1 -1
- package/dist/assets/{index.1ZV6DMoI.js → index.BTuqSe0A.js} +1 -1
- package/dist/assets/{index.BP0yBo-w.js → index.CCNNHbaO.js} +1 -1
- package/dist/assets/{index.Da-y1HNK.js → index.DnZ5v4VN.js} +1 -1
- package/dist/assets/{javascript.DXPB8Jbo.js → javascript.BlAITfvZ.js} +1 -1
- package/dist/assets/{jsonMode.DVz0aIDE.js → jsonMode.CWsT0d9H.js} +1 -1
- package/dist/assets/{liquid.BP9dP7-Z.js → liquid.DzklPy6U.js} +1 -1
- package/dist/assets/{lspLanguageFeatures.CpNhcIHE.js → lspLanguageFeatures.BUHVArVi.js} +1 -1
- package/dist/assets/{mdx.KhufbQQF.js → mdx.gSxxtcy7.js} +1 -1
- package/dist/assets/{python.C94rM7lW.js → python.Ch5alZKK.js} +1 -1
- package/dist/assets/{razor.DPjaPBcH.js → razor.DUJoRHtn.js} +1 -1
- package/dist/assets/remoteEntry.js +1 -1
- package/dist/assets/{tsMode.idfXhycx.js → tsMode.C5Hwpu7Y.js} +1 -1
- package/dist/assets/{typescript.Bg1XCf6a.js → typescript.CsgNHoEz.js} +1 -1
- package/dist/assets/{useFileDownload.CmIfPP9S.js → useFileDownload.B-U2izPN.js} +1 -1
- package/dist/assets/{xml.Bg1Kn9mk.js → xml.ywFLMI46.js} +1 -1
- package/dist/assets/{yaml.DJnG9bGb.js → yaml.CnUGE33H.js} +1 -1
- package/dist/index.html +5 -5
- package/package.json +1 -1
package/dist/assets/{RbLocalizationProvider.DXsc16pV.js → RbLocalizationProvider.s0vAzBAv.js}
RENAMED
|
@@ -268,7 +268,7 @@ Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),r.put(a,13)}},w2=n,w
|
|
|
268
268
|
The chosen QR Code version cannot contain this amount of data.
|
|
269
269
|
Minimum version required to store current data is: `+L+`.
|
|
270
270
|
`);const B=x(O,$,M),F=t.getSymbolSize(O),N=new r(F);return v(N,O),g(N),w(N,O),_(N,$,0),O>=7&&y(N,O),S(N,B),isNaN(A)&&(A=i.getBestMask(N,_.bind(null,N,$))),i.applyMask(A,N),_(N,$,A),{modules:N,version:O,errorCorrectionLevel:$,maskPattern:A,segments:M}}return t2.create=function(O,$){if(typeof O>"u"||O==="")throw new Error("No input text");let A=e.M,M,L;return typeof $<"u"&&(A=e.from($.errorCorrectionLevel,e.M),M=u.from($.version),L=i.from($.maskPattern),$.toSJISFunc&&t.setToSJISFunction($.toSJISFunc)),R(O,M,A,L)},t2}var y2={},_2={},Tx;function gk(){return Tx||(Tx=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(a){return[a,a]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,a=r.width&&r.width>=21?r.width:void 0,i=r.scale||4;return{width:a,scale:a?4:i,margin:o,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},t.getImageWidth=function(r,o){const a=t.getScale(r,o);return Math.floor((r+o.margin*2)*a)},t.qrToImageData=function(r,o,a){const i=o.modules.size,s=o.modules.data,l=t.getScale(i,a),u=Math.floor((i+a.margin*2)*l),d=a.margin*l,f=[a.color.light,a.color.dark];for(let m=0;m<u;m++)for(let v=0;v<u;v++){let g=(m*u+v)*4,w=a.color.light;if(m>=d&&v>=d&&m<u-d&&v<u-d){const y=Math.floor((m-d)/l),_=Math.floor((v-d)/l);w=f[s[y*i+_]?1:0]}r[g++]=w.r,r[g++]=w.g,r[g++]=w.b,r[g]=w.a}}})(_2)),_2}var Nx;function Cle(){return Nx||(Nx=1,(function(t){const e=gk();function n(o,a,i){o.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=i,a.width=i,a.style.height=i+"px",a.style.width=i+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(a,i,s){let l=s,u=i;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),i||(u=r()),l=e.getOptions(l);const d=e.getImageWidth(a.modules.size,l),f=u.getContext("2d"),m=f.createImageData(d,d);return e.qrToImageData(m.data,a,l),n(f,u,d),f.putImageData(m,0,0),u},t.renderToDataURL=function(a,i,s){let l=s;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),l||(l={});const u=t.render(a,i,l),d=l.type||"image/png",f=l.rendererOpts||{};return u.toDataURL(d,f.quality)}})(y2)),y2}var x2={},Px;function Ele(){if(Px)return x2;Px=1;const t=gk();function e(o,a){const i=o.a/255,s=a+'="'+o.hex+'"';return i<1?s+" "+a+'-opacity="'+i.toFixed(2).slice(1)+'"':s}function n(o,a,i){let s=o+a;return typeof i<"u"&&(s+=" "+i),s}function r(o,a,i){let s="",l=0,u=!1,d=0;for(let f=0;f<o.length;f++){const m=Math.floor(f%a),v=Math.floor(f/a);!m&&!u&&(u=!0),o[f]?(d++,f>0&&m>0&&o[f-1]||(s+=u?n("M",m+i,.5+v+i):n("m",l,0),l=0,u=!1),m+1<a&&o[f+1]||(s+=n("h",d),d=0)):l++}return s}return x2.render=function(a,i,s){const l=t.getOptions(i),u=a.modules.size,d=a.modules.data,f=u+l.margin*2,m=l.color.light.a?"<path "+e(l.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",v="<path "+e(l.color.dark,"stroke")+' d="'+r(d,u,l.margin)+'"/>',g='viewBox="0 0 '+f+" "+f+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+g+' shape-rendering="crispEdges">'+m+v+`</svg>
|
|
271
|
-
`;return typeof s=="function"&&s(null,y),y},x2}var Ax;function Mle(){if(Ax)return jc;Ax=1;const t=ile(),e=Sle(),n=Cle(),r=Ele();function o(a,i,s,l,u){const d=[].slice.call(arguments,1),f=d.length,m=typeof d[f-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(f<2)throw new Error("Too few arguments provided");f===2?(u=s,s=i,i=l=void 0):f===3&&(i.getContext&&typeof u>"u"?(u=l,l=void 0):(u=l,l=s,s=i,i=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(s=i,i=l=void 0):f===2&&!i.getContext&&(l=s,s=i,i=void 0),new Promise(function(v,g){try{const w=e.create(s,l);v(a(w,i,l))}catch(w){g(w)}})}try{const v=e.create(s,l);u(null,a(v,i,l))}catch(v){u(v)}}return jc.create=e.create,jc.toCanvas=o.bind(null,n.render),jc.toDataURL=o.bind(null,n.renderToDataURL),jc.toString=o.bind(null,function(a,i,s){return r.render(a,s)}),jc}Mle();const{useCallback:ive,useEffect:sve,useState:lve}=await q("react"),{useCallback:cve,useEffect:uve,useId:dve,useRef:fve,useState:pve}=await q("react"),{useCallback:hve,useEffect:mve,useId:gve,useRef:vve,useState:wve}=await q("react"),kle="_selected_621ky_62",Rle={"inbox-pagination":"_inbox-pagination_621ky_41","pagination-page":"_pagination-page_621ky_54",selected:kle,"pagination-next":"_pagination-next_621ky_65","pagination-prev":"_pagination-prev_621ky_65","pagination-next-double":"_pagination-next-double_621ky_65","pagination-prev-double":"_pagination-prev-double_621ky_65"},{useMemo:gd}=await q("react"),Hc=rn(Rle),bve=({className:t,currPage:e=1,listSize:n=20,pageSize:r=5,totalCount:o=0,handlePageChange:a})=>{const i=gd(()=>{const f=o/n;return f%1===0?f:Math.floor(f)+1},[n,o]),s=gd(()=>Array.from({length:o},(f,m)=>Array.from({length:r},(v,g)=>m*r+g+1)),[r,o]),l=gd(()=>(s.find(f=>f.includes(e))??[]).filter(f=>f<=i),[e,s,i]),u=gd(()=>{const f=l[0]??1;return Math.max(1,f-1)},[l]),d=gd(()=>{const f=l[l.length-1]??i;return Math.min(i,f+1)},[l,i]);return te("ul",{className:Hc(t,"inbox-pagination"),children:[h("li",{children:h("button",{className:Hc("pagination-prev-double"),type:"button",disabled:e===1,onClick:()=>a(u),children:h(d$,{})})}),h("li",{children:h("button",{className:Hc("pagination-prev"),type:"button",disabled:e===1,onClick:()=>a(e-1),children:h(p$,{})})}),l.map(f=>h("li",{children:h("button",{className:Hc("pagination-page",e===f&&"selected"),type:"button",onClick:()=>a(f),children:f})},f)),h("li",{children:h("button",{className:Hc("pagination-next"),type:"button",disabled:!(e<i),onClick:()=>a(e+1),children:h(h$,{})})}),h("li",{children:h("button",{className:Hc("pagination-next-double"),type:"button",disabled:e===i,onClick:()=>a(d),children:h(f$,{})})})]})},{useEffect:yve,useRef:_ve,useState:xve}=await q("react"),Tle="_inner_16agd_43",Nle="_left_16agd_50",Ple="_right_16agd_53",Ale="_disabled_16agd_87",Ile={"joystick-with-buttons":"_joystick-with-buttons_16agd_40",inner:Tle,left:Nle,right:Ple,"btn-group":"_btn-group_16agd_61","btn-group-item":"_btn-group-item_16agd_69",disabled:Ale,"joy-stick-container":"_joy-stick-container_16agd_95","joy-stick":"_joy-stick_16agd_95","hide-joystick":"_hide-joystick_16agd_110","transition-disabled":"_transition-disabled_16agd_115"},{useCallback:Ole,useEffect:Ix,useMemo:Ox,useRef:S2,useState:Lx}=await q("react"),Wc=rn(Ile),Sve=({className:t,joystickType:e,disableDiagonal:n,xOnly:r,yOnly:o,buttonsDirection:a,buttons:i,hideJoystick:s,onJoystickMove:l})=>{const u=S2(null),d=S2([]),f=S2({timeoutId:[],animationFrameId:[]}),{isMobile:m,isSmallTablet:v}=s3(),[g,w]=Lx(!s),[y,_]=Lx(!1),S=Ox(()=>{const $=i?.length??0;return $>=4?{oneObjectDeg:35,initDeg:a==="left"?-5:5}:$===3?{oneObjectDeg:40,initDeg:a==="left"?15:-15}:{oneObjectDeg:45,initDeg:a==="left"?25:-25}},[i?.length,a]),x=Ox(()=>m?80:v?100:110,[m,v]),C=$=>{_(!0),l?.({isMoving:!0,type:e,data:$})},R=$=>{l?.({isMoving:!0,type:e,data:$})},P=$=>{_(!1),l?.({isMoving:!1,type:e,data:$})},O=Ole(({oneObjectDeg:$,initDeg:A})=>{if(!u.current)return;const M=u.current.getBoundingClientRect(),L=M.width/2,B=M.height/2,F=M.width/2;s?(f.current.animationFrameId.forEach(N=>{cancelAnimationFrame(N)}),f.current.timeoutId.forEach(N=>{clearTimeout(N)}),d.current?.forEach((N,V)=>{if(!N)return;const z=N,I=z.offsetWidth,D=20;z&&(a==="left"?(z.style.left=`${I*V+D*(V+1)}px`,z.style.transform="translateY(-100%)"):(z.style.left=`calc(100% - ${I*V+D*(V+1)}px)`,z.style.transform="translateX(-100%) translateY(-100%)"),z.style.top=`calc(100% - ${D}px)`,z.style.transition="",z.style.opacity="1")})):d.current?.forEach((N,V)=>{const z=N;if(z){const I=(A-90)*(Math.PI/180),D=a==="left"?(A-90+V*$)*(Math.PI/180):(A-90-V*$)*(Math.PI/180);let U=I,Y=.1,oe=.06;const Q=.85,re=.02,le=L+Math.cos(I)*F,ee=B+Math.sin(I)*F;z.style.position="absolute",z.style.left=`${le-z.clientWidth/2}px`,z.style.top=`${ee-z.clientHeight/2}px`,z.style.opacity=`${Y}`,z.style.transform="scale(0.98)";const ne=()=>{if(s)return;const ue=D-U;oe+=ue*re,oe*=Q,U+=oe,Y+=.03,Y=Math.min(Y,1);const ve=.98+(1-Math.abs(ue)/Math.PI)*.02,we=L+Math.cos(U)*F,ye=B+Math.sin(U)*F;z.style.left=`${we-z.clientWidth/2}px`,z.style.top=`${ye-z.clientHeight/2}px`,z.style.opacity=`${Y}`,z.style.transform=`scale(${ve})`,z.style.transition="none",Math.abs(ue)>.002||Math.abs(oe)>.002?f.current.animationFrameId[V]=requestAnimationFrame(ne):(z.style.opacity="1",z.style.transform="scale(1)",z.style.transition="")};f.current.timeoutId[V]=window.setTimeout(()=>{f.current.animationFrameId[V]=requestAnimationFrame(ne)},V*60)}})},[s,a]);return Ix(()=>{O(S)},[O,S,x]),Ix(()=>{setTimeout(()=>{w(!0)},200)},[]),h("div",{className:Wc(t,"joystick-with-buttons",{"hide-joystick":s,"transition-disabled":!g}),children:te("div",{className:Wc("inner",a),children:[h("div",{ref:u,className:Wc("btn-group"),children:i?.map(($,A)=>h("div",{ref:M=>{d.current[A]=M},className:Wc("btn-group-item",{disabled:y}),onClick:M=>{M.stopPropagation()},children:$.element},A))}),h("div",{className:Wc("joy-stick-container"),style:{width:x,height:x},children:h(tle,{className:Wc("joy-stick"),type:e,size:x,disableDiagonal:n,xOnly:r,yOnly:o,paddingSize:30,keepMoveEventInterval:200,onStart:C,onMove:R,onEnd:P})})]})})},Lle=({className:t,containerId:e,open:n,onOpenChange:r,title:o,content:a,buttonText:i="확인",buttonClassName:s,snapshotCnt:l,resolve:u,onConfirm:d})=>{const f=()=>{u(!0),d?.()};return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:n,onOpenChange:r,type:"dialog",dialogContainer:e?document.getElementById(e):void 0,snapshotCnt:l,hideCloseButton:!0,enableDimClose:!1,header:o?{title:o}:void 0,footer:h(Ah,{className:ae("h-[2.5rem] text-[1rem] font-medium",s),onClick:f,children:i}),children:h("div",{className:"whitespace-pre-wrap",children:a})})},{useState:$le}=await q("react"),Dle=({className:t,open:e,onOpenChange:n,title:r,content:o,buttonText:a={yes:"확인",no:"취소"},buttonClassName:i,buttonWrapperClassName:s,snapshotCnt:l,containerId:u,onConfirm:d,onCancel:f,resolve:m})=>{const[v,g]=$le(!1),w=async()=>{g(!0);try{await d?.(),m(!0)}finally{g(!1)}},y=()=>{f?.(),m(!1)};return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:l,dialogContainer:u?document.getElementById(u):void 0,hideCloseButton:!0,enableDimClose:!1,header:r?{title:r}:void 0,footer:te(Yo,{className:ae("btn-wrapper",s),alignItems:"center",gap:8,children:[h(fk,{className:ae("h-[2.5rem] px-[1rem] text-[1rem] font-medium",i?.no),onClick:y,children:a.no}),h(Ah,{className:ae("h-[2.5rem] px-[1rem] text-[1rem] font-medium",i?.yes),autoFocus:!0,onClick:w,loading:v,children:a.yes})]}),children:h("div",{className:"text-default text-center whitespace-pre-wrap",children:o})})},{cloneElement:Ble,useState:zle}=await q("react"),Fle=({className:t,open:e,onOpenChange:n,title:r,content:o,placeholder:a,inputType:i="text",inputElement:s,autoFocus:l=!1,value:u,buttonText:d={yes:"확인",no:"취소"},buttonClassName:f,buttonWrapperClassName:m,containerId:v,snapshotCnt:g,resolve:w,close:y})=>{const[_,S]=zle(u||"");return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:g,dialogContainer:v?document.getElementById(v):void 0,hideCloseButton:!0,enableDimClose:!1,header:r?{title:r}:void 0,footer:te(Yo,{className:ae("btn-wrapper",m),alignItems:"center",gap:8,children:[h(fk,{className:ae("h-[2.5rem] text-[1rem] font-medium",f?.no),onClick:()=>y(),children:d.no}),h(Ah,{className:ae("h-[2.5rem] text-[1rem] font-medium",f?.yes),onClick:()=>w(_),children:d.yes})]}),children:te(Ul,{gap:16,children:[h("div",{children:o}),s?Ble(s,{value:_,handleChange:S,tabIndex:l?0:-1,placeholder:a,type:i}):h(ek,{className:ae("w-full"),type:i,tabIndex:l?0:-1,placeholder:a,value:_,handleChange:S})]})})},{useMemo:Cve}=await q("react"),Vle="_spin_tbvd8_59",jle={"count-down":"_count-down_tbvd8_40","count-down-text":"_count-down-text_tbvd8_45","count-down-refresh-img":"_count-down-refresh-img_tbvd8_49",spin:Vle},{useRef:C2,useCallback:vd,useEffect:Hle,useState:Wle,forwardRef:qle,useImperativeHandle:Ule}=await q("react"),E2=rn(jle),Yle=qle(({className:t,remainSeconds:e=10,initialPlay:n,loop:r,refreshIconClassName:o,textClassName:a,onStart:i,onComplete:s},l)=>{const u=C2(null),d=C2(null),f=C2(e),[m,v]=Wle(!1),g=vd(x=>{x<0||(f.current=x,d.current.textContent=x.toString())},[]),w=vd(()=>{g(e)},[e,g]),y=vd(()=>{u.current&&window.clearInterval(u.current)},[]),_=vd(()=>{u.current&&window.clearInterval(u.current),f.current===e&&i?.(),u.current=window.setInterval(()=>{g(f.current-1),f.current<=0&&(r?(v(!0),setTimeout(()=>{v(!1)},1e3),w()):y(),s?.())},1e3)},[r,e,i,s,w,y,g]),S=vd(()=>{v(!0),setTimeout(()=>{v(!1)},1e3),w(),_()},[w,_]);return Hle(()=>(d.current.textContent=f.current.toString(),n&&_(),()=>{u.current&&window.clearInterval(u.current)}),[]),Ule(l,()=>({restart:S,stop:y,start:_,reset:w})),h(Yo,{className:E2(t,"count-down"),justifyContent:"center",alignItems:"center",children:te("button",{onClick:S,children:[h(Hq,{className:E2("count-down-refresh-img",o,{spin:m})}),h("span",{ref:d,className:E2("count-down-text",a)})]})})});Yle.displayName="CountDown";const $x=5177,Gle=()=>{if(typeof window>"u")return"";const t=window.__RB_ASSETS_BASE_URL__;if(t)return t;const{protocol:e,hostname:n}=window.location;return e==="file:"||!n?`http://127.0.0.1:${$x}`:`${e}//${n}:${$x}`},C3=t=>{const e=t.startsWith("/")?t:`/${t}`;return`${Gle()}${e}`},Dx=t=>C3(`/imgs${t.startsWith("/")?t:`/${t}`}`),Eve=t=>C3(`/models${t}`),Mve=t=>C3(`/data/joint${t}`),{useEffect:kve}=await q("react"),Kle="_readonly_1w1i8_46",Xle="_input_1w1i8_49",Zle={"side-number-input":"_side-number-input_1w1i8_40",readonly:Kle,"number-btn":"_number-btn_1w1i8_46",input:Xle},{forwardRef:Qle,useCallback:pa,useEffect:wd,useImperativeHandle:Jle,useMemo:ece,useRef:qa,useState:Bx}=await q("react"),i1=rn(Zle,"rb-ui"),tce=t=>{const e=t?.target?.value;return kn.replace(e,/^0+[\d,]/gm,o=>kn.last(o)).replace(/[^\d.-]/g,"")},nce=Qle(({className:t="",inputClassName:e="",step:n=1,error:r,isDirect:o=!0,increaseStep:a,decreaseStep:i,maxLength:s,increaseElement:l="+",decreaseElement:u="-",detectDobleClick:d,rippleOption:f,notAllowedEmptyValue:m,inputDisabled:v,disableAutoAccel:g,disableLongPress:w,handleChange:y,onButtonPointerDown:_,onButtonPointerUp:S,handleEnter:x,...C},R)=>{const{value:P,readOnly:O,disabled:$,min:A,max:M="9999999999999",digit:L=18,onFocus:B,onBlur:F}=C,N=qa(null),V=qa(!1),z=qa(!1),I=qa({up:0,down:0}),D=qa(""),U=qa(null),Y=qa(null),oe=qa(0),Q=qa(0),re=qa(1e3),[le,ee]=Bx(P??""),[ne,ue]=Bx(!1),ve=ece(()=>$||new Ut(A??0).cmp(new Ut(M))>0,[$,M,A]),we=pa((_e,at,ht)=>at===0?_e:ht==="up"?new Ut(_e||0).add(new Ut(U.current?.increase??at??1)).toDP(L,Ut.ROUND_DOWN).toString():new Ut(_e||0).sub(new Ut(U.current?.decrease??at??1)).toDP(L,Ut.ROUND_DOWN).toString(),[L]),ye=pa(_e=>typeof _e>"u"||!_e||ve?"":_e.endsWith(".")?_e:typeof A<"u"&&new Ut(Number(_e)).lt(new Ut(A))?String(A):typeof M<"u"&&new Ut(Dl(_e||"")).gt(new Ut(M))?String(M):_e,[A,M,ve]),Le=pa(_e=>ve?"":_e.endsWith(".")?_e:ye(_e),[ve,ye]),Oe=pa(({type:_e,e:at})=>{if(!N.current||ve)return;const{value:ht,name:st}=N.current,Ct=tce({target:{value:ht}}),cn=L?new RegExp(`^-?[0-9]*[.]{0,1}[0-9]{0,${L}}$`,"gm"):/^-?\d{0,18}$/;Ct.match(cn)&&(typeof s<"u"&&(Ct||"").split(".")[0].replace(/[^0-9]/g,"").length>Number(s)||(N.current.value=Bi(Ct??"").join("."),D.current!==Ct&&(y?.(Ct,st,{type:_e}),at&&C.onChange?.(at),D.current=Ct),ee(Ct)))},[ve,L,s,y,C]),Ne=pa((_e,at)=>{N.current&&(ue(at),at?B?.(_e):(N.current.value=Le(N.current.value),m&&!_e.target.value&&(N.current.value=C.value),Oe({}),F?.(_e)))},[B,Le,m,C.value,Oe,F]),me=pa(_e=>{if(ve||O){V.current=!1,window.clearTimeout(oe.current);return}D.current=we(D.current??"0",Y.current,_e),D.current=ye(D.current??"0"),ee(String(D.current)),y?.(D.current,C.name,{type:_e}),_?.(_e),window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{V.current&&(me(_e),re.current>100&&!g&&(re.current-=re.current/5))},re.current)},[_,we,ye,ve,y,C.name,g,O]),pe=pa(_e=>{const{value:at="",name:ht}=_e.target;m&&!at&&(_e.target.value=C.value),x?.(at,ht),_e.target.blur()},[x,C.value,m]),be=pa(_e=>{_e.key==="Enter"&&!_e.nativeEvent.isComposing&&pe(_e),C.onKeyDown?.(_e)},[C,pe]),Ue=pa((_e,at)=>{if(!(Date.now()-I.current[_e]<500&&d)){if(ve||O){V.current=!1,window.clearTimeout(oe.current);return}I.current[_e]=Date.now(),me(_e),w||(oe.current=window.setTimeout(()=>{V.current=!0,me(_e)},re.current)),z.current=!0}},[d,ve,O,me,w]),He=pa((_e,at)=>{if(ve||O||!z.current){V.current=!1,window.clearTimeout(oe.current);return}V.current=!1,z.current=!1,window.clearTimeout(oe.current),_e&&S?.(_e,at),_e&&Oe({type:_e})},[ve,Oe,O,S]),qe=pa(()=>{V.current=!1,window.clearTimeout(oe.current),window.clearTimeout(Q.current)},[]);return wd(()=>{D.current=P??""},[P]),wd(()=>{typeof P<"u"&&ee(P)},[P]),wd(()=>{Y.current=n},[n]),wd(()=>{U.current={increase:a,decrease:i}},[a,i]),Jle(R,()=>N.current),wd(()=>{const _e=at=>{at.type==="contextmenu"&&V.current&&at.preventDefault()};return window.addEventListener("contextmenu",_e),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e),()=>{window.removeEventListener("contextmenu",_e),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e)}},[qe]),te(Yo,{className:i1("side-number-input",{focus:ne,readonly:O,disabled:$,error:r},t),alignItems:"center",justifyContent:"center",children:[h(Rr,{...f,disabled:ve||f?.disabled,children:h("button",{type:"button","data-type":"down",className:i1("number-btn","down"),disabled:ve||M===le,onPointerDown:_e=>{Ue("down",_e)},onPointerUp:_e=>{He("down",_e)},onPointerLeave:_e=>{_e.currentTarget.hasPointerCapture?.(_e.pointerId)||He(void 0,_e)},onPointerCancel:_e=>{He(void 0,_e)},onLostPointerCapture:_e=>{He(void 0,_e)},onContextMenu:_e=>{_e.preventDefault()},children:u})}),h("input",{...C,className:i1("input",{focus:ne,readonly:O,disabled:$,error:r},e),ref:N,type:"text",value:Bi(le??"").join(".")??"",readOnly:!o,disabled:$||v,onChange:_e=>Oe({e:_e}),onFocus:_e=>Ne(_e,!0),onBlur:_e=>Ne(_e,!1),onKeyDown:be,onContextMenu:_e=>{_e.preventDefault()}}),h(Rr,{...f,disabled:ve||f?.disabled,children:h("button",{type:"button","data-type":"up",className:i1("number-btn","up"),disabled:ve||A===le,onPointerDown:_e=>{Ue("up",_e)},onPointerUp:_e=>{He("up",_e)},onPointerLeave:_e=>{_e.currentTarget.hasPointerCapture?.(_e.pointerId)||He(void 0,_e)},onPointerCancel:_e=>{He(void 0,_e)},onLostPointerCapture:_e=>{He(void 0,_e)},onContextMenu:_e=>{_e.preventDefault()},children:l})})]})});nce.displayName="SideNumberInput";const{useCallback:s1}=await q("react"),Rve=({alertComponent:t,confirmComponent:e,promptComponent:n,options:r}={})=>{const{modal:o,closeModal:a}=OE(),i=s1(async({modalId:d,componentName:f,...m})=>o({component:t??Lle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,t,r?.containerId]),s=s1(async({modalId:d,componentName:f,...m})=>o({component:e??Dle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,e,r?.containerId]),l=s1(async({modalId:d,componentName:f,...m})=>o({component:n??Fle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,n,r?.containerId]),u=s1(d=>{a(d)},[a]);return{alertDialog:i,confirmDialog:s,promptDialog:l,closeDialog:u}},{useCallback:l1}=await q("react"),Tve=({alertComponent:t,confirmComponent:e,promptComponent:n}={})=>{const{modal:r,closeModal:o}=OE(),a=l1(async({modalId:u,componentName:d,...f})=>r({component:t??sfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,t]),i=l1(async({modalId:u,componentName:d,...f})=>r({component:e??cfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,e]),s=l1(async({modalId:u,componentName:d,...f})=>r({component:n??mfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,n]),l=l1(u=>{o(u)},[o]);return{alertDialog:a,confirmDialog:i,promptDialog:s,closeDialog:l}},oi=Object.create(null);oi.open="0";oi.close="1";oi.ping="2";oi.pong="3";oi.message="4";oi.upgrade="5";oi.noop="6";const r0=Object.create(null);Object.keys(oi).forEach(t=>{r0[oi[t]]=t});const zv={type:"error",data:"parser error"},vk=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wk=typeof ArrayBuffer=="function",bk=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,E3=({type:t,data:e},n,r)=>vk&&e instanceof Blob?n?r(e):zx(e,r):wk&&(e instanceof ArrayBuffer||bk(e))?n?r(e):zx(new Blob([e]),r):r(oi[t]+(e||"")),zx=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Fx(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let M2;function rce(t,e){if(vk&&t.data instanceof Blob)return t.data.arrayBuffer().then(Fx).then(e);if(wk&&(t.data instanceof ArrayBuffer||bk(t.data)))return e(Fx(t.data));E3(t,!1,n=>{M2||(M2=new TextEncoder),e(M2.encode(n))})}const Vx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Vx.length;t++)jd[Vx.charCodeAt(t)]=t;const oce=t=>{let e=t.length*.75,n=t.length,r,o=0,a,i,s,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const u=new ArrayBuffer(e),d=new Uint8Array(u);for(r=0;r<n;r+=4)a=jd[t.charCodeAt(r)],i=jd[t.charCodeAt(r+1)],s=jd[t.charCodeAt(r+2)],l=jd[t.charCodeAt(r+3)],d[o++]=a<<2|i>>4,d[o++]=(i&15)<<4|s>>2,d[o++]=(s&3)<<6|l&63;return u},ace=typeof ArrayBuffer=="function",M3=(t,e)=>{if(typeof t!="string")return{type:"message",data:yk(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:ice(t.substring(1),e)}:r0[n]?t.length>1?{type:r0[n],data:t.substring(1)}:{type:r0[n]}:zv},ice=(t,e)=>{if(ace){const n=oce(t);return yk(n,e)}else return{base64:!0,data:t}},yk=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},_k="",sce=(t,e)=>{const n=t.length,r=new Array(n);let o=0;t.forEach((a,i)=>{E3(a,!1,s=>{r[i]=s,++o===n&&e(r.join(_k))})})},lce=(t,e)=>{const n=t.split(_k),r=[];for(let o=0;o<n.length;o++){const a=M3(n[o],e);if(r.push(a),a.type==="error")break}return r};function cce(){return new TransformStream({transform(t,e){rce(t,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const a=new DataView(o.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{o=new Uint8Array(9);const a=new DataView(o.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(o[0]|=128),e.enqueue(o),e.enqueue(n)})}})}let k2;function c1(t){return t.reduce((e,n)=>e+n.length,0)}function u1(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let o=0;o<e;o++)n[o]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function uce(t,e){k2||(k2=new TextDecoder);const n=[];let r=0,o=-1,a=!1;return new TransformStream({transform(i,s){for(n.push(i);;){if(r===0){if(c1(n)<1)break;const l=u1(n,1);a=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(c1(n)<2)break;const l=u1(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(c1(n)<8)break;const l=u1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){s.enqueue(zv);break}o=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(c1(n)<o)break;const l=u1(n,o);s.enqueue(M3(a?l:k2.decode(l),e)),r=0}if(o===0||o>t){s.enqueue(zv);break}}}})}const xk=4;function Qn(t){if(t)return dce(t)}function dce(t){for(var e in Qn.prototype)t[e]=Qn.prototype[e];return t}Qn.prototype.on=Qn.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Qn.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Qn.prototype.off=Qn.prototype.removeListener=Qn.prototype.removeAllListeners=Qn.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Qn.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,e)}return this};Qn.prototype.emitReserved=Qn.prototype.emit;Qn.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Qn.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Bh=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Ho=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fce="arraybuffer";function Sk(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const pce=Ho.setTimeout,hce=Ho.clearTimeout;function zh(t,e){e.useNativeTimers?(t.setTimeoutFn=pce.bind(Ho),t.clearTimeoutFn=hce.bind(Ho)):(t.setTimeoutFn=Ho.setTimeout.bind(Ho),t.clearTimeoutFn=Ho.clearTimeout.bind(Ho))}const mce=1.33;function gce(t){return typeof t=="string"?vce(t):Math.ceil((t.byteLength||t.size)*mce)}function vce(t){let e=0,n=0;for(let r=0,o=t.length;r<o;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function Ck(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function wce(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function bce(t){let e={},n=t.split("&");for(let r=0,o=n.length;r<o;r++){let a=n[r].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}class yce extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class k3 extends Qn{constructor(e){super(),this.writable=!1,zh(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new yce(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=M3(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=wce(e);return n.length?"?"+n:""}}class _ce extends k3{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};lce(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,sce(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Ck()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ek=!1;try{Ek=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xce=Ek;function Sce(){}class Cce extends _ce{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let lu=class o0 extends Qn{constructor(e,n,r){super(),this.createRequest=e,zh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=Sk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=o0.requestsCount++,o0.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Sce,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete o0.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};lu.requestsCount=0;lu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jx);else if(typeof addEventListener=="function"){const t="onpagehide"in Ho?"pagehide":"unload";addEventListener(t,jx,!1)}}function jx(){for(let t in lu.requests)lu.requests.hasOwnProperty(t)&&lu.requests[t].abort()}const Ece=(function(){const t=Mk({xdomain:!1});return t&&t.responseType!==null})();class Mce extends Cce{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=Ece&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new lu(Mk,this.uri(),e)}}function Mk(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||xce))return new XMLHttpRequest}catch{}if(!e)try{return new Ho[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const kk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class kce extends k3{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=kk?{}:Sk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;E3(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}o&&Bh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Ck()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const R2=Ho.WebSocket||Ho.MozWebSocket;class Rce extends kce{createSocket(e,n,r){return kk?new R2(e,n,r):n?new R2(e,n):new R2(e)}doWrite(e,n){this.ws.send(n)}}class Tce extends k3{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=uce(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),o=cce();o.readable.pipeTo(e.writable),this._writer=o.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;this._writer.write(r).then(()=>{o&&Bh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Nce={websocket:Rce,webtransport:Tce,polling:Mce},Pce=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ace=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Fv(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let o=Pce.exec(t||""),a={},i=14;for(;i--;)a[Ace[i]]=o[i]||"";return n!=-1&&r!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Ice(a,a.path),a.queryKey=Oce(a,a.query),a}function Ice(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Oce(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,a){o&&(n[o]=a)}),n}const Vv=typeof addEventListener=="function"&&typeof removeEventListener=="function",a0=[];Vv&&addEventListener("offline",()=>{a0.forEach(t=>t())},!1);class Ls extends Qn{constructor(e,n){if(super(),this.binaryType=fce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=Fv(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Fv(n.host).host);zh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=bce(this.opts.query)),Vv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},a0.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=xk,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Ls.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ls.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=gce(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Bh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:e,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Ls.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Vv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=a0.indexOf(this._offlineEventListener);r!==-1&&a0.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ls.protocol=xk;class Lce extends Ls{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Ls.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ls.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function a(){r||(r=!0,d(),n.close(),n=null)}const i=f=>{const m=new Error("probe error: "+f);m.transport=n.name,a(),this.emitReserved("upgradeError",m)};function s(){i("transport closed")}function l(){i("socket closed")}function u(f){n&&f.name!==n.name&&a()}const d=()=>{n.removeListener("open",o),n.removeListener("error",i),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",o),n.once("error",i),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let $ce=class extends Lce{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Nce[o]).filter(o=>!!o)),super(e,r)}};function Dce(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=Fv(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+e,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const Bce=typeof ArrayBuffer=="function",zce=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Rk=Object.prototype.toString,Fce=typeof Blob=="function"||typeof Blob<"u"&&Rk.call(Blob)==="[object BlobConstructor]",Vce=typeof File=="function"||typeof File<"u"&&Rk.call(File)==="[object FileConstructor]";function R3(t){return Bce&&(t instanceof ArrayBuffer||zce(t))||Fce&&t instanceof Blob||Vce&&t instanceof File}function i0(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(i0(t[n]))return!0;return!1}if(R3(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return i0(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i0(t[n]))return!0;return!1}function jce(t){const e=[],n=t.data,r=t;return r.data=jv(n,e),r.attachments=e.length,{packet:r,buffers:e}}function jv(t,e){if(!t)return t;if(R3(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=jv(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=jv(t[r],e));return n}return t}function Hce(t,e){return t.data=Hv(t.data,e),delete t.attachments,t}function Hv(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Hv(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Hv(t[n],e));return t}const Wce=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var nn;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(nn||(nn={}));class qce{constructor(e){this.replacer=e}encode(e){return(e.type===nn.EVENT||e.type===nn.ACK)&&i0(e)?this.encodeAsBinary({type:e.type===nn.EVENT?nn.BINARY_EVENT:nn.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===nn.BINARY_EVENT||e.type===nn.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=jce(e),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class T3 extends Qn{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===nn.BINARY_EVENT;r||n.type===nn.BINARY_ACK?(n.type=r?nn.EVENT:nn.ACK,this.reconstructor=new Uce(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(R3(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(nn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===nn.BINARY_EVENT||r.type===nn.BINARY_ACK){const a=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const i=e.substring(a,n);if(i!=Number(i)||e.charAt(n)!=="-")throw new Error("Illegal attachments");const s=Number(i);if(!Yce(s)||s<0)throw new Error("Illegal attachments");if(s>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=s}if(e.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(a,n)}else r.nsp="/";const o=e.charAt(n+1);if(o!==""&&Number(o)==o){const a=n+1;for(;++n;){const i=e.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===e.length)break}r.id=Number(e.substring(a,n+1))}if(e.charAt(++n)){const a=this.tryParse(e.substr(n));if(T3.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case nn.CONNECT:return Hx(n);case nn.DISCONNECT:return n===void 0;case nn.CONNECT_ERROR:return typeof n=="string"||Hx(n);case nn.EVENT:case nn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Wce.indexOf(n[0])===-1);case nn.ACK:case nn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Uce{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=Hce(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Yce=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Hx(t){return Object.prototype.toString.call(t)==="[object Object]"}const Gce=Object.freeze(Object.defineProperty({__proto__:null,Decoder:T3,Encoder:qce,get PacketType(){return nn}},Symbol.toStringTag,{value:"Module"}));function ma(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Kce=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Tk extends Qn{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ma(e,"open",this.onopen.bind(this)),ma(e,"packet",this.onpacket.bind(this)),ma(e,"error",this.onerror.bind(this)),ma(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,o,a;if(Kce.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:nn.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),i.id=d}const s=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[e]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},o),i=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...n){return new Promise((r,o)=>{const a=(i,s)=>i?o(i):r(s);a.withError=!0,n.push(a),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...a)=>(this._queue[0],o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:nn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case nn.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nn.EVENT:case nn.BINARY_EVENT:this.onevent(e);break;case nn.ACK:case nn.BINARY_ACK:this.onack(e);break;case nn.DISCONNECT:this.ondisconnect();break;case nn.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:nn.ACK,id:e,data:o}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Nu(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nu.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};Nu.prototype.reset=function(){this.attempts=0};Nu.prototype.setMin=function(t){this.ms=t};Nu.prototype.setMax=function(t){this.max=t};Nu.prototype.setJitter=function(t){this.jitter=t};class Wv extends Qn{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,zh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Nu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const o=n.parser||Gce;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new $ce(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=ma(n,"open",function(){r.onopen(),e&&e()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),e?e(s):this.maybeReconnectOnOpen()},i=ma(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{o(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ma(e,"ping",this.onping.bind(this)),ma(e,"data",this.ondata.bind(this)),ma(e,"error",this.onerror.bind(this)),ma(e,"close",this.onclose.bind(this)),ma(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Bh(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Tk(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const bd={};function s0(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=Dce(t,e.path||"/socket.io"),r=n.source,o=n.id,a=n.path,i=bd[o]&&a in bd[o].nsps,s=e.forceNew||e["force new connection"]||e.multiplex===!1||i;let l;return s?l=new Wv(r,e):(bd[o]||(bd[o]=new Wv(r,e)),l=bd[o]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(s0,{Manager:Wv,Socket:Tk,io:s0,connect:s0});var T2,Wx;function Xce(){if(Wx)return T2;Wx=1;var t=typeof Element<"u",e=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(a,i){if(a===i)return!0;if(a&&i&&typeof a=="object"&&typeof i=="object"){if(a.constructor!==i.constructor)return!1;var s,l,u;if(Array.isArray(a)){if(s=a.length,s!=i.length)return!1;for(l=s;l--!==0;)if(!o(a[l],i[l]))return!1;return!0}var d;if(e&&a instanceof Map&&i instanceof Map){if(a.size!==i.size)return!1;for(d=a.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;for(d=a.entries();!(l=d.next()).done;)if(!o(l.value[1],i.get(l.value[0])))return!1;return!0}if(n&&a instanceof Set&&i instanceof Set){if(a.size!==i.size)return!1;for(d=a.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(i)){if(s=a.length,s!=i.length)return!1;for(l=s;l--!==0;)if(a[l]!==i[l])return!1;return!0}if(a.constructor===RegExp)return a.source===i.source&&a.flags===i.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof i.valueOf=="function")return a.valueOf()===i.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof i.toString=="function")return a.toString()===i.toString();if(u=Object.keys(a),s=u.length,s!==Object.keys(i).length)return!1;for(l=s;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;if(t&&a instanceof Element)return!1;for(l=s;l--!==0;)if(!((u[l]==="_owner"||u[l]==="__v"||u[l]==="__o")&&a.$$typeof)&&!o(a[u[l]],i[u[l]]))return!1;return!0}return a!==a&&i!==i}return T2=function(i,s){try{return o(i,s)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},T2}var Zce=Xce();const Qce=Ea(Zce),{createContext:Jce,useCallback:ha,useContext:N3,useEffect:$l,useLayoutEffect:eue,useMemo:tue,useRef:Di,useState:Rs}=await q("react"),l0={connected:null,realConnected:null,isInitialConnecting:!0,socketId:null,getSocketId:()=>null,setSocketUrl:()=>{},socketEventOn:()=>{},socketEventOff:()=>{},socketEventEmit:()=>{},setPrevResponse:()=>{},getPrevResponse:()=>null},Fh=Jce(l0),Pve=({url:t,socketOptions:e={},children:n,loadingElement:r})=>{const{transports:o=["websocket","polling"],reconnectionAttempts:a=1/0,reconnectionDelay:i=1e3,reconnectionDelayMax:s=5e3,timeout:l=2e4,...u}=e,d=Di(null),f=Di({}),m=Di({}),v=Di({}),[g,w]=Rs(t),[y,_]=Rs(l0.realConnected),[S,x]=Rs(l0.connected),[C,R]=Rs(l0.isInitialConnecting),[P,O]=Rs(null);$l(()=>{w(t)},[t]);const $=ha(D=>{w(D)},[]),A=ha((D,U)=>{Object.values(f.current[D]??{}).forEach(Y=>{Y(U)})},[]),M=ha((D,U)=>{d.current?.emit(D,U)},[]),L=ha(({topic:D,id:U,subscribePayload:Y},oe)=>{if(f.current[D]||(f.current[D]={}),!d.current?.hasListeners(D)){const Q={topic:D,...Y??{}};Y&&Object.keys(Y).length>0&&(v.current[D]=Y),M("subscribe",Q),d.current?.on(D,re=>{A(D,re)})}f.current[D][U]=oe},[M,A]),B=ha(({topic:D,id:U})=>{if(f.current[D]?.[U]&&(delete f.current[D][U],Object.keys(f.current[D]).length===0)){d.current?.off(D);const Y=v.current[D],oe=Y?{topic:D,...Y}:{topic:D};M("unsubscribe",oe),delete v.current[D]}},[M]),F=ha((D,U)=>m.current[D]?.[U],[]),N=ha((D,U)=>{m.current[D]={raw:U,parsed:m0(U)}},[]),V=ha(()=>d.current?.id??null,[]),z=ha(()=>{d.current&&(d.current.disconnect(),d.current=null),d.current=s0(g,{transports:o,reconnectionAttempts:a,reconnectionDelay:i,reconnectionDelayMax:s,timeout:l,...u}),Object.keys(f.current).forEach(D=>{Object.keys(f.current[D]??{}).length>0&&d.current?.on(D,U=>{A(D,U)})}),d.current.on("connect",()=>{console.log("Socket.io connected"),x(!0),_(!0),O(d.current?.id??null),A("connect","connected")}),d.current.on("disconnect",D=>{console.log("Socket.io disconnected",D),_(!1),A("disconnect","disconnected")}),d.current.io.on("reconnect",D=>{console.log("Socket.io reconnect",D),A("reconnect",D),Object.keys(f.current).forEach(U=>{if(Object.keys(f.current[U])?.length){const Y={topic:U,...v.current[U]??{}};M("subscribe",Y),d.current?.emit("subscribe",Y)}})}),d.current.io.on("reconnect_attempt",D=>{console.log("Socket.io reconnect_attempt",D),D>3&&x(!1),A("reconnect_attempt",D)}),d.current.io.on("reconnect_error",D=>{A("reconnect_error",D)}),d.current.io.on("reconnect_failed",()=>{console.error("Socket.io reconnect_failed"),x(!1),_(!1),A("reconnect_failed","reconnect_failed")}),d.current.on("error",D=>{console.error("Socket.io error: ",D),A("error",D)})},[A,a,i,s,JSON.stringify(u),JSON.stringify(o),g]),I=tue(()=>({connected:S,realConnected:y,isInitialConnecting:C,socketId:P,getSocketId:V,setSocketUrl:$,socketEventOn:L,socketEventOff:B,socketEventEmit:M,setPrevResponse:N,getPrevResponse:F}),[S,y,C,P,V,$,L,B,M,N,F]);return eue(()=>{z()},[z]),$l(()=>{!S&&m.current&&Object.keys(m.current).forEach(D=>{M(D,void 0),N(D,void 0)})},[S,N,M]),$l(()=>{S&&R(!1)},[S]),h(Fh.Provider,{value:I,children:n})},Ave=()=>{const{connected:t,realConnected:e,socketEventEmit:n,setSocketUrl:r,socketId:o,getSocketId:a}=N3(Fh);return{connected:t,realConnected:e,socketEventEmit:n,setSocketUrl:r,socketId:o,getSocketId:a}},nue=t=>{const{socketEventOn:e,socketEventOff:n,setPrevResponse:r,getPrevResponse:o}=N3(Fh),a=Di({options:t.options,callback:t.callback}),[i]=Rs(kn.uniqueId()),{topic:s}=t;$l(()=>{a.current={options:t.options,callback:t.callback}},[t]),$l(()=>{if(!t.options?.disabled)return e({topic:s,id:i,subscribePayload:t.options?.subscribePayload},l=>{const{options:u,callback:d}=a.current;u?.prevData,r(s,l);const f=m0(l);d?.(f)}),()=>{n({topic:s,id:i})}},[o,r,n,e,s,i,t.options?.disabled,t.options?.subscribePayload])},Ive=(t,e={})=>{const{realConnected:n,isInitialConnecting:r,getPrevResponse:o,setPrevResponse:a}=N3(Fh),[i,s]=Rs(!o(t,"parsed")&&!!e.defaultValue),l=n?o(t,"parsed")??e.defaultValue:e.defaultValue,[u,d]=Rs(e.selector?e.selector(l):l),f=Di(u),m=Di(i),v=Di(e);f.current=u,m.current=i,v.current=e;const g=ha(S=>{e.disabled||(d(e.selector?e.selector(S):S),a(t,S),s(!1))},[a,t,e]),w=e.throttleMs??0,y=Di({timer:null,pending:null,hasPending:!1}),_=ha(S=>{const x=e.selector?e.selector(S):S;!e.disableDuplicateCheck&&Qce(x,f.current)&&!m.current||(d(x),x&&s(!1))},[e]);return $l(()=>{const S=y.current;return()=>{S.timer&&clearTimeout(S.timer)}},[]),nue({topic:t,callback:S=>{if(w<=0){_(S);return}const x=y.current;x.pending=S,x.hasPending=!0,!x.timer&&(x.timer=setTimeout(()=>{x.timer=null,x.hasPending&&(x.hasPending=!1,_(x.pending),x.pending=null)},w))},options:{...e,prevData:u,subscribePayload:e.subscribePayload}}),$l(()=>{if(!n){const S=v.current,x=S.defaultValue===void 0?void 0:S.selector?S.selector(S.defaultValue):S.defaultValue;d(x),a(t,void 0),s(S.defaultValue!==void 0)}},[n,a,t]),{data:u,changeData:g,loading:!u&&!r,isDefaultData:i}},{useRef:Ove}=await q("react"),{useMutation:Lve}=await q("@tanstack/react-query"),{useMutation:$ve}=await q("@tanstack/react-query"),{useMutation:Dve}=await q("@tanstack/react-query"),{useMutation:Bve}=await q("@tanstack/react-query"),{useMutation:zve}=await q("@tanstack/react-query"),{useMutation:Fve}=await q("@tanstack/react-query"),{useMutation:Vve}=await q("@tanstack/react-query"),{useMutation:jve}=await q("@tanstack/react-query"),{useMutation:Hve}=await q("@tanstack/react-query"),{useCallback:Wve}=await q("react"),{useCallback:qve}=await q("react"),{useMutation:Uve}=await q("@tanstack/react-query"),{useMutation:Yve,useQueryClient:Gve}=await q("@tanstack/react-query"),{useMutation:Kve,useQueryClient:Xve}=await q("@tanstack/react-query"),{useMutation:Zve,useQueryClient:Qve}=await q("@tanstack/react-query"),{useMutation:Jve}=await q("@tanstack/react-query"),{useMutation:ewe}=await q("@tanstack/react-query"),{useMutation:twe}=await q("@tanstack/react-query"),{useMutation:nwe}=await q("@tanstack/react-query"),{useMutation:rwe}=await q("@tanstack/react-query"),{useMutation:owe}=await q("@tanstack/react-query"),{useMutation:awe}=await q("@tanstack/react-query"),{useMutation:iwe}=await q("@tanstack/react-query"),{useMutation:swe}=await q("@tanstack/react-query"),{useMutation:lwe}=await q("@tanstack/react-query"),{useMutation:cwe}=await q("@tanstack/react-query"),{useMutation:uwe}=await q("@tanstack/react-query"),{useMutation:dwe}=await q("@tanstack/react-query"),{useMutation:fwe}=await q("@tanstack/react-query"),{useMutation:pwe}=await q("@tanstack/react-query"),{useMutation:hwe}=await q("@tanstack/react-query"),{useMutation:mwe}=await q("@tanstack/react-query"),{useMutation:gwe}=await q("@tanstack/react-query"),{useMutation:vwe}=await q("@tanstack/react-query"),{useMutation:wwe}=await q("@tanstack/react-query"),{useMutation:bwe}=await q("@tanstack/react-query"),{useMutation:ywe}=await q("@tanstack/react-query"),{useMutation:_we}=await q("@tanstack/react-query"),{useMutation:xwe}=await q("@tanstack/react-query"),{useMutation:Swe}=await q("@tanstack/react-query"),{useMutation:Cwe}=await q("@tanstack/react-query"),{useMutation:Ewe}=await q("@tanstack/react-query"),{useMutation:Mwe}=await q("@tanstack/react-query"),{useMutation:kwe}=await q("@tanstack/react-query"),{useMutation:Rwe}=await q("@tanstack/react-query"),{useMutation:Twe}=await q("@tanstack/react-query"),{useMutation:Nwe}=await q("@tanstack/react-query"),{useMutation:Pwe}=await q("@tanstack/react-query"),{useMutation:Awe}=await q("@tanstack/react-query"),{useMutation:Iwe}=await q("@tanstack/react-query"),{useMutation:Owe}=await q("@tanstack/react-query"),{useMutation:Lwe}=await q("@tanstack/react-query"),{useMutation:$we}=await q("@tanstack/react-query"),{useMutation:Dwe}=await q("@tanstack/react-query"),{useMutation:Bwe}=await q("@tanstack/react-query"),{useMutation:zwe}=await q("@tanstack/react-query"),{useMutation:rue}=await q("@tanstack/react-query"),oue="/setUrl",Fwe=()=>rue({mutationFn:t=>Th.post(oue,t)}),{useMutation:Vwe}=await q("@tanstack/react-query"),{useMutation:jwe}=await q("@tanstack/react-query"),{useCallback:Hwe}=await q("react"),{useMutation:Wwe}=await q("@tanstack/react-query"),{useCallback:qwe}=await q("react"),{useMutation:Uwe}=await q("@tanstack/react-query"),{useCallback:Ywe}=await q("react"),{useMutation:Gwe}=await q("@tanstack/react-query"),{useCallback:Kwe}=await q("react"),{useMutation:Xwe}=await q("@tanstack/react-query"),{useCallback:Zwe}=await q("react"),{useMutation:Qwe}=await q("@tanstack/react-query"),{useCallback:Jwe}=await q("react"),{useMutation:e3e}=await q("@tanstack/react-query"),{useCallback:t3e}=await q("react"),{useMutation:n3e}=await q("@tanstack/react-query"),{useMutation:r3e}=await q("@tanstack/react-query"),{useMutation:o3e}=await q("@tanstack/react-query"),{useMutation:a3e}=await q("@tanstack/react-query"),{useMutation:i3e}=await q("@tanstack/react-query"),{useMutation:s3e}=await q("@tanstack/react-query"),{useMutation:l3e}=await q("@tanstack/react-query"),{useMutation:c3e}=await q("@tanstack/react-query"),{useMutation:u3e}=await q("@tanstack/react-query"),{useCallback:d3e}=await q("react"),{useMutation:f3e}=await q("@tanstack/react-query"),{useCallback:p3e}=await q("react"),{useEffect:h3e,useRef:m3e,useState:g3e}=await q("react"),{useMutation:v3e}=await q("@tanstack/react-query"),{useEffect:w3e,useRef:b3e,useState:y3e}=await q("react"),{useMutation:_3e}=await q("@tanstack/react-query"),{useMutation:x3e}=await q("@tanstack/react-query"),{useMutation:S3e}=await q("@tanstack/react-query"),{useMutation:C3e}=await q("@tanstack/react-query"),{useEffect:E3e,useMemo:M3e,useState:k3e}=await q("react"),{useMemo:R3e}=await q("react"),aue={moveState:{autoMove:"stop",moveId:"",moveResult:"",dockMove:"",jogMove:"none",obs:"none",pathState:"none",step:0,multiId:"",multiState:""},pose:{x:0,y:0,rz:0},vel:{vx:0,vy:0,wz:0},curNode:{id:"",name:"",state:"",pose:{x:0,y:0,rz:0}},goalNode:{id:"",name:"",state:"",pose:{x:0,y:0,rz:0}}},iue=t=>({...t,pose:{x:String(t.pose.x),y:String(t.pose.y),rz:String(t.pose.rz)}});iue(aue);const{useCallback:T3e,useMemo:N3e}=await q("react"),{useMemo:P3e}=await q("react"),{useRef:A3e}=await q("react"),{useCallback:I3e,useEffect:O3e,useRef:L3e,useState:$3e}=await q("react"),{useCallback:D3e}=await q("react"),{useCallback:B3e}=await q("react"),{useEffect:qx,useState:sue}=await q("react"),lue=t=>{const[e,n]=sue("");return qx(()=>{},[e,t]),qx(()=>{let r="",o;const a=i=>{clearTimeout(o);const s=document.activeElement;if(!(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.tagName==="SELECT"||s.contentEditable==="true"))){if(i.key==="Enter"){n(r.trim()),r="";return}/^[a-zA-Z0-9\-_]$/.test(i.key)&&(r+=i.key),o=setTimeout(()=>{n(r.trim()),r=""},100)}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),{barCodeValue:e}},{useMemo:z3e}=await q("react"),{useEffect:F3e,useRef:V3e,useCallback:j3e}=await q("react"),{useRef:cue,useState:uue}=await q("react"),H3e=({onFiles:t,accept:e,multiple:n=!0,onRejected:r})=>{const o=cue(null),[a,i]=uue(!1),s=v=>{const g=n?v:v.slice(0,1);if(g.length===0)return;if(!e||e.length===0){t(g);return}const w=e.map(S=>S.toLowerCase()),y=g.filter(S=>w.some(x=>S.name.toLowerCase().endsWith(x))),_=g.filter(S=>!y.includes(S));_.length>0&&r?.(_),y.length>0&&t(y)},l=v=>{v.preventDefault(),v.stopPropagation(),i(!0)},u=v=>{v.preventDefault(),v.stopPropagation(),i(!1)},d=v=>{v.preventDefault(),v.stopPropagation(),i(!1),s(Array.from(v.dataTransfer.files))},f=()=>o.current?.click(),m={ref:o,type:"file",multiple:n,accept:e?.join(","),style:{display:"none"},onChange:v=>{s(Array.from(v.target.files??[])),v.target.value=""}};return{isDragging:a,dropProps:{onDragOver:l,onDragLeave:u,onDrop:d},inputProps:m,open:f}},due={"popover-area":"_popover-area_y74pu_40","btn-popover":"_btn-popover_y74pu_45","popover-element-wrap":"_popover-element-wrap_y74pu_59","popover-element":"_popover-element_y74pu_59"},{cloneElement:fue,forwardRef:pue,useCallback:yd,useEffect:hue,useImperativeHandle:mue,useMemo:Ux,useRef:Yx,useState:Gx}=await q("react"),d1=rn(due,"rb-ui"),Kx=[],P3=pue(({id:t,className:e="",popoverAreaClassName:n,popoverElementClassName:r,anchorId:o,detectDoubleClick:a,popoverElement:i,popoverStyle:s={top:0,left:0,zIndex:1},popoverAnimation:l={name:"pop-fade",duration:200},ripple:u,disabled:d=!1,excludeOutSideIds:f=Kx,whenWindowScrollClose:m,children:v,onClick:g,onClose:w},y)=>{const _=Yx(null),S=Yx(!1),[x,C]=Gx(!1),[R,P]=Gx(""),O=Ux(()=>x?R==="enter"||R==="leave"?{animationName:l.name,animationDuration:`${l.duration}ms`,animationTimingFunction:l.timingFunc||"ease",animationDirection:R==="leave"?"reverse":"normal",animationFillMode:R==="leave"?"forwards":"normal"}:{}:{},[l,x,R]),$=yd(N=>new Promise(V=>setTimeout(V,N)),[]),A=yd(async()=>{!o||R==="leave"||(P(""),await $(10),P("leave"),await $(l.duration),C(!1),w?.())},[o,R,l.duration,$,w]),M=yd(async()=>{o&&(C(!0),P("enter"),await $(l.duration),P(""))},[o,l.duration,$]),L=yd(()=>{x?A():M()},[x,A,M]),B=yd(async N=>{d||S.current&&a||(S.current=!0,setTimeout(()=>{S.current=!1},500),L(),g?.(N))},[a,d,L,g]),F=Ux(()=>{const N=typeof i?.type=="string"?void 0:{close:A};return h("div",{className:d1("popover-element-wrap",r),children:x&&h("div",{className:d1("popover-element",R),style:{...s,...O},children:fue(i??h(Mr,{}),N)})})},[O,A,x,i,r,s,R]);return Nf(_,N=>{const V=[...f,o].filter(I=>!!I).concat(Kx).map(I=>document.querySelector(`#${I}`)).filter(I=>I),z=N.target;document.body.contains(z)&&(z.closest('[data-slot="select-drop-box"]')||V.some(I=>I?.contains(z))||x&&A())},{event:"mouseup"}),hue(()=>{const N=()=>{C(!1),P("")};return x&&m&&window.addEventListener("scroll",N),()=>{window.removeEventListener("scroll",N)}},[m,x]),mue(y,()=>({close:A,open:M})),te("div",{ref:_,id:t,className:d1("popover-area",n),children:[h(Rr,{...u,disabled:d||u?.disabled,children:h("button",{className:d1("btn-popover",e,x&&"open",d&&"pointer-events-none cursor-not-allowed"),"data-pad-focus":"true",disabled:d,onClick:B,children:v})}),o?h(Gl,{id:o,children:F}):null]})});P3.displayName="PopoverButton";function Nk({className:t,onCancel:e,onConfirm:n,onReset:r,labels:o}){return te(Yo,{className:ae("w-full p-4",t),justifyContent:"space-between",alignItems:"center",children:[h(Wr,{variant:"transparent",size:"sm",onClick:r,children:o?.reset??"Reset"}),te(Yo,{inline:!0,alignItems:"center",gap:4,children:[h(Wr,{className:"light:bg-fill-subtlest",variant:"soft",size:"sm",onClick:e,children:o?.cancel??"Cancel"}),h(Wr,{variant:"brand",size:"sm",onClick:n,children:o?.confirm??"Confirm"})]})]})}const gue=he(["inline-flex items-center overflow-hidden","bg-fill-control-surface outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"px-2_5 h-8 rounded-md",sm:"px-2_5 h-9 rounded-md",md:"h-10 rounded-md px-3",lg:"h-12 rounded-lg px-3"},variant:{default:"outline-border-default"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled hover:bg-fill-control-surface-disabled text-fg-disabled pointer-events-none cursor-not-allowed",false:""}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{focus:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1}}),vue=he("flex-1 truncate text-left",{variants:{size:{xs2:"typo-compact-xs2-normal pr-1",sm:"typo-compact-sm-normal pr-1",md:"typo-compact-sm2-normal pr-1_5",lg:"typo-compact-sm2-normal pr-2"},placeholder:{true:"text-fg-subtler font-normal",false:"text-fg-default font-medium"},disabled:{true:"text-fg-disabled",false:""}},defaultVariants:{size:"md",placeholder:!0,disabled:!1}}),wue=he("inline-flex shrink-0 items-center justify-center",{variants:{size:{xs2:"size-4",sm:"size-4",md:"size-5",lg:"size-5"},disabled:{true:"text-fg-disabled",false:"text-fg-default"}},defaultVariants:{size:"md",disabled:!1}}),bue=he(["absolute left-0 z-[999999] max-w-0","bg-overlay outline-border-subtle rounded-md outline outline-1 outline-offset-[-1px]","shadow-down-xs","overflow-x-hidden"].join(" "),{variants:{mode:{default:"no-scrollbar max-h-60 overflow-y-auto p-1",empty:"p-1_5 h-48 max-h-56",loading:"p-1_5 h-48 max-h-56"}},defaultVariants:{mode:"default"}}),yue=he("text-center",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-sm-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal"}},defaultVariants:{size:"md"}}),_ue=he("inline-flex h-9 w-full items-center overflow-hidden rounded-sm px-3",{variants:{selected:{true:"",false:""},disabled:{true:"",false:""},hovered:{true:"bg-fill-transparent-hovered",false:"bg-fill-transparent"}},compoundVariants:[{selected:!1,disabled:!1,hovered:!1,className:"text-fg-subtler font-normal"},{selected:!1,disabled:!1,hovered:!0,className:"text-fg-default font-normal"},{selected:!0,disabled:!1,className:"text-fg-default font-semibold"},{selected:!1,disabled:!0,className:"text-fg-disabled font-normal"},{selected:!0,disabled:!0,className:"text-fg-disabled font-semibold"}],defaultVariants:{selected:!1,disabled:!1,hovered:!1}}),xue=he("line-clamp-1 flex-1 pr-4 text-left",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-xs2-normal",lg:"typo-compact-xs2-normal"}},defaultVariants:{size:"md"}}),{useCallback:Sue,useMemo:Cue,useState:Eue}=await q("react"),qv=({className:t="",size:e="md",text:n,value:r,label:o,children:a,description:i,selectedValue:s="",searchText:l="",enableGamepadFocus:u,disabled:d,handleChange:f})=>{const m=s===r,[v,g]=Eue(!1),w=Cue(()=>l?kn.lowerCase(n).includes(kn.lowerCase(l)):!1,[n,l]),y=Sue(_=>{_.button===2||d||f?.({label:o??a,value:r})},[a,d,f,r,o]);return h("div",{"data-slot":"select-option",className:ae(_ue({selected:m,disabled:!!d,hovered:!d&&(w||v)}),i&&"h-auto min-h-9 overflow-visible py-2",t,{active:m}),role:"button","data-pad-focus":u&&!d?"true":"false",tabIndex:-1,onClick:y,onMouseEnter:()=>{d||g(!0)},onMouseLeave:()=>g(!1),children:te("div",{"data-slot":"select-option-content",className:"flex min-w-0 flex-1 items-center gap-2",children:[te("div",{"data-slot":"select-option-text",className:ae("min-w-0 flex-1",xue({size:e}),i&&"line-clamp-none"),children:[a,i&&h("div",{"data-slot":"select-option-description",className:"typo-compact-xs-normal text-fg-subtle",children:i})]}),m&&h(js,{"aria-hidden":!0,"data-slot":"select-option-check",className:ae("size-4 shrink-0",d?"text-fg-disabled":"text-fg-default")})]})})};qv.displayName="Option";const Pk=he("",{variants:{size:{xs2:"typo-compact-xs-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal",xl:"typo-compact-lg-normal"}},defaultVariants:{size:"md"}}),A3=({className:t,nullText:e="no data",children:n,style:r,size:o})=>te("div",{"data-slot":"no-data",className:ae("text-fg-subtle flex flex-col items-center justify-center gap-1",t,Pk({size:o})),style:r,children:[h("span",{"data-slot":"no-data-icon",className:"inline-flex items-center justify-center",children:n}),h("div",{"data-slot":"no-data-text",children:e})]}),{useEffect:Mue,useRef:kue,useMemo:Rue,Children:Tue}=await q("react"),Nue=({className:t,children:e,size:n,noDataMsg:r=h(A3,{className:ae(Pk({size:n}),"flex h-full w-full items-center justify-center")}),...o})=>{const a=kue(null),i=Rue(()=>Tue.map(e,s=>s).length===0,[e]);return Mue(()=>{setTimeout(()=>{const s=document.querySelector('[data-slot="dialog-content"]');if(s&&o.open){const l=s.querySelector(".active");typeof s.scrollTo=="function"&&s.scrollTo(0,l?.offsetTop??0)}},50)},[o.open]),h(tc,{"data-slot":"select-modal-drop-box",className:ae("bg-overlay shadow-down-xs border-subtle max-h-[calc(var(--vh,1vh)*50)] w-min max-w-[90vw] min-w-80 overflow-y-auto p-1 outline-hidden",t),...o,children:h("div",{ref:a,"data-slot":"select-modal-drop-box-list",className:ae(i?"flex min-h-60 items-stretch":""),children:i?r:e})})},{Children:Pue,forwardRef:Aue,useCallback:N2,useEffect:yl,useImperativeHandle:Iue,useMemo:Xx,useRef:Zx}=await q("react"),Oue=4,Ak=Aue((t,e)=>{const{className:n,theme:r,size:o,children:a,label:i,inputEl:s,parentEl:l,maxHeight:u=200,search:d,searchText:f="",searchPlaceholder:m,noDataMsg:v=h(A3,{className:ae(yue({size:o}),"flex h-full w-full items-center justify-center")}),direction:g="bottom",showCloseBtn:w,whenScrollCloseDropBox:y,setOpen:_,handleSearchTextChange:S,handleKeyPress:x}=t,C=Zx(null),R=Zx(null),{isMobile:P}=s3(),O=g==="top"?"top-start":"bottom-start",{refs:$,floatingStyles:A,update:M}=u7({placement:O,strategy:"fixed",whileElementsMounted:l7,middleware:[d7(Oue),p7({fallbackPlacements:g==="top"?["bottom-start"]:["top-start"]}),f7({padding:8}),h7({apply({availableHeight:I,rects:D,elements:U}){const Y=Math.min(u,Math.max(120,I));Object.assign(U.floating.style,{minWidth:`${D.reference.width}px`,maxHeight:`${Y}px`})}})]}),L=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",L+"px");const B=Xx(()=>Pue.map(a,I=>I).length===0,[a]),F=Xx(()=>P?i||w:!1,[P,i,w]),N=N2(I=>{const{value:D}=I.target;S(D)},[S]),V=N2(()=>{S("")},[S]),z=N2(()=>{s&&s.blur(),_(!1)},[s,_]);return yl(()=>{const I=R.current;if(I){const D=I.querySelector(".active");if(D&&typeof I.scrollTo=="function"){const U=D.getBoundingClientRect().top-I.getBoundingClientRect().top+I.scrollTop;I.scrollTo(0,U)}}},[l]),yl(()=>{if(R){const I=R.current,D=I.querySelector(".match");D&&([...I.children].map(U=>U.classList.remove("match")),D.classList.add("match"),I.scrollTo(0,D.offsetTop))}},[f,R]),yl(()=>{const I=()=>{window.innerWidth<800||(_(!1),s&&s.blur())};return window.removeEventListener("resize",I),window.addEventListener("resize",I),y&&(window.removeEventListener("scroll",I),window.addEventListener("scroll",I)),()=>{window.removeEventListener("scroll",I),window.removeEventListener("resize",I)}},[s,_,y]),yl(()=>(P&&D8(),()=>{P&&B8()}),[P]),Iue(e,()=>C.current),yl(()=>{$.setReference(l)},[l,$]),yl(()=>{const D=(Y=>{const oe=[];let Q=Y?.parentElement??null;for(;Q;){const re=window.getComputedStyle(Q),le=re.overflowY,ee=re.overflowX;(/(auto|scroll|overlay)/.test(le)||/(auto|scroll|overlay)/.test(ee))&&oe.push(Q),Q=Q.parentElement}return oe.push(window),oe})(l),U=()=>{M()};return D.forEach(Y=>Y.addEventListener("scroll",U,{passive:!0})),window.addEventListener("resize",U,{passive:!0}),()=>{D.forEach(Y=>Y.removeEventListener("scroll",U)),window.removeEventListener("resize",U)}},[l,M]),yl(()=>{let I=0;const D=()=>{M(),I=window.requestAnimationFrame(D)};return I=window.requestAnimationFrame(D),()=>{window.cancelAnimationFrame(I)}},[M]),te("div",{ref:I=>{C.current=I,$.setFloating(I)},"data-slot":"select-drop-box","data-pad-scope":"dropdown-box","data-theme":r,role:"button",tabIndex:-1,className:ae(bue({mode:B?"empty":"default"}),"!fixed !top-0 !left-0 flex flex-col",n),style:A,onKeyDown:x,children:[F&&te("div",{"data-slot":"select-drop-box-header",className:"border-subtle flex items-center gap-2 border-b px-2 py-2",children:[i&&h("label",{"data-slot":"select-drop-box-label",className:"text-fg-default flex-1 text-sm font-medium",children:i}),w&&h("button",{type:"button","data-slot":"select-drop-box-close",className:"text-fg-subtle ml-auto px-2 text-sm",onClick:z,children:h(df,{})})]}),d&&h("div",{"data-slot":"select-drop-box-search",className:"border-subtle border-b p-1",children:h(sw,{type:"text",size:o,className:"w-full",placeholder:m,value:f,prefixIcon:h(Z0,{className:"text-fg-subtle size-4"}),onChange:N,onKeyDown:x,handleReset:V})}),h("div",{ref:R,"data-slot":"select-drop-box-list",className:ae("min-h-0 overflow-y-auto",B?"flex flex-1 items-stretch":""),children:B?v:a})]})});Ak.displayName="SelectDropBox";const{Children:Lue,cloneElement:$ue,useCallback:qc,useEffect:f1,useMemo:p1,useRef:h1,useState:_l,forwardRef:Due,useImperativeHandle:Bue}=await q("react"),Uv=Due((t,e)=>{const{className:n="",size:r="md",children:o,name:a,value:i,error:s,search:l,mobileLabel:u,placeholder:d,disabled:f,readOnly:m,dropBoxClassName:v,maxDropBoxHeight:g=200,modalBoxClassName:w,selectArrow:y=h(K0,{}),keepDropDown:_,searchPlaceholder:S="Search",showCloseBtn:x,whenScrollCloseDropBox:C,enableModal:R=!xo.isDesktop,enableGamepadFocus:P=!0,noDataMsg:O,onClick:$,handleChange:A,...M}=t,L=h1(null),B=h1(null),F=h1(null),N=h1(Date.now()),[V,z]=_l(i),[I,D]=_l(""),[U,Y]=_l(""),[oe,Q]=_l(!1),[re,le]=_l(!1),[ee,ne]=_l(null),[ue,ve]=_l(null),we=p1(()=>{const qe=({value:ht})=>{f||(z(ht),A?.(ht,a),L.current.value=String(ht),M.onChange?.({target:L.current}),_||Q(!1))},_e=ht=>(ht??[]).flatMap(st=>{if(!st?.props)return[];if(st.type?.displayName==="Option"){let Ct;return st.props.text||(typeof st.props.label=="string"?Ct=st.props.label:typeof st.props.children=="string"?Ct=st.props.children:Ct=st.props.value.toString()),$ue(st,{...st.props,size:r,text:Ct.toLowerCase(),selectedValue:V,searchText:I,handleChange:qe,enableGamepadFocus:P})}return Array.isArray(st.props.children)?_e(st.props.children):[]}),at=Lue.map(o,ht=>ht);return _e(at)},[o,f,A,a,M,_,r,V,I,P]),ye=p1(()=>we.filter(qe=>qe.props.text.toLowerCase().includes(U.toLowerCase())),[we,U]),Le=p1(()=>we.find(qe=>{const _e=qe.props.value;return _e===V||_e===i}),[we,V,i]),Oe=p1(()=>{if(!Le){const at=we[0]?.props;return{text:d??at?.label??at?.children??"",isPlaceholder:!!d}}const{label:qe,children:_e}=Le.props;return{text:qe??_e??"",isPlaceholder:!1}},[Le,we,d]),Ne=qc(()=>{const qe=Date.now();if(qe-N.current<300){N.current=qe;return}if($)$();else{if(f||m)return;const at=B.current?.closest("[data-theme]")?.getAttribute("data-theme");ne(at),Q(ht=>!ht),N.current=qe}},[f,m,$]),me=qc(qe=>{D(qe),Y(qe)},[]),pe=qc(()=>{if(!oe){Q(!0);return}const qe=we.find(_e=>_e.props.text.includes(I.toLowerCase()));if(qe){const _e=qe.props;z(_e.value),A?.(_e.value,a),L.current.value=String(_e.value||""),M.onChange?.({target:L.current}),Q(!1),L.current.blur()}},[A,M,a,oe,we,I]),be=qc(qe=>{let _e;const at=we.findIndex(st=>{const Ct=st.props;return I?Ct.text===I:Ct.value===V});qe==="down"?_e=at+1>=we.length?we[0]:we[at+1]:_e=at<=0?we[we.length-1]:we[at-1];const ht=_e.props.text;D(ht)},[we,V,I]),Ue=qc(qe=>{qe.key==="Enter"&&!qe.nativeEvent.isComposing?pe():qe.key==="ArrowDown"?(be("down"),qe.preventDefault()):qe.key==="ArrowUp"&&(be("up"),qe.preventDefault())},[pe,be]),He=qc((qe,_e)=>{le(_e),_e?M.onFocus?.(qe):M.onBlur?.(qe)},[M]);return Nf(B,qe=>{!("button"in qe&&qe.button===2)&&!F.current?.contains(qe.target)&&Q(!1)},{offTouchEvent:!0}),f1(()=>{if(we.length&&!d&&!Le){const _e=we[0].props.value;z(L.current?.value??_e)}},[d,Le,we]),f1(()=>{typeof i<"u"&&z(i)},[i]),f1(()=>{oe||(D(""),Y(""))},[oe]),f1(()=>{if(!oe){ve(null);return}const qe=B.current?.closest('[data-slot="dialog-content"]');ve(qe instanceof HTMLElement?qe:null)},[oe]),Bue(e,()=>(L.current.handleClickSelectBox=Ne,{...L.current,get value(){return L.current.value},set value(qe){z(_e=>typeof _e=="string"&&_e===qe||typeof _e=="number"&&_e===Number(qe)||typeof _e=="boolean"&&String(_e)===String(qe)?_e:qe),L.current.value=qe}})),te(Mr,{children:[h("div",{ref:B,"data-slot":"select-box",className:ae(gue({size:r,variant:"default",focus:re,error:s,disabled:f,readOnly:m}),n),onClick:Ne,children:te("label",{"data-slot":"select-box-control",className:"relative flex w-full min-w-0 items-center",children:[h("div",{"data-slot":"select-box-value",className:vue({size:r,placeholder:Oe.isPlaceholder,disabled:f}),children:h("span",{children:Oe.text})}),h("input",{...M,ref:L,type:"text",value:V??L.current?.value??"",name:a,readOnly:!0,className:"sr-only","data-pad-focus":P?"true":"false",onFocus:qe=>He(qe,!0),onBlur:qe=>He(qe,!1),onKeyDown:Ue}),h("span",{"data-slot":"select-box-icon",className:ae(wue({size:r,disabled:f}),"transition-transform duration-200",oe&&"rotate-180"),children:y})]})}),R&&h(Nue,{className:w,type:"dialog",open:oe,size:r,hideCloseButton:!0,onOpenChange:Q,noDataMsg:O,children:ye}),!R&&oe&&h(Gl,{container:ue,children:h(Ak,{ref:F,className:v,size:r,label:u,inputEl:L.current,parentEl:B.current,theme:ee,maxHeight:g,setOpen:Q,search:l,searchText:I,searchPlaceholder:S,showCloseBtn:x,whenScrollCloseDropBox:C,noDataMsg:O,handleSearchTextChange:me,handleKeyPress:Ue,children:ye})})]})});Uv.displayName="RBSelectBox";const zue=he("inline-flex w-full items-start gap-2",{defaultVariants:{controlPlacement:"start",size:"default",tone:"default",type:"default"},compoundVariants:[{className:"outline-border-danger-stronger",tone:"invalid",type:"box"}],variants:{controlPlacement:{end:"justify-between",start:"justify-start"},size:{default:"",sm:"gap-1.5"},tone:{default:"",disabled:"",invalid:""},type:{box:"bg-raised outline-border-subtle p-2_5 rounded-md outline outline-1 outline-offset-[-1px]",default:""}}}),Fue=he("focus-visible:ring-border-stronger data-[state=checked]:bg-fill-brand data-[state=unchecked]:bg-fill-subtler relative inline-flex shrink-0 items-center rounded-full border border-transparent outline-hidden transition-colors focus-visible:ring-2 disabled:pointer-events-none",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"},tone:{default:"",disabled:"data-[state=checked]:bg-fill-subtler data-[state=unchecked]:bg-fill-subtler",invalid:"border-danger-stronger"}},defaultVariants:{size:"default",tone:"default"}}),Vue=he(["absolute top-1/2 left-0 -translate-y-1/2","data-[state=unchecked]:translate-x-0.5","pointer-events-none rounded-full transition-transform"].join(" "),{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"},tone:{default:"data-[state=checked]:bg-fg-static-white bg-white",disabled:"bg-fg-disabled data-[state=checked]:!bg-fg-disabled",invalid:""}},defaultVariants:{size:"default",tone:"default"}}),jue=he("gap-0_5 inline-flex min-w-0 flex-1 flex-col"),Hue=he("text-fg-default",{defaultVariants:{size:"default",tone:"default"},variants:{size:{default:"typo-compact-sm-medium",sm:"typo-compact-xs-semibold"},tone:{default:"",disabled:"text-fg-disabled",invalid:"text-fg-danger"}}}),Wue=he("text-fg-default",{defaultVariants:{size:"default",tone:"default"},variants:{size:{default:"typo-compact-sm-normal",sm:"typo-compact-xs-normal"},tone:{default:"",disabled:"text-fg-disabled",invalid:""}}});function que({className:t,disabled:e=!1,invalid:n=!1,size:r="default",...o}){const a=e?"disabled":n?"invalid":"default";return h($X,{"data-slot":"switch","data-size":r,"data-tone":a,"data-pad-focus":"true",disabled:e,className:ae(Fue({tone:a,size:r}),t),...o,children:h(DX,{"data-slot":"switch-thumb",className:Vue({size:r,tone:a})})})}const Uue=Array.from({length:24},(t,e)=>String(e).padStart(2,"0")),Yue=Array.from({length:60},(t,e)=>String(e).padStart(2,"0")),Qx=t=>({hour:String(t?.getHours()??0).padStart(2,"0"),minute:String(t?.getMinutes()??0).padStart(2,"0")});function Ik({pickerType:t="range",selectedDate:e,onChange:n,labels:r}){const o=t==="range"?"min-w-[84px]":"min-w-[76px]",a=(s,l)=>{const u=e.from??e.to??new Date;let d=new Date(e.from??u),f=t==="range"?new Date(e.to??u):void 0;e.from||d.setHours(0,0,0,0),f&&!e.to&&f.setHours(0,0,0,0),(s==="from"?d:f)?.setHours(Number(l.hour),Number(l.minute),0,0),f&&d.toDateString()===f.toDateString()&&d>f&&(s==="from"?f=new Date(d):d=new Date(f)),n({...e,from:d,to:f})},i=[{label:r?.from??(t==="range"?"From":"Time"),time:Qx(e.from),onChange:s=>a("from",s)},...t==="range"?[{label:r?.to??"To",time:Qx(e.to),onChange:s=>a("to",s)}]:[]];return h("div",{"data-slot":"footer-time",className:"border-subtle flex w-full flex-col items-start border-t",children:te("div",{"data-slot":"footer-time-content",className:ae("w-full px-4 py-3",t==="range"?"inline-flex items-center justify-between gap-4":"flex flex-wrap items-start gap-2"),children:[te("label",{"data-slot":"footer-time-set-time",className:"inline-flex shrink-0 items-center gap-2",children:[h(que,{checked:e.timeEnabled,onCheckedChange:s=>n({...e,timeEnabled:s})}),h("span",{className:"typo-compact-sm-medium text-fg-default whitespace-nowrap",children:r?.setTime??"Set Time"})]}),h("div",{"data-slot":"footer-time-time-rows",className:ae("flex w-full items-center",t==="range"?"justify-end gap-4":"flex-col gap-1"),children:i.map(({label:s,time:l,onChange:u})=>te("div",{"data-slot":"footer-time-row",className:ae("inline-flex items-center",t==="range"?"shrink-0 gap-2":"w-full justify-between"),children:[h("div",{className:"typo-compact-sm-medium text-fg-subtler text-center whitespace-nowrap",children:s}),te("div",{className:"inline-flex items-center gap-2",children:[h(Uv,{"data-slot":"footer-time-hour-select",className:ae("w-fit",o),size:"sm",value:l.hour,disabled:!e.timeEnabled,readOnly:!e.timeEnabled,placeholder:l.hour,handleChange:d=>u({...l,hour:String(d??"00")}),children:Uue.map(d=>h(qv,{value:d,children:d},d))}),h(Uv,{"data-slot":"footer-time-minute-select",className:ae("w-fit",o),size:"sm",value:l.minute,disabled:!e.timeEnabled,readOnly:!e.timeEnabled,placeholder:l.minute,handleChange:d=>u({...l,minute:String(d??"00")}),children:Yue.map(d=>h(qv,{value:d,children:d},d))})]})]},s))})]})})}function Ok({label:t,onClick:e}){return h(Wr,{className:"light:bg-fill-subtlest",size:"xs",variant:"soft",onClick:e,children:t})}const Lk=he(["gap-1_5 inline-flex min-w-72 items-center overflow-hidden","outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"h-8 rounded-md px-2",sm:"h-9 rounded-md px-2",md:"px-2_5 h-10 rounded-md",lg:"px-2_5 h-12 rounded-lg"},variant:{default:"bg-fill-control-surface outline-border-default"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled pointer-events-none cursor-not-allowed",false:""},interactive:{true:"cursor-pointer",false:"cursor-default"}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{focus:!0,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,interactive:!0}}),$k=he("inline-flex shrink-0 items-center justify-center [&_svg]:block [&_svg]:shrink-0 [&_svg]:leading-none",{variants:{size:{xs2:"size-4",sm:"size-4",md:"size-5",lg:"size-5"},disabled:{true:"text-fg-disabled",false:"text-fg-subtlest"}},defaultVariants:{size:"md",disabled:!1}}),Dk=he("inline-flex min-w-0 flex-1 items-center gap-1 overflow-hidden whitespace-nowrap"),c0=he("truncate",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-medium",md:"typo-compact-sm2-medium",lg:"typo-compact-sm2-medium"},tone:{default:"text-fg-default",placeholder:"text-fg-subtler font-normal"},disabled:{true:"text-fg-disabled",false:""}},compoundVariants:[{tone:"placeholder",disabled:!0,className:"text-fg-disabled"}],defaultVariants:{size:"md",tone:"default",disabled:!1}}),Gue=he("",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-medium",lg:"typo-compact-sm2-medium"},disabled:{true:"text-fg-disabled",false:"text-fg-subtler"}},defaultVariants:{size:"md",disabled:!1}}),Bk=he(["bg-overlay relative z-[1]","shadow-up-lg inline-flex flex-col overflow-visible","outline-border-subtle rounded-md outline outline-1 outline-offset-[-2px]"].join(" "),{variants:{pickerType:{basic:"max-w-72",range:"min-w-140"}},defaultVariants:{pickerType:"basic"}}),Kue=he("py-1_5 inline-flex w-full items-start justify-between"),Xue=he("inline-flex flex-1 flex-col items-start justify-start p-3"),Zue=he("typo-compact-sm-medium inline-flex size-5 items-center justify-center text-center",{variants:{weekend:{true:"text-fg-danger",false:"text-fg-default"}},defaultVariants:{weekend:!1}}),xl=he(["typo-compact-sm-medium relative flex h-9 flex-1 items-center justify-center px-2 text-center","transition-colors"].join(" "),{variants:{state:{default:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered rounded-md",disabled:"bg-fill-transparent text-fg-disabled pointer-events-none !cursor-default rounded-md",single:"bg-fill-brand text-fg-default hover:!bg-fill-brand-hovered rounded-md font-semibold",rangeStart:"bg-fill-brand hover:!bg-fill-brand-hovered rounded-none! rounded-l-md! font-medium text-white",rangeMiddle:"bg-fill-subtlest text-fg-default rounded-none!",rangeEnd:"bg-fill-brand hover:!bg-fill-brand-hovered rounded-none! rounded-r-md! font-medium text-white"}},defaultVariants:{state:"default"}}),{useRef:Que}=await q("react");function Jue(t){const e=Que(null),n=wC(t.date,t.displayMonth,e);if(n.isHidden)return h("div",{role:"gridcell"});if(!n.isButton)return h("div",{...n.divProps});const r=n.activeModifiers.outside,o=n.buttonProps["aria-selected"]===!0||n.buttonProps["aria-selected"]==="true"||n.activeModifiers.selected||n.activeModifiers.range_start||n.activeModifiers.range_end||n.activeModifiers.range_middle,a=r||n.activeModifiers.range_start||n.activeModifiers.range_end||n.activeModifiers.range_middle,i=n.buttonProps.className?.replace(a?/\bday_selected\b/g:/$^/,"").replace(r||o?/\bday_range_start\b|\bday_range_end\b|\bday_range_middle\b|\bday_today\b/g:/$^/,"").replace(/\s+/g," ").trim();return h(nf,{ref:e,...n.buttonProps,className:i,"aria-selected":r?void 0:n.buttonProps["aria-selected"],disabled:n.buttonProps.disabled||r})}function zk({className:t,classNames:e,showOutsideDays:n=!0,...r}){return h(PX,{showOutsideDays:n,className:ae("cursor-default p-0",t),classNames:{months:ae(Kue(),r.mode==="range"?"gap-0":"justify-center"),month:Xue(),caption:"bg-fill-transparent relative inline-flex h-8 w-full items-center justify-center px-8",caption_label:"typo-compact-sm-semibold text-fg-default pointer-events-none",nav:"flex items-center gap-1",nav_button:ae(u8({variant:"transparent",size:"xs"}),"absolute top-1/2 size-5 -translate-y-1/2 p-0"),nav_button_previous:"left-0",nav_button_next:"right-0",table:"w-full border-collapse",head_row:"inline-flex h-10 w-full items-center justify-center",head_cell:ae("flex h-9 flex-1 items-center justify-center overflow-hidden px-2",Zue(),"[&:first-child]:text-fg-danger [&:last-child]:text-fg-danger"),row:"inline-flex h-10 w-full items-center justify-center",cell:ae("relative flex h-9 flex-1 items-center justify-center overflow-hidden p-0 text-center focus-within:relative focus-within:z-20",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md! [&:has(>.day-range-start)]:rounded-l-md! first:[&:has([aria-selected])]:rounded-l-md! last:[&:has([aria-selected])]:rounded-r-md!":"[&:has([aria-selected])]:rounded-md!"),day:ae(xl({state:"default"}),"h-9 w-full flex-none px-0"),day_range_start:ae(xl({state:"rangeStart"}),"h-9 w-full flex-none px-0 text-white!"),day_range_end:ae(xl({state:"rangeEnd"}),"h-9 w-full flex-none px-0 text-white!"),day_selected:ae(xl({state:"single"}),"h-9 w-full flex-none px-0"),day_today:"[&:not([aria-selected=true])]:!bg-fill-default [&:not([aria-selected=true])]:hover:!bg-fill-default [&:not([aria-selected=true])]:rounded-full! [&:not([aria-selected=true])]:!text-fg-inverse",day_outside:ae(xl({state:"disabled"}),"!bg-fill-transparent hover:!bg-fill-transparent aria-selected:text-fg-disabled"),day_disabled:ae(xl({state:"disabled"}),"h-9 w-full flex-none px-0"),day_range_middle:ae(xl({state:"rangeMiddle"}),"h-9 w-full flex-none rounded-none! px-0 hover:text-white!"),day_hidden:"invisible",...e},components:{Day:Jue,IconLeft:({className:o,...a})=>h(X0,{className:ae("size-4",o),...a}),IconRight:({className:o,...a})=>h(Su,{className:ae("size-4",o),...a})},...r})}const{useCallback:_d,useEffect:Jx,useId:ede,useRef:tde,useState:xd}=await q("react"),nde=[{key:"today",label:"Today"},{key:"month-ago",label:"1 month ago"},{key:"year-ago",label:"1 year ago"}],rde=()=>({hour:"00",minute:"00"}),Yv=t=>t?{hour:String(t.getHours()).padStart(2,"0"),minute:String(t.getMinutes()).padStart(2,"0")}:rde(),e6=t=>!!(t&&(t.getHours()!==0||t.getMinutes()!==0)),t6=(t,e)=>{const n=new Date(t);return n.setHours(Number(e.hour),Number(e.minute),0,0),n},n6=t=>Array.isArray(t)?t[0]:t,r6=(t,e,n)=>{if(!t)return e;const r=V8(t.getTime());if(!n)return r;const o=Yv(t);return`${r} ${o.hour}:${o.minute}`},W3e=({className:t,showType:e="popover",value:n,name:r,disabled:o,readOnly:a,size:i="md",variant:s="default",error:l=!1,showPresets:u=!0,showFooter:d=!0,placeholder:f,handleChange:m})=>{const v=tde(null),g=ede().replace(/:/g,""),[w,y]=xd(!1),[_,S]=xd(!1),[x,C]=xd(()=>{const I=n6(n);return{from:I,to:void 0,timeEnabled:e6(I)}}),[R,P]=xd(x),[O,$]=xd(x.from??new Date),A=typeof f=="string"?f:"Select date",M=()=>{o||y(!0)},L=I=>{I.key==="Enter"&&(v.current?.open(),y(!0))},B=_d(()=>{y(!1),v.current?.close()},[]),F=_d(()=>{if(R.from){const I=new Date(R.from);R.timeEnabled?I.setSeconds(0,0):I.setHours(0,0,0,0),C(R),m?.(I,void 0,r??"")}B()},[m,B,r,R]),N=_d(()=>{const I={from:void 0,to:void 0,timeEnabled:!1};C(I),P(I),m?.(void 0,void 0,r??"")},[m,r]),V=_d(I=>{const D=new Date,U=new Date(D);switch(I){case"today":break;case"month-ago":U.setMonth(D.getMonth()-1);break;case"year-ago":U.setFullYear(D.getFullYear()-1);break}P(Y=>({...Y,from:t6(U,Yv(Y.from))})),$(U)},[]),z=_d(()=>te(Ul,{className:ae(Bk({pickerType:"basic"})),children:[u&&h("div",{"data-slot":"date-input-presets",className:"border-subtle inline-flex w-full flex-wrap items-start justify-center gap-1 border-b px-3 py-4",children:nde.map(I=>h(Ok,{label:I.label,onClick:()=>V(I.key)},I.key))}),h(zk,{"data-slot":"date-input-calendar",month:O,selected:R.from,mode:"single",numberOfMonths:1,onMonthChange:$,onSelect:I=>{P(D=>({...D,from:I?t6(I,Yv(D.from)):void 0})),I&&$(I)}}),d&&h(Ik,{"data-slot":"date-input-footer-time",pickerType:"basic",selectedDate:R,onChange:P}),h(Nk,{"data-slot":"date-input-footer-button",onReset:N,onCancel:B,onConfirm:F})]}),[F,B,V,N,R,O,d,u]);return Jx(()=>{const I=n6(n),D={from:I,to:void 0,timeEnabled:e6(I)};C(D),P(D),$(I??new Date)},[n]),Jx(()=>{w||(P(x),$(x.from??new Date))},[w,x]),te(Mr,{children:[te(P3,{ref:v,disabled:o,anchorId:e==="popover"&&!o?`date-input-popover-${g}`:void 0,className:ae("inline-block"),ripple:{disabled:!0},popoverStyle:{top:"10px",left:"0"},popoverElement:h(z,{}),onClose:()=>y(!1),onClick:M,children:[te("div",{"data-slot":"date-input",className:ae(Lk({size:i,variant:s,focus:_||w,error:l,readOnly:a,disabled:o,interactive:!o&&!a}),t),children:[h("span",{"data-slot":"date-input-icon","aria-hidden":!0,className:$k({size:i,disabled:o}),children:h(rw,{})}),h("span",{"data-slot":"date-input-content",className:Dk(),children:h("input",{"data-slot":"date-input-input",type:"text",readOnly:!0,disabled:o,value:r6(x.from,"",x.timeEnabled),placeholder:r6(void 0,A,!1),onFocus:()=>S(!0),onBlur:()=>S(!1),onKeyDown:L,className:ae("w-full min-w-0",c0({size:i,tone:x.from?"default":"placeholder",disabled:o}))})})]}),e==="popover"&&h("div",{id:`date-input-popover-${g}`})]}),e==="modal"&&h(tc,{className:ae("w-auto border-none p-0"),open:w,hideCloseButton:!0,onOpenChange:y,children:h(z,{})})]})},o6=[{key:"last-24-hours",label:"Last 24 hours"},{key:"last-3-days",label:"Last 3 days"},{key:"last-week",label:"Last week"},{key:"last-month",label:"Last month"},{key:"last-3-month",label:"Last 3 month"}],ode=(t,e=new Date)=>{const n=new Date(e),r=new Date(e);switch(t){case"last-24-hours":n.setDate(e.getDate()-1);break;case"last-3-days":n.setDate(e.getDate()-3);break;case"last-week":n.setDate(e.getDate()-7);break;case"last-month":n.setMonth(e.getMonth()-1);break;case"last-3-month":n.setMonth(e.getMonth()-3);break}return{from:n,to:r}},{useCallback:Sd,useEffect:a6,useId:ade,useRef:ide,useState:m1}=await q("react"),sde=(t,e,n)=>{const r=[];return t&&r.push({before:t}),e&&r.push({after:e}),Array.isArray(n)?r.push(...n):n!==void 0&&r.push(n),r},Gv=()=>({hour:"00",minute:"00"}),kl=t=>t?{hour:String(t.getHours()).padStart(2,"0"),minute:String(t.getMinutes()).padStart(2,"0")}:Gv(),g1=t=>!!(t&&(t.getHours()!==0||t.getMinutes()!==0)),bs=(t,e)=>{const n=new Date(t);return n.setHours(Number(e.hour),Number(e.minute),0,0),n},lde=(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),i6=(t,e,n)=>{if(!t)return e;const r=V8(t.getTime());if(!n)return r;const o=kl(t);return`${r} ${o.hour}:${o.minute}`},q3e=({className:t,calendarPanelClassName:e,showType:n="popover",value:r,name:o,min:a,max:i,maxDays:s,placeholder:l,disabled:u,disabledDates:d,readOnly:f,size:m="md",variant:v="default",error:g=!1,showPresets:w=!0,showFooter:y=!0,handleChange:_,presets:S})=>{const x=ide(null),C=ade().replace(/:/g,""),[R,P]=m1(!1),[O]=m1(!1),[$,A]=m1({from:r?.[0],to:r?.[1],timeEnabled:g1(r?.[0])||g1(r?.[1])}),[M,L]=m1($),B=!!($?.from||$?.to),F=typeof l=="string"?l:l?.start||l?.end||"Select date",N=()=>{u||P(!0)},V=Sd(()=>{P(!1),x.current?.close()},[]),z=Sd(()=>{if(M.from){const Y=M.to??M.from,oe=bs(M.from,kl(M.from)),Q=bs(Y,kl(Y)),re=M.timeEnabled?oe:bs(oe,Gv()),le=M.timeEnabled?Q:bs(Q,Gv());A({from:oe,to:Q,timeEnabled:M.timeEnabled}),_?.(re,le,o??"")}V()},[_,V,o,M]),I=Sd(()=>{const Y={from:void 0,to:void 0,timeEnabled:!1};A(Y),L(Y),_?.(void 0,void 0,o??"")},[_,o]),D=Sd(Y=>{const{from:oe,to:Q}=ode(Y);L(re=>({...re,from:bs(oe,kl(re.from)),to:bs(Q,kl(re.to))}))},[]),U=Sd(()=>te(Ul,{className:ae(Bk({pickerType:"range"}),e),children:[w&&h("div",{"data-slot":"data-input-presets",className:"border-subtle inline-flex w-full flex-wrap items-start justify-center gap-1 border-b px-3 py-4",children:(S?o6.filter(Y=>S.includes(Y.key)):o6).map(Y=>h(Ok,{label:Y.label,onClick:()=>D(Y.key)},Y.key))}),h(zk,{"data-slot":"data-input-calendar",selected:M,mode:"range",numberOfMonths:2,max:s,disabled:sde(a,i,d),initialFocus:!0,defaultMonth:M?.from,onSelect:Y=>{L(oe=>{const Q=Y?.from?bs(Y.from,kl(oe.from)):void 0;let re=Y?.to;!re&&oe.timeEnabled&&oe.to&&(re=Y?.from);let le=re?bs(re,kl(oe.to)):void 0;return Q&&le&&lde(Q,le)&&Q>le&&(le=new Date(Q)),{...oe,from:Q,to:le}})}}),y&&h(Ik,{"data-slot":"date-input-footer-time",pickerType:"range",selectedDate:M,onChange:L}),h(Nk,{"data-slot":"date-input-footer-button",onReset:I,onCancel:V,onConfirm:z})]}),[e,D,V,z,I,d,i,s,a,S,M,y,w]);return a6(()=>{const Y={from:r?.[0],to:r?.[1]},oe={...Y,timeEnabled:g1(Y.from)||g1(Y.to)};A(oe),L(oe)},[r]),a6(()=>{R||L($)},[R,$]),te(Mr,{children:[te(P3,{ref:x,disabled:u,anchorId:n==="popover"&&!u?`date-input-popover-${C}`:void 0,className:"inline-block",ripple:{disabled:!0},popoverStyle:{top:"10px",left:"0"},popoverElement:h(U,{}),onClose:()=>P(!1),onClick:N,children:[te("div",{"data-slot":"date-input",className:ae(Lk({size:m,variant:v,focus:O||R,error:g,readOnly:f,disabled:u,interactive:!u&&!f}),t),children:[h("span",{"data-slot":"date-input-icon","aria-hidden":!0,className:$k({size:m,disabled:u}),children:h(rw,{})}),h("span",{"data-slot":"date-input-content",className:Dk(),children:B?te(Mr,{children:[h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:$?.from?"default":"placeholder",disabled:u}),children:i6($?.from,F,$.timeEnabled)}),h("span",{"data-slot":"date-input-separator",className:Gue({size:m,disabled:u}),children:"~"}),h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:$?.to?"default":"placeholder",disabled:u}),children:i6($?.to,F,$.timeEnabled)})]}):h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:"placeholder",disabled:u}),children:F})})]}),n==="popover"&&h("div",{id:`date-input-popover-${C}`})]}),n==="modal"&&h(tc,{className:ae("w-auto max-w-fit border-none p-0"),open:R,hideCloseButton:!0,onOpenChange:P,children:h(U,{})})]})},cde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),ude=he("bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 shadow-down-md fixed top-1/2 left-1/2 z-50 inline-flex max-w-[95vw] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg outline-hidden transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{size:{sm:"max-h-[25rem] min-h-40 w-[22.5rem]",md:"max-h-[35rem] w-[30rem]",lg:"max-h-[35rem] w-[34.375rem]"}},defaultVariants:{size:"lg"}}),dde=he("gap-0_5 relative flex flex-col items-start self-stretch px-4 pt-4 pr-16 pb-2"),fde=he("flex items-center justify-end gap-4 self-stretch p-4"),pde=he("text-fg-default typo-title-01-bold"),hde=he("text-fg-subtle typo-compact-sm-normal"),mde=he("text-fg-subtle hover:bg-fill-transparent-hovered hover:text-fg-default focus-visible:outline-border-stronger absolute top-3 right-3 inline-flex size-7 items-center justify-center rounded-[3px] outline-hidden transition-colors focus-visible:outline focus-visible:outline-1"),{forwardRef:Vh,useEffect:gde,useId:vde,useRef:wde}=await q("react"),q0=new Map,bde=300;function yde(t,e){q0.set(t,e)}function s6(t){q0.delete(t)}function _de(){const t=Array.from(q0.values());if(q0.clear(),t.length===0){Rl.resetModal();return}t.forEach(e=>e()),setTimeout(()=>{const e=document.querySelectorAll('[data-slot="dialog-content"][data-state="closed"]'),n=Array.from(e).flatMap(r=>r.getAnimations().map(o=>o.finished));if(n.length===0){Rl.resetModal();return}Promise.allSettled(n).then(()=>{Rl.resetModal()})},bde)}function xde({...t}){const e=vde(),n=wde(t.onOpenChange);return n.current=t.onOpenChange,gde(()=>(t.open?yde(e,()=>n.current?.(!1)):s6(e),()=>s6(e)),[e,t.open]),h(bf,{"data-slot":"dialog",...t})}function U3e({...t}){return h(Vw,{"data-slot":"dialog-trigger",...t})}function Sde({...t}){return h(yf,{"data-slot":"dialog-portal",...t})}function Y3e({...t}){return h(Zl,{"data-slot":"dialog-close",...t})}const Fk=Vh(({closeAllLabel:t},e)=>h("button",{ref:e,type:"button","aria-label":"dialog-all-close",className:"text-fg-default typo-compact-sm-semibold border-fg-subtler bg-fg-inverse pointer-events-auto fixed top-4 right-4 z-50 h-8 w-20 cursor-pointer rounded-md border p-1",onClick:_de,children:h("span",{children:t})}));Fk.displayName="RBDialogCloseAll";const Vk=Vh(({className:t,...e},n)=>h(_f,{ref:n,"data-slot":"dialog-overlay",className:ae(cde(),t),...e}));Vk.displayName="RBDialogOverlay";function Cde({className:t,children:e,container:n,showCloseButton:r=!0,size:o="lg",closeAllLabel:a,...i}){const s=n??(typeof document<"u"?document.querySelector(".modal-container")??void 0:void 0);return te(Sde,{container:s,children:[h(Vk,{onContextMenu:l=>l.preventDefault()}),h(Fk,{closeAllLabel:a}),te(xf,{"data-slot":"dialog-content","data-size":o,className:ae(ude({size:o}),t),...i,children:[e,r&&te(Zl,{"data-slot":"dialog-close",className:mde(),tabIndex:-1,children:[h(df,{className:"size-4"}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function Ede({className:t,...e}){return h("div",{"data-slot":"dialog-header",className:ae(dde(),t),...e})}function Mde({className:t,...e}){return h("div",{"data-slot":"dialog-footer",className:ae(fde(),t),...e})}const u0=Vh(({className:t,...e},n)=>h(Sf,{ref:n,"data-slot":"dialog-title",className:ae(pde(),t),...e}));u0.displayName="RBDialogTitle";const d0=Vh(({className:t,...e},n)=>h(Cf,{ref:n,"data-slot":"dialog-description",className:ae(hde(),t),...e}));d0.displayName="RBDialogDescription";const kde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),Rde=he("bg-raised border-subtle data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex h-auto flex-col overflow-hidden transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{defaultVariants:{side:"bottom"},variants:{side:{top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 w-full rounded-b-xl border-b",bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 w-full rounded-t-xl border-t",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 max-w-96 rounded-r-xl border-r",right:"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 max-w-96 rounded-l-xl border-l"}}}),Tde=he("bg-fg-default h-1 w-28 rounded-full"),Nde=he("flex items-center justify-center self-stretch pt-4"),Pde=he("gap-0_5 flex flex-col p-4"),Ade=he("mt-auto flex flex-col items-stretch gap-2 self-stretch p-4"),Ide=he("text-fg-default typo-title-01-medium"),Ode=he("text-fg-subtle typo-compact-sm-normal"),Lde=he("flex flex-col gap-3 self-stretch overflow-hidden px-4 pt-4"),$de=he("text-fg-default hover:text-fg-default-hovered focus-visible:outline-border-stronger absolute top-4 right-4 inline-flex size-4 items-center justify-center rounded-xs outline-hidden transition-colors focus-visible:outline focus-visible:outline-1");function Dde({side:t,...e}){return h(qr.Root,{"data-slot":"drawer",...e,direction:t??e.direction})}function G3e({...t}){return h(qr.Trigger,{"data-slot":"drawer-trigger",...t})}function K3e({...t}){return h(qr.Close,{"data-slot":"drawer-close",...t})}function Bde({...t}){return h(qr.Portal,{"data-slot":"drawer-portal",...t})}function zde({className:t,...e}){return h(qr.Overlay,{"data-slot":"drawer-overlay",className:ae(kde(),t),...e})}function Fde({className:t,children:e,side:n="bottom",showHandle:r,showCloseButton:o=!1,...a}){const i=r??n==="bottom";return te(Bde,{children:[h(zde,{}),te(qr.Content,{"data-slot":"drawer-content","data-position":n,className:ae(Rde({side:n}),t),...a,children:[n==="bottom"&&i&&h("div",{className:Nde(),children:h("div",{className:Tde()})}),e,o&&te(qr.Close,{className:$de(),children:[h(df,{}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function Vde({className:t,...e}){return h("div",{"data-slot":"drawer-header",className:ae(Pde(),t),...e})}function X3e({className:t,...e}){return h("div",{"data-slot":"drawer-body",className:ae(Lde(),t),...e})}function jde({className:t,...e}){return h("div",{"data-slot":"drawer-footer",className:ae(Ade(),t),...e})}function Hde({className:t,...e}){return h(qr.Title,{"data-slot":"drawer-title",className:ae(Ide(),t),...e})}function Wde({className:t,...e}){return h(qr.Description,{"data-slot":"drawer-description",className:ae(Ode(),t),...e})}const qde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),Ude=he("bg-raised outline-border-subtle data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 p-4 outline outline-1 outline-offset-[-1px] transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{defaultVariants:{side:"right"},variants:{side:{bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom shadow-up-lg inset-x-0 bottom-0 h-[520px] max-h-[80vh]",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full max-w-[90vw] shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.10)] shadow-lg",right:"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right shadow-up-lg inset-y-0 right-0 h-full max-w-[90vw]",top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-[520px] max-h-[80vh] shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.10)] shadow-lg"}}}),Yde=he("gap-0_5 flex flex-col"),Gde=he("mt-auto flex flex-col items-stretch gap-2 overflow-hidden"),Kde=he("text-fg-default typo-title-01-medium"),Xde=he("text-fg-subtle typo-compact-sm-normal"),Zde=he("text-fg-default hover:text-fg-default-hovered focus-visible:outline-border-stronger absolute top-4 right-4 inline-flex size-4 items-center justify-center rounded-xs outline-hidden transition-colors focus-visible:outline focus-visible:outline-1");function Qde({...t}){return h(bf,{"data-slot":"sheet",...t})}function Z3e({...t}){return h(Vw,{"data-slot":"sheet-trigger",...t})}function Q3e({...t}){return h(Zl,{"data-slot":"sheet-close",...t})}function Jde({...t}){return h(yf,{"data-slot":"sheet-portal",...t})}function efe({className:t,...e}){return h(_f,{"data-slot":"sheet-overlay",className:ae(qde(),t),...e})}function tfe({className:t,children:e,side:n="right",showCloseButton:r=!0,...o}){return te(Jde,{children:[h(efe,{}),te(xf,{"data-slot":"sheet-content","data-position":n,className:ae(Ude({side:n}),t),...o,children:[e,r&&te(Zl,{className:Zde(),children:[h(df,{}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function nfe({className:t,...e}){return h("div",{"data-slot":"sheet-header",className:ae(Yde(),t),...e})}function rfe({className:t,...e}){return h("div",{"data-slot":"sheet-footer",className:ae(Gde(),t),...e})}function ofe({className:t,...e}){return h(Sf,{"data-slot":"sheet-title",className:ae(Kde(),t),...e})}function afe({className:t,...e}){return h(Cf,{"data-slot":"sheet-description",className:ae(Xde(),t),...e})}const ife=({className:t,type:e,open:n,onOpenChange:r,header:o,footer:a,children:i,hideCloseButton:s,handleInteractOutside:l})=>{const u=e.split("-")[0];return h(Qde,{open:n,onOpenChange:r,children:te(tfe,{className:ae(t,{"[&>button:last-child]:hidden":s}),side:u,onInteractOutside:l,children:[!!o&&te(nfe,{children:[!!o.title&&h(ofe,{children:o.title}),!!o.description&&h(afe,{children:o.description})]}),i,!!a&&h(rfe,{children:a})]})})},jh=({className:t,open:e,type:n="dialog",dialogContainer:r,children:o,enableDimClose:a=!0,header:i,hideCloseButton:s,footer:l,gamePadType:u="modal",onOpenChange:d,disableAutoFocus:f=!1,closeAllButtonLabel:m="Close All"})=>{const v=g=>{a||g.preventDefault()};return n==="drawer"?h(Dde,{open:e,onOpenChange:d,children:te(Fde,{className:ae(t),onInteractOutside:v,children:[!!i&&te(Vde,{children:[!!i.title&&h(Hde,{children:i.title}),!!i.description&&h(Wde,{children:i.description})]}),o,!!l&&h(jde,{children:l})]})}):n==="dialog"?h(xde,{open:e,onOpenChange:d,children:te(Cde,{...f&&{onOpenAutoFocus:g=>g.preventDefault()},className:ae(t),container:r,"data-pad-scope":u,showCloseButton:!s,closeAllLabel:m,onInteractOutside:v,children:[i?te(Ede,{children:[i.title?h(u0,{children:i.title}):h(Il,{children:h(u0,{})}),i.description?h(d0,{children:i.description}):h(Il,{children:h(d0,{})})]}):te(Il,{children:[h(u0,{}),h(d0,{})]}),o,!!l&&h(Mde,{children:l})]})}):h(ife,{className:t,type:n,header:i,footer:l,open:e,enableDimClose:a,hideCloseButton:s,onOpenChange:d,handleInteractOutside:v,children:o})},sfe=({className:t,containerId:e,open:n,onOpenChange:r,title:o,content:a,contentClassName:i,buttonText:s="확인",snapshotCnt:l,resolve:u,onConfirm:d})=>{const f=()=>{u(!0),d?.()};return h(jh,{"data-slot":"alert-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:n,onOpenChange:r,type:"dialog",dialogContainer:e?document.getElementById(e):void 0,snapshotCnt:l,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:o?{title:o}:void 0,footer:h(Wr,{variant:"brand",onClick:f,children:s}),children:h("div",{"data-slot":"alert-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",i),children:a})})},{useState:lfe}=await q("react"),cfe=({className:t,open:e,onOpenChange:n,title:r,description:o,content:a,contentClassName:i,buttonText:s={yes:"Confirm",no:"Cancel"},buttonClassName:l,buttonWrapperClassName:u,snapshotCnt:d,containerId:f,onConfirm:m,onCancel:v,resolve:g})=>{const[w,y]=lfe(!1),_=async()=>{y(!0);try{await m?.(),g(!0)}finally{y(!1)}},S=()=>{v?.(),g(!1)};return h(jh,{"data-slot":"confirm-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:d,dialogContainer:f?document.getElementById(f):void 0,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:r||o?{title:r,description:o}:void 0,footer:te(Yo,{"data-slot":"confirm-modal-button-wrapper",className:ae("btn-wrapper",u),alignItems:"center",gap:8,children:[h(Wr,{variant:"outlined",className:ae(l?.no),disabled:w,onClick:S,children:s.no}),h(Wr,{variant:"brand",className:ae(l?.yes),autoFocus:!0,loading:w,onClick:_,children:s.yes})]}),children:h("div",{"data-slot":"confirm-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",i),children:a})})},ufe={default:"text-fg-subtle",error:"text-fg-danger",success:"text-fg-success"};function dfe({className:t,helperText:e,helperTone:n="default"}){return e?h("div",{"data-slot":"text-helper",className:ae("pt-1_5 w-full",t),children:h("div",{"data-slot":"text-helper-message",className:ae("typo-compact-xs-normal",ufe[n]),children:e})}):null}function ffe({className:t,label:e,description:n,required:r=!1,children:o}){return!e&&!n&&!o?null:te("div",{"data-slot":"text-label",className:ae("gap-0_5 flex w-full flex-col",t),children:[e&&te("div",{"data-slot":"text-label-heading",className:"gap-0_5 typo-compact-xs-semibold inline-flex items-start",children:[h("span",{"data-slot":"text-label-text",className:"text-fg-default",children:e}),r&&h("span",{"data-slot":"text-label-required",className:"text-fg-information",children:"*"})]}),n&&h("div",{"data-slot":"text-label-description",className:"text-fg-subtle typo-compact-xs-normal",children:n}),o&&h("div",{className:"pt-1","data-slot":"text-label-children",children:o})]})}function pfe({className:t="",labelClassName:e="",helperClassName:n="",label:r,description:o,required:a=!1,helperText:i,helperTone:s="default",children:l}){return h("div",{"data-slot":"text-field",className:ae("w-full",t),children:te(ffe,{className:e,label:r,description:o,required:a,children:[h("div",{"data-slot":"text-field-control",children:l}),h(dfe,{className:n,helperText:i,helperTone:s})]})})}const{cloneElement:hfe,useState:l6}=await q("react"),mfe=({className:t,open:e,onOpenChange:n,title:r,content:o,contentClassName:a,placeholder:i,inputType:s="text",inputElement:l,label:u,description:d,required:f=!1,helperText:m,helperTone:v="default",autoFocus:g=!1,value:w,buttonText:y={yes:"Confirm",no:"Cancel"},buttonClassName:_,buttonWrapperClassName:S,containerId:x,snapshotCnt:C,resolve:R,close:P})=>{const[O,$]=l6(w||""),[A,M]=l6(!1),L=s==="password"&&A?"text":s;return h(jh,{"data-slot":"prompt-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:C,dialogContainer:x?document.getElementById(x):void 0,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:r?{title:r}:void 0,footer:te(Yo,{"data-slot":"prompt-modal-button-wrapper",className:ae("btn-wrapper",S),alignItems:"center",gap:8,children:[h(Wr,{variant:"outlined",className:ae(_?.no),onClick:()=>R(null),children:y.no}),h(Wr,{variant:"brand",className:ae(_?.yes),onClick:()=>R(O),children:y.yes})]}),children:te(Ul,{children:[o&&h("div",{"data-slot":"prompt-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",a),children:o}),l?h("div",{"data-slot":"prompt-modal-input",className:"w-full px-4 py-2",children:hfe(l,{value:O,handleChange:$,tabIndex:g?0:-1,placeholder:i,type:s})}):h("div",{"data-slot":"prompt-modal-input",className:"w-full px-4 py-2",children:h(pfe,{label:u,description:d,required:f,helperText:m,helperTone:v,children:te("div",{className:"relative w-full",children:[h(sw,{className:ae("w-full",s==="password"&&"pr-10"),type:L,tabIndex:g?0:-1,placeholder:i,value:O,handleChange:$,handleEnter:()=>R(O)}),s==="password"&&h("button",{type:"button",className:"text-fg-subtle hover:text-fg-default absolute top-1/2 right-4 -translate-y-1/2",onClick:()=>M(B=>!B),children:A?h(k8,{className:"size-4"}):h(R8,{className:"size-4"})})]})})})]})})},gfe=he("gap-2_5 inline-flex items-center justify-center pt-4"),P2=he("gap-0_5 flex items-center justify-start"),v1=he("py-0_5 inline-flex size-6 shrink-0 items-center justify-center rounded-sm transition-colors duration-200 ease-out",{variants:{disabled:{true:"bg-fill-transparent text-fg-disabled pointer-events-none",false:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered"}},defaultVariants:{disabled:!1}}),w1=he("inline-flex size-3.5 items-center justify-center"),vfe=he("inline-flex size-6 shrink-0 flex-col items-center justify-center rounded-md transition-colors duration-200 ease-out",{variants:{selected:{true:"text-fg-default outline-border-default outline outline-1 outline-offset-[-1px]",false:"text-fg-subtler hover:bg-fill-subtler-hovered"}},defaultVariants:{selected:!1}}),wfe=he("inline-flex h-5 w-7 items-center justify-center text-center text-xs leading-4 font-semibold"),{useMemo:Cd}=await q("react"),J3e=({className:t,currPage:e=1,listSize:n=20,pageSize:r=5,totalCount:o=0,handlePageChange:a})=>{const i=Cd(()=>{const f=o/n;return f%1===0?f:Math.floor(f)+1},[n,o]),s=Cd(()=>{const f=Math.ceil(i/r);return Array.from({length:f},(m,v)=>Array.from({length:r},(g,w)=>v*r+w+1))},[r,i]),l=Cd(()=>{const f=(s.find(m=>m.includes(e))??[]).filter(m=>m<=i);return f.length===0?[1]:f},[e,s,i]),u=Cd(()=>{const f=l[0]??1;return Math.max(1,f-1)},[l]),d=Cd(()=>{const f=l[l.length-1]??i;return Math.min(i,f+1)},[l,i]);return te("div",{"data-slot":"pagination",className:ae(gfe(),t),children:[te("div",{"data-slot":"pagination-prev-group",className:P2(),children:[h("button",{"data-slot":"pagination-prev-double",className:v1({disabled:e===1}),type:"button",disabled:e===1,onClick:()=>a(u),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(_8,{})})}),h("button",{"data-slot":"pagination-prev",className:v1({disabled:e===1}),type:"button",disabled:e===1,onClick:()=>a(e-1),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(X0,{})})})]}),h("div",{"data-slot":"pagination-pages",className:P2(),children:l.map(f=>h("button",{"data-slot":"pagination-page",className:vfe({selected:e===f}),type:"button",onClick:()=>a(f),children:h("span",{"data-slot":"pagination-page-text",className:wfe(),children:f})},f))}),te("div",{"data-slot":"pagination-next-group",className:P2(),children:[h("button",{"data-slot":"pagination-next",className:v1({disabled:!(e<i)}),type:"button",disabled:!(e<i),onClick:()=>a(e+1),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(Su,{})})}),h("button",{"data-slot":"pagination-next-double",className:v1({disabled:e===i||i===0}),type:"button",disabled:e===i||i===0,onClick:()=>a(d),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(x8,{})})})]})]})},bfe=he(["inline-flex w-48 items-center gap-1 overflow-hidden","bg-fill-control-surface outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"h-8 rounded-md px-0.5",sm:"h-9 rounded-md px-0.5",md:"h-10 rounded-md px-0.5",lg:"h-12 rounded-lg px-1"},variant:{default:"outline-border-default",success:"outline-border-success-stronger"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled pointer-events-none cursor-not-allowed",false:""},inputDisabled:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{variant:"success",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-success-stronger"},{focus:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{inputDisabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1}}),c6=he("bg-fill-transparent touch-action-none inline-flex shrink-0 items-center justify-center rounded-sm transition-[background-color] [&_*]:pointer-events-none",{variants:{size:{xs2:"size-7",sm:"size-8",md:"size-9",lg:"size-10"},disabledLike:{true:"cursor-not-allowed",false:"cursor-pointer"},pressed:{true:"scale-90",false:""}},defaultVariants:{size:"md",disabledLike:!1,pressed:!1}}),u6=he("",{variants:{size:{xs2:"size-3.5",sm:"size-3.5",md:"size-4",lg:"size-4"},disabledLike:{true:"text-fg-disabled",false:"text-fg-default"},pressed:{true:"scale-90",false:""}},compoundVariants:[{disabledLike:!1,pressed:!0,className:"transform transition-transform"}],defaultVariants:{size:"md",disabledLike:!1,pressed:!1}}),yfe=he(["w-full border-none bg-transparent text-center ring-0 outline-none","placeholder:text-fg-subtler appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"].join(" "),{variants:{size:{xs2:"typo-compact-xs2-semibold",sm:"typo-compact-sm-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal"},variant:{default:"text-fg-default",success:"text-fg-default"},focus:{true:"placeholder:text-fg-subtler",false:""},error:{true:"placeholder:text-fg-subtler",false:""},readOnly:{true:"placeholder:text-fg-default",false:""},disabled:{true:"text-fg-disabled placeholder:text-fg-disabled",false:""},inputDisabled:{true:"text-fg-disabled placeholder:text-fg-disabled",false:""}},defaultVariants:{size:"md",variant:"default"}}),{forwardRef:_fe,useCallback:eo,useEffect:Uc,useImperativeHandle:xfe,useMemo:Sfe,useRef:Ua,useState:A2}=await q("react"),Cfe=t=>{const e=t?.target?.value;return kn.replace(e,/^0+[\d,]/gm,o=>kn.last(o)).replace(/[^\d.-]/g,"")},Efe=_fe(({className:t="",type:e,size:n,variant:r,step:o=1,error:a,isDirect:i=!0,increaseStep:s,decreaseStep:l,maxLength:u,increaseElement:d,decreaseElement:f,detectDobleClick:m,useSetButton:v,notAllowedEmptyValue:g,inputDisabled:w,disableAutoAccel:y,disableLongPress:_,fixedDigit:S,initialLongPressDelay:x=300,enableArrowKeys:C,enableWheel:R,handleChange:P,onButtonPointerDown:O,onButtonPointerUp:$,handleEnter:A,...M},L)=>{const{value:B,readOnly:F,disabled:N,min:V,max:z="9999999999999",digit:I=18,onFocus:D,onBlur:U}=M,Y=Ua(null),oe=Ua(!1),Q=Ua(!1),re=Ua({up:0,down:0}),le=Ua(""),ee=Ua(null),ne=Ua(null),ue=Ua(0),ve=Ua(0),we=Ua(x),[ye,Le]=A2(B??""),[Oe,Ne]=A2(!1),[me,pe]=A2(null),be=Sfe(()=>N||new Ut(V??0).cmp(new Ut(z))>0,[N,z,V]),Ue=eo((Ce,Ye,wt)=>{if(Ye===0)return Ce;const un=wt==="up"?new Ut(Ce||0).add(new Ut(ee.current?.increase??Ye??1)).toDP(I,Ut.ROUND_DOWN):new Ut(Ce||0).sub(new Ut(ee.current?.decrease??Ye??1)).toDP(I,Ut.ROUND_DOWN);return S!==void 0?un.toFixed(S):un.toString()},[I,S]),He=eo(Ce=>typeof Ce>"u"||!Ce||be?"":Ce.endsWith(".")?Ce:typeof V<"u"&&new Ut(Number(Ce)).lt(new Ut(V))?String(V):typeof z<"u"&&new Ut(Dl(Ce||"")).gt(new Ut(z))?String(z):Ce,[V,z,be]),qe=eo(Ce=>be?"":Ce.endsWith(".")?Ce:He(Ce),[be,He]),_e=eo(Ce=>{const Ye=Y.current;Ye&&(Ye.value=Bi(Ce??"").join("."),delete Ye.dataset.tempNumberKeypadValue,Ye.dispatchEvent(new Event("input",{bubbles:!0})))},[]),at=eo(({type:Ce,e:Ye})=>{if(!Y.current||be)return;const{value:wt,name:un}=Y.current,on=Cfe({target:{value:wt}}),Lt=I?new RegExp(`^-?[0-9]*[.]{0,1}[0-9]{0,${I}}$`,"gm"):/^-?\d{0,18}$/;on.match(Lt)&&(typeof u<"u"&&(on||"").split(".")[0].replace(/[^0-9]/g,"").length>Number(u)||(Y.current.value=Bi(on??"").join("."),le.current!==on&&(P?.(on,un,{type:Ce}),Ye&&M.onChange?.(Ye),le.current=on),Le(on)))},[be,I,u,P,M]),ht=eo((Ce,Ye)=>{Y.current&&(Ne(Ye),Ye?D?.(Ce):(Y.current.value=qe(Y.current.value),g&&!Ce.target.value&&(Y.current.value=M.value),at({}),U?.(Ce)))},[D,qe,g,M.value,at,U]),st=eo(Ce=>{if(be||F){oe.current=!1,window.clearTimeout(ue.current);return}le.current=Ue(le.current??"0",ne.current,Ce),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:Ce}),window.clearTimeout(ve.current),ve.current=window.setTimeout(()=>{oe.current&&(st(Ce),we.current>50&&!y&&(we.current-=we.current/6))},we.current)},[Ue,He,be,P,M.name,y,F,_e]),Ct=eo(Ce=>{const{value:Ye="",name:wt}=Ce.target;g&&!Ye&&(Ce.target.value=M.value),A?.(Ye,wt),Ce.target.blur()},[A,M.value,g]),cn=eo(Ce=>{if(Ce.key==="Enter"&&!Ce.nativeEvent.isComposing)Ct(Ce);else if(C&&(Ce.key==="ArrowUp"||Ce.key==="ArrowDown")&&(Ce.preventDefault(),!be&&!F)){const Ye=Ce.key==="ArrowUp"?"up":"down";le.current=Ue(le.current??"0",ne.current,Ye),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:Ye})}M.onKeyDown?.(Ce)},[M,Ct,C,be,F,Ue,He,P,_e]);Uc(()=>{const Ce=Y.current;if(!Ce||!R)return;const Ye=wt=>{if(be||F)return;wt.preventDefault();const un=wt.deltaY<0?"up":"down";le.current=Ue(le.current??"0",ne.current,un),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:un})};return Ce.addEventListener("wheel",Ye,{passive:!1}),()=>Ce.removeEventListener("wheel",Ye)},[R,be,F,Ue,He,P,M.name,_e]);const Sn=eo((Ce,Ye)=>{if(!(Date.now()-re.current[Ce]<500&&m)){if(be||F){oe.current=!1,window.clearTimeout(ue.current);return}re.current[Ce]=Date.now(),pe(Ce),st(Ce),O?.(Ce,Ye),_||(ue.current=window.setTimeout(()=>{oe.current=!0,st(Ce)},we.current)),Q.current=!0}},[m,be,F,st,_,O]),Jn=eo(Ce=>{Ce&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)&&Ce.currentTarget.releasePointerCapture?.(Ce.pointerId)},[]);eo((Ce,Ye=20)=>{const wt=Ce.currentTarget.getBoundingClientRect();return Ce.clientX<wt.left-Ye||Ce.clientX>wt.right+Ye||Ce.clientY<wt.top-Ye||Ce.clientY>wt.bottom+Ye},[]);const Gt=eo((Ce,Ye)=>{if(be||F||!Q.current){oe.current=!1,window.clearTimeout(ue.current),Q.current&&Ce&&$?.(Ce,Ye);return}oe.current=!1,Q.current=!1,pe(null),window.clearTimeout(ue.current),we.current=x,Ce&&$?.(Ce,Ye),Ce&&at({type:Ce})},[be,at,F,$,x]),Tn=eo(()=>{oe.current=!1,pe(null),window.clearTimeout(ue.current),window.clearTimeout(ve.current),we.current=x},[x]);Uc(()=>{le.current=B??""},[B]),Uc(()=>{typeof B<"u"&&Le(B)},[B]),Uc(()=>{ne.current=o},[o]),Uc(()=>{ee.current={increase:s,decrease:l}},[s,l]),xfe(L,()=>Y.current),Uc(()=>{const Ce=Ye=>{Ye.type==="contextmenu"&&(oe.current||Q.current)&&Ye.preventDefault()};return window.addEventListener("contextmenu",Ce),window.addEventListener("pointerup",Ce),window.addEventListener("pointercancel",Ce),()=>{window.removeEventListener("contextmenu",Ce),window.removeEventListener("pointerup",Ce),window.removeEventListener("pointercancel",Ce)}},[Tn]);const Hn=f??h(T8,{"aria-hidden":!0,className:u6({size:n,disabledLike:be||V===ye,pressed:me==="down"})}),Tt=d??h(N8,{"aria-hidden":!0,className:u6({size:n,disabledLike:be||z===ye,pressed:me==="up"})});return te(Yo,{"data-slot":"side-number-input",className:ae(bfe({size:n,variant:r,focus:Oe,readOnly:F,disabled:N,error:a,inputDisabled:w}),t),alignItems:"center",justifyContent:"space-between",onContextMenu:Ce=>{Ce.target instanceof HTMLInputElement||Ce.preventDefault()},children:[h("button",{type:"button","data-slot":"side-number-input-decrease","data-type":"down",className:c6({size:n,disabledLike:be||z===ye,pressed:me==="down"}),disabled:be||z===ye,onPointerDown:Ce=>{Ce.preventDefault(),Ce.currentTarget.setPointerCapture?.(Ce.pointerId),Sn("down",Ce)},onPointerMove:Ce=>{Q.current&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)},onPointerUp:Ce=>{Gt("down",Ce),Jn(Ce)},onPointerCancel:Ce=>{Gt("down",Ce),Jn(Ce)},onLostPointerCapture:Ce=>{Gt("down",Ce)},onContextMenu:Ce=>{Ce.preventDefault()},children:Hn}),h("input",{...M,type:"text",inputMode:e==="nx-number"?"none":void 0,"data-slot":"side-number-input-field",className:yfe({size:n,variant:r,focus:Oe,readOnly:F,disabled:N,error:a,inputDisabled:w}),ref:Y,value:Bi(ye??"").join(".")??"",readOnly:!i,disabled:N||w,onChange:Ce=>at({e:Ce}),onFocus:Ce=>ht(Ce,!0),onBlur:Ce=>ht(Ce,!1),onKeyDown:cn,onContextMenu:Ce=>{Ce.preventDefault()}}),h("button",{type:"button","data-slot":"side-number-input-increase","data-type":"up",className:c6({size:n,disabledLike:be||V===ye,pressed:me==="up"}),disabled:be||V===ye,onPointerDown:Ce=>{Ce.preventDefault(),Ce.currentTarget.setPointerCapture?.(Ce.pointerId),Sn("up",Ce)},onPointerMove:Ce=>{Q.current&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)},onPointerUp:Ce=>{Gt("up",Ce),Jn(Ce)},onPointerCancel:Ce=>{Gt("up",Ce),Jn(Ce)},onLostPointerCapture:Ce=>{Gt("up",Ce)},onContextMenu:Ce=>{Ce.preventDefault()},children:Tt}),e==="nx-number"&&h(aw,{inputRef:Y,maxLength:Number(u),useSet:v,onSet:A})]})});Efe.displayName="SideNumberInput";const Mfe=he("group inline-flex items-center select-none",{variants:{size:{sm:"gap-1",md:"gap-1_5"},checked:{true:"",false:""},disabled:{true:"pointer-events-none cursor-not-allowed",false:"cursor-pointer"},readOnly:{true:"pointer-events-none cursor-not-allowed",false:""}},defaultVariants:{size:"sm",checked:!1,disabled:!1,readOnly:!1}}),kfe=he("relative inline-flex shrink-0 items-center justify-center rounded-full border transition-[background-color,border-color] duration-200 ease-out",{variants:{size:{sm:"size-4",md:"size-5"},checked:{true:"",false:""},disabled:{true:"",false:""}},compoundVariants:[{checked:!1,disabled:!1,className:"border-subtle bg-fill-control-surface"},{checked:!0,disabled:!1,className:"bg-fill-brand border-transparent"},{checked:!1,disabled:!0,className:"bg-fill-disabled border-disabled"},{checked:!0,disabled:!0,className:"bg-fill-disabled border-none"}],defaultVariants:{size:"sm",checked:!1,disabled:!1}}),Rfe=he("rounded-full transition-[opacity,transform,background-color] duration-200 ease-out",{variants:{size:{sm:"size-1.5",md:"size-2"},checked:{true:"",false:""},disabled:{true:"",false:""}},compoundVariants:[{checked:!0,disabled:!1,className:"bg-fg-static-white scale-100 opacity-100"},{checked:!1,disabled:!1,className:"bg-fg-static-white scale-0 opacity-0"},{checked:!0,disabled:!0,className:"bg-fg-disabled scale-100"},{checked:!1,disabled:!0,className:"bg-fg-disabled scale-0 opacity-0"}],defaultVariants:{size:"sm",checked:!1,disabled:!1}}),Tfe=he("",{variants:{size:{sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-normal"},disabled:{true:"text-fg-disabled",false:"text-fg-default"}},defaultVariants:{size:"sm",disabled:!1}}),Nfe=he(["relative inline-flex","[&_[data-slot='radio-check']]:hidden","[&_[data-slot='radio-text']]:inline-flex","[&_[data-slot='radio-text']]:items-center","[&_[data-slot='radio-text']]:justify-center","[&_[data-slot='radio-text']]:gap-1","[&_[data-slot='radio-text']]:cursor-pointer","[&_[data-slot='radio-text']]:rounded-md","[&_[data-slot='radio-text']]:bg-fill-transparent","[&_[data-slot='radio-text']]:text-fg-default","[&_[data-slot='radio-text']]:outline","[&_[data-slot='radio-text']]:outline-1","[&_[data-slot='radio-text']]:outline-offset-[-1px]","[&_[data-slot='radio-text']]:outline-border-default","[&_[data-slot='radio-text']]:transition-colors","[&_[data-slot='radio-text']]:hover:bg-fill-transparent-hovered","[&_.peer:checked~[data-slot='radio-text']]:bg-fill-subtler","[&_.peer:checked~[data-slot='radio-text']]:text-fg-default","[&_.peer:checked~[data-slot='radio-text']]:outline-transparent","[&_.peer:checked~[data-slot='radio-text']]:hover:bg-fill-subtler-hovered","[&_.peer:disabled~[data-slot='radio-text']]:bg-fill-transparent","[&_.peer:disabled~[data-slot='radio-text']]:cursor-not-allowed","[&_.peer:disabled~[data-slot='radio-text']]:text-fg-disabled","[&_.peer:disabled~[data-slot='radio-text']]:outline-border-disabled","[&_.peer:disabled~[data-slot='radio-text']]:hover:bg-fill-transparent","[&_.peer:checked:disabled~[data-slot='radio-text']]:bg-fill-disabled","[&_.peer:checked:disabled~[data-slot='radio-text']]:text-fg-disabled","[&_.peer:checked:disabled~[data-slot='radio-text']]:outline-transparent","[&_.peer[readonly]~[data-slot='radio-text']]:bg-fill-transparent","[&_.peer[readonly]~[data-slot='radio-text']]:cursor-not-allowed","[&_.peer[readonly]~[data-slot='radio-text']]:text-fg-default","[&_.peer[readonly]~[data-slot='radio-text']]:outline-border-subtler","[&_.peer[readonly]~[data-slot='radio-text']]:hover:bg-fill-transparent","[&_.peer:checked[readonly]~[data-slot='radio-text']]:bg-fill-disabled","[&_.peer:checked[readonly]~[data-slot='radio-text']]:text-fg-default","[&_.peer:checked[readonly]~[data-slot='radio-text']]:outline-transparent"].join(" "),{variants:{size:{sm:["[&_[data-slot='radio-text']]:min-h-7","[&_[data-slot='radio-text']]:px-2","[&_[data-slot='radio-text']]:typo-compact-xs-semibold"].join(" "),md:["[&_[data-slot='radio-text']]:min-h-8","[&_[data-slot='radio-text']]:px-3","[&_[data-slot='radio-text']]:typo-compact-xs-semibold"].join(" ")},disabled:{true:"pointer-events-none cursor-not-allowed",false:""}},defaultVariants:{size:"sm",disabled:!1}}),{forwardRef:Pfe,useCallback:Afe,useImperativeHandle:Ife,useMemo:Ofe,useRef:Lfe}=await q("react"),jk=Pfe(({className:t="",children:e,size:n,disabled:r,readOnly:o,checkValue:a,value:i,handleChange:s,...l},u)=>{const d=Lfe(null),f=Ofe(()=>{if(!(typeof i>"u"))return i===a},[i,a]),m=Afe(v=>{const{name:g,value:w}=v.target;(typeof a=="number"?Number(w)===a:w===a)&&s?.(a,g),l.onChange?.(v)},[s,l,a]);return Ife(u,()=>d.current),te("label",{"data-slot":"radio-root",className:ae(Mfe({size:n,checked:f,disabled:r,readOnly:o}),t),children:[h("input",{ref:d,...l,type:"radio",value:a,checked:f,readOnly:o,disabled:r,onChange:m,className:"peer sr-only"}),h("span",{"data-slot":"radio-check",className:kfe({size:n,checked:f,disabled:r}),children:h("i",{"data-slot":"radio-icon",className:Rfe({size:n,checked:f,disabled:r})})}),e&&h("span",{"data-slot":"radio-text",className:Tfe({size:n,disabled:r}),children:e})]})});jk.displayName="RBRadioBox";const{forwardRef:$fe}=await q("react"),Dfe=$fe(({className:t="",children:e,rippleOption:n={disabled:!0},size:r="sm",disabled:o,...a},i)=>h(Rr,{...n,children:h(jk,{ref:i,size:r,disabled:o,className:ae(Nfe({size:r,disabled:o}),t),...a,children:e})}));Dfe.displayName="RBRadioButton";const Hk=he("block",{variants:{swipeContent:{true:"swipe-content",false:""}},defaultVariants:{swipeContent:!1}}),Wk=he("relative isolate",{variants:{hasScrollMask:{true:"overflow-hidden",false:""}},defaultVariants:{hasScrollMask:!1}}),qk=he("relative overflow-x-auto overflow-y-visible whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"),Bfe=he("border-subtle inline-flex items-end border-b",{variants:{size:{sm:"gap-3",md:"gap-3_5",lg:"gap-4"}},defaultVariants:{size:"md"}}),zfe=he("px-0_5 relative -mb-px inline-flex shrink-0 items-center justify-center border-b text-center transition-colors",{variants:{size:{sm:"typo-compact-sm-semibold h-8",md:"typo-compact-sm2-semibold h-10",lg:"typo-compact-lg-semibold h-12"},selected:{true:"",false:"border-transparent"},disabled:{true:"pointer-events-none cursor-not-allowed",false:"cursor-pointer"},slider:{true:"",false:""}},compoundVariants:[{selected:!0,disabled:!1,slider:!1,className:"text-fg-default z-[1] border-transparent"},{selected:!1,disabled:!1,className:"text-fg-subtler"},{selected:!0,disabled:!0,slider:!1,className:"text-fg-disabled z-[1] border-transparent"},{selected:!1,disabled:!0,className:"text-fg-disabled"},{selected:!0,disabled:!1,slider:!0,className:"text-fg-default z-[1] border-transparent"},{selected:!0,disabled:!0,slider:!0,className:"text-fg-disabled z-[1] border-transparent"}],defaultVariants:{size:"md",selected:!1,disabled:!1,slider:!1}}),Ffe=he("bg-fill-default pointer-events-none absolute bottom-[-1px] left-0 z-[1] h-[1px] transition-[transform,width] duration-200",{variants:{visible:{true:"",false:"opacity-0"}},defaultVariants:{visible:!0}}),f0=he("max-w-full",{variants:{hasContent:{true:"pt-2",false:""},swipeContent:{true:"[&_.swiper-wrapper]:!transition-property-[transform]",false:""}},defaultVariants:{hasContent:!0,swipeContent:!1}}),cu=he("",{variants:{active:{true:"block",false:"hidden"},disabled:{true:"",false:""},swipeContent:{true:"block",false:""}},defaultVariants:{active:!1,disabled:!1,swipeContent:!1}}),ebe=he("inline-flex items-center overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",{variants:{size:{sm:"gap-1",md:"gap-1_5",lg:"gap-1_5"}},defaultVariants:{size:"md"}}),Vfe=he("inline-flex shrink-0 items-center justify-center rounded-full transition-colors",{variants:{size:{sm:"px-2_5 typo-compact-sm-semibold h-7",md:"typo-compact-sm2-semibold h-8 px-3",lg:"typo-compact-lg-semibold h-10 px-4"},selected:{true:"",false:"bg-fill-transparent outline-border-subtle outline outline-1 outline-offset-[-1px]"},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{selected:!0,disabled:!1,className:"bg-fill-default text-fg-inverse"},{selected:!1,disabled:!1,className:"text-fg-subtler"},{selected:!0,disabled:!0,className:"bg-fill-disabled text-fg-disabled"},{selected:!1,disabled:!0,className:"text-fg-disabled outline-border-disabled"}],defaultVariants:{size:"md",selected:!1,disabled:!1}}),jfe=he("items-center border-b-0",{variants:{size:{sm:"gap-1",md:"gap-1_5",lg:"gap-1_5"}},defaultVariants:{size:"md"}}),Hfe=he("items-center border-b-0",{variants:{size:{xs:"gap-1",xs2:"gap-1"}},defaultVariants:{size:"xs2"}}),Wfe=he("relative inline-flex shrink-0 items-center justify-center rounded-md transition-colors",{variants:{size:{xs:"typo-compact-xs-semibold h-7 px-2",xs2:"typo-compact-xs-semibold h-8 px-3"},selected:{true:"outline outline-1 outline-offset-[-1px] outline-transparent",false:"bg-fill-transparent outline-border-default outline outline-1 outline-offset-[-1px]"},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{selected:!0,disabled:!1,className:"bg-fill-subtler text-fg-default"},{selected:!1,disabled:!1,className:"text-fg-default"},{selected:!0,disabled:!0,className:"bg-fill-disabled text-fg-disabled"},{selected:!1,disabled:!0,className:"text-fg-disabled outline-border-disabled"}],defaultVariants:{size:"xs2",selected:!1,disabled:!1}}),{forwardRef:qfe}=await q("react"),Uk=qfe(({className:t="",size:e="md",slider:n=!1,useDefaultStyle:r=!0,selected:o=!1,disabled:a=!1,role:i,children:s,onClick:l,"aria-selected":u},d)=>h("button",{ref:d,type:"button",disabled:a,role:i,"aria-selected":u,className:ae(r&&zfe({size:e,selected:o,disabled:a,slider:n}),t),onClick:l,children:h("span",{className:"text-center",children:s})}));Uk.displayName="RBTabItem";const{useCallback:I2,useEffect:Ed,useMemo:b1,useRef:Md,useState:Ufe}=await q("react"),Yfe=Oh,Gfe=Ih,Kfe=({className:t="",size:e,tabItems:n,activeKey:r,name:o,slider:a,swipeContent:i,disabled:s,rippleOption:l={disabled:!0},tabNavScrollRef:u,destroyInactiveTabPanel:d=!0,tabBtnClassName:f,style:m,onClick:v,handleChange:g})=>{const w=Md(null),y=Md(null),_=Md([]),S=Md(null),x=Md(!1),C=b1(()=>n?.filter(F=>!F?.isHide)??[],[n]),[R,P]=Ufe(r??C[0]?.key),O=b1(()=>{const F=C.findIndex(N=>N.key===R);return F===-1?0:F},[R,C]),$=b1(()=>{if(!C.length)return null;if(i){const F=()=>{const{swipeDirection:N}=S.current,{key:V,disabled:z}=C[S.current.activeIndex],{key:I}=C[S.current.activeIndex-1]??C[0],{key:D}=C[S.current.activeIndex+1]??C[S.current.activeIndex];z?(P(N==="next"?D:I),g?.(N==="next"?D:I,o)):(P(V),g?.(V,o))};return h(Gfe,{className:ae(f0({swipeContent:!0})),autoHeight:!0,threshold:1,slidesPerView:1,enabled:!s,onSwiper:N=>{S.current=N},onSlideChange:F,children:C.map(N=>h(Yfe,{className:ae(cu({disabled:s||N.disabled})),style:{visibility:N.disabled?"hidden":"visible"},children:N.children},N.key))})}else return d?h("div",{className:ae(f0()),children:h("div",{className:ae(cu({active:!0,disabled:s||C[O]?.disabled})),children:C[O]?.children})},`contents-${C[O]?.key}`):h("div",{className:ae(f0()),children:C.map((F,N)=>h("div",{className:ae(cu({active:O===N,disabled:s||F.disabled})),children:F.children},`contents-${F.key}`))})},[O,d,s,g,o,i,C]),A=I2(()=>{const F=u?.current??y.current,N=_.current.find(V=>V&&V.classList.contains("active"))??_.current[0];if(N){const{offsetLeft:V,clientWidth:z}=N,I=V-F.offsetWidth/2+z/2;F.scrollTo({top:0,left:I,behavior:"smooth"})}},[u]),M=I2(()=>{const F=w.current;if(!a||!F)return;const N=_.current.find(V=>V&&V.classList.contains("active"))??_.current[0];if(N){const{offsetLeft:V,clientWidth:z}=N;F.style.transform=`translateX(${V}px)`,F.style.width=`${z}px`,x.current?F.style.transition="":(F.style.transition="none",x.current=!0)}else F.style.transform="translateX(0px)",F.style.width="0px"},[a]),L=I2((F,N)=>{typeof r>"u"&&P(F),g?.(F,o),v?.(F,N)},[r,o,g,v]),B=b1(()=>{if(!(typeof window>"u"))return new ResizeObserver(()=>{M()})},[M]);return Ed(()=>{typeof r<"u"&&r!==R&&P(r)},[r,R]),Ed(()=>{M(),A(),S.current&&S.current.slideTo(O,250)},[O,M,A]),Ed(()=>{const F=()=>{M(),A()};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[M,A]),Ed(()=>{i&&S.current&&(s?S.current.disable():S.current.enable())},[s,i]),Ed(()=>{if(B){const F=_.current;return F.forEach(N=>{N&&B.observe(N)}),()=>{F.forEach(N=>{N&&B.unobserve(N)})}}},[B]),te("div",{"data-slot":"tab-wrapper",className:ae(Hk({swipeContent:!!i}),t),style:m,children:[h("div",{"data-slot":"tab-nav",className:ae(Wk()),children:h("div",{"data-slot":"tab-nav-viewport",ref:y,className:ae(qk()),children:te("div",{"data-slot":"tab-nav-list",className:ae("relative flex w-full",Bfe({size:e})),children:[C.map((F,N)=>h(Rr,{...l,disabled:l.disabled||F.disabled||s,children:h(Uk,{ref:V=>{V&&(_.current[N]=V)},"data-slot":"tab-nav-item",className:ae(R===F.key&&"active",f),slider:!!a,selected:R===F.key,disabled:!!(s||F.disabled),role:"tab","aria-selected":R===F.key,onClick:V=>L(F.key,V),children:F.label})},F.key)),h("span",{ref:w,"data-slot":"tab-slider",className:ae(Ffe({visible:!!a})),style:{width:0}})]})})}),h("div",{"data-slot":"tab-content",children:$})]})};Kfe.displayName="RBTab";const{forwardRef:Xfe}=await q("react"),Yk=Xfe(({className:t="",size:e="md",selected:n=!1,disabled:r=!1,role:o,children:a,onClick:i,"aria-selected":s},l)=>h("button",{ref:l,type:"button",disabled:r,role:o,"aria-selected":s,className:ae(Vfe({size:e,selected:n,disabled:r}),t),onClick:i,children:a}));Yk.displayName="RBChipItem";const{useCallback:O2,useEffect:kd,useMemo:Rd,useRef:Td,useState:Zfe}=await q("react"),Qfe=Oh,Jfe=Ih,epe=({className:t="",size:e,tabItems:n,activeKey:r,name:o,slider:a,swipeContent:i,disabled:s,rippleOption:l={disabled:!0},tabNavScrollRef:u,destroyInactiveTabPanel:d=!0,tabBtnClassName:f,style:m,onClick:v,handleChange:g})=>{const w=Td(null),y=Td(null),_=Td([]),S=Td(null),x=Td(!1),C=Rd(()=>n?.filter(N=>!N?.isHide)??[],[n]),[R,P]=Zfe(r??C[0]?.key),O=Rd(()=>{const N=C.findIndex(V=>V.key===R);return N===-1?0:N},[R,C]),$=Rd(()=>C[O]?.children!=null,[O,C]),A=Rd(()=>C.length?i?h(Jfe,{autoHeight:!0,threshold:1,slidesPerView:1,enabled:!s,onSwiper:V=>{S.current=V},onSlideChange:()=>{const{swipeDirection:V}=S.current,{key:z,disabled:I}=C[S.current.activeIndex],{key:D}=C[S.current.activeIndex-1]??C[0],{key:U}=C[S.current.activeIndex+1]??C[S.current.activeIndex];I?(P(V==="next"?U:D),g?.(V==="next"?U:D,o)):(P(z),g?.(z,o))},children:C.map(V=>h(Qfe,{className:ae(cu({active:!0,swipeContent:!0,disabled:s||V.disabled})),style:{visibility:V.disabled?"hidden":"visible"},children:V.children},V.key))}):d?h("div",{children:h("div",{className:ae(cu(),{active:!0,disabled:s||C[O]?.disabled}),children:C[O]?.children})},`contents-${C[O]?.key}`):h("div",{children:C.map((N,V)=>h("div",{className:ae(cu(),{active:O===V,disabled:s||N.disabled}),children:N.children},`contents-${N.key}`))}):null,[O,d,s,g,o,i,C]),M=O2(()=>{const N=u?.current??y.current,V=_.current.find(z=>z&&z.classList.contains("active"))??_.current[0];if(V){const{offsetLeft:z,clientWidth:I}=V,D=z-N.offsetWidth/2+I/2;N.scrollTo({top:0,left:D,behavior:"smooth"})}},[u]),L=O2(()=>{const N=w.current;if(!a||!N)return;const V=_.current.find(z=>z&&z.classList.contains("active"))??_.current[0];if(V){const{offsetLeft:z,clientWidth:I}=V;N.style.transform=`translateX(${z}px)`,N.style.width=`${I}px`,x.current?N.style.transition="":(N.style.transition="none",x.current=!0)}else N.style.transform="translateX(0px)",N.style.width="0px"},[a]),B=O2((N,V)=>{typeof r>"u"&&P(N),g?.(N,o),v?.(N,V)},[r,o,g,v]),F=Rd(()=>{if(!(typeof window>"u"))return new ResizeObserver(()=>{L()})},[L]);return kd(()=>{typeof r<"u"&&r!==R&&P(r)},[r,R]),kd(()=>{L(),M(),S.current&&S.current.slideTo(O,250)},[O,L,M]),kd(()=>{const N=()=>{L(),M()};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[L,M]),kd(()=>{i&&S.current&&(s?S.current.disable():S.current.enable())},[s,i]),kd(()=>{if(F){const N=_.current;return N.forEach(V=>{V&&F.observe(V)}),()=>{N.forEach(V=>{V&&F.unobserve(V)})}}},[F]),te("div",{"data-slot":"chip-tab-wrapper",className:ae(Hk({swipeContent:!!i}),t),style:m,children:[h("div",{"data-slot":"chip-tab-nav",className:ae(Wk()),children:h("div",{"data-slot":"chip-tab-nav-viewport",ref:y,className:ae(qk()),children:h("div",{"data-slot":"chip-tab-nav-list",className:ae("relative flex",jfe({size:e})),children:C.map((N,V)=>h(Rr,{...l,disabled:l.disabled||N.disabled||s,children:h(Yk,{ref:z=>{z&&(_.current[V]=z)},"data-slot":"chip-tab-nav-item",className:ae(R===N.key&&"active",f),size:e,selected:R===N.key,disabled:!!(s||N.disabled),role:"tab","aria-selected":R===N.key,onClick:z=>B(N.key,z),children:N.label})},N.key))})})}),h("div",{"data-slot":"chip-tab-content",className:ae(f0({hasContent:$})),children:A})]})};epe.displayName="RBTab";const{forwardRef:tpe}=await q("react"),Gk=tpe(({className:t="",size:e="xs2",selected:n=!1,disabled:r=!1,role:o,children:a,onClick:i,"aria-selected":s,...l},u)=>h("button",{ref:u,type:"button",disabled:r,role:o,"aria-selected":s,"data-pad-focus":"true",className:ae(Wfe({size:e,selected:n,disabled:r}),t),onClick:i,...l,children:a}));Gk.displayName="RBChipsBoxItem";const{useCallback:y1,useEffect:_1,useMemo:L2,useRef:$2,useState:Yc}=await q("react"),npe=({className:t="",size:e="xs2",tabItems:n,activeKey:r,name:o,disabled:a=!1,destroyInactiveTabPanel:i=!0,rippleOption:s={disabled:!0},tabBtnClassName:l="",style:u,enableOverflowExpand:d=!0,showBottomBorder:f=!0,rightIconButtonProps:m,leftSlot:v,handleChange:g,onClick:w})=>{const[y,_]=Yc(!1),[S,x]=Yc(!1),[C,R]=Yc(0),P=$2(null),O=$2([]),$=$2(null),A=L2(()=>n?.filter(ne=>!ne?.isHide)??[],[n]),[M,L]=Yc(r??A[0]?.key),[B,F]=Yc(!1),[N,V]=Yc(!1),z=y1(()=>{const ne=P.current;if(!ne){x(!1),R(0);return}const ue=ne.scrollWidth>ne.clientWidth+1;x(ue),R(ue?ne.clientWidth/2:0)},[]),I=L2(()=>{const ne=A.findIndex(ue=>ue.key===M);return ne===-1?0:ne},[M,A]),D=y1(()=>{if(z(),y){F(!1),V(!1);return}const ne=P.current;if(!ne)return;if(!(ne.scrollWidth>ne.clientWidth+1)){F(!1),V(!1);return}const ve=Math.max(0,ne.scrollWidth-ne.clientWidth);F(ne.scrollLeft>1),V(ne.scrollLeft<ve-1)},[z,y]),U=y1(()=>{if(y)return;const ne=P.current,ue=O.current.find(Le=>Le&&Le.classList.contains("active"))??O.current[0];if(!ne||!ue)return;const{offsetLeft:ve,clientWidth:we}=ue,ye=ve-ne.offsetWidth/2+we/2;ne.scrollTo({top:0,left:ye,behavior:"smooth"})},[y]),Y=y1((ne,ue)=>{typeof r>"u"&&L(ne),g?.(ne,o),w?.(ne,ue)},[r,g,o,w]),oe=ne=>{_(ue=>!ue),m?.onClick?.(ne)};_1(()=>{typeof r<"u"&&r!==M&&L(r)},[r,M]),_1(()=>{U(),D()},[I,y,U,D]),_1(()=>{z();const ne=P.current;if(!ne)return;const ue=new ResizeObserver(()=>{z(),D(),U()});ue.observe(ne);const ve=()=>{z(),D(),U()};return window.addEventListener("resize",ve),()=>{ue.disconnect(),window.removeEventListener("resize",ve)}},[z,D,U,A]),_1(()=>{const ne=P.current;if(!ne||y)return;const ue=()=>{$.current!==null&&window.clearTimeout($.current),D(),$.current=window.setTimeout(()=>{D()},140)};return D(),ne.addEventListener("scroll",ue,{passive:!0}),()=>{ne.removeEventListener("scroll",ue),$.current!==null&&window.clearTimeout($.current)}},[y,D]);const Q=y?h(ow,{}):h(K0,{}),re=e==="xs2"?"h-11":"h-10",le=d&&(y||S),ee=L2(()=>A.length?i?h("div",{children:h("div",{className:ae("block",(a||A[I]?.disabled)&&"pointer-events-none opacity-50"),children:A[I]?.children})},`contents-${A[I]?.key}`):h("div",{children:A.map((ne,ue)=>h("div",{className:ae(I===ue?"block":"hidden"),children:ne.children},`contents-${ne.key}`))}):null,[I,i,a,A]);return te("div",{className:ae("block",t),style:u,children:[te("div",{className:ae("relative isolate",f&&"border-subtler border-b"),children:[v&&h("div",{className:"absolute top-0 bottom-0 left-0 z-[4] flex items-center pl-1",children:v}),h("div",{ref:P,className:ae("relative p-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",y?"overflow-x-visible overflow-y-visible pr-0":"overflow-x-auto overflow-y-hidden pr-10 whitespace-nowrap",v&&"pl-9"),children:te("div",{className:ae(Hfe({size:e}),"relative flex",y?"w-full flex-wrap content-start gap-y-1":"w-max min-w-full flex-nowrap"),children:[A.map((ne,ue)=>h(Rr,{...s,disabled:s.disabled||ne.disabled||a,children:h(Gk,{ref:ve=>{O.current[ue]=ve},className:ae(M===ne.key&&"active",l),size:e,selected:M===ne.key,disabled:!!(a||ne.disabled),role:"tab","aria-selected":M===ne.key,onClick:ve=>Y(ne.key,ve),children:ne.label})},ne.key)),h("div",{"aria-hidden":"true",className:y?"hidden":"inline-block",style:{width:`${C}px`,flexShrink:0}})]})}),!y&&te(Mr,{children:[h("div",{"aria-hidden":"true",className:ae("to-bg-default pointer-events-none absolute top-0 bottom-px -left-px z-[2] w-11 shrink-0 bg-gradient-to-l from-transparent to-[30%] transition-opacity duration-150",B?"opacity-100":"opacity-0")}),h("div",{"aria-hidden":"true",className:ae("from-bg-default pointer-events-none absolute top-0 -right-px bottom-px z-[3] w-11 shrink-0 bg-gradient-to-l from-[30%] to-transparent transition-opacity duration-150",N?"opacity-100":"opacity-0")})]}),le?te("div",{className:ae("pointer-events-none absolute top-0 right-0 z-[5] w-9",re,"from-bg-default bg-gradient-to-l from-[80%] to-transparent"),children:[y?null:h("div",{className:"bg-default absolute top-0 right-0 bottom-0 w-px"}),h("div",{className:ae("pointer-events-auto flex items-center justify-center",re),children:h(d8,{size:"3xs",variant:"circle",icon:Q,...m,onClick:oe})})]}):null]}),ee]})};npe.displayName="RBChipsBoxTab";const Kk=({className:t,borderClassName:e,pathClassName:n,size:r,style:o})=>te("svg",{className:ae("spinner","animate-spinner-rotate relative z-2 stroke-[5px]",t),viewBox:"0 0 50 50",width:r,height:r,stroke:"currentColor",style:o,children:[h("circle",{className:ae("stroke-linecap-round stroke-width-inherit stroke-inherit opacity-30",e),cx:"25",cy:"25",r:"20",fill:"none"}),h("circle",{className:ae("animate-spinner-path-dash infinite stroke-linecap-round stroke-width-inherit stroke-inherit ease-in-out",n),cx:"25",cy:"25",r:"20",fill:"none"})]}),rpe=he(["overflow-x-auto overflow-y-hidden min-[1280px]:overflow-hidden","[&::-webkit-scrollbar]:h-0 [&::-webkit-scrollbar]:w-0","[&_table]:w-full [&_table]:min-w-full [&_table]:border-collapse","[&_th]:relative [&_th]:h-9 [&_th]:border-b [&_th]:border-b-[var(--color-border-subtler)]","[&_th]:bg-fill-transparent [&_th]:px-2 [&_th]:py-0","[&_th]:text-fg-default [&_th]:text-left [&_th]:align-middle","[&_td]:relative [&_td]:min-h-7 [&_td]:border-b [&_td]:border-b-[var(--color-border-subtler)]","[&_td]:bg-fill-transparent [&_td]:py-1_5 [&_td]:px-2","[&_td]:typo-body-xs-normal [&_td]:text-fg-subtle [&_td]:align-middle","[&_tbody_tr]:relative [&_tbody_tr]:transition-all [&_tbody_tr]:duration-200","[&_[data-slot='ico-check']]:mr-0 [&_label]:p-0"].join(" "),{variants:{noData:{true:"overflow-hidden",false:""},loading:{true:"",false:""},stickyThead:{true:["[&_table]:border-separate [&_table]:border-spacing-0","[&_thead_tr]:sticky [&_thead_tr]:top-0 [&_thead_tr]:z-10","[&_th]:sticky [&_th]:top-0 [&_th]:z-10","[&_th]:bg-inherit [&_th]:bg-clip-padding","[&_th]:shadow-[inset_0_-1px_0_0_var(--color-border-subtler)]"].join(" "),false:""}},defaultVariants:{noData:!1,loading:!1,stickyThead:!1}}),ope=he("transition-colors duration-150",{variants:{sortable:{true:"hover:bg-fill-transparent-hovered cursor-pointer select-none",false:""},align:{left:"",center:"",right:""}},defaultVariants:{sortable:!1,align:"left"}}),ape=he("typo-compact-xs-semibold text-fg-default gap-0_5 inline-flex h-full w-full items-center bg-transparent",{variants:{align:{left:"justify-start text-left",center:"justify-center text-center",right:"justify-end text-right"}},defaultVariants:{align:"left"}}),ipe=he("text-fg-default inline-flex size-4 items-center justify-center bg-transparent [&>svg]:size-full"),spe=he("flex min-h-36 w-full items-center justify-center"),lpe=he("!border-b-0 !border-none !p-0"),cpe=he("!table-row"),upe=he("min-h-60 w-full max-w-[calc(100vw-2.5rem)] border-b-0"),dpe=he("",{variants:{expend:{true:"hover:bg-fill-transparent-hovered cursor-pointer",false:""},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{expend:!1,align:"left"}}),fpe=he("[&_.table-checkbox]:w-2.5"),ppe=he(""),hpe=he("!overflow-hidden !border-none !p-0"),mpe=he("!m-0 overflow-hidden !p-0 transition-[max-height] duration-200"),gpe=he("border-subtler py-2_5 border-b px-3"),{useCallback:vpe,useState:wpe}=await q("react"),Xk=({className:t="",children:e,align:n="left",fieldId:r,size:o="",colSpan:a,rowSpan:i,expend:s,expendOpen:l,handleExpendToggle:u,onClick:d})=>{const[f,m]=wpe(l),v=vpe(g=>{if(d?.(g),!!s)try{m(w=>!w)}catch(w){console.error(w)}finally{setTimeout(()=>{u?.(!f)},10)}},[s,f,d,u]);return h("td",{"data-slot":"table-cell",className:ae(dpe({expend:s,align:n}),r,s&&l&&"expend-open",t),colSpan:a,rowSpan:i,style:{width:o},onClick:v,children:h(Bf,{children:e})})};Xk.displayName="RBTdColumn";const{Children:Kv,Fragment:bpe,isValidElement:Zk,useMemo:D2,useState:d6}=await q("react"),Xv=t=>{let e=[];return Kv.forEach(t,n=>{if(Zk(n)){const r=n;r.type===bpe?e=[...e,...Xv(r.props.children)]:typeof n.type=="function"&&(n.type.name==="RBTdColumn"||n.type.displayName==="RBTdColumn")?e.push(n):e=[...e,...Xv(r.props.children)]}}),e},tbe=({className:t="",list:e,children:n,loadingElement:r=h(Kk,{className:"text-fg-default size-7",borderClassName:"text-fg-subtler opacity-100"}),errorFallback:o,noDataMsg:a,hideThead:i,stickyThead:s=!1,theadTopRows:l,sortUpElement:u=h(A8,{}),sortDownElement:d=h(I8,{}),sortNormalElement:f=h(b8,{}),loading:m})=>{const[v,g]=d6(!1),[w,y]=d6(null),_=D2(()=>{const R=(e||[]).length>0?e?.[0]:{};return Xv(n({item:R,index:0}))},[n,e]),S=D2(()=>{const R=_?.map(P=>{const O=P;return{className:O.props?.className??"",align:O.props?.align??"left",label:O.props?.label,fieldId:O.props?.fieldId,enableSorting:typeof O.props?.sortValue<"u"||!!O.props?.handleClickSort,handleClickSort:O.props?.handleClickSort,thColSpan:O.props?.thColSpan,thRowSpan:O.props?.thRowSpan,rowSpan:O.props?.rowSpan,colSpan:O.props?.colSpan,size:O.props?.size,order:O.props?.order??""}});return R?R.filter(P=>typeof P.label<"u").map(P=>w?.fieldId?{...P,order:w?.fieldId===P.fieldId?w?.order:""}:P):[]},[_,w]),x=D2(()=>{const{fieldId:R,order:P}=w??{};if(!P)return e;const $=e.map((A,M)=>Kv.map(n({item:A,index:M}),L=>{if(Zk(L)){const B=L;return B.type===Xk?L:Kv.toArray(B.props.children)}return[]})).reduce((A,M)=>{const L=M.find(B=>B.props.fieldId===R);return A.push(L.props?.sortValue??0),A},[]);return kn.orderBy(e.map((A,M)=>({...A,sortValue:$[M]})),["sortValue"],[P])},[e,w,n]),C=async R=>{let P="desc";const{order:O,index:$,fieldId:A,enableSorting:M,handleClickSort:L}=R;if(!M||v)return;O==="desc"?P="asc":O==="asc"&&(P="");const B={index:$,order:P,fieldId:A};if(y(B),L)try{g(!0),await L(B)}finally{g(!1)}};return h(Bf,{fallback:o,children:h("div",{"data-slot":"table-root",className:ae(rpe({noData:!!e&&e.length===0,loading:!e||v||m,stickyThead:s}),t),children:te("table",{"data-slot":"table",children:[!i&&te("thead",{"data-slot":"table-head",children:[l,h("tr",{"data-slot":"table-head-row",children:S.map((R,P)=>h("th",{"data-slot":"table-head-cell",className:ae(ope({sortable:R.enableSorting,align:R.align}),R.fieldId,R.className),rowSpan:R.thRowSpan??R.rowSpan,colSpan:R.thColSpan??R.colSpan,style:{width:R.size},onClick:()=>C({...R,index:P}),children:te("div",{"data-slot":"table-head-cell-content",className:ape({align:R.align}),children:[R.label,!!R.enableSorting&&te("span",{"data-slot":"table-head-cell-sort-icon",className:ipe(),children:[R.order!=="desc"&&R.order!=="asc"&&f,R.order==="desc"&&d,R.order==="asc"&&u]})]})},`th-${R.fieldId??P}`))})]}),te("tbody",{"data-slot":"table-body",children:[(!e||v||m)&&h("tr",{"data-slot":"table-loading-row",children:h("td",{"data-slot":"table-loading-cell",className:lpe(),colSpan:S.length,children:h("div",{"data-slot":"table-loading-content",className:spe(),children:r})})}),!!e&&!m&&!v&&(e.length>0?x.map((R,P)=>n({item:R,index:P})):h("tr",{"data-slot":"table-empty-row",className:cpe(),children:h("td",{"data-slot":"table-empty-cell",colSpan:S.length,children:typeof a=="object"?a:h(A3,{"data-slot":"table-empty-content",className:upe(),nullText:a})})}))]})]})})})},{useCallback:f6,useEffect:p6,useMemo:h6,useRef:ype,useState:_pe}=await q("react"),xpe=({className:t="",children:e,expendOpen:n=!1,handleExpendChange:r,beforeExpendOpen:o,onClick:a})=>{const i=ype(null),[s,l]=_pe(n),u=f6(v=>{if(i.current){const g=typeof v=="boolean"?v:!s,w=i.current.firstChild;w&&(w.style.maxHeight=g?`${w.scrollHeight}px`:"0px")}},[i,s]),d=f6(async()=>{try{o&&!s&&(await o(),await ok(10))}catch(v){console.error(v)}finally{l(!s),r?.(!s)}},[s,r,o]),f=h6(()=>{const v=w=>w.flatMap(y=>y?.props?y.type?.displayName==="RBTdColumn"?{...y,props:{...y.props,handleExpendToggle:d,expendOpen:s}}:Array.isArray(y.props.children)?v(y.props.children):[]:[]),g=Array.isArray(e)?e:[e];return v(g)},[e,s,d]),m=h6(()=>{const v=w=>w.flatMap(y=>{if(y?.props){if(y.type?.displayName==="RBTdExpend")return y;if(Array.isArray(y.props.children))return v(y.props.children)}}),g=Array.isArray(e)?e:[e];return v(g).filter(w=>w)[0]},[e]);return p6(()=>{u(s)},[s,u]),p6(()=>{typeof n<"u"&&l(n)},[n]),te(Mr,{children:[h("tr",{"data-slot":"table-row",className:ae(fpe(),t),onClick:a,children:f}),!!m&&h("tr",{"data-slot":"table-expand-row",className:ppe(),children:h("td",{"data-slot":"table-expand-cell",ref:i,className:hpe(),colSpan:f.length,children:m})})]})};xpe.displayName="RBTableRow";const Spe=({className:t="",children:e,style:n})=>h("div",{"data-slot":"table-expand-content",className:mpe(),children:h("div",{"data-slot":"table-expand-content-inner",className:ae(gpe(),t),style:n,children:e})});Spe.displayName="RBTdExpend";const Cpe=he("inline-flex items-center justify-center rounded-full",{variants:{type:{number:"typo-compact-2xs-semibold size-4 min-w-4 gap-1 overflow-hidden px-1",capsule:"typo-compact-2xs-semibold gap-1_5 px-1_5 py-0_5",soft:"typo-compact-2xs-semibold gap-1_5 px-1_5 py-0_5",transparent:"typo-compact-2xs-semibold gap-0_5 rounded-none p-0"}},defaultVariants:{type:"number"}}),Epe=he("",{variants:{variant:{solid:"bg-fill-default text-fg-inverse hover:bg-fill-default-hovered",soft:"bg-fill-subtler text-fg-default hover:bg-fill-subtler-hovered",outlined:"bg-fill-transparent text-fg-default outline-border-default hover:bg-fill-transparent-hovered outline outline-1 outline-offset-[-1px]",ghost:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered"}},defaultVariants:{variant:"solid"}}),Mpe=he("",{variants:{color:{red:"bg-fill-danger text-fg-inverse",orange:"bg-fg-warning text-fg-inverse",green:"bg-fill-success text-fg-inverse",blue:"bg-fill-information text-fg-inverse",purple:"bg-fill-debug text-fg-inverse",gray:"bg-fill-subtle text-fg-inverse","gray-subtle":"bg-fill-subtler text-fg-inverse"}},defaultVariants:{color:"red"}}),kpe=he("",{variants:{color:{red:"bg-fill-danger-subtlest text-fg-danger",orange:"bg-fill-caution-subtlest text-fg-caution",green:"bg-fill-success-subtlest text-fg-success",blue:"bg-fill-information-subtlest text-fg-information",purple:"bg-fill-debug-subtlest text-fg-debug",gray:"bg-fill-disabled text-fg-subtle","gray-subtle":"bg-fill-subtlest text-fg-subtler"}},defaultVariants:{color:"red"}}),Rpe=he("",{variants:{color:{red:"text-fg-danger bg-transparent",orange:"text-fg-warning bg-transparent",green:"text-fg-success bg-transparent",blue:"text-fg-information bg-transparent",purple:"text-fg-debug bg-transparent",gray:"text-fg-subtle bg-transparent","gray-subtle":"text-fg-subtler bg-transparent"}},defaultVariants:{color:"red"}});function nbe({className:t,type:e="number",numberVariant:n="solid",color:r="red",leadingIcon:o,children:a}){return h("span",{"data-slot":"badge",className:ae(Cpe({type:e}),{[Epe({variant:n})]:e==="number",[Mpe({color:r})]:e==="capsule",[kpe({color:r})]:e==="soft",[Rpe({color:r})]:e==="transparent"},t),children:e==="transparent"?te(Mr,{children:[o,h("span",{"data-slot":"badge-content",className:"relative top-px inline-flex items-center",children:a})]}):a})}const Tpe=he("inline-flex w-full flex-col items-start gap-7 overflow-hidden"),Npe=he("flex h-48 w-full flex-col items-center justify-center gap-3 overflow-hidden px-9 py-5"),Ppe=he("text-fg-subtle typo-body-xs2-normal w-full max-w-[600px] text-center"),Ape=he("text-fg-subtler inline-flex size-6 items-center justify-center [&_svg]:size-full");function m6({className:t,type:e="button",message:n="엠프티뷰의 안내 메세지를 입력해주세요.",description:r,buttonLabel:o="버튼 라벨",onButtonClick:a,icon:i}){const s=e==="button";return h("div",{"data-slot":"empty-view",className:ae(Tpe(),t),children:te("div",{"data-slot":"empty-view-section",className:Npe(),children:[!s&&h("i",{"data-slot":"empty-view-icon","aria-hidden":!0,className:Ape(),children:i??h(Z0,{})}),te("div",{children:[h("p",{"data-slot":"empty-view-message",className:Ppe(),children:n}),r&&h("p",{"data-slot":"empty-view-description",className:"text-fg-subtler typo-body-xs2-normal w-full max-w-150 text-center",children:r})]}),s&&h(Wr,{"data-slot":"empty-view-button",size:"sm",variant:"soft",onClick:a,children:o})]})})}const Ipe=he("relative z-[1] w-full",{variants:{disabled:{true:"[&_[data-slot=multi-range-range]]:bg-fill-default [&_[data-slot=text-input]]:bg-fill-control-surface-disabled [&_[data-slot=text-input]]:text-fg-disabled [&_[data-slot=text-input]]:outline-border-disabled [&_[data-slot=multi-range-text-field]]:text-fg-disabled [&_input[type='range']::-moz-range-thumb]:border-default [&_input[type='range']::-moz-range-thumb]:bg-default [&_input[type='range']::-webkit-slider-thumb]:border-default [&_input[type='range']::-webkit-slider-thumb]:bg-default opacity-30 [&_[data-slot=multi-range-slider]]:pointer-events-none [&_[data-slot=multi-range-slider]]:cursor-not-allowed [&_input[type='range']::-moz-range-thumb]:cursor-not-allowed [&_input[type='range']::-webkit-slider-thumb]:cursor-not-allowed",false:""}},defaultVariants:{disabled:!1}}),Ope=he("relative inline-flex w-full items-center justify-center"),Lpe=he("h-[var(--mri-slider-height)] w-[calc(100%_-_var(--mri-thumb-size))]"),g6=he("pointer-events-none absolute top-1/2 left-0 z-[3] h-[var(--mri-slider-height)] w-full -translate-y-1/2 appearance-none bg-transparent opacity-100"),$pe=he("relative z-[2] h-[var(--mri-slider-height)]"),Dpe=he("absolute inset-0 z-[1] rounded-full bg-[var(--mri-track-color,var(--color-fill-subtler))]"),Bpe=he("absolute top-0 bottom-0 z-[2] rounded-full bg-[var(--mri-range-color,var(--color-fill-brand))]"),zpe=he("flex w-full items-start justify-between pt-1"),v6=he("",{variants:{align:{left:"",right:"ml-auto text-right"}},defaultVariants:{align:"left"}}),w6=he("typo-compact-xs2-normal text-fg-default bg-fill-control-surface outline-border-default inline-block h-8 w-auto shrink-0 rounded-md px-2.5 text-center outline outline-1 outline-offset-[-1px] transition-colors"),b6="[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:h-[var(--mri-thumb-size)] [&::-webkit-slider-thumb]:w-[var(--mri-thumb-size)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-[var(--mri-thumb-border-color,var(--color-fg-default))] [&::-webkit-slider-thumb]:bg-[var(--mri-thumb-color,var(--color-fg-default))] [&::-webkit-slider-thumb]:cursor-pointer [&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-[var(--mri-thumb-size)] [&::-moz-range-thumb]:w-[var(--mri-thumb-size)] [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-[var(--mri-thumb-border-color,var(--color-fg-default))] [&::-moz-range-thumb]:bg-[var(--mri-thumb-color,var(--color-fg-wte))] [&::-moz-range-thumb]:cursor-pointer",{forwardRef:Fpe,useCallback:x1,useEffect:y6,useImperativeHandle:Vpe,useMemo:B2,useRef:Nd,useState:jpe}=await q("react"),Hpe=Fpe((t,e)=>{const{className:n="",value:r,name:o,min:a,max:i,step:s=1,thumbSize:l=12,sliderHeight:u=4,thumbBorderColor:d,thumbColor:f,trackColor:m,rangeColor:v,showTextInput:g=!0,disabled:w=!1,handleChange:y,onChange:_}=t,S=Nd([a,i]),x=Nd(null),C=Nd(null),R=Nd(null),P=Nd(null),[O,$]=jpe([a,i]),A=B2(()=>O.map(I=>(I-a)/(i-a)*100),[O,a,i]),M=w||a===i,L=B2(()=>Wo(O[0]),[O]),B=B2(()=>Wo(O[1]),[O]),F=x1(()=>{!R.current||!P.current||(R.current.value=L,P.current.value=B)},[L,B]),N=x1(I=>{I.key==="Enter"&&!I.nativeEvent.isComposing&&(R.current.blur(),P.current.blur())},[]),V=x1((I,D,U=!1)=>{if(g&&(!R.current||!P.current))return;const{value:Y}=D.target;if(I==="left"){let oe=Math.min(Dl(Y),O[1]-s);oe=oe>a?oe:a,$([oe,O[1]]),U&&y?.([oe,O[1]],o),R.current.value=Wo(oe)}else{let oe=Math.max(Dl(Y),O[0]+s);oe=oe<=i?oe:i,$([O[0],oe]),U&&y?.([O[0],oe],o),P.current.value=Wo(oe)}_?.(D),F()},[_,g,F,y,o,O,s,a,i]),z=x1(()=>{O.some((I,D)=>I!==S.current[D])&&(S.current=[...O],y?.(O,o))},[O,o,y]);return y6(()=>{F()},[F]),y6(()=>{typeof r<"u"&&($(r),S.current=[...r])},[r]),Vpe(e,()=>({focus:x.current.focus})),te("div",{"data-slot":"multi-range-input",className:ae(Ipe({disabled:M}),n),style:{"--mri-thumb-size":`${l}px`,"--mri-slider-height":`${u}px`,"--mri-thumb-border-color":d,"--mri-thumb-color":f,"--mri-track-color":m,"--mri-range-color":v},children:[h("div",{className:Ope(),style:{height:"var(--mri-thumb-size)"},children:te("div",{className:Lpe(),children:[h("input",{ref:x,type:"range",value:O[0],min:a,max:i,step:s,disabled:M,className:ae(g6(),b6),onChange:I=>V("left",I),onMouseUp:z,onMouseLeave:z,onTouchEnd:z}),h("input",{ref:C,type:"range",value:O[1],min:a,max:i,step:s,disabled:M,className:ae(g6(),b6),onChange:I=>V("right",I),onMouseUp:z,onMouseLeave:z,onTouchEnd:z}),te("div",{"data-slot":"multi-range-slider",className:$pe(),children:[h("div",{"data-slot":"multi-range-track",className:Dpe()}),h("div",{"data-slot":"multi-range-range",className:Bpe(),style:{left:`${A[0]}%`,right:`${100-A[1]}%`}})]})]})}),g&&te("div",{"data-slot":"multi-range-text-wrap",className:zpe(),children:[h("div",{className:v6({align:"left"}),children:h("input",{"data-slot":"multi-range-text-field",ref:R,type:"text",inputMode:"numeric",defaultValue:O[0],size:Math.max(L.length,1),disabled:M,className:w6(),onBlur:I=>V("left",I,!0),onKeyDown:N})}),h("div",{className:v6({align:"right"}),children:h("input",{"data-slot":"multi-range-text-field",ref:P,type:"text",inputMode:"numeric",defaultValue:O[1],size:Math.max(B.length,1),disabled:M,className:w6(),onBlur:I=>V("right",I,!0),onKeyDown:N})})]})]})});Hpe.displayName="MultiRangeInput";const Wpe=he("relative touch-none rounded-full",{variants:{disabled:{false:"",true:"cursor-not-allowed [&>*]:pointer-events-none [&>*]:opacity-40"}},defaultVariants:{disabled:!1}}),qpe=he(["relative flex h-full cursor-grab items-center justify-center","will-change-[transform,opacity]","transition-opacity duration-150 ease-in-out"],{variants:{active:{false:"",true:"cursor-grabbing opacity-100"}},defaultVariants:{active:!1}}),Upe=he(["absolute top-0 left-0 z-[1] h-full w-full","will-change-transform [backface-visibility:hidden]"]),Ype=he("shadow-down-sm relative block h-full rounded-full bg-[var(--joy-stick-area-color,var(--color-fill-inverse))] opacity-40 transition-opacity duration-100",{variants:{active:{false:"",true:"opacity-100"}},defaultVariants:{active:!1}}),Gpe=he(["relative z-[2] h-10 w-10 rounded-full","border-disabled shadow-down-xs border","pointer-events-none touch-none","will-change-transform [backface-visibility:hidden]","transition-[scale,box-shadow] duration-200 ease-out"],{variants:{active:{false:"",true:"shadow-down-sm scale-110"}},defaultVariants:{active:!1}}),Kpe=he(["pointer-events-none absolute inset-0 rounded-full","[--joy-sweep:calc(30deg_+_var(--joy-ratio,0)_*_45deg)]","opacity-[var(--joy-ratio,0)] transition-opacity duration-100","bg-[conic-gradient(from_calc(var(--joy-angle,0deg)_-_var(--joy-sweep)_/_2),transparent_0deg,var(--joy-arc-color)_calc(var(--joy-sweep)_*_0.3),var(--joy-arc-color)_calc(var(--joy-sweep)_*_0.7),transparent_var(--joy-sweep))]","[mask:radial-gradient(closest-side,transparent_calc(100%_-_3px_-_var(--joy-ratio,0)_*_1px),#000_calc(100%_-_2px_-_var(--joy-ratio,0)_*_1px))]"]),Xpe=he("pointer-events-none absolute top-0 left-0 z-[2] h-full w-full touch-none"),S1=he(["absolute z-[1] inline-flex items-center justify-center","size-3.5 text-center","transition-[opacity,color] duration-150 ease-out","[&_svg]:inline-block [&_svg]:size-3.5 [&_svg]:align-middle"],{variants:{position:{top:"top-2 left-1/2 -translate-x-1/2",bottom:"bottom-2 left-1/2 -translate-x-1/2",left:"top-1/2 left-2 -translate-y-1/2",right:"top-1/2 right-2 -translate-y-1/2"},highlighted:{false:"text-fg-default opacity-70",true:"text-[var(--joy-arc-color)] opacity-100"}},defaultVariants:{highlighted:!1}}),Zpe=he("pointer-events-none absolute top-0 left-0 z-[2] h-full w-full touch-none"),_6=he(["absolute z-[1] inline-flex size-5 items-center justify-center","text-center transition-[opacity,color] duration-150 ease-out","[&_svg]:inline-block [&_svg]:size-5","[&_svg_path]:stroke-opacity-100"],{variants:{position:{top:"top-[5px] left-1/2 -translate-x-1/2",bottom:"bottom-[5px] left-1/2 -translate-x-1/2 [&_svg]:rotate-x-180 [&_svg]:rotate-y-180"},highlighted:{false:"text-fg-default opacity-40",true:"text-[var(--joy-arc-color)] opacity-100"}},defaultVariants:{highlighted:!1}}),{useRef:Pi,useCallback:Sl,useId:Qpe,useEffect:x6,useState:S6}=await q("react"),rbe=({className:t,type:e="direction",size:n=100,stickColor:r="radial-gradient(circle, #727272 0%, #3B3B3B 100%)",arcColor:o="var(--color-scale-zinc-100)",stickAreaColor:a="var(--color-fill-inverse)",throttleThreshold:i=.05,throttleDuration:s,xOnly:l=!1,yOnly:u=!1,disableDiagonal:d=!1,disabled:f=!1,keepMoveEventInterval:m,paddingSize:v=10,style:g,onStart:w,onMove:y,onEnd:_})=>{const S=Pi(null),x=Pi(null),C=Pi(null),R=Pi(null),P=Pi(null),O=Pi(null),$=Pi(null),A=Pi({x:0,y:0}),M=Pi({type:"none",startPosition:{x:0,y:0},normalizedDistance:{x:0,y:0},rotate:{radian:0,degree:0},distance:{x:0,y:0},direction:{x:"center",y:"center"},time:Date.now()}),L=Qpe().replace(/:/g,""),[B,F]=S6(!1),[N,V]=S6({x:"center",y:"center"}),z=({clientX:ee,clientY:ne})=>{if(!x.current)return;const{width:ue,top:ve,left:we}=x.current.getBoundingClientRect(),ye=ue/2,Le=ee-we-ye,Oe=ne-ve-ye;x.current.style.transform=`translate3d(${Le}px, ${Oe}px, 0px)`,S.current.style.transition=""},I=Sl(()=>{x.current&&(x.current.style.transform="translate3d(0px, 0px, 0px)",x.current.classList.remove("left","right","top","bottom","center"))},[]),D=Sl(({clientX:ee,clientY:ne})=>{if(!S.current||!C.current)return;const ve=C.current.offsetWidth/2,we={x:ee-M.current.startPosition.x,y:ne-M.current.startPosition.y};d?Math.abs(we.x)>Math.abs(we.y)?we.y=0:Math.abs(we.x)<Math.abs(we.y)?we.x=0:(we.x=0,we.y=0):l?we.y=0:u&&(we.x=0);const ye=Math.hypot(we.x,we.y);if(ye>ve){const Ue=ve/ye;we.x*=Ue,we.y*=Ue}const Le={x:Math.abs(we.x)>3?we.x>0?"right":"left":"center",y:Math.abs(we.y)>3?we.y>0?"bottom":"top":"center"},Oe=Math.atan2(we.x,-we.y);let Ne=Oe*180/Math.PI;Ne<0&&(Ne+=360);const me={radian:Oe,degree:Ne},pe={x:we.x/ve,y:-we.y/ve},be=Math.hypot(pe.x-A.current.x,pe.y-A.current.y);return{direction:Le,distance:we,normalizedDistance:pe,movementRatio:be,rotate:me}},[d,l,u]),U=Sl(({clientX:ee,clientY:ne})=>{if(!S.current||!C.current)return;const{direction:ue,distance:ve,rotate:we,normalizedDistance:ye,movementRatio:Le}=D({clientX:ee,clientY:ne});S.current.style.transform=`translate3d(${ve.x}px, ${ve.y}px, 0px)`,C.current.style.setProperty("--joy-angle",`${we.degree}deg`);const Oe=Math.hypot(ye.x,ye.y);return C.current.style.setProperty("--joy-ratio",`${Oe}`),x.current.classList.remove("left","right","top","bottom","center"),x.current.classList.add(ue.x,ue.y),V(ue),{direction:ue,distance:{x:ve.x,y:-ve.y},rotate:we,normalizedDistance:ye,movementRatio:Le}},[D]),Y=Sl(()=>{S.current&&(S.current.style.transition="transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1)",C.current?.style.setProperty("--joy-ratio","0"),S.current.style.transform="translate3d(0px, 0px, 0px)")},[]),oe=Sl(()=>{const ne=Date.now()-M.current.time;if(!$.current||["none","end"].includes(M.current.type)||ne<s)return;const ue=$.current;ue.preventDefault(),ue.stopPropagation();const{clientX:ve,clientY:we}=ue,{distance:ye,direction:Le,rotate:Oe,normalizedDistance:Ne,movementRatio:me}=U({clientX:ve,clientY:we});M.current={...M.current,type:"move",rotate:Oe,distance:ye,normalizedDistance:Ne,direction:Le,time:Date.now()};const pe={...M.current,event:ue,targets:{joystick:x.current,stickArea:C.current,stick:S.current}};me>=i&&(A.current=Ne,y?.(pe)),m&&(window.clearInterval(P.current),P.current=window.setInterval(()=>{M.current.type==="move"&&y?.(pe)},m))},[i,s,y,U,m]),Q=Sl(ee=>{window.clearInterval(P.current),!["none","end"].includes(M.current.type)&&(ee.target instanceof Element&&ee.target.releasePointerCapture?.(ee.pointerId),ee.preventDefault(),ee.stopPropagation(),M.current.type="end",setTimeout(()=>{M.current.type="none"},100),I(),Y(),F(!1),V({x:"center",y:"center"}),x.current.classList.remove("active"),window.clearInterval(P.current),$.current=null,_?.({type:"end",...M.current,direction:{x:"center",y:"center"},normalizedDistance:{x:0,y:0},rotate:{degree:0,radian:0},distance:{x:0,y:0},event:ee,targets:{joystick:x.current,stickArea:C.current,stick:S.current}}))},[_,I,Y]),re=ee=>{if(ee.button===2||f||["start","move","end"].includes(M.current.type))return;R.current=`${L}-${ee.pointerId}`,ee.currentTarget.setPointerCapture(ee.pointerId),ee.stopPropagation(),ee.preventDefault();const{clientX:ne,clientY:ue}=ee;M.current.type="start",M.current.startPosition={x:ne,y:ue},F(!0),V({x:"center",y:"center"}),x.current.classList.add("active"),z({clientX:ne,clientY:ue}),w?.({...M.current,event:ee,targets:{joystick:x.current,stickArea:C.current,stick:S.current},distance:{x:0,y:0},normalizedDistance:{x:0,y:0},rotate:{radian:0,degree:0},startPosition:{x:ne,y:ue},direction:{x:"center",y:"center"}})},le=Sl(ee=>{$.current=ee.nativeEvent,R.current===`${L}-${ee.pointerId}`&&(O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(oe))},[oe,L]);return x6(()=>{const ee=ne=>{Q(ne)};return window.addEventListener("pointerup",ee),()=>{window.removeEventListener("pointerup",ee)}},[L,Q]),x6(()=>{const ee=P.current;return()=>{window.clearInterval(ee)}},[]),h("div",{"data-slot":"joy-stick",className:ae(Wpe({disabled:f}),t),style:{...g,width:`${n+v*2}px`,height:`${n+v*2}px`,"--joy-stick-color":r,"--joy-stick-area-color":a,"--joy-arc-color":o},onContextMenu:ee=>ee.preventDefault(),children:te("div",{"data-slot":"joy-stick-inner",ref:x,className:qpe({active:B}),style:{padding:v},children:[h("div",{"data-slot":"joy-stick-stick-area",ref:C,className:Upe(),style:{padding:v},onPointerDownCapture:re,onPointerUpCapture:Q,onPointerMove:le,children:te("span",{"data-slot":"joy-stick-stick-area-inner",className:Ype({active:B}),style:{"--joy-stick-area-color":a},children:[h("span",{"data-slot":"joy-stick-arc",className:Kpe()}),e==="direction"&&te("div",{className:Xpe(),children:[h("span",{className:S1({position:"top",highlighted:B&&N.y==="top"}),children:h(y8,{})}),h("span",{className:S1({position:"bottom",highlighted:B&&N.y==="bottom"}),children:h(g8,{})}),h("span",{className:S1({position:"left",highlighted:B&&N.x==="left"}),children:h(v8,{})}),h("span",{className:S1({position:"right",highlighted:B&&N.x==="right"}),children:h(w8,{})})]}),e==="curved"&&te("div",{className:Zpe(),children:[h("span",{className:_6({position:"top",highlighted:B&&N.y==="top"}),children:h(G2,{})}),h("span",{className:_6({position:"bottom",highlighted:B&&N.y==="bottom"}),children:h(G2,{})})]})]})}),h("div",{"data-slot":"joy-stick-stick",ref:S,className:Gpe({active:B}),style:{background:"var(--joy-stick-color)"}})]})})},Jpe=he("pointer-events-none"),e1e=he("absolute z-[9] w-full rounded-md"),t1e=he("pointer-events-none absolute z-[99] overflow-hidden",{variants:{hidden:{false:"",true:"hidden"}},defaultVariants:{hidden:!1}}),n1e=he("block"),r1e=he(["block size-2.5","fill-bg-tooltip"]),o1e=he("absolute z-[9999]"),a1e=he("relative"),i1e=he(["inline-flex items-center justify-center overflow-hidden","bg-tooltip max-w-60 rounded-md px-3 py-2"]),s1e=he(["text-fg-inverse flex-1","typo-body-xs2-normal","break-words whitespace-normal"]),{useCallback:ys,useEffect:z2,useMemo:C6,useRef:Gc,useState:F2}=await q("react"),l1e=t=>new Promise(e=>setTimeout(e,t)),obe=({className:t="",anchorId:e,width:n=200,space:r=0,place:o="bottom",events:a=["hover"],arrowPosition:i=0,hideArrow:s,tooltipPosition:l,tooltipColor:u,tooltipTextColor:d,tooltipBoxShadow:f,tooltipBorderRadius:m,open:v,whenWindowScrollClose:g,children:w})=>{const y=Gc(null),_=Gc(null),S=Gc(null),x=Gc(null),C=Gc(0),R=Gc(!1),[P,O]=F2(!1),[$,A]=F2(o),[M,L]=F2(!!v),B=C6(()=>{const Q=[...a],re=Q.findIndex(le=>le==="hover");return re!==-1&&!xo.isMobile&&Q.splice(re,0,"mouseover","mouseout"),Q},[a]),F=ys(()=>{if(_.current)return _.current;const Q=document.querySelector(`#${e}`);Q&&(_.current=Q)},[e]),N=ys((Q,re)=>{if(!_.current)return;const{scrollY:le,innerHeight:ee}=window,ne=le,ue=le+ee,{top:ve}=_.current.getBoundingClientRect();return ne>Q&&ve>0?Q+ve:ue<Q+re?ue-re-10:Q},[]),V=ys((Q,re)=>{const{scrollX:le,innerWidth:ee}=window,ne=le,ue=le+ee;return ne>Q?ne+r:ue<Q+re?ue-re-r:Q},[r]),z=ys(Q=>{const{targetTop:re,targetLeft:le,targetWidth:ee,targetHeight:ne,tooltipHeight:ue,arrowWidth:ve,arrowHeight:we}=Q;return scrollY+re-ue-we-r<scrollY&&o==="top"?"bottom":scrollY+re+ne+we+r>scrollY+innerHeight&&o==="bottom"?"top":le-ve-r<100&&o==="left"?"right":innerWidth-(scrollX+le+ee+ve+r+10)<100&&o==="right"?"left":le+scrollX<scrollX?"right":o},[o,r]),I=ys(()=>{if(!y.current||!_.current)return{targetTop:0,targetLeft:0,targetWidth:0,targetHeight:0,arrowWidth:0,arrowHeight:0,tooltipWidth:0,tooltipHeight:0,scrollX:0,scrollY:0,innerWidth:0,innerHeight:0};const{top:Q,left:re,height:le,width:ee}=_.current.getBoundingClientRect(),{offsetHeight:ne,offsetWidth:ue}=y.current,{clientWidth:ve=0,clientHeight:we=0}=S.current??{},{scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne}=window,{position:me,top:pe,left:be}=document.body.style,Ue=me==="fixed"?Number(pe.replace("px",""))*-1:0,He=me==="fixed"?Number(be.replace("px",""))*-1:0;return{targetTop:Q,targetLeft:re,targetWidth:ee,targetHeight:le,arrowWidth:ve,arrowHeight:we,tooltipWidth:ue,tooltipHeight:ne,scrollX:He||ye,scrollY:Ue||Le,innerWidth:Oe,innerHeight:Ne}},[]),D=ys(async()=>{if(!_.current||!y.current)return;const{targetTop:Q,targetLeft:re,targetWidth:le,targetHeight:ee,arrowWidth:ne,arrowHeight:ue,tooltipWidth:ve,tooltipHeight:we,scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne}=I(),{top:me=0,left:pe=0}=l??{},be=i||0,Ue=s?Math.max(r,8):r,He=z({targetTop:Q,targetLeft:re,targetWidth:le,targetHeight:ee,arrowWidth:ne,arrowHeight:ue,tooltipWidth:ve,tooltipHeight:we,scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne});A(He);let qe="",_e="",at="";switch(He){case"top":qe+=`
|
|
271
|
+
`;return typeof s=="function"&&s(null,y),y},x2}var Ax;function Mle(){if(Ax)return jc;Ax=1;const t=ile(),e=Sle(),n=Cle(),r=Ele();function o(a,i,s,l,u){const d=[].slice.call(arguments,1),f=d.length,m=typeof d[f-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(f<2)throw new Error("Too few arguments provided");f===2?(u=s,s=i,i=l=void 0):f===3&&(i.getContext&&typeof u>"u"?(u=l,l=void 0):(u=l,l=s,s=i,i=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(s=i,i=l=void 0):f===2&&!i.getContext&&(l=s,s=i,i=void 0),new Promise(function(v,g){try{const w=e.create(s,l);v(a(w,i,l))}catch(w){g(w)}})}try{const v=e.create(s,l);u(null,a(v,i,l))}catch(v){u(v)}}return jc.create=e.create,jc.toCanvas=o.bind(null,n.render),jc.toDataURL=o.bind(null,n.renderToDataURL),jc.toString=o.bind(null,function(a,i,s){return r.render(a,s)}),jc}Mle();const{useCallback:ive,useEffect:sve,useState:lve}=await q("react"),{useCallback:cve,useEffect:uve,useId:dve,useRef:fve,useState:pve}=await q("react"),{useCallback:hve,useEffect:mve,useId:gve,useRef:vve,useState:wve}=await q("react"),kle="_selected_621ky_62",Rle={"inbox-pagination":"_inbox-pagination_621ky_41","pagination-page":"_pagination-page_621ky_54",selected:kle,"pagination-next":"_pagination-next_621ky_65","pagination-prev":"_pagination-prev_621ky_65","pagination-next-double":"_pagination-next-double_621ky_65","pagination-prev-double":"_pagination-prev-double_621ky_65"},{useMemo:gd}=await q("react"),Hc=rn(Rle),bve=({className:t,currPage:e=1,listSize:n=20,pageSize:r=5,totalCount:o=0,handlePageChange:a})=>{const i=gd(()=>{const f=o/n;return f%1===0?f:Math.floor(f)+1},[n,o]),s=gd(()=>Array.from({length:o},(f,m)=>Array.from({length:r},(v,g)=>m*r+g+1)),[r,o]),l=gd(()=>(s.find(f=>f.includes(e))??[]).filter(f=>f<=i),[e,s,i]),u=gd(()=>{const f=l[0]??1;return Math.max(1,f-1)},[l]),d=gd(()=>{const f=l[l.length-1]??i;return Math.min(i,f+1)},[l,i]);return te("ul",{className:Hc(t,"inbox-pagination"),children:[h("li",{children:h("button",{className:Hc("pagination-prev-double"),type:"button",disabled:e===1,onClick:()=>a(u),children:h(d$,{})})}),h("li",{children:h("button",{className:Hc("pagination-prev"),type:"button",disabled:e===1,onClick:()=>a(e-1),children:h(p$,{})})}),l.map(f=>h("li",{children:h("button",{className:Hc("pagination-page",e===f&&"selected"),type:"button",onClick:()=>a(f),children:f})},f)),h("li",{children:h("button",{className:Hc("pagination-next"),type:"button",disabled:!(e<i),onClick:()=>a(e+1),children:h(h$,{})})}),h("li",{children:h("button",{className:Hc("pagination-next-double"),type:"button",disabled:e===i,onClick:()=>a(d),children:h(f$,{})})})]})},{useEffect:yve,useRef:_ve,useState:xve}=await q("react"),Tle="_inner_16agd_43",Nle="_left_16agd_50",Ple="_right_16agd_53",Ale="_disabled_16agd_87",Ile={"joystick-with-buttons":"_joystick-with-buttons_16agd_40",inner:Tle,left:Nle,right:Ple,"btn-group":"_btn-group_16agd_61","btn-group-item":"_btn-group-item_16agd_69",disabled:Ale,"joy-stick-container":"_joy-stick-container_16agd_95","joy-stick":"_joy-stick_16agd_95","hide-joystick":"_hide-joystick_16agd_110","transition-disabled":"_transition-disabled_16agd_115"},{useCallback:Ole,useEffect:Ix,useMemo:Ox,useRef:S2,useState:Lx}=await q("react"),Wc=rn(Ile),Sve=({className:t,joystickType:e,disableDiagonal:n,xOnly:r,yOnly:o,buttonsDirection:a,buttons:i,hideJoystick:s,onJoystickMove:l})=>{const u=S2(null),d=S2([]),f=S2({timeoutId:[],animationFrameId:[]}),{isMobile:m,isSmallTablet:v}=s3(),[g,w]=Lx(!s),[y,_]=Lx(!1),S=Ox(()=>{const $=i?.length??0;return $>=4?{oneObjectDeg:35,initDeg:a==="left"?-5:5}:$===3?{oneObjectDeg:40,initDeg:a==="left"?15:-15}:{oneObjectDeg:45,initDeg:a==="left"?25:-25}},[i?.length,a]),x=Ox(()=>m?80:v?100:110,[m,v]),C=$=>{_(!0),l?.({isMoving:!0,type:e,data:$})},R=$=>{l?.({isMoving:!0,type:e,data:$})},P=$=>{_(!1),l?.({isMoving:!1,type:e,data:$})},O=Ole(({oneObjectDeg:$,initDeg:A})=>{if(!u.current)return;const M=u.current.getBoundingClientRect(),L=M.width/2,B=M.height/2,F=M.width/2;s?(f.current.animationFrameId.forEach(N=>{cancelAnimationFrame(N)}),f.current.timeoutId.forEach(N=>{clearTimeout(N)}),d.current?.forEach((N,V)=>{if(!N)return;const z=N,I=z.offsetWidth,D=20;z&&(a==="left"?(z.style.left=`${I*V+D*(V+1)}px`,z.style.transform="translateY(-100%)"):(z.style.left=`calc(100% - ${I*V+D*(V+1)}px)`,z.style.transform="translateX(-100%) translateY(-100%)"),z.style.top=`calc(100% - ${D}px)`,z.style.transition="",z.style.opacity="1")})):d.current?.forEach((N,V)=>{const z=N;if(z){const I=(A-90)*(Math.PI/180),D=a==="left"?(A-90+V*$)*(Math.PI/180):(A-90-V*$)*(Math.PI/180);let U=I,Y=.1,oe=.06;const Q=.85,re=.02,le=L+Math.cos(I)*F,ee=B+Math.sin(I)*F;z.style.position="absolute",z.style.left=`${le-z.clientWidth/2}px`,z.style.top=`${ee-z.clientHeight/2}px`,z.style.opacity=`${Y}`,z.style.transform="scale(0.98)";const ne=()=>{if(s)return;const ue=D-U;oe+=ue*re,oe*=Q,U+=oe,Y+=.03,Y=Math.min(Y,1);const ve=.98+(1-Math.abs(ue)/Math.PI)*.02,we=L+Math.cos(U)*F,ye=B+Math.sin(U)*F;z.style.left=`${we-z.clientWidth/2}px`,z.style.top=`${ye-z.clientHeight/2}px`,z.style.opacity=`${Y}`,z.style.transform=`scale(${ve})`,z.style.transition="none",Math.abs(ue)>.002||Math.abs(oe)>.002?f.current.animationFrameId[V]=requestAnimationFrame(ne):(z.style.opacity="1",z.style.transform="scale(1)",z.style.transition="")};f.current.timeoutId[V]=window.setTimeout(()=>{f.current.animationFrameId[V]=requestAnimationFrame(ne)},V*60)}})},[s,a]);return Ix(()=>{O(S)},[O,S,x]),Ix(()=>{setTimeout(()=>{w(!0)},200)},[]),h("div",{className:Wc(t,"joystick-with-buttons",{"hide-joystick":s,"transition-disabled":!g}),children:te("div",{className:Wc("inner",a),children:[h("div",{ref:u,className:Wc("btn-group"),children:i?.map(($,A)=>h("div",{ref:M=>{d.current[A]=M},className:Wc("btn-group-item",{disabled:y}),onClick:M=>{M.stopPropagation()},children:$.element},A))}),h("div",{className:Wc("joy-stick-container"),style:{width:x,height:x},children:h(tle,{className:Wc("joy-stick"),type:e,size:x,disableDiagonal:n,xOnly:r,yOnly:o,paddingSize:30,keepMoveEventInterval:200,onStart:C,onMove:R,onEnd:P})})]})})},Lle=({className:t,containerId:e,open:n,onOpenChange:r,title:o,content:a,buttonText:i="확인",buttonClassName:s,snapshotCnt:l,resolve:u,onConfirm:d})=>{const f=()=>{u(!0),d?.()};return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:n,onOpenChange:r,type:"dialog",dialogContainer:e?document.getElementById(e):void 0,snapshotCnt:l,hideCloseButton:!0,enableDimClose:!1,header:o?{title:o}:void 0,footer:h(Ah,{className:ae("h-[2.5rem] text-[1rem] font-medium",s),onClick:f,children:i}),children:h("div",{className:"whitespace-pre-wrap",children:a})})},{useState:$le}=await q("react"),Dle=({className:t,open:e,onOpenChange:n,title:r,content:o,buttonText:a={yes:"확인",no:"취소"},buttonClassName:i,buttonWrapperClassName:s,snapshotCnt:l,containerId:u,onConfirm:d,onCancel:f,resolve:m})=>{const[v,g]=$le(!1),w=async()=>{g(!0);try{await d?.(),m(!0)}finally{g(!1)}},y=()=>{f?.(),m(!1)};return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:l,dialogContainer:u?document.getElementById(u):void 0,hideCloseButton:!0,enableDimClose:!1,header:r?{title:r}:void 0,footer:te(Yo,{className:ae("btn-wrapper",s),alignItems:"center",gap:8,children:[h(fk,{className:ae("h-[2.5rem] px-[1rem] text-[1rem] font-medium",i?.no),onClick:y,children:a.no}),h(Ah,{className:ae("h-[2.5rem] px-[1rem] text-[1rem] font-medium",i?.yes),autoFocus:!0,onClick:w,loading:v,children:a.yes})]}),children:h("div",{className:"text-default text-center whitespace-pre-wrap",children:o})})},{cloneElement:Ble,useState:zle}=await q("react"),Fle=({className:t,open:e,onOpenChange:n,title:r,content:o,placeholder:a,inputType:i="text",inputElement:s,autoFocus:l=!1,value:u,buttonText:d={yes:"확인",no:"취소"},buttonClassName:f,buttonWrapperClassName:m,containerId:v,snapshotCnt:g,resolve:w,close:y})=>{const[_,S]=zle(u||"");return h(tc,{className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:g,dialogContainer:v?document.getElementById(v):void 0,hideCloseButton:!0,enableDimClose:!1,header:r?{title:r}:void 0,footer:te(Yo,{className:ae("btn-wrapper",m),alignItems:"center",gap:8,children:[h(fk,{className:ae("h-[2.5rem] text-[1rem] font-medium",f?.no),onClick:()=>y(),children:d.no}),h(Ah,{className:ae("h-[2.5rem] text-[1rem] font-medium",f?.yes),onClick:()=>w(_),children:d.yes})]}),children:te(Ul,{gap:16,children:[h("div",{children:o}),s?Ble(s,{value:_,handleChange:S,tabIndex:l?0:-1,placeholder:a,type:i}):h(ek,{className:ae("w-full"),type:i,tabIndex:l?0:-1,placeholder:a,value:_,handleChange:S})]})})},{useMemo:Cve}=await q("react"),Vle="_spin_tbvd8_59",jle={"count-down":"_count-down_tbvd8_40","count-down-text":"_count-down-text_tbvd8_45","count-down-refresh-img":"_count-down-refresh-img_tbvd8_49",spin:Vle},{useRef:C2,useCallback:vd,useEffect:Hle,useState:Wle,forwardRef:qle,useImperativeHandle:Ule}=await q("react"),E2=rn(jle),Yle=qle(({className:t,remainSeconds:e=10,initialPlay:n,loop:r,refreshIconClassName:o,textClassName:a,onStart:i,onComplete:s},l)=>{const u=C2(null),d=C2(null),f=C2(e),[m,v]=Wle(!1),g=vd(x=>{x<0||(f.current=x,d.current.textContent=x.toString())},[]),w=vd(()=>{g(e)},[e,g]),y=vd(()=>{u.current&&window.clearInterval(u.current)},[]),_=vd(()=>{u.current&&window.clearInterval(u.current),f.current===e&&i?.(),u.current=window.setInterval(()=>{g(f.current-1),f.current<=0&&(r?(v(!0),setTimeout(()=>{v(!1)},1e3),w()):y(),s?.())},1e3)},[r,e,i,s,w,y,g]),S=vd(()=>{v(!0),setTimeout(()=>{v(!1)},1e3),w(),_()},[w,_]);return Hle(()=>(d.current.textContent=f.current.toString(),n&&_(),()=>{u.current&&window.clearInterval(u.current)}),[]),Ule(l,()=>({restart:S,stop:y,start:_,reset:w})),h(Yo,{className:E2(t,"count-down"),justifyContent:"center",alignItems:"center",children:te("button",{onClick:S,children:[h(Hq,{className:E2("count-down-refresh-img",o,{spin:m})}),h("span",{ref:d,className:E2("count-down-text",a)})]})})});Yle.displayName="CountDown";const $x=5177,Gle=()=>{if(typeof window>"u")return"";const t=window.__RB_ASSETS_BASE_URL__;if(t)return t;const{protocol:e,hostname:n}=window.location;return e==="file:"||!n?`http://127.0.0.1:${$x}`:`${e}//${n}:${$x}`},C3=t=>{const e=t.startsWith("/")?t:`/${t}`;return`${Gle()}${e}`},Dx=t=>C3(`/imgs${t.startsWith("/")?t:`/${t}`}`),Eve=t=>C3(`/models${t}`),Mve=t=>C3(`/data/joint${t}`),{useEffect:kve}=await q("react"),Kle="_readonly_1w1i8_46",Xle="_input_1w1i8_49",Zle={"side-number-input":"_side-number-input_1w1i8_40",readonly:Kle,"number-btn":"_number-btn_1w1i8_46",input:Xle},{forwardRef:Qle,useCallback:pa,useEffect:wd,useImperativeHandle:Jle,useMemo:ece,useRef:qa,useState:Bx}=await q("react"),i1=rn(Zle,"rb-ui"),tce=t=>{const e=t?.target?.value;return kn.replace(e,/^0+[\d,]/gm,o=>kn.last(o)).replace(/[^\d.-]/g,"")},nce=Qle(({className:t="",inputClassName:e="",step:n=1,error:r,isDirect:o=!0,increaseStep:a,decreaseStep:i,maxLength:s,increaseElement:l="+",decreaseElement:u="-",detectDobleClick:d,rippleOption:f,notAllowedEmptyValue:m,inputDisabled:v,disableAutoAccel:g,disableLongPress:w,handleChange:y,onButtonPointerDown:_,onButtonPointerUp:S,handleEnter:x,...C},R)=>{const{value:P,readOnly:O,disabled:$,min:A,max:M="9999999999999",digit:L=18,onFocus:B,onBlur:F}=C,N=qa(null),V=qa(!1),z=qa(!1),I=qa({up:0,down:0}),D=qa(""),U=qa(null),Y=qa(null),oe=qa(0),Q=qa(0),re=qa(1e3),[le,ee]=Bx(P??""),[ne,ue]=Bx(!1),ve=ece(()=>$||new Ut(A??0).cmp(new Ut(M))>0,[$,M,A]),we=pa((_e,at,ht)=>at===0?_e:ht==="up"?new Ut(_e||0).add(new Ut(U.current?.increase??at??1)).toDP(L,Ut.ROUND_DOWN).toString():new Ut(_e||0).sub(new Ut(U.current?.decrease??at??1)).toDP(L,Ut.ROUND_DOWN).toString(),[L]),ye=pa(_e=>typeof _e>"u"||!_e||ve?"":_e.endsWith(".")?_e:typeof A<"u"&&new Ut(Number(_e)).lt(new Ut(A))?String(A):typeof M<"u"&&new Ut(Dl(_e||"")).gt(new Ut(M))?String(M):_e,[A,M,ve]),Le=pa(_e=>ve?"":_e.endsWith(".")?_e:ye(_e),[ve,ye]),Oe=pa(({type:_e,e:at})=>{if(!N.current||ve)return;const{value:ht,name:st}=N.current,Ct=tce({target:{value:ht}}),cn=L?new RegExp(`^-?[0-9]*[.]{0,1}[0-9]{0,${L}}$`,"gm"):/^-?\d{0,18}$/;Ct.match(cn)&&(typeof s<"u"&&(Ct||"").split(".")[0].replace(/[^0-9]/g,"").length>Number(s)||(N.current.value=Bi(Ct??"").join("."),D.current!==Ct&&(y?.(Ct,st,{type:_e}),at&&C.onChange?.(at),D.current=Ct),ee(Ct)))},[ve,L,s,y,C]),Ne=pa((_e,at)=>{N.current&&(ue(at),at?B?.(_e):(N.current.value=Le(N.current.value),m&&!_e.target.value&&(N.current.value=C.value),Oe({}),F?.(_e)))},[B,Le,m,C.value,Oe,F]),me=pa(_e=>{if(ve||O){V.current=!1,window.clearTimeout(oe.current);return}D.current=we(D.current??"0",Y.current,_e),D.current=ye(D.current??"0"),ee(String(D.current)),y?.(D.current,C.name,{type:_e}),_?.(_e),window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>{V.current&&(me(_e),re.current>100&&!g&&(re.current-=re.current/5))},re.current)},[_,we,ye,ve,y,C.name,g,O]),pe=pa(_e=>{const{value:at="",name:ht}=_e.target;m&&!at&&(_e.target.value=C.value),x?.(at,ht),_e.target.blur()},[x,C.value,m]),be=pa(_e=>{_e.key==="Enter"&&!_e.nativeEvent.isComposing&&pe(_e),C.onKeyDown?.(_e)},[C,pe]),Ue=pa((_e,at)=>{if(!(Date.now()-I.current[_e]<500&&d)){if(ve||O){V.current=!1,window.clearTimeout(oe.current);return}I.current[_e]=Date.now(),me(_e),w||(oe.current=window.setTimeout(()=>{V.current=!0,me(_e)},re.current)),z.current=!0}},[d,ve,O,me,w]),He=pa((_e,at)=>{if(ve||O||!z.current){V.current=!1,window.clearTimeout(oe.current);return}V.current=!1,z.current=!1,window.clearTimeout(oe.current),_e&&S?.(_e,at),_e&&Oe({type:_e})},[ve,Oe,O,S]),qe=pa(()=>{V.current=!1,window.clearTimeout(oe.current),window.clearTimeout(Q.current)},[]);return wd(()=>{D.current=P??""},[P]),wd(()=>{typeof P<"u"&&ee(P)},[P]),wd(()=>{Y.current=n},[n]),wd(()=>{U.current={increase:a,decrease:i}},[a,i]),Jle(R,()=>N.current),wd(()=>{const _e=at=>{at.type==="contextmenu"&&V.current&&at.preventDefault()};return window.addEventListener("contextmenu",_e),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e),()=>{window.removeEventListener("contextmenu",_e),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e)}},[qe]),te(Yo,{className:i1("side-number-input",{focus:ne,readonly:O,disabled:$,error:r},t),alignItems:"center",justifyContent:"center",children:[h(Rr,{...f,disabled:ve||f?.disabled,children:h("button",{type:"button","data-type":"down",className:i1("number-btn","down"),disabled:ve||M===le,onPointerDown:_e=>{Ue("down",_e)},onPointerUp:_e=>{He("down",_e)},onPointerLeave:_e=>{_e.currentTarget.hasPointerCapture?.(_e.pointerId)||He(void 0,_e)},onPointerCancel:_e=>{He(void 0,_e)},onLostPointerCapture:_e=>{He(void 0,_e)},onContextMenu:_e=>{_e.preventDefault()},children:u})}),h("input",{...C,className:i1("input",{focus:ne,readonly:O,disabled:$,error:r},e),ref:N,type:"text",value:Bi(le??"").join(".")??"",readOnly:!o,disabled:$||v,onChange:_e=>Oe({e:_e}),onFocus:_e=>Ne(_e,!0),onBlur:_e=>Ne(_e,!1),onKeyDown:be,onContextMenu:_e=>{_e.preventDefault()}}),h(Rr,{...f,disabled:ve||f?.disabled,children:h("button",{type:"button","data-type":"up",className:i1("number-btn","up"),disabled:ve||A===le,onPointerDown:_e=>{Ue("up",_e)},onPointerUp:_e=>{He("up",_e)},onPointerLeave:_e=>{_e.currentTarget.hasPointerCapture?.(_e.pointerId)||He(void 0,_e)},onPointerCancel:_e=>{He(void 0,_e)},onLostPointerCapture:_e=>{He(void 0,_e)},onContextMenu:_e=>{_e.preventDefault()},children:l})})]})});nce.displayName="SideNumberInput";const{useCallback:s1}=await q("react"),Rve=({alertComponent:t,confirmComponent:e,promptComponent:n,options:r}={})=>{const{modal:o,closeModal:a}=OE(),i=s1(async({modalId:d,componentName:f,...m})=>o({component:t??Lle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,t,r?.containerId]),s=s1(async({modalId:d,componentName:f,...m})=>o({component:e??Dle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,e,r?.containerId]),l=s1(async({modalId:d,componentName:f,...m})=>o({component:n??Fle,props:{...m,containerId:r?.containerId},options:{id:d,componentName:f??kn.uniqueId()}}),[o,n,r?.containerId]),u=s1(d=>{a(d)},[a]);return{alertDialog:i,confirmDialog:s,promptDialog:l,closeDialog:u}},{useCallback:l1}=await q("react"),Tve=({alertComponent:t,confirmComponent:e,promptComponent:n}={})=>{const{modal:r,closeModal:o}=OE(),a=l1(async({modalId:u,componentName:d,...f})=>r({component:t??sfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,t]),i=l1(async({modalId:u,componentName:d,...f})=>r({component:e??cfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,e]),s=l1(async({modalId:u,componentName:d,...f})=>r({component:n??mfe,props:f,options:{id:u,componentName:d??kn.uniqueId()}}),[r,n]),l=l1(u=>{o(u)},[o]);return{alertDialog:a,confirmDialog:i,promptDialog:s,closeDialog:l}},oi=Object.create(null);oi.open="0";oi.close="1";oi.ping="2";oi.pong="3";oi.message="4";oi.upgrade="5";oi.noop="6";const r0=Object.create(null);Object.keys(oi).forEach(t=>{r0[oi[t]]=t});const zv={type:"error",data:"parser error"},vk=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wk=typeof ArrayBuffer=="function",bk=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,E3=({type:t,data:e},n,r)=>vk&&e instanceof Blob?n?r(e):zx(e,r):wk&&(e instanceof ArrayBuffer||bk(e))?n?r(e):zx(new Blob([e]),r):r(oi[t]+(e||"")),zx=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Fx(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let M2;function rce(t,e){if(vk&&t.data instanceof Blob)return t.data.arrayBuffer().then(Fx).then(e);if(wk&&(t.data instanceof ArrayBuffer||bk(t.data)))return e(Fx(t.data));E3(t,!1,n=>{M2||(M2=new TextEncoder),e(M2.encode(n))})}const Vx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Vx.length;t++)jd[Vx.charCodeAt(t)]=t;const oce=t=>{let e=t.length*.75,n=t.length,r,o=0,a,i,s,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const u=new ArrayBuffer(e),d=new Uint8Array(u);for(r=0;r<n;r+=4)a=jd[t.charCodeAt(r)],i=jd[t.charCodeAt(r+1)],s=jd[t.charCodeAt(r+2)],l=jd[t.charCodeAt(r+3)],d[o++]=a<<2|i>>4,d[o++]=(i&15)<<4|s>>2,d[o++]=(s&3)<<6|l&63;return u},ace=typeof ArrayBuffer=="function",M3=(t,e)=>{if(typeof t!="string")return{type:"message",data:yk(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:ice(t.substring(1),e)}:r0[n]?t.length>1?{type:r0[n],data:t.substring(1)}:{type:r0[n]}:zv},ice=(t,e)=>{if(ace){const n=oce(t);return yk(n,e)}else return{base64:!0,data:t}},yk=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},_k="",sce=(t,e)=>{const n=t.length,r=new Array(n);let o=0;t.forEach((a,i)=>{E3(a,!1,s=>{r[i]=s,++o===n&&e(r.join(_k))})})},lce=(t,e)=>{const n=t.split(_k),r=[];for(let o=0;o<n.length;o++){const a=M3(n[o],e);if(r.push(a),a.type==="error")break}return r};function cce(){return new TransformStream({transform(t,e){rce(t,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const a=new DataView(o.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{o=new Uint8Array(9);const a=new DataView(o.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(o[0]|=128),e.enqueue(o),e.enqueue(n)})}})}let k2;function c1(t){return t.reduce((e,n)=>e+n.length,0)}function u1(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let o=0;o<e;o++)n[o]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function uce(t,e){k2||(k2=new TextDecoder);const n=[];let r=0,o=-1,a=!1;return new TransformStream({transform(i,s){for(n.push(i);;){if(r===0){if(c1(n)<1)break;const l=u1(n,1);a=(l[0]&128)===128,o=l[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(c1(n)<2)break;const l=u1(n,2);o=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(c1(n)<8)break;const l=u1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){s.enqueue(zv);break}o=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(c1(n)<o)break;const l=u1(n,o);s.enqueue(M3(a?l:k2.decode(l),e)),r=0}if(o===0||o>t){s.enqueue(zv);break}}}})}const xk=4;function Qn(t){if(t)return dce(t)}function dce(t){for(var e in Qn.prototype)t[e]=Qn.prototype[e];return t}Qn.prototype.on=Qn.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Qn.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Qn.prototype.off=Qn.prototype.removeListener=Qn.prototype.removeAllListeners=Qn.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Qn.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,e)}return this};Qn.prototype.emitReserved=Qn.prototype.emit;Qn.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Qn.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Bh=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Ho=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fce="arraybuffer";function Sk(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const pce=Ho.setTimeout,hce=Ho.clearTimeout;function zh(t,e){e.useNativeTimers?(t.setTimeoutFn=pce.bind(Ho),t.clearTimeoutFn=hce.bind(Ho)):(t.setTimeoutFn=Ho.setTimeout.bind(Ho),t.clearTimeoutFn=Ho.clearTimeout.bind(Ho))}const mce=1.33;function gce(t){return typeof t=="string"?vce(t):Math.ceil((t.byteLength||t.size)*mce)}function vce(t){let e=0,n=0;for(let r=0,o=t.length;r<o;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function Ck(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function wce(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function bce(t){let e={},n=t.split("&");for(let r=0,o=n.length;r<o;r++){let a=n[r].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}class yce extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class k3 extends Qn{constructor(e){super(),this.writable=!1,zh(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new yce(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=M3(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=wce(e);return n.length?"?"+n:""}}class _ce extends k3{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};lce(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,sce(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Ck()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ek=!1;try{Ek=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xce=Ek;function Sce(){}class Cce extends _ce{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let lu=class o0 extends Qn{constructor(e,n,r){super(),this.createRequest=e,zh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=Sk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=o0.requestsCount++,o0.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Sce,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete o0.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};lu.requestsCount=0;lu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jx);else if(typeof addEventListener=="function"){const t="onpagehide"in Ho?"pagehide":"unload";addEventListener(t,jx,!1)}}function jx(){for(let t in lu.requests)lu.requests.hasOwnProperty(t)&&lu.requests[t].abort()}const Ece=(function(){const t=Mk({xdomain:!1});return t&&t.responseType!==null})();class Mce extends Cce{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=Ece&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new lu(Mk,this.uri(),e)}}function Mk(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||xce))return new XMLHttpRequest}catch{}if(!e)try{return new Ho[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const kk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class kce extends k3{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=kk?{}:Sk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;E3(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}o&&Bh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Ck()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const R2=Ho.WebSocket||Ho.MozWebSocket;class Rce extends kce{createSocket(e,n,r){return kk?new R2(e,n,r):n?new R2(e,n):new R2(e)}doWrite(e,n){this.ws.send(n)}}class Tce extends k3{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=uce(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),o=cce();o.readable.pipeTo(e.writable),this._writer=o.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;this._writer.write(r).then(()=>{o&&Bh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Nce={websocket:Rce,webtransport:Tce,polling:Mce},Pce=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ace=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Fv(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let o=Pce.exec(t||""),a={},i=14;for(;i--;)a[Ace[i]]=o[i]||"";return n!=-1&&r!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Ice(a,a.path),a.queryKey=Oce(a,a.query),a}function Ice(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Oce(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,a){o&&(n[o]=a)}),n}const Vv=typeof addEventListener=="function"&&typeof removeEventListener=="function",a0=[];Vv&&addEventListener("offline",()=>{a0.forEach(t=>t())},!1);class Ls extends Qn{constructor(e,n){if(super(),this.binaryType=fce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=Fv(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Fv(n.host).host);zh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=bce(this.opts.query)),Vv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},a0.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=xk,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Ls.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ls.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=gce(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Bh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:e,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Ls.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Vv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=a0.indexOf(this._offlineEventListener);r!==-1&&a0.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ls.protocol=xk;class Lce extends Ls{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Ls.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ls.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function a(){r||(r=!0,d(),n.close(),n=null)}const i=f=>{const m=new Error("probe error: "+f);m.transport=n.name,a(),this.emitReserved("upgradeError",m)};function s(){i("transport closed")}function l(){i("socket closed")}function u(f){n&&f.name!==n.name&&a()}const d=()=>{n.removeListener("open",o),n.removeListener("error",i),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",o),n.once("error",i),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let $ce=class extends Lce{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>Nce[o]).filter(o=>!!o)),super(e,r)}};function Dce(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=Fv(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+e,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const Bce=typeof ArrayBuffer=="function",zce=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Rk=Object.prototype.toString,Fce=typeof Blob=="function"||typeof Blob<"u"&&Rk.call(Blob)==="[object BlobConstructor]",Vce=typeof File=="function"||typeof File<"u"&&Rk.call(File)==="[object FileConstructor]";function R3(t){return Bce&&(t instanceof ArrayBuffer||zce(t))||Fce&&t instanceof Blob||Vce&&t instanceof File}function i0(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(i0(t[n]))return!0;return!1}if(R3(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return i0(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&i0(t[n]))return!0;return!1}function jce(t){const e=[],n=t.data,r=t;return r.data=jv(n,e),r.attachments=e.length,{packet:r,buffers:e}}function jv(t,e){if(!t)return t;if(R3(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=jv(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=jv(t[r],e));return n}return t}function Hce(t,e){return t.data=Hv(t.data,e),delete t.attachments,t}function Hv(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Hv(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Hv(t[n],e));return t}const Wce=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var nn;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(nn||(nn={}));class qce{constructor(e){this.replacer=e}encode(e){return(e.type===nn.EVENT||e.type===nn.ACK)&&i0(e)?this.encodeAsBinary({type:e.type===nn.EVENT?nn.BINARY_EVENT:nn.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===nn.BINARY_EVENT||e.type===nn.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=jce(e),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}class T3 extends Qn{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===nn.BINARY_EVENT;r||n.type===nn.BINARY_ACK?(n.type=r?nn.EVENT:nn.ACK,this.reconstructor=new Uce(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(R3(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(nn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===nn.BINARY_EVENT||r.type===nn.BINARY_ACK){const a=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const i=e.substring(a,n);if(i!=Number(i)||e.charAt(n)!=="-")throw new Error("Illegal attachments");const s=Number(i);if(!Yce(s)||s<0)throw new Error("Illegal attachments");if(s>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=s}if(e.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(a,n)}else r.nsp="/";const o=e.charAt(n+1);if(o!==""&&Number(o)==o){const a=n+1;for(;++n;){const i=e.charAt(n);if(i==null||Number(i)!=i){--n;break}if(n===e.length)break}r.id=Number(e.substring(a,n+1))}if(e.charAt(++n)){const a=this.tryParse(e.substr(n));if(T3.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case nn.CONNECT:return Hx(n);case nn.DISCONNECT:return n===void 0;case nn.CONNECT_ERROR:return typeof n=="string"||Hx(n);case nn.EVENT:case nn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Wce.indexOf(n[0])===-1);case nn.ACK:case nn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Uce{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=Hce(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Yce=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function Hx(t){return Object.prototype.toString.call(t)==="[object Object]"}const Gce=Object.freeze(Object.defineProperty({__proto__:null,Decoder:T3,Encoder:qce,get PacketType(){return nn}},Symbol.toStringTag,{value:"Module"}));function ma(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Kce=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Tk extends Qn{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ma(e,"open",this.onopen.bind(this)),ma(e,"packet",this.onpacket.bind(this)),ma(e,"error",this.onerror.bind(this)),ma(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,o,a;if(Kce.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const i={type:nn.EVENT,data:n};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),i.id=d}const s=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[e]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},o),i=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...n){return new Promise((r,o)=>{const a=(i,s)=>i?o(i):r(s);a.withError=!0,n.push(a),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...a)=>(this._queue[0],o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:nn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case nn.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case nn.EVENT:case nn.BINARY_EVENT:this.onevent(e);break;case nn.ACK:case nn.BINARY_ACK:this.onack(e);break;case nn.DISCONNECT:this.ondisconnect();break;case nn.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:nn.ACK,id:e,data:o}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:nn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Nu(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nu.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};Nu.prototype.reset=function(){this.attempts=0};Nu.prototype.setMin=function(t){this.ms=t};Nu.prototype.setMax=function(t){this.max=t};Nu.prototype.setJitter=function(t){this.jitter=t};class Wv extends Qn{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,zh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Nu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const o=n.parser||Gce;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new $ce(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=ma(n,"open",function(){r.onopen(),e&&e()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),e?e(s):this.maybeReconnectOnOpen()},i=ma(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{o(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(o),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ma(e,"ping",this.onping.bind(this)),ma(e,"data",this.ondata.bind(this)),ma(e,"error",this.onerror.bind(this)),ma(e,"close",this.onclose.bind(this)),ma(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Bh(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Tk(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const bd={};function s0(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=Dce(t,e.path||"/socket.io"),r=n.source,o=n.id,a=n.path,i=bd[o]&&a in bd[o].nsps,s=e.forceNew||e["force new connection"]||e.multiplex===!1||i;let l;return s?l=new Wv(r,e):(bd[o]||(bd[o]=new Wv(r,e)),l=bd[o]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(s0,{Manager:Wv,Socket:Tk,io:s0,connect:s0});var T2,Wx;function Xce(){if(Wx)return T2;Wx=1;var t=typeof Element<"u",e=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(a,i){if(a===i)return!0;if(a&&i&&typeof a=="object"&&typeof i=="object"){if(a.constructor!==i.constructor)return!1;var s,l,u;if(Array.isArray(a)){if(s=a.length,s!=i.length)return!1;for(l=s;l--!==0;)if(!o(a[l],i[l]))return!1;return!0}var d;if(e&&a instanceof Map&&i instanceof Map){if(a.size!==i.size)return!1;for(d=a.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;for(d=a.entries();!(l=d.next()).done;)if(!o(l.value[1],i.get(l.value[0])))return!1;return!0}if(n&&a instanceof Set&&i instanceof Set){if(a.size!==i.size)return!1;for(d=a.entries();!(l=d.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(i)){if(s=a.length,s!=i.length)return!1;for(l=s;l--!==0;)if(a[l]!==i[l])return!1;return!0}if(a.constructor===RegExp)return a.source===i.source&&a.flags===i.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof i.valueOf=="function")return a.valueOf()===i.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof i.toString=="function")return a.toString()===i.toString();if(u=Object.keys(a),s=u.length,s!==Object.keys(i).length)return!1;for(l=s;l--!==0;)if(!Object.prototype.hasOwnProperty.call(i,u[l]))return!1;if(t&&a instanceof Element)return!1;for(l=s;l--!==0;)if(!((u[l]==="_owner"||u[l]==="__v"||u[l]==="__o")&&a.$$typeof)&&!o(a[u[l]],i[u[l]]))return!1;return!0}return a!==a&&i!==i}return T2=function(i,s){try{return o(i,s)}catch(l){if((l.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw l}},T2}var Zce=Xce();const Qce=Ea(Zce),{createContext:Jce,useCallback:ha,useContext:N3,useEffect:$l,useLayoutEffect:eue,useMemo:tue,useRef:Di,useState:Rs}=await q("react"),l0={connected:null,realConnected:null,isInitialConnecting:!0,socketId:null,getSocketId:()=>null,setSocketUrl:()=>{},socketEventOn:()=>{},socketEventOff:()=>{},socketEventEmit:()=>{},setPrevResponse:()=>{},getPrevResponse:()=>null},Fh=Jce(l0),Pve=({url:t,socketOptions:e={},children:n,loadingElement:r})=>{const{transports:o=["websocket","polling"],reconnectionAttempts:a=1/0,reconnectionDelay:i=1e3,reconnectionDelayMax:s=5e3,timeout:l=2e4,...u}=e,d=Di(null),f=Di({}),m=Di({}),v=Di({}),[g,w]=Rs(t),[y,_]=Rs(l0.realConnected),[S,x]=Rs(l0.connected),[C,R]=Rs(l0.isInitialConnecting),[P,O]=Rs(null);$l(()=>{w(t)},[t]);const $=ha(D=>{w(D)},[]),A=ha((D,U)=>{Object.values(f.current[D]??{}).forEach(Y=>{Y(U)})},[]),M=ha((D,U)=>{d.current?.emit(D,U)},[]),L=ha(({topic:D,id:U,subscribePayload:Y},oe)=>{if(f.current[D]||(f.current[D]={}),!d.current?.hasListeners(D)){const Q={topic:D,...Y??{}};Y&&Object.keys(Y).length>0&&(v.current[D]=Y),M("subscribe",Q),d.current?.on(D,re=>{A(D,re)})}f.current[D][U]=oe},[M,A]),B=ha(({topic:D,id:U})=>{if(f.current[D]?.[U]&&(delete f.current[D][U],Object.keys(f.current[D]).length===0)){d.current?.off(D);const Y=v.current[D],oe=Y?{topic:D,...Y}:{topic:D};M("unsubscribe",oe),delete v.current[D]}},[M]),F=ha((D,U)=>m.current[D]?.[U],[]),N=ha((D,U)=>{m.current[D]={raw:U,parsed:m0(U)}},[]),V=ha(()=>d.current?.id??null,[]),z=ha(()=>{d.current&&(d.current.disconnect(),d.current=null),d.current=s0(g,{transports:o,reconnectionAttempts:a,reconnectionDelay:i,reconnectionDelayMax:s,timeout:l,...u}),Object.keys(f.current).forEach(D=>{Object.keys(f.current[D]??{}).length>0&&d.current?.on(D,U=>{A(D,U)})}),d.current.on("connect",()=>{console.log("Socket.io connected"),x(!0),_(!0),O(d.current?.id??null),A("connect","connected")}),d.current.on("disconnect",D=>{console.log("Socket.io disconnected",D),_(!1),A("disconnect","disconnected")}),d.current.io.on("reconnect",D=>{console.log("Socket.io reconnect",D),A("reconnect",D),Object.keys(f.current).forEach(U=>{if(Object.keys(f.current[U])?.length){const Y={topic:U,...v.current[U]??{}};M("subscribe",Y),d.current?.emit("subscribe",Y)}})}),d.current.io.on("reconnect_attempt",D=>{console.log("Socket.io reconnect_attempt",D),D>3&&x(!1),A("reconnect_attempt",D)}),d.current.io.on("reconnect_error",D=>{A("reconnect_error",D)}),d.current.io.on("reconnect_failed",()=>{console.error("Socket.io reconnect_failed"),x(!1),_(!1),A("reconnect_failed","reconnect_failed")}),d.current.on("error",D=>{console.error("Socket.io error: ",D),A("error",D)})},[A,a,i,s,JSON.stringify(u),JSON.stringify(o),g]),I=tue(()=>({connected:S,realConnected:y,isInitialConnecting:C,socketId:P,getSocketId:V,setSocketUrl:$,socketEventOn:L,socketEventOff:B,socketEventEmit:M,setPrevResponse:N,getPrevResponse:F}),[S,y,C,P,V,$,L,B,M,N,F]);return eue(()=>{z()},[z]),$l(()=>{!S&&m.current&&Object.keys(m.current).forEach(D=>{M(D,void 0),N(D,void 0)})},[S,N,M]),$l(()=>{S&&R(!1)},[S]),h(Fh.Provider,{value:I,children:n})},Ave=()=>{const{connected:t,realConnected:e,socketEventEmit:n,setSocketUrl:r,socketId:o,getSocketId:a}=N3(Fh);return{connected:t,realConnected:e,socketEventEmit:n,setSocketUrl:r,socketId:o,getSocketId:a}},nue=t=>{const{socketEventOn:e,socketEventOff:n,setPrevResponse:r,getPrevResponse:o}=N3(Fh),a=Di({options:t.options,callback:t.callback}),[i]=Rs(kn.uniqueId()),{topic:s}=t;$l(()=>{a.current={options:t.options,callback:t.callback}},[t]),$l(()=>{if(!t.options?.disabled)return e({topic:s,id:i,subscribePayload:t.options?.subscribePayload},l=>{const{options:u,callback:d}=a.current;u?.prevData,r(s,l);const f=m0(l);d?.(f)}),()=>{n({topic:s,id:i})}},[o,r,n,e,s,i,t.options?.disabled,t.options?.subscribePayload])},Ive=(t,e={})=>{const{realConnected:n,isInitialConnecting:r,getPrevResponse:o,setPrevResponse:a}=N3(Fh),[i,s]=Rs(!o(t,"parsed")&&!!e.defaultValue),l=n?o(t,"parsed")??e.defaultValue:e.defaultValue,[u,d]=Rs(e.selector?e.selector(l):l),f=Di(u),m=Di(i),v=Di(e);f.current=u,m.current=i,v.current=e;const g=ha(S=>{e.disabled||(d(e.selector?e.selector(S):S),a(t,S),s(!1))},[a,t,e]),w=e.throttleMs??0,y=Di({timer:null,pending:null,hasPending:!1}),_=ha(S=>{const x=e.selector?e.selector(S):S;!e.disableDuplicateCheck&&Qce(x,f.current)&&!m.current||(d(x),x&&s(!1))},[e]);return $l(()=>{const S=y.current;return()=>{S.timer&&clearTimeout(S.timer)}},[]),nue({topic:t,callback:S=>{if(w<=0){_(S);return}const x=y.current;x.pending=S,x.hasPending=!0,!x.timer&&(x.timer=setTimeout(()=>{x.timer=null,x.hasPending&&(x.hasPending=!1,_(x.pending),x.pending=null)},w))},options:{...e,prevData:u,subscribePayload:e.subscribePayload}}),$l(()=>{if(!n){const S=v.current,x=S.defaultValue===void 0?void 0:S.selector?S.selector(S.defaultValue):S.defaultValue;d(x),a(t,void 0),s(S.defaultValue!==void 0)}},[n,a,t]),{data:u,changeData:g,loading:!u&&!r,isDefaultData:i}},{useRef:Ove}=await q("react"),{useMutation:Lve}=await q("@tanstack/react-query"),{useMutation:$ve}=await q("@tanstack/react-query"),{useMutation:Dve}=await q("@tanstack/react-query"),{useMutation:Bve}=await q("@tanstack/react-query"),{useMutation:zve}=await q("@tanstack/react-query"),{useMutation:Fve}=await q("@tanstack/react-query"),{useMutation:Vve}=await q("@tanstack/react-query"),{useMutation:jve}=await q("@tanstack/react-query"),{useMutation:Hve}=await q("@tanstack/react-query"),{useCallback:Wve}=await q("react"),{useCallback:qve}=await q("react"),{useMutation:Uve}=await q("@tanstack/react-query"),{useMutation:Yve,useQueryClient:Gve}=await q("@tanstack/react-query"),{useMutation:Kve,useQueryClient:Xve}=await q("@tanstack/react-query"),{useMutation:Zve,useQueryClient:Qve}=await q("@tanstack/react-query"),{useMutation:Jve}=await q("@tanstack/react-query"),{useMutation:ewe}=await q("@tanstack/react-query"),{useMutation:twe}=await q("@tanstack/react-query"),{useMutation:nwe}=await q("@tanstack/react-query"),{useMutation:rwe}=await q("@tanstack/react-query"),{useMutation:owe}=await q("@tanstack/react-query"),{useMutation:awe}=await q("@tanstack/react-query"),{useMutation:iwe}=await q("@tanstack/react-query"),{useMutation:swe}=await q("@tanstack/react-query"),{useMutation:lwe}=await q("@tanstack/react-query"),{useMutation:cwe}=await q("@tanstack/react-query"),{useMutation:uwe}=await q("@tanstack/react-query"),{useMutation:dwe}=await q("@tanstack/react-query"),{useMutation:fwe}=await q("@tanstack/react-query"),{useMutation:pwe}=await q("@tanstack/react-query"),{useMutation:hwe}=await q("@tanstack/react-query"),{useMutation:mwe}=await q("@tanstack/react-query"),{useMutation:gwe}=await q("@tanstack/react-query"),{useMutation:vwe}=await q("@tanstack/react-query"),{useMutation:wwe}=await q("@tanstack/react-query"),{useMutation:bwe}=await q("@tanstack/react-query"),{useMutation:ywe}=await q("@tanstack/react-query"),{useMutation:_we}=await q("@tanstack/react-query"),{useMutation:xwe}=await q("@tanstack/react-query"),{useMutation:Swe}=await q("@tanstack/react-query"),{useMutation:Cwe}=await q("@tanstack/react-query"),{useMutation:Ewe}=await q("@tanstack/react-query"),{useMutation:Mwe}=await q("@tanstack/react-query"),{useMutation:kwe}=await q("@tanstack/react-query"),{useMutation:Rwe}=await q("@tanstack/react-query"),{useMutation:Twe}=await q("@tanstack/react-query"),{useMutation:Nwe}=await q("@tanstack/react-query"),{useMutation:Pwe}=await q("@tanstack/react-query"),{useMutation:Awe}=await q("@tanstack/react-query"),{useMutation:Iwe}=await q("@tanstack/react-query"),{useMutation:Owe}=await q("@tanstack/react-query"),{useMutation:Lwe}=await q("@tanstack/react-query"),{useMutation:$we}=await q("@tanstack/react-query"),{useMutation:Dwe}=await q("@tanstack/react-query"),{useMutation:Bwe}=await q("@tanstack/react-query"),{useMutation:zwe}=await q("@tanstack/react-query"),{useMutation:rue}=await q("@tanstack/react-query"),oue="/setUrl",Fwe=()=>rue({mutationFn:t=>Th.post(oue,t)}),{useMutation:Vwe}=await q("@tanstack/react-query"),{useMutation:jwe}=await q("@tanstack/react-query"),{useCallback:Hwe}=await q("react"),{useMutation:Wwe}=await q("@tanstack/react-query"),{useCallback:qwe}=await q("react"),{useMutation:Uwe}=await q("@tanstack/react-query"),{useCallback:Ywe}=await q("react"),{useMutation:Gwe}=await q("@tanstack/react-query"),{useCallback:Kwe}=await q("react"),{useMutation:Xwe}=await q("@tanstack/react-query"),{useCallback:Zwe}=await q("react"),{useMutation:Qwe}=await q("@tanstack/react-query"),{useCallback:Jwe}=await q("react"),{useMutation:e3e}=await q("@tanstack/react-query"),{useCallback:t3e}=await q("react"),{useMutation:n3e}=await q("@tanstack/react-query"),{useMutation:r3e}=await q("@tanstack/react-query"),{useMutation:o3e}=await q("@tanstack/react-query"),{useMutation:a3e}=await q("@tanstack/react-query"),{useMutation:i3e}=await q("@tanstack/react-query"),{useMutation:s3e}=await q("@tanstack/react-query"),{useMutation:l3e}=await q("@tanstack/react-query"),{useMutation:c3e}=await q("@tanstack/react-query"),{useMutation:u3e}=await q("@tanstack/react-query"),{useCallback:d3e}=await q("react"),{useMutation:f3e}=await q("@tanstack/react-query"),{useCallback:p3e}=await q("react"),{useEffect:h3e,useRef:m3e,useState:g3e}=await q("react"),{useMutation:v3e}=await q("@tanstack/react-query"),{useEffect:w3e,useRef:b3e,useState:y3e}=await q("react"),{useMutation:_3e}=await q("@tanstack/react-query"),{useMutation:x3e}=await q("@tanstack/react-query"),{useMutation:S3e}=await q("@tanstack/react-query"),{useMutation:C3e}=await q("@tanstack/react-query"),{useEffect:E3e,useMemo:M3e,useState:k3e}=await q("react"),{useMemo:R3e}=await q("react"),aue={moveState:{autoMove:"stop",moveId:"",moveResult:"",dockMove:"",jogMove:"none",obs:"none",pathState:"none",step:0,multiId:"",multiState:""},pose:{x:0,y:0,rz:0},vel:{vx:0,vy:0,wz:0},curNode:{id:"",name:"",state:"",pose:{x:0,y:0,rz:0}},goalNode:{id:"",name:"",state:"",pose:{x:0,y:0,rz:0}}},iue=t=>({...t,pose:{x:String(t.pose.x),y:String(t.pose.y),rz:String(t.pose.rz)}});iue(aue);const{useCallback:T3e,useMemo:N3e}=await q("react"),{useMemo:P3e}=await q("react"),{useRef:A3e}=await q("react"),{useCallback:I3e,useEffect:O3e,useRef:L3e,useState:$3e}=await q("react"),{useCallback:D3e}=await q("react"),{useCallback:B3e}=await q("react"),{useEffect:qx,useState:sue}=await q("react"),lue=t=>{const[e,n]=sue("");return qx(()=>{},[e,t]),qx(()=>{let r="",o;const a=i=>{clearTimeout(o);const s=document.activeElement;if(!(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.tagName==="SELECT"||s.contentEditable==="true"))){if(i.key==="Enter"){n(r.trim()),r="";return}/^[a-zA-Z0-9\-_]$/.test(i.key)&&(r+=i.key),o=setTimeout(()=>{n(r.trim()),r=""},100)}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),{barCodeValue:e}},{useMemo:z3e}=await q("react"),{useEffect:F3e,useRef:V3e,useCallback:j3e}=await q("react"),{useRef:cue,useState:uue}=await q("react"),H3e=({onFiles:t,accept:e,multiple:n=!0,onRejected:r})=>{const o=cue(null),[a,i]=uue(!1),s=v=>{const g=n?v:v.slice(0,1);if(g.length===0)return;if(!e||e.length===0){t(g);return}const w=e.map(S=>S.toLowerCase()),y=g.filter(S=>w.some(x=>S.name.toLowerCase().endsWith(x))),_=g.filter(S=>!y.includes(S));_.length>0&&r?.(_),y.length>0&&t(y)},l=v=>{v.preventDefault(),v.stopPropagation(),i(!0)},u=v=>{v.preventDefault(),v.stopPropagation(),i(!1)},d=v=>{v.preventDefault(),v.stopPropagation(),i(!1),s(Array.from(v.dataTransfer.files))},f=()=>o.current?.click(),m={ref:o,type:"file",multiple:n,accept:e?.join(","),style:{display:"none"},onChange:v=>{s(Array.from(v.target.files??[])),v.target.value=""}};return{isDragging:a,dropProps:{onDragOver:l,onDragLeave:u,onDrop:d},inputProps:m,open:f}},due={"popover-area":"_popover-area_y74pu_40","btn-popover":"_btn-popover_y74pu_45","popover-element-wrap":"_popover-element-wrap_y74pu_59","popover-element":"_popover-element_y74pu_59"},{cloneElement:fue,forwardRef:pue,useCallback:yd,useEffect:hue,useImperativeHandle:mue,useMemo:Ux,useRef:Yx,useState:Gx}=await q("react"),d1=rn(due,"rb-ui"),Kx=[],P3=pue(({id:t,className:e="",popoverAreaClassName:n,popoverElementClassName:r,anchorId:o,detectDoubleClick:a,popoverElement:i,popoverStyle:s={top:0,left:0,zIndex:1},popoverAnimation:l={name:"pop-fade",duration:200},ripple:u,disabled:d=!1,excludeOutSideIds:f=Kx,whenWindowScrollClose:m,children:v,onClick:g,onClose:w},y)=>{const _=Yx(null),S=Yx(!1),[x,C]=Gx(!1),[R,P]=Gx(""),O=Ux(()=>x?R==="enter"||R==="leave"?{animationName:l.name,animationDuration:`${l.duration}ms`,animationTimingFunction:l.timingFunc||"ease",animationDirection:R==="leave"?"reverse":"normal",animationFillMode:R==="leave"?"forwards":"normal"}:{}:{},[l,x,R]),$=yd(N=>new Promise(V=>setTimeout(V,N)),[]),A=yd(async()=>{!o||R==="leave"||(P(""),await $(10),P("leave"),await $(l.duration),C(!1),w?.())},[o,R,l.duration,$,w]),M=yd(async()=>{o&&(C(!0),P("enter"),await $(l.duration),P(""))},[o,l.duration,$]),L=yd(()=>{x?A():M()},[x,A,M]),B=yd(async N=>{d||S.current&&a||(S.current=!0,setTimeout(()=>{S.current=!1},500),L(),g?.(N))},[a,d,L,g]),F=Ux(()=>{const N=typeof i?.type=="string"?void 0:{close:A};return h("div",{className:d1("popover-element-wrap",r),draggable:!1,children:x&&h("div",{className:d1("popover-element",R),style:{...s,...O},children:fue(i??h(Mr,{}),N)})})},[O,A,x,i,r,s,R]);return Nf(_,N=>{const V=[...f,o].filter(I=>!!I).concat(Kx).map(I=>document.querySelector(`#${I}`)).filter(I=>I),z=N.target;document.body.contains(z)&&(z.closest('[data-slot="select-drop-box"]')||V.some(I=>I?.contains(z))||x&&A())},{event:"mouseup"}),hue(()=>{const N=()=>{C(!1),P("")};return x&&m&&window.addEventListener("scroll",N),()=>{window.removeEventListener("scroll",N)}},[m,x]),mue(y,()=>({close:A,open:M})),te("div",{ref:_,id:t,className:d1("popover-area",n),children:[h(Rr,{...u,disabled:d||u?.disabled,children:h("button",{className:d1("btn-popover",e,x&&"open",d&&"pointer-events-none cursor-not-allowed"),"data-pad-focus":"true",disabled:d,onClick:B,children:v})}),o?h(Gl,{id:o,children:F}):null]})});P3.displayName="PopoverButton";function Nk({className:t,onCancel:e,onConfirm:n,onReset:r,labels:o}){return te(Yo,{className:ae("w-full p-4",t),justifyContent:"space-between",alignItems:"center",children:[h(Wr,{variant:"transparent",size:"sm",onClick:r,children:o?.reset??"Reset"}),te(Yo,{inline:!0,alignItems:"center",gap:4,children:[h(Wr,{className:"light:bg-fill-subtlest",variant:"soft",size:"sm",onClick:e,children:o?.cancel??"Cancel"}),h(Wr,{variant:"brand",size:"sm",onClick:n,children:o?.confirm??"Confirm"})]})]})}const gue=he(["inline-flex items-center overflow-hidden","bg-fill-control-surface outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"px-2_5 h-8 rounded-md",sm:"px-2_5 h-9 rounded-md",md:"h-10 rounded-md px-3",lg:"h-12 rounded-lg px-3"},variant:{default:"outline-border-default"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled hover:bg-fill-control-surface-disabled text-fg-disabled pointer-events-none cursor-not-allowed",false:""}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{focus:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1}}),vue=he("flex-1 truncate text-left",{variants:{size:{xs2:"typo-compact-xs2-normal pr-1",sm:"typo-compact-sm-normal pr-1",md:"typo-compact-sm2-normal pr-1_5",lg:"typo-compact-sm2-normal pr-2"},placeholder:{true:"text-fg-subtler font-normal",false:"text-fg-default font-medium"},disabled:{true:"text-fg-disabled",false:""}},defaultVariants:{size:"md",placeholder:!0,disabled:!1}}),wue=he("inline-flex shrink-0 items-center justify-center",{variants:{size:{xs2:"size-4",sm:"size-4",md:"size-5",lg:"size-5"},disabled:{true:"text-fg-disabled",false:"text-fg-default"}},defaultVariants:{size:"md",disabled:!1}}),bue=he(["absolute left-0 z-[999999] max-w-0","bg-overlay outline-border-subtle rounded-md outline outline-1 outline-offset-[-1px]","shadow-down-xs","overflow-x-hidden"].join(" "),{variants:{mode:{default:"no-scrollbar max-h-60 overflow-y-auto p-1",empty:"p-1_5 h-48 max-h-56",loading:"p-1_5 h-48 max-h-56"}},defaultVariants:{mode:"default"}}),yue=he("text-center",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-sm-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal"}},defaultVariants:{size:"md"}}),_ue=he("inline-flex h-9 w-full items-center overflow-hidden rounded-sm px-3",{variants:{selected:{true:"",false:""},disabled:{true:"",false:""},hovered:{true:"bg-fill-transparent-hovered",false:"bg-fill-transparent"}},compoundVariants:[{selected:!1,disabled:!1,hovered:!1,className:"text-fg-subtler font-normal"},{selected:!1,disabled:!1,hovered:!0,className:"text-fg-default font-normal"},{selected:!0,disabled:!1,className:"text-fg-default font-semibold"},{selected:!1,disabled:!0,className:"text-fg-disabled font-normal"},{selected:!0,disabled:!0,className:"text-fg-disabled font-semibold"}],defaultVariants:{selected:!1,disabled:!1,hovered:!1}}),xue=he("line-clamp-1 flex-1 pr-4 text-left",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-xs2-normal",lg:"typo-compact-xs2-normal"}},defaultVariants:{size:"md"}}),{useCallback:Sue,useMemo:Cue,useState:Eue}=await q("react"),qv=({className:t="",size:e="md",text:n,value:r,label:o,children:a,description:i,selectedValue:s="",searchText:l="",enableGamepadFocus:u,disabled:d,handleChange:f})=>{const m=s===r,[v,g]=Eue(!1),w=Cue(()=>l?kn.lowerCase(n).includes(kn.lowerCase(l)):!1,[n,l]),y=Sue(_=>{_.button===2||d||f?.({label:o??a,value:r})},[a,d,f,r,o]);return h("div",{"data-slot":"select-option",className:ae(_ue({selected:m,disabled:!!d,hovered:!d&&(w||v)}),i&&"h-auto min-h-9 overflow-visible py-2",t,{active:m}),role:"button","data-pad-focus":u&&!d?"true":"false",tabIndex:-1,onClick:y,onMouseEnter:()=>{d||g(!0)},onMouseLeave:()=>g(!1),children:te("div",{"data-slot":"select-option-content",className:"flex min-w-0 flex-1 items-center gap-2",children:[te("div",{"data-slot":"select-option-text",className:ae("min-w-0 flex-1",xue({size:e}),i&&"line-clamp-none"),children:[a,i&&h("div",{"data-slot":"select-option-description",className:"typo-compact-xs-normal text-fg-subtle",children:i})]}),m&&h(js,{"aria-hidden":!0,"data-slot":"select-option-check",className:ae("size-4 shrink-0",d?"text-fg-disabled":"text-fg-default")})]})})};qv.displayName="Option";const Pk=he("",{variants:{size:{xs2:"typo-compact-xs-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal",xl:"typo-compact-lg-normal"}},defaultVariants:{size:"md"}}),A3=({className:t,nullText:e="no data",children:n,style:r,size:o})=>te("div",{"data-slot":"no-data",className:ae("text-fg-subtle flex flex-col items-center justify-center gap-1",t,Pk({size:o})),style:r,children:[h("span",{"data-slot":"no-data-icon",className:"inline-flex items-center justify-center",children:n}),h("div",{"data-slot":"no-data-text",children:e})]}),{useEffect:Mue,useRef:kue,useMemo:Rue,Children:Tue}=await q("react"),Nue=({className:t,children:e,size:n,noDataMsg:r=h(A3,{className:ae(Pk({size:n}),"flex h-full w-full items-center justify-center")}),...o})=>{const a=kue(null),i=Rue(()=>Tue.map(e,s=>s).length===0,[e]);return Mue(()=>{setTimeout(()=>{const s=document.querySelector('[data-slot="dialog-content"]');if(s&&o.open){const l=s.querySelector(".active");typeof s.scrollTo=="function"&&s.scrollTo(0,l?.offsetTop??0)}},50)},[o.open]),h(tc,{"data-slot":"select-modal-drop-box",className:ae("bg-overlay shadow-down-xs border-subtle max-h-[calc(var(--vh,1vh)*50)] w-min max-w-[90vw] min-w-80 overflow-y-auto p-1 outline-hidden",t),...o,children:h("div",{ref:a,"data-slot":"select-modal-drop-box-list",className:ae(i?"flex min-h-60 items-stretch":""),children:i?r:e})})},{Children:Pue,forwardRef:Aue,useCallback:N2,useEffect:yl,useImperativeHandle:Iue,useMemo:Xx,useRef:Zx}=await q("react"),Oue=4,Ak=Aue((t,e)=>{const{className:n,theme:r,size:o,children:a,label:i,inputEl:s,parentEl:l,maxHeight:u=200,search:d,searchText:f="",searchPlaceholder:m,noDataMsg:v=h(A3,{className:ae(yue({size:o}),"flex h-full w-full items-center justify-center")}),direction:g="bottom",showCloseBtn:w,whenScrollCloseDropBox:y,setOpen:_,handleSearchTextChange:S,handleKeyPress:x}=t,C=Zx(null),R=Zx(null),{isMobile:P}=s3(),O=g==="top"?"top-start":"bottom-start",{refs:$,floatingStyles:A,update:M}=u7({placement:O,strategy:"fixed",whileElementsMounted:l7,middleware:[d7(Oue),p7({fallbackPlacements:g==="top"?["bottom-start"]:["top-start"]}),f7({padding:8}),h7({apply({availableHeight:I,rects:D,elements:U}){const Y=Math.min(u,Math.max(120,I));Object.assign(U.floating.style,{minWidth:`${D.reference.width}px`,maxHeight:`${Y}px`})}})]}),L=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",L+"px");const B=Xx(()=>Pue.map(a,I=>I).length===0,[a]),F=Xx(()=>P?i||w:!1,[P,i,w]),N=N2(I=>{const{value:D}=I.target;S(D)},[S]),V=N2(()=>{S("")},[S]),z=N2(()=>{s&&s.blur(),_(!1)},[s,_]);return yl(()=>{const I=R.current;if(I){const D=I.querySelector(".active");if(D&&typeof I.scrollTo=="function"){const U=D.getBoundingClientRect().top-I.getBoundingClientRect().top+I.scrollTop;I.scrollTo(0,U)}}},[l]),yl(()=>{if(R){const I=R.current,D=I.querySelector(".match");D&&([...I.children].map(U=>U.classList.remove("match")),D.classList.add("match"),I.scrollTo(0,D.offsetTop))}},[f,R]),yl(()=>{const I=()=>{window.innerWidth<800||(_(!1),s&&s.blur())};return window.removeEventListener("resize",I),window.addEventListener("resize",I),y&&(window.removeEventListener("scroll",I),window.addEventListener("scroll",I)),()=>{window.removeEventListener("scroll",I),window.removeEventListener("resize",I)}},[s,_,y]),yl(()=>(P&&D8(),()=>{P&&B8()}),[P]),Iue(e,()=>C.current),yl(()=>{$.setReference(l)},[l,$]),yl(()=>{const D=(Y=>{const oe=[];let Q=Y?.parentElement??null;for(;Q;){const re=window.getComputedStyle(Q),le=re.overflowY,ee=re.overflowX;(/(auto|scroll|overlay)/.test(le)||/(auto|scroll|overlay)/.test(ee))&&oe.push(Q),Q=Q.parentElement}return oe.push(window),oe})(l),U=()=>{M()};return D.forEach(Y=>Y.addEventListener("scroll",U,{passive:!0})),window.addEventListener("resize",U,{passive:!0}),()=>{D.forEach(Y=>Y.removeEventListener("scroll",U)),window.removeEventListener("resize",U)}},[l,M]),yl(()=>{let I=0;const D=()=>{M(),I=window.requestAnimationFrame(D)};return I=window.requestAnimationFrame(D),()=>{window.cancelAnimationFrame(I)}},[M]),te("div",{ref:I=>{C.current=I,$.setFloating(I)},"data-slot":"select-drop-box","data-pad-scope":"dropdown-box","data-theme":r,role:"button",tabIndex:-1,className:ae(bue({mode:B?"empty":"default"}),"!fixed !top-0 !left-0 flex flex-col",n),style:A,onKeyDown:x,children:[F&&te("div",{"data-slot":"select-drop-box-header",className:"border-subtle flex items-center gap-2 border-b px-2 py-2",children:[i&&h("label",{"data-slot":"select-drop-box-label",className:"text-fg-default flex-1 text-sm font-medium",children:i}),w&&h("button",{type:"button","data-slot":"select-drop-box-close",className:"text-fg-subtle ml-auto px-2 text-sm",onClick:z,children:h(df,{})})]}),d&&h("div",{"data-slot":"select-drop-box-search",className:"border-subtle border-b p-1",children:h(sw,{type:"text",size:o,className:"w-full",placeholder:m,value:f,prefixIcon:h(Z0,{className:"text-fg-subtle size-4"}),onChange:N,onKeyDown:x,handleReset:V})}),h("div",{ref:R,"data-slot":"select-drop-box-list",className:ae("min-h-0 overflow-y-auto",B?"flex flex-1 items-stretch":""),children:B?v:a})]})});Ak.displayName="SelectDropBox";const{Children:Lue,cloneElement:$ue,useCallback:qc,useEffect:f1,useMemo:p1,useRef:h1,useState:_l,forwardRef:Due,useImperativeHandle:Bue}=await q("react"),Uv=Due((t,e)=>{const{className:n="",size:r="md",children:o,name:a,value:i,error:s,search:l,mobileLabel:u,placeholder:d,disabled:f,readOnly:m,dropBoxClassName:v,maxDropBoxHeight:g=200,modalBoxClassName:w,selectArrow:y=h(K0,{}),keepDropDown:_,searchPlaceholder:S="Search",showCloseBtn:x,whenScrollCloseDropBox:C,enableModal:R=!xo.isDesktop,enableGamepadFocus:P=!0,noDataMsg:O,onClick:$,handleChange:A,...M}=t,L=h1(null),B=h1(null),F=h1(null),N=h1(Date.now()),[V,z]=_l(i),[I,D]=_l(""),[U,Y]=_l(""),[oe,Q]=_l(!1),[re,le]=_l(!1),[ee,ne]=_l(null),[ue,ve]=_l(null),we=p1(()=>{const qe=({value:ht})=>{f||(z(ht),A?.(ht,a),L.current.value=String(ht),M.onChange?.({target:L.current}),_||Q(!1))},_e=ht=>(ht??[]).flatMap(st=>{if(!st?.props)return[];if(st.type?.displayName==="Option"){let Ct;return st.props.text||(typeof st.props.label=="string"?Ct=st.props.label:typeof st.props.children=="string"?Ct=st.props.children:Ct=st.props.value.toString()),$ue(st,{...st.props,size:r,text:Ct.toLowerCase(),selectedValue:V,searchText:I,handleChange:qe,enableGamepadFocus:P})}return Array.isArray(st.props.children)?_e(st.props.children):[]}),at=Lue.map(o,ht=>ht);return _e(at)},[o,f,A,a,M,_,r,V,I,P]),ye=p1(()=>we.filter(qe=>qe.props.text.toLowerCase().includes(U.toLowerCase())),[we,U]),Le=p1(()=>we.find(qe=>{const _e=qe.props.value;return _e===V||_e===i}),[we,V,i]),Oe=p1(()=>{if(!Le){const at=we[0]?.props;return{text:d??at?.label??at?.children??"",isPlaceholder:!!d}}const{label:qe,children:_e}=Le.props;return{text:qe??_e??"",isPlaceholder:!1}},[Le,we,d]),Ne=qc(()=>{const qe=Date.now();if(qe-N.current<300){N.current=qe;return}if($)$();else{if(f||m)return;const at=B.current?.closest("[data-theme]")?.getAttribute("data-theme");ne(at),Q(ht=>!ht),N.current=qe}},[f,m,$]),me=qc(qe=>{D(qe),Y(qe)},[]),pe=qc(()=>{if(!oe){Q(!0);return}const qe=we.find(_e=>_e.props.text.includes(I.toLowerCase()));if(qe){const _e=qe.props;z(_e.value),A?.(_e.value,a),L.current.value=String(_e.value||""),M.onChange?.({target:L.current}),Q(!1),L.current.blur()}},[A,M,a,oe,we,I]),be=qc(qe=>{let _e;const at=we.findIndex(st=>{const Ct=st.props;return I?Ct.text===I:Ct.value===V});qe==="down"?_e=at+1>=we.length?we[0]:we[at+1]:_e=at<=0?we[we.length-1]:we[at-1];const ht=_e.props.text;D(ht)},[we,V,I]),Ue=qc(qe=>{qe.key==="Enter"&&!qe.nativeEvent.isComposing?pe():qe.key==="ArrowDown"?(be("down"),qe.preventDefault()):qe.key==="ArrowUp"&&(be("up"),qe.preventDefault())},[pe,be]),He=qc((qe,_e)=>{le(_e),_e?M.onFocus?.(qe):M.onBlur?.(qe)},[M]);return Nf(B,qe=>{!("button"in qe&&qe.button===2)&&!F.current?.contains(qe.target)&&Q(!1)},{offTouchEvent:!0}),f1(()=>{if(we.length&&!d&&!Le){const _e=we[0].props.value;z(L.current?.value??_e)}},[d,Le,we]),f1(()=>{typeof i<"u"&&z(i)},[i]),f1(()=>{oe||(D(""),Y(""))},[oe]),f1(()=>{if(!oe){ve(null);return}const qe=B.current?.closest('[data-slot="dialog-content"]');ve(qe instanceof HTMLElement?qe:null)},[oe]),Bue(e,()=>(L.current.handleClickSelectBox=Ne,{...L.current,get value(){return L.current.value},set value(qe){z(_e=>typeof _e=="string"&&_e===qe||typeof _e=="number"&&_e===Number(qe)||typeof _e=="boolean"&&String(_e)===String(qe)?_e:qe),L.current.value=qe}})),te(Mr,{children:[h("div",{ref:B,"data-slot":"select-box",className:ae(gue({size:r,variant:"default",focus:re,error:s,disabled:f,readOnly:m}),n),onClick:Ne,children:te("label",{"data-slot":"select-box-control",className:"relative flex w-full min-w-0 items-center",children:[h("div",{"data-slot":"select-box-value",className:vue({size:r,placeholder:Oe.isPlaceholder,disabled:f}),children:h("span",{children:Oe.text})}),h("input",{...M,ref:L,type:"text",value:V??L.current?.value??"",name:a,readOnly:!0,className:"sr-only","data-pad-focus":P?"true":"false",onFocus:qe=>He(qe,!0),onBlur:qe=>He(qe,!1),onKeyDown:Ue}),h("span",{"data-slot":"select-box-icon",className:ae(wue({size:r,disabled:f}),"transition-transform duration-200",oe&&"rotate-180"),children:y})]})}),R&&h(Nue,{className:w,type:"dialog",open:oe,size:r,hideCloseButton:!0,onOpenChange:Q,noDataMsg:O,children:ye}),!R&&oe&&h(Gl,{container:ue,children:h(Ak,{ref:F,className:v,size:r,label:u,inputEl:L.current,parentEl:B.current,theme:ee,maxHeight:g,setOpen:Q,search:l,searchText:I,searchPlaceholder:S,showCloseBtn:x,whenScrollCloseDropBox:C,noDataMsg:O,handleSearchTextChange:me,handleKeyPress:Ue,children:ye})})]})});Uv.displayName="RBSelectBox";const zue=he("inline-flex w-full items-start gap-2",{defaultVariants:{controlPlacement:"start",size:"default",tone:"default",type:"default"},compoundVariants:[{className:"outline-border-danger-stronger",tone:"invalid",type:"box"}],variants:{controlPlacement:{end:"justify-between",start:"justify-start"},size:{default:"",sm:"gap-1.5"},tone:{default:"",disabled:"",invalid:""},type:{box:"bg-raised outline-border-subtle p-2_5 rounded-md outline outline-1 outline-offset-[-1px]",default:""}}}),Fue=he("focus-visible:ring-border-stronger data-[state=checked]:bg-fill-brand data-[state=unchecked]:bg-fill-subtler relative inline-flex shrink-0 items-center rounded-full border border-transparent outline-hidden transition-colors focus-visible:ring-2 disabled:pointer-events-none",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"},tone:{default:"",disabled:"data-[state=checked]:bg-fill-subtler data-[state=unchecked]:bg-fill-subtler",invalid:"border-danger-stronger"}},defaultVariants:{size:"default",tone:"default"}}),Vue=he(["absolute top-1/2 left-0 -translate-y-1/2","data-[state=unchecked]:translate-x-0.5","pointer-events-none rounded-full transition-transform"].join(" "),{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"},tone:{default:"data-[state=checked]:bg-fg-static-white bg-white",disabled:"bg-fg-disabled data-[state=checked]:!bg-fg-disabled",invalid:""}},defaultVariants:{size:"default",tone:"default"}}),jue=he("gap-0_5 inline-flex min-w-0 flex-1 flex-col"),Hue=he("text-fg-default",{defaultVariants:{size:"default",tone:"default"},variants:{size:{default:"typo-compact-sm-medium",sm:"typo-compact-xs-semibold"},tone:{default:"",disabled:"text-fg-disabled",invalid:"text-fg-danger"}}}),Wue=he("text-fg-default",{defaultVariants:{size:"default",tone:"default"},variants:{size:{default:"typo-compact-sm-normal",sm:"typo-compact-xs-normal"},tone:{default:"",disabled:"text-fg-disabled",invalid:""}}});function que({className:t,disabled:e=!1,invalid:n=!1,size:r="default",...o}){const a=e?"disabled":n?"invalid":"default";return h($X,{"data-slot":"switch","data-size":r,"data-tone":a,"data-pad-focus":"true",disabled:e,className:ae(Fue({tone:a,size:r}),t),...o,children:h(DX,{"data-slot":"switch-thumb",className:Vue({size:r,tone:a})})})}const Uue=Array.from({length:24},(t,e)=>String(e).padStart(2,"0")),Yue=Array.from({length:60},(t,e)=>String(e).padStart(2,"0")),Qx=t=>({hour:String(t?.getHours()??0).padStart(2,"0"),minute:String(t?.getMinutes()??0).padStart(2,"0")});function Ik({pickerType:t="range",selectedDate:e,onChange:n,labels:r}){const o=t==="range"?"min-w-[84px]":"min-w-[76px]",a=(s,l)=>{const u=e.from??e.to??new Date;let d=new Date(e.from??u),f=t==="range"?new Date(e.to??u):void 0;e.from||d.setHours(0,0,0,0),f&&!e.to&&f.setHours(0,0,0,0),(s==="from"?d:f)?.setHours(Number(l.hour),Number(l.minute),0,0),f&&d.toDateString()===f.toDateString()&&d>f&&(s==="from"?f=new Date(d):d=new Date(f)),n({...e,from:d,to:f})},i=[{label:r?.from??(t==="range"?"From":"Time"),time:Qx(e.from),onChange:s=>a("from",s)},...t==="range"?[{label:r?.to??"To",time:Qx(e.to),onChange:s=>a("to",s)}]:[]];return h("div",{"data-slot":"footer-time",className:"border-subtle flex w-full flex-col items-start border-t",children:te("div",{"data-slot":"footer-time-content",className:ae("w-full px-4 py-3",t==="range"?"inline-flex items-center justify-between gap-4":"flex flex-wrap items-start gap-2"),children:[te("label",{"data-slot":"footer-time-set-time",className:"inline-flex shrink-0 items-center gap-2",children:[h(que,{checked:e.timeEnabled,onCheckedChange:s=>n({...e,timeEnabled:s})}),h("span",{className:"typo-compact-sm-medium text-fg-default whitespace-nowrap",children:r?.setTime??"Set Time"})]}),h("div",{"data-slot":"footer-time-time-rows",className:ae("flex w-full items-center",t==="range"?"justify-end gap-4":"flex-col gap-1"),children:i.map(({label:s,time:l,onChange:u})=>te("div",{"data-slot":"footer-time-row",className:ae("inline-flex items-center",t==="range"?"shrink-0 gap-2":"w-full justify-between"),children:[h("div",{className:"typo-compact-sm-medium text-fg-subtler text-center whitespace-nowrap",children:s}),te("div",{className:"inline-flex items-center gap-2",children:[h(Uv,{"data-slot":"footer-time-hour-select",className:ae("w-fit",o),size:"sm",value:l.hour,disabled:!e.timeEnabled,readOnly:!e.timeEnabled,placeholder:l.hour,handleChange:d=>u({...l,hour:String(d??"00")}),children:Uue.map(d=>h(qv,{value:d,children:d},d))}),h(Uv,{"data-slot":"footer-time-minute-select",className:ae("w-fit",o),size:"sm",value:l.minute,disabled:!e.timeEnabled,readOnly:!e.timeEnabled,placeholder:l.minute,handleChange:d=>u({...l,minute:String(d??"00")}),children:Yue.map(d=>h(qv,{value:d,children:d},d))})]})]},s))})]})})}function Ok({label:t,onClick:e}){return h(Wr,{className:"light:bg-fill-subtlest",size:"xs",variant:"soft",onClick:e,children:t})}const Lk=he(["gap-1_5 inline-flex min-w-72 items-center overflow-hidden","outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"h-8 rounded-md px-2",sm:"h-9 rounded-md px-2",md:"px-2_5 h-10 rounded-md",lg:"px-2_5 h-12 rounded-lg"},variant:{default:"bg-fill-control-surface outline-border-default"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled pointer-events-none cursor-not-allowed",false:""},interactive:{true:"cursor-pointer",false:"cursor-default"}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{focus:!0,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,interactive:!0}}),$k=he("inline-flex shrink-0 items-center justify-center [&_svg]:block [&_svg]:shrink-0 [&_svg]:leading-none",{variants:{size:{xs2:"size-4",sm:"size-4",md:"size-5",lg:"size-5"},disabled:{true:"text-fg-disabled",false:"text-fg-subtlest"}},defaultVariants:{size:"md",disabled:!1}}),Dk=he("inline-flex min-w-0 flex-1 items-center gap-1 overflow-hidden whitespace-nowrap"),c0=he("truncate",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-medium",md:"typo-compact-sm2-medium",lg:"typo-compact-sm2-medium"},tone:{default:"text-fg-default",placeholder:"text-fg-subtler font-normal"},disabled:{true:"text-fg-disabled",false:""}},compoundVariants:[{tone:"placeholder",disabled:!0,className:"text-fg-disabled"}],defaultVariants:{size:"md",tone:"default",disabled:!1}}),Gue=he("",{variants:{size:{xs2:"typo-compact-xs2-normal",sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-medium",lg:"typo-compact-sm2-medium"},disabled:{true:"text-fg-disabled",false:"text-fg-subtler"}},defaultVariants:{size:"md",disabled:!1}}),Bk=he(["bg-overlay relative z-[1]","shadow-up-lg inline-flex flex-col overflow-visible","outline-border-subtle rounded-md outline outline-1 outline-offset-[-2px]"].join(" "),{variants:{pickerType:{basic:"max-w-72",range:"min-w-140"}},defaultVariants:{pickerType:"basic"}}),Kue=he("py-1_5 inline-flex w-full items-start justify-between"),Xue=he("inline-flex flex-1 flex-col items-start justify-start p-3"),Zue=he("typo-compact-sm-medium inline-flex size-5 items-center justify-center text-center",{variants:{weekend:{true:"text-fg-danger",false:"text-fg-default"}},defaultVariants:{weekend:!1}}),xl=he(["typo-compact-sm-medium relative flex h-9 flex-1 items-center justify-center px-2 text-center","transition-colors"].join(" "),{variants:{state:{default:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered rounded-md",disabled:"bg-fill-transparent text-fg-disabled pointer-events-none !cursor-default rounded-md",single:"bg-fill-brand text-fg-default hover:!bg-fill-brand-hovered rounded-md font-semibold",rangeStart:"bg-fill-brand hover:!bg-fill-brand-hovered rounded-none! rounded-l-md! font-medium text-white",rangeMiddle:"bg-fill-subtlest text-fg-default rounded-none!",rangeEnd:"bg-fill-brand hover:!bg-fill-brand-hovered rounded-none! rounded-r-md! font-medium text-white"}},defaultVariants:{state:"default"}}),{useRef:Que}=await q("react");function Jue(t){const e=Que(null),n=wC(t.date,t.displayMonth,e);if(n.isHidden)return h("div",{role:"gridcell"});if(!n.isButton)return h("div",{...n.divProps});const r=n.activeModifiers.outside,o=n.buttonProps["aria-selected"]===!0||n.buttonProps["aria-selected"]==="true"||n.activeModifiers.selected||n.activeModifiers.range_start||n.activeModifiers.range_end||n.activeModifiers.range_middle,a=r||n.activeModifiers.range_start||n.activeModifiers.range_end||n.activeModifiers.range_middle,i=n.buttonProps.className?.replace(a?/\bday_selected\b/g:/$^/,"").replace(r||o?/\bday_range_start\b|\bday_range_end\b|\bday_range_middle\b|\bday_today\b/g:/$^/,"").replace(/\s+/g," ").trim();return h(nf,{ref:e,...n.buttonProps,className:i,"aria-selected":r?void 0:n.buttonProps["aria-selected"],disabled:n.buttonProps.disabled||r})}function zk({className:t,classNames:e,showOutsideDays:n=!0,...r}){return h(PX,{showOutsideDays:n,className:ae("cursor-default p-0",t),classNames:{months:ae(Kue(),r.mode==="range"?"gap-0":"justify-center"),month:Xue(),caption:"bg-fill-transparent relative inline-flex h-8 w-full items-center justify-center px-8",caption_label:"typo-compact-sm-semibold text-fg-default pointer-events-none",nav:"flex items-center gap-1",nav_button:ae(u8({variant:"transparent",size:"xs"}),"absolute top-1/2 size-5 -translate-y-1/2 p-0"),nav_button_previous:"left-0",nav_button_next:"right-0",table:"w-full border-collapse",head_row:"inline-flex h-10 w-full items-center justify-center",head_cell:ae("flex h-9 flex-1 items-center justify-center overflow-hidden px-2",Zue(),"[&:first-child]:text-fg-danger [&:last-child]:text-fg-danger"),row:"inline-flex h-10 w-full items-center justify-center",cell:ae("relative flex h-9 flex-1 items-center justify-center overflow-hidden p-0 text-center focus-within:relative focus-within:z-20",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md! [&:has(>.day-range-start)]:rounded-l-md! first:[&:has([aria-selected])]:rounded-l-md! last:[&:has([aria-selected])]:rounded-r-md!":"[&:has([aria-selected])]:rounded-md!"),day:ae(xl({state:"default"}),"h-9 w-full flex-none px-0"),day_range_start:ae(xl({state:"rangeStart"}),"h-9 w-full flex-none px-0 text-white!"),day_range_end:ae(xl({state:"rangeEnd"}),"h-9 w-full flex-none px-0 text-white!"),day_selected:ae(xl({state:"single"}),"h-9 w-full flex-none px-0"),day_today:"[&:not([aria-selected=true])]:!bg-fill-default [&:not([aria-selected=true])]:hover:!bg-fill-default [&:not([aria-selected=true])]:rounded-full! [&:not([aria-selected=true])]:!text-fg-inverse",day_outside:ae(xl({state:"disabled"}),"!bg-fill-transparent hover:!bg-fill-transparent aria-selected:text-fg-disabled"),day_disabled:ae(xl({state:"disabled"}),"h-9 w-full flex-none px-0"),day_range_middle:ae(xl({state:"rangeMiddle"}),"h-9 w-full flex-none rounded-none! px-0 hover:text-white!"),day_hidden:"invisible",...e},components:{Day:Jue,IconLeft:({className:o,...a})=>h(X0,{className:ae("size-4",o),...a}),IconRight:({className:o,...a})=>h(Su,{className:ae("size-4",o),...a})},...r})}const{useCallback:_d,useEffect:Jx,useId:ede,useRef:tde,useState:xd}=await q("react"),nde=[{key:"today",label:"Today"},{key:"month-ago",label:"1 month ago"},{key:"year-ago",label:"1 year ago"}],rde=()=>({hour:"00",minute:"00"}),Yv=t=>t?{hour:String(t.getHours()).padStart(2,"0"),minute:String(t.getMinutes()).padStart(2,"0")}:rde(),e6=t=>!!(t&&(t.getHours()!==0||t.getMinutes()!==0)),t6=(t,e)=>{const n=new Date(t);return n.setHours(Number(e.hour),Number(e.minute),0,0),n},n6=t=>Array.isArray(t)?t[0]:t,r6=(t,e,n)=>{if(!t)return e;const r=V8(t.getTime());if(!n)return r;const o=Yv(t);return`${r} ${o.hour}:${o.minute}`},W3e=({className:t,showType:e="popover",value:n,name:r,disabled:o,readOnly:a,size:i="md",variant:s="default",error:l=!1,showPresets:u=!0,showFooter:d=!0,placeholder:f,handleChange:m})=>{const v=tde(null),g=ede().replace(/:/g,""),[w,y]=xd(!1),[_,S]=xd(!1),[x,C]=xd(()=>{const I=n6(n);return{from:I,to:void 0,timeEnabled:e6(I)}}),[R,P]=xd(x),[O,$]=xd(x.from??new Date),A=typeof f=="string"?f:"Select date",M=()=>{o||y(!0)},L=I=>{I.key==="Enter"&&(v.current?.open(),y(!0))},B=_d(()=>{y(!1),v.current?.close()},[]),F=_d(()=>{if(R.from){const I=new Date(R.from);R.timeEnabled?I.setSeconds(0,0):I.setHours(0,0,0,0),C(R),m?.(I,void 0,r??"")}B()},[m,B,r,R]),N=_d(()=>{const I={from:void 0,to:void 0,timeEnabled:!1};C(I),P(I),m?.(void 0,void 0,r??"")},[m,r]),V=_d(I=>{const D=new Date,U=new Date(D);switch(I){case"today":break;case"month-ago":U.setMonth(D.getMonth()-1);break;case"year-ago":U.setFullYear(D.getFullYear()-1);break}P(Y=>({...Y,from:t6(U,Yv(Y.from))})),$(U)},[]),z=_d(()=>te(Ul,{className:ae(Bk({pickerType:"basic"})),children:[u&&h("div",{"data-slot":"date-input-presets",className:"border-subtle inline-flex w-full flex-wrap items-start justify-center gap-1 border-b px-3 py-4",children:nde.map(I=>h(Ok,{label:I.label,onClick:()=>V(I.key)},I.key))}),h(zk,{"data-slot":"date-input-calendar",month:O,selected:R.from,mode:"single",numberOfMonths:1,onMonthChange:$,onSelect:I=>{P(D=>({...D,from:I?t6(I,Yv(D.from)):void 0})),I&&$(I)}}),d&&h(Ik,{"data-slot":"date-input-footer-time",pickerType:"basic",selectedDate:R,onChange:P}),h(Nk,{"data-slot":"date-input-footer-button",onReset:N,onCancel:B,onConfirm:F})]}),[F,B,V,N,R,O,d,u]);return Jx(()=>{const I=n6(n),D={from:I,to:void 0,timeEnabled:e6(I)};C(D),P(D),$(I??new Date)},[n]),Jx(()=>{w||(P(x),$(x.from??new Date))},[w,x]),te(Mr,{children:[te(P3,{ref:v,disabled:o,anchorId:e==="popover"&&!o?`date-input-popover-${g}`:void 0,className:ae("inline-block"),ripple:{disabled:!0},popoverStyle:{top:"10px",left:"0"},popoverElement:h(z,{}),onClose:()=>y(!1),onClick:M,children:[te("div",{"data-slot":"date-input",className:ae(Lk({size:i,variant:s,focus:_||w,error:l,readOnly:a,disabled:o,interactive:!o&&!a}),t),children:[h("span",{"data-slot":"date-input-icon","aria-hidden":!0,className:$k({size:i,disabled:o}),children:h(rw,{})}),h("span",{"data-slot":"date-input-content",className:Dk(),children:h("input",{"data-slot":"date-input-input",type:"text",readOnly:!0,disabled:o,value:r6(x.from,"",x.timeEnabled),placeholder:r6(void 0,A,!1),onFocus:()=>S(!0),onBlur:()=>S(!1),onKeyDown:L,className:ae("w-full min-w-0",c0({size:i,tone:x.from?"default":"placeholder",disabled:o}))})})]}),e==="popover"&&h("div",{id:`date-input-popover-${g}`})]}),e==="modal"&&h(tc,{className:ae("w-auto border-none p-0"),open:w,hideCloseButton:!0,onOpenChange:y,children:h(z,{})})]})},o6=[{key:"last-24-hours",label:"Last 24 hours"},{key:"last-3-days",label:"Last 3 days"},{key:"last-week",label:"Last week"},{key:"last-month",label:"Last month"},{key:"last-3-month",label:"Last 3 month"}],ode=(t,e=new Date)=>{const n=new Date(e),r=new Date(e);switch(t){case"last-24-hours":n.setDate(e.getDate()-1);break;case"last-3-days":n.setDate(e.getDate()-3);break;case"last-week":n.setDate(e.getDate()-7);break;case"last-month":n.setMonth(e.getMonth()-1);break;case"last-3-month":n.setMonth(e.getMonth()-3);break}return{from:n,to:r}},{useCallback:Sd,useEffect:a6,useId:ade,useRef:ide,useState:m1}=await q("react"),sde=(t,e,n)=>{const r=[];return t&&r.push({before:t}),e&&r.push({after:e}),Array.isArray(n)?r.push(...n):n!==void 0&&r.push(n),r},Gv=()=>({hour:"00",minute:"00"}),kl=t=>t?{hour:String(t.getHours()).padStart(2,"0"),minute:String(t.getMinutes()).padStart(2,"0")}:Gv(),g1=t=>!!(t&&(t.getHours()!==0||t.getMinutes()!==0)),bs=(t,e)=>{const n=new Date(t);return n.setHours(Number(e.hour),Number(e.minute),0,0),n},lde=(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),i6=(t,e,n)=>{if(!t)return e;const r=V8(t.getTime());if(!n)return r;const o=kl(t);return`${r} ${o.hour}:${o.minute}`},q3e=({className:t,calendarPanelClassName:e,showType:n="popover",value:r,name:o,min:a,max:i,maxDays:s,placeholder:l,disabled:u,disabledDates:d,readOnly:f,size:m="md",variant:v="default",error:g=!1,showPresets:w=!0,showFooter:y=!0,handleChange:_,presets:S})=>{const x=ide(null),C=ade().replace(/:/g,""),[R,P]=m1(!1),[O]=m1(!1),[$,A]=m1({from:r?.[0],to:r?.[1],timeEnabled:g1(r?.[0])||g1(r?.[1])}),[M,L]=m1($),B=!!($?.from||$?.to),F=typeof l=="string"?l:l?.start||l?.end||"Select date",N=()=>{u||P(!0)},V=Sd(()=>{P(!1),x.current?.close()},[]),z=Sd(()=>{if(M.from){const Y=M.to??M.from,oe=bs(M.from,kl(M.from)),Q=bs(Y,kl(Y)),re=M.timeEnabled?oe:bs(oe,Gv()),le=M.timeEnabled?Q:bs(Q,Gv());A({from:oe,to:Q,timeEnabled:M.timeEnabled}),_?.(re,le,o??"")}V()},[_,V,o,M]),I=Sd(()=>{const Y={from:void 0,to:void 0,timeEnabled:!1};A(Y),L(Y),_?.(void 0,void 0,o??"")},[_,o]),D=Sd(Y=>{const{from:oe,to:Q}=ode(Y);L(re=>({...re,from:bs(oe,kl(re.from)),to:bs(Q,kl(re.to))}))},[]),U=Sd(()=>te(Ul,{className:ae(Bk({pickerType:"range"}),e),children:[w&&h("div",{"data-slot":"data-input-presets",className:"border-subtle inline-flex w-full flex-wrap items-start justify-center gap-1 border-b px-3 py-4",children:(S?o6.filter(Y=>S.includes(Y.key)):o6).map(Y=>h(Ok,{label:Y.label,onClick:()=>D(Y.key)},Y.key))}),h(zk,{"data-slot":"data-input-calendar",selected:M,mode:"range",numberOfMonths:2,max:s,disabled:sde(a,i,d),initialFocus:!0,defaultMonth:M?.from,onSelect:Y=>{L(oe=>{const Q=Y?.from?bs(Y.from,kl(oe.from)):void 0;let re=Y?.to;!re&&oe.timeEnabled&&oe.to&&(re=Y?.from);let le=re?bs(re,kl(oe.to)):void 0;return Q&&le&&lde(Q,le)&&Q>le&&(le=new Date(Q)),{...oe,from:Q,to:le}})}}),y&&h(Ik,{"data-slot":"date-input-footer-time",pickerType:"range",selectedDate:M,onChange:L}),h(Nk,{"data-slot":"date-input-footer-button",onReset:I,onCancel:V,onConfirm:z})]}),[e,D,V,z,I,d,i,s,a,S,M,y,w]);return a6(()=>{const Y={from:r?.[0],to:r?.[1]},oe={...Y,timeEnabled:g1(Y.from)||g1(Y.to)};A(oe),L(oe)},[r]),a6(()=>{R||L($)},[R,$]),te(Mr,{children:[te(P3,{ref:x,disabled:u,anchorId:n==="popover"&&!u?`date-input-popover-${C}`:void 0,className:"inline-block",ripple:{disabled:!0},popoverStyle:{top:"10px",left:"0"},popoverElement:h(U,{}),onClose:()=>P(!1),onClick:N,children:[te("div",{"data-slot":"date-input",className:ae(Lk({size:m,variant:v,focus:O||R,error:g,readOnly:f,disabled:u,interactive:!u&&!f}),t),children:[h("span",{"data-slot":"date-input-icon","aria-hidden":!0,className:$k({size:m,disabled:u}),children:h(rw,{})}),h("span",{"data-slot":"date-input-content",className:Dk(),children:B?te(Mr,{children:[h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:$?.from?"default":"placeholder",disabled:u}),children:i6($?.from,F,$.timeEnabled)}),h("span",{"data-slot":"date-input-separator",className:Gue({size:m,disabled:u}),children:"~"}),h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:$?.to?"default":"placeholder",disabled:u}),children:i6($?.to,F,$.timeEnabled)})]}):h("span",{"data-slot":"date-input-value",className:c0({size:m,tone:"placeholder",disabled:u}),children:F})})]}),n==="popover"&&h("div",{id:`date-input-popover-${C}`})]}),n==="modal"&&h(tc,{className:ae("w-auto max-w-fit border-none p-0"),open:R,hideCloseButton:!0,onOpenChange:P,children:h(U,{})})]})},cde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),ude=he("bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 shadow-down-md fixed top-1/2 left-1/2 z-50 inline-flex max-w-[95vw] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg outline-hidden transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{size:{sm:"max-h-[25rem] min-h-40 w-[22.5rem]",md:"max-h-[35rem] w-[30rem]",lg:"max-h-[35rem] w-[34.375rem]"}},defaultVariants:{size:"lg"}}),dde=he("gap-0_5 relative flex flex-col items-start self-stretch px-4 pt-4 pr-16 pb-2"),fde=he("flex items-center justify-end gap-4 self-stretch p-4"),pde=he("text-fg-default typo-title-01-bold"),hde=he("text-fg-subtle typo-compact-sm-normal"),mde=he("text-fg-subtle hover:bg-fill-transparent-hovered hover:text-fg-default focus-visible:outline-border-stronger absolute top-3 right-3 inline-flex size-7 items-center justify-center rounded-[3px] outline-hidden transition-colors focus-visible:outline focus-visible:outline-1"),{forwardRef:Vh,useEffect:gde,useId:vde,useRef:wde}=await q("react"),q0=new Map,bde=300;function yde(t,e){q0.set(t,e)}function s6(t){q0.delete(t)}function _de(){const t=Array.from(q0.values());if(q0.clear(),t.length===0){Rl.resetModal();return}t.forEach(e=>e()),setTimeout(()=>{const e=document.querySelectorAll('[data-slot="dialog-content"][data-state="closed"]'),n=Array.from(e).flatMap(r=>r.getAnimations().map(o=>o.finished));if(n.length===0){Rl.resetModal();return}Promise.allSettled(n).then(()=>{Rl.resetModal()})},bde)}function xde({...t}){const e=vde(),n=wde(t.onOpenChange);return n.current=t.onOpenChange,gde(()=>(t.open?yde(e,()=>n.current?.(!1)):s6(e),()=>s6(e)),[e,t.open]),h(bf,{"data-slot":"dialog",...t})}function U3e({...t}){return h(Vw,{"data-slot":"dialog-trigger",...t})}function Sde({...t}){return h(yf,{"data-slot":"dialog-portal",...t})}function Y3e({...t}){return h(Zl,{"data-slot":"dialog-close",...t})}const Fk=Vh(({closeAllLabel:t},e)=>h("button",{ref:e,type:"button","aria-label":"dialog-all-close",className:"text-fg-default typo-compact-sm-semibold border-fg-subtler bg-fg-inverse pointer-events-auto fixed top-4 right-4 z-50 h-8 w-20 cursor-pointer rounded-md border p-1",onClick:_de,children:h("span",{children:t})}));Fk.displayName="RBDialogCloseAll";const Vk=Vh(({className:t,...e},n)=>h(_f,{ref:n,"data-slot":"dialog-overlay",className:ae(cde(),t),...e}));Vk.displayName="RBDialogOverlay";function Cde({className:t,children:e,container:n,showCloseButton:r=!0,size:o="lg",closeAllLabel:a,...i}){const s=n??(typeof document<"u"?document.querySelector(".modal-container")??void 0:void 0);return te(Sde,{container:s,children:[h(Vk,{onContextMenu:l=>l.preventDefault()}),h(Fk,{closeAllLabel:a}),te(xf,{"data-slot":"dialog-content","data-size":o,className:ae(ude({size:o}),t),...i,children:[e,r&&te(Zl,{"data-slot":"dialog-close",className:mde(),tabIndex:-1,children:[h(df,{className:"size-4"}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function Ede({className:t,...e}){return h("div",{"data-slot":"dialog-header",className:ae(dde(),t),...e})}function Mde({className:t,...e}){return h("div",{"data-slot":"dialog-footer",className:ae(fde(),t),...e})}const u0=Vh(({className:t,...e},n)=>h(Sf,{ref:n,"data-slot":"dialog-title",className:ae(pde(),t),...e}));u0.displayName="RBDialogTitle";const d0=Vh(({className:t,...e},n)=>h(Cf,{ref:n,"data-slot":"dialog-description",className:ae(hde(),t),...e}));d0.displayName="RBDialogDescription";const kde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),Rde=he("bg-raised border-subtle data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex h-auto flex-col overflow-hidden transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{defaultVariants:{side:"bottom"},variants:{side:{top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 w-full rounded-b-xl border-b",bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 w-full rounded-t-xl border-t",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 max-w-96 rounded-r-xl border-r",right:"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 max-w-96 rounded-l-xl border-l"}}}),Tde=he("bg-fg-default h-1 w-28 rounded-full"),Nde=he("flex items-center justify-center self-stretch pt-4"),Pde=he("gap-0_5 flex flex-col p-4"),Ade=he("mt-auto flex flex-col items-stretch gap-2 self-stretch p-4"),Ide=he("text-fg-default typo-title-01-medium"),Ode=he("text-fg-subtle typo-compact-sm-normal"),Lde=he("flex flex-col gap-3 self-stretch overflow-hidden px-4 pt-4"),$de=he("text-fg-default hover:text-fg-default-hovered focus-visible:outline-border-stronger absolute top-4 right-4 inline-flex size-4 items-center justify-center rounded-xs outline-hidden transition-colors focus-visible:outline focus-visible:outline-1");function Dde({side:t,...e}){return h(qr.Root,{"data-slot":"drawer",...e,direction:t??e.direction})}function G3e({...t}){return h(qr.Trigger,{"data-slot":"drawer-trigger",...t})}function K3e({...t}){return h(qr.Close,{"data-slot":"drawer-close",...t})}function Bde({...t}){return h(qr.Portal,{"data-slot":"drawer-portal",...t})}function zde({className:t,...e}){return h(qr.Overlay,{"data-slot":"drawer-overlay",className:ae(kde(),t),...e})}function Fde({className:t,children:e,side:n="bottom",showHandle:r,showCloseButton:o=!1,...a}){const i=r??n==="bottom";return te(Bde,{children:[h(zde,{}),te(qr.Content,{"data-slot":"drawer-content","data-position":n,className:ae(Rde({side:n}),t),...a,children:[n==="bottom"&&i&&h("div",{className:Nde(),children:h("div",{className:Tde()})}),e,o&&te(qr.Close,{className:$de(),children:[h(df,{}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function Vde({className:t,...e}){return h("div",{"data-slot":"drawer-header",className:ae(Pde(),t),...e})}function X3e({className:t,...e}){return h("div",{"data-slot":"drawer-body",className:ae(Lde(),t),...e})}function jde({className:t,...e}){return h("div",{"data-slot":"drawer-footer",className:ae(Ade(),t),...e})}function Hde({className:t,...e}){return h(qr.Title,{"data-slot":"drawer-title",className:ae(Ide(),t),...e})}function Wde({className:t,...e}){return h(qr.Description,{"data-slot":"drawer-description",className:ae(Ode(),t),...e})}const qde=he("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-dim fixed inset-0 z-50"),Ude=he("bg-raised outline-border-subtle data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 p-4 outline outline-1 outline-offset-[-1px] transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{defaultVariants:{side:"right"},variants:{side:{bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom shadow-up-lg inset-x-0 bottom-0 h-[520px] max-h-[80vh]",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full max-w-[90vw] shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.10)] shadow-lg",right:"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right shadow-up-lg inset-y-0 right-0 h-full max-w-[90vw]",top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-[520px] max-h-[80vh] shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.10)] shadow-lg"}}}),Yde=he("gap-0_5 flex flex-col"),Gde=he("mt-auto flex flex-col items-stretch gap-2 overflow-hidden"),Kde=he("text-fg-default typo-title-01-medium"),Xde=he("text-fg-subtle typo-compact-sm-normal"),Zde=he("text-fg-default hover:text-fg-default-hovered focus-visible:outline-border-stronger absolute top-4 right-4 inline-flex size-4 items-center justify-center rounded-xs outline-hidden transition-colors focus-visible:outline focus-visible:outline-1");function Qde({...t}){return h(bf,{"data-slot":"sheet",...t})}function Z3e({...t}){return h(Vw,{"data-slot":"sheet-trigger",...t})}function Q3e({...t}){return h(Zl,{"data-slot":"sheet-close",...t})}function Jde({...t}){return h(yf,{"data-slot":"sheet-portal",...t})}function efe({className:t,...e}){return h(_f,{"data-slot":"sheet-overlay",className:ae(qde(),t),...e})}function tfe({className:t,children:e,side:n="right",showCloseButton:r=!0,...o}){return te(Jde,{children:[h(efe,{}),te(xf,{"data-slot":"sheet-content","data-position":n,className:ae(Ude({side:n}),t),...o,children:[e,r&&te(Zl,{className:Zde(),children:[h(df,{}),h("span",{className:"sr-only",children:"Close"})]})]})]})}function nfe({className:t,...e}){return h("div",{"data-slot":"sheet-header",className:ae(Yde(),t),...e})}function rfe({className:t,...e}){return h("div",{"data-slot":"sheet-footer",className:ae(Gde(),t),...e})}function ofe({className:t,...e}){return h(Sf,{"data-slot":"sheet-title",className:ae(Kde(),t),...e})}function afe({className:t,...e}){return h(Cf,{"data-slot":"sheet-description",className:ae(Xde(),t),...e})}const ife=({className:t,type:e,open:n,onOpenChange:r,header:o,footer:a,children:i,hideCloseButton:s,handleInteractOutside:l})=>{const u=e.split("-")[0];return h(Qde,{open:n,onOpenChange:r,children:te(tfe,{className:ae(t,{"[&>button:last-child]:hidden":s}),side:u,onInteractOutside:l,children:[!!o&&te(nfe,{children:[!!o.title&&h(ofe,{children:o.title}),!!o.description&&h(afe,{children:o.description})]}),i,!!a&&h(rfe,{children:a})]})})},jh=({className:t,open:e,type:n="dialog",dialogContainer:r,children:o,enableDimClose:a=!0,header:i,hideCloseButton:s,footer:l,gamePadType:u="modal",onOpenChange:d,disableAutoFocus:f=!1,closeAllButtonLabel:m="Close All"})=>{const v=g=>{a||g.preventDefault()};return n==="drawer"?h(Dde,{open:e,onOpenChange:d,children:te(Fde,{className:ae(t),onInteractOutside:v,children:[!!i&&te(Vde,{children:[!!i.title&&h(Hde,{children:i.title}),!!i.description&&h(Wde,{children:i.description})]}),o,!!l&&h(jde,{children:l})]})}):n==="dialog"?h(xde,{open:e,onOpenChange:d,children:te(Cde,{...f&&{onOpenAutoFocus:g=>g.preventDefault()},className:ae(t),container:r,"data-pad-scope":u,showCloseButton:!s,closeAllLabel:m,onInteractOutside:v,children:[i?te(Ede,{children:[i.title?h(u0,{children:i.title}):h(Il,{children:h(u0,{})}),i.description?h(d0,{children:i.description}):h(Il,{children:h(d0,{})})]}):te(Il,{children:[h(u0,{}),h(d0,{})]}),o,!!l&&h(Mde,{children:l})]})}):h(ife,{className:t,type:n,header:i,footer:l,open:e,enableDimClose:a,hideCloseButton:s,onOpenChange:d,handleInteractOutside:v,children:o})},sfe=({className:t,containerId:e,open:n,onOpenChange:r,title:o,content:a,contentClassName:i,buttonText:s="확인",snapshotCnt:l,resolve:u,onConfirm:d})=>{const f=()=>{u(!0),d?.()};return h(jh,{"data-slot":"alert-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:n,onOpenChange:r,type:"dialog",dialogContainer:e?document.getElementById(e):void 0,snapshotCnt:l,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:o?{title:o}:void 0,footer:h(Wr,{variant:"brand",onClick:f,children:s}),children:h("div",{"data-slot":"alert-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",i),children:a})})},{useState:lfe}=await q("react"),cfe=({className:t,open:e,onOpenChange:n,title:r,description:o,content:a,contentClassName:i,buttonText:s={yes:"Confirm",no:"Cancel"},buttonClassName:l,buttonWrapperClassName:u,snapshotCnt:d,containerId:f,onConfirm:m,onCancel:v,resolve:g})=>{const[w,y]=lfe(!1),_=async()=>{y(!0);try{await m?.(),g(!0)}finally{y(!1)}},S=()=>{v?.(),g(!1)};return h(jh,{"data-slot":"confirm-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:d,dialogContainer:f?document.getElementById(f):void 0,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:r||o?{title:r,description:o}:void 0,footer:te(Yo,{"data-slot":"confirm-modal-button-wrapper",className:ae("btn-wrapper",u),alignItems:"center",gap:8,children:[h(Wr,{variant:"outlined",className:ae(l?.no),disabled:w,onClick:S,children:s.no}),h(Wr,{variant:"brand",className:ae(l?.yes),autoFocus:!0,loading:w,onClick:_,children:s.yes})]}),children:h("div",{"data-slot":"confirm-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",i),children:a})})},ufe={default:"text-fg-subtle",error:"text-fg-danger",success:"text-fg-success"};function dfe({className:t,helperText:e,helperTone:n="default"}){return e?h("div",{"data-slot":"text-helper",className:ae("pt-1_5 w-full",t),children:h("div",{"data-slot":"text-helper-message",className:ae("typo-compact-xs-normal",ufe[n]),children:e})}):null}function ffe({className:t,label:e,description:n,required:r=!1,children:o}){return!e&&!n&&!o?null:te("div",{"data-slot":"text-label",className:ae("gap-0_5 flex w-full flex-col",t),children:[e&&te("div",{"data-slot":"text-label-heading",className:"gap-0_5 typo-compact-xs-semibold inline-flex items-start",children:[h("span",{"data-slot":"text-label-text",className:"text-fg-default",children:e}),r&&h("span",{"data-slot":"text-label-required",className:"text-fg-information",children:"*"})]}),n&&h("div",{"data-slot":"text-label-description",className:"text-fg-subtle typo-compact-xs-normal",children:n}),o&&h("div",{className:"pt-1","data-slot":"text-label-children",children:o})]})}function pfe({className:t="",labelClassName:e="",helperClassName:n="",label:r,description:o,required:a=!1,helperText:i,helperTone:s="default",children:l}){return h("div",{"data-slot":"text-field",className:ae("w-full",t),children:te(ffe,{className:e,label:r,description:o,required:a,children:[h("div",{"data-slot":"text-field-control",children:l}),h(dfe,{className:n,helperText:i,helperTone:s})]})})}const{cloneElement:hfe,useState:l6}=await q("react"),mfe=({className:t,open:e,onOpenChange:n,title:r,content:o,contentClassName:a,placeholder:i,inputType:s="text",inputElement:l,label:u,description:d,required:f=!1,helperText:m,helperTone:v="default",autoFocus:g=!1,value:w,buttonText:y={yes:"Confirm",no:"Cancel"},buttonClassName:_,buttonWrapperClassName:S,containerId:x,snapshotCnt:C,resolve:R,close:P})=>{const[O,$]=l6(w||""),[A,M]=l6(!1),L=s==="password"&&A?"text":s;return h(jh,{"data-slot":"prompt-modal",className:ae("w-fit","min-w-[25rem]","max-w-[95vw]",t),open:e,onOpenChange:n,type:"dialog",snapshotCnt:C,dialogContainer:x?document.getElementById(x):void 0,hideCloseButton:!0,enableDimClose:!1,gamePadType:"dialog",header:r?{title:r}:void 0,footer:te(Yo,{"data-slot":"prompt-modal-button-wrapper",className:ae("btn-wrapper",S),alignItems:"center",gap:8,children:[h(Wr,{variant:"outlined",className:ae(_?.no),onClick:()=>R(null),children:y.no}),h(Wr,{variant:"brand",className:ae(_?.yes),onClick:()=>R(O),children:y.yes})]}),children:te(Ul,{children:[o&&h("div",{"data-slot":"prompt-modal-content",className:ae("text-body-xs2-normal text-fg-default px-4 py-3 whitespace-pre-wrap",a),children:o}),l?h("div",{"data-slot":"prompt-modal-input",className:"w-full px-4 py-2",children:hfe(l,{value:O,handleChange:$,tabIndex:g?0:-1,placeholder:i,type:s})}):h("div",{"data-slot":"prompt-modal-input",className:"w-full px-4 py-2",children:h(pfe,{label:u,description:d,required:f,helperText:m,helperTone:v,children:te("div",{className:"relative w-full",children:[h(sw,{className:ae("w-full",s==="password"&&"pr-10"),type:L,tabIndex:g?0:-1,placeholder:i,value:O,handleChange:$,handleEnter:()=>R(O)}),s==="password"&&h("button",{type:"button",className:"text-fg-subtle hover:text-fg-default absolute top-1/2 right-4 -translate-y-1/2",onClick:()=>M(B=>!B),children:A?h(k8,{className:"size-4"}):h(R8,{className:"size-4"})})]})})})]})})},gfe=he("gap-2_5 inline-flex items-center justify-center pt-4"),P2=he("gap-0_5 flex items-center justify-start"),v1=he("py-0_5 inline-flex size-6 shrink-0 items-center justify-center rounded-sm transition-colors duration-200 ease-out",{variants:{disabled:{true:"bg-fill-transparent text-fg-disabled pointer-events-none",false:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered"}},defaultVariants:{disabled:!1}}),w1=he("inline-flex size-3.5 items-center justify-center"),vfe=he("inline-flex size-6 shrink-0 flex-col items-center justify-center rounded-md transition-colors duration-200 ease-out",{variants:{selected:{true:"text-fg-default outline-border-default outline outline-1 outline-offset-[-1px]",false:"text-fg-subtler hover:bg-fill-subtler-hovered"}},defaultVariants:{selected:!1}}),wfe=he("inline-flex h-5 w-7 items-center justify-center text-center text-xs leading-4 font-semibold"),{useMemo:Cd}=await q("react"),J3e=({className:t,currPage:e=1,listSize:n=20,pageSize:r=5,totalCount:o=0,handlePageChange:a})=>{const i=Cd(()=>{const f=o/n;return f%1===0?f:Math.floor(f)+1},[n,o]),s=Cd(()=>{const f=Math.ceil(i/r);return Array.from({length:f},(m,v)=>Array.from({length:r},(g,w)=>v*r+w+1))},[r,i]),l=Cd(()=>{const f=(s.find(m=>m.includes(e))??[]).filter(m=>m<=i);return f.length===0?[1]:f},[e,s,i]),u=Cd(()=>{const f=l[0]??1;return Math.max(1,f-1)},[l]),d=Cd(()=>{const f=l[l.length-1]??i;return Math.min(i,f+1)},[l,i]);return te("div",{"data-slot":"pagination",className:ae(gfe(),t),children:[te("div",{"data-slot":"pagination-prev-group",className:P2(),children:[h("button",{"data-slot":"pagination-prev-double",className:v1({disabled:e===1}),type:"button",disabled:e===1,onClick:()=>a(u),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(_8,{})})}),h("button",{"data-slot":"pagination-prev",className:v1({disabled:e===1}),type:"button",disabled:e===1,onClick:()=>a(e-1),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(X0,{})})})]}),h("div",{"data-slot":"pagination-pages",className:P2(),children:l.map(f=>h("button",{"data-slot":"pagination-page",className:vfe({selected:e===f}),type:"button",onClick:()=>a(f),children:h("span",{"data-slot":"pagination-page-text",className:wfe(),children:f})},f))}),te("div",{"data-slot":"pagination-next-group",className:P2(),children:[h("button",{"data-slot":"pagination-next",className:v1({disabled:!(e<i)}),type:"button",disabled:!(e<i),onClick:()=>a(e+1),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(Su,{})})}),h("button",{"data-slot":"pagination-next-double",className:v1({disabled:e===i||i===0}),type:"button",disabled:e===i||i===0,onClick:()=>a(d),children:h("span",{"data-slot":"pagination-nav-icon",className:w1(),children:h(x8,{})})})]})]})},bfe=he(["inline-flex w-48 items-center gap-1 overflow-hidden","bg-fill-control-surface outline outline-1 outline-offset-[-1px]","transition-colors"].join(" "),{variants:{size:{xs2:"h-8 rounded-md px-0.5",sm:"h-9 rounded-md px-0.5",md:"h-10 rounded-md px-0.5",lg:"h-12 rounded-lg px-1"},variant:{default:"outline-border-default",success:"outline-border-success-stronger"},focus:{true:"outline-border-input-focused",false:""},error:{true:"outline-border-danger-stronger",false:""},readOnly:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""},disabled:{true:"bg-fill-control-surface-disabled outline-border-disabled pointer-events-none cursor-not-allowed",false:""},inputDisabled:{true:"bg-fill-control-surface-disabled outline-border-disabled",false:""}},compoundVariants:[{variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1,className:"[&:hover]:bg-fill-control-surface-hovered [&:hover]:outline-border-default"},{variant:"success",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-success-stronger"},{focus:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-input-focused"},{error:!0,className:"[&:hover]:bg-fill-control-surface [&:hover]:outline-border-danger-stronger"},{readOnly:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{disabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"},{inputDisabled:!0,className:"[&:hover]:bg-fill-control-surface-disabled [&:hover]:outline-border-disabled"}],defaultVariants:{size:"md",variant:"default",focus:!1,error:!1,readOnly:!1,disabled:!1,inputDisabled:!1}}),c6=he("bg-fill-transparent touch-action-none inline-flex shrink-0 items-center justify-center rounded-sm transition-[background-color] [&_*]:pointer-events-none",{variants:{size:{xs2:"size-7",sm:"size-8",md:"size-9",lg:"size-10"},disabledLike:{true:"cursor-not-allowed",false:"cursor-pointer"},pressed:{true:"scale-90",false:""}},defaultVariants:{size:"md",disabledLike:!1,pressed:!1}}),u6=he("",{variants:{size:{xs2:"size-3.5",sm:"size-3.5",md:"size-4",lg:"size-4"},disabledLike:{true:"text-fg-disabled",false:"text-fg-default"},pressed:{true:"scale-90",false:""}},compoundVariants:[{disabledLike:!1,pressed:!0,className:"transform transition-transform"}],defaultVariants:{size:"md",disabledLike:!1,pressed:!1}}),yfe=he(["w-full border-none bg-transparent text-center ring-0 outline-none","placeholder:text-fg-subtler appearance-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"].join(" "),{variants:{size:{xs2:"typo-compact-xs2-semibold",sm:"typo-compact-sm-normal",md:"typo-compact-sm2-normal",lg:"typo-compact-sm2-normal"},variant:{default:"text-fg-default",success:"text-fg-default"},focus:{true:"placeholder:text-fg-subtler",false:""},error:{true:"placeholder:text-fg-subtler",false:""},readOnly:{true:"placeholder:text-fg-default",false:""},disabled:{true:"text-fg-disabled placeholder:text-fg-disabled",false:""},inputDisabled:{true:"text-fg-disabled placeholder:text-fg-disabled",false:""}},defaultVariants:{size:"md",variant:"default"}}),{forwardRef:_fe,useCallback:eo,useEffect:Uc,useImperativeHandle:xfe,useMemo:Sfe,useRef:Ua,useState:A2}=await q("react"),Cfe=t=>{const e=t?.target?.value;return kn.replace(e,/^0+[\d,]/gm,o=>kn.last(o)).replace(/[^\d.-]/g,"")},Efe=_fe(({className:t="",type:e,size:n,variant:r,step:o=1,error:a,isDirect:i=!0,increaseStep:s,decreaseStep:l,maxLength:u,increaseElement:d,decreaseElement:f,detectDobleClick:m,useSetButton:v,notAllowedEmptyValue:g,inputDisabled:w,disableAutoAccel:y,disableLongPress:_,fixedDigit:S,initialLongPressDelay:x=300,enableArrowKeys:C,enableWheel:R,handleChange:P,onButtonPointerDown:O,onButtonPointerUp:$,handleEnter:A,...M},L)=>{const{value:B,readOnly:F,disabled:N,min:V,max:z="9999999999999",digit:I=18,onFocus:D,onBlur:U}=M,Y=Ua(null),oe=Ua(!1),Q=Ua(!1),re=Ua({up:0,down:0}),le=Ua(""),ee=Ua(null),ne=Ua(null),ue=Ua(0),ve=Ua(0),we=Ua(x),[ye,Le]=A2(B??""),[Oe,Ne]=A2(!1),[me,pe]=A2(null),be=Sfe(()=>N||new Ut(V??0).cmp(new Ut(z))>0,[N,z,V]),Ue=eo((Ce,Ye,wt)=>{if(Ye===0)return Ce;const un=wt==="up"?new Ut(Ce||0).add(new Ut(ee.current?.increase??Ye??1)).toDP(I,Ut.ROUND_DOWN):new Ut(Ce||0).sub(new Ut(ee.current?.decrease??Ye??1)).toDP(I,Ut.ROUND_DOWN);return S!==void 0?un.toFixed(S):un.toString()},[I,S]),He=eo(Ce=>typeof Ce>"u"||!Ce||be?"":Ce.endsWith(".")?Ce:typeof V<"u"&&new Ut(Number(Ce)).lt(new Ut(V))?String(V):typeof z<"u"&&new Ut(Dl(Ce||"")).gt(new Ut(z))?String(z):Ce,[V,z,be]),qe=eo(Ce=>be?"":Ce.endsWith(".")?Ce:He(Ce),[be,He]),_e=eo(Ce=>{const Ye=Y.current;Ye&&(Ye.value=Bi(Ce??"").join("."),delete Ye.dataset.tempNumberKeypadValue,Ye.dispatchEvent(new Event("input",{bubbles:!0})))},[]),at=eo(({type:Ce,e:Ye})=>{if(!Y.current||be)return;const{value:wt,name:un}=Y.current,on=Cfe({target:{value:wt}}),Lt=I?new RegExp(`^-?[0-9]*[.]{0,1}[0-9]{0,${I}}$`,"gm"):/^-?\d{0,18}$/;on.match(Lt)&&(typeof u<"u"&&(on||"").split(".")[0].replace(/[^0-9]/g,"").length>Number(u)||(Y.current.value=Bi(on??"").join("."),le.current!==on&&(P?.(on,un,{type:Ce}),Ye&&M.onChange?.(Ye),le.current=on),Le(on)))},[be,I,u,P,M]),ht=eo((Ce,Ye)=>{Y.current&&(Ne(Ye),Ye?D?.(Ce):(Y.current.value=qe(Y.current.value),g&&!Ce.target.value&&(Y.current.value=M.value),at({}),U?.(Ce)))},[D,qe,g,M.value,at,U]),st=eo(Ce=>{if(be||F){oe.current=!1,window.clearTimeout(ue.current);return}le.current=Ue(le.current??"0",ne.current,Ce),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:Ce}),window.clearTimeout(ve.current),ve.current=window.setTimeout(()=>{oe.current&&(st(Ce),we.current>50&&!y&&(we.current-=we.current/6))},we.current)},[Ue,He,be,P,M.name,y,F,_e]),Ct=eo(Ce=>{const{value:Ye="",name:wt}=Ce.target;g&&!Ye&&(Ce.target.value=M.value),A?.(Ye,wt),Ce.target.blur()},[A,M.value,g]),cn=eo(Ce=>{if(Ce.key==="Enter"&&!Ce.nativeEvent.isComposing)Ct(Ce);else if(C&&(Ce.key==="ArrowUp"||Ce.key==="ArrowDown")&&(Ce.preventDefault(),!be&&!F)){const Ye=Ce.key==="ArrowUp"?"up":"down";le.current=Ue(le.current??"0",ne.current,Ye),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:Ye})}M.onKeyDown?.(Ce)},[M,Ct,C,be,F,Ue,He,P,_e]);Uc(()=>{const Ce=Y.current;if(!Ce||!R)return;const Ye=wt=>{if(be||F)return;wt.preventDefault();const un=wt.deltaY<0?"up":"down";le.current=Ue(le.current??"0",ne.current,un),le.current=He(le.current??"0"),Le(String(le.current)),_e(le.current),P?.(le.current,M.name,{type:un})};return Ce.addEventListener("wheel",Ye,{passive:!1}),()=>Ce.removeEventListener("wheel",Ye)},[R,be,F,Ue,He,P,M.name,_e]);const Sn=eo((Ce,Ye)=>{if(!(Date.now()-re.current[Ce]<500&&m)){if(be||F){oe.current=!1,window.clearTimeout(ue.current);return}re.current[Ce]=Date.now(),pe(Ce),st(Ce),O?.(Ce,Ye),_||(ue.current=window.setTimeout(()=>{oe.current=!0,st(Ce)},we.current)),Q.current=!0}},[m,be,F,st,_,O]),Jn=eo(Ce=>{Ce&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)&&Ce.currentTarget.releasePointerCapture?.(Ce.pointerId)},[]);eo((Ce,Ye=20)=>{const wt=Ce.currentTarget.getBoundingClientRect();return Ce.clientX<wt.left-Ye||Ce.clientX>wt.right+Ye||Ce.clientY<wt.top-Ye||Ce.clientY>wt.bottom+Ye},[]);const Gt=eo((Ce,Ye)=>{if(be||F||!Q.current){oe.current=!1,window.clearTimeout(ue.current),Q.current&&Ce&&$?.(Ce,Ye);return}oe.current=!1,Q.current=!1,pe(null),window.clearTimeout(ue.current),we.current=x,Ce&&$?.(Ce,Ye),Ce&&at({type:Ce})},[be,at,F,$,x]),Tn=eo(()=>{oe.current=!1,pe(null),window.clearTimeout(ue.current),window.clearTimeout(ve.current),we.current=x},[x]);Uc(()=>{le.current=B??""},[B]),Uc(()=>{typeof B<"u"&&Le(B)},[B]),Uc(()=>{ne.current=o},[o]),Uc(()=>{ee.current={increase:s,decrease:l}},[s,l]),xfe(L,()=>Y.current),Uc(()=>{const Ce=Ye=>{Ye.type==="contextmenu"&&(oe.current||Q.current)&&Ye.preventDefault()};return window.addEventListener("contextmenu",Ce),window.addEventListener("pointerup",Ce),window.addEventListener("pointercancel",Ce),()=>{window.removeEventListener("contextmenu",Ce),window.removeEventListener("pointerup",Ce),window.removeEventListener("pointercancel",Ce)}},[Tn]);const Hn=f??h(T8,{"aria-hidden":!0,className:u6({size:n,disabledLike:be||V===ye,pressed:me==="down"})}),Tt=d??h(N8,{"aria-hidden":!0,className:u6({size:n,disabledLike:be||z===ye,pressed:me==="up"})});return te(Yo,{"data-slot":"side-number-input",className:ae(bfe({size:n,variant:r,focus:Oe,readOnly:F,disabled:N,error:a,inputDisabled:w}),t),alignItems:"center",justifyContent:"space-between",onContextMenu:Ce=>{Ce.target instanceof HTMLInputElement||Ce.preventDefault()},children:[h("button",{type:"button","data-slot":"side-number-input-decrease","data-type":"down",className:c6({size:n,disabledLike:be||z===ye,pressed:me==="down"}),disabled:be||z===ye,onPointerDown:Ce=>{Ce.preventDefault(),Ce.currentTarget.setPointerCapture?.(Ce.pointerId),Sn("down",Ce)},onPointerMove:Ce=>{Q.current&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)},onPointerUp:Ce=>{Gt("down",Ce),Jn(Ce)},onPointerCancel:Ce=>{Gt("down",Ce),Jn(Ce)},onLostPointerCapture:Ce=>{Gt("down",Ce)},onContextMenu:Ce=>{Ce.preventDefault()},children:Hn}),h("input",{...M,type:"text",inputMode:e==="nx-number"?"none":void 0,"data-slot":"side-number-input-field",className:yfe({size:n,variant:r,focus:Oe,readOnly:F,disabled:N,error:a,inputDisabled:w}),ref:Y,value:Bi(ye??"").join(".")??"",readOnly:!i,disabled:N||w,onChange:Ce=>at({e:Ce}),onFocus:Ce=>ht(Ce,!0),onBlur:Ce=>ht(Ce,!1),onKeyDown:cn,onContextMenu:Ce=>{Ce.preventDefault()}}),h("button",{type:"button","data-slot":"side-number-input-increase","data-type":"up",className:c6({size:n,disabledLike:be||V===ye,pressed:me==="up"}),disabled:be||V===ye,onPointerDown:Ce=>{Ce.preventDefault(),Ce.currentTarget.setPointerCapture?.(Ce.pointerId),Sn("up",Ce)},onPointerMove:Ce=>{Q.current&&Ce.currentTarget.hasPointerCapture?.(Ce.pointerId)},onPointerUp:Ce=>{Gt("up",Ce),Jn(Ce)},onPointerCancel:Ce=>{Gt("up",Ce),Jn(Ce)},onLostPointerCapture:Ce=>{Gt("up",Ce)},onContextMenu:Ce=>{Ce.preventDefault()},children:Tt}),e==="nx-number"&&h(aw,{inputRef:Y,maxLength:Number(u),useSet:v,onSet:A})]})});Efe.displayName="SideNumberInput";const Mfe=he("group inline-flex items-center select-none",{variants:{size:{sm:"gap-1",md:"gap-1_5"},checked:{true:"",false:""},disabled:{true:"pointer-events-none cursor-not-allowed",false:"cursor-pointer"},readOnly:{true:"pointer-events-none cursor-not-allowed",false:""}},defaultVariants:{size:"sm",checked:!1,disabled:!1,readOnly:!1}}),kfe=he("relative inline-flex shrink-0 items-center justify-center rounded-full border transition-[background-color,border-color] duration-200 ease-out",{variants:{size:{sm:"size-4",md:"size-5"},checked:{true:"",false:""},disabled:{true:"",false:""}},compoundVariants:[{checked:!1,disabled:!1,className:"border-subtle bg-fill-control-surface"},{checked:!0,disabled:!1,className:"bg-fill-brand border-transparent"},{checked:!1,disabled:!0,className:"bg-fill-disabled border-disabled"},{checked:!0,disabled:!0,className:"bg-fill-disabled border-none"}],defaultVariants:{size:"sm",checked:!1,disabled:!1}}),Rfe=he("rounded-full transition-[opacity,transform,background-color] duration-200 ease-out",{variants:{size:{sm:"size-1.5",md:"size-2"},checked:{true:"",false:""},disabled:{true:"",false:""}},compoundVariants:[{checked:!0,disabled:!1,className:"bg-fg-static-white scale-100 opacity-100"},{checked:!1,disabled:!1,className:"bg-fg-static-white scale-0 opacity-0"},{checked:!0,disabled:!0,className:"bg-fg-disabled scale-100"},{checked:!1,disabled:!0,className:"bg-fg-disabled scale-0 opacity-0"}],defaultVariants:{size:"sm",checked:!1,disabled:!1}}),Tfe=he("",{variants:{size:{sm:"typo-compact-xs2-normal",md:"typo-compact-sm2-normal"},disabled:{true:"text-fg-disabled",false:"text-fg-default"}},defaultVariants:{size:"sm",disabled:!1}}),Nfe=he(["relative inline-flex","[&_[data-slot='radio-check']]:hidden","[&_[data-slot='radio-text']]:inline-flex","[&_[data-slot='radio-text']]:items-center","[&_[data-slot='radio-text']]:justify-center","[&_[data-slot='radio-text']]:gap-1","[&_[data-slot='radio-text']]:cursor-pointer","[&_[data-slot='radio-text']]:rounded-md","[&_[data-slot='radio-text']]:bg-fill-transparent","[&_[data-slot='radio-text']]:text-fg-default","[&_[data-slot='radio-text']]:outline","[&_[data-slot='radio-text']]:outline-1","[&_[data-slot='radio-text']]:outline-offset-[-1px]","[&_[data-slot='radio-text']]:outline-border-default","[&_[data-slot='radio-text']]:transition-colors","[&_[data-slot='radio-text']]:hover:bg-fill-transparent-hovered","[&_.peer:checked~[data-slot='radio-text']]:bg-fill-subtler","[&_.peer:checked~[data-slot='radio-text']]:text-fg-default","[&_.peer:checked~[data-slot='radio-text']]:outline-transparent","[&_.peer:checked~[data-slot='radio-text']]:hover:bg-fill-subtler-hovered","[&_.peer:disabled~[data-slot='radio-text']]:bg-fill-transparent","[&_.peer:disabled~[data-slot='radio-text']]:cursor-not-allowed","[&_.peer:disabled~[data-slot='radio-text']]:text-fg-disabled","[&_.peer:disabled~[data-slot='radio-text']]:outline-border-disabled","[&_.peer:disabled~[data-slot='radio-text']]:hover:bg-fill-transparent","[&_.peer:checked:disabled~[data-slot='radio-text']]:bg-fill-disabled","[&_.peer:checked:disabled~[data-slot='radio-text']]:text-fg-disabled","[&_.peer:checked:disabled~[data-slot='radio-text']]:outline-transparent","[&_.peer[readonly]~[data-slot='radio-text']]:bg-fill-transparent","[&_.peer[readonly]~[data-slot='radio-text']]:cursor-not-allowed","[&_.peer[readonly]~[data-slot='radio-text']]:text-fg-default","[&_.peer[readonly]~[data-slot='radio-text']]:outline-border-subtler","[&_.peer[readonly]~[data-slot='radio-text']]:hover:bg-fill-transparent","[&_.peer:checked[readonly]~[data-slot='radio-text']]:bg-fill-disabled","[&_.peer:checked[readonly]~[data-slot='radio-text']]:text-fg-default","[&_.peer:checked[readonly]~[data-slot='radio-text']]:outline-transparent"].join(" "),{variants:{size:{sm:["[&_[data-slot='radio-text']]:min-h-7","[&_[data-slot='radio-text']]:px-2","[&_[data-slot='radio-text']]:typo-compact-xs-semibold"].join(" "),md:["[&_[data-slot='radio-text']]:min-h-8","[&_[data-slot='radio-text']]:px-3","[&_[data-slot='radio-text']]:typo-compact-xs-semibold"].join(" ")},disabled:{true:"pointer-events-none cursor-not-allowed",false:""}},defaultVariants:{size:"sm",disabled:!1}}),{forwardRef:Pfe,useCallback:Afe,useImperativeHandle:Ife,useMemo:Ofe,useRef:Lfe}=await q("react"),jk=Pfe(({className:t="",children:e,size:n,disabled:r,readOnly:o,checkValue:a,value:i,handleChange:s,...l},u)=>{const d=Lfe(null),f=Ofe(()=>{if(!(typeof i>"u"))return i===a},[i,a]),m=Afe(v=>{const{name:g,value:w}=v.target;(typeof a=="number"?Number(w)===a:w===a)&&s?.(a,g),l.onChange?.(v)},[s,l,a]);return Ife(u,()=>d.current),te("label",{"data-slot":"radio-root",className:ae(Mfe({size:n,checked:f,disabled:r,readOnly:o}),t),children:[h("input",{ref:d,...l,type:"radio",value:a,checked:f,readOnly:o,disabled:r,onChange:m,className:"peer sr-only"}),h("span",{"data-slot":"radio-check",className:kfe({size:n,checked:f,disabled:r}),children:h("i",{"data-slot":"radio-icon",className:Rfe({size:n,checked:f,disabled:r})})}),e&&h("span",{"data-slot":"radio-text",className:Tfe({size:n,disabled:r}),children:e})]})});jk.displayName="RBRadioBox";const{forwardRef:$fe}=await q("react"),Dfe=$fe(({className:t="",children:e,rippleOption:n={disabled:!0},size:r="sm",disabled:o,...a},i)=>h(Rr,{...n,children:h(jk,{ref:i,size:r,disabled:o,className:ae(Nfe({size:r,disabled:o}),t),...a,children:e})}));Dfe.displayName="RBRadioButton";const Hk=he("block",{variants:{swipeContent:{true:"swipe-content",false:""}},defaultVariants:{swipeContent:!1}}),Wk=he("relative isolate",{variants:{hasScrollMask:{true:"overflow-hidden",false:""}},defaultVariants:{hasScrollMask:!1}}),qk=he("relative overflow-x-auto overflow-y-visible whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"),Bfe=he("border-subtle inline-flex items-end border-b",{variants:{size:{sm:"gap-3",md:"gap-3_5",lg:"gap-4"}},defaultVariants:{size:"md"}}),zfe=he("px-0_5 relative -mb-px inline-flex shrink-0 items-center justify-center border-b text-center transition-colors",{variants:{size:{sm:"typo-compact-sm-semibold h-8",md:"typo-compact-sm2-semibold h-10",lg:"typo-compact-lg-semibold h-12"},selected:{true:"",false:"border-transparent"},disabled:{true:"pointer-events-none cursor-not-allowed",false:"cursor-pointer"},slider:{true:"",false:""}},compoundVariants:[{selected:!0,disabled:!1,slider:!1,className:"text-fg-default z-[1] border-transparent"},{selected:!1,disabled:!1,className:"text-fg-subtler"},{selected:!0,disabled:!0,slider:!1,className:"text-fg-disabled z-[1] border-transparent"},{selected:!1,disabled:!0,className:"text-fg-disabled"},{selected:!0,disabled:!1,slider:!0,className:"text-fg-default z-[1] border-transparent"},{selected:!0,disabled:!0,slider:!0,className:"text-fg-disabled z-[1] border-transparent"}],defaultVariants:{size:"md",selected:!1,disabled:!1,slider:!1}}),Ffe=he("bg-fill-default pointer-events-none absolute bottom-[-1px] left-0 z-[1] h-[1px] transition-[transform,width] duration-200",{variants:{visible:{true:"",false:"opacity-0"}},defaultVariants:{visible:!0}}),f0=he("max-w-full",{variants:{hasContent:{true:"pt-2",false:""},swipeContent:{true:"[&_.swiper-wrapper]:!transition-property-[transform]",false:""}},defaultVariants:{hasContent:!0,swipeContent:!1}}),cu=he("",{variants:{active:{true:"block",false:"hidden"},disabled:{true:"",false:""},swipeContent:{true:"block",false:""}},defaultVariants:{active:!1,disabled:!1,swipeContent:!1}}),ebe=he("inline-flex items-center overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",{variants:{size:{sm:"gap-1",md:"gap-1_5",lg:"gap-1_5"}},defaultVariants:{size:"md"}}),Vfe=he("inline-flex shrink-0 items-center justify-center rounded-full transition-colors",{variants:{size:{sm:"px-2_5 typo-compact-sm-semibold h-7",md:"typo-compact-sm2-semibold h-8 px-3",lg:"typo-compact-lg-semibold h-10 px-4"},selected:{true:"",false:"bg-fill-transparent outline-border-subtle outline outline-1 outline-offset-[-1px]"},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{selected:!0,disabled:!1,className:"bg-fill-default text-fg-inverse"},{selected:!1,disabled:!1,className:"text-fg-subtler"},{selected:!0,disabled:!0,className:"bg-fill-disabled text-fg-disabled"},{selected:!1,disabled:!0,className:"text-fg-disabled outline-border-disabled"}],defaultVariants:{size:"md",selected:!1,disabled:!1}}),jfe=he("items-center border-b-0",{variants:{size:{sm:"gap-1",md:"gap-1_5",lg:"gap-1_5"}},defaultVariants:{size:"md"}}),Hfe=he("items-center border-b-0",{variants:{size:{xs:"gap-1",xs2:"gap-1"}},defaultVariants:{size:"xs2"}}),Wfe=he("relative inline-flex shrink-0 items-center justify-center rounded-md transition-colors",{variants:{size:{xs:"typo-compact-xs-semibold h-7 px-2",xs2:"typo-compact-xs-semibold h-8 px-3"},selected:{true:"outline outline-1 outline-offset-[-1px] outline-transparent",false:"bg-fill-transparent outline-border-default outline outline-1 outline-offset-[-1px]"},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{selected:!0,disabled:!1,className:"bg-fill-subtler text-fg-default"},{selected:!1,disabled:!1,className:"text-fg-default"},{selected:!0,disabled:!0,className:"bg-fill-disabled text-fg-disabled"},{selected:!1,disabled:!0,className:"text-fg-disabled outline-border-disabled"}],defaultVariants:{size:"xs2",selected:!1,disabled:!1}}),{forwardRef:qfe}=await q("react"),Uk=qfe(({className:t="",size:e="md",slider:n=!1,useDefaultStyle:r=!0,selected:o=!1,disabled:a=!1,role:i,children:s,onClick:l,"aria-selected":u},d)=>h("button",{ref:d,type:"button",disabled:a,role:i,"aria-selected":u,className:ae(r&&zfe({size:e,selected:o,disabled:a,slider:n}),t),onClick:l,children:h("span",{className:"text-center",children:s})}));Uk.displayName="RBTabItem";const{useCallback:I2,useEffect:Ed,useMemo:b1,useRef:Md,useState:Ufe}=await q("react"),Yfe=Oh,Gfe=Ih,Kfe=({className:t="",size:e,tabItems:n,activeKey:r,name:o,slider:a,swipeContent:i,disabled:s,rippleOption:l={disabled:!0},tabNavScrollRef:u,destroyInactiveTabPanel:d=!0,tabBtnClassName:f,style:m,onClick:v,handleChange:g})=>{const w=Md(null),y=Md(null),_=Md([]),S=Md(null),x=Md(!1),C=b1(()=>n?.filter(F=>!F?.isHide)??[],[n]),[R,P]=Ufe(r??C[0]?.key),O=b1(()=>{const F=C.findIndex(N=>N.key===R);return F===-1?0:F},[R,C]),$=b1(()=>{if(!C.length)return null;if(i){const F=()=>{const{swipeDirection:N}=S.current,{key:V,disabled:z}=C[S.current.activeIndex],{key:I}=C[S.current.activeIndex-1]??C[0],{key:D}=C[S.current.activeIndex+1]??C[S.current.activeIndex];z?(P(N==="next"?D:I),g?.(N==="next"?D:I,o)):(P(V),g?.(V,o))};return h(Gfe,{className:ae(f0({swipeContent:!0})),autoHeight:!0,threshold:1,slidesPerView:1,enabled:!s,onSwiper:N=>{S.current=N},onSlideChange:F,children:C.map(N=>h(Yfe,{className:ae(cu({disabled:s||N.disabled})),style:{visibility:N.disabled?"hidden":"visible"},children:N.children},N.key))})}else return d?h("div",{className:ae(f0()),children:h("div",{className:ae(cu({active:!0,disabled:s||C[O]?.disabled})),children:C[O]?.children})},`contents-${C[O]?.key}`):h("div",{className:ae(f0()),children:C.map((F,N)=>h("div",{className:ae(cu({active:O===N,disabled:s||F.disabled})),children:F.children},`contents-${F.key}`))})},[O,d,s,g,o,i,C]),A=I2(()=>{const F=u?.current??y.current,N=_.current.find(V=>V&&V.classList.contains("active"))??_.current[0];if(N){const{offsetLeft:V,clientWidth:z}=N,I=V-F.offsetWidth/2+z/2;F.scrollTo({top:0,left:I,behavior:"smooth"})}},[u]),M=I2(()=>{const F=w.current;if(!a||!F)return;const N=_.current.find(V=>V&&V.classList.contains("active"))??_.current[0];if(N){const{offsetLeft:V,clientWidth:z}=N;F.style.transform=`translateX(${V}px)`,F.style.width=`${z}px`,x.current?F.style.transition="":(F.style.transition="none",x.current=!0)}else F.style.transform="translateX(0px)",F.style.width="0px"},[a]),L=I2((F,N)=>{typeof r>"u"&&P(F),g?.(F,o),v?.(F,N)},[r,o,g,v]),B=b1(()=>{if(!(typeof window>"u"))return new ResizeObserver(()=>{M()})},[M]);return Ed(()=>{typeof r<"u"&&r!==R&&P(r)},[r,R]),Ed(()=>{M(),A(),S.current&&S.current.slideTo(O,250)},[O,M,A]),Ed(()=>{const F=()=>{M(),A()};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}},[M,A]),Ed(()=>{i&&S.current&&(s?S.current.disable():S.current.enable())},[s,i]),Ed(()=>{if(B){const F=_.current;return F.forEach(N=>{N&&B.observe(N)}),()=>{F.forEach(N=>{N&&B.unobserve(N)})}}},[B]),te("div",{"data-slot":"tab-wrapper",className:ae(Hk({swipeContent:!!i}),t),style:m,children:[h("div",{"data-slot":"tab-nav",className:ae(Wk()),children:h("div",{"data-slot":"tab-nav-viewport",ref:y,className:ae(qk()),children:te("div",{"data-slot":"tab-nav-list",className:ae("relative flex w-full",Bfe({size:e})),children:[C.map((F,N)=>h(Rr,{...l,disabled:l.disabled||F.disabled||s,children:h(Uk,{ref:V=>{V&&(_.current[N]=V)},"data-slot":"tab-nav-item",className:ae(R===F.key&&"active",f),slider:!!a,selected:R===F.key,disabled:!!(s||F.disabled),role:"tab","aria-selected":R===F.key,onClick:V=>L(F.key,V),children:F.label})},F.key)),h("span",{ref:w,"data-slot":"tab-slider",className:ae(Ffe({visible:!!a})),style:{width:0}})]})})}),h("div",{"data-slot":"tab-content",children:$})]})};Kfe.displayName="RBTab";const{forwardRef:Xfe}=await q("react"),Yk=Xfe(({className:t="",size:e="md",selected:n=!1,disabled:r=!1,role:o,children:a,onClick:i,"aria-selected":s},l)=>h("button",{ref:l,type:"button",disabled:r,role:o,"aria-selected":s,className:ae(Vfe({size:e,selected:n,disabled:r}),t),onClick:i,children:a}));Yk.displayName="RBChipItem";const{useCallback:O2,useEffect:kd,useMemo:Rd,useRef:Td,useState:Zfe}=await q("react"),Qfe=Oh,Jfe=Ih,epe=({className:t="",size:e,tabItems:n,activeKey:r,name:o,slider:a,swipeContent:i,disabled:s,rippleOption:l={disabled:!0},tabNavScrollRef:u,destroyInactiveTabPanel:d=!0,tabBtnClassName:f,style:m,onClick:v,handleChange:g})=>{const w=Td(null),y=Td(null),_=Td([]),S=Td(null),x=Td(!1),C=Rd(()=>n?.filter(N=>!N?.isHide)??[],[n]),[R,P]=Zfe(r??C[0]?.key),O=Rd(()=>{const N=C.findIndex(V=>V.key===R);return N===-1?0:N},[R,C]),$=Rd(()=>C[O]?.children!=null,[O,C]),A=Rd(()=>C.length?i?h(Jfe,{autoHeight:!0,threshold:1,slidesPerView:1,enabled:!s,onSwiper:V=>{S.current=V},onSlideChange:()=>{const{swipeDirection:V}=S.current,{key:z,disabled:I}=C[S.current.activeIndex],{key:D}=C[S.current.activeIndex-1]??C[0],{key:U}=C[S.current.activeIndex+1]??C[S.current.activeIndex];I?(P(V==="next"?U:D),g?.(V==="next"?U:D,o)):(P(z),g?.(z,o))},children:C.map(V=>h(Qfe,{className:ae(cu({active:!0,swipeContent:!0,disabled:s||V.disabled})),style:{visibility:V.disabled?"hidden":"visible"},children:V.children},V.key))}):d?h("div",{children:h("div",{className:ae(cu(),{active:!0,disabled:s||C[O]?.disabled}),children:C[O]?.children})},`contents-${C[O]?.key}`):h("div",{children:C.map((N,V)=>h("div",{className:ae(cu(),{active:O===V,disabled:s||N.disabled}),children:N.children},`contents-${N.key}`))}):null,[O,d,s,g,o,i,C]),M=O2(()=>{const N=u?.current??y.current,V=_.current.find(z=>z&&z.classList.contains("active"))??_.current[0];if(V){const{offsetLeft:z,clientWidth:I}=V,D=z-N.offsetWidth/2+I/2;N.scrollTo({top:0,left:D,behavior:"smooth"})}},[u]),L=O2(()=>{const N=w.current;if(!a||!N)return;const V=_.current.find(z=>z&&z.classList.contains("active"))??_.current[0];if(V){const{offsetLeft:z,clientWidth:I}=V;N.style.transform=`translateX(${z}px)`,N.style.width=`${I}px`,x.current?N.style.transition="":(N.style.transition="none",x.current=!0)}else N.style.transform="translateX(0px)",N.style.width="0px"},[a]),B=O2((N,V)=>{typeof r>"u"&&P(N),g?.(N,o),v?.(N,V)},[r,o,g,v]),F=Rd(()=>{if(!(typeof window>"u"))return new ResizeObserver(()=>{L()})},[L]);return kd(()=>{typeof r<"u"&&r!==R&&P(r)},[r,R]),kd(()=>{L(),M(),S.current&&S.current.slideTo(O,250)},[O,L,M]),kd(()=>{const N=()=>{L(),M()};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}},[L,M]),kd(()=>{i&&S.current&&(s?S.current.disable():S.current.enable())},[s,i]),kd(()=>{if(F){const N=_.current;return N.forEach(V=>{V&&F.observe(V)}),()=>{N.forEach(V=>{V&&F.unobserve(V)})}}},[F]),te("div",{"data-slot":"chip-tab-wrapper",className:ae(Hk({swipeContent:!!i}),t),style:m,children:[h("div",{"data-slot":"chip-tab-nav",className:ae(Wk()),children:h("div",{"data-slot":"chip-tab-nav-viewport",ref:y,className:ae(qk()),children:h("div",{"data-slot":"chip-tab-nav-list",className:ae("relative flex",jfe({size:e})),children:C.map((N,V)=>h(Rr,{...l,disabled:l.disabled||N.disabled||s,children:h(Yk,{ref:z=>{z&&(_.current[V]=z)},"data-slot":"chip-tab-nav-item",className:ae(R===N.key&&"active",f),size:e,selected:R===N.key,disabled:!!(s||N.disabled),role:"tab","aria-selected":R===N.key,onClick:z=>B(N.key,z),children:N.label})},N.key))})})}),h("div",{"data-slot":"chip-tab-content",className:ae(f0({hasContent:$})),children:A})]})};epe.displayName="RBTab";const{forwardRef:tpe}=await q("react"),Gk=tpe(({className:t="",size:e="xs2",selected:n=!1,disabled:r=!1,role:o,children:a,onClick:i,"aria-selected":s,...l},u)=>h("button",{ref:u,type:"button",disabled:r,role:o,"aria-selected":s,"data-pad-focus":"true",className:ae(Wfe({size:e,selected:n,disabled:r}),t),onClick:i,...l,children:a}));Gk.displayName="RBChipsBoxItem";const{useCallback:y1,useEffect:_1,useMemo:L2,useRef:$2,useState:Yc}=await q("react"),npe=({className:t="",size:e="xs2",tabItems:n,activeKey:r,name:o,disabled:a=!1,destroyInactiveTabPanel:i=!0,rippleOption:s={disabled:!0},tabBtnClassName:l="",style:u,enableOverflowExpand:d=!0,showBottomBorder:f=!0,rightIconButtonProps:m,leftSlot:v,handleChange:g,onClick:w})=>{const[y,_]=Yc(!1),[S,x]=Yc(!1),[C,R]=Yc(0),P=$2(null),O=$2([]),$=$2(null),A=L2(()=>n?.filter(ne=>!ne?.isHide)??[],[n]),[M,L]=Yc(r??A[0]?.key),[B,F]=Yc(!1),[N,V]=Yc(!1),z=y1(()=>{const ne=P.current;if(!ne){x(!1),R(0);return}const ue=ne.scrollWidth>ne.clientWidth+1;x(ue),R(ue?ne.clientWidth/2:0)},[]),I=L2(()=>{const ne=A.findIndex(ue=>ue.key===M);return ne===-1?0:ne},[M,A]),D=y1(()=>{if(z(),y){F(!1),V(!1);return}const ne=P.current;if(!ne)return;if(!(ne.scrollWidth>ne.clientWidth+1)){F(!1),V(!1);return}const ve=Math.max(0,ne.scrollWidth-ne.clientWidth);F(ne.scrollLeft>1),V(ne.scrollLeft<ve-1)},[z,y]),U=y1(()=>{if(y)return;const ne=P.current,ue=O.current.find(Le=>Le&&Le.classList.contains("active"))??O.current[0];if(!ne||!ue)return;const{offsetLeft:ve,clientWidth:we}=ue,ye=ve-ne.offsetWidth/2+we/2;ne.scrollTo({top:0,left:ye,behavior:"smooth"})},[y]),Y=y1((ne,ue)=>{typeof r>"u"&&L(ne),g?.(ne,o),w?.(ne,ue)},[r,g,o,w]),oe=ne=>{_(ue=>!ue),m?.onClick?.(ne)};_1(()=>{typeof r<"u"&&r!==M&&L(r)},[r,M]),_1(()=>{U(),D()},[I,y,U,D]),_1(()=>{z();const ne=P.current;if(!ne)return;const ue=new ResizeObserver(()=>{z(),D(),U()});ue.observe(ne);const ve=()=>{z(),D(),U()};return window.addEventListener("resize",ve),()=>{ue.disconnect(),window.removeEventListener("resize",ve)}},[z,D,U,A]),_1(()=>{const ne=P.current;if(!ne||y)return;const ue=()=>{$.current!==null&&window.clearTimeout($.current),D(),$.current=window.setTimeout(()=>{D()},140)};return D(),ne.addEventListener("scroll",ue,{passive:!0}),()=>{ne.removeEventListener("scroll",ue),$.current!==null&&window.clearTimeout($.current)}},[y,D]);const Q=y?h(ow,{}):h(K0,{}),re=e==="xs2"?"h-11":"h-10",le=d&&(y||S),ee=L2(()=>A.length?i?h("div",{children:h("div",{className:ae("block",(a||A[I]?.disabled)&&"pointer-events-none opacity-50"),children:A[I]?.children})},`contents-${A[I]?.key}`):h("div",{children:A.map((ne,ue)=>h("div",{className:ae(I===ue?"block":"hidden"),children:ne.children},`contents-${ne.key}`))}):null,[I,i,a,A]);return te("div",{className:ae("block",t),style:u,children:[te("div",{className:ae("relative isolate",f&&"border-subtler border-b"),children:[v&&h("div",{className:"absolute top-0 bottom-0 left-0 z-[4] flex items-center pl-1",children:v}),h("div",{ref:P,className:ae("relative p-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",y?"overflow-x-visible overflow-y-visible pr-0":"overflow-x-auto overflow-y-hidden pr-10 whitespace-nowrap",v&&"pl-9"),children:te("div",{className:ae(Hfe({size:e}),"relative flex",y?"w-full flex-wrap content-start gap-y-1":"w-max min-w-full flex-nowrap"),children:[A.map((ne,ue)=>h(Rr,{...s,disabled:s.disabled||ne.disabled||a,children:h(Gk,{ref:ve=>{O.current[ue]=ve},className:ae(M===ne.key&&"active",l),size:e,selected:M===ne.key,disabled:!!(a||ne.disabled),role:"tab","aria-selected":M===ne.key,onClick:ve=>Y(ne.key,ve),children:ne.label})},ne.key)),h("div",{"aria-hidden":"true",className:y?"hidden":"inline-block",style:{width:`${C}px`,flexShrink:0}})]})}),!y&&te(Mr,{children:[h("div",{"aria-hidden":"true",className:ae("to-bg-default pointer-events-none absolute top-0 bottom-px -left-px z-[2] w-11 shrink-0 bg-gradient-to-l from-transparent to-[30%] transition-opacity duration-150",B?"opacity-100":"opacity-0")}),h("div",{"aria-hidden":"true",className:ae("from-bg-default pointer-events-none absolute top-0 -right-px bottom-px z-[3] w-11 shrink-0 bg-gradient-to-l from-[30%] to-transparent transition-opacity duration-150",N?"opacity-100":"opacity-0")})]}),le?te("div",{className:ae("pointer-events-none absolute top-0 right-0 z-[5] w-9",re,"from-bg-default bg-gradient-to-l from-[80%] to-transparent"),children:[y?null:h("div",{className:"bg-default absolute top-0 right-0 bottom-0 w-px"}),h("div",{className:ae("pointer-events-auto flex items-center justify-center",re),children:h(d8,{size:"3xs",variant:"circle",icon:Q,...m,onClick:oe})})]}):null]}),ee]})};npe.displayName="RBChipsBoxTab";const Kk=({className:t,borderClassName:e,pathClassName:n,size:r,style:o})=>te("svg",{className:ae("spinner","animate-spinner-rotate relative z-2 stroke-[5px]",t),viewBox:"0 0 50 50",width:r,height:r,stroke:"currentColor",style:o,children:[h("circle",{className:ae("stroke-linecap-round stroke-width-inherit stroke-inherit opacity-30",e),cx:"25",cy:"25",r:"20",fill:"none"}),h("circle",{className:ae("animate-spinner-path-dash infinite stroke-linecap-round stroke-width-inherit stroke-inherit ease-in-out",n),cx:"25",cy:"25",r:"20",fill:"none"})]}),rpe=he(["overflow-x-auto overflow-y-hidden min-[1280px]:overflow-hidden","[&::-webkit-scrollbar]:h-0 [&::-webkit-scrollbar]:w-0","[&_table]:w-full [&_table]:min-w-full [&_table]:border-collapse","[&_th]:relative [&_th]:h-9 [&_th]:border-b [&_th]:border-b-[var(--color-border-subtler)]","[&_th]:bg-fill-transparent [&_th]:px-2 [&_th]:py-0","[&_th]:text-fg-default [&_th]:text-left [&_th]:align-middle","[&_td]:relative [&_td]:min-h-7 [&_td]:border-b [&_td]:border-b-[var(--color-border-subtler)]","[&_td]:bg-fill-transparent [&_td]:py-1_5 [&_td]:px-2","[&_td]:typo-body-xs-normal [&_td]:text-fg-subtle [&_td]:align-middle","[&_tbody_tr]:relative [&_tbody_tr]:transition-all [&_tbody_tr]:duration-200","[&_[data-slot='ico-check']]:mr-0 [&_label]:p-0"].join(" "),{variants:{noData:{true:"overflow-hidden",false:""},loading:{true:"",false:""},stickyThead:{true:["[&_table]:border-separate [&_table]:border-spacing-0","[&_thead_tr]:sticky [&_thead_tr]:top-0 [&_thead_tr]:z-10","[&_th]:sticky [&_th]:top-0 [&_th]:z-10","[&_th]:bg-inherit [&_th]:bg-clip-padding","[&_th]:shadow-[inset_0_-1px_0_0_var(--color-border-subtler)]"].join(" "),false:""}},defaultVariants:{noData:!1,loading:!1,stickyThead:!1}}),ope=he("transition-colors duration-150",{variants:{sortable:{true:"hover:bg-fill-transparent-hovered cursor-pointer select-none",false:""},align:{left:"",center:"",right:""}},defaultVariants:{sortable:!1,align:"left"}}),ape=he("typo-compact-xs-semibold text-fg-default gap-0_5 inline-flex h-full w-full items-center bg-transparent",{variants:{align:{left:"justify-start text-left",center:"justify-center text-center",right:"justify-end text-right"}},defaultVariants:{align:"left"}}),ipe=he("text-fg-default inline-flex size-4 items-center justify-center bg-transparent [&>svg]:size-full"),spe=he("flex min-h-36 w-full items-center justify-center"),lpe=he("!border-b-0 !border-none !p-0"),cpe=he("!table-row"),upe=he("min-h-60 w-full max-w-[calc(100vw-2.5rem)] border-b-0"),dpe=he("",{variants:{expend:{true:"hover:bg-fill-transparent-hovered cursor-pointer",false:""},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{expend:!1,align:"left"}}),fpe=he("[&_.table-checkbox]:w-2.5"),ppe=he(""),hpe=he("!overflow-hidden !border-none !p-0"),mpe=he("!m-0 overflow-hidden !p-0 transition-[max-height] duration-200"),gpe=he("border-subtler py-2_5 border-b px-3"),{useCallback:vpe,useState:wpe}=await q("react"),Xk=({className:t="",children:e,align:n="left",fieldId:r,size:o="",colSpan:a,rowSpan:i,expend:s,expendOpen:l,handleExpendToggle:u,onClick:d})=>{const[f,m]=wpe(l),v=vpe(g=>{if(d?.(g),!!s)try{m(w=>!w)}catch(w){console.error(w)}finally{setTimeout(()=>{u?.(!f)},10)}},[s,f,d,u]);return h("td",{"data-slot":"table-cell",className:ae(dpe({expend:s,align:n}),r,s&&l&&"expend-open",t),colSpan:a,rowSpan:i,style:{width:o},onClick:v,children:h(Bf,{children:e})})};Xk.displayName="RBTdColumn";const{Children:Kv,Fragment:bpe,isValidElement:Zk,useMemo:D2,useState:d6}=await q("react"),Xv=t=>{let e=[];return Kv.forEach(t,n=>{if(Zk(n)){const r=n;r.type===bpe?e=[...e,...Xv(r.props.children)]:typeof n.type=="function"&&(n.type.name==="RBTdColumn"||n.type.displayName==="RBTdColumn")?e.push(n):e=[...e,...Xv(r.props.children)]}}),e},tbe=({className:t="",list:e,children:n,loadingElement:r=h(Kk,{className:"text-fg-default size-7",borderClassName:"text-fg-subtler opacity-100"}),errorFallback:o,noDataMsg:a,hideThead:i,stickyThead:s=!1,theadTopRows:l,sortUpElement:u=h(A8,{}),sortDownElement:d=h(I8,{}),sortNormalElement:f=h(b8,{}),loading:m})=>{const[v,g]=d6(!1),[w,y]=d6(null),_=D2(()=>{const R=(e||[]).length>0?e?.[0]:{};return Xv(n({item:R,index:0}))},[n,e]),S=D2(()=>{const R=_?.map(P=>{const O=P;return{className:O.props?.className??"",align:O.props?.align??"left",label:O.props?.label,fieldId:O.props?.fieldId,enableSorting:typeof O.props?.sortValue<"u"||!!O.props?.handleClickSort,handleClickSort:O.props?.handleClickSort,thColSpan:O.props?.thColSpan,thRowSpan:O.props?.thRowSpan,rowSpan:O.props?.rowSpan,colSpan:O.props?.colSpan,size:O.props?.size,order:O.props?.order??""}});return R?R.filter(P=>typeof P.label<"u").map(P=>w?.fieldId?{...P,order:w?.fieldId===P.fieldId?w?.order:""}:P):[]},[_,w]),x=D2(()=>{const{fieldId:R,order:P}=w??{};if(!P)return e;const $=e.map((A,M)=>Kv.map(n({item:A,index:M}),L=>{if(Zk(L)){const B=L;return B.type===Xk?L:Kv.toArray(B.props.children)}return[]})).reduce((A,M)=>{const L=M.find(B=>B.props.fieldId===R);return A.push(L.props?.sortValue??0),A},[]);return kn.orderBy(e.map((A,M)=>({...A,sortValue:$[M]})),["sortValue"],[P])},[e,w,n]),C=async R=>{let P="desc";const{order:O,index:$,fieldId:A,enableSorting:M,handleClickSort:L}=R;if(!M||v)return;O==="desc"?P="asc":O==="asc"&&(P="");const B={index:$,order:P,fieldId:A};if(y(B),L)try{g(!0),await L(B)}finally{g(!1)}};return h(Bf,{fallback:o,children:h("div",{"data-slot":"table-root",className:ae(rpe({noData:!!e&&e.length===0,loading:!e||v||m,stickyThead:s}),t),children:te("table",{"data-slot":"table",children:[!i&&te("thead",{"data-slot":"table-head",children:[l,h("tr",{"data-slot":"table-head-row",children:S.map((R,P)=>h("th",{"data-slot":"table-head-cell",className:ae(ope({sortable:R.enableSorting,align:R.align}),R.fieldId,R.className),rowSpan:R.thRowSpan??R.rowSpan,colSpan:R.thColSpan??R.colSpan,style:{width:R.size},onClick:()=>C({...R,index:P}),children:te("div",{"data-slot":"table-head-cell-content",className:ape({align:R.align}),children:[R.label,!!R.enableSorting&&te("span",{"data-slot":"table-head-cell-sort-icon",className:ipe(),children:[R.order!=="desc"&&R.order!=="asc"&&f,R.order==="desc"&&d,R.order==="asc"&&u]})]})},`th-${R.fieldId??P}`))})]}),te("tbody",{"data-slot":"table-body",children:[(!e||v||m)&&h("tr",{"data-slot":"table-loading-row",children:h("td",{"data-slot":"table-loading-cell",className:lpe(),colSpan:S.length,children:h("div",{"data-slot":"table-loading-content",className:spe(),children:r})})}),!!e&&!m&&!v&&(e.length>0?x.map((R,P)=>n({item:R,index:P})):h("tr",{"data-slot":"table-empty-row",className:cpe(),children:h("td",{"data-slot":"table-empty-cell",colSpan:S.length,children:typeof a=="object"?a:h(A3,{"data-slot":"table-empty-content",className:upe(),nullText:a})})}))]})]})})})},{useCallback:f6,useEffect:p6,useMemo:h6,useRef:ype,useState:_pe}=await q("react"),xpe=({className:t="",children:e,expendOpen:n=!1,handleExpendChange:r,beforeExpendOpen:o,onClick:a})=>{const i=ype(null),[s,l]=_pe(n),u=f6(v=>{if(i.current){const g=typeof v=="boolean"?v:!s,w=i.current.firstChild;w&&(w.style.maxHeight=g?`${w.scrollHeight}px`:"0px")}},[i,s]),d=f6(async()=>{try{o&&!s&&(await o(),await ok(10))}catch(v){console.error(v)}finally{l(!s),r?.(!s)}},[s,r,o]),f=h6(()=>{const v=w=>w.flatMap(y=>y?.props?y.type?.displayName==="RBTdColumn"?{...y,props:{...y.props,handleExpendToggle:d,expendOpen:s}}:Array.isArray(y.props.children)?v(y.props.children):[]:[]),g=Array.isArray(e)?e:[e];return v(g)},[e,s,d]),m=h6(()=>{const v=w=>w.flatMap(y=>{if(y?.props){if(y.type?.displayName==="RBTdExpend")return y;if(Array.isArray(y.props.children))return v(y.props.children)}}),g=Array.isArray(e)?e:[e];return v(g).filter(w=>w)[0]},[e]);return p6(()=>{u(s)},[s,u]),p6(()=>{typeof n<"u"&&l(n)},[n]),te(Mr,{children:[h("tr",{"data-slot":"table-row",className:ae(fpe(),t),onClick:a,children:f}),!!m&&h("tr",{"data-slot":"table-expand-row",className:ppe(),children:h("td",{"data-slot":"table-expand-cell",ref:i,className:hpe(),colSpan:f.length,children:m})})]})};xpe.displayName="RBTableRow";const Spe=({className:t="",children:e,style:n})=>h("div",{"data-slot":"table-expand-content",className:mpe(),children:h("div",{"data-slot":"table-expand-content-inner",className:ae(gpe(),t),style:n,children:e})});Spe.displayName="RBTdExpend";const Cpe=he("inline-flex items-center justify-center rounded-full",{variants:{type:{number:"typo-compact-2xs-semibold size-4 min-w-4 gap-1 overflow-hidden px-1",capsule:"typo-compact-2xs-semibold gap-1_5 px-1_5 py-0_5",soft:"typo-compact-2xs-semibold gap-1_5 px-1_5 py-0_5",transparent:"typo-compact-2xs-semibold gap-0_5 rounded-none p-0"}},defaultVariants:{type:"number"}}),Epe=he("",{variants:{variant:{solid:"bg-fill-default text-fg-inverse hover:bg-fill-default-hovered",soft:"bg-fill-subtler text-fg-default hover:bg-fill-subtler-hovered",outlined:"bg-fill-transparent text-fg-default outline-border-default hover:bg-fill-transparent-hovered outline outline-1 outline-offset-[-1px]",ghost:"bg-fill-transparent text-fg-default hover:bg-fill-transparent-hovered"}},defaultVariants:{variant:"solid"}}),Mpe=he("",{variants:{color:{red:"bg-fill-danger text-fg-inverse",orange:"bg-fg-warning text-fg-inverse",green:"bg-fill-success text-fg-inverse",blue:"bg-fill-information text-fg-inverse",purple:"bg-fill-debug text-fg-inverse",gray:"bg-fill-subtle text-fg-inverse","gray-subtle":"bg-fill-subtler text-fg-inverse"}},defaultVariants:{color:"red"}}),kpe=he("",{variants:{color:{red:"bg-fill-danger-subtlest text-fg-danger",orange:"bg-fill-caution-subtlest text-fg-caution",green:"bg-fill-success-subtlest text-fg-success",blue:"bg-fill-information-subtlest text-fg-information",purple:"bg-fill-debug-subtlest text-fg-debug",gray:"bg-fill-disabled text-fg-subtle","gray-subtle":"bg-fill-subtlest text-fg-subtler"}},defaultVariants:{color:"red"}}),Rpe=he("",{variants:{color:{red:"text-fg-danger bg-transparent",orange:"text-fg-warning bg-transparent",green:"text-fg-success bg-transparent",blue:"text-fg-information bg-transparent",purple:"text-fg-debug bg-transparent",gray:"text-fg-subtle bg-transparent","gray-subtle":"text-fg-subtler bg-transparent"}},defaultVariants:{color:"red"}});function nbe({className:t,type:e="number",numberVariant:n="solid",color:r="red",leadingIcon:o,children:a}){return h("span",{"data-slot":"badge",className:ae(Cpe({type:e}),{[Epe({variant:n})]:e==="number",[Mpe({color:r})]:e==="capsule",[kpe({color:r})]:e==="soft",[Rpe({color:r})]:e==="transparent"},t),children:e==="transparent"?te(Mr,{children:[o,h("span",{"data-slot":"badge-content",className:"relative top-px inline-flex items-center",children:a})]}):a})}const Tpe=he("inline-flex w-full flex-col items-start gap-7 overflow-hidden"),Npe=he("flex h-48 w-full flex-col items-center justify-center gap-3 overflow-hidden px-9 py-5"),Ppe=he("text-fg-subtle typo-body-xs2-normal w-full max-w-[600px] text-center"),Ape=he("text-fg-subtler inline-flex size-6 items-center justify-center [&_svg]:size-full");function m6({className:t,type:e="button",message:n="엠프티뷰의 안내 메세지를 입력해주세요.",description:r,buttonLabel:o="버튼 라벨",onButtonClick:a,icon:i}){const s=e==="button";return h("div",{"data-slot":"empty-view",className:ae(Tpe(),t),children:te("div",{"data-slot":"empty-view-section",className:Npe(),children:[!s&&h("i",{"data-slot":"empty-view-icon","aria-hidden":!0,className:Ape(),children:i??h(Z0,{})}),te("div",{children:[h("p",{"data-slot":"empty-view-message",className:Ppe(),children:n}),r&&h("p",{"data-slot":"empty-view-description",className:"text-fg-subtler typo-body-xs2-normal w-full max-w-150 text-center",children:r})]}),s&&h(Wr,{"data-slot":"empty-view-button",size:"sm",variant:"soft",onClick:a,children:o})]})})}const Ipe=he("relative z-[1] w-full",{variants:{disabled:{true:"[&_[data-slot=multi-range-range]]:bg-fill-default [&_[data-slot=text-input]]:bg-fill-control-surface-disabled [&_[data-slot=text-input]]:text-fg-disabled [&_[data-slot=text-input]]:outline-border-disabled [&_[data-slot=multi-range-text-field]]:text-fg-disabled [&_input[type='range']::-moz-range-thumb]:border-default [&_input[type='range']::-moz-range-thumb]:bg-default [&_input[type='range']::-webkit-slider-thumb]:border-default [&_input[type='range']::-webkit-slider-thumb]:bg-default opacity-30 [&_[data-slot=multi-range-slider]]:pointer-events-none [&_[data-slot=multi-range-slider]]:cursor-not-allowed [&_input[type='range']::-moz-range-thumb]:cursor-not-allowed [&_input[type='range']::-webkit-slider-thumb]:cursor-not-allowed",false:""}},defaultVariants:{disabled:!1}}),Ope=he("relative inline-flex w-full items-center justify-center"),Lpe=he("h-[var(--mri-slider-height)] w-[calc(100%_-_var(--mri-thumb-size))]"),g6=he("pointer-events-none absolute top-1/2 left-0 z-[3] h-[var(--mri-slider-height)] w-full -translate-y-1/2 appearance-none bg-transparent opacity-100"),$pe=he("relative z-[2] h-[var(--mri-slider-height)]"),Dpe=he("absolute inset-0 z-[1] rounded-full bg-[var(--mri-track-color,var(--color-fill-subtler))]"),Bpe=he("absolute top-0 bottom-0 z-[2] rounded-full bg-[var(--mri-range-color,var(--color-fill-brand))]"),zpe=he("flex w-full items-start justify-between pt-1"),v6=he("",{variants:{align:{left:"",right:"ml-auto text-right"}},defaultVariants:{align:"left"}}),w6=he("typo-compact-xs2-normal text-fg-default bg-fill-control-surface outline-border-default inline-block h-8 w-auto shrink-0 rounded-md px-2.5 text-center outline outline-1 outline-offset-[-1px] transition-colors"),b6="[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:h-[var(--mri-thumb-size)] [&::-webkit-slider-thumb]:w-[var(--mri-thumb-size)] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-[var(--mri-thumb-border-color,var(--color-fg-default))] [&::-webkit-slider-thumb]:bg-[var(--mri-thumb-color,var(--color-fg-default))] [&::-webkit-slider-thumb]:cursor-pointer [&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-[var(--mri-thumb-size)] [&::-moz-range-thumb]:w-[var(--mri-thumb-size)] [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-[var(--mri-thumb-border-color,var(--color-fg-default))] [&::-moz-range-thumb]:bg-[var(--mri-thumb-color,var(--color-fg-wte))] [&::-moz-range-thumb]:cursor-pointer",{forwardRef:Fpe,useCallback:x1,useEffect:y6,useImperativeHandle:Vpe,useMemo:B2,useRef:Nd,useState:jpe}=await q("react"),Hpe=Fpe((t,e)=>{const{className:n="",value:r,name:o,min:a,max:i,step:s=1,thumbSize:l=12,sliderHeight:u=4,thumbBorderColor:d,thumbColor:f,trackColor:m,rangeColor:v,showTextInput:g=!0,disabled:w=!1,handleChange:y,onChange:_}=t,S=Nd([a,i]),x=Nd(null),C=Nd(null),R=Nd(null),P=Nd(null),[O,$]=jpe([a,i]),A=B2(()=>O.map(I=>(I-a)/(i-a)*100),[O,a,i]),M=w||a===i,L=B2(()=>Wo(O[0]),[O]),B=B2(()=>Wo(O[1]),[O]),F=x1(()=>{!R.current||!P.current||(R.current.value=L,P.current.value=B)},[L,B]),N=x1(I=>{I.key==="Enter"&&!I.nativeEvent.isComposing&&(R.current.blur(),P.current.blur())},[]),V=x1((I,D,U=!1)=>{if(g&&(!R.current||!P.current))return;const{value:Y}=D.target;if(I==="left"){let oe=Math.min(Dl(Y),O[1]-s);oe=oe>a?oe:a,$([oe,O[1]]),U&&y?.([oe,O[1]],o),R.current.value=Wo(oe)}else{let oe=Math.max(Dl(Y),O[0]+s);oe=oe<=i?oe:i,$([O[0],oe]),U&&y?.([O[0],oe],o),P.current.value=Wo(oe)}_?.(D),F()},[_,g,F,y,o,O,s,a,i]),z=x1(()=>{O.some((I,D)=>I!==S.current[D])&&(S.current=[...O],y?.(O,o))},[O,o,y]);return y6(()=>{F()},[F]),y6(()=>{typeof r<"u"&&($(r),S.current=[...r])},[r]),Vpe(e,()=>({focus:x.current.focus})),te("div",{"data-slot":"multi-range-input",className:ae(Ipe({disabled:M}),n),style:{"--mri-thumb-size":`${l}px`,"--mri-slider-height":`${u}px`,"--mri-thumb-border-color":d,"--mri-thumb-color":f,"--mri-track-color":m,"--mri-range-color":v},children:[h("div",{className:Ope(),style:{height:"var(--mri-thumb-size)"},children:te("div",{className:Lpe(),children:[h("input",{ref:x,type:"range",value:O[0],min:a,max:i,step:s,disabled:M,className:ae(g6(),b6),onChange:I=>V("left",I),onMouseUp:z,onMouseLeave:z,onTouchEnd:z}),h("input",{ref:C,type:"range",value:O[1],min:a,max:i,step:s,disabled:M,className:ae(g6(),b6),onChange:I=>V("right",I),onMouseUp:z,onMouseLeave:z,onTouchEnd:z}),te("div",{"data-slot":"multi-range-slider",className:$pe(),children:[h("div",{"data-slot":"multi-range-track",className:Dpe()}),h("div",{"data-slot":"multi-range-range",className:Bpe(),style:{left:`${A[0]}%`,right:`${100-A[1]}%`}})]})]})}),g&&te("div",{"data-slot":"multi-range-text-wrap",className:zpe(),children:[h("div",{className:v6({align:"left"}),children:h("input",{"data-slot":"multi-range-text-field",ref:R,type:"text",inputMode:"numeric",defaultValue:O[0],size:Math.max(L.length,1),disabled:M,className:w6(),onBlur:I=>V("left",I,!0),onKeyDown:N})}),h("div",{className:v6({align:"right"}),children:h("input",{"data-slot":"multi-range-text-field",ref:P,type:"text",inputMode:"numeric",defaultValue:O[1],size:Math.max(B.length,1),disabled:M,className:w6(),onBlur:I=>V("right",I,!0),onKeyDown:N})})]})]})});Hpe.displayName="MultiRangeInput";const Wpe=he("relative touch-none rounded-full",{variants:{disabled:{false:"",true:"cursor-not-allowed [&>*]:pointer-events-none [&>*]:opacity-40"}},defaultVariants:{disabled:!1}}),qpe=he(["relative flex h-full cursor-grab items-center justify-center","will-change-[transform,opacity]","transition-opacity duration-150 ease-in-out"],{variants:{active:{false:"",true:"cursor-grabbing opacity-100"}},defaultVariants:{active:!1}}),Upe=he(["absolute top-0 left-0 z-[1] h-full w-full","will-change-transform [backface-visibility:hidden]"]),Ype=he("shadow-down-sm relative block h-full rounded-full bg-[var(--joy-stick-area-color,var(--color-fill-inverse))] opacity-40 transition-opacity duration-100",{variants:{active:{false:"",true:"opacity-100"}},defaultVariants:{active:!1}}),Gpe=he(["relative z-[2] h-10 w-10 rounded-full","border-disabled shadow-down-xs border","pointer-events-none touch-none","will-change-transform [backface-visibility:hidden]","transition-[scale,box-shadow] duration-200 ease-out"],{variants:{active:{false:"",true:"shadow-down-sm scale-110"}},defaultVariants:{active:!1}}),Kpe=he(["pointer-events-none absolute inset-0 rounded-full","[--joy-sweep:calc(30deg_+_var(--joy-ratio,0)_*_45deg)]","opacity-[var(--joy-ratio,0)] transition-opacity duration-100","bg-[conic-gradient(from_calc(var(--joy-angle,0deg)_-_var(--joy-sweep)_/_2),transparent_0deg,var(--joy-arc-color)_calc(var(--joy-sweep)_*_0.3),var(--joy-arc-color)_calc(var(--joy-sweep)_*_0.7),transparent_var(--joy-sweep))]","[mask:radial-gradient(closest-side,transparent_calc(100%_-_3px_-_var(--joy-ratio,0)_*_1px),#000_calc(100%_-_2px_-_var(--joy-ratio,0)_*_1px))]"]),Xpe=he("pointer-events-none absolute top-0 left-0 z-[2] h-full w-full touch-none"),S1=he(["absolute z-[1] inline-flex items-center justify-center","size-3.5 text-center","transition-[opacity,color] duration-150 ease-out","[&_svg]:inline-block [&_svg]:size-3.5 [&_svg]:align-middle"],{variants:{position:{top:"top-2 left-1/2 -translate-x-1/2",bottom:"bottom-2 left-1/2 -translate-x-1/2",left:"top-1/2 left-2 -translate-y-1/2",right:"top-1/2 right-2 -translate-y-1/2"},highlighted:{false:"text-fg-default opacity-70",true:"text-[var(--joy-arc-color)] opacity-100"}},defaultVariants:{highlighted:!1}}),Zpe=he("pointer-events-none absolute top-0 left-0 z-[2] h-full w-full touch-none"),_6=he(["absolute z-[1] inline-flex size-5 items-center justify-center","text-center transition-[opacity,color] duration-150 ease-out","[&_svg]:inline-block [&_svg]:size-5","[&_svg_path]:stroke-opacity-100"],{variants:{position:{top:"top-[5px] left-1/2 -translate-x-1/2",bottom:"bottom-[5px] left-1/2 -translate-x-1/2 [&_svg]:rotate-x-180 [&_svg]:rotate-y-180"},highlighted:{false:"text-fg-default opacity-40",true:"text-[var(--joy-arc-color)] opacity-100"}},defaultVariants:{highlighted:!1}}),{useRef:Pi,useCallback:Sl,useId:Qpe,useEffect:x6,useState:S6}=await q("react"),rbe=({className:t,type:e="direction",size:n=100,stickColor:r="radial-gradient(circle, #727272 0%, #3B3B3B 100%)",arcColor:o="var(--color-scale-zinc-100)",stickAreaColor:a="var(--color-fill-inverse)",throttleThreshold:i=.05,throttleDuration:s,xOnly:l=!1,yOnly:u=!1,disableDiagonal:d=!1,disabled:f=!1,keepMoveEventInterval:m,paddingSize:v=10,style:g,onStart:w,onMove:y,onEnd:_})=>{const S=Pi(null),x=Pi(null),C=Pi(null),R=Pi(null),P=Pi(null),O=Pi(null),$=Pi(null),A=Pi({x:0,y:0}),M=Pi({type:"none",startPosition:{x:0,y:0},normalizedDistance:{x:0,y:0},rotate:{radian:0,degree:0},distance:{x:0,y:0},direction:{x:"center",y:"center"},time:Date.now()}),L=Qpe().replace(/:/g,""),[B,F]=S6(!1),[N,V]=S6({x:"center",y:"center"}),z=({clientX:ee,clientY:ne})=>{if(!x.current)return;const{width:ue,top:ve,left:we}=x.current.getBoundingClientRect(),ye=ue/2,Le=ee-we-ye,Oe=ne-ve-ye;x.current.style.transform=`translate3d(${Le}px, ${Oe}px, 0px)`,S.current.style.transition=""},I=Sl(()=>{x.current&&(x.current.style.transform="translate3d(0px, 0px, 0px)",x.current.classList.remove("left","right","top","bottom","center"))},[]),D=Sl(({clientX:ee,clientY:ne})=>{if(!S.current||!C.current)return;const ve=C.current.offsetWidth/2,we={x:ee-M.current.startPosition.x,y:ne-M.current.startPosition.y};d?Math.abs(we.x)>Math.abs(we.y)?we.y=0:Math.abs(we.x)<Math.abs(we.y)?we.x=0:(we.x=0,we.y=0):l?we.y=0:u&&(we.x=0);const ye=Math.hypot(we.x,we.y);if(ye>ve){const Ue=ve/ye;we.x*=Ue,we.y*=Ue}const Le={x:Math.abs(we.x)>3?we.x>0?"right":"left":"center",y:Math.abs(we.y)>3?we.y>0?"bottom":"top":"center"},Oe=Math.atan2(we.x,-we.y);let Ne=Oe*180/Math.PI;Ne<0&&(Ne+=360);const me={radian:Oe,degree:Ne},pe={x:we.x/ve,y:-we.y/ve},be=Math.hypot(pe.x-A.current.x,pe.y-A.current.y);return{direction:Le,distance:we,normalizedDistance:pe,movementRatio:be,rotate:me}},[d,l,u]),U=Sl(({clientX:ee,clientY:ne})=>{if(!S.current||!C.current)return;const{direction:ue,distance:ve,rotate:we,normalizedDistance:ye,movementRatio:Le}=D({clientX:ee,clientY:ne});S.current.style.transform=`translate3d(${ve.x}px, ${ve.y}px, 0px)`,C.current.style.setProperty("--joy-angle",`${we.degree}deg`);const Oe=Math.hypot(ye.x,ye.y);return C.current.style.setProperty("--joy-ratio",`${Oe}`),x.current.classList.remove("left","right","top","bottom","center"),x.current.classList.add(ue.x,ue.y),V(ue),{direction:ue,distance:{x:ve.x,y:-ve.y},rotate:we,normalizedDistance:ye,movementRatio:Le}},[D]),Y=Sl(()=>{S.current&&(S.current.style.transition="transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1)",C.current?.style.setProperty("--joy-ratio","0"),S.current.style.transform="translate3d(0px, 0px, 0px)")},[]),oe=Sl(()=>{const ne=Date.now()-M.current.time;if(!$.current||["none","end"].includes(M.current.type)||ne<s)return;const ue=$.current;ue.preventDefault(),ue.stopPropagation();const{clientX:ve,clientY:we}=ue,{distance:ye,direction:Le,rotate:Oe,normalizedDistance:Ne,movementRatio:me}=U({clientX:ve,clientY:we});M.current={...M.current,type:"move",rotate:Oe,distance:ye,normalizedDistance:Ne,direction:Le,time:Date.now()};const pe={...M.current,event:ue,targets:{joystick:x.current,stickArea:C.current,stick:S.current}};me>=i&&(A.current=Ne,y?.(pe)),m&&(window.clearInterval(P.current),P.current=window.setInterval(()=>{M.current.type==="move"&&y?.(pe)},m))},[i,s,y,U,m]),Q=Sl(ee=>{window.clearInterval(P.current),!["none","end"].includes(M.current.type)&&(ee.target instanceof Element&&ee.target.releasePointerCapture?.(ee.pointerId),ee.preventDefault(),ee.stopPropagation(),M.current.type="end",setTimeout(()=>{M.current.type="none"},100),I(),Y(),F(!1),V({x:"center",y:"center"}),x.current.classList.remove("active"),window.clearInterval(P.current),$.current=null,_?.({type:"end",...M.current,direction:{x:"center",y:"center"},normalizedDistance:{x:0,y:0},rotate:{degree:0,radian:0},distance:{x:0,y:0},event:ee,targets:{joystick:x.current,stickArea:C.current,stick:S.current}}))},[_,I,Y]),re=ee=>{if(ee.button===2||f||["start","move","end"].includes(M.current.type))return;R.current=`${L}-${ee.pointerId}`,ee.currentTarget.setPointerCapture(ee.pointerId),ee.stopPropagation(),ee.preventDefault();const{clientX:ne,clientY:ue}=ee;M.current.type="start",M.current.startPosition={x:ne,y:ue},F(!0),V({x:"center",y:"center"}),x.current.classList.add("active"),z({clientX:ne,clientY:ue}),w?.({...M.current,event:ee,targets:{joystick:x.current,stickArea:C.current,stick:S.current},distance:{x:0,y:0},normalizedDistance:{x:0,y:0},rotate:{radian:0,degree:0},startPosition:{x:ne,y:ue},direction:{x:"center",y:"center"}})},le=Sl(ee=>{$.current=ee.nativeEvent,R.current===`${L}-${ee.pointerId}`&&(O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(oe))},[oe,L]);return x6(()=>{const ee=ne=>{Q(ne)};return window.addEventListener("pointerup",ee),()=>{window.removeEventListener("pointerup",ee)}},[L,Q]),x6(()=>{const ee=P.current;return()=>{window.clearInterval(ee)}},[]),h("div",{"data-slot":"joy-stick",className:ae(Wpe({disabled:f}),t),style:{...g,width:`${n+v*2}px`,height:`${n+v*2}px`,"--joy-stick-color":r,"--joy-stick-area-color":a,"--joy-arc-color":o},onContextMenu:ee=>ee.preventDefault(),children:te("div",{"data-slot":"joy-stick-inner",ref:x,className:qpe({active:B}),style:{padding:v},children:[h("div",{"data-slot":"joy-stick-stick-area",ref:C,className:Upe(),style:{padding:v},onPointerDownCapture:re,onPointerUpCapture:Q,onPointerMove:le,children:te("span",{"data-slot":"joy-stick-stick-area-inner",className:Ype({active:B}),style:{"--joy-stick-area-color":a},children:[h("span",{"data-slot":"joy-stick-arc",className:Kpe()}),e==="direction"&&te("div",{className:Xpe(),children:[h("span",{className:S1({position:"top",highlighted:B&&N.y==="top"}),children:h(y8,{})}),h("span",{className:S1({position:"bottom",highlighted:B&&N.y==="bottom"}),children:h(g8,{})}),h("span",{className:S1({position:"left",highlighted:B&&N.x==="left"}),children:h(v8,{})}),h("span",{className:S1({position:"right",highlighted:B&&N.x==="right"}),children:h(w8,{})})]}),e==="curved"&&te("div",{className:Zpe(),children:[h("span",{className:_6({position:"top",highlighted:B&&N.y==="top"}),children:h(G2,{})}),h("span",{className:_6({position:"bottom",highlighted:B&&N.y==="bottom"}),children:h(G2,{})})]})]})}),h("div",{"data-slot":"joy-stick-stick",ref:S,className:Gpe({active:B}),style:{background:"var(--joy-stick-color)"}})]})})},Jpe=he("pointer-events-none"),e1e=he("absolute z-[9] w-full rounded-md"),t1e=he("pointer-events-none absolute z-[99] overflow-hidden",{variants:{hidden:{false:"",true:"hidden"}},defaultVariants:{hidden:!1}}),n1e=he("block"),r1e=he(["block size-2.5","fill-bg-tooltip"]),o1e=he("absolute z-[9999]"),a1e=he("relative"),i1e=he(["inline-flex items-center justify-center overflow-hidden","bg-tooltip max-w-60 rounded-md px-3 py-2"]),s1e=he(["text-fg-inverse flex-1","typo-body-xs2-normal","break-words whitespace-normal"]),{useCallback:ys,useEffect:z2,useMemo:C6,useRef:Gc,useState:F2}=await q("react"),l1e=t=>new Promise(e=>setTimeout(e,t)),obe=({className:t="",anchorId:e,width:n=200,space:r=0,place:o="bottom",events:a=["hover"],arrowPosition:i=0,hideArrow:s,tooltipPosition:l,tooltipColor:u,tooltipTextColor:d,tooltipBoxShadow:f,tooltipBorderRadius:m,open:v,whenWindowScrollClose:g,children:w})=>{const y=Gc(null),_=Gc(null),S=Gc(null),x=Gc(null),C=Gc(0),R=Gc(!1),[P,O]=F2(!1),[$,A]=F2(o),[M,L]=F2(!!v),B=C6(()=>{const Q=[...a],re=Q.findIndex(le=>le==="hover");return re!==-1&&!xo.isMobile&&Q.splice(re,0,"mouseover","mouseout"),Q},[a]),F=ys(()=>{if(_.current)return _.current;const Q=document.querySelector(`#${e}`);Q&&(_.current=Q)},[e]),N=ys((Q,re)=>{if(!_.current)return;const{scrollY:le,innerHeight:ee}=window,ne=le,ue=le+ee,{top:ve}=_.current.getBoundingClientRect();return ne>Q&&ve>0?Q+ve:ue<Q+re?ue-re-10:Q},[]),V=ys((Q,re)=>{const{scrollX:le,innerWidth:ee}=window,ne=le,ue=le+ee;return ne>Q?ne+r:ue<Q+re?ue-re-r:Q},[r]),z=ys(Q=>{const{targetTop:re,targetLeft:le,targetWidth:ee,targetHeight:ne,tooltipHeight:ue,arrowWidth:ve,arrowHeight:we}=Q;return scrollY+re-ue-we-r<scrollY&&o==="top"?"bottom":scrollY+re+ne+we+r>scrollY+innerHeight&&o==="bottom"?"top":le-ve-r<100&&o==="left"?"right":innerWidth-(scrollX+le+ee+ve+r+10)<100&&o==="right"?"left":le+scrollX<scrollX?"right":o},[o,r]),I=ys(()=>{if(!y.current||!_.current)return{targetTop:0,targetLeft:0,targetWidth:0,targetHeight:0,arrowWidth:0,arrowHeight:0,tooltipWidth:0,tooltipHeight:0,scrollX:0,scrollY:0,innerWidth:0,innerHeight:0};const{top:Q,left:re,height:le,width:ee}=_.current.getBoundingClientRect(),{offsetHeight:ne,offsetWidth:ue}=y.current,{clientWidth:ve=0,clientHeight:we=0}=S.current??{},{scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne}=window,{position:me,top:pe,left:be}=document.body.style,Ue=me==="fixed"?Number(pe.replace("px",""))*-1:0,He=me==="fixed"?Number(be.replace("px",""))*-1:0;return{targetTop:Q,targetLeft:re,targetWidth:ee,targetHeight:le,arrowWidth:ve,arrowHeight:we,tooltipWidth:ue,tooltipHeight:ne,scrollX:He||ye,scrollY:Ue||Le,innerWidth:Oe,innerHeight:Ne}},[]),D=ys(async()=>{if(!_.current||!y.current)return;const{targetTop:Q,targetLeft:re,targetWidth:le,targetHeight:ee,arrowWidth:ne,arrowHeight:ue,tooltipWidth:ve,tooltipHeight:we,scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne}=I(),{top:me=0,left:pe=0}=l??{},be=i||0,Ue=s?Math.max(r,8):r,He=z({targetTop:Q,targetLeft:re,targetWidth:le,targetHeight:ee,arrowWidth:ne,arrowHeight:ue,tooltipWidth:ve,tooltipHeight:we,scrollX:ye,scrollY:Le,innerWidth:Oe,innerHeight:Ne});A(He);let qe="",_e="",at="";switch(He){case"top":qe+=`
|
|
272
272
|
top: ${me+Le+Q-we-ue-Ue}px;
|
|
273
273
|
left: ${V(pe+ye+re+le/2-ve/2,ve)}px;
|
|
274
274
|
`,_e+=`
|