@matthiaskrijgsman/mat-ui 0.0.21 → 0.0.22

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.
@@ -179,5 +179,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
179
179
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hc(e,t){if(e){if(typeof e=="string")return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(e,t)}}function Br(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Ng(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i=[],r=!0,o=!1,s,a;try{for(n=n.call(e);!(r=(s=n.next()).done)&&(i.push(s.value),!(t&&i.length===t));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&n.return!=null&&n.return()}finally{if(o)throw a}}return i}}function Fg(e){if(Array.isArray(e))return e}function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gc(Object(n),!0).forEach(function(i){$r(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function $r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $n(e,t){if(e==null)return{};var n=Vg(e,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)i=o[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Vg(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Wr=S.forwardRef(function(e,t){var n=e.children,i=$n(e,Cg),r=qr(i),o=r.open,s=$n(r,Pg);return S.useImperativeHandle(t,function(){return{open:o}},[o]),S.createElement(S.Fragment,null,n(oe(oe({},s),{},{open:o})))});Wr.displayName="Dropzone";var vc={disabled:!1,getFilesFromEvent:Yh,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Wr.defaultProps=vc,Wr.propTypes={children:re.func,accept:re.objectOf(re.arrayOf(re.string)),multiple:re.bool,preventDropOnDocument:re.bool,noClick:re.bool,noKeyboard:re.bool,noDrag:re.bool,noDragEventsBubbling:re.bool,minSize:re.number,maxSize:re.number,maxFiles:re.number,disabled:re.bool,getFilesFromEvent:re.func,onFileDialogCancel:re.func,onFileDialogOpen:re.func,useFsAccessApi:re.bool,autoFocus:re.bool,onDragEnter:re.func,onDragLeave:re.func,onDragOver:re.func,onDrop:re.func,onDropAccepted:re.func,onDropRejected:re.func,onError:re.func,validator:re.func};var Ur={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function qr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=oe(oe({},vc),e),n=t.accept,i=t.disabled,r=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,c=t.onDragLeave,d=t.onDragOver,f=t.onDrop,m=t.onDropAccepted,v=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,h=t.useFsAccessApi,T=t.autoFocus,b=t.preventDropOnDocument,k=t.noClick,y=t.noKeyboard,P=t.noDrag,j=t.noDragEventsBubbling,A=t.onError,M=t.validator,U=S.useMemo(function(){return kg(n)},[n]),F=S.useMemo(function(){return Sg(n)},[n]),Q=S.useMemo(function(){return typeof w=="function"?w:xc},[w]),G=S.useMemo(function(){return typeof x=="function"?x:xc},[x]),N=S.useRef(null),ee=S.useRef(null),ie=S.useReducer(Lg,Ur),X=zr(ie,2),q=X[0],Z=X[1],g=q.isFocused,E=q.isFileDialogActive,O=S.useRef(typeof window<"u"&&window.isSecureContext&&h&&Tg()),V=function(){!O.current&&E&&setTimeout(function(){if(ee.current){var $=ee.current.files;$.length||(Z({type:"closeDialog"}),G())}},300)};S.useEffect(function(){return window.addEventListener("focus",V,!1),function(){window.removeEventListener("focus",V,!1)}},[ee,E,G,O]);var L=S.useRef([]),z=S.useRef([]),K=function($){N.current&&N.current.contains($.target)||($.preventDefault(),L.current=[])};S.useEffect(function(){return b&&(document.addEventListener("dragover",dc,!1),document.addEventListener("drop",K,!1)),function(){b&&(document.removeEventListener("dragover",dc),document.removeEventListener("drop",K))}},[N,b]),S.useEffect(function(){var R=function(ze){z.current=[].concat(mc(z.current),[ze.target]),cn(ze)&&Z({isDragGlobal:!0,type:"setDragGlobal"})},$=function(ze){z.current=z.current.filter(function(qe){return qe!==ze.target&&qe!==null}),!(z.current.length>0)&&Z({isDragGlobal:!1,type:"setDragGlobal"})},ce=function(){z.current=[],Z({isDragGlobal:!1,type:"setDragGlobal"})},me=function(){z.current=[],Z({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",R,!1),document.addEventListener("dragleave",$,!1),document.addEventListener("dragend",ce,!1),document.addEventListener("drop",me,!1),function(){document.removeEventListener("dragenter",R),document.removeEventListener("dragleave",$),document.removeEventListener("dragend",ce),document.removeEventListener("drop",me)}},[N]),S.useEffect(function(){return!i&&T&&N.current&&N.current.focus(),function(){}},[N,T,i]);var B=S.useCallback(function(R){A?A(R):console.error(R)},[A]),_=S.useCallback(function(R){R.preventDefault(),R.persist(),ni(R),L.current=[].concat(mc(L.current),[R.target]),cn(R)&&Promise.resolve(r(R)).then(function($){if(!(Bn(R)&&!j)){var ce=$.length,me=ce>0&&xg({files:$,accept:U,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:M}),xe=ce>0&&!me;Z({isDragAccept:me,isDragReject:xe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(R)}}).catch(function($){return B($)})},[r,u,B,j,U,s,o,a,l,M]),H=S.useCallback(function(R){R.preventDefault(),R.persist(),ni(R);var $=cn(R);if($&&R.dataTransfer)try{R.dataTransfer.dropEffect="copy"}catch{}return $&&d&&d(R),!1},[d,j]),J=S.useCallback(function(R){R.preventDefault(),R.persist(),ni(R);var $=L.current.filter(function(me){return N.current&&N.current.contains(me)}),ce=$.indexOf(R.target);ce!==-1&&$.splice(ce,1),L.current=$,!($.length>0)&&(Z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),cn(R)&&c&&c(R))},[N,c,j]),de=S.useCallback(function(R,$){var ce=[],me=[];R.forEach(function(xe){var ze=cc(xe,U),qe=zr(ze,2),fo=qe[0],mo=qe[1],ho=uc(xe,s,o),ii=zr(ho,2),go=ii[0],vo=ii[1],xo=M?M(xe):null;if(fo&&go&&!xo)ce.push(xe);else{var yo=[mo,vo];xo&&(yo=yo.concat(xo)),me.push({file:xe,errors:yo.filter(function(ey){return ey})})}}),(!a&&ce.length>1||a&&l>=1&&ce.length>l)&&(ce.forEach(function(xe){me.push({file:xe,errors:[gg]})}),ce.splice(0)),Z({acceptedFiles:ce,fileRejections:me,type:"setFiles"}),f&&f(ce,me,$),me.length>0&&v&&v(me,$),ce.length>0&&m&&m(ce,$)},[Z,a,U,s,o,l,f,m,v,M]),D=S.useCallback(function(R){R.preventDefault(),R.persist(),ni(R),L.current=[],cn(R)&&Promise.resolve(r(R)).then(function($){Bn(R)&&!j||de($,R)}).catch(function($){return B($)}),Z({type:"reset"})},[r,de,B,j]),ve=S.useCallback(function(){if(O.current){Z({type:"openDialog"}),Q();var R={multiple:a,types:F};window.showOpenFilePicker(R).then(function($){return r($)}).then(function($){de($,null),Z({type:"closeDialog"})}).catch(function($){Eg($)?(G($),Z({type:"closeDialog"})):jg($)?(O.current=!1,ee.current?(ee.current.value=null,ee.current.click()):B(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):B($)});return}ee.current&&(Z({type:"openDialog"}),Q(),ee.current.value=null,ee.current.click())},[Z,Q,G,h,de,B,F,a]),ht=S.useCallback(function(R){!N.current||!N.current.isEqualNode(R.target)||(R.key===" "||R.key==="Enter"||R.keyCode===32||R.keyCode===13)&&(R.preventDefault(),ve())},[N,ve]),gn=S.useCallback(function(){Z({type:"focus"})},[]),lu=S.useCallback(function(){Z({type:"blur"})},[]),cu=S.useCallback(function(){k||(wg()?setTimeout(ve,0):ve())},[k,ve]),zt=function($){return i?null:$},po=function($){return y?null:zt($)},ti=function($){return P?null:zt($)},ni=function($){j&&$.stopPropagation()},Zx=S.useMemo(function(){return function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=R.refKey,ce=$===void 0?"ref":$,me=R.role,xe=R.onKeyDown,ze=R.onFocus,qe=R.onBlur,fo=R.onClick,mo=R.onDragEnter,ho=R.onDragOver,ii=R.onDragLeave,go=R.onDrop,vo=$n(R,Ag);return oe(oe($r({onKeyDown:po(Fe(xe,ht)),onFocus:po(Fe(ze,gn)),onBlur:po(Fe(qe,lu)),onClick:zt(Fe(fo,cu)),onDragEnter:ti(Fe(mo,_)),onDragOver:ti(Fe(ho,H)),onDragLeave:ti(Fe(ii,J)),onDrop:ti(Fe(go,D)),role:typeof me=="string"&&me!==""?me:"presentation"},ce,N),!i&&!y?{tabIndex:0}:{}),vo)}},[N,ht,gn,lu,cu,_,H,J,D,y,P,i]),Jx=S.useCallback(function(R){R.stopPropagation()},[]),Qx=S.useMemo(function(){return function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=R.refKey,ce=$===void 0?"ref":$,me=R.onChange,xe=R.onClick,ze=$n(R,Dg),qe=$r({accept:U,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:zt(Fe(me,D)),onClick:zt(Fe(xe,Jx)),tabIndex:-1},ce,ee);return oe(oe({},qe),ze)}},[ee,n,a,D,i]);return oe(oe({},q),{},{isFocused:g&&!i,getRootProps:Zx,getInputProps:Qx,rootRef:N,inputRef:ee,open:zt(ve)})}function Lg(e,t){switch(t.type){case"focus":return oe(oe({},e),{},{isFocused:!0});case"blur":return oe(oe({},e),{},{isFocused:!1});case"openDialog":return oe(oe({},Ur),{},{isFileDialogActive:!0});case"closeDialog":return oe(oe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return oe(oe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return oe(oe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:!1});case"setDragGlobal":return oe(oe({},e),{},{isDragGlobal:t.isDragGlobal});case"reset":return oe({},Ur);default:return e}}function xc(){}const _g={sm:"h-7",md:"h-8",lg:"h-10"},zg={sm:"px-2.5",md:"px-3",lg:"px-4"},Bg={sm:"text-xs",md:"text-sm",lg:"text-sm"},$g=e=>{const{label:t,description:n,error:i,placeholder:r="No file chosen",buttonText:o="Choose",Icon:s=Th,size:a="md",value:l,isUploaded:u=!1,isUploading:c=!1,onChange:d,onDropRejected:f,accept:m,maxSize:v,minSize:x,disabled:w=!1,className:h}=e,T=async M=>{const[U]=M;U&&await d?.(U)},{getRootProps:b,getInputProps:k,open:y,isDragActive:P,isFocused:j}=qr({multiple:!1,accept:m,maxSize:v,minSize:x,disabled:w,onDrop:T,onDropRejected:f}),A=l?.name;return p.jsx(Je.Provider,{value:a,children:p.jsxs("div",{className:I("flex flex-col",h),children:[p.jsx(We,{children:t}),p.jsxs("div",{...b({className:I("flex flex-row items-center","border input-base rounded-xl shadow-sm transition-all duration-150","ring-0 focus:outline-none",(j||P)&&"ring-4",i&&"input-error",w&&"opacity-60 cursor-not-allowed",lt[a],ct[a],"gap-3")}),children:[p.jsx("input",{...k()}),p.jsx(s,{className:I("input-icon shrink-0",Ot[a])}),p.jsx("span",{className:I("flex-1 truncate",Xe[a],!A&&"text-[var(--color-input-placeholder)]"),children:A??r}),i&&p.jsx(Ze,{}),c&&!i&&p.jsx("div",{className:"h-5 w-5 flex items-center justify-center",children:p.jsx(Dt,{className:"h-4 w-4 text-[var(--color-input-icon)]"})}),u&&!c&&!i&&p.jsx("div",{className:"h-5 w-5",children:p.jsx(jr,{className:"h-5 w-5 text-[var(--color-status-success)]"})}),p.jsx("button",{type:"button",disabled:w,onClick:M=>{M.stopPropagation(),y()},className:I("inline-flex flex-row items-center justify-center shrink-0","border button-white shadow-sm rounded-[calc(var(--border-radius-input)-0.25rem)]","font-semibold cursor-pointer select-none transition-all duration-150","button-ring ring-0 hover:ring-4 active:ring-1 focus:outline-none focus:ring-4","disabled:cursor-default","mr-1.5",_g[a],zg[a],Bg[a]),children:o})]}),p.jsx(Ae,{children:n}),p.jsx(De,{children:i})]})})},Wg=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`,yc=e=>{const{file:t,isUploaded:n=!1,isUploading:i=!1,error:r,onRemove:o,className:s}=e,a=i||n||!!r;return p.jsxs("div",{className:I("flex flex-row items-center gap-3","border input-base rounded-xl shadow-sm","pl-4 pr-1 py-1",r&&"input-error",s),children:[a&&p.jsx("div",{className:"shrink-0 h-5 w-5 flex items-center justify-center",children:r?p.jsx(Cr,{className:"h-5 w-5 input-error-icon"}):i?p.jsx(Dt,{className:"h-4 w-4 text-[var(--color-input-icon)]"}):p.jsx(jr,{className:"h-5 w-5 text-[var(--color-status-success)]"})}),p.jsx("div",{className:"flex-1 min-w-0 font-medium truncate",children:t.name}),p.jsx("div",{className:"shrink-0 text-sm text-[var(--color-input-description-text)]",children:Wg(t.size)}),o&&p.jsx(Fn,{variant:"transparent",size:"sm",Icon:ut,onClick:o,"aria-label":"Remove file",className:"shrink-0"})]})},Ug=e=>{const{label:t,description:n,error:i,title:r="Drop files here",hint:o,Icon:s=yh,onUpload:a,onFileRemoved:l,onDropRejected:u,renderFileTile:c,accept:d,maxSize:f,minSize:m,maxFiles:v,disabled:x=!1,className:w}=e,[h,T]=S.useState([]),b=S.useRef(0),k=(F,Q)=>{T(G=>G.map(N=>N.id===F?{...N,...Q}:N))},y=F=>{if(F.length===0)return;const Q=F.map(G=>({id:String(++b.current),file:G,status:a?"uploading":"idle"}));if(T(G=>[...G,...Q]),!!a)for(const G of Q)Promise.resolve().then(()=>a(G.file)).then(()=>k(G.id,{status:"uploaded"})).catch(N=>{k(G.id,{status:"error",error:N instanceof Error?N:new Error(String(N))})})},P=F=>{const Q=h.find(G=>G.id===F);T(G=>G.filter(N=>N.id!==F)),Q&&l?.(Q.file)},{getRootProps:j,getInputProps:A,isDragActive:M,isFocused:U}=qr({multiple:!0,accept:d,maxSize:f,minSize:m,maxFiles:v,disabled:x,onDrop:y,onDropRejected:u});return p.jsxs("div",{className:I("flex flex-col",w),children:[p.jsx(We,{children:t}),p.jsxs("div",{...j({className:I("flex flex-col items-center justify-center gap-1","border-2 border-dashed input-base rounded-xl bg-transparent!","py-10 px-6 cursor-pointer transition-all duration-150","ring-0 focus:outline-none",(U||M)&&"ring-4",i&&"input-error",x&&"opacity-60 cursor-not-allowed")}),children:[p.jsx("input",{...A()}),p.jsx("div",{className:"h-14 w-14 rounded-xl flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2",children:p.jsx(s,{className:"h-7 w-7 input-icon"})}),p.jsx("div",{className:"text-base font-semibold",children:r}),o&&p.jsx("div",{className:"text-sm text-[var(--color-input-description-text)] ",children:o})]}),h.length>0&&p.jsx("div",{className:"flex flex-col gap-2 mt-3",children:h.map(F=>{const Q={file:F.file,isUploading:F.status==="uploading",isUploaded:F.status==="uploaded",error:F.status==="error"?F.error?.message:void 0,onRemove:()=>P(F.id)};return p.jsx(C.Fragment,{children:c?c(F.file,Q):p.jsx(yc,{...Q})},F.id)})}),p.jsx(Ae,{children:n}),p.jsx(De,{children:i})]})},qg=e=>{const{className:t,label:n,description:i,options:r,error:o,size:s="md",...a}=e;return p.jsx(Je.Provider,{value:s,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",children:[p.jsx("select",{className:I("appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",lt[s],Xe[s],ct[s],Rt[s]),...a,children:r&&r.map((l,u)=>p.jsx("option",{value:l.value,disabled:l.disabled,children:l.label},u))}),p.jsxs(dt,{children:[o&&p.jsx(Ze,{}),p.jsx(Ue,{Icon:an})]})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:o})]})})},un=e=>{const{children:t,onClick:n,selected:i,disabled:r=!1}=e;return p.jsxs("div",{onClick:()=>!r&&n&&n(),className:I("option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",i&&!r&&"option-selected",r&&"option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent"),children:[p.jsx("div",{className:"flex-1",children:t}),i&&!r&&p.jsx("div",{className:"shrink-0",children:p.jsx(gh,{className:"h-5 w-5"})})]})};function Wn(){return typeof window<"u"}function It(e){return Kr(e)?(e.nodeName||"").toLowerCase():"#document"}function Se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ve(e){var t;return(t=(Kr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kr(e){return Wn()?e instanceof Node||e instanceof Se(e).Node:!1}function ye(e){return Wn()?e instanceof Element||e instanceof Se(e).Element:!1}function Le(e){return Wn()?e instanceof HTMLElement||e instanceof Se(e).HTMLElement:!1}function Yr(e){return!Wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Se(e).ShadowRoot}const Kg=new Set(["inline","contents"]);function dn(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=Me(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!Kg.has(r)}const Yg=new Set(["table","td","th"]);function Hg(e){return Yg.has(It(e))}const Gg=[":popover-open",":modal"];function Un(e){return Gg.some(t=>{try{return e.matches(t)}catch{return!1}})}const Xg=["transform","translate","scale","rotate","perspective"],Zg=["transform","translate","scale","rotate","perspective","filter"],Jg=["paint","layout","strict","content"];function Hr(e){const t=Gr(),n=ye(e)?Me(e):e;return Xg.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Zg.some(i=>(n.willChange||"").includes(i))||Jg.some(i=>(n.contain||"").includes(i))}function Qg(e){let t=Qe(e);for(;Le(t)&&!Nt(t);){if(Hr(t))return t;if(Un(t))return null;t=Qe(t)}return null}function Gr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ev=new Set(["html","body","#document"]);function Nt(e){return ev.has(It(e))}function Me(e){return Se(e).getComputedStyle(e)}function qn(e){return ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qe(e){if(It(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yr(e)&&e.host||Ve(e);return Yr(t)?t.host:t}function bc(e){const t=Qe(e);return Nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Le(t)&&dn(t)?t:bc(t)}function pn(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=bc(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),s=Se(r);if(o){const a=Xr(s);return t.concat(s,s.visualViewport||[],dn(r)?r:[],a&&n?pn(a):[])}return t.concat(r,pn(r,[],n))}function Xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const fn=Math.min,Re=Math.max,Kn=Math.round,Yn=Math.floor,_e=e=>({x:e,y:e});function wc(e,t){return typeof e=="function"?e(t):e}function Zr(e){return e.split("-")[0]}function Tc(e){return e.split("-")[1]}function tv(e){return e==="x"?"y":"x"}function nv(e){return e==="y"?"height":"width"}const iv=new Set(["top","bottom"]);function Jr(e){return iv.has(Zr(e))?"y":"x"}function rv(e){return tv(Jr(e))}function ov(e){return{top:0,right:0,bottom:0,left:0,...e}}function sv(e){return typeof e!="number"?ov(e):{top:e,right:e,bottom:e,left:e}}function Hn(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}/*!
180
180
  * tabbable 6.2.0
181
181
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
182
- */var av=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Qr=av.join(","),Sc=typeof Element>"u",mn=Sc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gn=!Sc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Xn=function e(t,n){var i;n===void 0&&(n=!0);var r=t==null||(i=t.getAttribute)===null||i===void 0?void 0:i.call(t,"inert"),o=r===""||r==="true",s=o||n&&t&&e(t.parentNode);return s},lv=function(t){var n,i=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return i===""||i==="true"},cv=function(t,n,i){if(Xn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Qr));return n&&mn.call(t,Qr)&&r.unshift(t),r=r.filter(i),r},uv=function e(t,n,i){for(var r=[],o=Array.from(t);o.length;){var s=o.shift();if(!Xn(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,i);i.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var c=mn.call(s,Qr);c&&i.filter(s)&&(n||!t.includes(s))&&r.push(s);var d=s.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(s),f=!Xn(d,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(s));if(d&&f){var m=e(d===!0?s.children:d.children,!0,i);i.flatten?r.push.apply(r,m):r.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return r},kc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ec=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lv(t))&&!kc(t)?0:t.tabIndex},dv=function(t,n){var i=Ec(t);return i<0&&n&&!kc(t)?0:i},pv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jc=function(t){return t.tagName==="INPUT"},fv=function(t){return jc(t)&&t.type==="hidden"},mv=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return n},hv=function(t,n){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===n)return t[i]},gv=function(t){if(!t.name)return!0;var n=t.form||Gn(t),i=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=i(window.CSS.escape(t.name));else try{r=i(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=hv(r,t.form);return!o||o===t},vv=function(t){return jc(t)&&t.type==="radio"},xv=function(t){return vv(t)&&!gv(t)},yv=function(t){var n,i=t&&Gn(t),r=(n=i)===null||n===void 0?void 0:n.host,o=!1;if(i&&i!==t){var s,a,l;for(o=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&r;){var u,c,d;i=Gn(r),r=(u=i)===null||u===void 0?void 0:u.host,o=!!((c=r)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(r))}}return o},Cc=function(t){var n=t.getBoundingClientRect(),i=n.width,r=n.height;return i===0&&r===0},bv=function(t,n){var i=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=mn.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(mn.call(s,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var l=t.parentElement,u=Gn(t);if(l&&!l.shadowRoot&&r(l)===!0)return Cc(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(yv(t))return!t.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return Cc(t);return!1},wv=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var i=0;i<n.children.length;i++){var r=n.children.item(i);if(r.tagName==="LEGEND")return mn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Tv=function(t,n){return!(n.disabled||Xn(n)||fv(n)||bv(n,t)||mv(n)||wv(n))},Pc=function(t,n){return!(xv(n)||Ec(n)<0||!Tv(t,n))},Sv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},kv=function e(t){var n=[],i=[];return t.forEach(function(r,o){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=dv(a,s),u=s?e(r.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):i.push({documentOrder:o,tabIndex:l,item:r,isScope:s,content:u})}),i.sort(pv).reduce(function(r,o){return o.isScope?r.push.apply(r,o.content):r.push(o.content),r},[]).concat(n)},Ac=function(t,n){n=n||{};var i;return n.getShadowRoot?i=uv([t],n.includeContainer,{filter:Pc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Sv}):i=cv(t,n.includeContainer,Pc.bind(null,n)),kv(i)};function Ev(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function jv(){return/apple/i.test(navigator.vendor)}function Cv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Pv(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Yr(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function eo(e){return e?.ownerDocument||document}var Av=typeof document<"u",Dv=function(){},et=Av?S.useLayoutEffect:Dv;const Rv={...C}.useInsertionEffect||(e=>e());function Ov(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Rv(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return t.current==null?void 0:t.current(...i)},[])}const Dc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rc(e,t){const n=Ac(e,Dc()),i=n.length;if(i===0)return;const r=Cv(eo(e)),o=n.indexOf(r),s=o===-1?t===1?0:i-1:o+t;return n[s]}function Mv(e){return Rc(eo(e).body,1)||e}function Iv(e){return Rc(eo(e).body,-1)||e}function to(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Pv(n,i)}function Nv(e){Ac(e,Dc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Oc(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function Mc(e,t,n){let{reference:i,floating:r}=e;const o=Jr(t),s=rv(t),a=nv(s),l=Zr(t),u=o==="y",c=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let m;switch(l){case"top":m={x:c,y:i.y-r.height};break;case"bottom":m={x:c,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:d};break;case"left":m={x:i.x-r.width,y:d};break;default:m={x:i.x,y:i.y}}switch(Tc(t)){case"start":m[s]-=f*(n&&u?-1:1);break;case"end":m[s]+=f*(n&&u?-1:1);break}return m}const Fv=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:d}=Mc(u,i,l),f=i,m={},v=0;for(let x=0;x<a.length;x++){const{name:w,fn:h}=a[x],{x:T,y:b,data:k,reset:y}=await h({x:c,y:d,initialPlacement:i,placement:f,strategy:r,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});c=T??c,d=b??d,m={...m,[w]:{...m[w],...k}},y&&v<=50&&(v++,typeof y=="object"&&(y.placement&&(f=y.placement),y.rects&&(u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:c,y:d}=Mc(u,f,l)),x=-1)}return{x:c,y:d,placement:f,strategy:r,middlewareData:m}};async function Vv(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=wc(t,e),v=sv(m),w=a[f?d==="floating"?"reference":"floating":d],h=Hn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),T=d==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),k=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},y=Hn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:T,offsetParent:b,strategy:l}):T);return{top:(h.top-y.top+v.top)/k.y,bottom:(y.bottom-h.bottom+v.bottom)/k.y,left:(h.left-y.left+v.left)/k.x,right:(y.right-h.right+v.right)/k.x}}const Lv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:r,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=wc(e,t),c=await Vv(t,u),d=Zr(r),f=Tc(r),m=Jr(r)==="y",{width:v,height:x}=o.floating;let w,h;d==="top"||d==="bottom"?(w=d,h=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,w=f==="end"?"top":"bottom");const T=x-c.top-c.bottom,b=v-c.left-c.right,k=fn(x-c[w],T),y=fn(v-c[h],b),P=!t.middlewareData.shift;let j=k,A=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(j=T),P&&!f){const U=Re(c.left,0),F=Re(c.right,0),Q=Re(c.top,0),G=Re(c.bottom,0);m?A=v-2*(U!==0||F!==0?U+F:Re(c.left,c.right)):j=x-2*(Q!==0||G!==0?Q+G:Re(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:j});const M=await s.getDimensions(a.floating);return v!==M.width||x!==M.height?{reset:{rects:!0}}:{}}}};function Ic(e){const t=Me(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Le(e),o=r?e.offsetWidth:n,s=r?e.offsetHeight:i,a=Kn(n)!==o||Kn(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}function no(e){return ye(e)?e:e.contextElement}function Ft(e){const t=no(e);if(!Le(t))return _e(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Ic(t);let s=(o?Kn(n.width):n.width)/i,a=(o?Kn(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _v=_e(0);function Nc(e){const t=Se(e);return!Gr()||!t.visualViewport?_v:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Se(e)?!1:t}function mt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=no(e);let s=_e(1);t&&(i?ye(i)&&(s=Ft(i)):s=Ft(e));const a=zv(o,n,i)?Nc(o):_e(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,c=r.width/s.x,d=r.height/s.y;if(o){const f=Se(o),m=i&&ye(i)?Se(i):i;let v=f,x=Xr(v);for(;x&&i&&m!==v;){const w=Ft(x),h=x.getBoundingClientRect(),T=Me(x),b=h.left+(x.clientLeft+parseFloat(T.paddingLeft))*w.x,k=h.top+(x.clientTop+parseFloat(T.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,d*=w.y,l+=b,u+=k,v=Se(x),x=Xr(v)}}return Hn({width:c,height:d,x:l,y:u})}function Zn(e,t){const n=qn(e).scrollLeft;return t?t.left+n:mt(Ve(e)).left+n}function Fc(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Zn(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Bv(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const o=r==="fixed",s=Ve(i),a=t?Un(t.floating):!1;if(i===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=_e(1);const c=_e(0),d=Le(i);if((d||!d&&!o)&&((It(i)!=="body"||dn(s))&&(l=qn(i)),Le(i))){const m=mt(i);u=Ft(i),c.x=m.x+i.clientLeft,c.y=m.y+i.clientTop}const f=s&&!d&&!o?Fc(s,l):_e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function $v(e){return Array.from(e.getClientRects())}function Wv(e){const t=Ve(e),n=qn(e),i=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=Re(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+Zn(e);const a=-n.scrollTop;return Me(i).direction==="rtl"&&(s+=Re(t.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}const Vc=25;function Uv(e,t){const n=Se(e),i=Ve(e),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const c=Gr();(!c||c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=Zn(i);if(u<=0){const c=i.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,v=Math.abs(i.clientWidth-d.clientWidth-m);v<=Vc&&(o-=v)}else u<=Vc&&(o+=u);return{width:o,height:s,x:a,y:l}}const qv=new Set(["absolute","fixed"]);function Kv(e,t){const n=mt(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,o=Le(e)?Ft(e):_e(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=r*o.x,u=i*o.y;return{width:s,height:a,x:l,y:u}}function Lc(e,t,n){let i;if(t==="viewport")i=Uv(e,n);else if(t==="document")i=Wv(Ve(e));else if(ye(t))i=Kv(t,n);else{const r=Nc(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Hn(i)}function _c(e,t){const n=Qe(e);return n===t||!ye(n)||Nt(n)?!1:Me(n).position==="fixed"||_c(n,t)}function Yv(e,t){const n=t.get(e);if(n)return n;let i=pn(e,[],!1).filter(a=>ye(a)&&It(a)!=="body"),r=null;const o=Me(e).position==="fixed";let s=o?Qe(e):e;for(;ye(s)&&!Nt(s);){const a=Me(s),l=Hr(s);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&!!r&&qv.has(r.position)||dn(s)&&!l&&_c(e,s))?i=i.filter(c=>c!==s):r=a,s=Qe(s)}return t.set(e,i),i}function Hv(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const s=[...n==="clippingAncestors"?Un(t)?[]:Yv(t,this._c):[].concat(n),i],a=s[0],l=s.reduce((u,c)=>{const d=Lc(t,c,r);return u.top=Re(d.top,u.top),u.right=fn(d.right,u.right),u.bottom=fn(d.bottom,u.bottom),u.left=Re(d.left,u.left),u},Lc(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gv(e){const{width:t,height:n}=Ic(e);return{width:t,height:n}}function Xv(e,t,n){const i=Le(t),r=Ve(t),o=n==="fixed",s=mt(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=_e(0);function u(){l.x=Zn(r)}if(i||!i&&!o)if((It(t)!=="body"||dn(r))&&(a=qn(t)),i){const m=mt(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();o&&!i&&r&&u();const c=r&&!i&&!o?Fc(r,a):_e(0),d=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:d,y:f,width:s.width,height:s.height}}function io(e){return Me(e).position==="static"}function zc(e,t){if(!Le(e)||Me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ve(e)===n&&(n=n.ownerDocument.body),n}function Bc(e,t){const n=Se(e);if(Un(e))return n;if(!Le(e)){let r=Qe(e);for(;r&&!Nt(r);){if(ye(r)&&!io(r))return r;r=Qe(r)}return n}let i=zc(e,t);for(;i&&Hg(i)&&io(i);)i=zc(i,t);return i&&Nt(i)&&io(i)&&!Hr(i)?n:i||Qg(e)||n}const Zv=async function(e){const t=this.getOffsetParent||Bc,n=this.getDimensions,i=await n(e.floating);return{reference:Xv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Jv(e){return Me(e).direction==="rtl"}const Qv={convertOffsetParentRelativeRectToViewportRelativeRect:Bv,getDocumentElement:Ve,getClippingRect:Hv,getOffsetParent:Bc,getElementRects:Zv,getClientRects:$v,getDimensions:Gv,getScale:Ft,isElement:ye,isRTL:Jv};function $c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ex(e,t){let n=null,i;const r=Ve(e);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:m}=u;if(a||t(),!f||!m)return;const v=Yn(d),x=Yn(r.clientWidth-(c+f)),w=Yn(r.clientHeight-(d+m)),h=Yn(c),b={rootMargin:-v+"px "+-x+"px "+-w+"px "+-h+"px",threshold:Re(0,fn(1,l))||1};let k=!0;function y(P){const j=P[0].intersectionRatio;if(j!==l){if(!k)return s();j?s(!1,j):i=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!$c(u,e.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(y,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(y,b)}n.observe(e)}return s(!0),o}function tx(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=no(e),c=r||o?[...u?pn(u):[],...pn(t)]:[];c.forEach(h=>{r&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});const d=u&&a?ex(u,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(h=>{let[T]=h;T&&T.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let v,x=l?mt(e):null;l&&w();function w(){const h=mt(e);x&&!$c(x,h)&&n(),x=h,v=requestAnimationFrame(w)}return n(),()=>{var h;c.forEach(T=>{r&&T.removeEventListener("scroll",n),o&&T.removeEventListener("resize",n)}),d?.(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const nx=Lv,ix=(e,t,n)=>{const i=new Map,r={platform:Qv,...n},o={...r.platform,_c:i};return Fv(e,t,{...r,platform:o})};var rx=typeof document<"u",ox=function(){},Jn=rx?S.useLayoutEffect:ox;function Qn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!Qn(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!(o==="_owner"&&e.$$typeof)&&!Qn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uc(e,t){const n=Wc(e);return Math.round(t*n)/n}function ro(e){const t=C.useRef(e);return Jn(()=>{t.current=e}),t}function sx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=C.useState(i);Qn(f,i)||m(i);const[v,x]=C.useState(null),[w,h]=C.useState(null),T=C.useCallback(q=>{q!==P.current&&(P.current=q,x(q))},[]),b=C.useCallback(q=>{q!==j.current&&(j.current=q,h(q))},[]),k=o||v,y=s||w,P=C.useRef(null),j=C.useRef(null),A=C.useRef(c),M=l!=null,U=ro(l),F=ro(r),Q=ro(u),G=C.useCallback(()=>{if(!P.current||!j.current)return;const q={placement:t,strategy:n,middleware:f};F.current&&(q.platform=F.current),ix(P.current,j.current,q).then(Z=>{const g={...Z,isPositioned:Q.current!==!1};N.current&&!Qn(A.current,g)&&(A.current=g,wo.flushSync(()=>{d(g)}))})},[f,t,n,F,Q]);Jn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(q=>({...q,isPositioned:!1})))},[u]);const N=C.useRef(!1);Jn(()=>(N.current=!0,()=>{N.current=!1}),[]),Jn(()=>{if(k&&(P.current=k),y&&(j.current=y),k&&y){if(U.current)return U.current(k,y,G);G()}},[k,y,G,U,M]);const ee=C.useMemo(()=>({reference:P,floating:j,setReference:T,setFloating:b}),[T,b]),ie=C.useMemo(()=>({reference:k,floating:y}),[k,y]),X=C.useMemo(()=>{const q={position:n,left:0,top:0};if(!ie.floating)return q;const Z=Uc(ie.floating,c.x),g=Uc(ie.floating,c.y);return a?{...q,transform:"translate("+Z+"px, "+g+"px)",...Wc(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:g}},[n,a,ie.floating,c.x,c.y]);return C.useMemo(()=>({...c,update:G,refs:ee,elements:ie,floatingStyles:X}),[c,G,ee,ie,X])}const ax=(e,t)=>({...nx(e),options:[e,t]}),lx={...C};let qc=!1,cx=0;const Kc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cx++;function ux(){const[e,t]=C.useState(()=>qc?Kc():void 0);return et(()=>{e==null&&t(Kc())},[]),C.useEffect(()=>{qc=!0},[]),e}const Yc=lx.useId||ux;let oo;process.env.NODE_ENV!=="production"&&(oo=new Set);function dx(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const r="Floating UI: "+n.join(" ");if(!((e=oo)!=null&&e.has(r))){var o;(o=oo)==null||o.add(r),console.error(r)}}function px(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}const fx=C.createContext(null),mx=C.createContext(null),hx=()=>{var e;return((e=C.useContext(fx))==null?void 0:e.id)||null},gx=()=>C.useContext(mx);function Hc(e){return"data-floating-ui-"+e}const Gc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Xc=C.forwardRef(function(t,n){const[i,r]=C.useState();et(()=>{jv()&&r("button")},[]);const o={ref:n,tabIndex:0,role:i,"aria-hidden":i?void 0:!0,[Hc("focus-guard")]:"",style:Gc};return p.jsx("span",{...t,...o})}),Zc=C.createContext(null),Jc=Hc("portal");function vx(e){e===void 0&&(e={});const{id:t,root:n}=e,i=Yc(),r=xx(),[o,s]=C.useState(null),a=C.useRef(null);return et(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),et(()=>{if(!i||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=i,u.setAttribute(Jc,""),l.appendChild(u),a.current=u,s(u)},[t,i]),et(()=>{if(n===null||!i||a.current)return;let l=n||r?.portalNode;l&&!Kr(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=i,c.setAttribute(Jc,""),l=u||l,l.appendChild(c),a.current=c,s(c)},[t,n,i,r]),o}function so(e){const{children:t,id:n,root:i,preserveTabOrder:r=!0}=e,o=vx({id:n,root:i}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),c=C.useRef(null),d=C.useRef(null),f=s?.modal,m=s?.open,v=!!s&&!s.modal&&s.open&&r&&!!(i||o);return C.useEffect(()=>{if(!o||!r||f)return;function x(w){o&&to(w)&&(w.type==="focusin"?Oc:Nv)(o)}return o.addEventListener("focusin",x,!0),o.addEventListener("focusout",x,!0),()=>{o.removeEventListener("focusin",x,!0),o.removeEventListener("focusout",x,!0)}},[o,r,f]),C.useEffect(()=>{o&&(m||Oc(o))},[m,o]),p.jsxs(Zc.Provider,{value:C.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[r,o]),children:[v&&o&&p.jsx(Xc,{"data-type":"outside",ref:l,onFocus:x=>{if(to(x,o)){var w;(w=c.current)==null||w.focus()}else{const h=s?s.domReference:null,T=Iv(h);T?.focus()}}}),v&&o&&p.jsx("span",{"aria-owns":o.id,style:Gc}),o&&wo.createPortal(t,o),v&&o&&p.jsx(Xc,{"data-type":"outside",ref:u,onFocus:x=>{if(to(x,o)){var w;(w=d.current)==null||w.focus()}else{const h=s?s.domReference:null,T=Mv(h);T?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,x.nativeEvent,"focus-out")}}})]})}const xx=()=>C.useContext(Zc);let ei=0;const Qc="--floating-ui-scrollbar-width";function yx(){const e=Ev(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,s=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Qc,o+"px"),o&&(n[r]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,d=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(d))+"px",left:-(s-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(Qc),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a))}}let eu=()=>{};const ao=C.forwardRef(function(t,n){const{lockScroll:i=!1,...r}=t;return et(()=>{if(i)return ei++,ei===1&&(eu=yx()),()=>{ei--,ei===0&&eu()}},[i]),p.jsx("div",{ref:n,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})});function bx(e){const{open:t=!1,onOpenChange:n,elements:i}=e,r=Yc(),o=C.useRef({}),[s]=C.useState(()=>px()),a=hx()!=null;if(process.env.NODE_ENV!=="production"){const m=i.reference;m&&!ye(m)&&dx("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=C.useState(i.reference),c=Ov((m,v,x)=>{o.current.openEvent=m?v:void 0,s.emit("openchange",{open:m,event:v,reason:x,nested:a}),n?.(m,v,x)}),d=C.useMemo(()=>({setPositionReference:u}),[]),f=C.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return C.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:f,events:s,floatingId:r,refs:d}),[t,c,f,s,r,d])}function wx(e){e===void 0&&(e={});const{nodeId:t}=e,n=bx({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||n,r=i.elements,[o,s]=C.useState(null),[a,l]=C.useState(null),c=r?.domReference||o,d=C.useRef(null),f=gx();et(()=>{c&&(d.current=c)},[c]);const m=sx({...e,elements:{...r,...a&&{reference:a}}}),v=C.useCallback(b=>{const k=ye(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;l(k),m.refs.setReference(k)},[m.refs]),x=C.useCallback(b=>{(ye(b)||b===null)&&(d.current=b,s(b)),(ye(m.refs.reference.current)||m.refs.reference.current===null||b!==null&&!ye(b))&&m.refs.setReference(b)},[m.refs]),w=C.useMemo(()=>({...m.refs,setReference:x,setPositionReference:v,domReference:d}),[m.refs,x,v]),h=C.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),T=C.useMemo(()=>({...m,...i,refs:w,elements:h,nodeId:t}),[m,w,h,t,i]);return et(()=>{i.dataRef.current.floatingContext=T;const b=f?.nodesRef.current.find(k=>k.id===t);b&&(b.context=T)}),C.useMemo(()=>({...m,context:T,refs:w,elements:h}),[m,w,h,T])}const Tx={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},tu=C.memo(({open:e,children:t,className:n,onOutsideClick:i,floatingStyles:r,setFloating:o,placement:s})=>p.jsx(so,{children:p.jsx(Cn,{children:e&&p.jsxs(p.Fragment,{children:[i&&p.jsx(ao,{onClick:i}),p.jsx("div",{ref:o,style:r,className:"z-50",children:p.jsx(at.div,{className:n,style:{transformOrigin:Tx[s]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),Vt=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:i,minWidth:r,maxWidth:o}=e,s=C.useMemo(()=>[ax({apply({rects:d,elements:f}){i&&(f.floating.style.width=`${d.reference.width}px`),r&&(f.floating.style.minWidth=`${r}px`),o&&(f.floating.style.maxWidth=`${o}px`)}})],[i,o,r]),{refs:a,floatingStyles:l}=wx({placement:t,middleware:s,whileElementsMounted:tx}),u=C.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=C.useMemo(()=>{const d=f=>{const{floatingStyles:m,setFloating:v,onOutsideClick:x,placement:w}=u.current,{className:h,open:T,children:b}=f;return p.jsx(tu,{open:T,className:h,onOutsideClick:x,floatingStyles:m,setFloating:v,placement:w,children:b})};return C.memo(d)},[]);return{anchorRef:a.setReference,Popover:c}},Sx="flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1",kx={sm:"p-2",md:"p-3",lg:"p-4"},Lt=e=>{const{className:t,children:n,padding:i="md",...r}=e;return p.jsx("div",{className:I(Sx,kx[i],t),...r,children:n})},hn=(e,t)=>{S.useEffect(()=>{if(!e)return;const n=i=>{i.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},nu=e=>{const{className:t,label:n,description:i,options:r,onChange:o,value:s,placeholder:a,maxHeight:l=300,error:u,size:c="md"}=e,[d,f]=S.useState(!1),m=C.useRef(null),v=r?.find(h=>h.value===s);hn(d,()=>f(!1)),S.useEffect(()=>{d&&m.current?.focus({preventScroll:!0})},[d]);const{anchorRef:x,Popover:w}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return p.jsx(Je.Provider,{value:c,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:x,children:[p.jsxs("div",{ref:m,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[c],Xe[c],ct[c],Rt[c],u&&"select-trigger-error",d&&"ring-4"),onKeyDown:h=>h.key===" "&&f(T=>!T),onClick:()=>f(!d),children:[v&&p.jsx("span",{children:v.label}),!v&&a&&p.jsx("span",{className:"select-placeholder",children:a})]}),p.jsxs(dt,{children:[u&&p.jsx(Ze,{}),!!s&&p.jsx(Ue,{Icon:ut,onClick:()=>o(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(w,{open:d,children:p.jsx(Lt,{className:"!p-0",style:{maxHeight:l},children:p.jsx("div",{className:"flex flex-col p-2 gap-1",children:r.map(h=>{const T=h.value===s;return p.jsx(un,{onClick:()=>{!h.disabled&&o&&(o(h.value),f(!1))},selected:T,disabled:h.disabled,children:h.label},String(h.value))})})})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:u})]})})},Ex=e=>{const{className:t,label:n,description:i,options:r,onChange:o,onSearch:s,value:a,placeholder:l,maxHeight:u=300,error:c,size:d="md"}=e,[f,m]=S.useState(!1),[v,x]=S.useState(r),[w,h]=S.useState(""),T=C.useRef(null),b=C.useRef(null),k=r?.find(j=>j.value===a);hn(f,()=>m(!1)),S.useEffect(()=>{x(s(w))},[w,r,s]),S.useEffect(()=>{f&&setTimeout(()=>b.current?.focus(),100)},[f]);const{anchorRef:y,Popover:P}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return p.jsx(Je.Provider,{value:d,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:y,children:[p.jsxs("div",{ref:T,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[d],Xe[d],ct[d],Rt[d],c&&"select-trigger-error",f&&"ring-4"),onKeyDown:j=>j.key===" "&&m(A=>!A),onClick:()=>m(!f),children:[k&&p.jsx("span",{children:k.label}),!k&&l&&p.jsx("span",{className:"select-placeholder",children:l})]}),p.jsxs(dt,{children:[c&&p.jsx(Ze,{}),!!a&&p.jsx(Ue,{Icon:ut,onClick:()=>o(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(P,{open:f,children:p.jsxs(Lt,{className:"gap-0 !p-0",style:{maxHeight:u},children:[p.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[p.jsx("input",{ref:b,type:"text",placeholder:"Search",value:w,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:j=>h(j.target.value)}),p.jsx(Er,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[w!==""&&p.jsxs(p.Fragment,{children:[v.length===0&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Fl,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),v.map(j=>{const A=j.value===a;return p.jsx(un,{onClick:()=>{!j.disabled&&o&&(o(j.value),m(!1))},selected:A,disabled:j.disabled,children:j.label},String(j.value))})]}),w===""&&p.jsx(p.Fragment,{children:r.map(j=>{const A=j.value===a;return p.jsx(un,{onClick:()=>{!j.disabled&&o&&(o(j.value),m(!1))},selected:A,disabled:j.disabled,children:j.label},String(j.value))})})]})]})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:c})]})})},jx=(e,t)=>{const[n,i]=S.useState(e);return S.useEffect(()=>{const r=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(r)}},[e,t]),n},Cx=e=>{const{className:t,label:n,description:i,onChange:r,fetchOptionsByQuery:o,fetchOptionByValue:s,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:d,size:f="md"}=e,[m,v]=S.useState(!1),x=C.useRef(null),[w,h]=S.useState(""),[T,b]=S.useState([]),[k,y]=S.useState(null),P=C.useRef(null),[j,A]=S.useState(!1),[M,U]=S.useState(!1);hn(m,()=>v(!1));const F=jx(w,a);S.useEffect(()=>{(async()=>{A(!0);const ee=await o(F);b(ee),A(!1)})()},[F,o]),S.useEffect(()=>{if(l==null){y(null);return}const N=T?.find(ee=>ee.value===l);N?y(N):(async()=>{U(!0);const ie=await s(l);y(ie),U(!1)})()},[s,T,l]),S.useEffect(()=>{m&&setTimeout(()=>P.current?.focus(),100)},[m]);const{anchorRef:Q,Popover:G}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>v(!1)});return p.jsx(Je.Provider,{value:f,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:Q,children:[p.jsxs("div",{ref:x,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[f],Xe[f],ct[f],Rt[f],d&&"select-trigger-error",m&&"ring-4"),onKeyDown:N=>N.key===" "&&v(ee=>!ee),onClick:()=>v(!m),children:[!M&&k&&p.jsx("span",{children:k.label}),!M&&!k&&u&&p.jsx("span",{className:"select-placeholder",children:u}),M&&p.jsx(Dt,{className:"h-4 w-4 text-[var(--color-input-text)]"})]}),p.jsxs(dt,{children:[d&&p.jsx(Ze,{}),!!l&&p.jsx(Ue,{Icon:ut,onClick:()=>r(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(G,{open:m,children:p.jsxs(Lt,{className:"gap-0 !p-0",style:{maxHeight:c},children:[p.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[p.jsx("input",{ref:P,type:"text",placeholder:"Search",value:w,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:N=>h(N.target.value)}),p.jsx(Er,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!j&&T.length===0&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Fl,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),j&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Dt,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),!j&&p.jsx(p.Fragment,{children:T.map(N=>{const ee=N.value===l;return p.jsx(un,{onClick:()=>{!N.disabled&&r&&(r(N.value),v(!1))},selected:ee,disabled:N.disabled,children:N.label},String(N.value))})})]})]})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:d})]})})},Px=C.forwardRef((e,t)=>{const{className:n,children:i,...r}=e;return p.jsx("div",{ref:t,className:I("flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",n),...r,children:i})}),Ax=C.forwardRef((e,t)=>{const{className:n,children:i,...r}=e;return p.jsx("div",{ref:t,className:I("flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",n),...r,children:i})}),iu="input-description text-sm font-medium",Dx=e=>{const{className:t,label:n,children:i,orientation:r="vertical",...o}=e;return r==="horizontal"?p.jsxs("div",{className:I("flex flex-row items-center gap-3 px-3 py-2",t),...o,children:[p.jsx("div",{className:I(iu,"w-1/2 line-clamp-1 break-all"),children:n}),p.jsx("div",{className:"w-1/2 line-clamp-1 break-all",children:i})]}):p.jsxs("div",{className:I("flex flex-col gap-1 px-3 py-2",t),...o,children:[n&&p.jsx("div",{className:iu,children:n}),p.jsx("div",{children:i})]})},Rx={error:Cr,warning:kh,success:jr,info:Eh},Ox={error:"text-[var(--color-status-error)]",warning:"text-[var(--color-status-warning)]",success:"text-[var(--color-status-success)]",info:"text-[var(--color-status-info)]"},ru="inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",Mx=e=>{const{className:t,children:n,Icon:i,status:r,...o}=e,s=r?Rx[r]:null,a=p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"inline-flex flex-row items-center gap-3 min-w-0",children:[i&&p.jsx(i,{className:"h-5 w-5 shrink-0"}),p.jsx("span",{className:"truncate",children:n})]}),p.jsxs("span",{className:"inline-flex flex-row items-center gap-2 shrink-0",children:[s&&r&&p.jsx(s,{className:I("h-5 w-5",Ox[r])}),p.jsx(vh,{className:"h-5 w-5 text-[var(--color-input-icon-button-icon)]"})]})]});if(o.href!==void 0){const{href:l,...u}=o;return p.jsx("a",{href:l,className:I(ru,t),...u,children:a})}return p.jsx("button",{className:I(ru,t),...o,children:a})},Ix=e=>{const{className:t,vertical:n=!1,...i}=e;return p.jsx("div",{className:I(n?"w-px h-full bg-[var(--color-divider)]":"w-full h-px bg-[var(--color-divider)]",t),...i})},Nx=e=>{const{children:t,content:n,className:i,placement:r="top",minWidth:o=100,maxWidth:s=200}=e,[a,l]=S.useState(!1),{anchorRef:u,Popover:c}=Vt({placement:r,minWidth:o,maxWidth:s});return p.jsxs("span",{ref:u,className:i,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,p.jsx(c,{open:a,children:p.jsx(Lt,{children:n})})]})},Fx=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:i,enableDismissOnEscKey:r,enableDismissButton:o,className:s,children:a,maxWidth:l=600}=e;return hn(!!r&&t,n||(()=>{})),p.jsx(Cn,{children:t&&p.jsxs(so,{children:[p.jsx(at.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:p.jsx(ao,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:i?n:void 0,lockScroll:!0})}),p.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:p.jsxs(at.div,{className:I("flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",s),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&p.jsx(kr,{Icon:ut,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Vx=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:i,enableDismissOnEscKey:r,enableDismissButton:o,className:s,children:a,maxWidth:l=480}=e;return hn(!!r&&t,n||(()=>{})),p.jsx(Cn,{children:t&&p.jsxs(so,{children:[p.jsx(at.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:p.jsx(ao,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:i?n:void 0,lockScroll:!0})}),p.jsx("div",{className:"fixed inset-0 flex flex-row justify-end pointer-events-none z-20",children:p.jsxs(at.div,{className:I("flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",s),style:{maxWidth:l},initial:{translateX:"100%"},animate:{translateX:0},exit:{translateX:"100%"},transition:{duration:.25,ease:[.32,.72,0,1]},children:[o&&p.jsx(kr,{Icon:ut,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},ou={red:"bg-red-100 text-red-700 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-800",orange:"bg-orange-100 text-orange-700 ring-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:ring-orange-800",amber:"bg-amber-100 text-amber-700 ring-amber-200 dark:bg-amber-950 dark:text-amber-300 dark:ring-amber-800",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200 dark:bg-yellow-950 dark:text-yellow-300 dark:ring-yellow-800",lime:"bg-lime-100 text-lime-700 ring-lime-200 dark:bg-lime-950 dark:text-lime-300 dark:ring-lime-800",green:"bg-green-100 text-green-700 ring-green-200 dark:bg-green-950 dark:text-green-300 dark:ring-green-800",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200 dark:bg-emerald-950 dark:text-emerald-300 dark:ring-emerald-800",teal:"bg-teal-100 text-teal-700 ring-teal-200 dark:bg-teal-950 dark:text-teal-300 dark:ring-teal-800",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200 dark:bg-cyan-950 dark:text-cyan-300 dark:ring-cyan-800",sky:"bg-sky-100 text-sky-700 ring-sky-200 dark:bg-sky-950 dark:text-sky-300 dark:ring-sky-800",blue:"bg-blue-100 text-blue-700 ring-blue-200 dark:bg-blue-950 dark:text-blue-300 dark:ring-blue-800",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200 dark:bg-indigo-950 dark:text-indigo-300 dark:ring-indigo-800",violet:"bg-violet-100 text-violet-700 ring-violet-200 dark:bg-violet-950 dark:text-violet-300 dark:ring-violet-800",purple:"bg-purple-100 text-purple-700 ring-purple-200 dark:bg-purple-950 dark:text-purple-300 dark:ring-purple-800",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200 dark:bg-fuchsia-950 dark:text-fuchsia-300 dark:ring-fuchsia-800",pink:"bg-pink-100 text-pink-700 ring-pink-200 dark:bg-pink-950 dark:text-pink-300 dark:ring-pink-800",rose:"bg-rose-100 text-rose-700 ring-rose-200 dark:bg-rose-950 dark:text-rose-300 dark:ring-rose-800",slate:"bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-950 dark:text-slate-300 dark:ring-slate-800",gray:"bg-gray-100 text-gray-700 ring-gray-200 dark:bg-gray-950 dark:text-gray-300 dark:ring-gray-800",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200 dark:bg-zinc-950 dark:text-zinc-300 dark:ring-zinc-800",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200 dark:bg-neutral-950 dark:text-neutral-300 dark:ring-neutral-800",stone:"bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",white:"bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",black:"bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"},lo=C.forwardRef((e,t)=>{const{className:n,children:i,onClick:r,showCloseIcon:o,Icon:s,color:a="gray"}=e,l=I("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",ou[a],n);return r?p.jsx("div",{ref:t,children:p.jsxs("button",{className:I("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:r,children:[s&&p.jsx(s,{className:"h-4 w-4 shrink-0"}),p.jsx("div",{className:"break-all line-clamp-1 text-left",children:i}),o&&p.jsx(ut,{className:"h-4 w-4 shrink-0"})]})}):p.jsxs("div",{className:l,ref:t,children:[s&&p.jsx(s,{className:"h-4 w-4 shrink-0"}),p.jsx("div",{className:"break-all line-clamp-1 text-left",children:i})]})}),su=e=>{const{className:t,tabs:n}=e;return p.jsx("div",{className:I("h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",t),children:n.map((i,r)=>{const o=I("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",i.active&&"tab-button-active shadow-sm");return i.href?p.jsxs("a",{href:i.href,className:o,children:[i.Icon&&p.jsx(i.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),i.label]},r):p.jsxs("button",{className:o,onClick:i.onClick,children:[i.Icon&&p.jsx(i.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),i.label]},r)})})},Lx=e=>{const{duration:t=.3,ease:n="easeInOut",horizontal:i=!1,children:r,className:o,...s}=e,a=C.useRef(null),l=C.useRef(null),u=C.useRef(null);return C.useEffect(()=>{const c=a.current,d=l.current;if(!c||!d)return;let f=!0;const m=()=>{const x=i?c.scrollWidth-c.clientWidth:c.scrollHeight-c.clientHeight,w=i?c.scrollLeft:c.scrollTop;if(!(x<=0||Math.abs(x-w)<1)){if(f){f=!1,i?c.scrollLeft=x:c.scrollTop=x;return}u.current?.stop(),u.current=th(w,x,{duration:t,ease:n,onUpdate:h=>{i?c.scrollLeft=h:c.scrollTop=h}})}},v=new ResizeObserver(m);return v.observe(d),()=>{v.disconnect(),u.current?.stop()}},[t,n,i]),p.jsx("div",{ref:a,className:I("min-h-0 min-w-0",i?"overflow-x-auto":"overflow-y-auto",o),...s,children:p.jsx("div",{ref:l,children:r})})},au=S.createContext(void 0),_x=()=>({dismiss:S.useContext(au)||(()=>{})}),zx="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",Te=C.forwardRef((e,t)=>{const{className:n,children:i,Icon:r,onClick:o,dismissOnClick:s=!0,...a}=e,{dismiss:l}=_x(),u=c=>{o&&o(c),s&&l()};return p.jsxs("button",{ref:t,className:I(zx,n),onClick:u,...a,children:[r&&p.jsx(r,{className:"h-5 w-5"}),i]})}),co=e=>{const{label:t,children:n,className:i}=e;return p.jsxs("div",{className:I("flex flex-col dropdown-button-group",i),children:[t&&p.jsx("div",{className:"mb-2 text-sm dropdown-group-label font-semibold px-3",children:t}),n]})},uo=e=>{const{trigger:t,children:n,placement:i="bottom-end",minWidth:r=200,className:o}=e,[s,a]=S.useState(!1),{Popover:l,anchorRef:u}=Vt({placement:i,onOutsideClick:()=>a(!1),minWidth:r});return p.jsxs(p.Fragment,{children:[p.jsx("div",{ref:u,className:o,onClick:()=>a(!s),children:t}),p.jsx(l,{open:s,children:p.jsx(Lt,{padding:"sm",children:p.jsx(au.Provider,{value:()=>a(!1),children:n})})})]})};function Bx(e){const{onDelta:t,onDragStart:n,onDragEnd:i,disabled:r=!1,primaryButtonOnly:o=!0,preventScrollOnMove:s=!0}=e,[a,l]=C.useState(!1),u=C.useRef(!1),c=C.useRef(0),d=C.useRef(0),f=C.useRef(0),m=C.useRef(null),v=C.useRef(null),x=C.useRef({onDelta:t,onDragStart:n,onDragEnd:i,preventScrollOnMove:s});C.useEffect(()=>{x.current={onDelta:t,onDragStart:n,onDragEnd:i,preventScrollOnMove:s}});const w=C.useRef({}),h=C.useCallback(b=>{if(!u.current)return;const k={clientX:b??d.current,startX:c.current,totalDeltaX:f.current,target:m.current};u.current=!1,l(!1);const{move:y,up:P,keydown:j}=w.current;y&&window.removeEventListener("pointermove",y,!0),P&&(window.removeEventListener("pointerup",P,!0),window.removeEventListener("pointercancel",P,!0)),j&&window.removeEventListener("keydown",j,!0),w.current={},v.current!=null&&(cancelAnimationFrame(v.current),v.current=null),x.current.onDragEnd?.(k),m.current=null,f.current=0},[]),T=C.useCallback(b=>{if(r||o&&b.button!==0)return;b.target.setPointerCapture?.(b.pointerId),c.current=b.clientX,d.current=b.clientX,f.current=0,m.current=b.target,u.current=!0,l(!0);const k={clientX:b.clientX,startX:b.clientX,totalDeltaX:0,target:b.target};x.current.onDragStart?.(k);const y=A=>{u.current&&v.current==null&&(v.current=requestAnimationFrame(()=>{v.current=null;const M=A.clientX,U=M-d.current;if(U===0)return;d.current=M,f.current+=U;const F={clientX:M,startX:c.current,totalDeltaX:f.current,target:m.current};x.current.preventScrollOnMove&&A.preventDefault(),x.current.onDelta(U,F)}))},P=A=>{h(A.clientX)},j=A=>{A.key==="Escape"&&(A.preventDefault(),h())};w.current={move:y,up:P,keydown:j},window.addEventListener("pointermove",y,{passive:!s,capture:!0}),window.addEventListener("pointerup",P,{capture:!0}),window.addEventListener("pointercancel",P,{capture:!0}),window.addEventListener("keydown",j,!0)},[h,r,s,o]);return C.useEffect(()=>()=>{u.current&&h()},[h]),{isDragging:a,bind:{onPointerDown:T,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const $x=e=>{const{column:t,width:n,height:i,onResize:r,sortDirection:o,onSortClick:s}=e,a=!!t.sortable,{bind:l}=Bx({onDelta:u=>r(u)});return p.jsxs("div",{style:{width:n,height:i},className:"flex flex-row items-stretch select-none shrink-0",children:[p.jsxs("div",{className:I("flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",a&&"cursor-pointer"),onClick:a?s:void 0,children:[p.jsx("span",{className:"truncate",children:t.header}),a&&o==="asc"&&p.jsx(xh,{className:"h-4 w-4 shrink-0"}),a&&o==="desc"&&p.jsx(an,{className:"h-4 w-4 shrink-0"})]}),p.jsx("div",{...l,className:"cursor-ew-resize group py-2 table-resize-handle w-[8px]",children:p.jsx("div",{className:"w-0.5 h-full mx-auto table-resize-divider table-resize-divider-hover pointer-events-none"})})]})},_t=200,Wx=60,Ux=e=>{const t={};for(const n of e)t[n.id]=n.defaultWidth??_t;return t},qx=e=>{const{columns:t,rows:n,getRowId:i,onRowClick:r,sort:o,onSortChange:s,className:a,rowHeight:l=44,headerHeight:u=44}=e,[c,d]=S.useState(()=>Ux(t));S.useEffect(()=>{d(h=>{const T={};let b=Object.keys(h).length!==t.length;for(const k of t)k.id in h?T[k.id]=h[k.id]:(T[k.id]=k.defaultWidth??_t,b=!0);return b?T:h})},[t]);const f=S.useCallback((h,T,b)=>{d(k=>{const y=k[h]??_t,P=Math.max(b,y+T);return P===y?k:{...k,[h]:P}})},[]),m=S.useCallback(h=>{if(s){if(!o||o.columnId!==h){s({columnId:h,direction:"asc"});return}if(o.direction==="asc"){s({columnId:h,direction:"desc"});return}s(null)}},[o,s]),v=t.reduce((h,T)=>h+(c[T.id]??T.defaultWidth??_t),0),x=S.useRef(null),w=h=>{x.current&&(x.current.scrollLeft=h.currentTarget.scrollLeft)};return p.jsxs("div",{className:I("flex flex-col h-full w-full",a),children:[p.jsx("div",{ref:x,className:"overflow-hidden shrink-0",style:{height:u},children:p.jsx("div",{className:"flex flex-row table-header font-medium",style:{width:v,minWidth:"100%"},children:t.map(h=>p.jsx($x,{column:h,width:c[h.id]??h.defaultWidth??_t,height:u,onResize:T=>f(h.id,T,h.minWidth??Wx),sortDirection:o?.columnId===h.id?o.direction:null,onSortClick:()=>m(h.id)},h.id))})}),p.jsx("div",{className:"flex-1 overflow-auto",onScroll:w,children:p.jsx("div",{className:"flex flex-col",style:{width:v,minWidth:"100%"},children:n.map((h,T)=>p.jsx("div",{className:I("flex flex-row table-body-row transition-colors duration-100",r&&"cursor-pointer"),onClick:r?()=>r(h,T):void 0,children:t.map(b=>p.jsx("div",{className:"shrink-0 content-center px-4 relative",style:{width:c[b.id]??b.defaultWidth??_t,height:l},children:p.jsx("div",{className:"break-all line-clamp-1",children:b.renderCell(h,T)})},b.id))},i(h,T)))})})]})},Kx=()=>p.jsx("div",{}),Yx=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],Hx=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>p.jsx(lo,{Icon:jh,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>p.jsx(Xx,{})}],Gx=()=>p.jsxs("div",{className:"flex flex-col gap-6",children:[p.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[p.jsx(Pr,{Icon:Er,placeholder:"Search..."}),p.jsx(Fn,{Icon:Vl}),p.jsx(Ml,{Icon:Nl,children:"New"}),p.jsxs(uo,{trigger:p.jsx(Fn,{Icon:Vl}),children:[p.jsx(Te,{dismissOnClick:!1,Icon:Nl,children:"Add new"}),p.jsx(Te,{Icon:Sh,children:"Remove"}),p.jsxs(co,{label:"Test",className:"mt-2",children:[p.jsx(Te,{children:"Item 1"}),p.jsx(Te,{children:"Item 2"}),p.jsx(Te,{children:"Item 3"}),p.jsx(Te,{children:"Item 4"})]}),p.jsxs(co,{label:"Test",className:"mt-2",children:[p.jsx(Te,{children:"Item 1"}),p.jsx(Te,{children:"Item 2"}),p.jsx(Te,{children:"Item 3"}),p.jsx(Te,{children:"Item 4"})]})]}),p.jsx(su,{tabs:[{label:"Tab 1",Icon:Il,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:Il,active:!1,onClick:()=>{}}]})]}),p.jsx(nu,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),p.jsx(qx,{className:"h-[300px] w-[300px]",columns:Hx,rows:Yx,getRowId:e=>e.id}),p.jsx(Kx,{})]}),Xx=()=>p.jsx(p.Fragment,{children:p.jsxs(uo,{placement:"bottom-end",className:"inline-block",trigger:p.jsx(lo,{onClick:()=>{},children:"Test"}),children:[p.jsx(Te,{children:"Option 1"}),p.jsx(Te,{children:"Option 2"}),p.jsx(Te,{children:"Option 3"})]})});W.AutoScroll=Lx,W.Badge=lo,W.BadgeColor=ou,W.Button=Ml,W.ButtonIconRound=kr,W.ButtonIconSquare=Fn,W.Divider=Ix,W.DropdownButton=Te,W.DropdownButtonGroup=co,W.DropdownMenu=uo,W.DropdownPanel=Lt,W.Input=Pr,W.InputCheck=Nh,W.InputDescription=Ae,W.InputError=De,W.InputErrorIcon=Ze,W.InputFileMultiple=Ug,W.InputFileSingle=$g,W.InputIconButton=Ue,W.InputIconButtonTray=dt,W.InputLabel=We,W.InputPassword=Ph,W.InputRadio=Mh,W.InputSelect=nu,W.InputSelectNative=qg,W.InputSelectOption=un,W.InputSelectSearchable=Ex,W.InputSelectSearchableAsync=Cx,W.InputTextArea=Oh,W.InputToggle=Ih,W.Modal=Fx,W.Panel=Px,W.PanelField=Dx,W.PanelLink=Mx,W.PanelStack=Ax,W.PopoverBase=tu,W.SidebarModal=Vx,W.Spinner=Dt,W.TabButtons=su,W.Test=Gx,W.Tooltip=Nx,W.UploadFileTile=yc,W.usePopover=Vt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
182
+ */var av=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Qr=av.join(","),Sc=typeof Element>"u",mn=Sc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gn=!Sc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Xn=function e(t,n){var i;n===void 0&&(n=!0);var r=t==null||(i=t.getAttribute)===null||i===void 0?void 0:i.call(t,"inert"),o=r===""||r==="true",s=o||n&&t&&e(t.parentNode);return s},lv=function(t){var n,i=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return i===""||i==="true"},cv=function(t,n,i){if(Xn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Qr));return n&&mn.call(t,Qr)&&r.unshift(t),r=r.filter(i),r},uv=function e(t,n,i){for(var r=[],o=Array.from(t);o.length;){var s=o.shift();if(!Xn(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,i);i.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var c=mn.call(s,Qr);c&&i.filter(s)&&(n||!t.includes(s))&&r.push(s);var d=s.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(s),f=!Xn(d,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(s));if(d&&f){var m=e(d===!0?s.children:d.children,!0,i);i.flatten?r.push.apply(r,m):r.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return r},kc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ec=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||lv(t))&&!kc(t)?0:t.tabIndex},dv=function(t,n){var i=Ec(t);return i<0&&n&&!kc(t)?0:i},pv=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},jc=function(t){return t.tagName==="INPUT"},fv=function(t){return jc(t)&&t.type==="hidden"},mv=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return n},hv=function(t,n){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===n)return t[i]},gv=function(t){if(!t.name)return!0;var n=t.form||Gn(t),i=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=i(window.CSS.escape(t.name));else try{r=i(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=hv(r,t.form);return!o||o===t},vv=function(t){return jc(t)&&t.type==="radio"},xv=function(t){return vv(t)&&!gv(t)},yv=function(t){var n,i=t&&Gn(t),r=(n=i)===null||n===void 0?void 0:n.host,o=!1;if(i&&i!==t){var s,a,l;for(o=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&r;){var u,c,d;i=Gn(r),r=(u=i)===null||u===void 0?void 0:u.host,o=!!((c=r)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(r))}}return o},Cc=function(t){var n=t.getBoundingClientRect(),i=n.width,r=n.height;return i===0&&r===0},bv=function(t,n){var i=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var o=mn.call(t,"details>summary:first-of-type"),s=o?t.parentElement:t;if(mn.call(s,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var l=t.parentElement,u=Gn(t);if(l&&!l.shadowRoot&&r(l)===!0)return Cc(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(yv(t))return!t.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return Cc(t);return!1},wv=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var i=0;i<n.children.length;i++){var r=n.children.item(i);if(r.tagName==="LEGEND")return mn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Tv=function(t,n){return!(n.disabled||Xn(n)||fv(n)||bv(n,t)||mv(n)||wv(n))},Pc=function(t,n){return!(xv(n)||Ec(n)<0||!Tv(t,n))},Sv=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},kv=function e(t){var n=[],i=[];return t.forEach(function(r,o){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=dv(a,s),u=s?e(r.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):i.push({documentOrder:o,tabIndex:l,item:r,isScope:s,content:u})}),i.sort(pv).reduce(function(r,o){return o.isScope?r.push.apply(r,o.content):r.push(o.content),r},[]).concat(n)},Ac=function(t,n){n=n||{};var i;return n.getShadowRoot?i=uv([t],n.includeContainer,{filter:Pc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Sv}):i=cv(t,n.includeContainer,Pc.bind(null,n)),kv(i)};function Ev(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function jv(){return/apple/i.test(navigator.vendor)}function Cv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Pv(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Yr(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function eo(e){return e?.ownerDocument||document}var Av=typeof document<"u",Dv=function(){},et=Av?S.useLayoutEffect:Dv;const Rv={...C}.useInsertionEffect||(e=>e());function Ov(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Rv(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return t.current==null?void 0:t.current(...i)},[])}const Dc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rc(e,t){const n=Ac(e,Dc()),i=n.length;if(i===0)return;const r=Cv(eo(e)),o=n.indexOf(r),s=o===-1?t===1?0:i-1:o+t;return n[s]}function Mv(e){return Rc(eo(e).body,1)||e}function Iv(e){return Rc(eo(e).body,-1)||e}function to(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Pv(n,i)}function Nv(e){Ac(e,Dc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Oc(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function Mc(e,t,n){let{reference:i,floating:r}=e;const o=Jr(t),s=rv(t),a=nv(s),l=Zr(t),u=o==="y",c=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let m;switch(l){case"top":m={x:c,y:i.y-r.height};break;case"bottom":m={x:c,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:d};break;case"left":m={x:i.x-r.width,y:d};break;default:m={x:i.x,y:i.y}}switch(Tc(t)){case"start":m[s]-=f*(n&&u?-1:1);break;case"end":m[s]+=f*(n&&u?-1:1);break}return m}const Fv=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:d}=Mc(u,i,l),f=i,m={},v=0;for(let x=0;x<a.length;x++){const{name:w,fn:h}=a[x],{x:T,y:b,data:k,reset:y}=await h({x:c,y:d,initialPlacement:i,placement:f,strategy:r,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});c=T??c,d=b??d,m={...m,[w]:{...m[w],...k}},y&&v<=50&&(v++,typeof y=="object"&&(y.placement&&(f=y.placement),y.rects&&(u=y.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:c,y:d}=Mc(u,f,l)),x=-1)}return{x:c,y:d,placement:f,strategy:r,middlewareData:m}};async function Vv(e,t){var n;t===void 0&&(t={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=wc(t,e),v=sv(m),w=a[f?d==="floating"?"reference":"floating":d],h=Hn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),T=d==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),k=await(o.isElement==null?void 0:o.isElement(b))?await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1}:{x:1,y:1},y=Hn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:T,offsetParent:b,strategy:l}):T);return{top:(h.top-y.top+v.top)/k.y,bottom:(y.bottom-h.bottom+v.bottom)/k.y,left:(h.left-y.left+v.left)/k.x,right:(y.right-h.right+v.right)/k.x}}const Lv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:r,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=wc(e,t),c=await Vv(t,u),d=Zr(r),f=Tc(r),m=Jr(r)==="y",{width:v,height:x}=o.floating;let w,h;d==="top"||d==="bottom"?(w=d,h=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(h=d,w=f==="end"?"top":"bottom");const T=x-c.top-c.bottom,b=v-c.left-c.right,k=fn(x-c[w],T),y=fn(v-c[h],b),P=!t.middlewareData.shift;let j=k,A=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(j=T),P&&!f){const U=Re(c.left,0),F=Re(c.right,0),Q=Re(c.top,0),G=Re(c.bottom,0);m?A=v-2*(U!==0||F!==0?U+F:Re(c.left,c.right)):j=x-2*(Q!==0||G!==0?Q+G:Re(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:j});const M=await s.getDimensions(a.floating);return v!==M.width||x!==M.height?{reset:{rects:!0}}:{}}}};function Ic(e){const t=Me(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Le(e),o=r?e.offsetWidth:n,s=r?e.offsetHeight:i,a=Kn(n)!==o||Kn(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}function no(e){return ye(e)?e:e.contextElement}function Ft(e){const t=no(e);if(!Le(t))return _e(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Ic(t);let s=(o?Kn(n.width):n.width)/i,a=(o?Kn(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _v=_e(0);function Nc(e){const t=Se(e);return!Gr()||!t.visualViewport?_v:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Se(e)?!1:t}function mt(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=no(e);let s=_e(1);t&&(i?ye(i)&&(s=Ft(i)):s=Ft(e));const a=zv(o,n,i)?Nc(o):_e(0);let l=(r.left+a.x)/s.x,u=(r.top+a.y)/s.y,c=r.width/s.x,d=r.height/s.y;if(o){const f=Se(o),m=i&&ye(i)?Se(i):i;let v=f,x=Xr(v);for(;x&&i&&m!==v;){const w=Ft(x),h=x.getBoundingClientRect(),T=Me(x),b=h.left+(x.clientLeft+parseFloat(T.paddingLeft))*w.x,k=h.top+(x.clientTop+parseFloat(T.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,d*=w.y,l+=b,u+=k,v=Se(x),x=Xr(v)}}return Hn({width:c,height:d,x:l,y:u})}function Zn(e,t){const n=qn(e).scrollLeft;return t?t.left+n:mt(Ve(e)).left+n}function Fc(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Zn(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Bv(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const o=r==="fixed",s=Ve(i),a=t?Un(t.floating):!1;if(i===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=_e(1);const c=_e(0),d=Le(i);if((d||!d&&!o)&&((It(i)!=="body"||dn(s))&&(l=qn(i)),Le(i))){const m=mt(i);u=Ft(i),c.x=m.x+i.clientLeft,c.y=m.y+i.clientTop}const f=s&&!d&&!o?Fc(s,l):_e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function $v(e){return Array.from(e.getClientRects())}function Wv(e){const t=Ve(e),n=qn(e),i=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=Re(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+Zn(e);const a=-n.scrollTop;return Me(i).direction==="rtl"&&(s+=Re(t.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}const Vc=25;function Uv(e,t){const n=Se(e),i=Ve(e),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const c=Gr();(!c||c&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const u=Zn(i);if(u<=0){const c=i.ownerDocument,d=c.body,f=getComputedStyle(d),m=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,v=Math.abs(i.clientWidth-d.clientWidth-m);v<=Vc&&(o-=v)}else u<=Vc&&(o+=u);return{width:o,height:s,x:a,y:l}}const qv=new Set(["absolute","fixed"]);function Kv(e,t){const n=mt(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,o=Le(e)?Ft(e):_e(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=r*o.x,u=i*o.y;return{width:s,height:a,x:l,y:u}}function Lc(e,t,n){let i;if(t==="viewport")i=Uv(e,n);else if(t==="document")i=Wv(Ve(e));else if(ye(t))i=Kv(t,n);else{const r=Nc(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Hn(i)}function _c(e,t){const n=Qe(e);return n===t||!ye(n)||Nt(n)?!1:Me(n).position==="fixed"||_c(n,t)}function Yv(e,t){const n=t.get(e);if(n)return n;let i=pn(e,[],!1).filter(a=>ye(a)&&It(a)!=="body"),r=null;const o=Me(e).position==="fixed";let s=o?Qe(e):e;for(;ye(s)&&!Nt(s);){const a=Me(s),l=Hr(s);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&!!r&&qv.has(r.position)||dn(s)&&!l&&_c(e,s))?i=i.filter(c=>c!==s):r=a,s=Qe(s)}return t.set(e,i),i}function Hv(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const s=[...n==="clippingAncestors"?Un(t)?[]:Yv(t,this._c):[].concat(n),i],a=s[0],l=s.reduce((u,c)=>{const d=Lc(t,c,r);return u.top=Re(d.top,u.top),u.right=fn(d.right,u.right),u.bottom=fn(d.bottom,u.bottom),u.left=Re(d.left,u.left),u},Lc(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Gv(e){const{width:t,height:n}=Ic(e);return{width:t,height:n}}function Xv(e,t,n){const i=Le(t),r=Ve(t),o=n==="fixed",s=mt(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=_e(0);function u(){l.x=Zn(r)}if(i||!i&&!o)if((It(t)!=="body"||dn(r))&&(a=qn(t)),i){const m=mt(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&u();o&&!i&&r&&u();const c=r&&!i&&!o?Fc(r,a):_e(0),d=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:d,y:f,width:s.width,height:s.height}}function io(e){return Me(e).position==="static"}function zc(e,t){if(!Le(e)||Me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ve(e)===n&&(n=n.ownerDocument.body),n}function Bc(e,t){const n=Se(e);if(Un(e))return n;if(!Le(e)){let r=Qe(e);for(;r&&!Nt(r);){if(ye(r)&&!io(r))return r;r=Qe(r)}return n}let i=zc(e,t);for(;i&&Hg(i)&&io(i);)i=zc(i,t);return i&&Nt(i)&&io(i)&&!Hr(i)?n:i||Qg(e)||n}const Zv=async function(e){const t=this.getOffsetParent||Bc,n=this.getDimensions,i=await n(e.floating);return{reference:Xv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Jv(e){return Me(e).direction==="rtl"}const Qv={convertOffsetParentRelativeRectToViewportRelativeRect:Bv,getDocumentElement:Ve,getClippingRect:Hv,getOffsetParent:Bc,getElementRects:Zv,getClientRects:$v,getDimensions:Gv,getScale:Ft,isElement:ye,isRTL:Jv};function $c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ex(e,t){let n=null,i;const r=Ve(e);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:m}=u;if(a||t(),!f||!m)return;const v=Yn(d),x=Yn(r.clientWidth-(c+f)),w=Yn(r.clientHeight-(d+m)),h=Yn(c),b={rootMargin:-v+"px "+-x+"px "+-w+"px "+-h+"px",threshold:Re(0,fn(1,l))||1};let k=!0;function y(P){const j=P[0].intersectionRatio;if(j!==l){if(!k)return s();j?s(!1,j):i=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!$c(u,e.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(y,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(y,b)}n.observe(e)}return s(!0),o}function tx(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=no(e),c=r||o?[...u?pn(u):[],...pn(t)]:[];c.forEach(h=>{r&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});const d=u&&a?ex(u,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(h=>{let[T]=h;T&&T.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let v,x=l?mt(e):null;l&&w();function w(){const h=mt(e);x&&!$c(x,h)&&n(),x=h,v=requestAnimationFrame(w)}return n(),()=>{var h;c.forEach(T=>{r&&T.removeEventListener("scroll",n),o&&T.removeEventListener("resize",n)}),d?.(),(h=m)==null||h.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const nx=Lv,ix=(e,t,n)=>{const i=new Map,r={platform:Qv,...n},o={...r.platform,_c:i};return Fv(e,t,{...r,platform:o})};var rx=typeof document<"u",ox=function(){},Jn=rx?S.useLayoutEffect:ox;function Qn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!Qn(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!(o==="_owner"&&e.$$typeof)&&!Qn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Wc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uc(e,t){const n=Wc(e);return Math.round(t*n)/n}function ro(e){const t=C.useRef(e);return Jn(()=>{t.current=e}),t}function sx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=C.useState(i);Qn(f,i)||m(i);const[v,x]=C.useState(null),[w,h]=C.useState(null),T=C.useCallback(q=>{q!==P.current&&(P.current=q,x(q))},[]),b=C.useCallback(q=>{q!==j.current&&(j.current=q,h(q))},[]),k=o||v,y=s||w,P=C.useRef(null),j=C.useRef(null),A=C.useRef(c),M=l!=null,U=ro(l),F=ro(r),Q=ro(u),G=C.useCallback(()=>{if(!P.current||!j.current)return;const q={placement:t,strategy:n,middleware:f};F.current&&(q.platform=F.current),ix(P.current,j.current,q).then(Z=>{const g={...Z,isPositioned:Q.current!==!1};N.current&&!Qn(A.current,g)&&(A.current=g,wo.flushSync(()=>{d(g)}))})},[f,t,n,F,Q]);Jn(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(q=>({...q,isPositioned:!1})))},[u]);const N=C.useRef(!1);Jn(()=>(N.current=!0,()=>{N.current=!1}),[]),Jn(()=>{if(k&&(P.current=k),y&&(j.current=y),k&&y){if(U.current)return U.current(k,y,G);G()}},[k,y,G,U,M]);const ee=C.useMemo(()=>({reference:P,floating:j,setReference:T,setFloating:b}),[T,b]),ie=C.useMemo(()=>({reference:k,floating:y}),[k,y]),X=C.useMemo(()=>{const q={position:n,left:0,top:0};if(!ie.floating)return q;const Z=Uc(ie.floating,c.x),g=Uc(ie.floating,c.y);return a?{...q,transform:"translate("+Z+"px, "+g+"px)",...Wc(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:g}},[n,a,ie.floating,c.x,c.y]);return C.useMemo(()=>({...c,update:G,refs:ee,elements:ie,floatingStyles:X}),[c,G,ee,ie,X])}const ax=(e,t)=>({...nx(e),options:[e,t]}),lx={...C};let qc=!1,cx=0;const Kc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cx++;function ux(){const[e,t]=C.useState(()=>qc?Kc():void 0);return et(()=>{e==null&&t(Kc())},[]),C.useEffect(()=>{qc=!0},[]),e}const Yc=lx.useId||ux;let oo;process.env.NODE_ENV!=="production"&&(oo=new Set);function dx(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const r="Floating UI: "+n.join(" ");if(!((e=oo)!=null&&e.has(r))){var o;(o=oo)==null||o.add(r),console.error(r)}}function px(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}const fx=C.createContext(null),mx=C.createContext(null),hx=()=>{var e;return((e=C.useContext(fx))==null?void 0:e.id)||null},gx=()=>C.useContext(mx);function Hc(e){return"data-floating-ui-"+e}const Gc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Xc=C.forwardRef(function(t,n){const[i,r]=C.useState();et(()=>{jv()&&r("button")},[]);const o={ref:n,tabIndex:0,role:i,"aria-hidden":i?void 0:!0,[Hc("focus-guard")]:"",style:Gc};return p.jsx("span",{...t,...o})}),Zc=C.createContext(null),Jc=Hc("portal");function vx(e){e===void 0&&(e={});const{id:t,root:n}=e,i=Yc(),r=xx(),[o,s]=C.useState(null),a=C.useRef(null);return et(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),et(()=>{if(!i||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=i,u.setAttribute(Jc,""),l.appendChild(u),a.current=u,s(u)},[t,i]),et(()=>{if(n===null||!i||a.current)return;let l=n||r?.portalNode;l&&!Kr(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const c=document.createElement("div");c.id=i,c.setAttribute(Jc,""),l=u||l,l.appendChild(c),a.current=c,s(c)},[t,n,i,r]),o}function so(e){const{children:t,id:n,root:i,preserveTabOrder:r=!0}=e,o=vx({id:n,root:i}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),c=C.useRef(null),d=C.useRef(null),f=s?.modal,m=s?.open,v=!!s&&!s.modal&&s.open&&r&&!!(i||o);return C.useEffect(()=>{if(!o||!r||f)return;function x(w){o&&to(w)&&(w.type==="focusin"?Oc:Nv)(o)}return o.addEventListener("focusin",x,!0),o.addEventListener("focusout",x,!0),()=>{o.removeEventListener("focusin",x,!0),o.removeEventListener("focusout",x,!0)}},[o,r,f]),C.useEffect(()=>{o&&(m||Oc(o))},[m,o]),p.jsxs(Zc.Provider,{value:C.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[r,o]),children:[v&&o&&p.jsx(Xc,{"data-type":"outside",ref:l,onFocus:x=>{if(to(x,o)){var w;(w=c.current)==null||w.focus()}else{const h=s?s.domReference:null,T=Iv(h);T?.focus()}}}),v&&o&&p.jsx("span",{"aria-owns":o.id,style:Gc}),o&&wo.createPortal(t,o),v&&o&&p.jsx(Xc,{"data-type":"outside",ref:u,onFocus:x=>{if(to(x,o)){var w;(w=d.current)==null||w.focus()}else{const h=s?s.domReference:null,T=Mv(h);T?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,x.nativeEvent,"focus-out")}}})]})}const xx=()=>C.useContext(Zc);let ei=0;const Qc="--floating-ui-scrollbar-width";function yx(){const e=Ev(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,s=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Qc,o+"px"),o&&(n[r]=o+"px"),t){var l,u;const c=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,d=((u=window.visualViewport)==null?void 0:u.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(d))+"px",left:-(s-Math.floor(c))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(Qc),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a))}}let eu=()=>{};const ao=C.forwardRef(function(t,n){const{lockScroll:i=!1,...r}=t;return et(()=>{if(i)return ei++,ei===1&&(eu=yx()),()=>{ei--,ei===0&&eu()}},[i]),p.jsx("div",{ref:n,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})});function bx(e){const{open:t=!1,onOpenChange:n,elements:i}=e,r=Yc(),o=C.useRef({}),[s]=C.useState(()=>px()),a=hx()!=null;if(process.env.NODE_ENV!=="production"){const m=i.reference;m&&!ye(m)&&dx("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=C.useState(i.reference),c=Ov((m,v,x)=>{o.current.openEvent=m?v:void 0,s.emit("openchange",{open:m,event:v,reason:x,nested:a}),n?.(m,v,x)}),d=C.useMemo(()=>({setPositionReference:u}),[]),f=C.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return C.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:f,events:s,floatingId:r,refs:d}),[t,c,f,s,r,d])}function wx(e){e===void 0&&(e={});const{nodeId:t}=e,n=bx({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||n,r=i.elements,[o,s]=C.useState(null),[a,l]=C.useState(null),c=r?.domReference||o,d=C.useRef(null),f=gx();et(()=>{c&&(d.current=c)},[c]);const m=sx({...e,elements:{...r,...a&&{reference:a}}}),v=C.useCallback(b=>{const k=ye(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),getClientRects:()=>b.getClientRects(),contextElement:b}:b;l(k),m.refs.setReference(k)},[m.refs]),x=C.useCallback(b=>{(ye(b)||b===null)&&(d.current=b,s(b)),(ye(m.refs.reference.current)||m.refs.reference.current===null||b!==null&&!ye(b))&&m.refs.setReference(b)},[m.refs]),w=C.useMemo(()=>({...m.refs,setReference:x,setPositionReference:v,domReference:d}),[m.refs,x,v]),h=C.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),T=C.useMemo(()=>({...m,...i,refs:w,elements:h,nodeId:t}),[m,w,h,t,i]);return et(()=>{i.dataRef.current.floatingContext=T;const b=f?.nodesRef.current.find(k=>k.id===t);b&&(b.context=T)}),C.useMemo(()=>({...m,context:T,refs:w,elements:h}),[m,w,h,T])}const Tx={top:"bottom center","top-start":"bottom left","top-end":"bottom right",right:"left center","right-start":"top left","right-end":"bottom left",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"top right","left-end":"bottom right"},tu=C.memo(({open:e,children:t,className:n,onOutsideClick:i,floatingStyles:r,setFloating:o,placement:s})=>p.jsx(so,{children:p.jsx(Cn,{children:e&&p.jsxs(p.Fragment,{children:[i&&p.jsx(ao,{onClick:i}),p.jsx("div",{ref:o,style:r,className:"z-50",children:p.jsx(at.div,{className:n,style:{transformOrigin:Tx[s]},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.1,ease:"easeInOut"},children:t})})]})})})),Vt=e=>{const{placement:t="bottom",onOutsideClick:n,fullWidth:i,minWidth:r,maxWidth:o}=e,s=C.useMemo(()=>[ax({apply({rects:d,elements:f}){i&&(f.floating.style.width=`${d.reference.width}px`),r&&(f.floating.style.minWidth=`${r}px`),o&&(f.floating.style.maxWidth=`${o}px`)}})],[i,o,r]),{refs:a,floatingStyles:l}=wx({placement:t,middleware:s,whileElementsMounted:tx}),u=C.useRef({onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t});u.current={onOutsideClick:n,floatingStyles:l,setFloating:a.setFloating,placement:t};const c=C.useMemo(()=>{const d=f=>{const{floatingStyles:m,setFloating:v,onOutsideClick:x,placement:w}=u.current,{className:h,open:T,children:b}=f;return p.jsx(tu,{open:T,className:h,onOutsideClick:x,floatingStyles:m,setFloating:v,placement:w,children:b})};return C.memo(d)},[]);return{anchorRef:a.setReference,Popover:c}},Sx="flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1",kx={sm:"p-2",md:"p-3",lg:"p-4"},Lt=e=>{const{className:t,children:n,padding:i="md",...r}=e;return p.jsx("div",{className:I(Sx,kx[i],t),...r,children:n})},hn=(e,t)=>{S.useEffect(()=>{if(!e)return;const n=i=>{i.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[e,t])},nu=e=>{const{className:t,label:n,description:i,options:r,onChange:o,value:s,placeholder:a,maxHeight:l=300,error:u,size:c="md"}=e,[d,f]=S.useState(!1),m=C.useRef(null),v=r?.find(h=>h.value===s);hn(d,()=>f(!1)),S.useEffect(()=>{d&&m.current?.focus({preventScroll:!0})},[d]);const{anchorRef:x,Popover:w}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>f(!1)});return p.jsx(Je.Provider,{value:c,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:x,children:[p.jsxs("div",{ref:m,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[c],Xe[c],ct[c],Rt[c],u&&"select-trigger-error",d&&"ring-4"),onKeyDown:h=>h.key===" "&&f(T=>!T),onClick:()=>f(!d),children:[v&&p.jsx("span",{children:v.label}),!v&&a&&p.jsx("span",{className:"select-placeholder",children:a})]}),p.jsxs(dt,{children:[u&&p.jsx(Ze,{}),!!s&&p.jsx(Ue,{Icon:ut,onClick:()=>o(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(w,{open:d,children:p.jsx(Lt,{className:"!p-0",style:{maxHeight:l},children:p.jsx("div",{className:"flex flex-col p-2 gap-1",children:r.map(h=>{const T=h.value===s;return p.jsx(un,{onClick:()=>{!h.disabled&&o&&(o(h.value),f(!1))},selected:T,disabled:h.disabled,children:h.label},String(h.value))})})})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:u})]})})},Ex=e=>{const{className:t,label:n,description:i,options:r,onChange:o,onSearch:s,value:a,placeholder:l,maxHeight:u=300,error:c,size:d="md"}=e,[f,m]=S.useState(!1),[v,x]=S.useState(r),[w,h]=S.useState(""),T=C.useRef(null),b=C.useRef(null),k=r?.find(j=>j.value===a);hn(f,()=>m(!1)),S.useEffect(()=>{x(s(w))},[w,r,s]),S.useEffect(()=>{f&&setTimeout(()=>b.current?.focus(),100)},[f]);const{anchorRef:y,Popover:P}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>m(!1)});return p.jsx(Je.Provider,{value:d,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:y,children:[p.jsxs("div",{ref:T,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[d],Xe[d],ct[d],Rt[d],c&&"select-trigger-error",f&&"ring-4"),onKeyDown:j=>j.key===" "&&m(A=>!A),onClick:()=>m(!f),children:[k&&p.jsx("span",{children:k.label}),!k&&l&&p.jsx("span",{className:"select-placeholder",children:l})]}),p.jsxs(dt,{children:[c&&p.jsx(Ze,{}),!!a&&p.jsx(Ue,{Icon:ut,onClick:()=>o(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(P,{open:f,children:p.jsxs(Lt,{className:"gap-0 !p-0",style:{maxHeight:u},children:[p.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[p.jsx("input",{ref:b,type:"text",placeholder:"Search",value:w,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:j=>h(j.target.value)}),p.jsx(Er,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[w!==""&&p.jsxs(p.Fragment,{children:[v.length===0&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Fl,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),v.map(j=>{const A=j.value===a;return p.jsx(un,{onClick:()=>{!j.disabled&&o&&(o(j.value),m(!1))},selected:A,disabled:j.disabled,children:j.label},String(j.value))})]}),w===""&&p.jsx(p.Fragment,{children:r.map(j=>{const A=j.value===a;return p.jsx(un,{onClick:()=>{!j.disabled&&o&&(o(j.value),m(!1))},selected:A,disabled:j.disabled,children:j.label},String(j.value))})})]})]})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:c})]})})},jx=(e,t)=>{const[n,i]=S.useState(e);return S.useEffect(()=>{const r=setTimeout(()=>{i(e)},t);return()=>{clearTimeout(r)}},[e,t]),n},Cx=e=>{const{className:t,label:n,description:i,onChange:r,fetchOptionsByQuery:o,fetchOptionByValue:s,onSearchDebounceMs:a=300,value:l,placeholder:u,maxHeight:c=300,error:d,size:f="md"}=e,[m,v]=S.useState(!1),x=C.useRef(null),[w,h]=S.useState(""),[T,b]=S.useState([]),[k,y]=S.useState(null),P=C.useRef(null),[j,A]=S.useState(!1),[M,U]=S.useState(!1);hn(m,()=>v(!1));const F=jx(w,a);S.useEffect(()=>{(async()=>{A(!0);const ee=await o(F);b(ee),A(!1)})()},[F,o]),S.useEffect(()=>{if(l==null){y(null);return}const N=T?.find(ee=>ee.value===l);N?y(N):(async()=>{U(!0);const ie=await s(l);y(ie),U(!1)})()},[s,T,l]),S.useEffect(()=>{m&&setTimeout(()=>P.current?.focus(),100)},[m]);const{anchorRef:Q,Popover:G}=Vt({placement:"bottom",fullWidth:!0,onOutsideClick:()=>v(!1)});return p.jsx(Je.Provider,{value:f,children:p.jsxs("div",{className:I("flex flex-col",t),children:[p.jsx(We,{children:n}),p.jsxs("div",{className:"relative flex w-full flex-col",ref:Q,children:[p.jsxs("div",{ref:x,role:"button",tabIndex:0,className:I("flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",lt[f],Xe[f],ct[f],Rt[f],d&&"select-trigger-error",m&&"ring-4"),onKeyDown:N=>N.key===" "&&v(ee=>!ee),onClick:()=>v(!m),children:[!M&&k&&p.jsx("span",{children:k.label}),!M&&!k&&u&&p.jsx("span",{className:"select-placeholder",children:u}),M&&p.jsx(Dt,{className:"h-4 w-4 text-[var(--color-input-text)]"})]}),p.jsxs(dt,{children:[d&&p.jsx(Ze,{}),!!l&&p.jsx(Ue,{Icon:ut,onClick:()=>r(null)}),p.jsx(Ue,{Icon:an})]}),p.jsx(G,{open:m,children:p.jsxs(Lt,{className:"gap-0 !p-0",style:{maxHeight:c},children:[p.jsxs("div",{className:"sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm",children:[p.jsx("input",{ref:P,type:"text",placeholder:"Search",value:w,className:"appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",onChange:N=>h(N.target.value)}),p.jsx(Er,{className:"absolute select-search-icon left-4 top-4 h-4 w-4"})]}),p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[!j&&T.length===0&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Fl,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),j&&p.jsx("div",{className:"flex flex-col items-center justify-center py-6",children:p.jsx(Dt,{className:"h-6 w-6 text-[var(--color-input-text)]"})}),!j&&p.jsx(p.Fragment,{children:T.map(N=>{const ee=N.value===l;return p.jsx(un,{onClick:()=>{!N.disabled&&r&&(r(N.value),v(!1))},selected:ee,disabled:N.disabled,children:N.label},String(N.value))})})]})]})})]}),p.jsx(Ae,{children:i}),p.jsx(De,{children:d})]})})},Px=C.forwardRef((e,t)=>{const{className:n,children:i,...r}=e;return p.jsx("div",{ref:t,className:I("flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",n),...r,children:i})}),Ax=C.forwardRef((e,t)=>{const{className:n,children:i,...r}=e;return p.jsx("div",{ref:t,className:I("flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",n),...r,children:i})}),iu="input-description text-sm font-medium",Dx=e=>{const{className:t,label:n,children:i,orientation:r="vertical",...o}=e;return r==="horizontal"?p.jsxs("div",{className:I("flex flex-row items-center gap-3 px-3 py-2",t),...o,children:[p.jsx("div",{className:I(iu,"w-1/2 line-clamp-1 break-all"),children:n}),p.jsx("div",{className:"w-1/2 line-clamp-1 break-all",children:i})]}):p.jsxs("div",{className:I("flex flex-col gap-1 px-3 py-2",t),...o,children:[n&&p.jsx("div",{className:iu,children:n}),p.jsx("div",{children:i})]})},Rx={error:Cr,warning:kh,success:jr,info:Eh},Ox={error:"text-[var(--color-status-error)]",warning:"text-[var(--color-status-warning)]",success:"text-[var(--color-status-success)]",info:"text-[var(--color-status-info)]"},ru="inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",Mx=e=>{const{className:t,children:n,Icon:i,status:r,...o}=e,s=r?Rx[r]:null,a=p.jsxs(p.Fragment,{children:[p.jsxs("span",{className:"inline-flex flex-row items-center gap-3 min-w-0",children:[i&&p.jsx(i,{className:"h-5 w-5 shrink-0"}),p.jsx("span",{className:"truncate",children:n})]}),p.jsxs("span",{className:"inline-flex flex-row items-center gap-2 shrink-0",children:[s&&r&&p.jsx(s,{className:I("h-5 w-5",Ox[r])}),p.jsx(vh,{className:"h-5 w-5 text-[var(--color-input-icon-button-icon)]"})]})]});if(o.href!==void 0){const{href:l,...u}=o;return p.jsx("a",{href:l,className:I(ru,t),...u,children:a})}return p.jsx("button",{className:I(ru,t),...o,children:a})},Ix=e=>{const{className:t,vertical:n=!1,...i}=e;return p.jsx("div",{className:I(n?"w-px h-full bg-[var(--color-divider)]":"w-full h-px bg-[var(--color-divider)]",t),...i})},Nx=e=>{const{children:t,content:n,className:i,placement:r="top",minWidth:o=100,maxWidth:s=200}=e,[a,l]=S.useState(!1),{anchorRef:u,Popover:c}=Vt({placement:r,minWidth:o,maxWidth:s});return p.jsxs("span",{ref:u,className:i,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,p.jsx(c,{open:a,children:p.jsx(Lt,{children:n})})]})},Fx=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:i,enableDismissOnEscKey:r,enableDismissButton:o,className:s,children:a,maxWidth:l=600}=e;return hn(!!r&&t,n||(()=>{})),p.jsx(Cn,{children:t&&p.jsxs(so,{children:[p.jsx(at.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:p.jsx(ao,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:i?n:void 0,lockScroll:!0})}),p.jsx("div",{className:"fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-20",children:p.jsxs(at.div,{className:I("flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",s),style:{transformOrigin:"bottom",maxWidth:l},initial:{opacity:0,scale:.98,translateY:10},animate:{opacity:1,scale:1,translateY:0},exit:{opacity:0,scale:.98,translateY:10},transition:{duration:.15,ease:"easeInOut"},children:[o&&p.jsx(kr,{Icon:ut,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},Vx=e=>{const{open:t,onDismiss:n,enableDismissOnOutsideClick:i,enableDismissOnEscKey:r,enableDismissButton:o,className:s,children:a,maxWidth:l=480}=e;return hn(!!r&&t,n||(()=>{})),p.jsx(Cn,{children:t&&p.jsxs(so,{children:[p.jsx(at.div,{style:{transformOrigin:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},children:p.jsx(ao,{className:"modal-overlay backdrop-blur-[1px] z-10",onClick:i?n:void 0,lockScroll:!0})}),p.jsx("div",{className:"fixed inset-0 flex flex-row justify-end pointer-events-none z-20",children:p.jsxs(at.div,{className:I("flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",s),style:{maxWidth:l},initial:{translateX:"100%"},animate:{translateX:0},exit:{translateX:"100%"},transition:{duration:.25,ease:[.32,.72,0,1]},children:[o&&p.jsx(kr,{Icon:ut,className:"absolute top-4 right-4",variant:"transparent",size:"sm",onClick:n}),a]})})]})})},ou={red:"bg-red-100 text-red-700 ring-red-200 dark:bg-red-950 dark:text-red-300 dark:ring-red-800",orange:"bg-orange-100 text-orange-700 ring-orange-200 dark:bg-orange-950 dark:text-orange-300 dark:ring-orange-800",amber:"bg-amber-100 text-amber-700 ring-amber-200 dark:bg-amber-950 dark:text-amber-300 dark:ring-amber-800",yellow:"bg-yellow-100 text-yellow-700 ring-yellow-200 dark:bg-yellow-950 dark:text-yellow-300 dark:ring-yellow-800",lime:"bg-lime-100 text-lime-700 ring-lime-200 dark:bg-lime-950 dark:text-lime-300 dark:ring-lime-800",green:"bg-green-100 text-green-700 ring-green-200 dark:bg-green-950 dark:text-green-300 dark:ring-green-800",emerald:"bg-emerald-100 text-emerald-700 ring-emerald-200 dark:bg-emerald-950 dark:text-emerald-300 dark:ring-emerald-800",teal:"bg-teal-100 text-teal-700 ring-teal-200 dark:bg-teal-950 dark:text-teal-300 dark:ring-teal-800",cyan:"bg-cyan-100 text-cyan-700 ring-cyan-200 dark:bg-cyan-950 dark:text-cyan-300 dark:ring-cyan-800",sky:"bg-sky-100 text-sky-700 ring-sky-200 dark:bg-sky-950 dark:text-sky-300 dark:ring-sky-800",blue:"bg-blue-100 text-blue-700 ring-blue-200 dark:bg-blue-950 dark:text-blue-300 dark:ring-blue-800",indigo:"bg-indigo-100 text-indigo-700 ring-indigo-200 dark:bg-indigo-950 dark:text-indigo-300 dark:ring-indigo-800",violet:"bg-violet-100 text-violet-700 ring-violet-200 dark:bg-violet-950 dark:text-violet-300 dark:ring-violet-800",purple:"bg-purple-100 text-purple-700 ring-purple-200 dark:bg-purple-950 dark:text-purple-300 dark:ring-purple-800",fuchsia:"bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200 dark:bg-fuchsia-950 dark:text-fuchsia-300 dark:ring-fuchsia-800",pink:"bg-pink-100 text-pink-700 ring-pink-200 dark:bg-pink-950 dark:text-pink-300 dark:ring-pink-800",rose:"bg-rose-100 text-rose-700 ring-rose-200 dark:bg-rose-950 dark:text-rose-300 dark:ring-rose-800",slate:"bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-950 dark:text-slate-300 dark:ring-slate-800",gray:"bg-gray-100 text-gray-700 ring-gray-200 dark:bg-gray-950 dark:text-gray-300 dark:ring-gray-800",zinc:"bg-zinc-100 text-zinc-700 ring-zinc-200 dark:bg-zinc-950 dark:text-zinc-300 dark:ring-zinc-800",neutral:"bg-neutral-100 text-neutral-700 ring-neutral-200 dark:bg-neutral-950 dark:text-neutral-300 dark:ring-neutral-800",stone:"bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",white:"bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",black:"bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"},lo=C.forwardRef((e,t)=>{const{className:n,children:i,onClick:r,showCloseIcon:o,Icon:s,color:a="gray"}=e,l=I("inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",ou[a],n);return r?p.jsx("div",{ref:t,children:p.jsxs("button",{className:I("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4",l),onClick:r,children:[s&&p.jsx(s,{className:"h-4 w-4 shrink-0"}),p.jsx("div",{className:"break-all line-clamp-1 text-left",children:i}),o&&p.jsx(ut,{className:"h-4 w-4 shrink-0"})]})}):p.jsxs("div",{className:l,ref:t,children:[s&&p.jsx(s,{className:"h-4 w-4 shrink-0"}),p.jsx("div",{className:"break-all line-clamp-1 text-left",children:i})]})}),su=e=>{const{className:t,tabs:n}=e;return p.jsx("div",{className:I("h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",t),children:n.map((i,r)=>{const o=I("shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",i.active&&"tab-button-active shadow-sm");return i.href?p.jsxs("a",{href:i.href,className:o,children:[i.Icon&&p.jsx(i.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),i.label]},r):p.jsxs("button",{className:o,onClick:i.onClick,children:[i.Icon&&p.jsx(i.Icon,{className:"h-5 w-5 shrink-0 mr-2 -ml-1"}),i.label]},r)})})},Lx=e=>{const{duration:t=.3,ease:n="easeInOut",horizontal:i=!1,children:r,className:o,...s}=e,a=C.useRef(null),l=C.useRef(null),u=C.useRef(null);return C.useEffect(()=>{const c=a.current,d=l.current;if(!c||!d)return;let f=!0;const m=()=>{const x=i?c.scrollWidth-c.clientWidth:c.scrollHeight-c.clientHeight,w=i?c.scrollLeft:c.scrollTop;if(!(x<=0||Math.abs(x-w)<1)){if(f){f=!1,i?c.scrollLeft=x:c.scrollTop=x;return}u.current?.stop(),u.current=th(w,x,{duration:t,ease:n,onUpdate:h=>{i?c.scrollLeft=h:c.scrollTop=h}})}},v=new ResizeObserver(m);return v.observe(d),()=>{v.disconnect(),u.current?.stop()}},[t,n,i]),p.jsx("div",{ref:a,className:I("min-h-0 min-w-0",i?"overflow-x-auto":"overflow-y-auto",o),...s,children:p.jsx("div",{ref:l,children:r})})},au=S.createContext(void 0),_x=()=>({dismiss:S.useContext(au)||(()=>{})}),zx="inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent",Te=C.forwardRef((e,t)=>{const{className:n,children:i,Icon:r,onClick:o,dismissOnClick:s=!0,...a}=e,{dismiss:l}=_x(),u=c=>{o&&o(c),s&&l()};return p.jsxs("button",{ref:t,className:I(zx,n),onClick:u,...a,children:[r&&p.jsx(r,{className:"h-5 w-5"}),i]})}),co=e=>{const{label:t,children:n,className:i}=e;return p.jsxs("div",{className:I("flex flex-col dropdown-button-group",i),children:[t&&p.jsx("div",{className:"mb-2 text-sm dropdown-group-label font-semibold px-3",children:t}),n]})},uo=e=>{const{trigger:t,children:n,placement:i="bottom-end",minWidth:r=200,className:o}=e,[s,a]=S.useState(!1),{Popover:l,anchorRef:u}=Vt({placement:i,onOutsideClick:()=>a(!1),minWidth:r});return p.jsxs(p.Fragment,{children:[p.jsx("div",{ref:u,className:o,onClick:()=>a(!s),children:t}),p.jsx(l,{open:s,children:p.jsx(Lt,{padding:"sm",children:p.jsx(au.Provider,{value:()=>a(!1),children:n})})})]})};function Bx(e){const{onDelta:t,onDragStart:n,onDragEnd:i,disabled:r=!1,primaryButtonOnly:o=!0,preventScrollOnMove:s=!0}=e,[a,l]=C.useState(!1),u=C.useRef(!1),c=C.useRef(0),d=C.useRef(0),f=C.useRef(0),m=C.useRef(null),v=C.useRef(null),x=C.useRef({onDelta:t,onDragStart:n,onDragEnd:i,preventScrollOnMove:s});C.useEffect(()=>{x.current={onDelta:t,onDragStart:n,onDragEnd:i,preventScrollOnMove:s}});const w=C.useRef({}),h=C.useCallback(b=>{if(!u.current)return;const k={clientX:b??d.current,startX:c.current,totalDeltaX:f.current,target:m.current};u.current=!1,l(!1);const{move:y,up:P,keydown:j}=w.current;y&&window.removeEventListener("pointermove",y,!0),P&&(window.removeEventListener("pointerup",P,!0),window.removeEventListener("pointercancel",P,!0)),j&&window.removeEventListener("keydown",j,!0),w.current={},v.current!=null&&(cancelAnimationFrame(v.current),v.current=null),x.current.onDragEnd?.(k),m.current=null,f.current=0},[]),T=C.useCallback(b=>{if(r||o&&b.button!==0)return;b.target.setPointerCapture?.(b.pointerId),c.current=b.clientX,d.current=b.clientX,f.current=0,m.current=b.target,u.current=!0,l(!0);const k={clientX:b.clientX,startX:b.clientX,totalDeltaX:0,target:b.target};x.current.onDragStart?.(k);const y=A=>{u.current&&v.current==null&&(v.current=requestAnimationFrame(()=>{v.current=null;const M=A.clientX,U=M-d.current;if(U===0)return;d.current=M,f.current+=U;const F={clientX:M,startX:c.current,totalDeltaX:f.current,target:m.current};x.current.preventScrollOnMove&&A.preventDefault(),x.current.onDelta(U,F)}))},P=A=>{h(A.clientX)},j=A=>{A.key==="Escape"&&(A.preventDefault(),h())};w.current={move:y,up:P,keydown:j},window.addEventListener("pointermove",y,{passive:!s,capture:!0}),window.addEventListener("pointerup",P,{capture:!0}),window.addEventListener("pointercancel",P,{capture:!0}),window.addEventListener("keydown",j,!0)},[h,r,s,o]);return C.useEffect(()=>()=>{u.current&&h()},[h]),{isDragging:a,bind:{onPointerDown:T,role:"separator",style:{touchAction:"none",cursor:"col-resize",userSelect:"none"}}}}const $x=e=>{const{column:t,width:n,height:i,onResize:r,sortDirection:o,onSortClick:s}=e,a=!!t.sortable,{bind:l}=Bx({onDelta:u=>r(u)});return p.jsxs("div",{style:{width:n,height:i},className:"flex flex-row items-stretch select-none shrink-0",children:[p.jsxs("div",{className:I("flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",a&&"cursor-pointer"),onClick:a?s:void 0,children:[p.jsx("span",{className:"truncate",children:t.header}),a&&o==="asc"&&p.jsx(xh,{className:"h-4 w-4 shrink-0"}),a&&o==="desc"&&p.jsx(an,{className:"h-4 w-4 shrink-0"})]}),p.jsx("div",{...l,className:"cursor-ew-resize group py-4 table-resize-handle w-[8px]",children:p.jsx("div",{className:"w-0.5 h-full mx-auto table-resize-divider table-resize-divider-hover pointer-events-none"})})]})},_t=200,Wx=60,Ux=e=>{const t={};for(const n of e)t[n.id]=n.defaultWidth??_t;return t},qx=e=>{const{columns:t,rows:n,getRowId:i,onRowClick:r,sort:o,onSortChange:s,className:a,rowHeight:l=44,headerHeight:u=44}=e,[c,d]=S.useState(()=>Ux(t));S.useEffect(()=>{d(h=>{const T={};let b=Object.keys(h).length!==t.length;for(const k of t)k.id in h?T[k.id]=h[k.id]:(T[k.id]=k.defaultWidth??_t,b=!0);return b?T:h})},[t]);const f=S.useCallback((h,T,b)=>{d(k=>{const y=k[h]??_t,P=Math.max(b,y+T);return P===y?k:{...k,[h]:P}})},[]),m=S.useCallback(h=>{if(s){if(!o||o.columnId!==h){s({columnId:h,direction:"asc"});return}if(o.direction==="asc"){s({columnId:h,direction:"desc"});return}s(null)}},[o,s]),v=t.reduce((h,T)=>h+(c[T.id]??T.defaultWidth??_t),0),x=S.useRef(null),w=h=>{x.current&&(x.current.scrollLeft=h.currentTarget.scrollLeft)};return p.jsxs("div",{className:I("flex flex-col h-full w-full",a),children:[p.jsx("div",{ref:x,className:"overflow-hidden shrink-0",style:{height:u},children:p.jsx("div",{className:"flex flex-row table-header font-medium",style:{width:v,minWidth:"100%"},children:t.map(h=>p.jsx($x,{column:h,width:c[h.id]??h.defaultWidth??_t,height:u,onResize:T=>f(h.id,T,h.minWidth??Wx),sortDirection:o?.columnId===h.id?o.direction:null,onSortClick:()=>m(h.id)},h.id))})}),p.jsx("div",{className:"flex-1 overflow-auto",onScroll:w,children:p.jsx("div",{className:"flex flex-col",style:{width:v,minWidth:"100%"},children:n.map((h,T)=>p.jsx("div",{className:I("flex flex-row table-body-row transition-colors duration-100",r&&"cursor-pointer"),onClick:r?()=>r(h,T):void 0,children:t.map(b=>p.jsx("div",{className:"shrink-0 content-center px-4 relative",style:{width:c[b.id]??b.defaultWidth??_t,height:l},children:p.jsx("div",{className:"break-all line-clamp-1",children:b.renderCell(h,T)})},b.id))},i(h,T)))})})]})},Kx=()=>p.jsx("div",{}),Yx=[{id:1,email:"sarah.jennings@example.com",firstname:"Sarah",lastname:"Jennings",status:"active"},{id:2,email:"liam.patel@outlook.com",firstname:"Liam",lastname:"Patel",status:"inactive"},{id:3,email:"emily.wong@gmail.com",firstname:"Emily",lastname:"Wong",status:"active"},{id:4,email:"noah.thompson@yahoo.com",firstname:"Noah",lastname:"Thompson",status:"active"},{id:5,email:"isabella.martin@protonmail.com",firstname:"Isabella",lastname:"Martin",status:"active"},{id:6,email:"ethan.ross@company.io",firstname:"Ethan",lastname:"Ross",status:"inactive"},{id:7,email:"olivia.nguyen@example.org",firstname:"Olivia",lastname:"Nguyen",status:"active"},{id:8,email:"lucas.henderson@gmail.com",firstname:"Lucas",lastname:"Henderson",status:"inactive"},{id:9,email:"mia.johnson@workmail.com",firstname:"Mia",lastname:"Johnson",status:"active"},{id:10,email:"jackson.rivera@outlook.com",firstname:"Jackson",lastname:"Rivera",status:"active"},{id:11,email:"ava.sanders@example.com",firstname:"Ava",lastname:"Sanders",status:"active"},{id:12,email:"logan.bennett@company.io",firstname:"Logan",lastname:"Bennett",status:"inactive"}],Hx=[{id:"id",header:"ID",renderCell:e=>e.id},{id:"email",header:"Email",renderCell:e=>p.jsx(lo,{Icon:jh,onClick:()=>{},children:e.email})},{id:"firstname",header:"First Name",renderCell:e=>e.firstname},{id:"lastname",header:"Last Name",renderCell:e=>e.lastname},{id:"status",header:"Status",renderCell:()=>p.jsx(Xx,{})}],Gx=()=>p.jsxs("div",{className:"flex flex-col gap-6",children:[p.jsxs("div",{className:"flex flex-row items-center justify-start gap-3",children:[p.jsx(Pr,{Icon:Er,placeholder:"Search..."}),p.jsx(Fn,{Icon:Vl}),p.jsx(Ml,{Icon:Nl,children:"New"}),p.jsxs(uo,{trigger:p.jsx(Fn,{Icon:Vl}),children:[p.jsx(Te,{dismissOnClick:!1,Icon:Nl,children:"Add new"}),p.jsx(Te,{Icon:Sh,children:"Remove"}),p.jsxs(co,{label:"Test",className:"mt-2",children:[p.jsx(Te,{children:"Item 1"}),p.jsx(Te,{children:"Item 2"}),p.jsx(Te,{children:"Item 3"}),p.jsx(Te,{children:"Item 4"})]}),p.jsxs(co,{label:"Test",className:"mt-2",children:[p.jsx(Te,{children:"Item 1"}),p.jsx(Te,{children:"Item 2"}),p.jsx(Te,{children:"Item 3"}),p.jsx(Te,{children:"Item 4"})]})]}),p.jsx(su,{tabs:[{label:"Tab 1",Icon:Il,active:!0,onClick:()=>{}},{label:"Tab 2",active:!1,onClick:()=>{}},{label:"Tab 3",Icon:Il,active:!1,onClick:()=>{}}]})]}),p.jsx(nu,{options:[{label:"Option 1",value:1},{label:"Option 2",value:2},{label:"Option 3",value:3}],value:null,onChange:()=>{}}),p.jsx(qx,{className:"h-[300px] w-[300px]",columns:Hx,rows:Yx,getRowId:e=>e.id}),p.jsx(Kx,{})]}),Xx=()=>p.jsx(p.Fragment,{children:p.jsxs(uo,{placement:"bottom-end",className:"inline-block",trigger:p.jsx(lo,{onClick:()=>{},children:"Test"}),children:[p.jsx(Te,{children:"Option 1"}),p.jsx(Te,{children:"Option 2"}),p.jsx(Te,{children:"Option 3"})]})});W.AutoScroll=Lx,W.Badge=lo,W.BadgeColor=ou,W.Button=Ml,W.ButtonIconRound=kr,W.ButtonIconSquare=Fn,W.Divider=Ix,W.DropdownButton=Te,W.DropdownButtonGroup=co,W.DropdownMenu=uo,W.DropdownPanel=Lt,W.Input=Pr,W.InputCheck=Nh,W.InputDescription=Ae,W.InputError=De,W.InputErrorIcon=Ze,W.InputFileMultiple=Ug,W.InputFileSingle=$g,W.InputIconButton=Ue,W.InputIconButtonTray=dt,W.InputLabel=We,W.InputPassword=Ph,W.InputRadio=Mh,W.InputSelect=nu,W.InputSelectNative=qg,W.InputSelectOption=un,W.InputSelectSearchable=Ex,W.InputSelectSearchableAsync=Cx,W.InputTextArea=Oh,W.InputToggle=Ih,W.Modal=Fx,W.Panel=Px,W.PanelField=Dx,W.PanelLink=Mx,W.PanelStack=Ax,W.PopoverBase=tu,W.SidebarModal=Vx,W.Spinner=Dt,W.TabButtons=su,W.Test=Gx,W.Tooltip=Nx,W.UploadFileTile=yc,W.usePopover=Vt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
183
183
  //# sourceMappingURL=index.umd.cjs.map