UNPKG

@accounter/client

Version:
41 lines 100 kB
import{s as e}from"./dist-ypP48_Ax.js";import{i as t,o as n,t as r}from"./utils-CbS-oR5I.js";import{i}from"./error-handling-CKe_iwSC.js";import{n as a}from"./loader-circle-CfW9jOIr.js";import{i as o,s}from"./button-DUNsVBiu.js";var c=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),l=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),u=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),d=a(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),f=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),p=a(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),m=e(n(),1),h=e(i(),1),g=t(),_=Object.defineProperty,v=(e,t)=>_(e,`name`,{value:t,configurable:!0}),y=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=o(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,g.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function b(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}v(b,`dispatchDiscreteCustomEvent`);var x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0}),C=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),w=m.forwardRef(S(function(e,t){return(0,g.jsx)(y.span,{...e,ref:t,style:{...C,...e.style}})},`VisuallyHidden`)),T=Object.defineProperty,E=(e,t)=>T(e,`name`,{value:t,configurable:!0});function D(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=E(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,g.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return E(i,`useContext`),[r,i]}E(D,`createContext`);function O(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=E(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,g.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return E(s,`useContext`),[o,s]}E(r,`createContext`);let i=E(()=>{let t=n.map(e=>m.createContext(e));return E(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,k(i,...t)]}E(O,`createContextScope`);function k(...e){let t=e[0];if(e.length===1)return t;let n=E(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return E(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}E(k,`composeContextScopes`);var A=Object.defineProperty,j=(e,t)=>A(e,`name`,{value:t,configurable:!0});function M(e){let t=e+`CollectionProvider`,[n,r]=O(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j(e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,g.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);c.displayName=t;let l=e+`CollectionSlot`,u=o(l),d=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=s(t,i.collectionRef);return(0,g.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,h=o(f),_=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),c=s(t,o),l=a(f,n);return m.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,g.jsx)(h,{[p]:``,ref:c,children:r})});_.displayName=f;function v(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return j(v,`useCollection`),[{Provider:c,Slot:d,ItemSlot:_},v,r]}j(M,`createCollection`);var N=new WeakMap,P=class e extends Map{static{j(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],N.set(this,!0)}set(e,t){return N.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=I(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=F(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=F(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return F(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function F(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ee(e,t);return n===-1?void 0:e[n]}j(F,`at`);function ee(e,t){let n=e.length,r=I(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}j(ee,`toSafeIndex`);function I(e){return e!==e||e===0?0:Math.trunc(e)}j(I,`toSafeInteger`);function L(e){let t=e+`CollectionProvider`,[n,r]=O(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new P,setItemMap:j(()=>void 0,`setItemMap`)}),c=j(({state:e,...t})=>e?(0,g.jsx)(u,{...t,state:e}):(0,g.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=j(e=>{let t=y();return(0,g.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=t+`Init`;let u=j(e=>{let{scope:t,children:n,state:r}=e,a=m.useRef(null),[o,c]=m.useState(null),l=s(a,c),[u,d]=r;return m.useEffect(()=>{if(!o)return;let e=ie(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,g.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);u.displayName=t+`Impl`;let d=e+`CollectionSlot`,f=o(d),p=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(d,n),o=s(t,i.collectionRef);return(0,g.jsx)(f,{ref:o,children:r})});p.displayName=d;let h=e+`CollectionItemSlot`,_=o(h),v=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),[c,l]=m.useState(null),u=s(t,o,l),{setItemMap:d}=a(h,n),f=m.useRef(i);te(f.current,i)||(f.current=i);let p=f.current;return m.useEffect(()=>{let e=p;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(re):(t.set(c,{...e,element:c}),t.toSorted(re)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new P(e)))}},[c,p,d]),(0,g.jsx)(_,{"data-radix-collection-item":``,ref:u,children:r})});v.displayName=h;function y(){return m.useState(new P)}j(y,`useInitCollection`);function b(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return j(b,`useCollection`),[{Provider:c,Slot:p,ItemSlot:v},{createCollectionScope:r,useCollection:b,useInitCollection:y}]}j(L,`createCollection`);function te(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}j(te,`shallowEqual`);function ne(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}j(ne,`isElementPreceding`);function re(e,t){return!e[1].element||!t[1].element?0:ne(e[1].element,t[1].element)?-1:1}j(re,`sortByDocumentPosition`);function ie(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}j(ie,`getChildListObserver`);var ae=Object.defineProperty,oe=(e,t)=>ae(e,`name`,{value:t,configurable:!0}),se=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return oe(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}oe(R,`composeEventHandlers`);function ce(e){if(!se)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}oe(ce,`getOwnerWindow`);function le(e){if(!se)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}oe(le,`getOwnerDocument`);function ue(e,t=!1){let{activeElement:n}=le(e);if(!n?.nodeName)return null;if(de(n)&&n.contentDocument)return ue(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=le(n).getElementById(e);if(t)return t}}return n}oe(ue,`getActiveElement`);function de(e){return e.tagName===`IFRAME`}oe(de,`isFrame`);var z=globalThis?.document?m.useLayoutEffect:()=>{},fe=Object.defineProperty,pe=(e,t)=>fe(e,`name`,{value:t,configurable:!0}),me=m.useEffectEvent,he=m.useInsertionEffect;function ge(e){if(typeof me==`function`)return me(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof he==`function`?he(()=>{t.current=e}):z(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}pe(ge,`useEffectEvent`);var _e=Object.defineProperty,ve=(e,t)=>_e(e,`name`,{value:t,configurable:!0}),ye=m.useInsertionEffect||z;function be({prop:e,defaultProp:t,onChange:n=ve(()=>{},`onChange`),caller:r}){let[i,a,o]=xe({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Se(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ve(be,`useControllableState`);function xe({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return ye(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ve(xe,`useUncontrolledState`);function Se(e){return typeof e==`function`}ve(Se,`isFunction`);var Ce=Symbol(`RADIX:SYNC_STATE`);function we(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ge(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Ce)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ce,state:i})},[i,d.state,c]),[g,f]}ve(we,`useControllableStateReducer`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function De(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}Ee(De,`useStateMachine`);var Oe=Ee(e=>{let{present:t,children:n}=e,r=ke(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=je(r.ref,Ne(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function ke(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=De(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??Me(r.current),o.current=void 0):a.current=`none`},[s]),z(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Me(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),z(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ee(a=>{let o=Me(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ee(e=>{e.target===t&&(a.current=Me(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Me(t)}else r.current=null;n(e)},[])}}Ee(ke,`usePresence`);function Ae(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ee(Ae,`setRef`);function je(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ae(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ae(n[e],null)}}},[])}Ee(je,`useStableComposedRefs`);function Me(e){return e?.animationName||`none`}Ee(Me,`getAnimationName`);function Ne(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ee(Ne,`getElementRef`);var Pe=Object.defineProperty,Fe=(e,t)=>Pe(e,`name`,{value:t,configurable:!0}),Ie=m.useId||(()=>void 0),Le=0;function Re(e){let[t,n]=m.useState(Ie());return z(()=>{e||n(e=>e??String(Le++))},[e]),e||(t?`radix-${t}`:``)}Fe(Re,`useId`);var ze=Object.defineProperty,Be=(e,t)=>ze(e,`name`,{value:t,configurable:!0}),Ve=m.createContext(void 0);function He(e){let t=m.useContext(Ve);return e||t||`ltr`}Be(He,`useDirection`);var Ue=Object.defineProperty,We=(e,t)=>Ue(e,`name`,{value:t,configurable:!0});function B(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}We(B,`useCallbackRef`);var Ge=Object.defineProperty,V=(e,t)=>Ge(e,`name`,{value:t,configurable:!0}),Ke=`dismissableLayer.update`,qe=`dismissableLayer.pointerDownOutside`,Je=`dismissableLayer.focusOutside`,Ye,Xe=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ze=m.forwardRef(V(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=m.useContext(Xe),[f,p]=m.useState(null),h=f?.ownerDocument??globalThis?.document,[,_]=m.useState({}),v=s(t,p),b=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x?b.indexOf(x):-1,C=f?b.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,E=m.useRef(!1),D=et(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return T&&!t},[d.branches,T])}),O=tt(e=>{if(r&&E.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h),k=f?C===b.length-1:!1,A=B(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return m.useEffect(()=>{if(k)return h.addEventListener(`keydown`,A,{capture:!0}),()=>h.removeEventListener(`keydown`,A,{capture:!0})},[h,k,A]),m.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ye=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),nt(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Ye))}},[f,h,n,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),nt())},[f,d]),m.useEffect(()=>{let e=V(()=>_({}),`handleUpdate`);return document.addEventListener(Ke,e),()=>document.removeEventListener(Ke,e)},[]),(0,g.jsx)(y.div,{...u,ref:v,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,O.onFocusCapture),onBlurCapture:R(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,D.onPointerDownCapture)})},`DismissableLayer`));function Qe(){let e=m.useContext(Xe),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}V(Qe,`useDismissableLayerSurface`);var $e=V(()=>!0,`IS_TRUE`);function et(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=$e}=t,s=B(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}V(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}V(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}V(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}V(p,`handleInteractionBubble`);let m=V(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||rt(qe,s,p,{discrete:!0})};if(V(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:V(()=>c.current=!0,`onPointerDownCapture`)}}V(et,`usePointerDownOutside`);function tt(e,t=globalThis?.document){let n=B(e),r=m.useRef(!1);return m.useEffect(()=>{let e=V(e=>{e.target&&!r.current&&rt(Je,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:V(()=>r.current=!0,`onFocusCapture`),onBlurCapture:V(()=>r.current=!1,`onBlurCapture`)}}V(tt,`useFocusOutside`);function nt(){let e=new CustomEvent(Ke);document.dispatchEvent(e)}V(nt,`dispatchUpdate`);function rt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?b(i,a):i.dispatchEvent(a)}V(rt,`handleAndDispatchCustomEvent`);var it=Object.defineProperty,H=(e,t)=>it(e,`name`,{value:t,configurable:!0}),at=`focusScope.autoFocusOnMount`,ot=`focusScope.autoFocusOnUnmount`,st={bubbles:!1,cancelable:!0},ct=m.forwardRef(H(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=m.useState(null),u=B(i),d=B(a),f=m.useRef(null),p=s(t,l),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(h.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:ht(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||ht(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ht(c)};H(e,`handleFocusIn`),H(t,`handleFocusOut`),H(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,h.paused]),m.useEffect(()=>{if(c){gt.add(h);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(at,st);c.addEventListener(at,u),c.dispatchEvent(t),t.defaultPrevented||(lt(yt(dt(c)),{select:!0}),document.activeElement===e&&ht(c))}return()=>{c.removeEventListener(at,u),setTimeout(()=>{let t=new CustomEvent(ot,st);c.addEventListener(ot,d),c.dispatchEvent(t),t.defaultPrevented||ht(e??document.body,{select:!0}),c.removeEventListener(ot,d),gt.remove(h)},0)}}},[c,u,d,h]);let _=m.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ut(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ht(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ht(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,g.jsx)(y.div,{tabIndex:-1,...o,ref:p,onKeyDown:_})},`FocusScope`));function lt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ht(r,{select:t}),document.activeElement!==n)return}H(lt,`focusFirst`);function ut(e){let t=dt(e);return[ft(t,e),ft(t.reverse(),e)]}H(ut,`getTabbableEdges`);function dt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:H(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}H(dt,`getTabbableCandidates`);function ft(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pt(r,{upTo:t})))return r}H(ft,`findVisible`);function pt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}H(pt,`isHidden`);function mt(e){return e instanceof HTMLInputElement&&`select`in e}H(mt,`isSelectableInput`);function ht(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mt(e)&&t&&e.select()}}H(ht,`focus`);var gt=_t();function _t(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=vt(e,t),e.unshift(t)},remove(t){e=vt(e,t),e[0]?.resume()}}}H(_t,`createFocusScopesStack`);function vt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}H(vt,`arrayRemove`);function yt(e){return e.filter(e=>e.tagName!==`A`)}H(yt,`removeLinks`);var bt=Object.defineProperty,xt=m.forwardRef(((e,t)=>bt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);z(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?h.createPortal((0,g.jsx)(y.div,{...r,ref:t}),o):null},`Portal`)),St=Object.defineProperty,Ct=(e,t)=>St(e,`name`,{value:t,configurable:!0}),wt=0,Tt=null;function Et(e){return Dt(),e.children}Ct(Et,`FocusGuards`);function Dt(){m.useEffect(()=>{Tt||={start:Ot(),end:Ot()};let{start:e,end:t}=Tt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),wt++,()=>{wt===1&&(Tt?.start.remove(),Tt?.end.remove(),Tt=null),wt=Math.max(0,wt-1)}},[])}Ct(Dt,`useFocusGuards`);function Ot(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ct(Ot,`createFocusGuard`);var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function kt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function At(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function jt(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Mt(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Nt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Pt=`right-scroll-bar-position`,Ft=`width-before-scroll-bar`,It=`with-scroll-bars-hidden`,Lt=`--removed-body-scroll-bar-size`;function Rt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function zt(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Bt=typeof window<`u`?m.useLayoutEffect:m.useEffect,Vt=new WeakMap;function Ht(e,t){var n=zt(t||null,function(t){return e.forEach(function(e){return Rt(e,t)})});return Bt(function(){var t=Vt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Rt(e,null)}),i.forEach(function(e){r.has(e)||Rt(e,a)})}Vt.set(n,e)},[e]),n}function Ut(e){return e}function Wt(e,t){t===void 0&&(t=Ut);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Gt(e){e===void 0&&(e={});var t=Wt(null);return t.options=U({async:!0,ssr:!1},e),t}var Kt=function(e){var t=e.sideCar,n=kt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,U({},n))};Kt.isSideCarExport=!0;function qt(e,t){return e.useMedium(t),Kt}var Jt=Gt(),Yt=function(){},Xt=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Yt,onWheelCapture:Yt,onTouchMoveCapture:Yt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=kt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Ht([n,t]),w=U(U({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Jt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),U(U({},w),{ref:C})):m.createElement(y,U({},w,{className:c,ref:C}),s))});Xt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xt.classNames={fullWidth:Ft,zeroRight:Pt};var Zt,Qt=function(){if(Zt)return Zt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function $t(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Qt();return t&&e.setAttribute(`nonce`,t),e}function en(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var nn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$t())&&(en(t,n),tn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rn=function(){var e=nn();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},an=function(){var e=rn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},on={left:0,top:0,right:0,gap:0},sn=function(e){return parseInt(e||``,10)||0},cn=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[sn(n),sn(r),sn(i)]},ln=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return on;var t=cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},un=an(),dn=`data-scroll-locked`,fn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
  .${It} {
   overflow: hidden ${r};
   padding-right: ${s}px ${r};
  }
  body[${dn}] {
    overflow: hidden ${r};
    overscroll-behavior: contain;
    ${[t&&`position: relative ${r};`,n===`margin`&&`
    padding-left: ${i}px;
    padding-top: ${a}px;
    padding-right: ${o}px;
    margin-left:0;
    margin-top:0;
    margin-right: ${s}px ${r};
    `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
  }
  
  .${Pt} {
    right: ${s}px ${r};
  }
  
  .${Ft} {
    margin-right: ${s}px ${r};
  }
  
  .${Pt} .${Pt} {
    right: 0 ${r};
  }
  
  .${Ft} .${Ft} {
    margin-right: 0 ${r};
  }
  
  body[${dn}] {
    ${Lt}: ${s}px;
  }
`},pn=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},mn=function(){m.useEffect(function(){return document.body.setAttribute(dn,(pn()+1).toString()),function(){var e=pn()-1;e<=0?document.body.removeAttribute(dn):document.body.setAttribute(dn,e.toString())}},[])},hn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;mn();var a=m.useMemo(function(){return ln(i)},[i]);return m.createElement(un,{styles:fn(a,!t,i,n?``:`!important`)})},gn=!1;if(typeof window<`u`)try{var _n=Object.defineProperty({},"passive",{get:function(){return gn=!0,!0}});window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=gn?{passive:!1}:!1,yn=function(e){return e.tagName===`TEXTAREA`},bn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!yn(e)&&n[t]===`visible`)},xn=function(e){return bn(e,`overflowY`)},Sn=function(e){return bn(e,`overflowX`)},Cn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),En(e,r)){var i=Dn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Tn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},En=function(e,t){return e===`v`?xn(t):Sn(t)},Dn=function(e,t){return e===`v`?wn(t):Tn(t)},On=function(e,t){return e===`h`&&t===`rtl`?-1:1},kn=function(e,t,n,r,i){var a=On(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Dn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&En(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},An=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jn=function(e){return[e.deltaX,e.deltaY]},Mn=function(e){return e&&`current`in e?e.current:e},Nn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pn=function(e){return`
  .block-interactivity-${e} {pointer-events: none;}
  .allow-interactivity-${e} {pointer-events: all;}
`},Fn=0,In=[];function Ln(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Fn++)[0],a=m.useState(an)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nt([e.lockRef.current],(e.shards||[]).map(Mn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=An(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Cn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Cn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return kn(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(!(!In.length||In[In.length-1]!==a)){var r=`deltaY`in n?jn(n):An(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Nn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Mn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Rn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=An(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,jn(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,An(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return In.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,vn),document.addEventListener(`touchmove`,c,vn),document.addEventListener(`touchstart`,u,vn),function(){In=In.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,vn),document.removeEventListener(`touchmove`,c,vn),document.removeEventListener(`touchstart`,u,vn)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Pn(i)}):null,p?m.createElement(hn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var zn=qt(Jt,Ln),Bn=m.forwardRef(function(e,t){return m.createElement(Xt,U({},e,{ref:t,sideCar:zn}))});Bn.classNames=Xt.classNames;var Vn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Hn=new WeakMap,Un=new WeakMap,Wn={},Gn=0,Kn=function(e){return e&&(e.host||Kn(e.parentNode))},qn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Kn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Jn=function(e,t,n,r){var i=qn(t,Array.isArray(e)?e:[e]);Wn[n]||(Wn[n]=new WeakMap);var a=Wn[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Hn.get(e)||0)+1,l=(a.get(e)||0)+1;Hn.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Un.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Gn++,function(){o.forEach(function(e){var t=Hn.get(e)-1,i=a.get(e)-1;Hn.set(e,t),a.set(e,i),t||(Un.has(e)||e.removeAttribute(r),Un.delete(e)),i||e.removeAttribute(n)}),Gn--,Gn||(Hn=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Wn={})}},Yn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Vn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Jn(r,i,n,`aria-hidden`)):function(){return null}},Xn=Object.defineProperty,W=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Zn=`Dialog`,[Qn,$n]=O(Zn),[er,G]=Qn(Zn),tr=W(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=be({prop:r,defaultProp:i??!1,onChange:a,caller:Zn}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,g.jsx)(er,{scope:t,triggerRef:s,contentRef:c,contentId:Re(),titleId:Re(),descriptionId:Re(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),nr=`DialogTrigger`,rr=m.forwardRef(W(function(e,t){let{__scopeDialog:n,...r}=e,i=G(nr,n),a=s(t,i.triggerRef);return(0,g.jsx)(y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Cr(i.open),...r,ref:a,onClick:R(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),ir=`DialogPortal`,[ar,or]=Qn(ir,{forceMount:void 0}),sr=W(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=G(ir,t);return(0,g.jsx)(ar,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,g.jsx)(Oe,{present:n||a.open,children:(0,g.jsx)(xt,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),cr=`DialogOverlay`,lr=m.forwardRef(W(function(e,t){let n=or(cr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=G(cr,e.__scopeDialog);return a.modal?(0,g.jsx)(Oe,{present:r||a.open,children:(0,g.jsx)(dr,{...i,ref:t})}):null},`DialogOverlay`)),ur=o(`DialogOverlay.RemoveScroll`),dr=m.forwardRef(W(function(e,t){let{__scopeDialog:n,...r}=e,i=G(cr,n),a=Qe(),o=s(t,a);return(0,g.jsx)(Bn,{as:ur,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(y.div,{"data-state":Cr(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),fr=`DialogContent`,pr=m.forwardRef(W(function(e,t){let n=or(fr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=G(fr,e.__scopeDialog);return(0,g.jsx)(Oe,{present:r||a.open,children:a.modal?(0,g.jsx)(mr,{...i,ref:t}):(0,g.jsx)(hr,{...i,ref:t})})},`DialogContent`)),mr=m.forwardRef(W(function(e,t){let n=G(fr,e.__scopeDialog),r=m.useRef(null),i=s(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return Yn(e)},[]),(0,g.jsx)(gr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),hr=m.forwardRef(W(function(e,t){let n=G(fr,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,g.jsx)(gr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),gr=m.forwardRef(W(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=G(fr,n);return Dt(),(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(ct,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,g.jsx)(Ze,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Cr(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),_r=`DialogTitle`,vr=m.forwardRef(W(function(e,t){let{__scopeDialog:n,...r}=e,i=G(_r,n),{setTitleCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,g.jsx)(y.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),yr=`DialogDescription`,br=m.forwardRef(W(function(e,t){let{__scopeDialog:n,...r}=e,i=G(yr,n),{setDescriptionCount:a}=i;return z(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,g.jsx)(y.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),xr=`DialogClose`,Sr=m.forwardRef(W(function(e,t){let{__scopeDialog:n,...r}=e,i=G(xr,n);return(0,g.jsx)(y.button,{type:`button`,...r,ref:t,onClick:R(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Cr(e){return e?`open`:`closed`}W(Cr,`getState`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0});function Er(e){let[t,n]=m.useState(void 0);return z(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Tr(Er,`useSize`);var Dr=[`top`,`right`,`bottom`,`left`],K=Math.min,q=Math.max,Or=Math.round,kr=Math.floor,Ar=e=>({x:e,y:e}),jr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Mr(e,t,n){return q(e,K(t,n))}function J(e,t){return typeof e==`function`?e(t):e}function Y(e){return e.split(`-`)[0]}function Nr(e){return e.split(`-`)[1]}function Pr(e){return e===`x`?`y`:`x`}function Fr(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ir(e){return Pr(X(e))}function Lr(e,t,n){n===void 0&&(n=!1);let r=Nr(e),i=Ir(e),a=Fr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kr(o)),[o,Kr(o)]}function Rr(e){let t=Kr(e);return[zr(e),t,zr(t)]}function zr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Br=[`left`,`right`],Vr=[`right`,`left`],Hr=[`top`,`bottom`],Ur=[`bottom`,`top`];function Wr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vr:Br:t?Br:Vr;case`left`:case`right`:return t?Hr:Ur;default:return[]}}function Gr(e,t,n,r){let i=Nr(e),a=Wr(Y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zr)))),a}function Kr(e){let t=Y(e);return jr[t]+e.slice(t.length)}function qr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Jr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qr(e)}function Yr(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Xr(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=Ir(t),s=Fr(o),c=Y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Nr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Zr(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J(t,e),p=Jr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yr(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Qr=50,$r=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zr},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xr(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Qr&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Xr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ei=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J(e,t)||{};if(l==null)return{};let d=Jr(u),f={x:n,y:r},p=Ir(i),m=Fr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=K(d[_],T),D=K(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Mr(E,k,O),j=!c.arrow&&Nr(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),ti=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=J(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Y(r),_=X(o),v=Y(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Kr(o)]:Rr(o)),x=p!==`none`;!d&&x&&b.push(...Gr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Lr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ni(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ri(e){return Dr.some(t=>e[t]>=0)}var ii=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J(e,t);switch(i){case`referenceHidden`:{let e=ni(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ri(e)}}}case`escaped`:{let e=ni(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ri(e)}}}default:return{}}}}};function ai(e){let t=K(...e.map(e=>e.left)),n=K(...e.map(e=>e.top)),r=q(...e.map(e=>e.right)),i=q(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function oi(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>Yr(ai(e)))}var si=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=oi(u),f=Yr(ai(u)),p=Jr(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(X(n)===`y`){let e=d[0],t=d[d.length-1],r=Y(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return Yr({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Y(n)===`left`,t=q(...d.map(e=>e.right)),r=K(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return Yr({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},ci=new Set([`left`,`top`]);async function li(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y(n),s=Nr(n),c=X(n)===`y`,l=ci.has(o)?-1:1,u=a&&c?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ui=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await li(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},di=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=Pr(f),m=u[p],h=u[f],g=(e,t)=>Mr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},fi=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J(e,t),u={x:n,y:r},d=X(i),f=Pr(d),p=u[f],m=u[d],h=J(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ci.has(Y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pi=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=J(e,t),c=await i.detectOverflow(t,s),l=Y(n),u=Nr(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=K(p-c[m],g),y=K(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*q(c.left,c.right):S=p-2*q(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function mi(){return typeof window<`u`}function hi(e){return _i(e)?(e.nodeName||``).toLowerCase():`#document`}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gi(e){return((_i(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _i(e){return mi()?e instanceof Node||e instanceof Z(e).Node:!1}function vi(e){return mi()?e instanceof Element||e instanceof Z(e).Element:!1}function yi(e){return mi()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function bi(e){return!mi()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}function xi(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Si(e){return/^(table|td|th)$/.test(hi(e))}function Ci(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wi=/transform|translate|scale|rotate|perspective|filter/,Ti=/paint|layout|strict|content/,Ei=e=>!!e&&e!==`none`,Di;function Oi(e){let t=vi(e)?Mi(e):e;return Ei(t.transform)||Ei(t.translate)||Ei(t.scale)||Ei(t.rotate)||Ei(t.perspective)||!Ai()&&(Ei(t.backdropFilter)||Ei(t.filter))||wi.test(t.willChange||``)||Ti.test(t.contain||``)}function ki(e){let t=Pi(e);for(;yi(t)&&!ji(t);){if(Oi(t))return t;if(Ci(t))return null;t=Pi(t)}return null}function Ai(){return Di??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Di}function ji(e){return/^(html|body|#document)$/.test(hi(e))}function Mi(e){return Z(e).getComputedStyle(e)}function Ni(e){return vi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pi(e){if(hi(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||bi(e)&&e.host||gi(e);return bi(t)?t.host:t}function Fi(e){let t=Pi(e);return ji(t)?(e.ownerDocument||e).body:yi(t)&&xi(t)?t:Fi(t)}function Ii(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Fi(e),i=r===e.ownerDocument?.body,a=Z(r);if(i){let e=Li(a);return t.concat(a,a.visualViewport||[],xi(r)?r:[],e&&n?Ii(e):[])}return t.concat(r,Ii(r,[],n))}function Li(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ri(e){let t=Mi(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=yi(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Or(n)!==a||Or(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zi(e){return vi(e)?e:e.contextElement}function Bi(e){let t=zi(e);if(!yi(t))return Ar(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ri(t),o=(a?Or(n.width):n.width)/r,s=(a?Or(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vi=Ar(0);function Hi(e){let t=Z(e);return!Ai()||!t.visualViewport?Vi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ui(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Z(e)}function Wi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zi(e),o=Ar(1);t&&(r?vi(r)&&(o=Bi(r)):o=Bi(e));let s=Ui(a,n,r)?Hi(a):Ar(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Z(a),t=vi(r)?Z(r):r,n=e,i=Li(n);for(;i&&t!==n;){let e=Bi(i),t=i.getBoundingClientRect(),r=Mi(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Z(i),i=Li(n)}}return Yr({width:u,height:d,x:c,y:l})}function Gi(e,t){let n=Ni(e).scrollLeft;return t?t.left+n:Wi(gi(e)).left+n}function Ki(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gi(e,n),y:n.top+t.scrollTop}}function qi(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=gi(r),s=t?Ci(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ar(1),u=Ar(0),d=yi(r);if((d||!a)&&((hi(r)!==`body`||xi(o))&&(c=Ni(r)),d)){let e=Wi(r);l=Bi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ki(o,c):Ar(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ji(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yi(e){let t=Ni(e),n=e.ownerDocument.body,r=q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Gi(e),o=-t.scrollTop;return Mi(n).direction===`rtl`&&(a+=q(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xi=25;function Zi(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Z(e),a=gi(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ai()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Gi(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xi&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qi(e,t){let n=Wi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Bi(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $i(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zi(e,n,t);else if(t===`document`)r=Yi(gi(e));else if(vi(t))r=Qi(t,n);else{let n=Hi(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yr(r)}function ea(e,t){let n=t.get(e);if(n)return n;let r=Ii(e,[],!1).filter(e=>vi(e)&&hi(e)!==`body`),i=null,a=Mi(e).position===`fixed`,o=a?Pi(e):e;for(;vi(o)&&!ji(o);){let e=Mi(o),t=Oi(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Pi(o)}return t.set(e,r),r}function ta(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ci(t)?[]:ea(t,this._c):[].concat(n),r],o=$i(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$i(t,a[e],i);s=q(n.top,s),c=K(n.right,c),l=K(n.bottom,l),u=q(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function na(e){let{width:t,height:n}=Ri(e);return{width:t,height:n}}function ra(e,t,n){let r=yi(t),i=gi(t),a=n===`fixed`,o=Wi(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ar(0);if((r||!a)&&((hi(t)!==`body`||xi(i))&&(s=Ni(t)),r)){let e=Wi(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Gi(i));let l=i&&!r&&!a?Ki(i,s):Ar(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ia(e){return Mi(e).position===`static`}function aa(e,t){if(!yi(e)||Mi(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return gi(e)===n&&(n=n.ownerDocument.body),n}function oa(e,t){let n=Z(e);if(Ci(e))return n;if(!yi(e)){let t=Pi(e);for(;t&&!ji(t);){if(vi(t)&&!ia(t))return t;t=Pi(t)}return n}let r=aa(e,t);for(;r&&Si(r)&&ia(r);)r=aa(r,t);return r&&ji(r)&&ia(r)&&!Oi(r)?n:r||ki(e)||n}var sa=async function(e){let t=this.getOffsetParent||oa,n=this.getDimensions,r=await n(e.floating);return{reference:ra(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ca(e){return Mi(e).direction===`rtl`}var la={convertOffsetParentRelativeRectToViewportRelativeRect:qi,getDocumentElement:gi,getClippingRect:ta,getOffsetParent:oa,getElementRects:sa,getClientRects:Ji,getDimensions:na,getScale:Bi,isElement:vi,isRTL:ca};function ua(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function da(e,t,n){let r=null,i,a=gi(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=kr(d),h=kr(a.clientWidth-(u+f)),g=kr(a.clientHeight-(d+p)),_=kr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:q(0,K(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ua(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Z(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function fa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=zi(e),u=i||a?[...l?Ii(l):[],...t?Ii(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?da(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wi(e):null;c&&g();function g(){let t=Wi(e);h&&!ua(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var pa=ui,ma=di,ha=ti,ga=pi,_a=ii,va=ei,ya=si,ba=fi,xa=(e,t,n)=>{let r=new Map,i=n??{},a={...la,...i.platform,_c:r};return $r(e,t,{...i,platform:a})},Sa=typeof document<`u`?m.useLayoutEffect:function(){};function Ca(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,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ca(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ca(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wa(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ta(e,t){let n=wa(e);return Math.round(t*n)/n}function Ea(e){let t=m.useRef(e);return Sa(()=>{t.current=e}),t}function Da(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Ca(f,r)||p(r);let[g,_]=m.useState(null),[v,y]=m.useState(null),b=m.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=m.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=m.useRef(null),T=m.useRef(null),E=m.useRef(u),D=c!=null,O=Ea(c),k=Ea(i),A=Ea(l),j=m.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),xa(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Ca(E.current,t)&&(E.current=t,h.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Sa(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=m.useRef(!1);Sa(()=>(M.current=!0,()=>{M.current=!1}),[]),Sa(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=m.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=m.useMemo(()=>({reference:S,floating:C}),[S,C]),F=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ta(P.floating,u.x),r=Ta(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wa(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Oa=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:va({element:r.current,padding:i}).fn(n):r?va({element:r,padding:i}).fn(n):{}}}},ka=(e,t)=>{let n=pa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Aa=(e,t)=>{let n=ma(e);return{name:n.name,fn:n.fn,options:[e,t]}},ja=(e,t)=>({fn:ba(e).fn,options:[e,t]}),Ma=(e,t)=>{let n=ha(e);return{name:n.name,fn:n.fn,options:[e,t]}},Na=(e,t)=>{let n=ga(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pa=(e,t)=>{let n=_a(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fa=(e,t)=>{let n=Oa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ia=Object.defineProperty,La=m.forwardRef(((e,t)=>Ia(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,g.jsx)(y.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,g.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0}),Ba=`Popper`,[Va,Ha]=O(Ba),[Ua,Wa]=Va(Ba),Ga=za(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,g.jsx)(Ua,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ka=`PopperAnchor`,qa=m.forwardRef(za(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Wa(Ka,n),o=m.useRef(null),c=a.onAnchorChange,l=m.useCallback(e=>{o.current=e,e&&c(e)},[c]),u=s(t,l),d=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&c(d.current)});let f=a.placementState&&ro(a.placementState),p=f?.[0],h=f?.[1];return r?null:(0,g.jsx)(y.div,{"data-radix-popper-side":p,"data-radix-popper-align":h,...i,ref:u})},`PopperAnchor`)),Ja=`PopperContent`,[Ya,Xa]=Va(Ja),Za=m.forwardRef(za(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:h=`optimized`,onPlaced:_,...v}=e,b=Wa(Ja,n),[x,S]=m.useState(null),C=s(t,S),[w,T]=m.useState(null),E=Er(w),D=E?.width??0,O=E?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],M=j.length>0,N={padding:A,boundary:j.filter(to),altBoundary:M},{refs:P,floatingStyles:F,placement:ee,isPositioned:I,middlewareData:L}=Da({strategy:`fixed`,placement:k,whileElementsMounted:za((...e)=>fa(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:b.anchor},middleware:[ka({mainAxis:i+O,alignmentAxis:o}),l&&Aa({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?ja():void 0,...N}),l&&Ma({...N}),Na({...N,apply:za(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),w&&Fa({element:w,padding:c}),no({arrowWidth:D,arrowHeight:O}),p&&Pa({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),te=b.setPlacementState;z(()=>(te(ee),()=>{te(void 0)}),[ee,te]);let[ne,re]=ro(ee),ie=B(_);z(()=>{I&&ie?.()},[I,ie]);let ae=L.arrow?.x,oe=L.arrow?.y,se=L.arrow?.centerOffset!==0,[R,ce]=m.useState();return z(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),(0,g.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:I?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,g.jsx)(Ya,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:T,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,g.jsx)(y.div,{"data-side":ne,"data-align":re,...v,ref:C,style:{...v.style,animation:I?v.style?.animation:`none`}})})})},`PopperContent`)),Qa=`PopperArrow`,$a={top:`bottom`,right:`left`,bottom:`top`,left:`right`},eo=m.forwardRef(za(function(e,t){let{__scopePopper:n,...r}=e,i=Xa(Qa,n),a=$a[i.placedSide];return(0,g.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,g.jsx)(La,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function to(e){return e!==null}za(to,`isNotNull`);var no=za(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ro(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ro(e){let[t,n=`center`]=e.split(`-`);return[t,n]}za(ro,`getSideAndAlignFromPlacement`);var io=Ga,ao=qa,oo=Za,so=eo,co=Object.defineProperty,lo=m.forwardRef(((e,t)=>co(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,g.jsx)(y.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),uo=Object.defineProperty,fo=(e,t)=>uo(e,`name`,{value:t,configurable:!0});function po(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}fo(po,`usePrevious`);var mo=Object.defineProperty,ho=(e,t)=>mo(e,`name`,{value:t,configurable:!0});function go(e,[t,n]){return Math.min(n,Math.max(t,e))}ho(go,`clamp`);var _o=Object.defineProperty,Q=(e,t)=>_o(e,`name`,{value:t,configurable:!0}),vo=[` `,`Enter`,`ArrowUp`,`ArrowDown`],yo=[` `,`Enter`],bo=`Select`,[xo,So,Co]=M(bo),[wo,To]=O(bo,[Co,Ha]),Eo=Ha(),[Do,Oo]=wo(bo),[ko,Ao]=wo(bo);function jo(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:_}=e,v=Eo(t),[y,b]=m.useState(null),[x,S]=m.useState(null),[C,w]=m.useState(!1),T=He(l),[E,D]=be({prop:r,defaultProp:i??!1,onChange:a,caller:bo}),[O,k]=be({prop:o,defaultProp:s,onChange:c,caller:bo}),A=m.useRef(null),j=m.useRef(O);m.useEffect(()=>{let e=h?y?.ownerDocument.getElementById(h):y?.form;if(e instanceof HTMLFormElement){let t=Q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,y,k]);let M=!y||!!h||!!y.closest(`form`),[N,P]=m.useState(new Set),F=Re(),ee=Array.from(N).map(e=>e.props.value).join(`;`),I=m.useCallback(e=>{P(t=>new Set(t).add(e))},[]),L=m.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:F,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:N,nativeSelectKey:ee,isFormControl:M};return(0,g.jsx)(io,{...v,children:(0,g.jsx)(Do,{scope:t,...te,children:(0,g.jsx)(xo.Provider,{scope:t,children:(0,g.jsx)(ko,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:_s(_)?_(te):n})})})})}Q(jo,`SelectProvider`);var Mo=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,g.jsx)(jo,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,g.jsxs)(g.Fragment,{children:[n,e?(0,g.jsx)(gs,{__scopeSelect:t}):null]})})},`Select`),No=`SelectTrigger`,Po=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Eo(n),o=Oo(No,n),c=o.disabled||r,l=s(t,o.onTriggerChange),u=So(n),d=m.useRef(`touch`),[f,p,h]=ys(e=>{let t=u().filter(e=>!e.disabled),n=bs(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=Q(e=>{c||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,g.jsx)(ao,{asChild:!0,...a,children:(0,g.jsx)(y.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":vs(o.value)?``:void 0,...i,ref:l,onClick:R(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&_(e)}),onPointerDown:R(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:R(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&vo.includes(e.key)&&(_(),e.preventDefault())})})})},`SelectTrigger`)),Fo=`SelectValue`,Io=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...c}=e,l=Oo(Fo,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,f=s(t,l.onValueNodeChange);z(()=>{u(d)},[u,d]);let p=vs(l.value);return(0,g.jsx)(y.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,g.jsx)(m.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),Lo=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,g.jsx)(y.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Ro,zo]=wo(`SelectPortal`,{forceMount:void 0}),Bo=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,g.jsx)(Ro,{scope:e.__scopeSelect,forceMount:n,children:(0,g.jsx)(xt,{asChild:!0,...r})})},`SelectPortal`),Vo=`SelectContent`,Ho=m.forwardRef(Q(function(e,t){let n=zo(Vo,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Oo(Vo,e.__scopeSelect),[o,s]=m.useState();return z(()=>{s(new DocumentFragment)},[]),(0,g.jsx)(Oe,{present:r||a.open,children:({present:e})=>e?(0,g.jsx)(qo,{...i,ref:t}):(0,g.jsx)(Uo,{...i,fragment:o})})},`SelectContent`)),Uo=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?h.createPortal((0,g.jsx)(Wo,{scope:n,children:(0,g.jsx)(xo.Slot,{scope:n,children:(0,g.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),$=10,[Wo,Go]=wo(Vo),Ko=o(`SelectContent.RemoveScroll`),qo=m.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:_,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=Oo(Vo,n),[S,C]=m.useState(null),[w,T]=m.useState(null),E=s(t,C),[D,O]=m.useState(null),[k,A]=m.useState(null),j=So(n),[M,N]=m.useState(!1),P=m.useRef(!1);m.useEffect(()=>{if(S)return Yn(S)},[S]),Dt();let F=m.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,w]),ee=m.useCallback(()=>F([D,S]),[F,D,S]);m.useEffect(()=>{M&&ee()},[M,ee]);let{onOpenChange:I,triggerPointerDownPosRef:L}=x;m.useEffect(()=>{if(S){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(S)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,I,L]),m.useEffect(()=>{let e=Q(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[te,ne]=ys(e=>{let t=j().filter(e=>!e.disabled),n=bs(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=m.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(P.current=!0))},[x.value]),ie=m.useCallback(()=>S?.focus(),[S]),ae=m.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),oe=r===`popper`?Yo:Jo,se=oe===Yo?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:_,hideWhenDetached:v,avoidCollisions:y}:{};return(0,g.jsx)(Wo,{scope:n,content:S,viewport:w,onViewportChange:T,itemRefCallback:re,selectedItem:D,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:ee,selectedItemText:k,position:r,isPositioned:M,searchRef:te,children:(0,g.jsx)(Bn,{as:Ko,allowPinchZoom:!0,children:(0,g.jsx)(ct,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:R(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,g.jsx)(Ze,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,g.jsx)(oe,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...se,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:R(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Jo=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Oo(Vo,n),o=Go(Vo,n),[c,l]=m.useState(null),[u,d]=m.useState(null),f=s(t,d),p=So(n),h=m.useRef(!1),_=m.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:x,focusSelectedItem:S}=o,C=m.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&v&&b&&x){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=x.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,d=go(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,d=go(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let o=p(),s=window.innerHeight-$*2,l=v.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),y=f+m+l+_+g,S=Math.min(b.offsetHeight*5,y),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-$,D=s-E,O=b.offsetHeight/2,k=b.offsetTop+O,A=f+m+k,j=y-A;if(A<=E){let e=o.length>0&&b===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=o.length>0&&b===o[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${$}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,c,u,v,b,x,a.dir,r]);z(()=>C(),[C]);let[w,T]=m.useState();z(()=>{u&&T(window.getComputedStyle(u).zIndex)},[u]);let E=m.useCallback(e=>{e&&_.current===!0&&(C(),S?.(),_.current=!1)},[C,S]);return(0,g.jsx)(Xo,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:(0,g.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:w},children:(0,g.jsx)(y.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Yo=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Eo(n);return(0,g.jsx)(oo,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Xo,Zo]=wo(Vo,{}),Qo=`SelectViewport`,$o=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Go(Qo,n),o=Zo(Qo,n),c=s(t,a.onViewportChange),l=m.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,g.jsx)(xo.Slot,{scope:n,children:(0,g.jsx)(y.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:R(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[es,ts]=wo(`SelectGroup`),ns=`SelectItem`,[rs,is]=wo(ns),as=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=Oo(ns,n),l=Go(ns,n),u=c.value===r,[d,f]=m.useState(a??``),[p,h]=m.useState(!1),_=B(e=>l.itemRefCallback?.(e,r,i)),v=s(t,_),b=Re(),x=m.useRef(`touch`),S=Q(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},`handleSelect`);return(0,g.jsx)(rs,{scope:n,value:r,disabled:i,textId:b,isSelected:u,onItemTextChange:m.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,g.jsx)(xo.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,g.jsx)(y.div,{role:`option`,"aria-labelledby":b,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:v,onFocus:R(o.onFocus,()=>h(!0)),onBlur:R(o.onBlur,()=>h(!1)),onClick:R(o.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:R(o.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:R(o.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:R(o.onPointerMove,e=>{x.current=e.pointerType,i?l.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:R(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(yo.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),os=`SelectItemText`,ss=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Oo(os,n),c=Go(os,n),l=is(os,n),u=Ao(os,n),[d,f]=m.useState(null),p=B(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=s(t,f,l.onItemTextChange,p),v=d?.textContent,b=m.useMemo(()=>(0,g.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=u;return z(()=>(x(b),()=>S(b)),[x,S,b]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(y.span,{id:l.textId,...a,ref:_}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!vs(o.value)?h.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),cs=`SelectItemIndicator`,ls=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e;return is(cs,n).isSelected?(0,g.jsx)(y.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),us=`SelectScrollUpButton`,ds=m.forwardRef(Q(function(e,t){let n=Go(us,e.__scopeSelect),r=Zo(us,e.__scopeSelect),[i,a]=m.useState(!1),o=s(t,r.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,g.jsx)(ms,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),fs=`SelectScrollDownButton`,ps=m.forwardRef(Q(function(e,t){let n=Go(fs,e.__scopeSelect),r=Zo(fs,e.__scopeSelect),[i,a]=m.useState(!1),o=s(t,r.onScrollButtonChange);return z(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,g.jsx)(ms,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),ms=m.forwardRef(Q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Go(`SelectScrollButton`,n),o=m.useRef(null),s=So(n),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),z(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,g.jsx)(y.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:R(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:R(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:R(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),hs=`SelectBubbleInput`,gs=m.forwardRef(Q(function({__scopeSelect:e,...t},n){let r=Oo(hs,e),{value:i,onValueChange:a,required:o,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,h=m.useRef(null),_=s(n,h),v=i??``,b=po(v),x=Array.from(f).some(e=>(e.props.value??``)===``);return m.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(b!==v&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,v),e.dispatchEvent(t)}},[b,v]),(0,g.jsxs)(y.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>a(e.target.value),...t,style:{...C,...t.style},ref:_,defaultValue:v,children:[vs(i)&&!x?(0,g.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function _s(e){return typeof e==`function`}Q(_s,`isFunction`);function vs(e){return e===``||e===void 0}Q(vs,`shouldShowPlaceholder`);function ys(e){let t=B(e),n=m.useRef(``),r=m.useRef(0),i=m.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=m.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q(ys,`useTypeaheadSearch`);function bs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=xs(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(bs,`findNextItem`);function xs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(xs,`wrapArray`);function Ss({...e}){return(0,g.jsx)(tr,{"data-slot":`dialog`,...e})}function Cs({...e}){return(0,g.jsx)(rr,{"data-slot":`dialog-trigger`,...e})}function ws({...e}){return(0,g.jsx)(sr,{"data-slot":`dialog-portal`,...e})}function Ts({className:e,...t}){return(0,g.jsx)(lr,{"data-slot":`dialog-overlay`,className:r(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-1001 bg-black/50`,e),...t})}function Es({className:e,children:t,showCloseButton:n=!0,...i}){return(0,g.jsxs)(ws,{"data-slot":`dialog-portal`,children:[(0,g.jsx)(Ts,{}),(0,g.jsxs)(pr,{"data-slot":`dialog-content`,className:r(`bg-white data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-1001 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-gray-200 p-6 shadow-lg duration-200 sm:max-w-lg dark:bg-gray-950 dark:border-gray-800`,e),...i,children:[t,n&&(0,g.jsxs)(Sr,{"data-slot":`dialog-close`,className:`ring-offset-white focus:ring-gray-950 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500 absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:ring-offset-gray-950 dark:focus:ring-gray-300 dark:data-[state=open]:bg-gray-800 dark:data-[state=open]:text-gray-400`,children:[(0,g.jsx)(p,{}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Ds({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Os({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function ks({className:e,...t}){return(0,g.jsx)(vr,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function As({className:e,...t}){return(0,g.jsx)(br,{"data-slot":`dialog-description`,className:r(`text-gray-500 text-sm dark:text-gray-400`,e),...t})}function js({className:e,type:t,...n}){return(0,g.jsx)(`input`,{type:t,"data-slot":`input`,className:r(`file:text-gray-950 placeholder:text-gray-500 selection:bg-gray-900 selection:text-gray-50 dark:bg-gray-200/30 border-gray-200 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:file:text-gray-50 dark:placeholder:text-gray-400 dark:selection:bg-gray-50 dark:selection:text-gray-900 dark:dark:bg-gray-800/30 dark:border-gray-800`,`focus-visible:border-gray-950 focus-visible:ring-gray-950/50 focus-visible:ring-[3px] dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50`,`aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900`,e),...n})}function Ms({className:e,...t}){return(0,g.jsx)(lo,{"data-slot":`label`,className:r(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Ns({...e}){return(0,g.jsx)(Mo,{"data-slot":`select`,...e})}function Ps({...e}){return(0,g.jsx)(Io,{"data-slot":`select-value`,...e})}function Fs({className:e,size:t=`default`,children:n,...i}){return(0,g.jsxs)(Po,{"data-slot":`select-trigger`,"data-size":t,className:r(`border-gray-200 data-[placeholder]:text-gray-500 [&_svg:not([class*='text-'])]:text-gray-500 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:bg-gray-200/30 dark:hover:bg-gray-200/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:border-gray-800 dark:data-[placeholder]:text-gray-400 dark:[&_svg:not([class*='text-'])]:text-gray-400 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900 dark:dark:bg-gray-800/30 dark:dark:hover:bg-gray-800/50`,e),...i,children:[n,(0,g.jsx)(Lo,{asChild:!0,children:(0,g.jsx)(l,{className:`size-4 opacity-50`})})]})}function Is({className:e,children:t,position:n=`popper`,container:i,...a}){return(0,g.jsx)(Bo,{container:i,children:(0,g.jsxs)(Ho,{"data-slot":`select-content`,className:r(`bg-white text-gray-950 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-1001 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 shadow-md dark:bg-gray-950 dark:text-gray-50 dark:border-gray-800`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...a,children:[(0,g.jsx)(Rs,{}),(0,g.jsx)($o,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,g.jsx)(zs,{})]})})}function Ls({className:e,children:t,...n}){return(0,g.jsxs)(as,{"data-slot":`select-item`,className:r(`focus:bg-gray-100 focus:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 dark:focus:bg-gray-800 dark:focus:text-gray-50 dark:[&_svg:not([class*='text-'])]:text-gray-400`,e),...n,children:[(0,g.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,g.jsx)(ls,{children:(0,g.jsx)(c,{className:`size-4`})})}),(0,g.jsx)(ss,{children:t})]})}function Rs({className:e,...t}){return(0,g.jsx)(ds,{"data-slot":`select-scroll-up-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,g.jsx)(d,{className:`size-4`})})}function zs({className:e,...t}){return(0,g.jsx)(ps,{"data-slot":`select-scroll-down-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,g.jsx)(l,{className:`size-4`})})}export{Re as $,Ii as A,$n as B,xa as C,pa as D,ba as E,br as F,Mt as G,Bn as H,lr as I,xt as J,Nt as K,sr as L,tr as M,Sr as N,ma as O,pr as P,He as Q,vr as R,fa as S,ya as T,At as U,Yn as V,jt as W,Ze as X,ct as Y,B as Z,so as _,Ps as a,O as at,Ha as b,Ss as c,b as ct,Os as d,d as dt,Oe as et,Ds as f,u as ft,ao as g,go as h,Fs as i,M as it,Er as j,ga as k,Es as l,p as lt,Cs as m,c as mt,Is as n,z as nt,Ms as o,w as ot,ks as p,l as pt,Dt as q,Ls as r,R as rt,js as s,y as st,Ns as t,be as tt,As as u,f as ut,oo as v,ha as w,va as x,io as y,rr as z};