@melwyn584/ui-library 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react-dom`),require(`lucide-react`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react-dom`,`lucide-react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UILibrary={},e.React,e.ReactDOM,e.Lucide))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));t=f(t),n=f(n);function p({controlled:e,default:n,name:r,state:i=`value`}){let{current:a}=t.useRef(e!==void 0),[o,s]=t.useState(n),c=a?e:o;if(process.env.NODE_ENV!==`production`){t.useEffect(()=>{a!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${a?``:`un`}controlled ${i} state of ${r} to be ${a?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
2
+ `))},[i,r,e]);let{current:o}=t.useRef(n);t.useEffect(()=>{!a&&JSON.stringify(o)!==JSON.stringify(n)&&console.error([`Base UI: A component is changing the default ${i} state of an uncontrolled ${r} after being initialized. To suppress this warning opt to use a controlled ${r}.`].join(`
3
+ `))},[JSON.stringify(n)])}return[c,t.useCallback(e=>{a||s(e)},[])]}var m={};function h(e,n){let r=t.useRef(m);return r.current===m&&(r.current=e(n)),r}var g=t[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],_=g&&g!==t.useLayoutEffect?g:e=>e();function v(e){let t=h(y).current;return t.next=e,_(t.effect),t.trampoline}function y(){let e={next:void 0,callback:b,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function b(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}var x=typeof document<`u`?t.useLayoutEffect:()=>{},S;process.env.NODE_ENV!==`production`&&(S=new Set);function C(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);S.has(t)||(S.add(t),console.warn(`Base UI: ${t}`))}}var w=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(w.displayName=`CompositeListContext`);function T(){return t.useContext(w)}var E=u((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),D=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(A.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return P[e]||(P[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(j(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(A.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,L[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
4
+ let props = %s;
5
+ <%s {...props} />
6
+ React keys must be passed directly to JSX without using spread:
7
+ let props = %s;
8
+ <%s key={someKey} {...props} />`,o,p,m,p),L[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require(`react`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.client.reference`),k=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,j=Array.isArray,M=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var N,P={},F=m.react_stack_bottom_frame.bind(m,o)(),I=M(i(o)),L={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!1,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)},e.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)}})()})),O=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=E():t.exports=D()}))();function k(e){let{children:n,elementsRef:r,labelsRef:i,onMapChange:a}=e,o=v(a),s=t.useRef(0),c=h(j).current,l=h(A).current,[u,d]=t.useState(0),f=t.useRef(u),p=v((e,t)=>{l.set(e,t??null),f.current+=1,d(f.current)}),m=v(e=>{l.delete(e),f.current+=1,d(f.current)}),g=t.useMemo(()=>{let e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(M).forEach((t,n)=>{let r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,u]);x(()=>{if(typeof MutationObserver!=`function`||g.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(f.current+=1,d(f.current))});return g.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[g]),x(()=>{f.current===u&&(r.current.length!==g.size&&(r.current.length=g.size),i&&i.current.length!==g.size&&(i.current.length=g.size),s.current=g.size),o(g)},[o,g,r,i,u]),x(()=>()=>{r.current=[]},[r]),x(()=>()=>{i&&(i.current=[])},[i]);let _=v(e=>(c.add(e),()=>{c.delete(e)}));x(()=>{c.forEach(e=>e(g))},[c,g]);let y=t.useMemo(()=>({register:p,unregister:m,subscribeMapChange:_,elementsRef:r,labelsRef:i,nextIndexRef:s}),[p,m,_,r,i,s]);return(0,O.jsx)(w.Provider,{value:y,children:n})}function A(){return new Map}function j(){return new Set}function M(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var N=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(N.displayName=`DirectionContext`);function P(){return t.useContext(N)?.direction??`ltr`}function F(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var I=F(`https://base-ui.com/production-error`,`Base UI`),L=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(L.displayName=`AccordionRootContext`);function R(){let e=t.useContext(L);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(10):`Base UI: AccordionRootContext is missing. Accordion parts must be placed within <Accordion.Root>.`);return e}function z(e,t,n,r){let i=h(ee).current;return V(i,e,t,n,r)&&U(i,[e,t,n,r]),i.callback}function B(e){let t=h(ee).current;return H(t,e)&&U(t,e),t.callback}function ee(){return{callback:null,cleanup:null,refs:[]}}function V(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function H(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function U(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var W=parseInt(t.version,10);function G(e){return W>=e}function K(e){if(!t.isValidElement(e))return null;let n=e,r=n.props;return(G(19)?r?.ref:n.ref)??null}function te(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function q(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ne(e,t){return typeof e==`function`?e(t):e}function re(e,t){return typeof e==`function`?e(t):e}var ie={};function ae(e,t,n,r,i){let a={...de(e,ie)};return t&&(a=se(a,t)),n&&(a=se(a,n)),r&&(a=se(a,r)),i&&(a=se(a,i)),a}function oe(e){if(e.length===0)return ie;if(e.length===1)return de(e[0],ie);let t={...de(e[0],ie)};for(let n=1;n<e.length;n+=1)t=se(t,e[n]);return t}function se(e,t){return ue(t)?t(e):ce(e,t)}function ce(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=te(e.style,r);break;case`className`:e[n]=me(e.className,r);break;default:le(n,r)?e[n]=fe(e[n],r):e[n]=r}}return e}function le(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function ue(e){return typeof e==`function`}function de(e,t){return ue(e)?e(t):e??ie}function fe(e,t){return t?e?n=>{if(he(n)){let r=n;pe(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function pe(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function me(e,t){return t?e?t+` `+e:t:e}function he(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function ge(){}var _e=Object.freeze([]),ve=Object.freeze({}),ye={style:{transition:`none`}},be=`data-base-ui-click-trigger`,xe=`data-base-ui-swipe-ignore`,Se=`data-swipe-ignore`,Ce=`[${xe}]`,we=`[${Se}]`,Te={fallbackAxisSide:`none`},Ee={fallbackAxisSide:`end`},De={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function J(e,t,n={}){let r=t.render,i=Oe(t,n);return n.enabled===!1?null:Ae(e,r,i,n.state??ve)}function Oe(e,t={}){let{className:n,style:r,render:i}=e,{state:a=ve,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ne(n,a):void 0,d=l?re(r,a):void 0,f=l?q(a,c):ve,p=l?te(f,Array.isArray(s)?oe(s):s)??ve:ve;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=B([p.ref,K(i),...o]):p.ref=z(p.ref,K(i),o):z(null,null)),l?(u!==void 0&&(p.className=me(p.className,u)),d!==void 0&&(p.style=te(p.style,d)),p):ve}var ke=Symbol.for(`react.lazy`);function Ae(e,n,r,i){if(n){if(typeof n==`function`)return process.env.NODE_ENV!==`production`&&je(n),n(r,i);let e=ae(r,n.props);e.ref=r.ref;let a=n;if(a?.$$typeof===ke&&(a=t.Children.toArray(n)[0]),process.env.NODE_ENV!==`production`&&!t.isValidElement(a))throw Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",`https://base-ui.com/r/invalid-render-prop`].join(`
9
+ `));return t.cloneElement(a,e)}if(e&&typeof e==`string`)return Me(e,r);throw Error(process.env.NODE_ENV===`production`?I(8):`Base UI: Render element or function are not defined.`)}function je(e){let t=e.name;if(t.length===0)return;let n=t.charCodeAt(0);n<65||n>90||C(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function Me(e,n){return e===`button`?(0,t.createElement)(`button`,{type:`button`,...n,key:n.key}):e===`img`?(0,t.createElement)(`img`,{alt:``,...n,key:n.key}):t.createElement(e,n)}var Ne=`none`,Pe=`trigger-press`,Fe=`trigger-hover`,Ie=`trigger-focus`,Le=`outside-press`,Re=`item-press`,ze=`close-press`,Be=`increment-press`,Ve=`decrement-press`,He=`input-change`,Ue=`input-clear`,We=`input-blur`,Ge=`input-paste`,Ke=`input-press`,qe=`focus-out`,Je=`escape-key`,Ye=`close-watcher`,Xe=`list-navigation`,Ze=`keyboard`,Qe=`scrub`,$e=`cancel-open`,et=`sibling-open`,tt=`disabled`,nt=`imperative-action`,rt=`window-resize`;function Y(e,t,n,r){let i=!1,a=!1,o=r??ve;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function it(e,t,n){let r=n??ve;return{reason:e,event:t??new Event(`base-ui`),...r}}var at={value:()=>null},ot=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,hiddenUntilFound:o,keepMounted:s,loopFocus:c=!0,onValueChange:l,multiple:u=!1,orientation:d=`vertical`,value:f,defaultValue:m,...h}=e,g=P();process.env.NODE_ENV!==`production`&&x(()=>{o&&s===!1&&C("The `keepMounted={false}` prop on a Accordion.Root will be ignored when using `hiddenUntilFound` since it requires Panels to remain mounted when closed.")},[o,s]);let _=t.useMemo(()=>{if(f===void 0)return m??[]},[f,m]),y=v(l),b=t.useRef([]),[S,w]=p({controlled:f,default:_,name:`Accordion`,state:`value`}),T=v((e,t)=>{let n=Y(Ne);if(!u){let t=S[0]===e?[]:[e];if(y(t,n),n.isCanceled)return;w(t)}else if(t){let t=S.slice();if(t.push(e),y(t,n),n.isCanceled)return;w(t)}else{let t=S.filter(t=>t!==e);if(y(t,n),n.isCanceled)return;w(t)}}),E=t.useMemo(()=>({value:S,disabled:a,orientation:d}),[S,a,d]),D=t.useMemo(()=>({accordionItemRefs:b,direction:g,disabled:a,handleValueChange:T,hiddenUntilFound:o??!1,keepMounted:s??!1,loopFocus:c,orientation:d,state:E,value:S}),[g,a,T,o,s,c,d,E,S]),A=J(`div`,e,{state:E,ref:n,props:[{dir:g,role:`region`},h],stateAttributesMapping:at});return(0,O.jsx)(L.Provider,{value:D,children:(0,O.jsx)(k,{elementsRef:b,children:A})})});process.env.NODE_ENV!==`production`&&(ot.displayName=`AccordionRoot`);var st={...t},ct=0;function lt(e,n=`mui`){let[r,i]=t.useState(e),a=e||r;return t.useEffect(()=>{r??(ct+=1,i(`${n}-${ct}`))},[r,n]),a}var ut=st.useId;function dt(e,t){if(ut!==void 0){let n=ut();return e??(t?`${t}-${n}`:n)}return lt(e,t)}function ft(e){return dt(e,`base-ui`)}var pt=[];function mt(e){t.useEffect(e,pt)}var ht=null,gt=globalThis.requestAnimationFrame,_t=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=process.env.NODE_ENV!==`production`&&gt!==requestAnimationFrame&&(gt=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},vt=class e{static create(){return new e}static request(e){return _t.request(e)}static cancel(e){return _t.cancel(e)}currentId=ht;request(e){this.cancel(),this.currentId=_t.request(()=>{this.currentId=ht,e()})}cancel=()=>{this.currentId!==ht&&(_t.cancel(this.currentId),this.currentId=ht)};disposeEffect=()=>this.cancel};function yt(){let e=h(vt.create).current;return mt(e.disposeEffect),e}function bt(e){return e==null?e:`current`in e?e.current:e}var xt=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),St={[xt.startingStyle]:``},Ct={[xt.endingStyle]:``},wt={transitionStatus(e){return e===`starting`?St:e===`ending`?Ct:null}};function Tt(e,t=!1,r=!0){let i=yt();return v((a,o=null)=>{i.cancel();function s(){n.flushSync(a)}let c=bt(e);if(c==null)return;let l=c;if(typeof l.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)a();else{function e(){let e=xt.startingStyle;if(!l.hasAttribute(e)){i.request(n);return}let t=new MutationObserver(()=>{l.hasAttribute(e)||(t.disconnect(),n())});t.observe(l,{attributes:!0,attributeFilter:[e]}),o?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function n(){Promise.all(l.getAnimations().map(e=>e.finished)).then(()=>{o?.aborted||s()}).catch(()=>{let e=l.getAnimations();if(r){if(o?.aborted)return;s()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&n()})}if(t){e();return}i.request(n)}})}function Et(e,n=!1,r=!1){let[i,a]=t.useState(e&&n?`idle`:void 0),[o,s]=t.useState(e);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!r&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),x(()=>{if(!e&&o&&i!==`ending`&&r){let e=vt.request(()=>{a(`ending`)});return()=>{vt.cancel(e)}}},[e,o,i,r]),x(()=>{if(!e||n)return;let t=vt.request(()=>{a(void 0)});return()=>{vt.cancel(t)}},[n,e]),x(()=>{if(!e||!n)return;e&&o&&i!==`idle`&&a(`starting`);let t=vt.request(()=>{a(`idle`)});return()=>{vt.cancel(t)}},[n,e,o,a,i]),t.useMemo(()=>({mounted:o,setMounted:s,transitionStatus:i}),[o,i])}function Dt(e){let{open:n,defaultOpen:r,onOpenChange:i,disabled:a}=e,o=n!==void 0,[s,c]=p({controlled:n,default:r,name:`Collapsible`,state:`open`}),{mounted:l,setMounted:u,transitionStatus:d}=Et(s,!0,!0),[f,m]=t.useState(s),[{height:h,width:g},_]=t.useState({height:void 0,width:void 0}),y=ft(),[b,S]=t.useState(),C=b??y,[w,T]=t.useState(!1),[E,D]=t.useState(!1),O=t.useRef(null),k=t.useRef(null),A=t.useRef(null),j=t.useRef(null),M=Tt(j,!1),N=v(e=>{let t=!s,n=Y(Pe,e.nativeEvent);if(i(t,n),n.isCanceled)return;let r=j.current;k.current===`css-animation`&&r!=null&&r.style.removeProperty(`animation-name`),!w&&!E&&(k.current!=null&&k.current!==`css-animation`&&!l&&t&&u(!0),k.current===`css-animation`&&(!f&&t&&m(!0),!l&&t&&u(!0))),c(t),k.current===`none`&&l&&!t&&u(!1)});return x(()=>{o&&k.current===`none`&&!E&&!s&&u(!1)},[o,E,s,n,u]),t.useMemo(()=>({abortControllerRef:O,animationTypeRef:k,disabled:a,handleTrigger:N,height:h,mounted:l,open:s,panelId:C,panelRef:j,runOnceAnimationsFinish:M,setDimensions:_,setHiddenUntilFound:T,setKeepMounted:D,setMounted:u,setOpen:c,setPanelIdState:S,setVisible:m,transitionDimensionRef:A,transitionStatus:d,visible:f,width:g}),[O,k,a,N,h,l,s,C,j,M,_,T,D,u,c,m,A,d,f,g])}var Ot=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ot.displayName=`CollapsibleRootContext`);function kt(){let e=t.useContext(Ot);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(15):`Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.`);return e}var At=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function jt(e={}){let{label:n,metadata:r,textRef:i,indexGuessBehavior:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,elementsRef:u,labelsRef:d,nextIndexRef:f}=T(),p=t.useRef(-1),[m,h]=t.useState(o??(a===At.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),g=t.useRef(null),_=t.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(u.current[m]=e,d)){let t=n!==void 0;d.current[m]=t?n:i?.current?.textContent??e.textContent}},[m,u,d,n,i]);return x(()=>{if(o!=null)return;let e=g.current;if(e)return s(e,r),()=>{c(e)}},[o,s,c,r]),x(()=>{if(o==null)return l(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[o,l,h]),t.useMemo(()=>({ref:_,index:m}),[m,_])}var Mt=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Mt.displayName=`AccordionItemContext`);function Nt(){let e=t.useContext(Mt);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(9):`Base UI: AccordionItemContext is missing. Accordion parts must be placed within <Accordion.Item>.`);return e}var Pt=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=xt.startingStyle]=`startingStyle`,e[e.endingStyle=xt.endingStyle]=`endingStyle`,e}({}),Ft=function(e){return e.panelOpen=`data-panel-open`,e}({}),It={[Pt.open]:``},Lt={[Pt.closed]:``},Rt={open(e){return e?{[Ft.panelOpen]:``}:null}},zt={open(e){return e?It:Lt}},Bt=function(e){return e.index=`data-index`,e.disabled=`data-disabled`,e.open=`data-open`,e}({}),Vt={...zt,index:e=>Number.isInteger(e)?{[Bt.index]:String(e)}:null,...wt,value:()=>null},Ht=t.forwardRef(function(e,n){let{className:r,disabled:i=!1,onOpenChange:a,render:o,value:s,...c}=e,{ref:l,index:u}=jt(),d=z(n,l),{disabled:f,handleValueChange:p,state:m,value:h}=R(),g=ft(),_=s??g,y=i||f,b=t.useMemo(()=>{if(!h)return!1;for(let e=0;e<h.length;e+=1)if(h[e]===_)return!0;return!1},[h,_]),x=v((e,t)=>{a?.(e,t),!t.isCanceled&&p(_,e)}),S=Dt({open:b,onOpenChange:x,disabled:y}),C=t.useMemo(()=>({open:S.open,disabled:S.disabled,hidden:!S.mounted,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.mounted,S.transitionStatus]),w=t.useMemo(()=>({...S,onOpenChange:x,state:C}),[S,C,x]),T=t.useMemo(()=>({...m,index:u,disabled:y,open:b}),[y,u,b,m]),[E,D]=t.useState(ft()),k=t.useMemo(()=>({open:b,state:T,setTriggerId:D,triggerId:E}),[b,T,D,E]),A=J(`div`,e,{state:T,ref:d,props:c,stateAttributesMapping:Vt});return(0,O.jsx)(Ot.Provider,{value:w,children:(0,O.jsx)(Mt.Provider,{value:k,children:A})})});process.env.NODE_ENV!==`production`&&(Ht.displayName=`AccordionItem`);var Ut=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=Nt();return J(`h3`,e,{state:a,ref:t,props:i,stateAttributesMapping:Vt})});process.env.NODE_ENV!==`production`&&(Ut.displayName=`AccordionHeader`);function Wt(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Gt(){return typeof window<`u`}function Kt(e){return Yt(e)?(e.nodeName||``).toLowerCase():`#document`}function qt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jt(e){return((Yt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Yt(e){return Gt()?e instanceof Node||e instanceof qt(e).Node:!1}function Xt(e){return Gt()?e instanceof Element||e instanceof qt(e).Element:!1}function Zt(e){return Gt()?e instanceof HTMLElement||e instanceof qt(e).HTMLElement:!1}function Qt(e){return!Gt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof qt(e).ShadowRoot}function $t(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function en(e){return/^(table|td|th)$/.test(Kt(e))}function tn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var nn=/transform|translate|scale|rotate|perspective|filter/,rn=/paint|layout|strict|content/,an=e=>!!e&&e!==`none`,on;function sn(e){let t=Xt(e)?dn(e):e;return an(t.transform)||an(t.translate)||an(t.scale)||an(t.rotate)||an(t.perspective)||!ln()&&(an(t.backdropFilter)||an(t.filter))||nn.test(t.willChange||``)||rn.test(t.contain||``)}function cn(e){let t=pn(e);for(;Zt(t)&&!un(t);){if(sn(t))return t;if(tn(t))return null;t=pn(t)}return null}function ln(){return on??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),on}function un(e){return/^(html|body|#document)$/.test(Kt(e))}function dn(e){return qt(e).getComputedStyle(e)}function fn(e){return Xt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pn(e){if(Kt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Qt(e)&&e.host||Jt(e);return Qt(t)?t.host:t}function mn(e){let t=pn(e);return un(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zt(t)&&$t(t)?t:mn(t)}function hn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=mn(e),i=r===e.ownerDocument?.body,a=qt(r);if(i){let e=gn(a);return t.concat(a,a.visualViewport||[],$t(r)?r:[],e&&n?hn(e):[])}else return t.concat(r,hn(r,[],n))}function gn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var _n;process.env.NODE_ENV!==`production`&&(_n=new Set);function vn(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);_n.has(t)||(_n.add(t),console.error(`Base UI: ${t}`))}}var yn=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(yn.displayName=`CompositeRootContext`);function bn(e=!1){let n=t.useContext(yn);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return n}function xn(e){let{focusableWhenDisabled:n,disabled:r,composite:i=!1,tabIndex:a=0,isNativeButton:o}=e,s=i&&n!==!1,c=i&&n===!1;return{props:t.useMemo(()=>{let e={onKeyDown(e){r&&n&&e.key!==`Tab`&&e.preventDefault()}};return i||(e.tabIndex=a,!o&&r&&(e.tabIndex=n?a:-1)),(o&&(n||s)||!o&&r)&&(e[`aria-disabled`]=r),o&&(!n||c)&&(e.disabled=r),e},[i,r,n,s,c,o,a])}}function Sn(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=t.useRef(null),c=bn(!0),l=o??c!==void 0,{props:u}=xn({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:i,isNativeButton:a});process.env.NODE_ENV!==`production`&&t.useEffect(()=>{if(!s.current)return;let e=Cn(s.current);a?e||vn(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${st.captureOwnerStack?.()||``}`):e&&vn(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${st.captureOwnerStack?.()||``}`)},[a]);let d=t.useCallback(()=>{let e=s.current;Cn(e)&&l&&n&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,u.disabled,l]);return x(d,[d]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return ae({type:a?`button`:void 0,onClick(e){if(n){e.preventDefault();return}t?.(e)},onMouseDown(e){n||r?.(e)},onKeyDown(e){if(n||(pe(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,s=Cn(i),c=!a&&wn(i),u=r&&(a?s:!c),d=e.key===`Enter`,f=e.key===` `,p=i.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),c||a&&s?(i.click(),e.preventBaseUIHandler()):u&&(t?.(e),e.preventBaseUIHandler());return}u&&(!a&&(f||d)&&e.preventDefault(),!a&&d&&t?.(e))},onKeyUp(e){if(!n){if(pe(e),i?.(e),e.target===e.currentTarget&&a&&l&&Cn(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&e.key===` `&&t?.(e)}},onPointerDown(e){if(n){e.preventDefault();return}s?.(e)}},a?void 0:{role:`button`},u,c)},[n,u,l,a]),buttonRef:v(e=>{s.current=e,d()})}}function Cn(e){return Zt(e)&&e.tagName===`BUTTON`}function wn(e){return!!(e?.tagName===`A`&&e?.href)}var Tn=typeof navigator<`u`,En=In(),Dn=Rn(),On=Ln(),kn=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),An=En.platform===`MacIntel`&&En.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(En.platform),jn=Tn&&/firefox/i.test(On),Mn=Tn&&/apple/i.test(navigator.vendor);Tn&&/Edg/i.test(On);var Nn=Tn&&/android/i.test(Dn)||/android/i.test(On),Pn=Tn&&Dn.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,Fn=On.includes(`jsdom/`);function In(){if(!Tn)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function Ln(){if(!Tn)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Rn(){if(!Tn)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var zn=`data-base-ui-focusable`,Bn=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Vn=`ArrowLeft`,Hn=`ArrowRight`,Un=`ArrowUp`,Wn=`ArrowDown`;function Gn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Qt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Kn(e,t){if(!Xt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function qn(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Jn(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Yn(e){return e.matches(`html,body`)}function Xn(e){return Zt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Zn(e){return e?e.getAttribute(`role`)===`combobox`&&Xn(e):!1}function Qn(e){if(!e||Fn)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function $n(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function er(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...er(e,t.id,n)])}function tr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function nr(e){e.preventDefault(),e.stopPropagation()}function rr(e){return`nativeEvent`in e}function ir(e){return e.pointerType===``&&e.isTrusted?!0:Nn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ar(e){return Fn?!1:!Nn&&e.width===0&&e.height===0||Nn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function or(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function sr(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var cr=[`top`,`right`,`bottom`,`left`],lr=Math.min,ur=Math.max,dr=Math.round,fr=Math.floor,pr=e=>({x:e,y:e}),mr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hr(e,t,n){return ur(e,lr(t,n))}function gr(e,t){return typeof e==`function`?e(t):e}function _r(e){return e.split(`-`)[0]}function vr(e){return e.split(`-`)[1]}function yr(e){return e===`x`?`y`:`x`}function br(e){return e===`y`?`height`:`width`}function xr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Sr(e){return yr(xr(e))}function Cr(e,t,n){n===void 0&&(n=!1);let r=vr(e),i=Sr(e),a=br(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Mr(o)),[o,Mr(o)]}function wr(e){let t=Mr(e);return[Tr(e),t,Tr(t)]}function Tr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Er=[`left`,`right`],Dr=[`right`,`left`],Or=[`top`,`bottom`],kr=[`bottom`,`top`];function Ar(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Dr:Er:t?Er:Dr;case`left`:case`right`:return t?Or:kr;default:return[]}}function jr(e,t,n,r){let i=vr(e),a=Ar(_r(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Tr)))),a}function Mr(e){let t=_r(e);return mr[t]+e.slice(t.length)}function Nr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Nr(e)}function Fr(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 Ir(e,t,n){return Math.floor(e/t)!==n}function Lr(e,t){return t<0||t>=e.current.length}function Rr(e,t){return Br(e,{disabledIndices:t})}function zr(e,t){return Br(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Br(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&Gr(e,a,r));return a}function Vr(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f;if(t.key===`ArrowUp`?f=`up`:t.key===`ArrowDown`&&(f=`down`),f){let n=[],i=[],p=!1,m=0;{let t=null,r=-1;e.current.forEach((e,a)=>{if(e==null)return;m+=1;let o=e.closest(`[role="row"]`);o&&(p=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(a),i[a]=r})}let h=!1,g=0;if(p)for(let e of n){let t=e.length;t>g&&(g=t),t!==a&&(h=!0)}let _=h&&m<e.current.length,v=g||a,y=t=>{if(!h||l===-1)return;let a=i[l];if(a==null)return;let s=n[a].indexOf(l),c=t===`up`?-1:1;for(let t=a+c,i=0;i<n.length;i+=1,t+=c){if(t<0||t>=n.length){if(!r||_)return;t=t<0?n.length-1:0}let i=n[t];for(let t=Math.min(s,i.length-1);t>=0;--t){let n=i[t];if(!Gr(e,n,o))return n}}},b=t=>{if(!_||l===-1)return;let n=l%v,i=t===`up`?-v:v,a=c-c%v,s=fr(c/v)+1;for(let t=l-n+i,u=0;u<s;u+=1,t+=i){if(t<0||t>c){if(!r)return;t=t<0?a:0}let i=Math.min(t+v-1,c);for(let r=Math.min(t+n,i);r>=t;--r)if(!Gr(e,r,o))return r}};u&&nr(t);let x=y(f)??b(f);if(x!==void 0)d=x;else if(l===-1)d=f===`up`?c:s;else if(d=Br(e,{startingIndex:l,amount:v,decrement:f===`up`,disabledIndices:o}),r){if(f===`up`&&(l-v<s||d<0)){let e=l%v,t=c%v,n=c-(t-e);d=t===e?c:t>e?n:n-v}f===`down`&&l+v>c&&(d=Br(e,{startingIndex:l%v-v,amount:v,disabledIndices:o}))}Lr(e,d)&&(d=l)}if(n===`both`){let n=fr(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&nr(t),l%a===a-1?r&&(d=Br(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=Br(e,{startingIndex:l,disabledIndices:o}),r&&Ir(d,a,n)&&(d=Br(e,{startingIndex:l-l%a-1,disabledIndices:o}))),Ir(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&nr(t),l%a===0?r&&(d=Br(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=Br(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&Ir(d,a,n)&&(d=Br(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),Ir(d,a,n)&&(d=l));let s=fr(c/a)===n;Lr(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:Br(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function Hr(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{if(e>t&&process.env.NODE_ENV!==`production`)throw Error(`[Floating UI]: Invalid grid - item width at index ${o} is greater than grid columns`);let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function Ur(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function Wr(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Gr(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e.current[t];return r?Kr(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function Kr(e){return dn(e).display!==`none`}var qr=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),Jr=typeof Element>`u`,Yr=Jr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Xr=!Jr&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Zr=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Zr(e.parentNode))},Qr=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},$r=function(e,t,n){if(Zr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(qr));return t&&Yr.call(e,qr)&&r.unshift(e),r=r.filter(n),r},ei=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Zr(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=ei(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Yr.call(a,qr)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Zr(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=ei(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},ti=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ni=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Qr(e))&&!ti(e)?0:e.tabIndex},ri=function(e,t){var n=ni(e);return n<0&&t&&!ti(e)?0:n},ii=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ai=function(e){return e.tagName===`INPUT`},oi=function(e){return ai(e)&&e.type===`hidden`},si=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},ci=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},li=function(e){if(!e.name)return!0;var t=e.form||Xr(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=ci(r,e.form);return!i||i===e},ui=function(e){return ai(e)&&e.type===`radio`},di=function(e){return ui(e)&&!li(e)},fi=function(e){var t=e&&Xr(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Xr(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},pi=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},mi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Yr.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Yr.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Xr(e);if(o&&!o.shadowRoot&&r(o)===!0)return pi(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(fi(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return pi(e);return!1},hi=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Yr.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},gi=function(e,t){return!(t.disabled||oi(t)||mi(t,e)||si(t)||hi(t))},_i=function(e,t){return!(di(t)||ni(t)<0||!gi(e,t))},vi=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},yi=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=ri(a,i),s=i?yi(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ii).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},bi=function(e,t){return t||={},yi(t.getShadowRoot?ei([e],t.includeContainer,{filter:_i.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:vi}):$r(e,t.includeContainer,_i.bind(null,t)))},xi=function(e,t){return t||={},t.getShadowRoot?ei([e],t.includeContainer,{filter:gi.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):$r(e,t.includeContainer,gi.bind(null,t))},Si=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Yr.call(e,qr)===!1?!1:_i(t,e)};function Ci(e){return e?.ownerDocument||document}var wi=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Ti(e,t){let n=bi(e,wi()),r=n.length;if(r===0)return;let i=Gn(Ci(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ei(e){return Ti(Ci(e).body,1)||e}function Di(e){return Ti(Ci(e).body,-1)||e}function Oi(e,t){if(!e)return null;let n=bi(Ci(e).body,wi()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function ki(e){return Oi(e,1)}function Ai(e){return Oi(e,-1)}function ji(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function Mi(e){bi(e,wi()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Ni(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Pi=`ArrowUp`,Fi=`ArrowDown`,Ii=`ArrowLeft`,Li=`ArrowRight`,Ri=`Home`,zi=new Set([Ii,Li]),Bi=new Set([Ii,Li,Ri,`End`]),Vi=new Set([Pi,Fi]),Hi=new Set([Pi,Fi,Ri,`End`]),Ui=new Set([...zi,...Vi]),Wi=new Set([...Ui,Ri,`End`]),Gi=new Set([Pi,Fi,Ii,Li,Ri,`End`]),Ki=`Shift`,qi=new Set([Ki,`Control`,`Alt`,`Meta`]);function Ji(e){return Zt(e)&&e.tagName===`INPUT`}function Yi(e){return!!(Ji(e)&&e.selectionStart!=null||Zt(e)&&e.tagName===`TEXTAREA`)}function Xi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Zi(e,t,`left`),a=Qi(e),o=Qi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Zi(e,t,`top`),r=Qi(e),i=Qi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Zi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Qi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var $i=new Set([Fi,Pi,Li,Ii,Ri,`End`]);function ea(e){let{current:t}=e,n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!Wt(r)){let e=r?.querySelector(`[type="button"], [role="button"]`);e&&!Wt(e)&&n.push(e)}}return n}var ta=t.forwardRef(function(e,n){let{disabled:r,className:i,id:a,render:o,nativeButton:s=!0,...c}=e,{panelId:l,open:u,handleTrigger:d,disabled:f}=kt(),{getButtonProps:p,buttonRef:m}=Sn({disabled:r??f,focusableWhenDisabled:!0,native:s,composite:!0}),{accordionItemRefs:h,direction:g,loopFocus:_,orientation:v}=R(),y=g===`rtl`,b=v===`horizontal`,{state:S,setTriggerId:C,triggerId:w}=Nt();x(()=>(a&&C(a),()=>{C(void 0)}),[a,C]);let T=t.useMemo(()=>({"aria-controls":u?l:void 0,"aria-expanded":u,id:w,tabIndex:0,onClick:d,onKeyDown(e){if(!$i.has(e.key))return;nr(e);let t=ea(h),n=t.length-1,r=-1,i=t.indexOf(e.target);function a(){r=_?i+1>n?0:i+1:Math.min(i+1,n)}function o(){r=_&&i===0?n:i-1}switch(e.key){case Fi:b||a();break;case Pi:b||o();break;case Li:b&&(y?o():a());break;case Ii:b&&(y?a():o());break;case`Home`:r=0;break;case`End`:r=n;break;default:break}r>-1&&t[r].focus()}}),[h,d,w,b,y,_,u,l]);return J(`button`,e,{state:S,ref:[n,m],props:[T,c,p],stateAttributesMapping:Rt})});process.env.NODE_ENV!==`production`&&(ta.displayName=`AccordionTrigger`);var na=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function ra(e){let{abortControllerRef:n,animationTypeRef:r,externalRef:i,height:a,hiddenUntilFound:o,keepMounted:s,id:c,mounted:l,onOpenChange:u,open:d,panelRef:f,runOnceAnimationsFinish:p,setDimensions:m,setMounted:h,setOpen:g,setVisible:_,transitionDimensionRef:y,visible:b,width:S}=e,w=t.useRef(!1),T=t.useRef(null),E=t.useRef(d),D=t.useRef(d),O=yt(),k=t.useMemo(()=>r.current===`css-animation`?!b:!d&&!l,[d,l,b,r]),A=z(i,f,v(e=>{if(!e)return;if(r.current==null||y.current==null){let t=getComputedStyle(e),n=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;n&&i?process.env.NODE_ENV!==`production`&&C(`CSS transitions and CSS animations both detected on Collapsible or Accordion panel.`,`Only one of either animation type should be used.`):t.animationName===`none`&&t.transitionDuration!==`0s`?r.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?r.current=`css-animation`:r.current=`none`,e.getAttribute(na.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?y.current=`width`:y.current=`height`}if(r.current!==`css-transition`)return;(a===void 0||S===void 0)&&(m({height:e.scrollHeight,width:e.scrollWidth}),D.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,n=-1;return t=vt.request(()=>{D.current=!1,n=vt.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{vt.cancel(t),vt.cancel(n)}}));return x(()=>{if(r.current!==`css-transition`)return;let e=f.current;if(!e)return;let t=-1;if(n.current!=null&&(n.current.abort(),n.current=null),d){let n={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(n).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!D.current&&!s&&e.setAttribute(Pt.startingStyle,``),m({height:e.scrollHeight,width:e.scrollWidth}),t=vt.request(()=>{Object.entries(n).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;m({height:e.scrollHeight,width:e.scrollWidth});let t=new AbortController;n.current=t;let r=t.signal,i=null,a=Pt.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,p(()=>{m({height:0,width:0}),e.style.removeProperty(`content-visibility`),h(!1),n.current===t&&(n.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),O.cancel(),n.current===t&&(t.abort(),n.current=null)}}return()=>{vt.cancel(t)}},[n,r,O,o,s,l,d,f,p,m,h]),x(()=>{if(r.current!==`css-animation`)return;let e=f.current;e&&(T.current=e.style.animationName||T.current,e.style.setProperty(`animation-name`,`none`),m({height:e.scrollHeight,width:e.scrollWidth}),!E.current&&!w.current&&e.style.removeProperty(`animation-name`),d?(n.current!=null&&(n.current.abort(),n.current=null),h(!0),_(!0)):(n.current=new AbortController,p(()=>{h(!1),_(!1),n.current=null},n.current.signal)))},[n,r,d,f,p,m,h,_,b]),mt(()=>{let e=vt.request(()=>{E.current=!1});return()=>vt.cancel(e)}),x(()=>{if(!o)return;let e=f.current;if(!e)return;let t=-1,n=-1;return d&&w.current&&(e.style.transitionDuration=`0s`,m({height:e.scrollHeight,width:e.scrollWidth}),t=vt.request(()=>{w.current=!1,n=vt.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{vt.cancel(t),vt.cancel(n)}},[o,d,f,m]),x(()=>{let e=f.current;e&&o&&k&&(e.setAttribute(`hidden`,`until-found`),r.current===`css-transition`&&e.setAttribute(Pt.startingStyle,``))},[o,k,r,f]),t.useEffect(function(){let e=f.current;if(!e)return;function t(e){w.current=!0,g(!0),u(!0,Y(Ne,e))}return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[u,f,g]),t.useMemo(()=>({props:{hidden:k,id:c,ref:A}}),[k,c,A])}var ia=function(e){return e.accordionPanelHeight=`--accordion-panel-height`,e.accordionPanelWidth=`--accordion-panel-width`,e}({});function aa(e){let{enabled:n=!0,open:r,ref:i,onComplete:a}=e,o=v(a),s=Tt(i,r,!1);t.useEffect(()=>{if(!n)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[n,r,o,s])}var oa=t.forwardRef(function(e,n){let{className:r,hiddenUntilFound:i,keepMounted:a,id:o,render:s,...c}=e,{hiddenUntilFound:l,keepMounted:u}=R(),{abortControllerRef:d,animationTypeRef:f,height:p,mounted:m,onOpenChange:h,open:g,panelId:_,panelRef:v,runOnceAnimationsFinish:y,setDimensions:b,setHiddenUntilFound:S,setKeepMounted:w,setMounted:T,setOpen:E,setVisible:D,transitionDimensionRef:O,visible:k,width:A,setPanelIdState:j,transitionStatus:M}=kt(),N=i??l,P=a??u;process.env.NODE_ENV!==`production`&&x(()=>{a===!1&&N&&C("The `keepMounted={false}` prop on a Accordion.Panel will be ignored when using `contextHiddenUntilFound` on the Panel or the Root since it requires the panel to remain mounted when closed.")},[N,a]),x(()=>{if(o)return j(o),()=>{j(void 0)}},[o,j]),x(()=>{S(N)},[S,N]),x(()=>{w(P)},[w,P]),aa({open:g&&M===`idle`,ref:v,onComplete(){g&&b({width:void 0,height:void 0})}});let{props:F}=ra({abortControllerRef:d,animationTypeRef:f,externalRef:n,height:p,hiddenUntilFound:N,id:o??_,keepMounted:P,mounted:m,onOpenChange:h,open:g,panelRef:v,runOnceAnimationsFinish:y,setDimensions:b,setMounted:T,setOpen:E,setVisible:D,transitionDimensionRef:O,visible:k,width:A}),{state:I,triggerId:L}=Nt(),z=J(`div`,e,{state:t.useMemo(()=>({...I,transitionStatus:M}),[I,M]),ref:[n,v],props:[F,{"aria-labelledby":L,role:`region`,style:{[ia.accordionPanelHeight]:p===void 0?`auto`:`${p}px`,[ia.accordionPanelWidth]:A===void 0?`auto`:`${A}px`}},c],stateAttributesMapping:Vt});return P||N||!P&&m?z:null});process.env.NODE_ENV!==`production`&&(oa.displayName=`AccordionPanel`);var sa=ot,ca=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Ht,{ref:n,className:`border-b border-neutral-200 dark:border-neutral-800 ${e||``}`,...t}));ca.displayName=`AccordionItem`;var la=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsx)(Ut,{className:`flex`,children:(0,O.jsxs)(ta,{ref:i,className:`group flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2 dark:hover:text-neutral-300 dark:focus-visible:ring-white dark:focus-visible:ring-offset-neutral-950 ${e||``}`,...n,children:[t,(0,O.jsx)(r.ChevronDown,{className:`size-4 shrink-0 px-0 text-neutral-500 transition-transform duration-200 group-data-[panel-open]:rotate-180 dark:text-neutral-400`})]})}));la.displayName=`AccordionTrigger`;var ua=t.forwardRef(({className:e,children:t,...n},r)=>(0,O.jsx)(oa,{ref:r,className:`overflow-hidden text-sm text-neutral-600 dark:text-neutral-400 transition-all duration-300 ease-in-out data-[starting-style]:grid-rows-[0fr] data-[starting-style]:opacity-0 grid grid-rows-[1fr] ${e||``}`,...n,children:(0,O.jsx)(`div`,{className:`pb-4 pt-0 min-h-0`,children:t})}));ua.displayName=`AccordionContent`;var da=0,fa=class e{static create(){return new e}currentId=da;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=da,t()},e)}isStarted(){return this.currentId!==da}clear=()=>{this.currentId!==da&&(clearTimeout(this.currentId),this.currentId=da)};disposeEffect=()=>this.clear};function pa(){let e=h(fa.create).current;return mt(e.disposeEffect),e}var ma={},ha={},ga=``;function _a(e){if(typeof document>`u`)return!1;let t=Ci(e);return qt(t).innerWidth-t.documentElement.clientWidth>0}function va(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ci(e),n=t.documentElement,r=t.body,i=$t(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ya(e){let t=Ci(e),n=t.documentElement,r=t.body,i=$t(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ba(e){let t=Ci(e),n=t.documentElement,r=t.body,i=qt(n),a=0,o=0,s=!1,c=vt.create();if(kn&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ma={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ga=n.style.scrollBehavior,ha={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=$t(n)?n:r;if(s=va(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,ma),Object.assign(r.style,ha),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ga)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var xa=new class{lockCount=0;restore=null;timeoutLock=fa.create();timeoutUnlock=fa.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ci(e).documentElement,n=qt(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=ge;return}this.restore=An||!_a(e)?ya(e):ba(e)}};function Sa(e=!0,t=null){x(()=>{if(e)return xa.acquire(t)},[e,t])}function Ca(e,t){return t!=null&&!or(t)?0:typeof e==`function`?e():e}function wa(e,t,n){let r=Ca(e,n);return typeof r==`number`?r:r?.[t]}function Ta(e){return typeof e==`function`?e():e}function Ea(e,t){return t||e===`click`||e===`mousedown`}var Da=t.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new fa,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(Da.displayName=`FloatingDelayGroupContext`);function Oa(e){let{children:n,delay:r,timeoutMs:i=0}=e,a=t.useRef(r),o=t.useRef(r),s=t.useRef(null),c=t.useRef(null),l=pa();return(0,O.jsx)(Da.Provider,{value:t.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:o,currentIdRef:s,timeoutMs:i,currentContextRef:c,timeout:l}),[i,l]),children:n})}function ka(e,n={open:!1}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{open:a}=n,{currentIdRef:o,delayRef:s,timeoutMs:c,initialDelayRef:l,currentContextRef:u,hasProvider:d,timeout:f}=t.useContext(Da),[p,m]=t.useState(!1);return x(()=>{function e(){m(!1),u.current?.setIsInstantPhase(!1),o.current=null,u.current=null,s.current=l.current}if(o.current&&!a&&o.current===i){if(m(!1),c){let t=i;return f.start(c,()=>{r.select(`open`)||o.current&&o.current!==t||e()}),()=>{f.clear()}}e()}},[a,i,o,s,c,l,u,f,r]),x(()=>{if(!a)return;let e=u.current,t=o.current;f.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:m},o.current=i,s.current={open:0,close:wa(l.current,`close`)},t!==null&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Y(Ne))):(m(!1),e?.setIsInstantPhase(!1))},[a,i,r,o,s,c,l,u,f]),x(()=>()=>{u.current=null},[u]),t.useMemo(()=>({hasProvider:d,delayRef:s,isInstantPhase:p}),[d,s,p])}function Aa(e){let t=h(ja,e).current;return t.next=e,x(t.effect),t}function ja(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ma={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Na={...Ma,position:`fixed`,top:0,left:0},Pa={...Ma,position:`absolute`},Fa=t.forwardRef(function(e,n){let[r,i]=t.useState();x(()=>{Mn&&i(`button`)},[]);let a={tabIndex:0,role:r};return(0,O.jsx)(`span`,{...e,ref:n,style:Na,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(Fa.displayName=`FocusGuard`);function Ia(e){return`data-base-ui-${e}`}var La=0;function Ra(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(La);let a=()=>e?.focus({preventScroll:n});i?a():La=requestAnimationFrame(a)}var za={inert:new WeakMap,"aria-hidden":new WeakMap},Ba=`data-base-ui-inert`,Va={inert:new WeakSet,"aria-hidden":new WeakSet},Ha=new WeakMap,Ua=0;function Wa(e){return Va[e]}function Ga(e){return e?Qt(e)?e.host:Ga(e.parentNode):null}var Ka=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ga(t);return e.contains(n)?n:null}).filter(e=>e!=null),qa=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ja=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Kt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Ya(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Ka(t,e),u=i?Ka(t,a):[],d=new Set(u),f=i?Ja(t,qa(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=za[o],n=Wa(o);c=n,s=e;let r=Ka(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Ja(t,qa(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Ha.get(e)||0)+1;Ha.set(e,t),m.push(e),t===1&&e.setAttribute(Ba,``)}),Ua+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Ha.get(e)||0)-1;Ha.set(e,t),t||e.removeAttribute(Ba)}),--Ua,Ua||(za.inert=new WeakMap,za[`aria-hidden`]=new WeakMap,Va.inert=new WeakSet,Va[`aria-hidden`]=new WeakSet,Ha=new WeakMap)}}function Xa(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=Ci(e[0]).body;return Ya(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Za=t.createContext(null);process.env.NODE_ENV!==`production`&&(Za.displayName=`PortalContext`);var Qa=()=>t.useContext(Za),$a=Ia(`portal`);function eo(e={}){let{ref:r,container:i,componentProps:a=ve,elementProps:o}=e,s=dt(),c=Qa()?.portalNode,[l,u]=t.useState(null),[d,f]=t.useState(null),p=v(e=>{e!==null&&f(e)}),m=t.useRef(null);x(()=>{if(i===null){m.current&&(m.current=null,f(null),u(null));return}if(s==null)return;let e=(i&&(Yt(i)?i:i.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[i,c,s]);let h=J(`div`,a,{ref:[r,p],props:[{id:s,[$a]:``},o]});return{portalNode:d,portalSubtree:l&&h?n.createPortal(h,l):null}}var to=t.forwardRef(function(e,r){let{children:i,container:a,className:o,render:s,renderGuards:c,...l}=e,{portalNode:u,portalSubtree:d}=eo({container:a,ref:r,componentProps:e,elementProps:l}),f=t.useRef(null),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[g,_]=t.useState(null),v=g?.modal,y=g?.open,b=typeof c==`boolean`?c:!!g&&!g.modal&&g.open&&!!u;t.useEffect(()=>{if(!u||v)return;function e(e){u&&e.relatedTarget&&ji(e)&&(e.type===`focusin`?Ni:Mi)(u)}return u.addEventListener(`focusin`,e,!0),u.addEventListener(`focusout`,e,!0),()=>{u.removeEventListener(`focusin`,e,!0),u.removeEventListener(`focusout`,e,!0)}},[u,v]),t.useEffect(()=>{!u||y||Ni(u)},[y,u]);let x=t.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:u,setFocusManagerState:_}),[u]);return(0,O.jsxs)(t.Fragment,{children:[d,(0,O.jsxs)(Za.Provider,{value:x,children:[b&&u&&(0,O.jsx)(Fa,{"data-type":`outside`,ref:f,onFocus:e=>{ji(e,u)?m.current?.focus():Di(g?g.domReference:null)?.focus()}}),b&&u&&(0,O.jsx)(`span`,{"aria-owns":u.id,style:De}),u&&n.createPortal(i,u),b&&u&&(0,O.jsx)(Fa,{"data-type":`outside`,ref:p,onFocus:e=>{ji(e,u)?h.current?.focus():(Ei(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Y(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(to.displayName=`FloatingPortal`);function no(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ro=class{nodesRef={current:[]};events=no();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},io=t.createContext(null);process.env.NODE_ENV!==`production`&&(io.displayName=`FloatingNodeContext`);var ao=t.createContext(null);process.env.NODE_ENV!==`production`&&(ao.displayName=`FloatingTreeContext`);var oo=()=>t.useContext(io)?.id||null,so=e=>{let n=t.useContext(ao);return e??n};function co(e){let t=dt(),n=so(e),r=oo();return x(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function lo(e){let{children:n,id:r}=e,i=oo();return(0,O.jsx)(io.Provider,{value:t.useMemo(()=>({id:r,parentId:i}),[r,i]),children:n})}function uo(e){let{children:t,externalTree:n}=e,r=h(()=>n??new ro).current;return(0,O.jsx)(ao.Provider,{value:r,children:t})}function fo(e,t){let n=qt(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var po=20,mo=[];function ho(){mo=mo.filter(e=>e.deref()?.isConnected)}function go(e){ho(),e&&Kt(e)!==`body`&&(mo.push(new WeakRef(e)),mo.length>po&&(mo=mo.slice(-po)))}function _o(){return ho(),mo[mo.length-1]?.deref()}function vo(e){if(!e)return null;let t=wi();return Si(e,t)?e:bi(e,t)[0]||e}function yo(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Kr(e)}function bo(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=wi(),r=xi(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Si(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function xo(e){let{context:n,children:r,disabled:i=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in n?n.rootStore:n,_=g.useState(`open`),y=g.useState(`domReferenceElement`),b=g.useState(`floatingElement`),{events:S,dataRef:C}=g.context,w=v(()=>C.current.floatingContext?.nodeId),T=a===!1,E=Zn(y)&&T,D=t.useRef([`content`]),k=Aa(a),A=Aa(o),j=Aa(u),M=so(m),N=Qa(),P=t.useRef(!1),F=t.useRef(!1),I=t.useRef(!1),L=t.useRef(-1),R=t.useRef(``),B=t.useRef(``),ee=t.useRef(null),V=t.useRef(null),H=z(ee,p,N?.beforeInsideRef),U=z(V,N?.afterInsideRef),W=pa(),G=pa(),K=yt(),te=N!=null,q=$n(b),ne=v((e=q)=>e?bi(e,wi()):[]),re=v(()=>h?.().filter(e=>e!=null)??[]),ie=v(e=>{let t=ne(e);return D.current.map(()=>t).filter(Boolean).flat()});t.useEffect(()=>{if(i||!c)return;function e(e){e.key===`Tab`&&X(q,Gn(Ci(q)))&&ne().length===0&&!E&&nr(e)}let t=Ci(q);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[i,y,q,c,D,E,ne,ie]),t.useEffect(()=>{if(i||!_)return;let e=Ci(q);function t(){I.current=!1}function n(e){let t=qn(e),n=re();I.current=!(X(b,t)||X(y,t)||X(N?.portalNode,t)||n.some(e=>e===t||X(e,t))),B.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(F.current=!0)}function r(){B.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,r,!0)}},[i,b,y,q,_,N,re]),t.useEffect(()=>{if(i||!l)return;let e=Ci(q);function t(){F.current=!0,G.start(0,()=>{F.current=!1})}function n(e){let t=qn(e),n=ne().indexOf(t);n!==-1&&(L.current=n)}function r(t){let n=t.relatedTarget,r=t.currentTarget,i=qn(t);queueMicrotask(()=>{let a=w(),o=g.context.triggerElements,l=re(),u=n?.hasAttribute(Ia(`focus-guard`))&&[ee.current,V.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,bt(f),bt(d)].includes(n),p=!(X(y,n)||X(b,n)||X(n,b)||X(N?.portalNode,n)||l.some(e=>e===n||X(e,n))||n!=null&&o.hasElement(n)||o.hasMatchingElement(e=>X(e,n))||u||M&&(er(M.nodesRef.current,a).find(e=>X(e.context?.elements.floating,n)||X(e.context?.elements.domReference,n))||tr(M.nodesRef.current,a).find(e=>[e.context?.elements.floating,$n(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===y&&q&&bo(q,D),s&&r!==y&&!yo(i)&&Gn(e)===e.body){if(Zt(q)&&(q.focus(),s===`popup`)){K.request(()=>{q.focus()});return}let e=L.current,t=ne(),n=t[e]||t[t.length-1]||q;Zt(n)&&n.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(E||!c)&&n&&p&&!F.current&&(E||n!==_o())&&(P.current=!0,g.setOpen(!1,Y(qe,t)))})}function a(){I.current||(C.current.insideReactTree=!0,W.start(0,()=>{C.current.insideReactTree=!1}))}let o=Zt(y)?y:null,u=[];if(!(!b&&!o))return o&&(o.addEventListener(`focusout`,r),o.addEventListener(`pointerdown`,t),u.push(()=>{o.removeEventListener(`focusout`,r),o.removeEventListener(`pointerdown`,t)})),b&&(b.addEventListener(`focusin`,n),b.addEventListener(`focusout`,r),N&&(b.addEventListener(`focusout`,a,!0),u.push(()=>{b.removeEventListener(`focusout`,a,!0)})),u.push(()=>{b.removeEventListener(`focusin`,n),b.removeEventListener(`focusout`,r)})),()=>{u.forEach(e=>{e()})}},[i,y,b,q,c,M,N,g,l,s,ne,E,w,D,C,W,G,K,d,f,re]),t.useEffect(()=>{if(i||!b||!_)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${Ia(`portal`)}]`)||[]),t=(M?tr(M.nodesRef.current,w()):[]).find(e=>Zn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xa([...[b,...e,ee.current,V.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...re()],t,bt(f),bt(d),E?y:null].filter(e=>e!=null),{ariaHidden:c||E,mark:!1}),r=Xa([b,...e].filter(e=>e!=null));return()=>{r(),n()}},[_,i,y,b,c,D,N,E,M,w,d,f,re]),x(()=>{if(!_||i||!Zt(q))return;let e=Gn(Ci(q));queueMicrotask(()=>{let t=ie(q),n=k.current,r=typeof n==`function`?n(j.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||q:bt(r),i=i||t[0]||q,!X(q,e)&&Ra(i,{preventScroll:i===q})})},[i,_,q,T,ie,k,j]),x(()=>{if(i||!q)return;let e=Ci(q);go(Gn(e));function t(e){if(e.open||(R.current=fo(e.nativeEvent,B.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(ir(e.nativeEvent)||ar(e.nativeEvent))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}S.on(`openchange`,t);function n(){let e=A.current,t=typeof e==`function`?e(R.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=y||_o();return e&&e.isConnected?e:null}let n=y||_o();return bt(t)||n||null}return()=>{S.off(`openchange`,t);let r=Gn(e),i=re(),a=X(b,r)||i.some(e=>e===r||X(e,r))||M&&er(M.nodesRef.current,w(),!1).some(e=>X(e.context?.elements.floating,r)),o=n();queueMicrotask(()=>{let t=vo(o),n=typeof A.current!=`boolean`;A.current&&!P.current&&Zt(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),P.current=!1})}},[i,b,q,A,C,S,M,y,w,re]),x(()=>{if(!kn||_||!b)return;let e=Gn(Ci(b));!Zt(e)||!Xn(e)||X(b,e)&&e.blur()},[_,b]),x(()=>{if(!(i||!N))return N.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,c,_,g,l,y]),x(()=>{if(!(i||!q))return bo(q,D),()=>{queueMicrotask(ho)}},[i,q,D]);let ae=!i&&(c?!E:!0)&&(te||c);return(0,O.jsxs)(t.Fragment,{children:[ae&&(0,O.jsx)(Fa,{"data-type":`inside`,ref:H,onFocus:e=>{if(c){let e=ie();Ra(e[e.length-1])}else N?.portalNode&&(P.current=!1,ji(e,N.portalNode)?Ei(y)?.focus():bt(f??N.beforeOutsideRef)?.focus())}}),r,ae&&(0,O.jsx)(Fa,{"data-type":`inside`,ref:U,onFocus:e=>{c?Ra(ie()[0]):N?.portalNode&&(l&&(P.current=!0),ji(e,N.portalNode)?Di(y)?.focus():bt(d??N.afterOutsideRef)?.focus())}})]})}function So(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.context.dataRef,{enabled:a=!0,event:o=`click`,toggle:s=!0,ignoreMouse:c=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:d=Pe}=n,f=t.useRef(void 0),p=yt(),m=pa(),h=t.useMemo(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current,n=e.nativeEvent,a=r.select(`open`);if(e.button!==0||o===`click`||or(t,!0)&&c)return;let h=i.current.openEvent,g=h?.type,_=r.select(`domReferenceElement`)!==e.currentTarget,v=a&&_||!(a&&s&&(!(h&&l)||g===`click`||g===`mousedown`));if(Xn(n.target)){let e=Y(d,n,n.target);v&&t===`touch`&&u>0?m.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(v,e);return}let y=e.currentTarget;p.request(()=>{let e=Y(d,n,y);v&&t===`touch`&&u>0?m.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(v,e)})},onClick(e){if(o===`mousedown-only`)return;let t=f.current;if(o===`mousedown`&&t){f.current=void 0;return}if(or(t,!0)&&c)return;let n=r.select(`open`),a=i.current.openEvent,p=r.select(`domReferenceElement`)!==e.currentTarget,h=n&&p||!(n&&s&&(!(a&&l)||sr(a))),g=Y(d,e.nativeEvent,e.currentTarget);h&&t===`touch`&&u>0?m.start(u,()=>{r.setOpen(!0,g)}):r.setOpen(h,g)},onKeyDown(){f.current=void 0}}),[i,o,c,r,l,s,p,m,u,d]);return t.useMemo(()=>a?{reference:h}:ve,[a,h])}function Co(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function wo(e){return e!=null&&e.clientX!=null}function To(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.context.dataRef,{enabled:c=!0,axis:l=`both`}=n,u=t.useRef(!1),d=t.useRef(null),[f,p]=t.useState(),[m,h]=t.useState([]),g=v((e,t,n)=>{u.current||s.current.openEvent&&!wo(s.current.openEvent)||r.set(`positionReference`,Co(n??o,{x:e,y:t,axis:l,dataRef:s,pointerType:f}))}),_=v(e=>{i?d.current||h([]):g(e.clientX,e.clientY,e.currentTarget)}),y=or(f)?a:i,b=t.useCallback(()=>{if(!y||!c)return;let e=qt(a);function t(n){X(a,qn(n))?(e.removeEventListener(`mousemove`,t),d.current=null):g(n.clientX,n.clientY)}if(!s.current.openEvent||wo(s.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),d.current=null};return d.current=n,n}r.set(`positionReference`,o)},[y,c,a,s,o,r,g]);t.useEffect(()=>b(),[b,m]),t.useEffect(()=>{c&&!a&&(u.current=!1)},[c,a]),t.useEffect(()=>{!c&&i&&(u.current=!0)},[c,i]);let x=t.useMemo(()=>{function e(e){p(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return t.useMemo(()=>c?{reference:x,trigger:x}:{},[c,x])}var Eo={intentional:`onClick`,sloppy:`onPointerDown`};function Do(){return!1}function Oo(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ko(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),{dataRef:o}=r.context,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u=`sloppy`,referencePress:d=Do,referencePressEvent:f=`sloppy`,bubbles:p,externalTree:m}=n,h=so(m),g=v(typeof l==`function`?l:()=>!1),_=typeof l==`function`?g:l,y=_!==!1,b=v(()=>u),x=t.useRef(!1),S=t.useRef(!1),C=t.useRef(!1),{escapeKey:w,outsidePress:T}=Oo(p),E=t.useRef(null),D=pa(),O=pa(),k=v(()=>{O.clear(),o.current.insideReactTree=!1}),A=t.useRef(!1),j=t.useRef(``),M=v(d),N=v(e=>{if(!i||!s||!c||e.key!==`Escape`||A.current)return;let t=o.current.floatingContext?.nodeId,n=h?er(h.nodesRef.current,t):[];if(!w&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Y(Je,rr(e)?e.nativeEvent:e);r.setOpen(!1,a),!w&&!a.isPropagationAllowed&&e.stopPropagation()}),P=v(()=>{o.current.insideReactTree=!0,O.start(0,k)});t.useEffect(()=>{if(!i||!s)return;o.current.__escapeKeyBubbles=w,o.current.__outsidePressBubbles=T;let e=new fa,t=new fa;function n(){e.clear(),A.current=!0}function l(){e.start(ln()?5:0,()=>{A.current=!1})}function u(){C.current=!0,t.start(0,()=>{C.current=!1})}function d(){x.current=!1,S.current=!1}function f(){let e=j.current,t=e===`pen`||!e?`mouse`:e,n=b(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function m(e){let t=o.current.floatingContext?.nodeId,n=h&&er(h.nodesRef.current,t).some(t=>Jn(e,t.context?.elements.floating));return Jn(e,r.select(`floatingElement`))||Jn(e,r.select(`domReferenceElement`))||n}function g(e){if(p(e)){k();return}if(o.current.insideReactTree){k();return}let n=qn(e),i=`[${Ia(`inert`)}]`,a=Array.from(Ci(r.select(`floatingElement`)).querySelectorAll(i)),s=Xt(n)?n.getRootNode():null;Qt(s)&&(a=a.concat(Array.from(s.querySelectorAll(i))));let c=r.context.triggerElements;if(n&&(c.hasElement(n)||c.hasMatchingElement(e=>X(e,n))))return;let l=Xt(n)?n:null;for(;l&&!un(l);){let e=pn(l);if(un(e)||!Xt(e))break;l=e}if(a.length&&Xt(n)&&!Yn(n)&&!X(n,r.select(`floatingElement`))&&a.every(e=>!X(l,e)))return;if(Zt(n)&&!(`touches`in e)){let t=un(n),r=dn(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(m(e))return;if(f()===`intentional`&&C.current){t.clear(),C.current=!1;return}if(typeof _==`function`&&!_(e))return;let u=o.current.floatingContext?.nodeId,d=h?er(h.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r.setOpen(!1,Y(Le,e)),k()}function v(e){f()!==`sloppy`||e.pointerType===`touch`||!r.select(`open`)||!s||Jn(e,r.select(`floatingElement`))||Jn(e,r.select(`domReferenceElement`))||g(e)}function O(e){if(f()!==`sloppy`||!r.select(`open`)||!s||Jn(e,r.select(`floatingElement`))||Jn(e,r.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function M(e){j.current=`touch`;let t=qn(e);function n(){O(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function P(e){if(D.clear(),e.type===`pointerdown`&&(j.current=e.pointerType),e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)return;let t=qn(e);function n(){e.type===`pointerdown`?v(e):g(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function F(e){if(!x.current)return;let n=S.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!m(e)){if(n){u();return}typeof _==`function`&&!_(e)||(t.clear(),C.current=!0,k())}}}function I(e){if(f()!==`sloppy`||!E.current||Jn(e,r.select(`floatingElement`))||Jn(e,r.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),i=Math.abs(t.clientY-E.current.startY),a=Math.sqrt(n*n+i*i);a>5&&(E.current.dismissOnTouchEnd=!0),a>10&&(g(e),D.clear(),E.current=null)}function L(e){let t=qn(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function R(e){f()!==`sloppy`||!E.current||Jn(e,r.select(`floatingElement`))||Jn(e,r.select(`domReferenceElement`))||(E.current.dismissOnTouchEnd&&g(e),D.clear(),E.current=null)}function z(e){let t=qn(e);function n(){R(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}let B=Ci(a);return c&&(B.addEventListener(`keydown`,N),B.addEventListener(`compositionstart`,n),B.addEventListener(`compositionend`,l)),y&&(B.addEventListener(`click`,P,!0),B.addEventListener(`pointerdown`,P,!0),B.addEventListener(`pointerup`,F,!0),B.addEventListener(`pointercancel`,F,!0),B.addEventListener(`mousedown`,P,!0),B.addEventListener(`mouseup`,F,!0),B.addEventListener(`touchstart`,M,!0),B.addEventListener(`touchmove`,L,!0),B.addEventListener(`touchend`,z,!0)),()=>{c&&(B.removeEventListener(`keydown`,N),B.removeEventListener(`compositionstart`,n),B.removeEventListener(`compositionend`,l)),y&&(B.removeEventListener(`click`,P,!0),B.removeEventListener(`pointerdown`,P,!0),B.removeEventListener(`pointerup`,F,!0),B.removeEventListener(`pointercancel`,F,!0),B.removeEventListener(`mousedown`,P,!0),B.removeEventListener(`mouseup`,F,!0),B.removeEventListener(`touchstart`,M,!0),B.removeEventListener(`touchmove`,L,!0),B.removeEventListener(`touchend`,z,!0)),e.clear(),t.clear(),d(),C.current=!1}},[o,a,c,y,_,i,s,w,T,N,k,b,h,r,D]),t.useEffect(k,[_,k]);let F=t.useMemo(()=>({onKeyDown:N,[Eo[f]]:e=>{M()&&r.setOpen(!1,Y(Pe,e.nativeEvent))},...f!==`intentional`&&{onClick(e){M()&&r.setOpen(!1,Y(`trigger-press`,e.nativeEvent))}}}),[N,r,f,M]),I=v(e=>{if(!i||!s||e.button!==0)return;let t=qn(e.nativeEvent);X(r.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),L=v(e=>{!i||!s||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)}),R=t.useMemo(()=>({onKeyDown:N,onPointerDown:L,onMouseDown:L,onClickCapture:P,onMouseDownCapture(e){P(),I(e)},onPointerDownCapture(e){P(),I(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,I,L]);return t.useMemo(()=>s?{reference:F,floating:R,trigger:F}:{},[s,F,R])}function Ao(e,t,n){let{reference:r,floating:i}=e,a=xr(t),o=Sr(t),s=br(o),c=_r(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}}switch(vr(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function jo(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}=gr(t,e),p=Pr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Fr(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=Fr(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 Mo=50,No=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ao(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<Mo&&(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}=Ao(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Po=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}=gr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=_r(r),_=xr(o),v=_r(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Mr(o)]:wr(o)),x=p!==`none`;!d&&x&&b.push(...jr(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=Cr(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`&&_!==xr(t))||T.every(e=>xr(e.placement)===_?e.overflows[0]>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=xr(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Fo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Io(e){return cr.some(t=>e[t]>=0)}var Lo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=gr(e,t);switch(i){case`referenceHidden`:{let e=Fo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Io(e)}}}case`escaped`:{let e=Fo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Io(e)}}}default:return{}}}}},Ro=new Set([`left`,`top`]);async function zo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_r(n),s=vr(n),c=xr(n)===`y`,l=Ro.has(o)?-1:1,u=a&&c?-1:1,d=gr(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 Bo=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 zo(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}}}}},Vo=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}=gr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=xr(_r(i)),p=yr(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hr(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hr(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ho=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}=gr(e,t),u={x:n,y:r},d=xr(i),f=yr(d),p=u[f],m=u[d],h=gr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Ro.has(_r(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}}}},Uo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gr(e,t),u=await o.detectOverflow(t,l),d=_r(i),f=vr(i),p=xr(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lr(h-u[g],v),x=lr(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ur(u.left,0),t=ur(u.right,0),n=ur(u.top,0),r=ur(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ur(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ur(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Wo(e){let t=dn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Zt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dr(n)!==a||dr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Go(e){return Xt(e)?e:e.contextElement}function Ko(e){let t=Go(e);if(!Zt(t))return pr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Wo(t),o=(a?dr(n.width):n.width)/r,s=(a?dr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var qo=pr(0);function Jo(e){let t=qt(e);return!ln()||!t.visualViewport?qo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qt(e)?!1:t}function Xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Go(e),o=pr(1);t&&(r?Xt(r)&&(o=Ko(r)):o=Ko(e));let s=Yo(a,n,r)?Jo(a):pr(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){let e=qt(a),t=r&&Xt(r)?qt(r):r,n=e,i=gn(n);for(;i&&r&&t!==n;){let e=Ko(i),t=i.getBoundingClientRect(),r=dn(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=qt(i),i=gn(n)}}return Fr({width:u,height:d,x:c,y:l})}function Zo(e,t){let n=fn(e).scrollLeft;return t?t.left+n:Xo(Jt(e)).left+n}function Qo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Zo(e,n),y:n.top+t.scrollTop}}function $o(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Jt(r),s=t?tn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pr(1),u=pr(0),d=Zt(r);if((d||!d&&!a)&&((Kt(r)!==`body`||$t(o))&&(c=fn(r)),d)){let e=Xo(r);l=Ko(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Qo(o,c):pr(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 es(e){return Array.from(e.getClientRects())}function ts(e){let t=Jt(e),n=fn(e),r=e.ownerDocument.body,i=ur(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ur(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Zo(e),s=-n.scrollTop;return dn(r).direction===`rtl`&&(o+=ur(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ns=25;function rs(e,t){let n=qt(e),r=Jt(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=ln();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Zo(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=ns&&(a-=o)}else l<=ns&&(a+=l);return{width:a,height:o,x:s,y:c}}function is(e,t){let n=Xo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zt(e)?Ko(e):pr(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function as(e,t,n){let r;if(t===`viewport`)r=rs(e,n);else if(t===`document`)r=ts(Jt(e));else if(Xt(t))r=is(t,n);else{let n=Jo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fr(r)}function os(e,t){let n=pn(e);return n===t||!Xt(n)||un(n)?!1:dn(n).position===`fixed`||os(n,t)}function ss(e,t){let n=t.get(e);if(n)return n;let r=hn(e,[],!1).filter(e=>Xt(e)&&Kt(e)!==`body`),i=null,a=dn(e).position===`fixed`,o=a?pn(e):e;for(;Xt(o)&&!un(o);){let t=dn(o),n=sn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||$t(o)&&!n&&os(e,o))?r=r.filter(e=>e!==o):i=t,o=pn(o)}return t.set(e,r),r}function cs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?tn(t)?[]:ss(t,this._c):[].concat(n),r],o=as(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=as(t,a[e],i);s=ur(n.top,s),c=lr(n.right,c),l=lr(n.bottom,l),u=ur(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ls(e){let{width:t,height:n}=Wo(e);return{width:t,height:n}}function us(e,t,n){let r=Zt(t),i=Jt(t),a=n===`fixed`,o=Xo(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=pr(0);function l(){c.x=Zo(i)}if(r||!r&&!a)if((Kt(t)!==`body`||$t(i))&&(s=fn(t)),r){let e=Xo(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Qo(i,s):pr(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ds(e){return dn(e).position===`static`}function fs(e,t){if(!Zt(e)||dn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Jt(e)===n&&(n=n.ownerDocument.body),n}function ps(e,t){let n=qt(e);if(tn(e))return n;if(!Zt(e)){let t=pn(e);for(;t&&!un(t);){if(Xt(t)&&!ds(t))return t;t=pn(t)}return n}let r=fs(e,t);for(;r&&en(r)&&ds(r);)r=fs(r,t);return r&&un(r)&&ds(r)&&!sn(r)?n:r||cn(e)||n}var ms=async function(e){let t=this.getOffsetParent||ps,n=this.getDimensions,r=await n(e.floating);return{reference:us(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hs(e){return dn(e).direction===`rtl`}var gs={convertOffsetParentRelativeRectToViewportRelativeRect:$o,getDocumentElement:Jt,getClippingRect:cs,getOffsetParent:ps,getElementRects:ms,getClientRects:es,getDimensions:ls,getScale:Ko,isElement:Xt,isRTL:hs};function _s(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vs(e,t){let n=null,r,i=Jt(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=fr(d),h=fr(i.clientWidth-(u+f)),g=fr(i.clientHeight-(d+p)),_=fr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ur(0,lr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!_s(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function ys(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=Go(e),u=i||a?[...l?hn(l):[],...t?hn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?vs(l,n):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?Xo(e):null;c&&g();function g(){let t=Xo(e);h&&!_s(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 bs=Bo,xs=Vo,Ss=Po,Cs=Uo,ws=Lo,Ts=Ho,Es=(e,t,n)=>{let r=new Map,i={platform:gs,...n},a={...i.platform,_c:r};return No(e,t,{...i,platform:a})},Ds=typeof document<`u`?t.useLayoutEffect:function(){};function Os(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(!Os(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)&&!Os(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function As(e,t){let n=ks(e);return Math.round(t*n)/n}function js(e){let n=t.useRef(e);return Ds(()=>{n.current=e}),n}function Ms(e){e===void 0&&(e={});let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=t.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[m,h]=t.useState(a);Os(m,a)||h(a);let[g,_]=t.useState(null),[v,y]=t.useState(null),b=t.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=t.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=s||g,C=c||v,w=t.useRef(null),T=t.useRef(null),E=t.useRef(f),D=u!=null,O=js(u),k=js(o),A=js(d),j=t.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:r,strategy:i,middleware:m};k.current&&(e.platform=k.current),Es(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Os(E.current,t)&&(E.current=t,n.flushSync(()=>{p(t)}))})},[m,r,i,k,A]);Ds(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=t.useRef(!1);Ds(()=>(M.current=!0,()=>{M.current=!1}),[]),Ds(()=>{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=t.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=t.useMemo(()=>({reference:S,floating:C}),[S,C]),F=t.useMemo(()=>{let e={position:i,left:0,top:0};if(!P.floating)return e;let t=As(P.floating,f.x),n=As(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+n+`px)`,...ks(P.floating)>=1.5&&{willChange:`transform`}}:{position:i,left:t,top:n}},[i,l,P.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Ns=(e,t)=>{let n=bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ps=(e,t)=>{let n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fs=(e,t)=>({fn:Ts(e).fn,options:[e,t]}),Is=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ls=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t,n)=>{if(t.length===1&&t[0]===n){let t=!1;try{let n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`The result function returned its own inputs without modification. e.g
10
+ \`createSelector([state => state.todos], todos => todos)\`
11
+ This could lead to inefficient memoization and unnecessary re-renders.
12
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},Bs=(e,t,n)=>{let{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:a,inputSelectorResultsCopy:o}=e,s=r(()=>({}),...i);if(s.apply(null,a)!==s.apply(null,o)){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`An input selector returned a different result when passed same arguments.
13
+ This means your output selector will likely run more frequently than intended.
14
+ Avoid returning a new reference inside your input selector, e.g.
15
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},Vs={inputStabilityCheck:`once`,identityFunctionCheck:`once`},Hs=Symbol(`NOT_FOUND`);function Us(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Ws(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Gs(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Ks=e=>Array.isArray(e)?e:[e];function qs(e){let t=Array.isArray(e[0])?e[0]:e;return Gs(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Js(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Ys=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...Vs,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:zs},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:Bs}}};function Xs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Hs},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Zs(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return Hs}function i(t,i){r(t)===Hs&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Qs=(e,t)=>e===t;function $s(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function ec(e,t){let{equalityCheck:n=Qs,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=$s(n),o=0,s=r<=1?Xs(a):Zs(r,a);function c(){let t=s.get(arguments);if(t===Hs){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var tc=class{constructor(e){this.value=e}deref(){return this.value}},nc=typeof WeakRef<`u`?WeakRef:tc,rc=0,ic=1;function ac(){return{s:rc,v:void 0,o:null,p:null}}function oc(e,t={}){let n=ac(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=ac(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=ac(),e.set(n,t)):t=r}}let s=t,c;if(t.s===ic)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new nc(c):c}return s.s=ic,s.v=c,c}return o.clearCache=()=>{n=ac(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function sc(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Us(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=oc,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Ks(c),p=Ks(u),m=qs(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=Js(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=Ys(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=Js(m,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:s,memoizeOptions:f},arguments)}g&&=!1}return i},...p);return Object.assign(_,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var cc=sc(oc),lc=Object.assign((e,t=cc)=>{Ws(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>lc}),uc=sc({memoize:ec,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Z=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?I(1):`Unsupported number of selectors`);let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},dc=(...e)=>{let t=new WeakMap,n=1,r=e[e.length-1],i=e.length-1||1,a=r.length-i;if(a>3)throw Error(process.env.NODE_ENV===`production`?I(2):`Unsupported number of arguments`);return(i,o,s,c)=>{let l=i.__cacheKey__;l||(l={id:n},i.__cacheKey__=l,n+=1);let u=t.get(l);if(!u){let n=e,i=[void 0,void 0,void 0];switch(a){case 0:break;case 1:n=[...e.slice(0,-1),()=>i[0],r];break;case 2:n=[...e.slice(0,-1),()=>i[0],()=>i[1],r];break;case 3:n=[...e.slice(0,-1),()=>i[0],()=>i[1],()=>i[2],r];break;default:throw Error(process.env.NODE_ENV===`production`?I(2):`Unsupported number of arguments`)}u=uc(...n),u.selectorArgs=i,t.set(l,u)}switch(u.selectorArgs[0]=o,u.selectorArgs[1]=s,u.selectorArgs[2]=c,a){case 0:return u(i);case 1:return u(i,o);case 2:return u(i,o,s);case 3:return u(i,o,s,c);default:throw Error(`unreachable`)}}},fc=u((e=>{var t=require(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),pc=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require(`react`),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),mc=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=fc():t.exports=pc()})),hc=u((e=>{var t=require(`react`),n=mc();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),gc=u((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require(`react`),r=mc(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),_c=u(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=hc():t.exports=gc()})),vc=[],yc=void 0;function bc(){return yc}function xc(e){vc.push(e)}function Sc(e){let t=(t,n)=>{let r=h(wc).current,i;try{yc=r;for(let e of vc)e.before(r);i=e(t,n);for(let e of vc)e.after(r);r.didInitialize=!0}finally{yc=void 0}return i};return t.displayName=e.displayName||e.name,t}function Cc(e){return t.forwardRef(Sc(e))}function wc(){return{didInitialize:!1}}var Tc=mc(),Ec=_c(),Dc=G(19)?kc:Ac;function Q(e,t,n,r,i){return Dc(e,t,n,r,i)}function Oc(e,n,r,i,a){let o=t.useCallback(()=>n(e.getSnapshot(),r,i,a),[e,n,r,i,a]);return(0,Tc.useSyncExternalStore)(e.subscribe,o,o)}xc({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tc.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function kc(e,t,n,r,i){let a=bc();if(!a)return Oc(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function Ac(e,t,n,r,i){return(0,Ec.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var jc=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Q(this,e,t,n,r)}},Mc=class extends jc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,n){t.useDebugValue(e),x(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,t){let n=this;x(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let n=this;if(process.env.NODE_ENV!==`production`){t.useDebugValue(e,e=>Object.keys(e));let n=t.useRef(Object.keys(e)).current,r=Object.keys(e);(n.length!==r.length||n.some((e,t)=>e!==r[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}x(()=>{n.update(e)},[n,...Object.values(e)])}useControlledProp(e,n){t.useDebugValue(e);let r=n!==void 0;if(x(()=>{r&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r]),process.env.NODE_ENV!==`production`){let t=this.controlledValues??=new Map;t.has(e)||t.set(e,r);let n=t.get(e);n!==void 0&&n!==r&&console.error(`A component is changing the ${r?``:`un`}controlled state of ${e.toString()} to be ${r?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,n,r,i){return t.useDebugValue(e),Q(this,this.selectors[e],n,r,i)}useContextCallback(e,n){t.useDebugValue(e);let r=v(n??ge);this.context[e]=r}useStateSetter(e){let n=t.useRef(void 0);return n.current===void 0&&(n.current=t=>{this.set(e,t)}),n.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Nc(){let[,e]=t.useState({});return t.useCallback(()=>{e({})},[])}var Pc={open:Z(e=>e.open),domReferenceElement:Z(e=>e.domReferenceElement),referenceElement:Z(e=>e.positionReference??e.referenceElement),floatingElement:Z(e=>e.floatingElement),floatingId:Z(e=>e.floatingId)},Fc=class extends Mc{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:no(),nested:t,noEmit:n,triggerElements:i},Pc)}setOpen=(e,t)=>{if((!e||!this.state.open||sr(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function Ic(e,n){let r=t.useRef(null),i=t.useRef(null);return t.useCallback(t=>{if(e!==void 0){if(r.current!==null){let e=r.current,t=i.current,a=n.context.triggerElements.getById(e);t&&a===t&&n.context.triggerElements.delete(e),r.current=null,i.current=null}t!==null&&(r.current=e,i.current=t,n.context.triggerElements.add(e,t))}},[n,e])}function Lc(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ic(e,n),o=v(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return x(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Rc(e){let t=e.useState(`open`);x(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function zc(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Et(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=v(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return aa({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Bc=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);if(n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t),process.env.NODE_ENV!==`production`&&this.elementsSet.size!==this.idMap.size))throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`)}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Vc(){return new Fc({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Bc,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function Hc(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:Vc(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}var Uc=Z(e=>e.triggerIdProp??e.activeTriggerId),Wc={open:Z(e=>e.openProp??e.open),mounted:Z(e=>e.mounted),transitionStatus:Z(e=>e.transitionStatus),floatingRootContext:Z(e=>e.floatingRootContext),preventUnmountingOnClose:Z(e=>e.preventUnmountingOnClose),payload:Z(e=>e.payload),activeTriggerId:Uc,activeTriggerElement:Z(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Z((e,t)=>t!==void 0&&Uc(e)===t),isOpenedByTrigger:Z((e,t)=>t!==void 0&&Uc(e)===t&&e.open),isMountedByTrigger:Z((e,t)=>t!==void 0&&Uc(e)===t&&e.mounted),triggerProps:Z((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Z(e=>e.popupProps),popupElement:Z(e=>e.popupElement),positionerElement:Z(e=>e.positionerElement)};function Gc(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=dt(),a=oo()!=null;if(process.env.NODE_ENV!==`production`){let e=r.reference;e&&!Xt(e)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`",`instead.`)}let o=h(()=>new Fc({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Bc,floatingId:i,nested:a,noEmit:!1})).current;return x(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Xt(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function Kc(e={}){let{nodeId:n,externalTree:r}=e,i=Gc(e),a=e.rootContext||i,o={reference:a.useState(`referenceElement`),floating:a.useState(`floatingElement`),domReference:a.useState(`domReferenceElement`)},[s,c]=t.useState(null),l=t.useRef(null),u=so(r);x(()=>{o.domReference&&(l.current=o.domReference)},[o.domReference]);let d=Ms({...e,elements:{...o,...s&&{reference:s}}}),f=t.useCallback(e=>{let t=Xt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),d.refs.setReference(t)},[d.refs]),[p,m]=t.useState(null),[h,g]=t.useState(null);a.useSyncedValue(`referenceElement`,p),a.useSyncedValue(`domReferenceElement`,Xt(p)?p:null),a.useSyncedValue(`floatingElement`,h);let _=t.useCallback(e=>{(Xt(e)||e===null)&&(l.current=e,m(e)),(Xt(d.refs.reference.current)||d.refs.reference.current===null||e!==null&&!Xt(e))&&d.refs.setReference(e)},[d.refs,m]),v=t.useCallback(e=>{g(e),d.refs.setFloating(e)},[d.refs]),y=t.useMemo(()=>({...d.refs,setReference:_,setFloating:v,setPositionReference:f,domReference:l}),[d.refs,_,v,f]),b=t.useMemo(()=>({...d.elements,domReference:o.domReference}),[d.elements,o.domReference]),S=a.useState(`open`),C=a.useState(`floatingId`),w=t.useMemo(()=>({...d,dataRef:a.context.dataRef,open:S,onOpenChange:a.setOpen,events:a.context.events,floatingId:C,refs:y,elements:b,nodeId:n,rootStore:a}),[d,y,b,n,a,S,C]);return x(()=>{a.context.dataRef.current.floatingContext=w;let e=u?.nodesRef.current.find(e=>e.id===n);e&&(e.context=w)}),t.useMemo(()=>({...d,context:w,refs:y,elements:b,rootStore:a}),[d,y,b,w,a])}function qc(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=dt(),o=oo()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=h(()=>new Fc({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return x(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Xt(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var Jc=Pn&&Mn;function Yc(e,n={}){let r=`rootStore`in e?e.rootStore:e,{events:i,dataRef:a}=r.context,{enabled:o=!0,delay:s}=n,c=t.useRef(!1),l=t.useRef(null),u=pa(),d=t.useRef(!0);t.useEffect(()=>{let e=r.select(`domReferenceElement`);if(!o)return;let t=qt(e);function n(){let e=r.select(`domReferenceElement`);!r.select(`open`)&&Zt(e)&&e===Gn(Ci(e))&&(c.current=!0)}function i(){d.current=!0}function a(){d.current=!1}return t.addEventListener(`blur`,n),Jc&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,a,!0)),()=>{t.removeEventListener(`blur`,n),Jc&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,a,!0))}},[r,o]),t.useEffect(()=>{if(!o)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=r.select(`domReferenceElement`);Xt(e)&&(l.current=e,c.current=!0)}}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,o,r]);let f=t.useMemo(()=>({onMouseLeave(){c.current=!1,l.current=null},onFocus(e){let t=e.currentTarget;if(c.current){if(l.current===t)return;c.current=!1,l.current=null}let n=qn(e.nativeEvent);if(Xt(n)){if(Jc&&!e.relatedTarget){if(!d.current&&!Xn(n))return}else if(!Qn(n))return}let i=Kn(e.relatedTarget,r.context.triggerElements),{nativeEvent:a,currentTarget:o}=e,f=typeof s==`function`?s():s;if(r.select(`open`)&&i||f===0||f===void 0){r.setOpen(!0,Y(Ie,a,o));return}u.start(f,()=>{c.current||r.setOpen(!0,Y(Ie,a,o))})},onBlur(e){c.current=!1,l.current=null;let t=e.relatedTarget,n=e.nativeEvent,i=Xt(t)&&t.hasAttribute(Ia(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=r.select(`domReferenceElement`),o=Gn(e?e.ownerDocument:document);!t&&o===e||X(a.current.floatingContext?.refs.floating.current,o)||X(e,o)||i||Kn(t??o,r.context.triggerElements)||r.setOpen(!1,Y(Ie,n))})}}),[a,r,u,s]);return t.useMemo(()=>o?{reference:f,trigger:f}:{},[o,f])}var Xc=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Bn}`;function Zc(e){return e?!!e.closest(Xc):!1}var Qc=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new fa,this.restTimeout=new fa,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function $c(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function el(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t;$c(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function tl(e){let t=h(Qc.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,mt(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function nl(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),{dataRef:s}=r.context,{enabled:c=!0,closeDelay:l=0}=n,u=tl(r),d=so(),f=oo(),p=v(()=>Ea(s.current.openEvent?.type,u.interactedInside)),m=v(()=>{let e=s.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=v(e=>Kn(e,r.context.triggerElements)),g=t.useCallback(e=>{let t=wa(l,`close`,u.pointerType),n=()=>{r.setOpen(!1,Y(Fe,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,n):(u.openChangeTimeout.clear(),n())},[l,r,u,d]),_=v(()=>{$c(u)}),y=v(e=>{let t=qn(e);if(!Zc(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});x(()=>{i||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[i,u,_]),t.useEffect(()=>_,[_]),x(()=>{if(c&&i&&u.handleCloseOptions?.blockPointerEvents&&m()&&Xt(o)&&a){let e=o,t=a,n=Ci(a),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),el(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[c,i,o,a,u,m,d,f,_]);let b=pa();t.useEffect(()=>{if(!c)return;function e(){u.openChangeTimeout.clear(),b.clear(),d?.events.off(`floating.closed`,n),_()}function t(e){if(d&&f&&er(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,n);return}if(!h(e.relatedTarget)){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function n(e){!d||!f||er(d.nodesRef.current,f).length>0||b.start(0,()=>{d.events.off(`floating.closed`,n),r.setOpen(!1,Y(Fe,e)),d.events.emit(`floating.closed`,e)})}let i=a;return i&&(i.addEventListener(`mouseenter`,e),i.addEventListener(`mouseleave`,t),i.addEventListener(`pointerdown`,y,!0)),()=>{i&&(i.removeEventListener(`mouseenter`,e),i.removeEventListener(`mouseleave`,t),i.removeEventListener(`pointerdown`,y,!0)),d?.events.off(`floating.closed`,n)}},[c,a,r,s,p,h,g,_,y,u,d,f,b])}var rl={current:null};function il(e,r={}){let i=`rootStore`in e?e.rootStore:e,{dataRef:a,events:o}=i.context,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0,triggerElementRef:p=rl,externalTree:m,isActiveTrigger:h=!0,getHandleCloseContext:g}=r,_=so(m),y=tl(i),b=Aa(l),x=Aa(c),S=Aa(d),C=Aa(s);h&&(y.handleCloseOptions=b.current?.__options);let w=v(()=>Ea(a.current.openEvent?.type,y.interactedInside)),T=v(e=>Kn(e,i.context.triggerElements)),E=v((e,t,n)=>{let r=i.context.triggerElements;if(r.hasElement(t))return!e||!X(e,t);if(!Xt(n))return!1;let a=n;return r.hasMatchingElement(e=>X(e,a))&&(!e||!X(e,a))}),D=t.useCallback((e,t=!0)=>{let n=wa(x.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{i.setOpen(!1,Y(Fe,e)),_?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),i.setOpen(!1,Y(Fe,e)),_?.events.emit(`floating.closed`,e))},[x,i,y,_]),O=v(()=>{y.handler&&=(Ci(i.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)});t.useEffect(()=>O,[O]);let k=v(()=>{$c(y)});return t.useEffect(()=>{if(!s)return;function e(e){e.open||(O(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return o.on(`openchange`,e),()=>{o.off(`openchange`,e)}},[s,o,y,O]),t.useEffect(()=>{if(!s)return;let e=p.current??(h?i.select(`domReferenceElement`):null);if(!Xt(e))return;function t(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,u&&!or(y.pointerType)||Ta(S.current)>0&&!wa(x.current,`open`))return;let t=wa(x.current,`open`,y.pointerType),n=e.currentTarget??null,r=i.select(`domReferenceElement`),a=n==null?!1:E(r,n,e.target),o=i.select(`open`),s=!o||a;a&&o?i.setOpen(!0,Y(Fe,e,n)):t?y.openChangeTimeout.start(t,()=>{s&&i.setOpen(!0,Y(Fe,e,n))}):s&&i.setOpen(!0,Y(Fe,e,n))}function n(e){if(w()){k();return}O();let t=Ci(i.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let n=a.current.floatingContext??g?.();if(!T(e.relatedTarget)){if(b.current&&n){i.select(`open`)||y.openChangeTimeout.clear();let r=p.current;y.handler=b.current({...n,tree:_,x:e.clientX,y:e.clientY,onClose(){k(),O(),C.current&&!w()&&r===i.select(`domReferenceElement`)&&D(e,!0)}}),t.addEventListener(`mousemove`,y.handler),y.handler(e);return}(y.pointerType!==`touch`||!X(i.select(`floatingElement`),e.relatedTarget))&&D(e)}}return f&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),()=>{f&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n)}},[O,k,a,x,D,i,s,b,y,h,E,w,T,u,f,S,p,_,C,g]),t.useMemo(()=>{if(!s)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,a=i.select(`domReferenceElement`),o=i.select(`open`),s=E(a,r,e.target);if(u&&!or(y.pointerType))return;let c=Ta(S.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,w())return;let e=i.select(`open`);!y.blockMouseMove&&(!e||s)&&i.setOpen(!0,Y(Fe,t,r))}y.pointerType===`touch`?n.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[s,y,w,E,u,i,S])}function al(e=[]){let n=e.map(e=>e?.reference),r=e.map(e=>e?.floating),i=e.map(e=>e?.item),a=e.map(e=>e?.trigger),o=t.useCallback(t=>ol(t,e,`reference`),n),s=t.useCallback(t=>ol(t,e,`floating`),r),c=t.useCallback(t=>ol(t,e,`item`),i),l=t.useCallback(t=>ol(t,e,`trigger`),a);return t.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c,getTriggerProps:l}),[o,s,c,l])}function ol(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[zn]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&sl(a,s,i,r)}return sl(a,e,i,r),a}function sl(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var cl=`Escape`;function ll(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ul(e,t){return ll(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function dl(e,t,n){return ll(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function fl(e,t,n){return ll(t,n?e===Vn:e===Hn,e===Wn)}function pl(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===cl:ll(t,n?e===Hn:e===Vn,e===Un)}function ml(e,n){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.context.dataRef,{listRef:c,activeIndex:l,onNavigate:u=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:p=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:_=!1,focusItemOnOpen:y=`auto`,focusItemOnHover:b=!0,openOnArrowKeyDown:S=!0,disabledIndices:C=void 0,orientation:w=`vertical`,parentOrientation:T,cols:E=1,id:D,resetOnPointerLeave:O=!0,externalTree:k}=n;process.env.NODE_ENV!==`production`&&(p&&(m||console.warn("`useListNavigation` looping must be enabled to allow escaping."),_||console.warn("`useListNavigation` must be virtual to allow escaping.")),w===`vertical`&&E>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",`be either "horizontal" or "both".`));let A=Aa($n(a)),j=oo(),M=so(k);x(()=>{s.current.orientation=w},[s,w]);let N=Zn(o),P=t.useRef(y),F=t.useRef(f??-1),I=t.useRef(null),L=t.useRef(!0),R=v(e=>{u(F.current===-1?null:F.current,e)}),z=t.useRef(R),B=t.useRef(!!a),ee=t.useRef(i),V=t.useRef(!1),H=t.useRef(!1),U=Aa(C),W=Aa(i),G=Aa(f),K=Aa(O),te=v(()=>{function e(e){_?M?.events.emit(`virtualfocus`,e):Ra(e,{sync:V.current,preventScroll:!0})}let t=c.current[F.current],n=H.current;t&&e(t),(V.current?e=>e():requestAnimationFrame)(()=>{let r=c.current[F.current]||t;r&&(t||e(r),ne&&(n||!L.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});x(()=>{d&&(i&&a?(F.current=f??-1,P.current&&f!=null&&(H.current=!0,R())):B.current&&(F.current=-1,z.current()))},[d,i,a,f,R]),x(()=>{if(d){if(!i){V.current=!1;return}if(a)if(l==null){if(V.current=!1,G.current!=null)return;if(B.current&&(F.current=-1,te()),(!ee.current||!B.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{c.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(F.current=I.current==null||dl(I.current,w,g)||h?Rr(c):zr(c),I.current=null,R())};t()}}else Lr(c,l)||(F.current=l,te(),H.current=!1)}},[d,i,a,l,G,h,c,w,g,R,te,U]),x(()=>{if(!d||a||!M||_||!B.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=Gn(Ci(a)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[d,a,M,j,_]),x(()=>{z.current=R,ee.current=i,B.current=!!a}),x(()=>{i||(I.current=null,P.current=y)},[i,y]);let q=l!=null,ne=t.useMemo(()=>{function e(e){if(!W.current)return;let t=c.current.indexOf(e.currentTarget);t!==-1&&F.current!==t&&(F.current=t,R(e))}return{onFocus(t){V.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){V.current=!0,H.current=!1,b&&e(t)},onPointerLeave(e){if(!W.current||!L.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(!(!b||c.current.includes(t))&&K.current&&(Ra(null,{sync:!0}),F.current=-1,R(e),!_)){let e=A.current,t=Gn(Ci(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}},[W,A,b,c,R,K,_]),re=t.useCallback(()=>T??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation,[j,M,T]),ie=v(e=>{if(L.current=!1,V.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(h&&pl(e.key,w,g,E)){ul(e.key,re())||nr(e),r.setOpen(!1,Y(Xe,e.nativeEvent)),Zt(o)&&(_?M?.events.emit(`virtualfocus`,o):o.focus());return}let t=F.current,n=Rr(c,C),a=zr(c,C);if(N||(e.key===`Home`&&(nr(e),F.current=n,R(e)),e.key===`End`&&(nr(e),F.current=a,R(e))),E>1){let t=Array.from({length:c.current.length},()=>({width:1,height:1})),r=Hr(t,E,!1),i=r.findIndex(e=>e!=null&&!Gr(c,e,C)),o=r.reduce((e,t,n)=>t!=null&&!Gr(c,t,C)?n:e,-1),s=r[Vr({current:r.map(e=>e==null?null:c.current[e])},{event:e,orientation:w,loopFocus:m,rtl:g,cols:E,disabledIndices:Wr([...(typeof C==`function`?null:C)||c.current.map((e,t)=>Gr(c,t,C)?t:void 0),void 0],r),minIndex:i,maxIndex:o,prevIndex:Ur(F.current>a?n:F.current,t,r,E,e.key===`ArrowDown`?`bl`:e.key===(g?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(s!=null&&(F.current=s,R(e)),w===`both`)return}if(ul(e.key,w)){if(nr(e),i&&!_&&Gn(e.currentTarget.ownerDocument)===e.currentTarget){F.current=dl(e.key,w,g)?n:a,R(e);return}dl(e.key,w,g)?m?t>=a?p&&t!==c.current.length?F.current=-1:(V.current=!1,F.current=n):F.current=Br(c,{startingIndex:t,disabledIndices:C}):F.current=Math.min(a,Br(c,{startingIndex:t,disabledIndices:C})):m?t<=n?p&&t!==-1?F.current=c.current.length:(V.current=!1,F.current=a):F.current=Br(c,{startingIndex:t,decrement:!0,disabledIndices:C}):F.current=Math.max(n,Br(c,{startingIndex:t,decrement:!0,disabledIndices:C})),Lr(c,F.current)&&(F.current=-1),R(e)}}),ae=t.useMemo(()=>_&&i&&q&&{"aria-activedescendant":`${D}-${l}`},[_,i,q,D,l]),oe=t.useMemo(()=>({"aria-orientation":w===`both`?void 0:w,...N?{}:ae,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&i&&!_){let t=qn(e.nativeEvent);if(t&&!X(A.current,t))return;nr(e),r.setOpen(!1,Y(qe,e.nativeEvent)),Zt(o)&&o.focus();return}ie(e)},onPointerMove(){L.current=!0}}),[ae,ie,A,w,N,r,i,_,o]),se=t.useMemo(()=>{function e(e){y===`auto`&&ir(e.nativeEvent)&&(P.current=!_)}function t(e){P.current=y,y===`auto`&&ar(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(e){let t=r.select(`open`);L.current=!1;let n=e.key.startsWith(`Arrow`),i=fl(e.key,re(),g),a=ul(e.key,w),o=(h?i:a)||e.key===`Enter`||e.key.trim()===``;if(_&&t)return ie(e);if(!(!t&&!S&&n)){if(o){let t=ul(e.key,re());I.current=h&&t?null:e.key}if(h){i&&(nr(e),t?(F.current=Rr(c,U.current),R(e)):r.setOpen(!0,Y(Xe,e.nativeEvent,e.currentTarget)));return}a&&(G.current!=null&&(F.current=G.current),nr(e),!t&&S?r.setOpen(!0,Y(Xe,e.nativeEvent,e.currentTarget)):ie(e),t&&R(e))}},onFocus(e){r.select(`open`)&&!_&&(F.current=-1,R(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ie,U,y,c,h,R,r,S,w,re,g,G,_]),ce=t.useMemo(()=>({...ae,...se}),[ae,se]);return t.useMemo(()=>d?{reference:ce,floating:oe,item:ne,trigger:se}:{},[d,ce,oe,se,ne])}var hl=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function gl(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingId`),o=r.useState(`domReferenceElement`),s=r.useState(`floatingElement`),{role:c=`dialog`}=n,l=dt(),u=o?.id||l,d=t.useMemo(()=>$n(s)?.id||a,[s,a]),f=hl.get(c)??c,p=oo()!=null,m=t.useMemo(()=>f===`tooltip`||c===`label`?ve:{"aria-haspopup":f===`alertdialog`?`dialog`:f,"aria-expanded":`false`,...f===`listbox`&&{role:`combobox`},...f===`menu`&&p&&{role:`menuitem`},...c===`select`&&{"aria-autocomplete":`none`},...c===`combobox`&&{"aria-autocomplete":`list`}},[f,p,c]),h=t.useMemo(()=>f===`tooltip`||c===`label`?{[`aria-${c===`label`?`labelledby`:`describedby`}`]:i?d:void 0}:{...m,"aria-expanded":i?`true`:`false`,"aria-controls":i?d:void 0,...f===`menu`&&{id:u}},[f,d,i,u,c,m]),g=t.useMemo(()=>{let e={id:d,...f&&{role:f}};return f===`tooltip`||c===`label`?e:{...e,...f===`menu`&&{"aria-labelledby":u}}},[f,d,u,c]),_=t.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${d}-fui-option`}};switch(c){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[d,c]);return t.useMemo(()=>({reference:h,floating:g,item:_,trigger:m}),[h,g,m,_])}function _l(e,n){let r=`rootStore`in e?e.rootStore:e,i=r.context.dataRef,a=r.useState(`open`),{listRef:o,elementsRef:s,activeIndex:c,onMatch:l,onTypingChange:u,enabled:d=!0,resetMs:f=750,selectedIndex:p=null}=n,m=pa(),h=t.useRef(``),g=t.useRef(p??c??-1),_=t.useRef(null);x(()=>{!a&&p!==null||(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[a,p,m]),x(()=>{a&&h.current===``&&(g.current=p??c??-1)},[a,p,c]);let y=v(e=>{e?i.current.typing||(i.current.typing=e,u?.(e)):i.current.typing&&(i.current.typing=e,u?.(e))}),b=v(e=>{function t(e){let t=s?.current[e];return!t||Kr(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=o.current;if(h.current.length>0&&e.key===` `&&(nr(e),y(!0)),h.current.length>0&&h.current[0]!==` `&&n(r,h.current)===-1&&e.key!==` `&&y(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;a&&e.key!==` `&&(nr(e),y(!0));let i=h.current===``;i&&(g.current=p??c??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(f,()=>{h.current=``,g.current=_.current,y(!1)});let u=((i?p??c??-1:g.current)??0)+1,d=n(r,h.current,u);d===-1?e.key!==` `&&(h.current=``,y(!1)):(l?.(d),_.current=d)}),S=v(e=>{let t=e.relatedTarget,n=r.select(`domReferenceElement`),i=r.select(`floatingElement`),a=X(n,t),o=X(i,t);a||o||(m.clear(),h.current=``,g.current=_.current,y(!1))}),C=t.useMemo(()=>({onKeyDown:b,onBlur:S}),[b,S]),w=t.useMemo(()=>({onKeyDown:b,onBlur:S}),[b,S]);return t.useMemo(()=>d?{reference:C,floating:w}:{},[d,C,w])}var vl=.1,yl=vl*vl,bl=.5;function xl(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Sl(e,t,n,r,i,a,o,s,c,l){let u=!1;return xl(e,t,n,r,i,a)&&(u=!u),xl(e,t,i,a,o,s)&&(u=!u),xl(e,t,o,s,c,l)&&(u=!u),xl(e,t,c,l,n,r)&&(u=!u),u}function Cl(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function wl(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Tl(e={}){let{blockPointerEvents:t=!1}=e,n=new fa,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*yl;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=qn(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Xt(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&er(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=wl(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=wl(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=wl(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=wl(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Cl(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?bl/2:bl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+bl+1,o=C||T?S.bottom-bl:S.top,s=C?T?S.bottom-bl:S.top:S.bottom-bl;M=Sl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?bl/2:bl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-bl,o=C||T?S.top+bl:S.bottom,s=C?T?S.top+bl:S.bottom:S.top+bl;M=Sl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?bl/2:bl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+bl+1,o=w||E?S.right-bl:S.left,s=w?E?S.right-bl:S.left:S.right-bl;M=Sl(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?bl/2:bl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-bl,o=w||E?S.left+bl:S.right,s=w?E?S.left+bl:S.right:S.left+bl;M=Sl(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={blockPointerEvents:t},r}function El(e){let n=t.useRef(``),r=t.useCallback(t=>{t.defaultPrevented||(n.current=t.pointerType,e(t,t.pointerType))},[e]);return{onClick:t.useCallback(t=>{if(t.detail===0){e(t,`keyboard`);return}`pointerType`in t?e(t,t.pointerType):e(t,n.current),n.current=``},[e]),onPointerDown:r}}function Dl(e,n){let r=t.useRef(e),i=v(n);x(()=>{r.current!==e&&i(r.current)},[e,i]),x(()=>{r.current=e},[e])}function Ol(e){let[n,r]=t.useState(null),i=v((t,n)=>{e||r(n||(An?`touch`:``))});Dl(e,t=>{t&&!e&&r(null)});let{onClick:a,onPointerDown:o}=El(i);return t.useMemo(()=>({openMethod:n,triggerProps:{onClick:a,onPointerDown:o}}),[n,a,o])}function kl(e){let{store:n,parentContext:r,actionsRef:i}=e,a=n.useState(`open`),o=n.useState(`disablePointerDismissal`),s=n.useState(`modal`),c=n.useState(`popupElement`),{openMethod:l,triggerProps:u}=Ol(a);Rc(n);let{forceUnmount:d}=zc(a,n),f=v(e=>{let t=Y(e);return t.preventUnmountOnClose=()=>{n.set(`preventUnmountingOnClose`,!0)},t}),p=t.useCallback(()=>{n.setOpen(!1,f(nt))},[n,f]);t.useImperativeHandle(i,()=>({unmount:d,close:p}),[d,p]);let m=qc({popupStore:n,onOpenChange:n.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=t.useState(0),_=h===0,y=gl(m),b=ko(m,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!n.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let t=qn(e);if(_&&!o){let e=t;return s&&(n.context.internalBackdropRef.current||n.context.backdropRef.current)?n.context.internalBackdropRef.current===e||n.context.backdropRef.current===e||X(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});Sa(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=al([y,b]);n.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),n.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),t.useEffect(()=>(r?.onNestedDialogOpen&&a&&r.onNestedDialogOpen(h),r?.onNestedDialogClose&&!a&&r.onNestedDialogClose(),()=>{r?.onNestedDialogClose&&a&&r.onNestedDialogClose()}),[a,r,h]);let w=t.useMemo(()=>x(u),[x,u]),T=t.useMemo(()=>C(u),[C,u]),E=t.useMemo(()=>S(),[S]);n.useSyncedValues({openMethod:l,activeTriggerProps:w,inactiveTriggerProps:T,popupProps:E,floatingRootContext:m,nestedOpenDialogCount:h})}var Al=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Al.displayName=`DialogRootContext`);function jl(e){let n=t.useContext(Al);if(e===!1&&n===void 0)throw Error(process.env.NODE_ENV===`production`?I(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return n}var Ml={...Wc,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},Nl=class extends Mc{constructor(e){super(Pl(e),{popupRef:t.createRef(),backdropRef:t.createRef(),internalBackdropRef:t.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Bc,onOpenChange:void 0,onOpenChangeComplete:void 0},Ml)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function Pl(e={}){return{...Hc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function Fl(e){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,actionsRef:s,handle:c,triggerId:l,defaultTriggerId:u=null}=e,d=jl(),f=!!d,p=h(()=>c?.store??new Nl({open:i,openProp:r,activeTriggerId:u,triggerIdProp:l,modal:!0,disablePointerDismissal:!0,nested:f,role:`alertdialog`})).current;p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,l),p.useSyncedValue(`nested`,f),p.useContextCallback(`onOpenChange`,a),p.useContextCallback(`onOpenChangeComplete`,o);let m=p.useState(`payload`);kl({store:p,actionsRef:s,parentContext:d?.store.context,onOpenChange:a,triggerIdProp:l});let g=t.useMemo(()=>({store:p}),[p]);return(0,O.jsx)(Al.Provider,{value:g,children:typeof n==`function`?n({payload:m}):n})}var Il=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=xt.startingStyle]=`startingStyle`,e[e.endingStyle=xt.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Ll=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Rl={[Ll.popupOpen]:``},zl={[Ll.popupOpen]:``,[Ll.pressed]:``},Bl={[Il.open]:``},Vl={[Il.closed]:``},Hl={[Il.anchorHidden]:``},Ul={open(e){return e?Rl:null}},Wl={open(e){return e?zl:null}},Gl={open(e){return e?Bl:Vl},anchorHidden(e){return e?Hl:null}},Kl={...Gl,...wt},ql=t.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=jl(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`);return J(`div`,e,{state:{open:s,transitionStatus:o.useState(`transitionStatus`)},ref:[o.context.backdropRef,t],stateAttributesMapping:Kl,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})});process.env.NODE_ENV!==`production`&&(ql.displayName=`DialogBackdrop`);var Jl=t.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=jl(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Y(ze,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=Sn({disabled:i,native:a});return J(`button`,e,{state:{disabled:i},ref:[t,d],props:[{onClick:l},o,u]})});process.env.NODE_ENV!==`production`&&(Jl.displayName=`DialogClose`);var Yl=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=jl(),s=ft(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),J(`p`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(Yl.displayName=`DialogDescription`);var Xl=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Zl=function(e){return e[e.open=Il.open]=`open`,e[e.closed=Il.closed]=`closed`,e[e.startingStyle=Il.startingStyle]=`startingStyle`,e[e.endingStyle=Il.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Ql=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ql.displayName=`DialogPortalContext`);function $l(){let e=t.useContext(Ql);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(26):`Base UI: <Dialog.Portal> is missing.`);return e}var eu={...Gl,...wt,nestedDialogOpen(e){return e?{[Zl.nestedDialogOpen]:``}:null}},tu=t.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=jl(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);$l(),aa({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=J(`div`,e,{state:{open:g,nested:m,transitionStatus:y,nestedDialogOpen:h>0},props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){Gi.has(e.key)&&e.stopPropagation()},style:{[Xl.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:eu});return(0,O.jsx)(xo,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:C})});process.env.NODE_ENV!==`production`&&(tu.displayName=`DialogPopup`);function nu(e){return G(19)?e:e?`true`:void 0}var ru=t.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
16
+ 0% 0%,
17
+ 100% 0%,
18
+ 100% 100%,
19
+ 0% 100%,
20
+ 0% 0%,
21
+ ${e.left}px ${e.top}px,
22
+ ${e.left}px ${e.bottom}px,
23
+ ${e.right}px ${e.bottom}px,
24
+ ${e.right}px ${e.top}px,
25
+ ${e.left}px ${e.top}px
26
+ )`}return(0,O.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});process.env.NODE_ENV!==`production`&&(ru.displayName=`InternalBackdrop`);var iu=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=jl(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,O.jsx)(Ql.Provider,{value:n,children:(0,O.jsxs)(to,{ref:t,...r,children:[a&&o===!0&&(0,O.jsx)(ru,{ref:i.context.internalBackdropRef,inert:nu(!s)}),e.children]})}):null});process.env.NODE_ENV!==`production`&&(iu.displayName=`DialogPortal`);var au=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=jl(),s=ft(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),J(`h2`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(au.displayName=`DialogTitle`);var ou=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=jl(!0),f=l?.store??d?.store;if(!f)throw Error(process.env.NODE_ENV===`production`?I(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let p=ft(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=t.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=Lc(p,g,f,{payload:c}),{getButtonProps:y,buttonRef:b}=Sn({disabled:a,native:o}),x=al([So(m,{enabled:m!=null})]),S={disabled:a,open:h},C=f.useState(`triggerProps`,v);return J(`button`,e,{state:S,ref:[b,n,_,g],props:[x.getReferenceProps(),C,{[be]:``,id:p},u,y],stateAttributesMapping:Ul})});process.env.NODE_ENV!==`production`&&(ou.displayName=`DialogTrigger`);var su=Fl,cu=ou,lu=iu,uu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(ql,{ref:n,className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm transition-all duration-300 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 ${e||``}`,...t}));uu.displayName=`AlertDialogOverlay`;var du=t.forwardRef(({className:e,...t},n)=>(0,O.jsxs)(iu,{children:[(0,O.jsx)(uu,{}),(0,O.jsx)(tu,{ref:n,className:`fixed left-1/2 top-1/2 z-50 grid w-full max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-2xl transition-all duration-300 data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 sm:rounded-2xl ${e||``}`,...t})]}));du.displayName=`AlertDialogContent`;var fu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(au,{ref:n,className:`text-lg font-semibold text-neutral-900 dark:text-neutral-50 ${e||``}`,...t}));fu.displayName=`AlertDialogTitle`;var pu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Yl,{ref:n,className:`text-sm text-neutral-500 dark:text-neutral-400 ${e||``}`,...t}));pu.displayName=`AlertDialogDescription`;var mu=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(mu.displayName=`AvatarRootContext`);function hu(){let e=t.useContext(mu);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}var gu={imageLoadingStatus:()=>null},_u=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,[o,s]=t.useState(`idle`),c={imageLoadingStatus:o},l=t.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=J(`span`,e,{state:c,ref:n,props:a,stateAttributesMapping:gu});return(0,O.jsx)(mu.Provider,{value:l,children:u})});process.env.NODE_ENV!==`production`&&(_u.displayName=`AvatarRoot`);function vu(e,{referrerPolicy:n,crossOrigin:r}){let[i,a]=t.useState(`idle`);return x(()=>{if(!e)return a(`error`),ge;let t=!0,i=new window.Image,o=e=>()=>{t&&a(e)};return a(`loading`),i.onload=o(`loaded`),i.onerror=o(`error`),n&&(i.referrerPolicy=n),i.crossOrigin=r??null,i.src=e,()=>{t=!1}},[e,r,n]),i}var yu={...gu,...wt},bu=t.forwardRef(function(e,n){let{className:r,render:i,onLoadingStatusChange:a,referrerPolicy:o,crossOrigin:s,...c}=e,l=hu(),u=vu(e.src,{referrerPolicy:o,crossOrigin:s}),d=u===`loaded`,{mounted:f,transitionStatus:p,setMounted:m}=Et(d),h=t.useRef(null),g=v(e=>{a?.(e),l.setImageLoadingStatus(e)});x(()=>{u!==`idle`&&g(u)},[u,g]);let _={imageLoadingStatus:u,transitionStatus:p};aa({open:d,ref:h,onComplete(){d||m(!1)}});let y=J(`img`,e,{state:_,ref:[n,h],props:c,stateAttributesMapping:yu,enabled:f});return f?y:null});process.env.NODE_ENV!==`production`&&(bu.displayName=`AvatarImage`);var xu=t.forwardRef(function(e,n){let{className:r,render:i,delay:a,...o}=e,{imageLoadingStatus:s}=hu(),[c,l]=t.useState(a===void 0),u=pa();return t.useEffect(()=>(a!==void 0&&u.start(a,()=>l(!0)),u.clear),[u,a]),J(`span`,e,{state:{imageLoadingStatus:s},ref:n,props:o,stateAttributesMapping:gu,enabled:s!==`loaded`&&c})});process.env.NODE_ENV!==`production`&&(xu.displayName=`AvatarFallback`);var Su=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(_u,{ref:n,className:`relative flex size-10 shrink-0 overflow-hidden rounded-full bg-neutral-100 shadow-sm dark:bg-neutral-800 ${e||``}`,...t}));Su.displayName=`Avatar`;var Cu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(bu,{ref:n,className:`aspect-square h-full w-full object-cover transition-opacity duration-300 data-[status=loading]:opacity-0 ${e||``}`,...t}));Cu.displayName=`AvatarImage`;var wu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(xu,{ref:n,className:`flex h-full w-full items-center justify-center rounded-full bg-neutral-100 text-sm font-medium text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50 ${e||``}`,...t}));wu.displayName=`AvatarFallback`;var Tu=t.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,...s}=e,{getButtonProps:c,buttonRef:l}=Sn({disabled:i,focusableWhenDisabled:a,native:o});return J(`button`,e,{state:{disabled:i},ref:[t,l],props:[s,c]})});process.env.NODE_ENV!==`production`&&(Tu.displayName=`Button`);var Eu=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Tu,{ref:n,className:`inline-flex items-center justify-center rounded-xl bg-neutral-900 px-4 py-2.5 text-sm font-semibold text-white shadow-md transition-all duration-200 hover:bg-neutral-800 hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-2 active:scale-95 disabled:pointer-events-none disabled:opacity-50 dark:bg-white dark:text-neutral-900 dark:hover:bg-neutral-100 dark:focus:ring-white dark:focus:ring-offset-neutral-900 ${e||``}`,...t}));Eu.displayName=`Button`;var Du=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Ou=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),ku={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Au={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ju={disabled:!1,...Au},Mu={valid(e){return e===null?null:e?{[Ou.valid]:``}:{[Ou.invalid]:``}}};function Nu(e){return t.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[Du.checked]:``}:{[Du.unchecked]:``}},...Mu}),[e.indeterminate])}var Pu=t.createContext({invalid:void 0,name:void 0,validityData:{state:ku,errors:[],error:``,value:``,initialValue:null},setValidityData:ge,disabled:void 0,touched:Au.touched,setTouched:ge,dirty:Au.dirty,setDirty:ge,filled:Au.filled,setFilled:ge,focused:Au.focused,setFocused:ge,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:ju,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=ve)=>e,getInputValidationProps:(e=ve)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!==`production`&&(Pu.displayName=`FieldRootContext`);function Fu(e=!0){let n=t.useContext(Pu);if(n.setValidityData===ge&&!e)throw Error(process.env.NODE_ENV===`production`?I(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return n}var Iu=t.createContext({disabled:!1});process.env.NODE_ENV!==`production`&&(Iu.displayName=`FieldItemContext`);function Lu(){return t.useContext(Iu)}function Ru(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var zu=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ge,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(zu.displayName=`FormContext`);function Bu(){return t.useContext(zu)}function Vu(e){let{enabled:t=!0,value:r,id:i,name:a,controlRef:o,commit:s}=e,{formRef:c}=Bu(),{invalid:l,markedDirtyRef:u,validityData:d,setValidityData:f}=Fu(),p=v(e.getValue);x(()=>{if(!t)return;let e=r;e===void 0&&(e=p()),d.initialValue===null&&e!==null&&f(t=>({...t,initialValue:e}))},[t,f,r,d.initialValue,p]),x(()=>{!t||!i||c.current.fields.set(i,{getValue:p,name:a,controlRef:o,validityData:Ru(d,l),validate(e=!0){let t=r;t===void 0&&(t=p()),u.current=!0,e?n.flushSync(()=>s(t)):s(t)}})},[s,o,t,c,p,i,l,u,a,d,r]),x(()=>{let e=c.current.fields;return()=>{i&&e.delete(i)}},[c,i])}var Hu=t.createContext({controlId:void 0,registerControlId:ge,labelId:void 0,setLabelId:ge,messageIds:[],setMessageIds:ge,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(Hu.displayName=`LabelableContext`);function Uu(){return t.useContext(Hu)}function Wu(e,n,r,i=!0,a){let[o,s]=t.useState(),c=ft(a?`${a}-label`:void 0),l=e??n??o;return x(()=>{let t=e||n||!i?void 0:Gu(r.current,c);o!==t&&s(t)}),l}function Gu(e,t){let n=Ku(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Ku(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var qu=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(qu.displayName=`CheckboxGroupContext`);function Ju(e=!0){let n=t.useContext(qu);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(3):`Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.`);return n}var Yu=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Yu.displayName=`CheckboxRootContext`);function Xu(){let e=t.useContext(Yu);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(14):`Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.`);return e}var Zu=`data-parent`,Qu=t.forwardRef(function(e,n){let{checked:r,className:i,defaultChecked:a=!1,"aria-labelledby":o,disabled:s=!1,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:m=!1,readOnly:g=!1,render:_,required:y=!1,uncheckedValue:b,value:S,nativeButton:C=!1,...w}=e,{clearErrors:T}=Bu(),{disabled:E,name:D,setDirty:k,setFilled:A,setFocused:j,setTouched:M,state:N,validationMode:P,validityData:F,shouldValidateOnChange:I,validation:L}=Fu(),R=Lu(),{labelId:B,controlId:ee,registerControlId:V,getDescriptionProps:H}=Uu(),U=Ju(),W=U?.parent,G=W&&U.allValues,K=E||R.disabled||U?.disabled||s,te=D??d,q=S??te,ne=ft(),re=ft(),ie=ee;G?ie=m?re:`${W.id}-${q}`:c&&(ie=c);let oe={};G&&(m?oe=U.parent.getParentProps():q&&(oe=U.parent.getChildProps(q)));let se=v(f),{checked:ce=r,indeterminate:le=l,onCheckedChange:ue,...de}=oe,fe=U?.value,pe=U?.setValue,me=U?.defaultValue,he=t.useRef(null),_e=h(()=>Symbol(`checkbox-control`)),ye=t.useRef(!1),{getButtonProps:be,buttonRef:xe}=Sn({disabled:K,native:C}),Se=U?.validation??L,[Ce,we]=p({controlled:q&&fe&&!m?fe.includes(q):ce,default:q&&me&&!m?me.includes(q):a,name:`Checkbox`,state:`checked`});x(()=>{V!==ge&&(ye.current=!0,V(_e.current,ie))},[ie,U,V,m,_e]),t.useEffect(()=>{let e=_e.current;return()=>{!ye.current||V===ge||(ye.current=!1,V(e,void 0))}},[V,_e]),Vu({enabled:!U,id:ne,commit:Se.commit,value:Ce,controlRef:he,name:te,getValue:()=>Ce});let Te=t.useRef(null),Ee=z(u,Te,Se.inputRef),De=Wu(o,B,Te,!C,ie??void 0);x(()=>{Te.current&&(Te.current.indeterminate=le,Ce&&A(!0))},[Ce,le,A]),Dl(Ce,()=>{U&&!m||(T(te),A(Ce),k(Ce!==F.initialValue),I()?Se.commit(Ce):Se.commit(Ce,!0))});let Oe=ae({checked:Ce,disabled:K,name:m?void 0:te,id:C?void 0:ie??void 0,required:y,ref:Ee,style:te?Pa:Na,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Y(Ne,e.nativeEvent);ue?.(t,n),se(t,n),!n.isCanceled&&(we(t),q&&fe&&pe&&!m&&pe(t?[...fe,q]:fe.filter(e=>e!==q),n))},onFocus(){he.current?.focus()}},S===void 0?ve:{value:(U?Ce&&S:S)||``},H,U?Se.getValidationProps:Se.getInputValidationProps),ke=G?!!ce:Ce,Ae=G&&le||l;t.useEffect(()=>{if(!W||!q)return;let e=W.disabledStatesRef.current;return e.set(q,K),()=>{e.delete(q)}},[W,K,q]);let je=t.useMemo(()=>({...N,checked:ke,disabled:K,readOnly:g,required:y,indeterminate:Ae}),[N,ke,K,g,y,Ae]),Me=Nu(je),Pe=J(`span`,e,{state:je,ref:[xe,he,n,U?.registerControlRef],props:[{id:C?ie??void 0:ne,role:`checkbox`,"aria-checked":le?`mixed`:Ce,"aria-readonly":g||void 0,"aria-required":y||void 0,"aria-labelledby":De,[Zu]:m?``:void 0,onFocus(){j(!0)},onBlur(){let e=Te.current;e&&(M(!0),j(!1),P===`onBlur`&&Se.commit(U?fe:e.checked))},onClick(e){g||K||(e.preventDefault(),Te.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},H,Se.getValidationProps,w,de,be],stateAttributesMapping:Me});return(0,O.jsxs)(Yu.Provider,{value:je,children:[Pe,!Ce&&!U&&te&&!m&&b!==void 0&&(0,O.jsx)(`input`,{type:`hidden`,name:te,value:b}),(0,O.jsx)(`input`,{...Oe})]})});process.env.NODE_ENV!==`production`&&(Qu.displayName=`CheckboxRoot`);var $u=t.forwardRef(function(e,n){let{render:r,className:i,keepMounted:a=!1,...o}=e,s=Xu(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Et(c),f=t.useRef(null),p={...s,transitionStatus:u};aa({open:c,ref:f,onComplete(){c||d(!1)}});let m=Nu(s),h=t.useMemo(()=>({...m,...wt,...Mu}),[m]),g=a||l,_=J(`span`,e,{ref:[n,f],state:p,stateAttributesMapping:h,props:o});return g?_:null});process.env.NODE_ENV!==`production`&&($u.displayName=`CheckboxIndicator`);var ed=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Qu,{ref:n,className:`group flex size-5 shrink-0 items-center justify-center rounded-[6px] border border-neutral-300 bg-white shadow-sm transition-all duration-200 focus:outline-none focus:ring-4 focus:ring-neutral-900/10 data-[checked]:border-neutral-900 data-[checked]:bg-neutral-900 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:border-neutral-700 dark:bg-neutral-950 dark:data-[checked]:border-white dark:data-[checked]:bg-white ${e||``}`,...t,children:(0,O.jsx)($u,{className:`text-white dark:text-neutral-900 transition-transform duration-200 data-[starting-style]:scale-50 data-[starting-style]:opacity-0`,children:(0,O.jsx)(r.Check,{className:`size-3.5`,strokeWidth:3})})}));ed.displayName=`Checkbox`;var td={...zt,...wt},nd=t.forwardRef(function(e,n){let{render:r,className:i,defaultOpen:a=!1,disabled:o=!1,onOpenChange:s,open:c,...l}=e,u=v(s),d=Dt({open:c,defaultOpen:a,onOpenChange:u,disabled:o}),f=t.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=t.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=J(`div`,e,{state:f,ref:n,props:l,stateAttributesMapping:td});return(0,O.jsx)(Ot.Provider,{value:p,children:m})});process.env.NODE_ENV!==`production`&&(nd.displayName=`CollapsibleRoot`);var rd={...Rt,...wt},id=t.forwardRef(function(e,n){let{panelId:r,open:i,handleTrigger:a,state:o,disabled:s}=kt(),{className:c,disabled:l=s,id:u,render:d,nativeButton:f=!0,...p}=e,{getButtonProps:m,buttonRef:h}=Sn({disabled:l,focusableWhenDisabled:!0,native:f}),g=t.useMemo(()=>({"aria-controls":i?r:void 0,"aria-expanded":i,onClick:a}),[r,i,a]);return J(`button`,e,{state:o,ref:[n,h],props:[g,p,m],stateAttributesMapping:rd})});process.env.NODE_ENV!==`production`&&(id.displayName=`CollapsibleTrigger`);var ad=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),od=t.forwardRef(function(e,n){let{className:r,hiddenUntilFound:i,keepMounted:a,render:o,id:s,...c}=e;process.env.NODE_ENV!==`production`&&x(()=>{i&&a===!1&&C("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[i,a]);let{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:S,setPanelIdState:w,setOpen:T,setVisible:E,state:D,transitionDimensionRef:O,visible:k,width:A,transitionStatus:j}=kt(),M=i??!1,N=a??!1;x(()=>{if(s)return w(s),()=>{w(void 0)}},[s,w]),x(()=>{y(M)},[y,M]),x(()=>{b(N)},[b,N]);let{props:P}=ra({abortControllerRef:l,animationTypeRef:u,externalRef:n,height:d,hiddenUntilFound:M,id:h,keepMounted:N,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:S,setOpen:T,setVisible:E,transitionDimensionRef:O,visible:k,width:A});aa({open:m&&j===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let F=J(`div`,e,{state:t.useMemo(()=>({...D,transitionStatus:j}),[D,j]),ref:[n,g],props:[P,{style:{[ad.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[ad.collapsiblePanelWidth]:A===void 0?`auto`:`${A}px`}},c],stateAttributesMapping:td});return N||M||!N&&f?F:null});process.env.NODE_ENV!==`production`&&(od.displayName=`CollapsiblePanel`);var sd=nd,cd=id,ld=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(od,{ref:n,className:`overflow-hidden text-sm transition-all duration-300 ease-in-out data-[starting-style]:grid-rows-[0fr] data-[starting-style]:opacity-0 grid grid-rows-[1fr] ${e||``}`,...t,children:(0,O.jsx)(`div`,{className:`min-h-0`,children:t.children})}));ld.displayName=`CollapsibleContent`;function ud(e){let n=t.useRef(!0);n.current&&(n.current=!1,e())}var dd=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(dd.displayName=`ComboboxRootContext`);var fd=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(fd.displayName=`ComboboxFloatingContext`);var pd=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(pd.displayName=`ComboboxDerivedItemsContext`);var md=t.createContext(``);process.env.NODE_ENV!==`production`&&(md.displayName=`ComboboxInputValueContext`);function hd(){let e=t.useContext(dd);if(!e)throw Error(process.env.NODE_ENV===`production`?I(22):`Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function gd(){let e=t.useContext(fd);if(!e)throw Error(process.env.NODE_ENV===`production`?I(23):`Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function _d(){let e=t.useContext(pd);if(!e)throw Error(process.env.NODE_ENV===`production`?I(24):`Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.`);return e}function vd(){return t.useContext(md)}var yd=(e,t)=>Object.is(e,t);function bd(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function xd(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:bd(t,e,n))}function Sd(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:bd(e,t,n))}function Cd(e,t,n){return e.filter(e=>!bd(t,e,n))}function wd(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Td(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Ed(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Td(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Dd(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return wd(e)}function Od(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?wd(e.value):wd(e)}function kd(e,t,n){function r(){return Dd(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Td(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Ad(e,n,r){return e.reduce((e,i,a)=>(a>0&&e.push(`, `),e.push((0,O.jsx)(t.Fragment,{children:kd(i,n,r)},a)),e),[])}var $={id:Z(e=>e.id),labelId:Z(e=>e.labelId),query:Z(e=>e.query),items:Z(e=>e.items),selectedValue:Z(e=>e.selectedValue),hasSelectionChips:Z(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:Z(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:Z((e,t)=>t?Ed(e.items):!1),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMounted:Z(e=>e.forceMounted),inline:Z(e=>e.inline),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>bd(t,e,n)):bd(t,r,n)}),transitionStatus:Z(e=>e.transitionStatus),popupProps:Z(e=>e.popupProps),inputProps:Z(e=>e.inputProps),triggerProps:Z(e=>e.triggerProps),getItemProps:Z(e=>e.getItemProps),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),triggerElement:Z(e=>e.triggerElement),inputElement:Z(e=>e.inputElement),inputGroupElement:Z(e=>e.inputGroupElement),popupSide:Z(e=>e.popupSide),openMethod:Z(e=>e.openMethod),inputInsidePopup:Z(e=>e.inputInsidePopup),selectionMode:Z(e=>e.selectionMode),listRef:Z(e=>e.listRef),labelsRef:Z(e=>e.labelsRef),popupRef:Z(e=>e.popupRef),emptyRef:Z(e=>e.emptyRef),inputRef:Z(e=>e.inputRef),keyboardActiveRef:Z(e=>e.keyboardActiveRef),chipsContainerRef:Z(e=>e.chipsContainerRef),clearRef:Z(e=>e.clearRef),valuesRef:Z(e=>e.valuesRef),allValuesRef:Z(e=>e.allValuesRef),name:Z(e=>e.name),disabled:Z(e=>e.disabled),readOnly:Z(e=>e.readOnly),required:Z(e=>e.required),grid:Z(e=>e.grid),isGrouped:Z(e=>e.isGrouped),virtualized:Z(e=>e.virtualized),onOpenChangeComplete:Z(e=>e.onOpenChangeComplete),openOnInputClick:Z(e=>e.openOnInputClick),itemToStringLabel:Z(e=>e.itemToStringLabel),isItemEqualToValue:Z(e=>e.isItemEqualToValue),modal:Z(e=>e.modal),autoHighlight:Z(e=>e.autoHighlight),submitOnItemClick:Z(e=>e.submitOnItemClick)};function jd(e={}){let{id:n,implicit:r=!1,controlRef:i}=e,{controlId:a,registerControlId:o}=Uu(),s=ft(n),c=r?a:void 0,l=h(()=>Symbol(`labelable-control`)),u=t.useRef(!1),d=t.useRef(n!=null),f=v(()=>{!u.current||o===ge||(u.current=!1,o(l.current,void 0))});return x(()=>{if(o===ge)return;let e;if(r){let t=i?.current;e=Xt(t)&&t.closest(`label`)!=null?n??null:c??s}else if(n!=null)d.current=!0,e=n;else if(d.current)e=s;else{f();return}if(e===void 0){f();return}u.current=!0,o(l.current,e)},[n,i,c,o,r,s,l,f]),t.useEffect(()=>f,[f]),a??s}function Md(e,t){return(n,r)=>{if(n==null)return!1;let i=Dd(n,t);return e.contains(i,r)}}function Nd(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let a=Dd(r,t),o=n==null?``:Dd(n,t);return o&&e.contains(o,i)&&o.length===i.length?!0:e.contains(a,i)}}var Pd=new Map;function Fd(e){return Array.isArray(e)?e.map(e=>Fd(e)).join(`,`):e==null?``:String(e)}function Id(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${Fd(e.locale)}|${JSON.stringify(t)}`,r=Pd.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=Dd(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=Dd(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=Dd(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return Pd.set(n,a),a}var Ld=Id,Rd=Symbol(`none`),zd={value:Rd,index:-1};function Bd(e){let{id:n,onOpenChangeComplete:r,defaultSelectedValue:i=null,selectedValue:a,onSelectedValueChange:o,defaultInputValue:s,inputValue:c,selectionMode:l=`none`,onItemHighlighted:u,name:d,disabled:f=!1,readOnly:m=!1,required:g=!1,inputRef:_,grid:y=!1,items:b,filteredItems:S,filter:C,openOnInputClick:w=!0,autoHighlight:T=!1,keepHighlight:E=!1,highlightItemOnHover:D=!0,loopFocus:k=!0,itemToStringLabel:A,itemToStringValue:j,isItemEqualToValue:M=yd,virtualized:N=!1,inline:P=!1,fillInputOnItemPress:F=!0,modal:I=!1,limit:L=-1,autoComplete:R=`list`,formAutoComplete:B,locale:ee,submitOnItemClick:V=!1}=e,{clearErrors:H}=Bu(),{setDirty:U,validityData:W,shouldValidateOnChange:G,setFilled:K,name:te,disabled:q,setTouched:ne,setFocused:re,validationMode:ie,validation:ae}=Fu(),oe=jd({id:n}),se=Ld({locale:ee}),[ce,le]=t.useState(!1),[ue,de]=t.useState(null),fe=t.useRef([]),pe=t.useRef([]),me=t.useRef(null),he=t.useRef(null),ye=t.useRef(null),be=t.useRef(null),xe=t.useRef(null),Se=t.useRef(!0),Ce=t.useRef(!1),we=t.useRef(null),Te=t.useRef(null),Ee=t.useRef(null),De=t.useRef(zd),J=t.useRef(null),Oe=t.useRef([]),ke=t.useRef([]),Ae=q||f,je=te??d,Me=l===`multiple`,Pe=l===`single`,Fe=c!==void 0||s!==void 0,Ie=b!==void 0,Le=S!==void 0,ze;ze=T===`always`?`always`:T?`input-change`:!1;let[Be,Ve]=p({controlled:a,default:Me?i??_e:i,name:`Combobox`,state:`selectedValue`}),He=t.useMemo(()=>C===null?()=>!0:C===void 0?Pe&&!ce?Nd(se,A,Be):Md(se,A):C,[C,Pe,Be,ce,se,A]),We=h(()=>Fe?s??``:Pe?Dd(Be,A):``).current,[Ge,qe]=p({controlled:c,default:We,name:`Combobox`,state:`inputValue`}),[Je,Ye]=p({controlled:e.open,default:e.defaultOpen,name:`Combobox`,state:`open`}),Xe=Td(b),Ze=ue??(Ge===``?``:String(Ge).trim()),Qe=Pe?Dd(Be,A):``,$e=Pe&&!ce&&Ze!==``&&Qe!==``&&Qe.length===Ze.length&&se.contains(Qe,Ze),et=$e?``:Ze,tt=Ie&&Le&&$e,nt=t.useMemo(()=>b?Xe?b.flatMap(e=>e.items):b:_e,[b,Xe]),rt=t.useMemo(()=>{if(S&&!tt)return S;if(!b)return _e;if(Xe){let e=b,t=[],n=0;for(let r of e){if(L>-1&&n>=L)break;let e=et===``?r.items:r.items.filter(e=>He(e,et,A));if(e.length===0)continue;let i=L>-1?L-n:1/0,a=e.slice(0,i);if(a.length>0){let e={...r,items:a};t.push(e),n+=a.length}}return t}if(et===``)return L>-1?nt.slice(0,L):nt;let e=[];for(let t of nt){if(L>-1&&e.length>=L)break;He(t,et,A)&&e.push(t)}return e},[S,tt,b,Xe,et,L,He,A,nt]),at=t.useMemo(()=>Xe?rt.flatMap(e=>e.items):rt,[rt,Xe]),ot=h(()=>new jc({id:oe,labelId:void 0,selectedValue:Be,open:Je,filter:He,query:Ze,items:b,selectionMode:l,listRef:fe,labelsRef:pe,popupRef:me,emptyRef:xe,inputRef:he,startDismissRef:ye,endDismissRef:be,keyboardActiveRef:Se,chipsContainerRef:we,clearRef:Te,valuesRef:Oe,allValuesRef:ke,selectionEventRef:Ee,name:je,disabled:Ae,readOnly:m,required:g,grid:y,isGrouped:Xe,virtualized:N,openOnInputClick:w,itemToStringLabel:A,isItemEqualToValue:M,modal:I,autoHighlight:ze,submitOnItemClick:V,hasInputValue:Fe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:P,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:r||ge,setOpen:ge,setInputValue:ge,setSelectedValue:ge,setIndices:ge,onItemHighlighted:ge,handleSelection:ge,getItemProps:()=>ve,forceMount:ge,requestSubmit:ge})).current,st=l===`none`?Ge:Be,ct=t.useMemo(()=>l===`none`?st:Array.isArray(Be)?Be.map(e=>Od(e,j)):Od(Be,j),[st,j,l,Be]),lt=v(u),ut=v(r),dt=Q(ot,$.activeIndex),ft=Q(ot,$.selectedIndex),pt=Q(ot,$.positionerElement),mt=Q(ot,$.listElement),ht=Q(ot,$.triggerElement),gt=Q(ot,$.inputElement),_t=Q(ot,$.inputGroupElement),vt=Q(ot,$.inline),yt=Q(ot,$.inputInsidePopup),bt=Aa(ht),{mounted:xt,setMounted:St,transitionStatus:Ct}=Et(Je),{openMethod:wt,triggerProps:Tt}=Ol(Je);Vu({id:oe,name:je,commit:ae.commit,value:st,controlRef:yt?bt:he,getValue:()=>ct});let Dt=v(()=>{b?pe.current=at.map(e=>Dd(e,A)):ot.set(`forceMounted`,!0)}),Ot=t.useRef(Be);x(()=>{Be!==Ot.current&&Dt()},[Dt,Be]);let kt=v(e=>{ot.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0)if(e.activeIndex===null)De.current!==zd&&(De.current=zd,lt(void 0,it(t,void 0,{index:-1})));else{let n=Oe.current[e.activeIndex];De.current={value:n,index:e.activeIndex},lt(n,it(t,void 0,{index:e.activeIndex}))}}),At=v((t,n)=>{if(Ce.current=n.reason===Ue,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&le(!0),J.current={hasQuery:e},e&&ze&&ot.state.activeIndex==null&&ot.set(`activeIndex`,0)}}qe(t)}}),jt=v((t,n)=>{if(Je!==t&&(n.reason===`escape-key`&&Ie&&at.length===0&&!ot.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(!t&&ce&&(Pe?(vt||de(Ze),Ze===``&&le(!1)):Me&&(vt||yt?kt({activeIndex:null}):de(Ze),At(``,Y(Ue,n.event)))),Ye(t),!t&&yt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ne(!0),re(!1),ie===`onBlur`)))){let e=l===`none`?Ge:Be;ae.commit(e)}}),Mt=v((e,t)=>{o?.(e,t),!t.isCanceled&&(Ve(e),(l===`none`&&me.current&&F||Pe&&!ot.state.inputInsidePopup)&&At(Dd(e,A),Y(t.reason,t.event)),Pe&&e!=null&&t.reason!==`input-change`&&ce&&!vt&&de(Ze))}),Nt=v((e,t)=>{let n=t;if(n===void 0){if(dt===null)return;n=Oe.current[dt]}let r=qn(e),i=Ee.current??e;Ee.current=null;let a=Y(Re,i),o=r?.closest(`a`)?.getAttribute(`href`);if(o){o.startsWith(`#`)&&jt(!1,a);return}if(Me){let e=Array.isArray(Be)?Be:[];if(Mt(xd(e,n,ot.state.isItemEqualToValue)?Cd(e,n,ot.state.isItemEqualToValue):[...e,n],a),!(he.current&&he.current.value.trim()!==``))return;ot.state.inputInsidePopup?At(``,Y(Ue,a.event)):jt(!1,a)}else Mt(n,a),jt(!1,a)}),Pt=v(()=>{if(!ot.state.submitOnItemClick)return;let e=ot.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Ft=v(()=>{if(St(!1),ut?.(!1),le(!1),de(null),kt(l===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Me&&he.current&&he.current.value!==``&&!Ce.current&&At(``,Y(Ue)),Pe)if(ot.state.inputInsidePopup)he.current&&he.current.value!==``&&At(``,Y(Ue));else{let e=Dd(Be,A);he.current&&he.current.value!==e&&At(e,Y(e===``?Ue:Ne))}}),It=t.useMemo(()=>vt&&pt?{current:pt.closest(`[role="dialog"]`)}:me,[vt,pt]);aa({enabled:!e.actionsRef,open:Je,ref:It,onComplete(){Je||Ft()}}),t.useImperativeHandle(e.actionsRef,()=>({unmount:Ft}),[Ft]),x(function(){if(Je||l===`none`)return;let e=b?nt:ke.current;if(Me){let t=Array.isArray(Be)?Be:[],n=t[t.length-1],r=Sd(e,n,M);kt({selectedIndex:r===-1?null:r})}else{let t=Sd(e,Be,M);kt({selectedIndex:t===-1?null:t})}},[Je,Be,b,l,nt,Me,M,kt]),x(()=>{b&&(Oe.current=at,fe.current.length=at.length)},[b,at]),x(()=>{let e=J.current;if(e&&(e.hasQuery?ze&&ot.set(`activeIndex`,0):ze===`always`&&ot.set(`activeIndex`,0),J.current=null),!Je&&!vt)return;let t=Ie||Le?at:Oe.current,n=ot.state.activeIndex;if(n==null){if(ze===`always`&&t.length>0){ot.set(`activeIndex`,0);return}De.current!==zd&&(De.current=zd,ot.state.onItemHighlighted(void 0,it(Ne,void 0,{index:-1})));return}if(n>=t.length){De.current!==zd&&(De.current=zd,ot.state.onItemHighlighted(void 0,it(Ne,void 0,{index:-1}))),ot.set(`activeIndex`,null);return}let r=t[n],i=De.current.value,a=i!==Rd&&bd(r,i,ot.state.isItemEqualToValue);(De.current.index!==n||!a)&&(De.current={value:r,index:n},ot.state.onItemHighlighted(r,it(Ne,void 0,{index:n})))},[dt,ze,Le,Ie,at,vt,Je,ot]),x(()=>{if(l===`none`){K(String(Ge)!==``);return}K(Me?Array.isArray(Be)&&Be.length>0:Be!=null)},[K,l,Ge,Be,Me]),t.useEffect(()=>{Ie&&ze&&at.length===0&&kt({activeIndex:null})},[Ie,ze,at.length,kt]),Dl(Ze,()=>{!Je||Ze===``||Ze===String(We)||le(!0)}),Dl(Be,()=>{if(l!==`none`&&(H(je),U(Be!==W.initialValue),G()?ae.commit(Be):ae.commit(Be,!0),Pe&&!Fe&&!yt)){let e=Dd(Be,A);Ge!==e&&At(e,Y(Ne))}}),Dl(Ge,()=>{l===`none`&&(H(je),U(Ge!==W.initialValue),G()?ae.commit(Ge):ae.commit(Ge,!0))}),Dl(b,()=>{if(!Pe||Fe||yt||ce)return;let e=Dd(Be,A);Ge!==e&&At(e,Y(Ne))});let Lt=Gc({open:vt?!0:Je,onOpenChange:jt,elements:{reference:yt?ht:gt,floating:pt}}),Rt,zt;vt||(Rt=y?`grid`:`listbox`,zt=Je?`true`:`false`);let{getReferenceProps:Bt,getFloatingProps:Vt,getItemProps:Ht}=al([t.useMemo(()=>{let e=gt?.tagName===`INPUT`,t=gt==null||e,n=t||Je,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=zt,r[`aria-haspopup`]=Rt,r[`aria-controls`]=Je?mt?.id:void 0,r[`aria-autocomplete`]=R),{reference:r,floating:{role:`presentation`}}},[gt,Je,zt,Rt,mt?.id,R]),So(Lt,{enabled:!m&&!Ae&&w,event:`mousedown-only`,toggle:!1,touchOpenDelay:yt?0:50,reason:Ke}),ko(Lt,{enabled:!m&&!Ae&&!vt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:vt?!0:void 0,outsidePress(e){let t=qn(e);return!X(ht,t)&&!X(Te.current,t)&&!X(we.current,t)&&!X(_t,t)}}),ml(Lt,{enabled:!m&&!Ae,id:oe,listRef:fe,activeIndex:dt,selectedIndex:ft,virtual:!0,loopFocus:k,allowEscape:k&&!ze,focusItemOnOpen:ce||l===`none`&&!ze?!1:`auto`,focusItemOnHover:D,resetOnPointerLeave:!E,cols:y?2:1,orientation:y?`horizontal`:void 0,disabledIndices:_e,onNavigate(e,t){!t&&!Je||Ct===`ending`||kt(t?{activeIndex:e,type:Se.current?`keyboard`:`pointer`}:{activeIndex:e})}})]);ud(()=>{ot.update({inline:P,popupProps:Vt(),inputProps:Bt(),triggerProps:Tt,getItemProps:Ht,setOpen:jt,setInputValue:At,setSelectedValue:Mt,setIndices:kt,onItemHighlighted:lt,handleSelection:Nt,forceMount:Dt,requestSubmit:Pt})}),x(()=>{ot.update({id:oe,selectedValue:Be,open:Je,mounted:xt,transitionStatus:Ct,items:b,inline:P,popupProps:Vt(),inputProps:Bt(),triggerProps:Tt,openMethod:wt,getItemProps:Ht,selectionMode:l,name:je,disabled:Ae,readOnly:m,required:g,grid:y,isGrouped:Xe,virtualized:N,onOpenChangeComplete:ut,openOnInputClick:w,itemToStringLabel:A,modal:I,autoHighlight:ze,isItemEqualToValue:M,submitOnItemClick:V,hasInputValue:Fe,requestSubmit:Pt})},[ot,oe,Be,Je,xt,Ct,b,Vt,Bt,Ht,wt,Tt,l,je,Ae,m,g,ae,y,Xe,N,ut,w,A,I,M,V,Fe,P,Pt,ze]);let Ut=z(_,ae.inputRef),Wt=t.useMemo(()=>({query:Ze,hasItems:Ie,filteredItems:rt,flatFilteredItems:at}),[Ze,Ie,rt,at]),Gt=t.useMemo(()=>Array.isArray(st)?``:Od(st,j),[st,j]),Kt=Me&&Array.isArray(Be)&&Be.length>0,qt=Me||l===`none`?void 0:je,Jt=t.useMemo(()=>!Me||!Array.isArray(Be)||!je?null:Be.map(e=>{let t=Od(e,j);return(0,O.jsx)(`input`,{type:`hidden`,name:je,value:t},t)}),[Me,Be,je,j]),Yt=(0,O.jsxs)(t.Fragment,{children:[e.children,(0,O.jsx)(`input`,{...ae.getInputValidationProps({onFocus(){if(yt){ht?.focus();return}(he.current||ht)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Y(Ne,e.nativeEvent);function r(){if(Me)return;if(l===`none`){U(t!==W.initialValue),At(t,n),G()&&ae.commit(t);return}let e=Oe.current.find(e=>Od(e,j).toLowerCase()===t.toLowerCase());e!=null&&(U(e!==W.initialValue),Mt?.(e,n),G()&&ae.commit(e))}b?r():(Dt(),queueMicrotask(r))}}),id:oe&&qt==null?`${oe}-hidden-input`:void 0,name:qt,autoComplete:B,disabled:Ae,required:g&&!Kt,readOnly:m,value:Gt,ref:Ut,style:qt?Pa:Na,tabIndex:-1,"aria-hidden":!0}),Jt]});return(0,O.jsx)(dd.Provider,{value:ot,children:(0,O.jsx)(fd.Provider,{value:Lt,children:(0,O.jsx)(pd.Provider,{value:Wt,children:(0,O.jsx)(md.Provider,{value:Ge,children:Yt})})})})}function Vd(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,O.jsx)(Bd,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}function Hd(e,t){let n=ft(e);return x(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function Ud(e={}){let{id:t,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:a}=e,{controlId:o,setLabelId:s}=Uu(),c=Hd(t,v(e=>{s(e),i?.(e)})),l=o??n;function u(e){if(a){a(e,l);return}if(!l)return;let t=Ci(e.currentTarget).getElementById(l);Zt(t)&&Wd(t)}function d(e){qn(e.nativeEvent)?.closest(`button,input,select,textarea`)||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),!r&&u(e))}return r?{id:c,htmlFor:l??void 0,onMouseDown:d}:{id:c,onClick:d,onPointerDown(e){e.preventDefault()}}}function Wd(e){e.focus({focusVisible:!0})}function Gd(e){return e==null?void 0:`${e}-label`}function Kd(e,t){return e??t}var qd={...Wl,...Mu,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},Jd=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Jd.displayName=`ComboboxChipsContext`);function Yd(){return t.useContext(Jd)}var Xd=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Xd.displayName=`ComboboxPositionerContext`);function Zd(e){let n=t.useContext(Xd);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(21):`Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component`);return n}var Qd=t.forwardRef(function(e,t){let n=hd(),{buttonRef:r,getButtonProps:i}=Sn({native:!1});return(0,O.jsx)(`span`,{ref:z(t,r),...i({onClick:v(e=>{n.state.setOpen(!1,Y(ze,e.nativeEvent,e.currentTarget))})}),"aria-label":`Dismiss`,tabIndex:void 0,style:Pa})});process.env.NODE_ENV!==`production`&&(Qd.displayName=`ComboboxInternalDismissButton`);var $d=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,id:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=Fu(),{labelId:m}=Uu(),h=Yd(),g=!!Zd(!0),_=hd(),{filteredItems:y}=_d(),b=vd(),x=P(),S=Q(_,$.required),C=Q(_,$.disabled),w=Q(_,$.readOnly),T=Q(_,$.name),E=Q(_,$.selectionMode),D=Q(_,$.autoHighlight),k=Q(_,$.inputProps),A=Q(_,$.triggerProps),j=Q(_,$.open),M=Q(_,$.mounted),N=Q(_,$.selectedValue),F=Q(_,$.popupSide),I=Q(_,$.positionerElement),L=Q(_,$.id),R=Q(_,$.inline),z=Q(_,$.modal),B=!!D,ee=M&&I?F:null,V=l||C||a,H=y.length===0,U=g||R,W=!U||z,G=ft(o??(U?void 0:L)),K=Kd(m,void 0),te=g?Au:c,[q,ne]=t.useState(null),re=t.useRef(!1),ie=t.useRef(null),ae=t.useRef(!1),oe=v(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.state.setInputValue(``,Y(Ne)),_.update({inputElement:e,inputInsidePopup:t})}),se=g||!p?s:p.getValidationProps(s),ce={...te,open:j,disabled:V,readOnly:w,popupSide:ee,listEmpty:H};function le(e){if(!h)return;let t,{highlightedChipIndex:n}=h;if(n!==void 0){if(e.key===`ArrowLeft`)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===`ArrowRight`)e.preventDefault(),t=n<N.length-1?n+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let r=n>=N.length-1?N.length-2:n;t=r>=0?r:void 0,_.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`})}return t}return e.key===`ArrowLeft`&&(e.currentTarget.selectionStart??0)===0&&N.length>0?(e.preventDefault(),t=Math.max(N.length-1,0)):e.key===`Backspace`&&e.currentTarget.value===``&&N.length>0&&(_.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let ue=J(`input`,e,{state:ce,ref:[n,_.state.inputRef,oe],props:[k,A,{type:`text`,value:e.value??q??b,"aria-readonly":w||void 0,"aria-required":S||void 0,"aria-labelledby":K,disabled:V,readOnly:w,required:E===`none`?S:void 0,...E===`none`&&T&&{name:T},id:G,onFocus(){if(d(!0),!R||!ae.current)return;ae.current=!1;let e=ie.current;e==null||!Object.hasOwn(_.state.valuesRef.current,e)||_.state.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(R&&e!==null&&D!==`always`&&(ie.current=e,ae.current=!0,_.state.setIndices({activeIndex:null})),f===`onBlur`){let e=E===`none`?b:N;p.commit(e)}},onCompositionStart(e){Nn||(re.current=!0,ne(e.currentTarget.value))},onCompositionEnd(e){re.current=!1;let t=e.currentTarget.value;ne(null),_.state.setInputValue(t,Y(He,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=re.current||!n;if(re.current){let t=e.currentTarget.value;ne(t),t===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.state.setOpen(!1,Y(Ue,e.nativeEvent));let n=t.trim(),i=B&&n!==``;!w&&!V&&n&&r&&(_.state.setOpen(!0,Y(He,e.nativeEvent)),B||_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?`keyboard`:`pointer`})),j&&_.state.activeIndex!==null&&!i&&_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}_.state.setInputValue(e.currentTarget.value,Y(He,e.nativeEvent));let i=e.currentTarget.value===``,a=Y(Ue,e.nativeEvent);i&&!_.state.inputInsidePopup&&(E===`single`&&_.state.setSelectedValue(null,a),_.state.openOnInputClick||_.state.setOpen(!1,a));let o=e.currentTarget.value.trim();!w&&!V&&o&&r&&(_.state.setOpen(!0,Y(He,e.nativeEvent)),B||_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?`keyboard`:`pointer`})),j&&_.state.activeIndex!==null&&!B&&_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(V||w||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;_.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=x===`rtl`;if(e.key===`Home`){nr(e);let n=jn&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){nr(e);let i=jn&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!M&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(N)?N.length===0:N===null,n=Y(Je,e.nativeEvent),r=E===`multiple`?[]:null;_.state.setInputValue(``,n),_.state.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(N)&&N.length>0){let t=N.slice(0,-1);_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?`keyboard`:`pointer`}),_.state.setSelectedValue(t,Y(Ne,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=le(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.state.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&j){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(R)return;_.state.setOpen(!1,Y(Ne,n));return}nr(e);let r=_.state.listRef.current[t];r&&(_.state.selectionEventRef.current=n,r.click(),_.state.selectionEventRef.current=null)}},onPointerMove(){_.state.keyboardActiveRef.current=!1},onPointerDown(){_.state.keyboardActiveRef.current=!1}},se],stateAttributesMapping:qd});return(0,O.jsxs)(t.Fragment,{children:[j&&W&&(0,O.jsx)(Qd,{ref:_.state.startDismissRef}),ue]})});process.env.NODE_ENV!==`production`&&($d.displayName=`ComboboxInput`);function ef(e){let t=e.getBoundingClientRect();if(process.env.NODE_ENV!==`production`)return t;let n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var tf=2,nf=t.forwardRef(function(e,n){let{render:r,className:i,nativeButton:a=!0,disabled:o=!1,id:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=Fu(),{labelId:h}=Uu(),g=hd(),{filteredItems:_}=_d(),y=Q(g,$.selectionMode),b=Q(g,$.disabled),x=Q(g,$.readOnly),S=Q(g,$.required),C=Q(g,$.mounted),w=Q(g,$.popupSide),T=Q(g,$.positionerElement),E=Q(g,$.listElement),D=Q(g,$.triggerProps),O=Q(g,$.triggerElement),k=Q(g,$.inputInsidePopup),A=Q(g,$.id),j=Q(g,$.labelId),M=Q(g,$.open),N=Q(g,$.selectedValue),P=Q(g,$.activeIndex),F=Q(g,$.selectedIndex),I=Q(g,$.hasSelectedValue),L=gd(),R=vd(),z=pa(),B=u||b||o,ee=_.length===0,V=C&&T?w:null;jd({id:k?s:void 0});let H=k?s??A:s,U=Kd(h,j),W=t.useRef(``);function G(e){W.current=e.pointerType}let K=L.useState(`domReferenceElement`);t.useEffect(()=>{k&&O&&O!==K&&L.set(`domReferenceElement`,O)},[O,K,L,k]);let{reference:te}=_l(L,{enabled:!M&&!x&&!b&&y===`single`,listRef:g.state.labelsRef,activeIndex:P,selectedIndex:F,onMatch(e){let t=g.state.valuesRef.current[e];t!==void 0&&g.state.setSelectedValue(t,Y(`none`))}}),{reference:q}=So(L,{enabled:!x&&!b,event:`mousedown`}),{buttonRef:ne,getButtonProps:re}=Sn({native:a,disabled:B}),ie={...l,open:M,disabled:B,popupSide:V,listEmpty:ee,placeholder:!I};return J(`button`,e,{ref:[n,ne,v(e=>{g.set(`triggerElement`,e)})],state:ie,props:[D,q,te,{id:H,tabIndex:k?0:-1,role:k?`combobox`:void 0,"aria-expanded":M?`true`:`false`,"aria-haspopup":k?`dialog`:`listbox`,"aria-controls":M?E?.id:void 0,"aria-required":k&&S||void 0,"aria-labelledby":U,onPointerDown:G,onPointerEnter:G,onFocus(){f(!0),!(B||x)&&z.start(0,g.state.forceMount)},onBlur(e){if(!X(T,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=y===`none`?R:N;m.commit(e)}},onMouseDown(e){if(B||x||(k||L.set(`domReferenceElement`,e.currentTarget),g.state.forceMount(),W.current!==`touch`&&(g.state.inputRef.current?.focus(),k||e.preventDefault()),M))return;let t=Ci(e.currentTarget);function n(e){if(!O)return;let t=qn(e),n=g.state.positionerElement,r=g.state.listElement;if(X(O,t)||X(n,t)||X(r,t)||t===O)return;let i=ef(O),a=e.clientX>=i.left-tf&&e.clientX<=i.right+tf,o=e.clientY>=i.top-tf&&e.clientY<=i.bottom+tf;a&&o||g.state.setOpen(!1,Y(`cancel-open`,e))}k&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){B||x||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(nr(e),g.state.setOpen(!0,Y(Xe,e.nativeEvent)),g.state.inputRef.current?.focus())}},m?m.getValidationProps(c):c,re],stateAttributesMapping:qd})});process.env.NODE_ENV!==`production`&&(nf.displayName=`ComboboxTrigger`);var rf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(rf.displayName=`ComboboxPortalContext`);function af(){let e=t.useContext(rf);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(20):`Base UI: <Combobox.Portal> is missing.`);return e}var of=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=hd(),a=Q(i,$.mounted),o=Q(i,$.forceMounted);return a||n||o?(0,O.jsx)(rf.Provider,{value:n,children:(0,O.jsx)(to,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(of.displayName=`ComboboxPortal`);var sf=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,offsetParent:d=`real`}=gr(e,t)||{};if(l==null)return{};let f=Pr(u),p={x:n,y:r},m=Sr(i),h=br(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=hr(k,j,A),N=!c.arrow&&vr(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),cf=(e,t)=>({...sf(e),options:[e,t]}),lf={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Rs().fn(e)).data?.referenceHidden||a}}}},uf={sideX:`left`,sideY:`top`},df={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=qt(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:uf};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=Ci(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=_r(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:uf.sideX,g=f===`top`?`bottom`:uf.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function ff(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function pf(e,t,n){let{rects:r,placement:i}=e;return{side:ff(t,_r(i),n),align:vr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function mf(e){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:S=!1,externalTree:C}=e,[w,T]=t.useState(null);!h&&w!==null&&T(null);let E=g.side||`flip`,D=g.align||`flip`,O=g.fallbackAxisSide||`end`,k=typeof n==`function`?n:void 0,A=v(k),j=k?A:n,M=Aa(n),N=P()===`rtl`,F=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],I=o===`center`?F:`${F}-${o}`,L=l,R=i===`bottom`?1:0,z=i===`top`?1:0,B=i===`right`?1:0,ee=i===`left`?1:0;typeof L==`number`?L={top:L+R,right:L+ee,bottom:L+z,left:L+B}:L&&={top:(L.top||0)+R,right:(L.right||0)+ee,bottom:(L.bottom||0)+z,left:(L.left||0)+B};let V={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},H=t.useRef(null),U=Aa(a),W=Aa(s),G=[Ns(e=>{let t=pf(e,i,N),n=typeof U.current==`function`?U.current(t):U.current,r=typeof W.current==`function`?W.current(t):W.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[typeof a==`function`?0:a,typeof s==`function`?0:s,N,i])],K=D===`none`&&E!==`shift`,te=!K&&(u||_||E===`shift`),q=E===`none`?null:Is({...V,padding:{top:L.top+1,right:L.right+1,bottom:L.bottom+1,left:L.left+1},mainAxis:!_&&E===`flip`,crossAxis:D===`flip`?`alignment`:!1,fallbackAxisSideDirection:O}),ne=K?null:Ps(e=>{let t=Ci(e.elements.floating).documentElement;return{...V,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:D!==`none`,crossAxis:te,limiter:u||_?void 0:Fs(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=xr(_r(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})}},[V,u,_,L,D]);E===`shift`||D===`shift`||o===`center`?G.push(ne,q):G.push(q,ne),G.push(Ls({...V,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),cf(()=>({element:H.current||document.createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=_r(r),l=xr(c),u=H.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(pf(e,i,N)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,te&&l===`y`&&b?S:x),{}}},lf,b),x(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let re=t.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ie,elements:ae,x:oe,y:se,middlewareData:ce,update:le,placement:ue,context:de,isPositioned:fe,floatingStyles:pe}=Kc({rootContext:m,placement:I,middleware:G,strategy:r,whileElementsMounted:p?void 0:(...e)=>ys(...e,re),nodeId:y,externalTree:C}),{sideX:me,sideY:he}=ce.adaptiveOrigin||uf,ge=fe?r:`fixed`,_e=t.useMemo(()=>{let e=b?{position:ge,[me]:oe,[he]:se}:{position:ge,...pe};return fe||(e.opacity=0),e},[b,ge,me,oe,he,se,pe,fe]),ve=t.useRef(null);x(()=>{if(!h)return;let e=M.current,t=typeof e==`function`?e():e,n=(hf(t)?t.current:t)||null;n!==ve.current&&(ie.setPositionReference(n),ve.current=n)},[h,ie,j,M]),t.useEffect(()=>{if(!h)return;let e=M.current;typeof e!=`function`&&hf(e)&&e.current!==ve.current&&(ie.setPositionReference(e.current),ve.current=e.current)},[h,ie,j,M]),t.useEffect(()=>{if(p&&h&&ae.domReference&&ae.floating)return ys(ae.domReference,ae.floating,le,re)},[p,h,ae,le,re]);let ye=_r(ue),be=ff(i,ye,N),xe=vr(ue)||`center`,Se=!!ce.hide?.referenceHidden;x(()=>{S&&h&&fe&&T(ye)},[S,h,fe,ye]);let Ce=t.useMemo(()=>({position:`absolute`,top:ce.arrow?.y,left:ce.arrow?.x}),[ce.arrow]),we=ce.arrow?.centerOffset!==0;return t.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:H,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:ie,context:de,isPositioned:fe,update:le}),[_e,Ce,H,we,be,xe,ye,Se,ie,de,fe,le])}function hf(e){return e!=null&&`current`in e}function gf(e){return e===`starting`?ye:ve}var _f=t.forwardRef(function(e,n){let{render:r,className:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Te,..._}=e,y=hd(),{filteredItems:b}=_d(),S=gd(),C=af(),w=Q(y,$.modal),T=Q(y,$.open),E=Q(y,$.mounted),D=Q(y,$.openMethod),k=Q(y,$.triggerElement),A=Q(y,$.inputElement),j=Q(y,$.inputGroupElement),M=Q(y,$.inputInsidePopup),N=Q(y,$.transitionStatus),P=b.length===0,F=mf({anchor:a??(M?k:j??A),floatingRootContext:S,positionMethod:o,mounted:E,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:C,collisionAvoidance:g,lazyFlip:!0});Sa(T&&w&&D!==`touch`,k);let I=t.useMemo(()=>{let e={...F.positionerStyles};return T||(e.pointerEvents=`none`),{role:`presentation`,hidden:!E,style:e}},[T,E,F.positionerStyles]),L={open:T,side:F.side,align:F.align,anchorHidden:F.anchorHidden,empty:P};x(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let R=t.useMemo(()=>({side:F.side,align:F.align,arrowRef:F.arrowRef,arrowUncentered:F.arrowUncentered,arrowStyles:F.arrowStyles,anchorHidden:F.anchorHidden,isPositioned:F.isPositioned}),[F.side,F.align,F.arrowRef,F.arrowUncentered,F.arrowStyles,F.anchorHidden,F.isPositioned]),z=J(`div`,e,{state:L,ref:[n,v(e=>{y.set(`positionerElement`,e)})],props:[I,gf(N),_],stateAttributesMapping:Gl});return(0,O.jsxs)(Xd.Provider,{value:R,children:[E&&w&&(0,O.jsx)(ru,{inert:nu(!T),cutout:j??A??k}),z]})});process.env.NODE_ENV!==`production`&&(_f.displayName=`ComboboxPositioner`);var vf={...Gl,...wt},yf=t.forwardRef(function(e,n){let{render:r,className:i,initialFocus:a,finalFocus:o,...s}=e,c=hd(),l=Zd(),u=gd(),{filteredItems:d}=_d(),f=Q(c,$.mounted),p=Q(c,$.open),m=Q(c,$.openMethod),h=Q(c,$.transitionStatus),g=Q(c,$.inputInsidePopup),_=Q(c,$.inputElement),v=Q(c,$.modal),y=d.length===0;aa({open:p,ref:c.state.popupRef,onComplete(){p&&c.state.onOpenChangeComplete(!0)}});let b=J(`div`,e,{state:{open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:y},ref:[n,c.state.popupRef],props:[{role:g?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=qn(e.nativeEvent);m!==`touch`&&(X(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},gf(h),s],stateAttributesMapping:vf}),x=a===void 0?g?e=>e===`touch`?c.state.popupRef.current:_:!1:a,S;S=o??(g?void 0:!1);let C=!g||v;return(0,O.jsx)(xo,{context:u,disabled:!f,modal:C,openInteractionType:m,initialFocus:x,returnFocus:S,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,O.jsxs)(t.Fragment,{children:[b,C&&(0,O.jsx)(Qd,{ref:c.state.endDismissRef})]})})});process.env.NODE_ENV!==`production`&&(yf.displayName=`ComboboxPopup`);var bf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(bf.displayName=`ComboboxItemContext`);function xf(){let e=t.useContext(bf);if(!e)throw Error(process.env.NODE_ENV===`production`?I(19):`Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.`);return e}var Sf=t.createContext(!1);process.env.NODE_ENV!==`production`&&(Sf.displayName=`ComboboxRowContext`);function Cf(){return t.useContext(Sf)}var wf=t.memo(t.forwardRef(function(e,r){let{render:i,className:a,value:o=null,index:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=t.useRef(!1),f=t.useRef(null),p=jt({index:s,textRef:f,indexGuessBehavior:At.GuessFromOrder}),m=hd(),h=Cf(),{flatFilteredItems:g,hasItems:_}=_d(),v=Q(m,$.open),y=Q(m,$.selectionMode),b=Q(m,$.readOnly),S=Q(m,$.virtualized),C=Q(m,$.isItemEqualToValue),w=y!==`none`,T=s??(S?Sd(g,o,C):p.index),E=p.index!==-1,D=Q(m,$.id),k=Q(m,$.isActive,T),A=Q(m,$.isSelected,o),j=Q(m,$.getItemProps),M=t.useRef(null),N=D!=null&&E?`${D}-${T}`:void 0,P=A&&w;x(()=>{if(!(E&&(S||s!=null)))return;let e=m.state.listRef.current;return e[T]=M.current,()=>{delete e[T]}},[E,S,T,s,m]),x(()=>{if(!E||_)return;let e=m.state.valuesRef.current;return e[T]=o,y!==`none`&&m.state.allValuesRef.current.push(o),()=>{delete e[T]}},[E,_,T,o,m,y]),x(()=>{if(!v){d.current=!1;return}if(!E||_)return;let e=m.state.selectedValue;bd(o,Array.isArray(e)?e[e.length-1]:e,C)&&m.set(`selectedIndex`,T)},[E,_,v,m,T,o,C]);let F={disabled:c,selected:P,highlighted:k},I=j({active:k,selected:P});I.id=void 0,I.onFocus=void 0;let{getButtonProps:L,buttonRef:R}=Sn({disabled:c,focusableWhenDisabled:!0,native:l,composite:!0});function z(e){function t(){m.state.handleSelection(e,o)}m.state.submitOnItemClick?(n.flushSync(t),m.state.requestSubmit()):t()}let B={id:N,role:h?`gridcell`:`option`,"aria-selected":w?P:void 0,tabIndex:void 0,onPointerDownCapture(e){d.current=!0,e.preventDefault()},onClick(e){c||b||z(e.nativeEvent)},onMouseUp(e){let t=d.current;d.current=!1,!(c||b||e.button!==0||t||!k)&&z(e.nativeEvent)}},ee=J(`div`,e,{ref:[R,r,p.ref,M],state:F,props:[I,B,u,L]}),V=t.useMemo(()=>({selected:P,textRef:f}),[P,f]);return(0,O.jsx)(bf.Provider,{value:V,children:ee})}));process.env.NODE_ENV!==`production`&&(wf.displayName=`ComboboxItem`);var Tf=t.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=xf();return n||r?(0,O.jsx)(Ef,{...e,ref:t}):null});process.env.NODE_ENV!==`production`&&(Tf.displayName=`ComboboxItemIndicator`);var Ef=t.memo(t.forwardRef((e,n)=>{let{render:r,className:i,keepMounted:a,...o}=e,{selected:s}=xf(),c=t.useRef(null),{transitionStatus:l,setMounted:u}=Et(s),d=J(`span`,e,{ref:[n,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:wt});return aa({open:s,ref:c,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!==`production`&&(Ef.displayName=`Inner`);var Df=t.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,{filteredItems:o}=_d(),s=hd(),c=o.length===0?i:null;return J(`div`,e,{ref:[t,s.state.emptyRef],props:[{children:c,role:`status`,"aria-live":`polite`,"aria-atomic":!0},a]})});process.env.NODE_ENV!==`production`&&(Df.displayName=`ComboboxEmpty`);var Of=t.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return J(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},a]})});process.env.NODE_ENV!==`production`&&(Of.displayName=`Separator`);var kf=Vd,Af=t.forwardRef(({className:e,...t},n)=>(0,O.jsxs)(`div`,{className:`relative w-full`,children:[(0,O.jsx)($d,{ref:n,className:`flex h-11 w-full items-center rounded-xl border border-neutral-200 bg-white px-4 py-2 pr-10 text-sm text-neutral-900 shadow-sm transition-all focus:border-blue-500 focus:outline-none focus:ring-4 focus:ring-blue-500/10 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 dark:focus:ring-blue-500/20 ${e||``}`,...t}),(0,O.jsx)(nf,{className:`absolute inset-y-0 right-0 flex items-center pr-3 text-neutral-500 opacity-70 transition-transform hover:opacity-100 data-[popup-open]:rotate-180`,children:(0,O.jsx)(r.ChevronDown,{className:`size-4`})})]}));Af.displayName=`ComboboxInput`;var jf=t.forwardRef(({className:e,sideOffset:t=8,...n},r)=>(0,O.jsx)(of,{children:(0,O.jsx)(_f,{sideOffset:t,children:(0,O.jsx)(yf,{ref:r,className:`z-50 max-h-96 min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-neutral-200 bg-white p-1.5 shadow-lg transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 origin-[var(--transform-origin)] ${e||``}`,...n})})}));jf.displayName=`ComboboxContent`;var Mf=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsxs)(wf,{ref:i,className:`relative flex cursor-default select-none items-center justify-between rounded-lg px-3 py-2 text-sm font-medium outline-none transition-colors data-[highlighted]:bg-neutral-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:data-[highlighted]:bg-neutral-800 dark:data-[highlighted]:text-neutral-50 ${e||``}`,...n,children:[t,(0,O.jsx)(Tf,{children:(0,O.jsx)(r.Check,{className:`size-4`})})]}));Mf.displayName=`ComboboxItem`;var Nf=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Df,{ref:n,className:`py-6 text-center text-sm text-neutral-500 dark:text-neutral-400 ${e||``}`,...t}));Nf.displayName=`ComboboxEmpty`;var Pf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Pf.displayName=`ContextMenuRootContext`);function Ff(e=!0){let n=t.useContext(Pf);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(25):`Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.`);return n}var If=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(If.displayName=`MenuPositionerContext`);function Lf(e){let n=t.useContext(If);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(33):`Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.`);return n}var Rf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Rf.displayName=`MenuRootContext`);function zf(e){let n=t.useContext(Rf);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(36):`Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.`);return n}function Bf(e){let{closeOnClick:n,highlighted:r,id:i,nodeId:a,store:o,typingRef:s,itemRef:c,itemMetadata:l}=e,{events:u}=o.useState(`floatingTreeRoot`),d=Ff(!0),f=d!==void 0;return t.useMemo(()=>({id:i,role:`menuitem`,tabIndex:r?0:-1,onKeyDown(e){e.key===` `&&s?.current&&e.preventDefault()},onMouseMove(e){a&&u.emit(`itemhover`,{nodeId:a,target:e.currentTarget})},onClick(e){n&&u.emit(`close`,{domEvent:e,reason:Re})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!Pn&&e.button===2)return}c.current&&o.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&(!l||l.type===`regular-item`)&&c.current.click()}}),[n,r,i,u,a,o,s,c,d,f,l])}var Vf={type:`regular-item`};function Hf(e){let{closeOnClick:n,disabled:r=!1,highlighted:i,id:a,store:o,typingRef:s=o.context.typingRef,nativeButton:c,itemMetadata:l,nodeId:u}=e,d=t.useRef(null),{getButtonProps:f,buttonRef:p}=Sn({disabled:r,focusableWhenDisabled:!0,native:c,composite:!0}),m=Bf({closeOnClick:n,highlighted:i,id:a,nodeId:u,store:o,typingRef:s,itemRef:d,itemMetadata:l}),h=t.useCallback(e=>ae(m,{onMouseEnter(){l.type===`submenu-trigger`&&l.setActive()}},e,f),[m,f,l]),g=z(d,p);return t.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var Uf=t.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,...l}=e,u=jt({label:a}),d=Lf(!0),f=ft(i),{store:p}=zf(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),{getItemProps:g,itemRef:_}=Hf({closeOnClick:c,disabled:s,highlighted:m,id:f,store:p,nativeButton:o,nodeId:d?.nodeId,itemMetadata:Vf});return J(`div`,e,{state:{disabled:s,highlighted:m},props:[h,l,g],ref:[_,t,u.ref]})});process.env.NODE_ENV!==`production`&&(Uf.displayName=`MenuItem`);var Wf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Wf.displayName=`ToolbarRootContext`);function Gf(e){let n=t.useContext(Wf);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(69):`Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.`);return n}var Kf={...Gl,...wt},qf=t.forwardRef(function(e,n){let{render:r,className:i,finalFocus:a,...o}=e,{store:s}=zf(),{side:c,align:l}=Lf(),u=Gf(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=_.type===`context-menu`;aa({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),t.useEffect(()=>{function e(e){s.setOpen(!1,Y(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]);let T=s.useState(`hoverEnabled`),E=s.useState(`disabled`);nl(b,{enabled:T&&!E&&!w&&_.type!==`menubar`,closeDelay:S});let D={transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},k=t.useCallback(e=>{s.set(`popupElement`,e)},[s]),A=J(`div`,e,{state:D,ref:[n,s.context.popupRef,k],stateAttributesMapping:Kf,props:[p,{onKeyDown(e){u&&Gi.has(e.key)&&e.stopPropagation()}},gf(f),o,{"data-rootownerid":y}]}),j=_.type===void 0||w;return(g||_.type===`menubar`&&v!==`outside-press`)&&(j=!0),(0,O.jsx)(xo,{context:b,modal:w,disabled:!m,returnFocus:a===void 0?j:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:A})});process.env.NODE_ENV!==`production`&&(qf.displayName=`MenuPopup`);var Jf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Jf.displayName=`MenuPortalContext`);function Yf(){let e=t.useContext(Jf);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(32):`Base UI: <Menu.Portal> is missing.`);return e}var Xf=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=zf();return i.useState(`mounted`)||n?(0,O.jsx)(Jf.Provider,{value:n,children:(0,O.jsx)(to,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(Xf.displayName=`MenuPortal`);var Zf=t.forwardRef(function(e,n){let{anchor:r,positionMethod:i=`absolute`,className:a,render:o,side:s,align:c,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Te,..._}=e,{store:v}=zf(),y=Yf(),b=Ff(!0),S=v.useState(`parent`),C=v.useState(`floatingRootContext`),w=v.useState(`floatingTreeRoot`),T=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`hasViewport`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=C.useState(`domReferenceElement`),z=t.useRef(null),B=Tt(M,!1,!1),ee=r,V=l,H=u,U=c,W=g;S.type===`context-menu`&&(ee=r??S.context?.anchor,U??=`start`,!s&&U!==`center`&&(H=e.alignOffset??2,V=e.sideOffset??-5));let G=s,K=U;S.type===`menu`?(G??=`inline-end`,K??=`start`,W=e.collisionAvoidance??Ee):S.type===`menubar`&&(G??=`bottom`,K??=`start`);let te=S.type===`context-menu`,q=mf({anchor:ee,floatingRootContext:C,positionMethod:b?`fixed`:i,mounted:T,side:G,sideOffset:V,align:K,alignOffset:H,arrowPadding:te?0:p,collisionBoundary:d,collisionPadding:f,sticky:m,nodeId:I,keepMounted:y,disableAnchorTracking:h,collisionAvoidance:W,shiftCrossAxis:te&&!(`side`in W&&W.side===`flip`),externalTree:w,adaptiveOrigin:P?df:void 0}),ne=t.useMemo(()=>{let e={};return E||(e.pointerEvents=`none`),{role:`presentation`,hidden:!T,style:{...q.positionerStyles,...e}}},[E,T,q.positionerStyles]);t.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Y(et)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[v,w.events,I]),t.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Y(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,v]);let re=pa();t.useEffect(()=>{E||re.clear()},[E,re]),t.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?re.isStarted()||re.start(e,()=>{v.setOpen(!1,Y(et))}):v.setOpen(!1,Y(et))}else re.clear()}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,A,v,re]),t.useEffect(()=>{let e={open:E,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,v,I,L]),x(()=>{let e=R,t=z.current;if(e&&(z.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return B(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[R,B,v]);let ie={open:E,side:q.side,align:q.align,anchorHidden:q.anchorHidden,nested:S.type===`menu`,instant:N},ae=t.useMemo(()=>({side:q.side,align:q.align,arrowRef:q.arrowRef,arrowUncentered:q.arrowUncentered,arrowStyles:q.arrowStyles,nodeId:q.context.nodeId}),[q.side,q.align,q.arrowRef,q.arrowUncentered,q.arrowStyles,q.context.nodeId]),oe=J(`div`,e,{state:ie,stateAttributesMapping:Gl,ref:[n,v.useStateSetter(`positionerElement`)],props:[ne,gf(j),_]}),se=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&F!==`trigger-hover`||S.type===`menubar`&&S.context.modal),ce=null;return S.type===`menubar`?ce=S.context.contentElement:S.type===void 0&&(ce=A),(0,O.jsxs)(If.Provider,{value:ae,children:[se&&(0,O.jsx)(ru,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:nu(!E),cutout:ce}),(0,O.jsx)(lo,{id:I,children:(0,O.jsx)(k,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:oe})})]})});process.env.NODE_ENV!==`production`&&(Zf.displayName=`MenuPositioner`);var Qf=t.createContext(null);process.env.NODE_ENV!==`production`&&(Qf.displayName=`MenubarContext`);function $f(e){let n=t.useContext(Qf);if(n===null&&!e)throw Error(process.env.NODE_ENV===`production`?I(5):`Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.`);return n}var ep={...Wc,disabled:Z(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:Z(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),allowMouseEnter:Z(e=>e.allowMouseEnter),stickIfOpen:Z(e=>e.stickIfOpen),parent:Z(e=>e.parent),rootId:Z(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:Z(e=>e.activeIndex),isActive:Z((e,t)=>e.activeIndex===t),hoverEnabled:Z(e=>e.hoverEnabled),instantType:Z(e=>e.instantType),lastOpenChangeReason:Z(e=>e.openChangeReason),floatingTreeRoot:Z(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:Z(e=>e.floatingNodeId),floatingParentNodeId:Z(e=>e.floatingParentNodeId),itemProps:Z(e=>e.itemProps),closeDelay:Z(e=>e.closeDelay),hasViewport:Z(e=>e.hasViewport),keyboardEventRelay:Z(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},tp=class e extends Mc{constructor(e){super({...np(),...e},{positionerRef:t.createRef(),popupRef:t.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:t.createRef(),beforeContentFocusGuardRef:t.createRef(),onOpenChangeComplete:void 0,triggerElements:new Bc},ep),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=h(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function np(){return{...Hc(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ro,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ve,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var rp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(rp.displayName=`MenuSubmenuRootContext`);function ip(){return t.useContext(rp)}var ap=Sc(function(e){let{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0}=e,_=Ff(!0),y=zf(!0),b=$f(!0),S=ip(),C=t.useMemo(()=>S&&y?{type:`menu`,store:y.store}:b?{type:`menubar`,context:b}:_&&!y?{type:`context-menu`,context:_}:{type:void 0},[_,y,b,S]),w=tp.useStore(p?.store,{open:o,openProp:r,activeTriggerId:h,triggerIdProp:m,parent:C});ud(()=>{r===void 0&&w.state.open===!1&&o===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp(`openProp`,r),w.useControlledProp(`triggerIdProp`,m),w.useContextCallback(`onOpenChangeComplete`,a);let T=w.useState(`floatingTreeRoot`),E=co(T),D=oo();x(()=>{_&&!y?w.update({parent:{type:`context-menu`,context:_},floatingNodeId:E,floatingParentNodeId:D}):y&&w.update({floatingNodeId:E,floatingParentNodeId:D})},[_,y,E,D,w]);let k=w.useState(`open`),A=w.useState(`activeTriggerElement`),j=w.useState(`positionerElement`),M=w.useState(`hoverEnabled`),N=w.useState(`modal`),F=w.useState(`disabled`),I=w.useState(`lastOpenChangeReason`),L=w.useState(`parent`),R=w.useState(`activeIndex`),z=w.useState(`payload`),B=w.useState(`floatingParentNodeId`),ee=t.useRef(null),V=B!=null,H;process.env.NODE_ENV!==`production`&&L.type!==void 0&&c!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored."),w.useSyncedValues({disabled:s,modal:L.type===void 0?c:void 0,rootId:dt()});let{openMethod:U,triggerProps:W}=Ol(k);Rc(w);let{forceUnmount:G}=zc(k,w,()=>{w.update({allowMouseEnter:!1,stickIfOpen:!0})}),K=t.useRef(L.type!==`context-menu`),te=pa();t.useEffect(()=>{if(k||(ee.current=null),L.type===`context-menu`){if(!k){te.clear(),K.current=!1;return}te.start(500,()=>{K.current=!0})}},[te,k,L.type]),Sa(k&&N&&I!==`trigger-hover`&&U!==`touch`,j),x(()=>{!k&&!M&&w.set(`hoverEnabled`,!0)},[k,M,w]);let q=t.useRef(!0),ne=pa(),re=v((e,t)=>{let n=t.reason;if(k===e&&t.trigger===A&&I===n||(t.preventUnmountOnClose=()=>{w.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=A??void 0),i?.(e,t),t.isCanceled))return;let r={open:e,nativeEvent:t.event,reason:t.reason,nested:V};H?.emit(`openchange`,r);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!q.current)return;if(!e&&R!==null){let e=w.context.itemDomElements.current[R];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(q.current=!1,ne.start(300,()=>{q.current=!0})):(q.current=!0,ne.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0&&a?.isTrusted,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};ee.current=t.event??null;let l=t.trigger?.id??null;(l||e)&&(c.activeTriggerId=l,c.activeTriggerElement=t.trigger??null),w.update(c),L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?w.set(`instantType`,`group`):o||s?w.set(`instantType`,o?`click`:`dismiss`):w.set(`instantType`,void 0)}),ie=t.useCallback(e=>{let t=Y(e);return t.preventUnmountOnClose=()=>{w.set(`preventUnmountingOnClose`,!0)},t},[w]),oe=t.useCallback(()=>{w.setOpen(!1,ie(nt))},[w,ie]);t.useImperativeHandle(d,()=>({unmount:G,close:oe}),[G,oe]);let se;L.type===`context-menu`&&(se=L.context),t.useImperativeHandle(se?.positionerRef,()=>j,[j]),t.useImperativeHandle(se?.actionsRef,()=>({setOpen:re}),[re]);let ce=qc({popupStore:w,onOpenChange:re});H=ce.context.events,t.useEffect(()=>{let e=({open:e,eventDetails:t})=>re(e,t);return H.on(`setOpen`,e),()=>{H?.off(`setOpen`,e)}},[H,re]);let le=ko(ce,{enabled:!F,bubbles:{escapeKey:f&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||ee.current?.type===`contextmenu`?!0:K.current},externalTree:V?T:void 0}),ue=gl(ce,{role:`menu`}),de=P(),fe=t.useCallback(e=>{w.select(`activeIndex`)!==e&&w.set(`activeIndex`,e)},[w]),pe=ml(ce,{enabled:!F,listRef:w.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:l,orientation:u,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:de===`rtl`,disabledIndices:_e,onNavigate:fe,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:V?T:void 0,focusItemOnHover:g}),me=t.useCallback(e=>{w.context.typingRef.current=e},[w]),{getReferenceProps:he,getFloatingProps:ge,getItemProps:ve,getTriggerProps:ye}=al([le,ue,pe,_l(ce,{listRef:w.context.itemLabels,elementsRef:w.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{k&&e!==R&&w.set(`activeIndex`,e)},onTypingChange:me})]),be=t.useMemo(()=>{let e=ae(he(),{onMouseMove(){w.set(`allowMouseEnter`,!0)}},W);return delete e.role,e},[he,w,W]),xe=t.useMemo(()=>{let e=ye();if(!e)return e;let t=ae(e,W);return delete t.role,delete t[`aria-controls`],t},[ye,W]),Se=t.useMemo(()=>ge({onMouseMove(){w.set(`allowMouseEnter`,!0),L.type===`menu`&&w.set(`hoverEnabled`,!1)},onClick(){w.select(`hoverEnabled`)&&w.set(`hoverEnabled`,!1)},onKeyDown(e){let t=w.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[ge,L.type,w]),Ce=t.useMemo(()=>ve(),[ve]);w.useSyncedValues({floatingRootContext:ce,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:Se,itemProps:Ce});let we=t.useMemo(()=>({store:w,parent:C}),[w,C]),Te=(0,O.jsx)(Rf.Provider,{value:we,children:typeof n==`function`?n({payload:z}):n});return L.type===void 0||L.type===`context-menu`?(0,O.jsx)(uo,{externalTree:T,children:Te}):Te});process.env.NODE_ENV!==`production`&&(ap.displayName=`MenuRoot`);function op(e={}){let{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:i}=bn(),{ref:a,index:o}=jt(e),s=r===o,c=t.useRef(null),l=z(a,c);return{compositeProps:t.useMemo(()=>({tabIndex:s?0:-1,onFocus(){i(o)},onMouseMove(){let e=c.current;if(!n||!e)return;let t=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!s&&!t&&e.focus()}}),[s,i,o,n]),compositeRef:l,index:o}}function sp(e){let{render:t,className:n,state:r=ve,props:i=_e,refs:a=_e,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=op({metadata:o});return J(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}function cp(e){if(Zt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!un(e))return cp(pn(e))}function lp(e){let{enabled:n=!0,mouseDownAction:r,open:i}=e,a=t.useRef(!1);return t.useMemo(()=>n?{onMouseDown:e=>{(r===`open`&&!i||r===`close`&&i)&&(a.current=!0,Ci(e.currentTarget).addEventListener(`click`,()=>{a.current=!1},{once:!0}))},onClick:e=>{a.current&&(a.current=!1,e.preventBaseUIHandler())}}:ve,[n,r,i])}var up=2,dp=Cc(function(e,r){let{render:i,className:a,disabled:o=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:d=0,handle:f,payload:p,...m}=e,h=zf(!0),g=f?.store??h?.store;if(!g)throw Error(process.env.NODE_ENV===`production`?I(85):`Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.`);let _=ft(c),y=g.useState(`isTriggerActive`,_),b=g.useState(`floatingRootContext`),x=g.useState(`isOpenedByTrigger`,_),S=t.useRef(null),C=pp(),w=bn(!0),T=so(),E=t.useMemo(()=>T??new ro,[T]),{registerTrigger:D,isMountedByThisTrigger:k}=Lc(_,S,g,{payload:p,closeDelay:d,parent:C,floatingTreeRoot:E,floatingNodeId:co(E),floatingParentNodeId:oo(),keyboardEventRelay:w?.relayKeyboardEvent}),A=C.type===`menubar`,j=g.useState(`disabled`),M=o||j||A&&C.context.disabled,{getButtonProps:N,buttonRef:P}=Sn({disabled:M,native:s});t.useEffect(()=>{!x&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,x,C.type]);let F=t.useRef(null),L=pa(),R=v(e=>{if(!F.current)return;L.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(X(F.current,t)||X(g.select(`positionerElement`),t)||t===F.current||t!=null&&cp(t)===g.select(`rootId`))return;let n=ef(F.current);e.clientX>=n.left-up&&e.clientX<=n.right+up&&e.clientY>=n.top-up&&e.clientY<=n.bottom+up||E.events.emit(`close`,{domEvent:e,reason:$e})});t.useEffect(()=>{x&&g.select(`lastOpenChangeReason`)===`trigger-hover`&&Ci(F.current).addEventListener(`mouseup`,R,{once:!0})},[x,R,g]);let z=A&&C.context.hasSubmenuOpen,B=il(b,{enabled:(l??z)&&!M&&C.type!==`context-menu`&&(!A||z&&!k),handleClose:Tl({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:C.type===void 0?u:void 0,delay:{close:d},triggerElementRef:S,externalTree:E,isActiveTrigger:y}),ee=fp(x,g.select(`lastOpenChangeReason`)),V=So(b,{enabled:!M&&C.type!==`context-menu`,event:x&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?ee:!1}),H=Yc(b,{enabled:!M&&z}),U=lp({open:x,enabled:A,mouseDownAction:`open`}),W=al([V,H]),G={disabled:M,open:x},K=g.useState(`triggerProps`,k),te=[F,r,P,D,S],q=[W.getReferenceProps(),B??ve,K,{"aria-haspopup":`menu`,id:_,onMouseDown:e=>{g.select(`open`)||(L.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Ci(e.currentTarget).addEventListener(`mouseup`,R,{once:!0}))}},A?{role:`menuitem`}:{},U,m,N],ne=t.useRef(null),re=v(e=>{n.flushSync(()=>{g.setOpen(!1,Y(qe,e.nativeEvent,e.currentTarget))}),Ai(ne.current)?.focus()}),ie=v(e=>{let t=g.select(`positionerElement`);if(t&&ji(e,t))g.context.beforeContentFocusGuardRef.current?.focus();else{n.flushSync(()=>{g.setOpen(!1,Y(qe,e.nativeEvent,e.currentTarget))});let r=ki(g.context.triggerFocusTargetRef.current||S.current);for(;r!==null&&X(t,r);){let e=r;if(r=Ei(r),r===e)break}r?.focus()}}),ae=J(`button`,e,{enabled:!A,stateAttributesMapping:Wl,state:G,ref:te,props:q});return A?(0,O.jsx)(sp,{tag:`button`,render:i,className:a,state:G,refs:te,props:q,stateAttributesMapping:Wl}):x?(0,O.jsxs)(t.Fragment,{children:[(0,O.jsx)(Fa,{ref:ne,onFocus:re},`${_}-pre-focus-guard`),(0,O.jsx)(t.Fragment,{children:ae},_),(0,O.jsx)(Fa,{ref:g.context.triggerFocusTargetRef,onFocus:ie},`${_}-post-focus-guard`)]}):(0,O.jsx)(t.Fragment,{children:ae},_)});process.env.NODE_ENV!==`production`&&(dp.displayName=`MenuTrigger`);function fp(e,n){let r=pa(),[i,a]=t.useState(!1);return x(()=>{e&&n===`trigger-hover`?(a(!0),r.start(500,()=>{a(!1)})):e||(r.clear(),a(!1))},[e,n,r]),i}function pp(){let e=Ff(!0),n=zf(!0),r=$f(!0);return t.useMemo(()=>r?{type:`menubar`,context:r}:e&&!n?{type:`context-menu`,context:e}:{type:void 0},[e,n,r])}function mp(e){let[n,r]=t.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=t.useRef(null),a=t.useRef(null),o=t.useRef(null),s=t.useRef(null),c=t.useRef(!0),l=t.useRef(null),u=dt(),d=t.useMemo(()=>({anchor:n,setAnchor:r,actionsRef:o,backdropRef:i,internalBackdropRef:a,positionerRef:s,allowMouseUpTriggerRef:c,initialCursorPointRef:l,rootId:u}),[n,u]);return(0,O.jsx)(Pf.Provider,{value:d,children:(0,O.jsx)(Rf.Provider,{value:void 0,children:(0,O.jsx)(ap,{...e})})})}var hp=500,gp=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Ff(!1),{store:m}=zf(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=t.useRef(null),v=t.useRef(null),y=pa(),b=pa(),x=t.useRef(!1);function S(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,Y(Pe,n)),b.start(hp,()=>{x.current=!0})}function C(e){g||(d.current=!0,nr(e),S(e.clientX,e.clientY,e.nativeEvent),Ci(_.current).addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=qn(e);X(u.current,t)||p&&t&&cp(t)===p||s.current?.setOpen(!1,Y($e,e))},{once:!0}))}function w(e){if(!g&&(d.current=!1,e.touches.length===1)){e.stopPropagation();let t=e.touches[0];v.current={x:t.clientX,y:t.clientY},y.start(hp,()=>{v.current&&S(v.current.x,v.current.y,e.nativeEvent)})}}function T(e){if(y.isStarted()&&v.current&&e.touches.length===1){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&y.clear()}}function E(){y.clear(),v.current=null}return t.useEffect(()=>{function e(e){if(g)return;let t=qn(e);(X(_.current,t)||X(c.current,t)||X(l.current,t))&&e.preventDefault()}let t=Ci(_.current);return t.addEventListener(`contextmenu`,e),()=>{t.removeEventListener(`contextmenu`,e)}},[l,g,c]),J(`div`,e,{state:{open:h},ref:[_,n],props:[{onContextMenu:C,onTouchStart:w,onTouchMove:T,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Wl})});process.env.NODE_ENV!==`production`&&(gp.displayName=`ContextMenuTrigger`);var _p=mp,vp=gp,yp=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Xf,{children:(0,O.jsx)(Zf,{children:(0,O.jsx)(qf,{ref:n,className:`z-50 min-w-[12rem] overflow-hidden rounded-xl border border-neutral-200 bg-white p-1.5 text-neutral-950 shadow-lg origin-[var(--transform-origin)] transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 ${e||``}`,...t})})}));yp.displayName=`ContextMenuContent`;var bp=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Uf,{ref:n,className:`relative flex cursor-default select-none items-center rounded-lg px-3 py-2 text-sm font-medium outline-none transition-colors data-[highlighted]:bg-neutral-100 data-[highlighted]:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:data-[highlighted]:bg-neutral-800 dark:data-[highlighted]:text-neutral-50 ${e||``}`,...t}));bp.displayName=`ContextMenuItem`;function xp(e){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=jl(!0),m=!!p,g=h(()=>u?.store??new Nl({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,modal:c,disablePointerDismissal:s,nested:m})).current;ud(()=>{r===void 0&&g.state.open===!1&&i===!0&&g.update({open:!0,activeTriggerId:f})}),g.useControlledProp(`openProp`,r),g.useControlledProp(`triggerIdProp`,d),g.useSyncedValues({disablePointerDismissal:s,nested:m,modal:c}),g.useContextCallback(`onOpenChange`,a),g.useContextCallback(`onOpenChangeComplete`,o);let _=g.useState(`payload`);kl({store:g,actionsRef:l,parentContext:p?.store.context,onOpenChange:a,triggerIdProp:d});let v=t.useMemo(()=>({store:g}),[g]);return(0,O.jsx)(Al.Provider,{value:v,children:typeof n==`function`?n({payload:_}):n})}var Sp=xp,Cp=ou,wp=iu,Tp=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(ql,{ref:n,className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm transition-all duration-300 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 ${e||``}`,...t}));Tp.displayName=`DialogOverlay`;var Ep=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsxs)(iu,{children:[(0,O.jsx)(Tp,{}),(0,O.jsxs)(tu,{ref:i,className:`fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-neutral-200 bg-white p-6 shadow-2xl transition-all duration-300 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 sm:rounded-2xl ${e||``}`,...n,children:[t,(0,O.jsxs)(Jl,{className:`absolute right-4 top-4 rounded-full p-1 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:focus:ring-white dark:focus:ring-offset-neutral-950`,children:[(0,O.jsx)(r.X,{className:`size-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ep.displayName=`DialogContent`;var Dp=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(au,{ref:n,className:`text-lg font-semibold leading-none tracking-tight text-neutral-900 dark:text-neutral-50 ${e||``}`,...t}));Dp.displayName=`DialogTitle`;var Op=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Yl,{ref:n,className:`mt-2 text-sm text-neutral-500 dark:text-neutral-400 ${e||``}`,...t}));Op.displayName=`DialogDescription`;var kp=function(e){return e.nestedDrawers=`--nested-drawers`,e.height=`--drawer-height`,e.frontmostHeight=`--drawer-frontmost-height`,e.swipeMovementX=`--drawer-swipe-movement-x`,e.swipeMovementY=`--drawer-swipe-movement-y`,e.snapPointOffset=`--drawer-snap-point-offset`,e.swipeStrength=`--drawer-swipe-strength`,e}({}),Ap=function(e){return e.swipeProgress=`--drawer-swipe-progress`,e}({}),jp={...Gl,...wt},Mp=t.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=jl(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`);return J(`div`,e,{state:{open:s,transitionStatus:o.useState(`transitionStatus`)},ref:[o.context.backdropRef,t],stateAttributesMapping:jp,props:[{role:`presentation`,hidden:!l,style:{pointerEvents:s?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[Ap.swipeProgress]:`0`,[kp.swipeStrength]:`1`}},a],enabled:i||!c})});process.env.NODE_ENV!==`production`&&(Mp.displayName=`DrawerBackdrop`);var Np=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Np.displayName=`DrawerProviderContext`);function Pp(e){let n=t.useContext(Np);if(e===!1&&n===void 0)throw Error(process.env.NODE_ENV===`production`?I(91):`Base UI: DrawerProviderContext is missing. Use <Drawer.Provider>.`);return n}var Fp=function(e){return e[e.open=Il.open]=`open`,e[e.closed=Il.closed]=`closed`,e[e.startingStyle=Il.startingStyle]=`startingStyle`,e[e.endingStyle=Il.endingStyle]=`endingStyle`,e.expanded=`data-expanded`,e.nestedDrawerOpen=`data-nested-drawer-open`,e.nestedDrawerSwiping=`data-nested-drawer-swiping`,e.swipeDismiss=`data-swipe-dismiss`,e.swipeDirection=`data-swipe-direction`,e.swiping=`data-swiping`,e}({}),Ip=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ip.displayName=`DrawerRootContext`);function Lp(e){let n=t.useContext(Ip);if(e===!1&&n===void 0)throw Error(process.env.NODE_ENV===`production`?I(90):`Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.`);return n}function Rp(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function zp(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?Rp(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function Bp(e,t){let n=null,r=1/0;for(let i of t){let t=Math.abs(i.height-e);t<r&&(r=t,n=i)}return n}function Vp(){let{store:e}=jl(),{snapPoints:n,activeSnapPoint:r,setActiveSnapPoint:i,popupHeight:a}=Lp(),o=e.useState(`viewportElement`),[s,c]=t.useState(0),[l,u]=t.useState(16),d=v(()=>{let e=Ci(o).documentElement;o&&c(o.offsetHeight),o||c(e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});x(()=>{if(d(),!o||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(d);return e.observe(o),()=>{e.disconnect()}},[d,o]);let f=t.useMemo(()=>{if(!n||n.length===0||s<=0||a<=0)return[];let e=Math.min(a,s);if(!Number.isFinite(e)||e<=0)return[];let t=n.map(t=>{let n=zp(t,s,l);if(n===null||!Number.isFinite(n))return null;let r=Rp(n,0,e);return{value:t,height:r,offset:Math.max(0,a-r)}}).filter(e=>!!e);if(t.length<=1)return t;let r=[],i=[];for(let e=t.length-1;e>=0;--e){let n=t[e];i.some(e=>Math.abs(e-n.height)<=1)||(i.push(n.height),r.push(n))}return r.reverse(),r},[a,l,n,s]);return{snapPoints:n,activeSnapPoint:r,setActiveSnapPoint:i,popupHeight:a,viewportHeight:s,resolvedSnapPoints:f,activeSnapPointOffset:t.useMemo(()=>{if(r===void 0)return f[0];if(r===null)return;let e=f.find(e=>Object.is(e.value,r));if(e)return e;let t=Math.min(a,s),n=zp(r,s,l);if(!(n===null||!Number.isFinite(n)))return Bp(Rp(n,0,t),f)??void 0},[r,a,f,l,s])?.offset??null}}var Hp=t.createContext(null);process.env.NODE_ENV!==`production`&&(Hp.displayName=`DrawerViewportContext`);function Up(e){let n=t.useContext(Hp);if(e===!1&&n===null)throw Error(process.env.NODE_ENV===`production`?I(92):`Base UI: DrawerViewportContext is missing. Drawer parts must be placed within <Drawer.Viewport>.`);return n}var Wp=!1;function Gp(){Wp||=(typeof CSS<`u`&&`registerProperty`in CSS&&([kp.swipeMovementX,kp.swipeMovementY,kp.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:Ap.swipeProgress,initialValue:`0`},{name:kp.swipeStrength,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Kp={...Gl,...wt,expanded(e){return e?{[Fp.expanded]:``}:null},nestedDrawerOpen(e){return e?{[Fp.nestedDrawerOpen]:``}:null},nestedDrawerSwiping(e){return e?{[Fp.nestedDrawerSwiping]:``}:null},swipeDirection(e){return e?{[Fp.swipeDirection]:e}:null},swiping(e){return e?{[Fp.swiping]:``}:null}},qp=t.forwardRef(function(e,n){let{className:r,finalFocus:i,initialFocus:a,render:o,...s}=e,{store:c}=jl(),{swipeDirection:l,frontmostHeight:u,hasNestedDrawer:d,nestedSwiping:f,nestedSwipeProgressStore:p,onPopupHeightChange:m,notifyParentFrontmostHeight:h,notifyParentHasNestedDrawer:g}=Lp(),_=c.useState(`descriptionElementId`),y=c.useState(`disablePointerDismissal`),b=c.useState(`floatingRootContext`),S=c.useState(`popupProps`),C=c.useState(`modal`),w=c.useState(`mounted`),T=c.useState(`nested`),E=c.useState(`nestedOpenDialogCount`),D=c.useState(`transitionStatus`),k=c.useState(`open`),A=c.useState(`openMethod`),j=c.useState(`titleElementId`),M=c.useState(`role`),N=E>0,P=Up(!0),F=P?.swiping??!1,I=P?.swipeStrength??null,{snapPoints:L,activeSnapPoint:R,activeSnapPointOffset:z}=Vp();$l();let[B,ee]=t.useState(0),V=t.useRef(0),H=v(()=>{let e=c.context.popupRef.current;if(!e)return;let t=e.offsetHeight;if(V.current>0&&u>V.current&&t>V.current)return;if(V.current>0&&d){let e=V.current;ee(e),m(e);return}let n=t;n!==V.current&&(V.current=n,ee(n),m(n))});x(()=>{if(!w){V.current=0,ee(0),m(0);return}let e=c.context.popupRef.current;if(!e||(Gp(),H(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(H);return t.observe(e),()=>{t.disconnect()}},[H,w,N,m,c.context.popupRef]),x(()=>{let e=c.context.popupRef,t=()=>{let t=e.current;if(!t)return;let n=p.getSnapshot();n>0?t.style.setProperty(Ap.swipeProgress,`${n}`):t.style.setProperty(Ap.swipeProgress,`0`)};t();let n=p.subscribe(t);return()=>{n();let t=e.current;t&&t.style.setProperty(Ap.swipeProgress,`0`)}},[p,c.context.popupRef]),t.useEffect(()=>{if(k)return h?.(u),()=>{h?.(0)}},[u,k,h]),t.useEffect(()=>{if(g)return g(k||D===`ending`),()=>{g(!1)}},[g,k,D]),aa({open:k,ref:c.context.popupRef,onComplete(){k&&c.context.onOpenChangeComplete?.(!0)}});let U=a===void 0?c.context.popupRef:a,W={open:k,nested:T,transitionStatus:D,expanded:R===1,nestedDrawerOpen:N,nestedDrawerSwiping:f,swipeDirection:l,swiping:F},G;B&&!(!d&&D!==`ending`)&&(G=`${B}px`);let K=L&&L.length>0&&(l===`down`||l===`up`),te=null;K&&z!==null&&(te=l===`up`?-z:z);let q=P?P.getDragStyles():ve;if(K&&l===`down`){let e=z??0,t=Number.parseFloat(String(q[kp.swipeMovementY]??0)),n=Number.isFinite(t)?e+t:e;if(F&&n<0&&Number.isFinite(t)){let t=-Math.sqrt(Math.abs(n))-e;q={...q,transform:void 0,[kp.swipeMovementY]:`${t}px`}}else q={...q,transform:void 0}}let ne=J(`div`,e,{state:W,props:[S,{"aria-labelledby":j,"aria-describedby":_,role:M,tabIndex:-1,hidden:!w,onKeyDown(e){Gi.has(e.key)&&e.stopPropagation()},style:{...q,[Ap.swipeProgress]:`0`,[kp.nestedDrawers]:E,[kp.height]:G,[kp.snapPointOffset]:typeof te==`number`?`${te}px`:`0px`,[kp.frontmostHeight]:u?`${u}px`:void 0,[kp.swipeStrength]:typeof I==`number`&&Number.isFinite(I)&&I>0?`${I}`:`1`}},s],ref:[n,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:Kp});return(0,O.jsx)(xo,{context:b,openInteractionType:A,disabled:!w,closeOnFocusOut:!y,initialFocus:U,returnFocus:i,modal:C!==!1,restoreFocus:`popup`,children:ne})});process.env.NODE_ENV!==`production`&&(qp.displayName=`DrawerPopup`);var Jp=iu,Yp,Xp;function Zp(e){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null,swipeDirection:m=`down`,snapToSequentialPoints:h=!1,snapPoints:g,snapPoint:_,defaultSnapPoint:y,onSnapPointChange:b}=e,x=v(b),S=Lp(!0),C=S?.onNestedSwipeProgressChange,w=S?.onNestedFrontmostHeightChange,T=S?.onNestedSwipingChange,E=S?.onNestedDrawerPresenceChange,[D,k]=t.useState(0),[A,j]=t.useState(0),[M,N]=t.useState(!1),[P,F]=t.useState(!1),[I]=t.useState(Qp),L=y===void 0?g?.[0]??null:y,R=_!==void 0,[z,B]=p({controlled:_,default:L,name:`Drawer`,state:`snapPoint`}),ee=t.useRef(!1),V=v((e,t)=>{let n=t??Y(`none`);x?.(e,n),!n.isCanceled&&B(e)}),H=t.useMemo(()=>R||!g||g.length===0?z:z===null||!g.some(e=>Object.is(e,z))?L:z,[z,R,L,g]),U=v(e=>{k(e),!ee.current&&e>0&&j(e)}),W=v(e=>{if(e>0){ee.current=!0,j(e);return}ee.current=!1,D>0&&j(D)}),G=v(e=>{N(e)}),K=v(e=>{I.set(e),C?.(e)}),te=v(e=>{F(e),T?.(e)}),q=v((e,t)=>{a?.(e,t),!t.isCanceled&&!e&&g&&g.length>0&&V(L,Y(t.reason,t.event,t.trigger))}),ne=t.useMemo(()=>({swipeDirection:m,snapToSequentialPoints:h,snapPoints:g,activeSnapPoint:H,setActiveSnapPoint:V,frontmostHeight:A,popupHeight:D,hasNestedDrawer:M,nestedSwiping:P,nestedSwipeProgressStore:I,onNestedDrawerPresenceChange:G,onPopupHeightChange:U,onNestedFrontmostHeightChange:W,onNestedSwipingChange:te,onNestedSwipeProgressChange:K,notifyParentFrontmostHeight:w,notifyParentSwipingChange:T,notifyParentSwipeProgressChange:C,notifyParentHasNestedDrawer:E}),[H,A,M,P,I,E,C,T,w,G,W,K,te,U,D,V,g,h,m]),re=typeof n==`function`?e=>(0,O.jsxs)(t.Fragment,{children:[Yp||=(0,O.jsx)($p,{}),n(e)]}):(0,O.jsxs)(t.Fragment,{children:[Xp||=(0,O.jsx)($p,{}),n]});return(0,O.jsx)(Ip.Provider,{value:ne,children:(0,O.jsx)(xp,{open:r,defaultOpen:i,onOpenChange:q,onOpenChangeComplete:o,disablePointerDismissal:s,modal:c,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f,children:re})})}function Qp(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function $p(){let e=dt(),n=Pp(!0),r=jl(!1),i=r.store.useState(`open`),a=r.store.useState(`nestedOpenDialogCount`),o=r.store.useState(`popupElement`),s=a===0;return t.useEffect(()=>{if(!(!n||e==null))return()=>{n.removeDrawer(e)}},[e,n]),t.useEffect(()=>{e!=null&&n?.setDrawerOpen(e,i)},[e,i,n]),t.useEffect(()=>{if(!i||!s||!Nn)return;let e=qt(o).CloseWatcher;if(!e)return;function t(e){r.store.select(`open`)&&r.store.setOpen(!1,Y(Ye,e))}let n=new e;return n.addEventListener(`close`,t),()=>{n.removeEventListener(`close`,t),n.destroy()}},[r.store,s,i,o]),null}var em=ou,tm=Zp,nm=em,rm=Jp,im=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Mp,{ref:n,className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm transition-colors duration-300 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 ${e||``}`,...t}));im.displayName=`DrawerOverlay`;var am=t.forwardRef(({className:e,children:t,...n},r)=>(0,O.jsxs)(Jp,{children:[(0,O.jsx)(im,{}),(0,O.jsxs)(qp,{ref:r,className:`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[2rem] border border-neutral-200 bg-white shadow-2xl max-h-[96%] transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full dark:border-neutral-800 dark:bg-neutral-950 ${e||``}`,...n,children:[(0,O.jsx)(`div`,{className:`mx-auto mt-4 h-1.5 w-12 rounded-full bg-neutral-300 dark:bg-neutral-700`}),(0,O.jsx)(`div`,{className:`flex-1 overflow-auto p-6 text-neutral-900 dark:text-neutral-50`,children:t})]})]}));am.displayName=`DrawerContent`;var om=t.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});process.env.NODE_ENV!==`production`&&(om.displayName=`FieldsetRootContext`);function sm(e=!1){let n=t.useContext(om);if(!n&&!e)throw Error(process.env.NODE_ENV===`production`?I(86):`Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.`);return n}var cm=function(e){let n=ft(),r=e.controlId===void 0?n:e.controlId,[i,a]=t.useState(r),[o,s]=t.useState(e.labelId),[c,l]=t.useState([]),u=h(()=>new Map),{messageIds:d}=Uu(),f=v((e,t)=>{let n=u.current;if(t===void 0){n.delete(e);return}n.set(e,t),a(e=>{if(n.size===0)return;let t;for(let r of n.values()){if(e!==void 0&&r===e)return e;t===void 0&&(t=r)}return t})}),p=t.useCallback(e=>ae({"aria-describedby":d.concat(c).join(` `)||void 0},e),[d,c]),m=t.useMemo(()=>({controlId:i,registerControlId:f,labelId:o,setLabelId:s,messageIds:c,setMessageIds:l,getDescriptionProps:p}),[i,f,o,s,c,l,p]);return(0,O.jsx)(Hu.Provider,{value:m,children:e.children})};process.env.NODE_ENV!==`production`&&(cm.displayName=`LabelableProvider`);var lm=Object.keys(ku);function um(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of lm)n!==`valid`&&(n===`valueMissing`&&(t=e[n]),e[n]&&(t=!1));return t}function dm(e){let{formRef:n,clearErrors:r}=Bu(),{setValidityData:i,validate:a,validityData:o,validationDebounceTime:s,invalid:c,markedDirtyRef:l,state:u,name:d,shouldValidateOnChange:f}=e,{controlId:p,getDescriptionProps:m}=Uu(),h=pa(),g=t.useRef(null),_=v(async(e,t=!1)=>{let r=g.current;if(!r)return;if(t){if(u.valid!==!1)return;let t=r.validity;if(!t.valueMissing){let t={value:e,state:{...ku,valid:!0},error:``,errors:[],initialValue:o.initialValue};if(r.setCustomValidity(``),p){let e=n.current.fields.get(p);e&&n.current.fields.set(p,{...e,...Ru(t,!1)})}i(t);return}let a=lm.reduce((e,n)=>(e[n]=t[n],e),{});if(!a.valid&&!um(a))return}function s(e){let t=lm.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of lm)if(e!==`valid`){if(e===`valueMissing`&&t[e])n=!0;else if(t[e])return t}return n&&!l.current&&(t.valid=!0,t.valueMissing=!1),t}h.clear();let d=null,m=[],_=s(r),v,y=f();if(r.validationMessage&&!y)v=r.validationMessage,m=[r.validationMessage];else{let t=a(e,Array.from(n.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));d=typeof t==`object`&&t&&`then`in t?await t:t,d===null?y&&(r.setCustomValidity(``),_.customError=!1,r.validationMessage?(v=r.validationMessage,m=[r.validationMessage]):r.validity.valid&&!_.valid&&(_.valid=!0)):(_.valid=!1,_.customError=!0,Array.isArray(d)?(m=d,r.setCustomValidity(d.join(`
27
+ `))):d&&(m=[d],r.setCustomValidity(d)))}let b={value:e,state:_,error:v??(Array.isArray(d)?d[0]:d??``),errors:m,initialValue:o.initialValue};if(p){let e=n.current.fields.get(p);e&&n.current.fields.set(p,{...e,...Ru(b,c)})}i(b)}),y=t.useCallback((e={})=>ae(m,u.valid===!1?{"aria-invalid":!0}:ve,e),[m,u.valid]),b=t.useCallback((e={})=>ae({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(r(d),!f()){_(e.currentTarget.value,!0);return}let t=e.currentTarget;if(t.value===``){_(t.value);return}h.clear(),s?h.start(s,()=>{_(t.value)}):_(t.value)}},y(e)),[y,r,d,h,_,s,f]);return t.useMemo(()=>({getValidationProps:y,getInputValidationProps:b,inputRef:g,commit:_}),[y,b,_])}var fm=t.forwardRef(function(e,n){let{errors:r,validationMode:i,submitAttemptedRef:a}=Bu(),{render:o,className:s,validate:c,validationDebounceTime:l=0,validationMode:u=i,name:d,disabled:f=!1,invalid:p,dirty:m,touched:h,actionsRef:g,..._}=e,{disabled:y}=sm(),b=v(c||(()=>null)),x=y||f,[S,C]=t.useState(!1),[w,T]=t.useState(!1),[E,D]=t.useState(!1),[k,A]=t.useState(!1),j=m??w,M=h??S,N=t.useRef(!1),P=v(e=>{m===void 0&&(e&&(N.current=!0),T(e))}),F=v(e=>{h===void 0&&C(e)}),I=v(()=>u===`onChange`||u===`onSubmit`&&a.current),L=!!d&&Object.hasOwn(r,d)&&r[d]!==void 0,R=p===!0||L,[z,B]=t.useState({state:ku,error:``,errors:[],value:null,initialValue:null}),ee=!R&&z.state.valid,V=t.useMemo(()=>({disabled:x,touched:M,dirty:j,valid:ee,filled:E,focused:k}),[x,M,j,ee,E,k]),H=dm({setValidityData:B,validate:b,validityData:z,validationDebounceTime:l,invalid:R,markedDirtyRef:N,state:V,name:d,shouldValidateOnChange:I}),U=t.useCallback(()=>{N.current=!0,H.commit(z.value)},[H,z]);t.useImperativeHandle(g,()=>({validate:U}),[U]);let W=t.useMemo(()=>({invalid:R,name:d,validityData:z,setValidityData:B,disabled:x,touched:M,setTouched:F,dirty:j,setDirty:P,filled:E,setFilled:D,focused:k,setFocused:A,validate:b,validationMode:u,validationDebounceTime:l,shouldValidateOnChange:I,state:V,markedDirtyRef:N,validation:H}),[R,d,z,x,M,F,j,P,E,D,k,A,b,u,l,I,V,H]),G=J(`div`,e,{ref:n,state:V,props:_,stateAttributesMapping:Mu});return(0,O.jsx)(Pu.Provider,{value:W,children:G})});process.env.NODE_ENV!==`production`&&(fm.displayName=`FieldRootInner`);var pm=t.forwardRef(function(e,t){return(0,O.jsx)(cm,{children:(0,O.jsx)(fm,{...e,ref:t})})});process.env.NODE_ENV!==`production`&&(pm.displayName=`FieldRoot`);var mm=t.forwardRef(function(e,n){let{render:r,className:i,id:a,nativeLabel:o=!0,...s}=e,c=Fu(!1),{labelId:l}=Uu(),u=t.useRef(null),d=Ud({id:l??a,native:o});return process.env.NODE_ENV!==`production`&&t.useEffect(()=>{if(!u.current)return;let e=u.current.tagName===`LABEL`;o?e||vn(`<Field.Label> expected a <label> element because the \`nativeLabel\` prop is true. Rendering a non-<label> disables native label association, so \`htmlFor\` will not work. Use a real <label> in the \`render\` prop, or set \`nativeLabel\` to \`false\`.${st.captureOwnerStack?.()||``}`):e&&vn(`<Field.Label> expected a non-<label> element because the \`nativeLabel\` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the \`render\` prop, or set \`nativeLabel\` to \`true\`.${st.captureOwnerStack?.()||``}`)},[o]),J(`label`,e,{ref:[n,u],state:c.state,props:[d,s],stateAttributesMapping:Mu})});process.env.NODE_ENV!==`production`&&(mm.displayName=`FieldLabel`);var hm={...Mu,...wt},gm=t.forwardRef(function(e,n){let{render:r,id:i,className:a,match:o,...s}=e,c=ft(i),{validityData:l,state:u,name:d}=Fu(!1),{setMessageIds:f}=Uu(),{errors:p}=Bu(),m=d?p[d]:null,h=!1;h=m||o===!0?!0:o?!!l.state[o]:l.state.valid===!1;let{mounted:g,transitionStatus:_,setMounted:v}=Et(h);x(()=>{if(!(!h||!c))return f(e=>e.concat(c)),()=>{f(e=>e.filter(e=>e!==c))}},[h,c,f]);let y=t.useRef(null),[b,S]=t.useState(null),[C,w]=t.useState(null),T=m||(l.errors.length>1?(0,O.jsx)(`ul`,{children:l.errors.map(e=>(0,O.jsx)(`li`,{children:e},e))}):l.error),E=l.error;m==null?l.errors.length>1&&(E=JSON.stringify(l.errors)):E=Array.isArray(m)?JSON.stringify(m):m,h&&E!==C&&(w(E),S(T)),aa({open:h,ref:y,onComplete(){h||v(!1)}});let D={...u,transitionStatus:_},k=J(`div`,e,{ref:[n,y],state:D,props:[{id:c,children:h?T:b},s],stateAttributesMapping:hm,enabled:g});return g?k:null});process.env.NODE_ENV!==`production`&&(gm.displayName=`FieldError`);var _m=t.forwardRef(function(e,t){let{render:n,id:r,className:i,...a}=e,o=ft(r),s=Fu(!1),{setMessageIds:c}=Uu();return x(()=>{if(o)return c(e=>e.concat(o)),()=>{c(e=>e.filter(e=>e!==o))}},[o,c]),J(`p`,e,{ref:t,state:s.state,props:[{id:o},a],stateAttributesMapping:Mu})});process.env.NODE_ENV!==`production`&&(_m.displayName=`FieldDescription`);var vm=t.forwardRef(function(e,n){let{render:r,className:i,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,...f}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:S,validationMode:C,validation:w}=Fu(),T=g||c,E=h??o,D={...m,disabled:T},{labelId:O}=Uu(),k=jd({id:a});x(()=>{let e=s!=null;w.inputRef.current?.value||e&&s!==``?S(!0):e&&s===``&&S(!1)},[w.inputRef,S,s]);let A=t.useRef(null);x(()=>{d&&A.current===Gn(Ci(A.current))&&b(!0)},[d,b]);let[j]=p({controlled:s,default:u,name:`FieldControl`,state:`value`}),M=s!==void 0,N=M?j:void 0;return Vu({id:k,name:E,commit:w.commit,value:N,getValue:()=>w.inputRef.current?.value,controlRef:w.inputRef}),J(`input`,e,{ref:[n,A],state:D,props:[{id:k,disabled:T,name:E,ref:w.inputRef,"aria-labelledby":O,autoFocus:d,...M?{value:N}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,Y(Ne,e.nativeEvent)),v(t!==y.initialValue),S(t!==``)},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),C===`onBlur`&&w.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),w.commit(e.currentTarget.value))}},w.getInputValidationProps(),f],stateAttributesMapping:Mu})});process.env.NODE_ENV!==`production`&&(vm.displayName=`FieldControl`);var ym=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(pm,{ref:n,className:`flex flex-col gap-2 ${e||``}`,...t}));ym.displayName=`Field`;var bm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(mm,{ref:n,className:`text-sm font-medium leading-none text-neutral-900 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:text-neutral-50 ${e||``}`,...t}));bm.displayName=`FieldLabel`;var xm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(_m,{ref:n,className:`text-[0.8rem] text-neutral-500 dark:text-neutral-400 ${e||``}`,...t}));xm.displayName=`FieldDescription`;var Sm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(gm,{ref:n,className:`text-[0.8rem] font-medium text-red-500 dark:text-red-500 ${e||``}`,...t}));Sm.displayName=`FieldError`;var Cm=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,...o}=e,[s,c]=t.useState(void 0),l=J(`fieldset`,e,{ref:n,state:{disabled:a},props:[{"aria-labelledby":s},o]}),u=t.useMemo(()=>({legendId:s,setLegendId:c,disabled:a}),[s,c,a]);return(0,O.jsx)(om.Provider,{value:u,children:l})});process.env.NODE_ENV!==`production`&&(Cm.displayName=`FieldsetRoot`);var wm=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{disabled:o,setLegendId:s}=sm(),c=ft(i);return x(()=>(s(c),()=>{s(void 0)}),[s,c]),J(`div`,e,{state:{disabled:o??!1},ref:t,props:[{id:c},a]})});process.env.NODE_ENV!==`production`&&(wm.displayName=`FieldsetLegend`);var Tm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Cm,{ref:n,className:`m-0 p-0 ${e||``}`,...t}));Tm.displayName=`Fieldset`;var Em=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(wm,{ref:n,className:`mb-2 text-base font-semibold leading-none text-neutral-900 dark:text-neutral-50 ${e||``}`,...t}));Em.displayName=`FieldsetLegend`;var Dm=t.forwardRef(function(e,n){let{render:r,className:i,validationMode:a=`onSubmit`,errors:o,onSubmit:s,onFormSubmit:c,actionsRef:l,...u}=e,d=t.useRef({fields:new Map}),f=t.useRef(!1),p=t.useRef(!1),m=v(e=>{e&&(e.focus(),e.tagName===`INPUT`&&e.select())}),[h,g]=t.useState(o);Dl(o,()=>{g(o)}),t.useEffect(()=>{if(!f.current)return;f.current=!1;let e=Array.from(d.current.fields.values()).filter(e=>e.validityData.state.valid===!1);e.length&&m(e[0].controlRef.current)},[h,m]);let _=t.useCallback(e=>{let t=Array.from(d.current.fields.values());if(e){let n=t.find(t=>t.name===e);n&&n.validate(!1)}else t.forEach(e=>{e.validate(!1)})},[]);t.useImperativeHandle(l,()=>({validate:_}),[_]);let y=J(`form`,e,{ref:n,props:[{noValidate:!0,onSubmit(e){p.current=!0;let t=Array.from(d.current.fields.values());t.forEach(e=>{e.validate()}),t=Array.from(d.current.fields.values());let n=t.filter(e=>!e.validityData.state.valid);n.length?(e.preventDefault(),m(n[0].controlRef.current)):(f.current=!0,s?.(e),c&&(e.preventDefault(),c(t.reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}),it(Ne,e.nativeEvent))))}},u]}),b=v(e=>{if(e&&h&&ve.hasOwnProperty.call(h,e)){let t={...h};delete t[e],g(t)}}),x=t.useMemo(()=>({formRef:d,validationMode:a,errors:h??ve,clearErrors:b,submitAttemptedRef:p}),[d,a,h,b]);return(0,O.jsx)(zu.Provider,{value:x,children:y})});process.env.NODE_ENV!==`production`&&(Dm.displayName=`Form`);var Om=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Dm,{ref:n,className:`space-y-6 ${e||``}`,...t}));Om.displayName=`Form`;var km=t.forwardRef(function(e,t){return(0,O.jsx)(vm,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(km.displayName=`Input`);var Am=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(km,{ref:n,className:`flex h-11 w-full rounded-xl border border-neutral-200 bg-white px-4 py-2 text-sm text-neutral-900 placeholder:text-neutral-400 shadow-sm transition-all duration-200 focus:border-blue-500 focus:outline-none focus:ring-4 focus:ring-blue-500/10 disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-500 hover:border-neutral-300 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 dark:placeholder:text-neutral-500 dark:focus:border-blue-500 dark:focus:ring-blue-500/20 dark:hover:border-neutral-700 ${e||``}`,...t}));Am.displayName=`Input`;var jm=ap,Mm=dp,Nm=t.forwardRef(({className:e,sideOffset:t=8,...n},r)=>(0,O.jsx)(Xf,{children:(0,O.jsx)(Zf,{sideOffset:t,children:(0,O.jsx)(qf,{ref:r,className:`z-50 min-w-[12rem] overflow-hidden rounded-xl border border-neutral-200 bg-white p-1.5 text-neutral-950 shadow-lg origin-[var(--transform-origin)] transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 ${e||``}`,...n})})}));Nm.displayName=`MenuContent`;var Pm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Uf,{ref:n,className:`relative flex cursor-default select-none items-center rounded-lg px-3 py-2 text-sm font-medium outline-none transition-colors data-[highlighted]:bg-neutral-100 data-[highlighted]:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:data-[highlighted]:bg-neutral-800 dark:data-[highlighted]:text-neutral-50 ${e||``}`,...t}));Pm.displayName=`MenuItem`;var Fm=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Of,{ref:n,className:`-mx-1.5 my-1.5 h-px bg-neutral-100 dark:bg-neutral-800 ${e||``}`,...t}));Fm.displayName=`MenuSeparator`;var Im=0,Lm=class e extends fa{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==Im&&(clearInterval(this.currentId),this.currentId=Im)}};function Rm(){let e=h(Lm.create).current;return mt(e.disposeEffect),e}var zm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(zm.displayName=`NumberFieldRootContext`);function Bm(){let e=t.useContext(zm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(43):`Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.`);return e}var Vm={inputValue:()=>null,value:()=>null,...Mu},Hm=new Map;function Um(e,t){let n=JSON.stringify({locale:e,options:t}),r=Hm.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return Hm.set(n,i),i}function Wm(e,t,n){return e==null?``:Um(t,n).format(e)}function Gm(e,t,n){return Wm(e,t,{...n,maximumFractionDigits:20})}function Km(e,t,n){return e==null?``:n?Wm(e,t,n):Wm(e/100,t,{style:`percent`})}var qm=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],Jm={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},Ym=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],Xm=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],Zm=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],Qm=[`%`,`٪`,`%`,`﹪`],$m=[`‰`,`؉`],eh=[`−`,`-`,`‒`,`–`,`—`,`﹣`],th=[`+`,`﹢`],nh=RegExp(`[${Ym.join(``)}]`,`g`),rh=RegExp(`[${Xm.join(``)}]`,`g`),ih=RegExp(`[${Zm.join(``)}]`,`g`),ah=RegExp(`[${qm.join(``)}]`,`g`),oh=RegExp(`[${Qm.join(``)}]`),sh=RegExp(`[${$m.join(``)}]`),ch=/[٠١٢٣٤٥٦٧٨٩]/,lh=/[۰۱۲۳۴۵۶۷۸۹]/,uh=/[零〇一二三四五六七八九]/,dh=RegExp(`[${Zm.join(``)}]`),fh=[`.`,`,`,`.`,`,`,`٫`,`٬`],ph=/\p{Zs}/u,mh=[`+`,...th],hh=[`-`,...eh],gh=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),_h=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),vh=e=>`[${e.map(_h).join(``)}]`,yh=vh([`-`].concat(eh)),bh=vh([`+`].concat(th)),xh=new RegExp(yh,`gu`),Sh=new RegExp(bh,`gu`),Ch=new RegExp(yh),wh=new RegExp(bh);function Th(e,t){let n=Um(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),Um(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Eh(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(xh,`-`).replace(Sh,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(ch.test(r)||lh.test(r)?s=`ar`:uh.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Th(s,n),d=Um(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>gh(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(gh(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(gh(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(gh(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:nh,replacement:e=>String(Ym.indexOf(e))},{regex:rh,replacement:e=>String(Xm.indexOf(e))},{regex:ih,replacement:e=>String(Zm.indexOf(e))},{regex:ah,replacement:e=>Jm[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=oh.test(e)||v===`percent`;return sh.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Dh=1e-10;function Oh(e){let t=Um(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function kh(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Ah(e,t){let{maximumFractionDigits:n}=Oh(t);return kh(e,n)}function jh(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Dh*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Mh(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?Rp(e,n,r):e;if(t!=null&&o){if(t===0)return Ah(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Ah(jh(l,e,t,s?`nearest`:`directional`),a)}return Ah(l,a)}var Nh=t.forwardRef(function(e,n){let{id:r,min:i,max:a,smallStep:o=.1,step:s=1,largeStep:c=10,required:l=!1,disabled:u=!1,readOnly:d=!1,name:f,defaultValue:m,value:h,onValueChange:g,onValueCommitted:_,allowWheelScrub:y=!1,snapOnStep:b=!1,allowOutOfRange:S=!1,format:C,locale:w,render:T,className:E,inputRef:D,...k}=e,{setDirty:A,validityData:j,disabled:M,setFilled:N,invalid:P,name:F,state:I,validation:L,shouldValidateOnChange:R}=Fu(),B=M||u,ee=F??f,V=s===`any`?1:s,[H,U]=t.useState(!1),W=i??-(2**53-1),G=a??2**53-1,K=i??0,te=C?.style,q=t.useRef(null),ne=z(D,L.inputRef),re=jd({id:r}),[ie,ae]=p({controlled:h,default:m,name:`NumberField`,state:`value`}),oe=ie??null,se=Aa(oe);x(()=>{N(oe!==null)},[N,oe]);let ce=Nc(),le=Aa(C),ue=t.useRef(!1),de=v((e,t)=>{ue.current=!1,_?.(e,t)}),fe=pa(),pe=Rm(),me=pa(),he=t.useRef(!1),ge=t.useRef(0),_e=t.useRef(!0),ve=t.useRef(null),ye=t.useRef(()=>{}),[be,xe]=t.useState(()=>h===void 0?Wm(oe,w,C):Ph(oe,w,C)),[Se,Ce]=t.useState(`numeric`),we=v(()=>{let{decimal:e,group:t,currency:n,literal:r}=Th(w,C),i=new Set;fh.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),ph.test(t)&&i.add(` `));let a=te===`percent`||te===`unit`&&C?.unit===`percent`,o=te===`percent`||te===`unit`&&C?.unit===`permille`;return a&&Qm.forEach(e=>i.add(e)),o&&$m.forEach(e=>i.add(e)),te===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),ph.test(r)&&i.add(` `)),mh.forEach(e=>i.add(e)),W<0&&hh.forEach(e=>i.add(e)),i}),Te=v(e=>e?.altKey?o:e?.shiftKey?c:V),Ee=v((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!S||!(i===`input-change`||i===`input-blur`||i===`input-paste`||i===`input-clear`||i===`none`),o=Mh(e,{step:r?Te(n)*r:void 0,format:le.current,minWithDefault:W,maxWithDefault:G,minWithZeroDefault:K,snapOnStep:b,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==oe||s&&(e!==oe||_e.current===!1);if(c){if(ve.current=o,g?.(o,t),t.isCanceled)return c;ae(o),A(o!==j.initialValue),ue.current=!0}return _e.current&&xe(Wm(o,w,C)),ce(),c}),De=v((e,{direction:t,currentValue:n,event:r,reason:a})=>{let o=n??se.current;return Ee(typeof o==`number`?o+e*t:Math.max(0,i??0),Y(a,r,void 0,{direction:t}))}),Oe=v(()=>{me.clear(),fe.clear(),pe.clear(),ye.current(),ge.current=0}),ke=v((e,t)=>{if(Oe(),!q.current)return;let n=qt(q.current);function r(e){e.preventDefault()}n.addEventListener(`contextmenu`,r),ye.current=()=>{n.removeEventListener(`contextmenu`,r)},n.addEventListener(`pointerup`,t=>{he.current=!1,Oe(),de(ve.current??se.current,it(e?Be:Ve,t))},{once:!0});function i(){return De(Te(t)??1,{direction:e?1:-1,event:t,reason:e?`increment-press`:`decrement-press`})}if(!i()){Oe();return}fe.start(400,()=>{pe.start(60,()=>{i()||Oe()})})});x(function(){if(!_e.current)return;let e=h===void 0?Wm(oe,w,C):Ph(oe,w,C);e!==be&&xe(e)}),x(function(){if(!An)return;let e=`text`;W>=0&&(e=`decimal`),Ce(e)},[W,te]),t.useEffect(()=>()=>Oe(),[Oe]),t.useEffect(function(){let e=q.current;if(B||d||!y||!e)return;function t(e){e.ctrlKey||Ci(q.current).activeElement!==q.current||(e.preventDefault(),De(Te(e)??1,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`}))}return e.addEventListener(`wheel`,t),()=>{e.removeEventListener(`wheel`,t)}},[y,De,B,d,c,V,Te]);let Ae=t.useMemo(()=>({...I,disabled:B,readOnly:d,required:l,value:oe,inputValue:be,scrubbing:H}),[I,B,d,l,oe,be,H]),je=t.useMemo(()=>({inputRef:q,inputValue:be,value:oe,startAutoChange:ke,stopAutoChange:Oe,minWithDefault:W,maxWithDefault:G,disabled:B,readOnly:d,id:re,setValue:Ee,incrementValue:De,getStepAmount:Te,allowInputSyncRef:_e,formatOptionsRef:le,valueRef:se,lastChangedValueRef:ve,hasPendingCommitRef:ue,isPressedRef:he,intentionalTouchCheckTimeout:me,movesAfterTouchRef:ge,name:ee,required:l,invalid:P,inputMode:Se,getAllowedNonNumericKeys:we,min:i,max:a,setInputValue:xe,locale:w,isScrubbing:H,setIsScrubbing:U,state:Ae,onValueCommitted:de}),[q,be,oe,ke,Oe,W,G,B,d,re,Ee,De,Te,le,se,me,ee,l,P,Se,we,i,a,xe,w,H,Ae,de]),Me=J(`div`,e,{ref:n,state:Ae,props:k,stateAttributesMapping:Vm});return(0,O.jsxs)(zm.Provider,{value:je,children:[Me,(0,O.jsx)(`input`,{...L.getInputValidationProps({onFocus(){q.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=Y(Ne,e.nativeEvent);A(n!==j.initialValue),Ee(n,r),R()&&L.commit(n)}}),ref:ne,type:`number`,name:ee,value:oe??``,min:i,max:a,step:s,disabled:B,required:l,"aria-hidden":!0,tabIndex:-1,style:ee?Pa:Na})]})});process.env.NODE_ENV!==`production`&&(Nh.displayName=`NumberFieldRoot`);function Ph(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?Wm(e,t,n):Gm(e,t,n)}function Fh(e){return e===`touch`||e===`pen`}function Ih(e){let{allowInputSyncRef:n,disabled:r,formatOptionsRef:i,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,intentionalTouchCheckTimeout:u,isIncrement:d,isPressedRef:f,locale:p,movesAfterTouchRef:m,readOnly:h,setValue:g,startAutoChange:_,stopAutoChange:v,valueRef:y,lastChangedValueRef:b,onValueCommitted:x}=e,S=t.useRef({x:0,y:0}),C=t.useRef(!1),w=t.useRef(!1),T=t.useRef(``),E=d?`increment-press`:`decrement-press`;function D(e){n.current=!0;let t=Eh(l,p,i.current);t!==null&&(y.current=t,g(t,Y(E,e,void 0,{direction:d?1:-1})))}return{disabled:r,"aria-readonly":h||void 0,"aria-label":d?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},onTouchStart(){C.current=!0},onTouchEnd(){C.current=!1},onClick(e){let t=r||h;if(e.defaultPrevented||t||(Fh(T.current)?w.current:e.detail!==0))return;D(e.nativeEvent);let n=a(e)??1,i=y.current;s(n,{direction:d?1:-1,event:e.nativeEvent,reason:E});let o=b.current??y.current;o!==i&&x(o,it(E,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||h||!t||r||(T.current=e.pointerType,w.current=!1,f.current=!0,S.current={x:e.clientX,y:e.clientY},D(e.nativeEvent),Fh(e.pointerType)?u.start(50,()=>{let t=m.current;m.current=0,f.current&&t!=null&&t<3?(_(d,e),w.current=!0):(w.current=!1,v())}):(e.preventDefault(),c.current?.focus(),_(d,e)))},onPointerUp(e){Fh(e.pointerType)&&(f.current=!1)},onPointerMove(e){if(r||h||!Fh(e.pointerType)||!f.current)return;m.current!=null&&(m.current+=1);let{x:t,y:n}=S.current,i=t-e.clientX,a=n-e.clientY;i**2+a**2>8**2&&v()},onMouseEnter(e){let t=r||h;e.defaultPrevented||t||!f.current||C.current||Fh(T.current)||_(d,e)},onMouseLeave(){C.current||v()},onMouseUp(){C.current||v()}}}var Lh=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,intentionalTouchCheckTimeout:g,isPressedRef:_,locale:v,maxWithDefault:y,movesAfterTouchRef:b,readOnly:x,setValue:S,startAutoChange:C,state:w,stopAutoChange:T,value:E,valueRef:D,lastChangedValueRef:O,onValueCommitted:k}=Bm(),A=a||l||E!=null&&E>=y,j=Ih({isIncrement:!0,inputRef:m,startAutoChange:C,stopAutoChange:T,inputValue:h,disabled:A,readOnly:x,id:f,setValue:S,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:D,isPressedRef:_,intentionalTouchCheckTimeout:g,movesAfterTouchRef:b,locale:v,lastChangedValueRef:O,onValueCommitted:k}),{getButtonProps:M,buttonRef:N}=Sn({disabled:A,native:o,focusableWhenDisabled:!0}),P=t.useMemo(()=>({...w,disabled:A}),[w,A]);return J(`button`,e,{ref:[n,N],state:P,props:[j,s,M],stateAttributesMapping:Vm})});process.env.NODE_ENV!==`production`&&(Lh.displayName=`NumberFieldIncrement`);var Rh=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:u,getStepAmount:d,id:f,incrementValue:p,inputRef:m,inputValue:h,intentionalTouchCheckTimeout:g,isPressedRef:_,minWithDefault:v,movesAfterTouchRef:y,readOnly:b,setValue:x,startAutoChange:S,state:C,stopAutoChange:w,value:T,valueRef:E,locale:D,lastChangedValueRef:O,onValueCommitted:k}=Bm(),A=a||l||T!=null&&T<=v,j=Ih({isIncrement:!1,inputRef:m,startAutoChange:S,stopAutoChange:w,inputValue:h,disabled:A,readOnly:b,id:f,setValue:x,getStepAmount:d,incrementValue:p,allowInputSyncRef:c,formatOptionsRef:u,valueRef:E,isPressedRef:_,intentionalTouchCheckTimeout:g,movesAfterTouchRef:y,locale:D,lastChangedValueRef:O,onValueCommitted:k}),{getButtonProps:M,buttonRef:N}=Sn({disabled:A,native:o,focusableWhenDisabled:!0}),P=t.useMemo(()=>({...C,disabled:A}),[C,A]);return J(`button`,e,{ref:[n,N],state:P,props:[j,s,M],stateAttributesMapping:Vm})});process.env.NODE_ENV!==`production`&&(Rh.displayName=`NumberFieldDecrement`);var zh={...Mu,...Vm},Bh=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),Vh=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{allowInputSyncRef:o,disabled:s,formatOptionsRef:c,getAllowedNonNumericKeys:l,getStepAmount:u,id:d,incrementValue:f,inputMode:p,inputValue:m,max:h,min:g,name:_,readOnly:v,required:y,setValue:b,state:x,setInputValue:S,locale:C,inputRef:w,value:T,onValueCommitted:E,lastChangedValueRef:D,hasPendingCommitRef:O,valueRef:k}=Bm(),{clearErrors:A}=Bu(),{validationMode:j,setTouched:M,setFocused:N,invalid:P,shouldValidateOnChange:F,validation:I}=Fu(),{labelId:L}=Uu(),R=t.useRef(!1),z=t.useRef(!1);return Vu({id:d,commit:I.commit,value:T,controlRef:w,name:_,getValue:()=>T??null}),Dl(T,e=>{let t=F();if(A(_),t&&I.commit(T),!(e===T||t)){if(z.current){z.current=!1;return}I.commit(T,!0)}}),J(`input`,e,{ref:[n,w],state:x,props:[{id:d,required:y,disabled:s,readOnly:v,inputMode:p,value:m,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":P||void 0,"aria-labelledby":L,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||v||s||(N(!0),R.current))return;R.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||v||s)return;M(!0),N(!1);let t=!o.current,n=O.current;if(o.current=!0,m.trim()===``){b(null,Y(Ue,e.nativeEvent)),j===`onBlur`&&I.commit(null),E(null,it(Ue,e.nativeEvent));return}let r=c.current,i=Eh(m,C,r);if(i===null)return;let a=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,l=r?.maximumFractionDigits,u=a&&typeof l==`number`?Number(i.toFixed(l)):i,d=it(We,e.nativeEvent),f=T!==u,p=t||f||n;j===`onBlur`&&I.commit(u),f&&(z.current=!0,b(u,Y(We,e.nativeEvent))),p&&E(u,d);let h=Wm(u,C,r),g=Gm(i,C,r);!(!a&&i===T&&m===g)&&m!==h&&S(h)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.target.value;if(t.trim()===``){S(t),b(null,Y(Ue,e.nativeEvent));return}let n=l();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=ch.test(e),i=uh.test(e),a=lh.test(e),o=dh.test(e),s=Ch.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Eh(t,C,c.current);S(t),r!==null&&b(r,Y(He,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||v||s)return;let t=e.nativeEvent;o.current=!0;let n=l(),r=n.has(e.key),{decimal:i,currency:a,percentSign:d}=Th(C,c.current),p=e.currentTarget.selectionStart,_=e.currentTarget.selectionEnd,y=p===0&&_===m.length,x=e=>p!=null&&_!=null&&e>=p&&e<_;if(Ch.test(e.key)&&Array.from(n).some(e=>Ch.test(e||``))){let e=m.search(xh),t=e!=null&&e!==-1&&x(e);r=!(Ch.test(m)||wh.test(m))||y||t}if(wh.test(e.key)&&Array.from(n).some(e=>wh.test(e||``))){let e=m.search(Sh),t=e!=null&&e!==-1&&x(e);r=!(Ch.test(m)||wh.test(m))||y||t}[i,a,d].forEach(t=>{if(e.key===t){let e=x(m.indexOf(t));r=!m.includes(t)||y||e}});let S=e.key>=`0`&&e.key<=`9`,w=ch.test(e.key),T=uh.test(e.key),O=dh.test(e.key),A=Bh.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||S||w||O||T||A)return;let j=Eh(m,C,c.current),M=u(e)??1;nr(e);let N=it(Ze,t);e.key===`ArrowUp`?(f(M,{direction:1,currentValue:j,event:t,reason:Ze}),E(D.current??k.current,N)):e.key===`ArrowDown`?(f(M,{direction:-1,currentValue:j,event:t,reason:Ze}),E(D.current??k.current,N)):e.key===`Home`&&g!=null?(b(g,Y(Ze,t)),E(D.current??k.current,N)):e.key===`End`&&h!=null&&(b(h,Y(Ze,t)),E(D.current??k.current,N))},onPaste(e){if(e.defaultPrevented||v||s)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),n=Eh(t,C,c.current);n!==null&&(o.current=!1,b(n,Y(Ge,e.nativeEvent)),S(t))}},I.getValidationProps(),a],stateAttributesMapping:zh})});process.env.NODE_ENV!==`production`&&(Vh.displayName=`NumberFieldInput`);var Hh=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Hh.displayName=`NumberFieldScrubAreaContext`);function Uh(e,t){let n=qt(t),r=t.getBoundingClientRect();if(r&&e!=null)return{x:r.left-e/2,y:r.top-e/2,width:r.right+e/2,height:r.bottom+e/2};let i=n.visualViewport;return i?{x:i.offsetLeft,y:i.offsetTop,width:i.offsetLeft+i.width,height:i.offsetTop+i.height}:{x:0,y:0,width:n.document.documentElement.clientWidth,height:n.document.documentElement.clientHeight}}function Wh(e,t){let n=qt(e).visualViewport;if(!n)return()=>{};function r(){n&&(t.current=n.scale)}return r(),n.addEventListener(`resize`,r),()=>{n.removeEventListener(`resize`,r)}}var Gh=t.forwardRef(function(e,r){let{render:i,className:a,direction:o=`horizontal`,pixelSensitivity:s=2,teleportDistance:c,...l}=e,{state:u,setIsScrubbing:d,disabled:f,readOnly:p,inputRef:m,incrementValue:h,getStepAmount:g,onValueCommitted:_,lastChangedValueRef:y,valueRef:b}=Bm(),x=t.useRef(null),S=t.useRef(!1),C=t.useRef(!1),w=t.useRef(null),T=t.useRef(null),E=t.useRef({x:0,y:0}),D=t.useRef(1),k=pa(),[A,j]=t.useState(!1),[M,N]=t.useState(!1),[P,F]=t.useState(!1);t.useEffect(()=>{if(!(!P||!T.current))return Wh(T.current,D)},[P]);function I(e,t){T.current&&(T.current.style.transform=`translate3d(${e}px,${t}px,0) scale(${1/D.current})`)}let L=v(({movementX:e,movementY:t})=>{let n=T.current,r=x.current;if(!n||!r)return;let i=Uh(c,r),a=E.current,o={x:Math.round(a.x+e),y:Math.round(a.y+t)},s=n.offsetWidth,l=n.offsetHeight;o.x+s/2<i.x?o.x=i.width-s/2:o.x+s/2>i.width&&(o.x=i.x-s/2),o.y+l/2<i.y?o.y=i.height-l/2:o.y+l/2>i.height&&(o.y=i.y-l/2),E.current=o,I(o.x,o.y)}),R=v((e,{clientX:t,clientY:r})=>{n.flushSync(()=>{F(e),d(e)});let i=T.current;if(!i||!e)return;let a={x:t-i.offsetWidth/2,y:r-i.offsetHeight/2};E.current=a,I(a.x,a.y)});t.useEffect(function(){if(!m.current||f||p||!P)return;let e=0;function t(e){function t(){try{Ci(x.current).exitPointerLock()}catch{}finally{S.current=!1,R(!1,e),_(y.current??b.current,it(Qe,e)),!C.current&&w.current!=null&&w.current.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0})),C.current=!1,w.current=null}}jn?k.start(20,t):t()}function n(t){if(!S.current)return;t.preventDefault(),L(t);let{movementX:n,movementY:r}=t;if(e+=o===`vertical`?r:n,Math.abs(e)>=s){e=0,C.current=!0;let i=(o===`vertical`?-r:n)*(g(t)??1);i!==0&&h(Math.abs(i),{direction:i>=0?1:-1,event:t,reason:Qe})}}let r=qt(m.current);return r.addEventListener(`pointerup`,t,!0),r.addEventListener(`pointermove`,n,!0),()=>{k.clear(),r.removeEventListener(`pointerup`,t,!0),r.removeEventListener(`pointermove`,n,!0)}},[f,p,h,P,g,m,R,L,o,s,y,_,b,k]),t.useEffect(function(){let e=x.current;if(!e||f||p)return;function t(e){e.touches.length===1&&e.preventDefault()}return e.addEventListener(`touchstart`,t),()=>{e.removeEventListener(`touchstart`,t)}},[f,p]);let z=J(`span`,e,{ref:[r,x],state:u,props:[{role:`presentation`,style:{touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`},async onPointerDown(e){let t=!e.button||e.button===0;if(e.defaultPrevented||p||!t||f)return;let r=e.pointerType===`touch`;if(j(r),e.pointerType===`mouse`&&(e.preventDefault(),m.current?.focus()),S.current=!0,C.current=!1,w.current=e.target,R(!0,e.nativeEvent),!r&&!kn)try{await Ci(x.current).body.requestPointerLock(),N(!1)}catch{N(!0)}finally{S.current&&n.flushSync(()=>{R(!0,e.nativeEvent)})}}},l],stateAttributesMapping:Vm}),B=t.useMemo(()=>({isScrubbing:P,isTouchInput:A,isPointerLockDenied:M,scrubAreaCursorRef:T,scrubAreaRef:x,direction:o,pixelSensitivity:s,teleportDistance:c}),[P,A,M,o,s,c]);return(0,O.jsx)(Hh.Provider,{value:B,children:z})});process.env.NODE_ENV!==`production`&&(Gh.displayName=`NumberFieldScrubArea`);var Kh=t.forwardRef(({className:e,...t},n)=>(0,O.jsxs)(Nh,{ref:n,className:`group relative flex h-11 w-full items-center rounded-xl border border-neutral-200 bg-white shadow-sm transition-colors focus-within:border-blue-500 focus-within:ring-4 focus-within:ring-blue-500/10 dark:border-neutral-800 dark:bg-neutral-950 dark:focus-within:ring-blue-500/20 ${e||``}`,...t,children:[(0,O.jsx)(Gh,{className:`absolute inset-y-0 left-0 w-8 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity`}),(0,O.jsx)(Vh,{className:`h-full w-full bg-transparent px-4 py-2 text-sm text-neutral-900 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:text-neutral-50`}),(0,O.jsxs)(`div`,{className:`flex h-full flex-col border-l border-neutral-200 dark:border-neutral-800`,children:[(0,O.jsx)(Lh,{className:`flex flex-1 items-center justify-center px-3 text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-900 focus:outline-none dark:hover:bg-neutral-800 dark:hover:text-neutral-50`,children:(0,O.jsx)(r.ChevronUp,{className:`size-3`,strokeWidth:3})}),(0,O.jsx)(Rh,{className:`flex flex-1 items-center justify-center px-3 text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-neutral-900 focus:outline-none dark:hover:bg-neutral-800 dark:hover:text-neutral-50`,children:(0,O.jsx)(r.ChevronDown,{className:`size-3`,strokeWidth:3})})]})]}));Kh.displayName=`NumberField`;var qh=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(qh.displayName=`PopoverRootContext`);function Jh(e){let n=t.useContext(qh);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(47):`Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.`);return n}function Yh(){return{...Hc(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Xh={...Wc,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),openMethod:Z(e=>e.openMethod),openChangeReason:Z(e=>e.openChangeReason),modal:Z(e=>e.modal),stickIfOpen:Z(e=>e.stickIfOpen),titleElementId:Z(e=>e.titleElementId),descriptionElementId:Z(e=>e.descriptionElementId),openOnHover:Z(e=>e.openOnHover),closeDelay:Z(e=>e.closeDelay),hasViewport:Z(e=>e.hasViewport)},Zh=class e extends Mc{constructor(e){let n={...Yh(),...e};n.open&&e?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:t.createRef(),backdropRef:t.createRef(),internalBackdropRef:t.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:t.createRef(),beforeContentFocusGuardRef:t.createRef(),stickIfOpenTimeout:new fa,triggerElements:new Bc},Xh)}setOpen=(e,t)=>{let r=t.reason===Fe,i=t.reason===`trigger-press`&&t.event.detail===0,a=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,o);let s=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};r?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),n.flushSync(s)):s(),i||a?this.set(`instantType`,i?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=h(()=>new e(n)).current,i=t??r;return mt(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function Qh({props:e}){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,modal:s=!1,handle:c,triggerId:l,defaultTriggerId:u=null}=e,d=Zh.useStore(c?.store,{modal:s,open:i,openProp:r,activeTriggerId:u,triggerIdProp:l});ud(()=>{r===void 0&&d.state.open===!1&&i===!0&&d.update({open:!0,activeTriggerId:u})}),d.useControlledProp(`openProp`,r),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`positionerElement`),m=d.useState(`payload`),h=d.useState(`openChangeReason`);d.useContextCallback(`onOpenChange`,a),d.useContextCallback(`onOpenChangeComplete`,o);let{openMethod:g,triggerProps:_}=Ol(f);Rc(d);let{forceUnmount:v}=zc(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});Sa(f&&s===!0&&h!==`trigger-hover`&&g!==`touch`,p),t.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let y=t.useCallback(e=>{let t=Y(e);return t.preventUnmountOnClose=()=>{d.set(`preventUnmountingOnClose`,!0)},t},[d]),b=t.useCallback(()=>{d.setOpen(!1,y(nt))},[d,y]);t.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=qc({popupStore:d,onOpenChange:d.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=al([ko(x,{outsidePressEvent:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),gl(x)]),T=t.useMemo(()=>S(_),[S,_]),E=t.useMemo(()=>w(_),[w,_]),D=t.useMemo(()=>C(),[C]);d.useSyncedValues({modal:s,openMethod:g,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:oo()!=null});let k=t.useMemo(()=>({store:d}),[d]);return(0,O.jsx)(qh.Provider,{value:k,children:typeof n==`function`?n({payload:m}):n})}function $h(e){return Jh(!0)?(0,O.jsx)(Qh,{props:e}):(0,O.jsx)(uo,{children:(0,O.jsx)(Qh,{props:e})})}var eg=t.forwardRef(function(e,r){let{render:i,className:a,disabled:o=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Jh(!0),g=c?.store??h?.store;if(!g)throw Error(process.env.NODE_ENV===`production`?I(74):`Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.`);let _=ft(p),y=g.useState(`isTriggerActive`,_),b=g.useState(`floatingRootContext`),x=g.useState(`isOpenedByTrigger`,_),S=t.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Lc(_,S,g,{payload:l,disabled:o,openOnHover:u,closeDelay:f}),T=g.useState(`openChangeReason`),E=g.useState(`stickIfOpen`),D=g.useState(`openMethod`),k=il(b,{enabled:b!=null&&u&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Tl(),restMs:d,delay:{close:f},triggerElementRef:S,isActiveTrigger:y}),A=al([So(b,{enabled:b!=null,stickIfOpen:E})]),j=g.useState(`triggerProps`,w),M={disabled:o,open:x},{getButtonProps:N,buttonRef:P}=Sn({disabled:o,native:s}),F=t.useMemo(()=>({open(e){return e&&T===`trigger-press`?Wl.open(e):Ul.open(e)}}),[T]),L=J(`button`,e,{state:M,ref:[P,r,C,S],props:[A.getReferenceProps(),k,j,{[be]:``,id:_},m,N],stateAttributesMapping:F}),R=t.useRef(null),z=v(e=>{n.flushSync(()=>{g.setOpen(!1,Y(qe,e.nativeEvent,e.currentTarget))}),Ai(R.current)?.focus()}),B=v(e=>{let t=g.select(`positionerElement`);if(t&&ji(e,t))g.context.beforeContentFocusGuardRef.current?.focus();else{n.flushSync(()=>{g.setOpen(!1,Y(qe,e.nativeEvent,e.currentTarget))});let r=ki(g.context.triggerFocusTargetRef.current||S.current);for(;r!==null&&X(t,r);){let e=r;if(r=Ei(r),r===e)break}r?.focus()}});return y?(0,O.jsxs)(t.Fragment,{children:[(0,O.jsx)(Fa,{ref:R,onFocus:z}),(0,O.jsx)(t.Fragment,{children:L},_),(0,O.jsx)(Fa,{ref:g.context.triggerFocusTargetRef,onFocus:B})]}):(0,O.jsx)(t.Fragment,{children:L},_)});process.env.NODE_ENV!==`production`&&(eg.displayName=`PopoverTrigger`);var tg=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(tg.displayName=`PopoverPortalContext`);function ng(){let e=t.useContext(tg);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(45):`Base UI: <Popover.Portal> is missing.`);return e}var rg=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Jh();return i.useState(`mounted`)||n?(0,O.jsx)(tg.Provider,{value:n,children:(0,O.jsx)(to,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(rg.displayName=`PopoverPortal`);var ig=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(ig.displayName=`PopoverPositionerContext`);function ag(){let e=t.useContext(ig);if(!e)throw Error(process.env.NODE_ENV===`production`?I(46):`Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.`);return e}var og=t.forwardRef(function(e,n){let{render:r,className:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Ee,..._}=e,{store:v}=Jh(),y=ng(),b=co(),S=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`hasViewport`),N=t.useRef(null),P=Tt(k,!1,!1),F=mf({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M?df:void 0}),I=t.useMemo(()=>{let e={};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!C,style:{...F.positionerStyles,...e}}},[w,C,F.positionerStyles]),L=t.useMemo(()=>({props:I,...F}),[I,F]),R=S.useState(`domReferenceElement`);x(()=>{let e=R,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[R,P,v]);let z={open:w,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:A},B=t.useCallback(e=>{v.set(`positionerElement`,e)},[v]),ee=J(`div`,e,{state:z,props:[L.props,gf(j),_],ref:[n,B],stateAttributesMapping:Gl});return(0,O.jsxs)(ig.Provider,{value:L,children:[C&&D===!0&&T!==`trigger-hover`&&(0,O.jsx)(ru,{ref:v.context.internalBackdropRef,inert:nu(!w),cutout:E}),(0,O.jsx)(lo,{id:b,children:ee})]})});process.env.NODE_ENV!==`production`&&(og.displayName=`PopoverPositioner`);var sg=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(sg.displayName=`ClosePartContext`);function cg(){let[e,n]=t.useState(0),r=v(()=>(n(e=>e+1),()=>{n(e=>Math.max(0,e-1))}));return{context:t.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}function lg(e){let{value:t,children:n}=e;return(0,O.jsx)(sg.Provider,{value:t,children:n})}var ug={...Gl,...wt},dg=t.forwardRef(function(e,n){let{className:r,render:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Jh(),l=ag(),u=Gf(!0)!=null,{context:d,hasClosePart:f}=cg(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`);aa({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});let T=c.useState(`disabled`),E=c.useState(`openOnHover`),D=c.useState(`closeDelay`);nl(w,{enabled:E&&!T,closeDelay:D});function k(e){return e===`touch`?c.context.popupRef.current:!0}let A=a===void 0?k:a,j={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},M=b!==!1&&f,N=t.useCallback(e=>{c.set(`popupElement`,e)},[c]),P=J(`div`,e,{state:j,ref:[n,c.context.popupRef,N],props:[_,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Gi.has(e.key)&&e.stopPropagation()}},gf(g),s],stateAttributesMapping:ug});return(0,O.jsx)(xo,{context:w,openInteractionType:m,modal:M,disabled:!x||S===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Zt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,O.jsx)(lg,{value:d,children:P})})});process.env.NODE_ENV!==`production`&&(dg.displayName=`PopoverPopup`);var fg=$h,pg=eg,mg=t.forwardRef(({className:e,sideOffset:t=6,...n},r)=>(0,O.jsx)(rg,{children:(0,O.jsx)(og,{sideOffset:t,children:(0,O.jsx)(dg,{ref:r,className:`z-50 w-72 rounded-2xl border border-neutral-200 bg-white p-5 shadow-xl outline-none origin-[var(--transform-origin)] transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 ${e||``}`,...n,children:n.children})})}));mg.displayName=`PopoverContent`;var hg=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(hg.displayName=`ProgressRootContext`);function gg(){let e=t.useContext(hg);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(51):`Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.`);return e}var _g=function(e){return e.complete=`data-complete`,e.indeterminate=`data-indeterminate`,e.progressing=`data-progressing`,e}({}),vg={status(e){return e===`progressing`?{[_g.progressing]:``}:e===`complete`?{[_g.complete]:``}:e===`indeterminate`?{[_g.indeterminate]:``}:null}};function yg(e,t){return t==null?`indeterminate progress`:e||`${t}%`}var bg=t.forwardRef(function(e,n){let{format:r,getAriaValueText:i=yg,locale:a,max:o=100,min:s=0,value:c,render:l,className:u,children:d,...f}=e,[p,m]=t.useState(),h=Aa(r),g=`indeterminate`;Number.isFinite(c)&&(g=c===o?`complete`:`progressing`);let _=Km(c,a,h.current),v=t.useMemo(()=>({status:g}),[g]),y={"aria-labelledby":p,"aria-valuemax":o,"aria-valuemin":s,"aria-valuenow":c??void 0,"aria-valuetext":i(_,c),role:`progressbar`,children:(0,O.jsxs)(t.Fragment,{children:[d,(0,O.jsx)(`span`,{role:`presentation`,style:Na,children:`x`})]})},b=t.useMemo(()=>({formattedValue:_,max:o,min:s,setLabelId:m,state:v,status:g,value:c}),[_,o,s,m,v,g,c]),x=J(`div`,e,{state:v,ref:n,props:[y,f],stateAttributesMapping:vg});return(0,O.jsx)(hg.Provider,{value:b,children:x})});process.env.NODE_ENV!==`production`&&(bg.displayName=`ProgressRoot`);var xg=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=gg();return J(`div`,e,{state:a,ref:t,props:i,stateAttributesMapping:vg})});process.env.NODE_ENV!==`production`&&(xg.displayName=`ProgressTrack`);function Sg(e,t,n){return(e-t)*100/(n-t)}var Cg=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{max:o,min:s,value:c,state:l}=gg(),u=Number.isFinite(c)&&c!==null?Sg(c,s,o):null;return J(`div`,e,{state:l,ref:n,props:[{style:t.useCallback(()=>u==null?{}:{insetInlineStart:0,height:`inherit`,width:`${u}%`},[u])()},a],stateAttributesMapping:vg})});process.env.NODE_ENV!==`production`&&(Cg.displayName=`ProgressIndicator`);var wg=t.forwardRef(({className:e,value:t,...n},r)=>(0,O.jsx)(bg,{ref:r,value:t,className:`relative h-2 w-full overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800 ${e||``}`,...n,children:(0,O.jsx)(xg,{className:`absolute inset-0`,children:(0,O.jsx)(Cg,{className:`h-full bg-neutral-900 transition-all duration-500 ease-in-out dark:bg-white`,style:{width:`${t??0}%`}})})}));wg.displayName=`Progress`;var Tg=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Eg={checked(e){return e?{[Tg.checked]:``}:{[Tg.unchecked]:``}},...wt,...Mu},Dg=`data-composite-item-active`,Og=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Og.displayName=`RadioGroupContext`);function kg(){return t.useContext(Og)}var Ag=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ag.displayName=`RadioRootContext`);var jg=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,readOnly:o=!1,required:s=!1,"aria-labelledby":c,value:l,inputRef:u,nativeButton:d=!1,id:f,...p}=e,m=kg(),{disabled:h,readOnly:g,required:_,checkedValue:y,touched:b=!1,validation:S,name:C}=m??{},w=m?.setCheckedValue??ge,T=m?.setTouched??ge,E=m?.registerControlRef??ge,D=m?.registerInputRef??ge,{setDirty:k,validityData:A,setTouched:j,setFilled:M,state:N,disabled:P}=Fu(),F=Lu(),{labelId:I,getDescriptionProps:L}=Uu(),R=P||F.disabled||h||a,B=g||o,ee=_||s,V=m?y===l:l===``,H=t.useMemo(()=>wd(l),[l]),U=t.useRef(null),W=t.useRef(null),G=v(e=>{e&&E(e,R)}),K=z(u,W,D);x(()=>{W.current?.checked&&M(!0)},[M]),x(()=>{if(W.current){if(R&&V){D(null);return}U.current&&E(U.current,R),D(W.current)}},[V,R,E,D]);let te=ft(),q=jd({id:f,implicit:!1,controlRef:U}),ne=d?void 0:q,re=Wu(c,I,W,!d,ne),ie={role:`radio`,"aria-checked":V,"aria-required":ee||void 0,"aria-readonly":B||void 0,"aria-labelledby":re,[Dg]:V?``:void 0,id:d?q:te,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){e.defaultPrevented||R||B||(e.preventDefault(),W.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))},onFocus(e){e.defaultPrevented||R||B||!b||(W.current?.click(),T(!1))}},{getButtonProps:ae,buttonRef:oe}=Sn({disabled:R,native:d}),se={type:`radio`,ref:K,id:ne,name:C,tabIndex:-1,style:C?Pa:Na,"aria-hidden":!0,...l===void 0?ve:{value:H},disabled:R,checked:V,required:ee,readOnly:B,onChange(e){if(e.nativeEvent.defaultPrevented||R||B||l===void 0)return;let t=Y(Ne,e.nativeEvent);t.isCanceled||(j(!0),k(l!==A.initialValue),M(!0),w(l,t))},onFocus(){U.current?.focus()}},ce=t.useMemo(()=>({...N,required:ee,disabled:R,readOnly:B,checked:V}),[N,R,B,V,ee]),le=ce,ue=m!==void 0,de=[n,U,oe,G],fe=[ie,L,S?.getValidationProps??ve,p,ae],pe=J(`span`,e,{enabled:!ue,state:ce,ref:de,props:fe,stateAttributesMapping:Eg});return(0,O.jsxs)(Ag.Provider,{value:le,children:[ue?(0,O.jsx)(sp,{tag:`span`,render:r,className:i,state:ce,refs:de,props:fe,stateAttributesMapping:Eg}):pe,(0,O.jsx)(`input`,{...se})]})});process.env.NODE_ENV!==`production`&&(jg.displayName=`RadioRoot`);var Mg=[];function Ng(e){let{itemSizes:n,cols:r=1,loopFocus:i=!0,dense:a=!1,orientation:o=`both`,direction:s,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:m=Mg}=e,[h,g]=t.useState(0),_=r>1,y=t.useRef(null),b=z(y,u),x=t.useRef([]),S=t.useRef(!1),C=c??h,w=v((e,t=!1)=>{if((l??g)(e),t){let t=x.current[e];Xi(y.current,t,s,o)}}),T=v(e=>{if(e.size===0||S.current)return;S.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&w(r),Xi(y.current,n,s,o)}),E=t.useMemo(()=>({"aria-orientation":o===`both`?void 0:o,ref:b,onFocus(e){!y.current||!Yi(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let t=d?Wi:Ui;if(!t.has(e.key)||Pg(e,m)||!y.current)return;let c=s===`rtl`,l=c?Ii:Li,u={horizontal:l,vertical:Fi,both:l}[o],h=c?Li:Ii,g={horizontal:h,vertical:Pi,both:h}[o];if(Yi(e.target)&&!Wt(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==g&&t<r.length||e.key!==u&&t>0)return}let v=C,b=Rr(x,p),S=zr(x,p);if(_){let t=n||Array.from({length:x.current.length},()=>({width:1,height:1})),s=Hr(t,r,a),l=s.findIndex(e=>e!=null&&!Gr(x,e,p)),u=s.reduce((e,t,n)=>t!=null&&!Gr(x,t,p)?n:e,-1);v=s[Vr({current:s.map(e=>e?x.current[e]:null)},{event:e,orientation:o,loopFocus:i,cols:r,disabledIndices:Wr([...p||x.current.map((e,t)=>Gr(x,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:Ur(C>S?b:C,t,s,r,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Fi],both:[l,Fi]}[o],E={horizontal:[h],vertical:[Pi],both:[h,Pi]}[o],D=_?t:{horizontal:d?Bi:zi,vertical:d?Hi:Vi,both:t}[o];d&&(e.key===`Home`?v=b:e.key===`End`&&(v=S)),v===C&&(T.includes(e.key)||E.includes(e.key))&&(v=i&&v===S&&T.includes(e.key)?b:i&&v===b&&E.includes(e.key)?S:Br(x,{startingIndex:v,decrement:E.includes(e.key),disabledIndices:p})),v!==C&&!Lr(x,v)&&(f&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),w(v,!0),queueMicrotask(()=>{x.current[v]?.focus()}))}}),[r,a,s,p,x,d,C,_,n,i,b,m,w,o,f]);return t.useMemo(()=>({props:E,highlightedIndex:C,onHighlightedIndexChange:w,elementsRef:x,disabledIndices:p,onMapChange:T,relayKeyboardEvent:E.onKeyDown}),[E,C,w,x,p,T])}function Pg(e,t){for(let n of qi.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Fg(e){let{render:n,className:r,refs:i=_e,props:a=_e,state:o=ve,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,dense:d,itemSizes:f,loopFocus:p,cols:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:_=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:A,relayKeyboardEvent:j}=Ng({itemSizes:f,cols:m,loopFocus:p,dense:d,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:P(),disabledIndices:y,modifierKeys:b}),M=J(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),N=t.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:j}),[T,E,x,j]);return(0,O.jsx)(yn.Provider,{value:N,children:(0,O.jsx)(k,{elementsRef:D,onMapChange:e=>{g?.(e),A(e)},children:M})})}var Ig=[Ki],Lg=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a,readOnly:o,required:s,onValueChange:c,value:l,defaultValue:u,name:d,inputRef:f,id:m,...h}=e,{setTouched:g,setFocused:_,shouldValidateOnChange:y,validationMode:b,name:x,disabled:S,state:C,validation:w,setDirty:T,setFilled:E,validityData:D}=Fu(),{labelId:k}=Uu(),{clearErrors:A}=Bu(),j=sm(!0),M=S||a,N=x??d,P=ft(m),[F,I]=p({controlled:l,default:u,name:`RadioGroup`,state:`value`}),L=v(c),R=v((e,t)=>{L(e,t),!t.isCanceled&&I(e)}),z=t.useRef(null),B=t.useRef(null),ee=t.useRef(null);function V(e){let t;return f&&(typeof f==`function`?t=f(e):f.current=e),B.current=e,w.inputRef.current=e,t}let H=v((e,t=!1)=>{if(e){if(t){z.current===e&&(z.current=null);return}z.current??=e}}),U=v(e=>{if(!e||e.disabled)return;ee.current||=e;let t=B.current;if(e.checked||t==null||t.disabled)return V(e)});Vu({id:P,commit:w.commit,value:F,controlRef:z,name:N,getValue:()=>F??null}),Dl(F,()=>{A(N),T(F!==D.initialValue),E(F!=null),y()?w.commit(F):w.commit(F,!0);let e=ee.current;F==null&&e&&!e.disabled&&V(e)});let[W,G]=t.useState(!1),K=h[`aria-labelledby`]??k??j?.legendId,te={...C,disabled:M??!1,required:s??!1,readOnly:o??!1},q=t.useMemo(()=>({...C,checkedValue:F,disabled:M,validation:w,name:N,onValueChange:L,readOnly:o,registerControlRef:H,registerInputRef:U,required:s,setCheckedValue:R,setTouched:G,touched:W}),[F,M,w,C,N,L,o,H,U,s,R,G,W]),ne={role:`radiogroup`,"aria-required":s||void 0,"aria-disabled":M||void 0,"aria-readonly":o||void 0,"aria-labelledby":K,onFocus(){_(!0)},onBlur(e){X(e.currentTarget,e.relatedTarget)||(g(!0),_(!1),b===`onBlur`&&w.commit(F))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(g(!0),G(!0),_(!0))}};return(0,O.jsx)(Og.Provider,{value:q,children:(0,O.jsx)(Fg,{render:r,className:i,state:te,props:[ne,w.getValidationProps,h],refs:[n],stateAttributesMapping:Mu,enableHomeAndEndKeys:!1,modifierKeys:Ig})})});process.env.NODE_ENV!==`production`&&(Lg.displayName=`RadioGroup`);var Rg=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Lg,{ref:n,className:`grid gap-2 ${e||``}`,...t}));Rg.displayName=`RadioGroup`;var zg=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(jg,{ref:n,className:`group flex size-5 shrink-0 items-center justify-center rounded-full border border-neutral-300 bg-white shadow-sm transition-all focus:outline-none focus:ring-4 focus:ring-neutral-900/10 data-[checked]:border-neutral-900 data-[checked]:bg-neutral-900 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:border-neutral-700 dark:bg-neutral-950 dark:data-[checked]:border-white dark:data-[checked]:bg-white ${e||``}`,...t,children:(0,O.jsx)(`div`,{className:`size-2 rounded-full bg-white dark:bg-neutral-900 transition-transform duration-200 data-[starting-style]:scale-50 data-[starting-style]:opacity-0 scale-0 group-data-[checked]:scale-100`})}));zg.displayName=`RadioGroupItem`;var Bg=t.createContext(null);process.env.NODE_ENV!==`production`&&(Bg.displayName=`SelectRootContext`);var Vg=t.createContext(null);process.env.NODE_ENV!==`production`&&(Vg.displayName=`SelectFloatingContext`);function Hg(){let e=t.useContext(Bg);if(e===null)throw Error(process.env.NODE_ENV===`production`?I(60):`Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.`);return e}function Ug(){let e=t.useContext(Vg);if(e===null)throw Error(process.env.NODE_ENV===`production`?I(61):`Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.`);return e}var Wg={id:Z(e=>e.id),labelId:Z(e=>e.labelId),modal:Z(e=>e.modal),multiple:Z(e=>e.multiple),items:Z(e=>e.items),itemToStringLabel:Z(e=>e.itemToStringLabel),itemToStringValue:Z(e=>e.itemToStringValue),isItemEqualToValue:Z(e=>e.isItemEqualToValue),value:Z(e=>e.value),hasSelectedValue:Z(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Od(t,r)!==``}),hasNullItemLabel:Z((e,t)=>t?Ed(e.items):!1),open:Z(e=>e.open),mounted:Z(e=>e.mounted),forceMount:Z(e=>e.forceMount),transitionStatus:Z(e=>e.transitionStatus),openMethod:Z(e=>e.openMethod),activeIndex:Z(e=>e.activeIndex),selectedIndex:Z(e=>e.selectedIndex),isActive:Z((e,t)=>e.activeIndex===t),isSelected:Z((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>bd(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:bd(n,i,r)}),isSelectedByFocus:Z((e,t)=>e.selectedIndex===t),popupProps:Z(e=>e.popupProps),triggerProps:Z(e=>e.triggerProps),triggerElement:Z(e=>e.triggerElement),positionerElement:Z(e=>e.positionerElement),listElement:Z(e=>e.listElement),scrollUpArrowVisible:Z(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Z(e=>e.scrollDownArrowVisible),hasScrollArrows:Z(e=>e.hasScrollArrows)};function Gg(e){let{id:n,value:r,defaultValue:i=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,name:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:m=!1,modal:g=!0,actionsRef:_,inputRef:y,onOpenChangeComplete:b,items:S,multiple:C=!1,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E=yd,highlightItemOnHover:D=!0,children:k}=e,{clearErrors:A}=Bu(),{setDirty:j,setTouched:M,setFocused:N,shouldValidateOnChange:P,validityData:F,setFilled:I,name:L,disabled:R,validation:B,validationMode:ee}=Fu(),V=jd({id:n}),H=R||d,U=L??l,[W,G]=p({controlled:r,default:C?i??_e:i,name:`Select`,state:`value`}),[K,te]=p({controlled:o,default:s,name:`Select`,state:`open`}),q=t.useRef([]),ne=t.useRef([]),re=t.useRef(null),ie=t.useRef(null),oe=t.useRef(0),se=t.useRef(null),ce=t.useRef([]),le=t.useRef(!1),ue=t.useRef(!1),de=t.useRef(null),fe=t.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),pe=t.useRef(!1),{mounted:me,setMounted:he,transitionStatus:ge}=Et(K),{openMethod:ye,triggerProps:be}=Ol(K),xe=h(()=>new jc({id:V,labelId:void 0,modal:g,multiple:C,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E,value:W,open:K,mounted:me,transitionStatus:ge,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Se=Q(xe,Wg.activeIndex),Ce=Q(xe,Wg.selectedIndex),we=Q(xe,Wg.triggerElement),Te=Q(xe,Wg.positionerElement),Ee=t.useMemo(()=>C&&Array.isArray(W)&&W.length===0?``:Od(W,T),[C,W,T]),De=t.useMemo(()=>C&&Array.isArray(W)?W.map(e=>Od(e,T)):Od(W,T),[C,W,T]),J=Aa(xe.state.triggerElement);Vu({id:V,commit:B.commit,value:W,controlRef:J,name:U,getValue:()=>De});let Oe=t.useRef(W);x(()=>{W!==Oe.current&&xe.set(`forceMount`,!0)},[xe,W]),x(()=>{I(C?Array.isArray(W)&&W.length>0:W!=null)},[C,W,I]),x(function(){if(K)return;let e=ce.current;if(C){let t=Array.isArray(W)?W:[];if(t.length===0){xe.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Sd(e,n,E);xe.set(`selectedIndex`,r===-1?null:r);return}let t=Sd(e,W,E);xe.set(`selectedIndex`,t===-1?null:t)},[C,K,W,ce,E,xe]),Dl(W,()=>{A(U),j(W!==F.initialValue),P()?B.commit(W):B.commit(W,!0)});let ke=v((e,t)=>{if(c?.(e,t),!t.isCanceled&&(te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(M(!0),N(!1),ee===`onBlur`&&B.commit(W)),!e&&xe.state.activeIndex!==null)){let e=q.current[xe.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Ae=v(()=>{he(!1),xe.set(`activeIndex`,null),b?.(!1)});aa({enabled:!_,open:K,ref:re,onComplete(){K||Ae()}}),t.useImperativeHandle(_,()=>({unmount:Ae}),[Ae]);let je=v((e,t)=>{a?.(e,t),!t.isCanceled&&G(e)}),Me=v(()=>{let e=xe.state.listElement||re.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;xe.state.scrollUpArrowVisible!==r&&xe.set(`scrollUpArrowVisible`,r),xe.state.scrollDownArrowVisible!==i&&xe.set(`scrollDownArrowVisible`,i)}),Pe=Gc({open:K,onOpenChange:ke,elements:{reference:we,floating:Te}}),{getReferenceProps:Fe,getFloatingProps:Ie,getItemProps:Le}=al([So(Pe,{enabled:!f&&!H,event:`mousedown`}),ko(Pe,{bubbles:!1}),ml(Pe,{enabled:!f&&!H,listRef:q,activeIndex:Se,selectedIndex:Ce,disabledIndices:_e,onNavigate(e){e===null&&!K||xe.set(`activeIndex`,e)},focusItemOnHover:!1}),_l(Pe,{enabled:!f&&!H&&(K||!C),listRef:ne,activeIndex:Se,selectedIndex:Ce,onMatch(e){K?xe.set(`activeIndex`,e):je(ce.current[e],Y(`none`))},onTypingChange(e){le.current=e}})]),Re=t.useMemo(()=>ae(Fe(),be,V?{id:V}:ve),[Fe,be,V]);ud(()=>{xe.update({popupProps:Ie(),triggerProps:Re})}),x(()=>{xe.update({id:V,modal:g,multiple:C,value:W,open:K,mounted:me,transitionStatus:ge,popupProps:Ie(),triggerProps:Re,items:S,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E,openMethod:ye})},[xe,V,g,C,W,K,me,ge,Ie,Re,S,w,T,E,ye]);let ze=t.useMemo(()=>({store:xe,name:U,required:m,disabled:H,readOnly:f,multiple:C,itemToStringLabel:w,itemToStringValue:T,highlightItemOnHover:D,setValue:je,setOpen:ke,listRef:q,popupRef:re,scrollHandlerRef:ie,handleScrollArrowVisibility:Me,scrollArrowsMountedCountRef:oe,getItemProps:Le,events:Pe.context.events,valueRef:se,valuesRef:ce,labelsRef:ne,typingRef:le,selectionRef:fe,selectedItemTextRef:de,validation:B,onOpenChangeComplete:b,keyboardActiveRef:ue,alignItemWithTriggerActiveRef:pe,initialValueRef:Oe}),[xe,U,m,H,f,C,w,T,D,je,ke,Le,Pe.context.events,B,b,Me]),Be=z(y,B.inputRef),Ve=C&&Array.isArray(W)&&W.length>0,He=C?void 0:U,Ue=t.useMemo(()=>!C||!Array.isArray(W)||!U?null:W.map(e=>{let t=Od(e,T);return(0,O.jsx)(`input`,{type:`hidden`,name:U,value:t},t)}),[C,W,U,T]);return(0,O.jsx)(Bg.Provider,{value:ze,children:(0,O.jsxs)(Vg.Provider,{value:Pe,children:[k,(0,O.jsx)(`input`,{...B.getInputValidationProps({onFocus(){xe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Y(Ne,e.nativeEvent);function r(){if(C)return;let e=ce.current.find(e=>Od(e,T).toLowerCase()===t.toLowerCase());e!=null&&(j(e!==F.initialValue),je(e,n),P()&&B.commit(e))}xe.set(`forceMount`,!0),queueMicrotask(r)}}),id:V&&He==null?`${V}-hidden-input`:void 0,name:He,autoComplete:u,value:Ee,disabled:H,required:m&&!Ve,readOnly:f,ref:Be,style:U?Pa:Na,tabIndex:-1,"aria-hidden":!0}),Ue]})})}var Kg=2,qg=400,Jg=200,Yg={...Wl,...Mu,value:()=>null},Xg=t.forwardRef(function(e,n){let{render:r,className:i,id:a,disabled:o=!1,nativeButton:s=!0,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=Fu(),{labelId:m}=Uu(),{store:h,setOpen:g,selectionRef:_,validation:y,readOnly:b,required:x,alignItemWithTriggerActiveRef:S,disabled:C,keyboardActiveRef:w}=Hg(),T=p||C||o,E=Q(h,Wg.open),D=Q(h,Wg.value),O=Q(h,Wg.triggerProps),k=Q(h,Wg.positionerElement),A=Q(h,Wg.listElement),j=Q(h,Wg.id),M=Q(h,Wg.labelId),N=Q(h,Wg.hasSelectedValue),P=!N&&E,F=Q(h,Wg.hasNullItemLabel,P),I=a??j,L=Kd(m,M);jd({id:I});let R=Aa(k),B=t.useRef(null),{getButtonProps:ee,buttonRef:V}=Sn({disabled:T,native:s}),H=z(n,B,V,v(e=>{h.set(`triggerElement`,e)})),U=pa(),W=pa(),G=pa(),K=pa();t.useEffect(()=>{if(E)return N||F?K.start(Jg,()=>{_.current.allowUnselectedMouseUp=!0,G.start(Jg,()=>{_.current.allowSelectedMouseUp=!0})}):G.start(qg,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{G.clear(),K.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},W.clear()},[E,N,F,_,W,G,K]);let te=t.useMemo(()=>A?.id??$n(k)?.id,[A,k]),q=ae(O,{id:I,role:`combobox`,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?te:void 0,"aria-labelledby":L,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,ref:H,onFocus(e){u(!0),E&&S.current&&g(!1,Y(Ne,e.nativeEvent)),U.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){X(k,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&y.commit(D))},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(E)return;let t=Ci(e.currentTarget);function n(e){if(!B.current)return;let t=e.target;if(X(B.current,t)||X(R.current,t)||t===B.current)return;let n=ef(B.current);e.clientX>=n.left-Kg&&e.clientX<=n.right+Kg&&e.clientY>=n.top-Kg&&e.clientY<=n.bottom+Kg||g(!1,Y($e,e))}W.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},y.getValidationProps,c,ee);q.role=`combobox`;let ne={...f,open:E,disabled:T,value:D,readOnly:b,placeholder:!N};return J(`button`,e,{ref:[n,B],state:ne,stateAttributesMapping:Yg,props:q})});process.env.NODE_ENV!==`production`&&(Xg.displayName=`SelectTrigger`);var Zg={value:()=>null},Qg=t.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,...o}=e,{store:s,valueRef:c}=Hg(),l=Q(s,Wg.value),u=Q(s,Wg.items),d=Q(s,Wg.itemToStringLabel),f=Q(s,Wg.hasSelectedValue),p=!f&&a!=null&&i==null,m=Q(s,Wg.hasNullItemLabel,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(!f&&a!=null&&!m?a:Array.isArray(l)?Ad(l,u,d):kd(l,u,d)),J(`span`,e,{state:h,ref:[t,c],props:[{children:g},o],stateAttributesMapping:Zg})});process.env.NODE_ENV!==`production`&&(Qg.displayName=`SelectValue`);var $g=t.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Hg();return J(`span`,e,{state:{open:Q(a,Wg.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:Ul})});process.env.NODE_ENV!==`production`&&($g.displayName=`SelectIcon`);var e_=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(e_.displayName=`SelectPortalContext`);var t_=t.forwardRef(function(e,t){let{store:n}=Hg(),r=Q(n,Wg.mounted),i=Q(n,Wg.forceMount);return r||i?(0,O.jsx)(e_.Provider,{value:!0,children:(0,O.jsx)(to,{ref:t,...e})}):null});process.env.NODE_ENV!==`production`&&(t_.displayName=`SelectPortal`);var n_=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(n_.displayName=`SelectPositionerContext`);function r_(){let e=t.useContext(n_);if(!e)throw Error(process.env.NODE_ENV===`production`?I(59):`Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.`);return e}function i_(e,t){e&&Object.assign(e.style,t)}var a_={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},o_={position:`fixed`},s_=t.forwardRef(function(e,n){let{anchor:r,positionMethod:i=`absolute`,className:a,render:o,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=Te,...y}=e,{store:b,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:w,selectedItemTextRef:T,valuesRef:E,initialValueRef:D,popupRef:A,setValue:j}=Hg(),M=Ug(),N=Q(b,Wg.open),P=Q(b,Wg.mounted),F=Q(b,Wg.modal),I=Q(b,Wg.value),L=Q(b,Wg.openMethod),R=Q(b,Wg.positionerElement),z=Q(b,Wg.triggerElement),B=Q(b,Wg.isItemEqualToValue),ee=Q(b,Wg.transitionStatus),V=t.useRef(null),H=t.useRef(null),[U,W]=t.useState(g),G=P&&U&&L!==`touch`;!P&&U!==g&&W(g),x(()=>{P||(Wg.scrollUpArrowVisible(b.state)&&b.set(`scrollUpArrowVisible`,!1),Wg.scrollDownArrowVisible(b.state)&&b.set(`scrollDownArrowVisible`,!1))},[b,P]),t.useImperativeHandle(w,()=>G),Sa((G||F)&&N&&L!==`touch`,z);let K=mf({anchor:r,floatingRootContext:M,positionMethod:i,mounted:P,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h??G,collisionAvoidance:_,keepMounted:!0}),te=G?`none`:K.side,q=G?o_:K.positionerStyles,ne=t.useMemo(()=>{let e={};return N||(e.pointerEvents=`none`),{role:`presentation`,hidden:!P,style:{...q,...e}}},[N,P,q]),re={open:N,side:te,align:K.align,anchorHidden:K.anchorHidden},ie=J(`div`,e,{ref:[n,v(e=>{b.set(`positionerElement`,e)})],state:re,stateAttributesMapping:Gl,props:[ne,gf(ee),y]}),ae=t.useRef(0),oe=v(e=>{if(e.size===0&&ae.current===0||E.current.length===0)return;let t=ae.current;if(ae.current=e.size,e.size===t)return;let n=Y(Ne);if(t!==0&&!b.state.multiple&&I!==null&&Sd(E.current,I,B)===-1){let e=D.current,t=e!=null&&Sd(E.current,e,B)!==-1?e:null;j(t,n),t===null&&(b.set(`selectedIndex`,null),T.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(I)){let e=e=>Sd(E.current,e,B)!==-1,t=I.filter(t=>e(t));(t.length!==I.length||t.some(e=>!xd(I,e,B)))&&(j(t,n),t.length===0&&(b.set(`selectedIndex`,null),T.current=null))}if(N&&G){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};i_(R,e),i_(A.current,e)}}),se=t.useMemo(()=>({...K,side:te,alignItemWithTriggerActive:G,setControlledAlignItemWithTrigger:W,scrollUpArrowRef:V,scrollDownArrowRef:H}),[K,te,G,W]);return(0,O.jsx)(k,{elementsRef:S,labelsRef:C,onMapChange:oe,children:(0,O.jsxs)(n_.Provider,{value:se,children:[P&&F&&(0,O.jsx)(ru,{inert:nu(!N),cutout:z}),ie]})})});process.env.NODE_ENV!==`production`&&(s_.displayName=`SelectPositioner`);function c_(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var l_=`base-ui-disable-scrollbar`,u_={className:l_,getElement(e){return(0,O.jsx)(`style`,{nonce:e,href:l_,precedence:`base-ui:low`,children:`.${l_}{scrollbar-width:none}.${l_}::-webkit-scrollbar{display:none}`})}};process.env.NODE_ENV!==`production`&&(u_.getElement.displayName=`styleDisableScrollbar.getElement`);var d_=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(d_.displayName=`CSPContext`);var f_={disableStyleElements:!1};function p_(){return t.useContext(d_)??f_}var m_=1,h_={...Gl,...wt},g_=t.forwardRef(function(e,r){let{render:i,className:a,finalFocus:o,...s}=e,{store:c,popupRef:l,onOpenChangeComplete:u,setOpen:d,valueRef:f,selectedItemTextRef:p,keyboardActiveRef:m,multiple:h,handleScrollArrowVisibility:g,scrollHandlerRef:_,highlightItemOnHover:y}=Hg(),{side:b,align:S,alignItemWithTriggerActive:C,setControlledAlignItemWithTrigger:w,scrollDownArrowRef:T,scrollUpArrowRef:E}=r_(),D=Gf(!0)!=null,k=Ug(),{nonce:A,disableStyleElements:j}=p_(),M=pa(),N=Q(c,Wg.id),P=Q(c,Wg.open),F=Q(c,Wg.mounted),I=Q(c,Wg.popupProps),L=Q(c,Wg.transitionStatus),R=Q(c,Wg.triggerElement),z=Q(c,Wg.positionerElement),B=Q(c,Wg.listElement),ee=t.useRef(0),V=t.useRef(!1),H=t.useRef(0),U=t.useRef(!1),W=t.useRef({}),G=yt(),K=v(e=>{if(!z||!l.current||!U.current)return;if(V.current||!C){g();return}let t=z.style.top===`0px`,n=z.style.bottom===`0px`,r=z.getBoundingClientRect().height,i=Ci(z),a=getComputedStyle(z),o=parseFloat(a.marginTop),s=parseFloat(a.marginBottom),c=__(getComputedStyle(l.current)),u=Math.min(i.documentElement.clientHeight-o-s,c),d=e.scrollTop,f=v_(e),p=0,m=null,h=!1,_=!1,v=e=>{z.style.height=`${e}px`},y=(t,n)=>{let i=Rp(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=m_&&(V.current=!0),g()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=m_){y(e,f);return}u-n>m_?_=!0:h=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=m_){y(e,0);return}u-n>m_?m=0:(h=!0,d<f&&(m=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||m!=null){let t=v_(e),n=_?t:Rp(m,0,t);Math.abs(e.scrollTop-n)>m_&&(e.scrollTop=n)}(h||p>=u-m_)&&(V.current=!0),g()});t.useImperativeHandle(_,()=>K,[K]),aa({open:P,ref:l,onComplete(){P&&u?.(!0)}});let te={open:P,transitionStatus:L,side:b,align:S};x(()=>{!z||!l.current||Object.keys(W.current).length||(W.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[l,z]),x(()=>{P||C||(U.current=!1,V.current=!1,ee.current=0,H.current=0,i_(z,W.current))},[P,C,z,l]),x(()=>{let e=l.current;if(!(!P||!R||!z||!e||c.state.transitionStatus===`ending`)){if(!C){U.current=!0,G.request(g),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=S_(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(z),r=getComputedStyle(e),i=Ci(R),a=qt(z),o=y_(R),s=b_(R.getBoundingClientRect(),o),c=b_(z.getBoundingClientRect(),o),l=s.left,u=s.height,d=B||e,m=d.scrollHeight,h=parseFloat(r.borderBottomWidth),_=parseFloat(t.marginTop)||10,v=parseFloat(t.marginBottom)||10,y=parseFloat(t.minHeight)||100,b=__(r),x=i.documentElement.clientHeight-_-v,S=i.documentElement.clientWidth,C=x-s.bottom+u,T=p.current,E=f.current,D,O=0,k=0;if(T&&E){let e=b_(E.getBoundingClientRect(),o);D=b_(T.getBoundingClientRect(),o);let t=e.left-l,n=D.left-c.left,r=e.top-s.top+e.height/2,i=D.top-c.top+D.height/2;O=t-n,k=i-r}let A=C+k+v+h,j=Math.min(x,A),M=x-_-v,N=A-j,P=Math.max(5,l+O),F=S-5,I=Math.max(0,P+c.width-F);z.style.left=`${P-I}px`,z.style.height=`${j}px`,z.style.maxHeight=`auto`,z.style.marginTop=`${_}px`,z.style.marginBottom=`${v}px`,e.style.height=`100%`;let L=v_(d),H=N>=L-m_;H&&(j=Math.min(x,c.height)-(N-L));let G=s.top<20||s.bottom>x-20||Math.ceil(j)+m_<Math.min(m,y),K=(a.visualViewport?.scale??1)!==1&&kn;if(G||K){U.current=!0,i_(z,W.current),n.flushSync(()=>w(!1));return}if(H){let e=Math.max(0,x-A);z.style.top=c.height>=M?`0`:`${e}px`,z.style.height=`${j}px`,d.scrollTop=v_(d),ee.current=Math.max(y,j)}else z.style.bottom=`0`,ee.current=Math.max(y,j),d.scrollTop=N;if(D){let t=c.top,n=c.height,r=D.top+D.height/2,i=Rp(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(ee.current===x||j>=b)&&(V.current=!0),g(),setTimeout(()=>{U.current=!0})}finally{t()}})}},[c,P,z,R,f,p,l,g,C,w,G,T,E,B]),t.useEffect(()=>{if(!C||!z||!P)return;let e=qt(z);function t(e){d(!1,Y(rt,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[d,C,z,P]);let q={...B?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":h||void 0,id:`${N}-list`},onKeyDown(e){m.current=!0,D&&Gi.has(e.key)&&e.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(e){if(!y||c_(e)||e.pointerType===`touch`)return;let t=e.currentTarget;M.start(0,()=>{c.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){B||K(e.currentTarget)},...C&&{style:B?{height:`100%`}:a_}},ne=J(`div`,e,{ref:[r,l],state:te,stateAttributesMapping:h_,props:[I,q,gf(L),{className:!B&&C?u_.className:void 0},s]});return(0,O.jsxs)(t.Fragment,{children:[!j&&u_.getElement(A),(0,O.jsx)(xo,{context:k,modal:!1,disabled:!F,returnFocus:o,restoreFocus:!0,children:ne})]})});process.env.NODE_ENV!==`production`&&(g_.displayName=`SelectPopup`);function __(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function v_(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function y_(e){return gs.getScale(e)}function b_(e,t){return Fr({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}var x_=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function S_(e){let{style:t}=e,n={};for(let[e,r]of x_)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of x_){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var C_=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(C_.displayName=`SelectItemContext`);function w_(){let e=t.useContext(C_);if(!e)throw Error(process.env.NODE_ENV===`production`?I(57):`Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.`);return e}var T_=t.memo(t.forwardRef(function(e,n){let{render:r,className:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=t.useRef(null),d=jt({label:o,textRef:u,indexGuessBehavior:At.GuessFromOrder}),{store:f,getItemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,keyboardActiveRef:y,multiple:b,highlightItemOnHover:S}=Hg(),C=pa(),w=Q(f,Wg.isActive,d.index),T=Q(f,Wg.isSelected,d.index,a),E=Q(f,Wg.isSelectedByFocus,d.index),D=Q(f,Wg.isItemEqualToValue),k=d.index,A=k!==-1,j=t.useRef(null),M=Aa(k);x(()=>{if(!A)return;let e=v.current;return e[k]=a,()=>{delete e[k]}},[A,k,a,v]),x(()=>{if(!A)return;let e=f.state.value,t=e;b&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&bd(a,t,D)&&f.set(`selectedIndex`,k)},[A,k,b,D,f,a]);let N={disabled:s,selected:T,highlighted:w},P=p({active:w,selected:T});P.onFocus=void 0,P.id=void 0;let F=t.useRef(null),I=t.useRef(`mouse`),L=t.useRef(!1),{getButtonProps:R,buttonRef:z}=Sn({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0});function B(e){let t=f.state.value;if(b){let n=Array.isArray(t)?t:[];h(T?Cd(n,a,D):[...n,a],Y(Re,e))}else h(a,Y(Re,e)),m(!1,Y(Re,e))}let ee={role:`option`,"aria-selected":T,tabIndex:w?0:-1,onFocus(){f.set(`activeIndex`,k)},onMouseEnter(){!y.current&&f.state.selectedIndex===null&&S&&f.set(`activeIndex`,k)},onMouseMove(){S&&f.set(`activeIndex`,k)},onMouseLeave(e){!S||y.current||c_(e)||C.start(0,()=>{f.state.activeIndex===k&&f.set(`activeIndex`,null)})},onTouchStart(){g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){F.current=e.key,f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){L.current=!1,!(e.type===`keydown`&&F.current===null)&&(s||e.type===`keydown`&&F.current===` `&&_.current||I.current!==`touch`&&!w||(F.current=null,B(e.nativeEvent)))},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,L.current=!0},onMouseUp(){if(s)return;if(L.current){L.current=!1;return}let e=!g.current.allowSelectedMouseUp&&T,t=!g.current.allowUnselectedMouseUp&&!T;e||t||I.current!==`touch`&&!w||j.current?.click()}},V=J(`div`,e,{ref:[z,n,d.ref,j],state:N,props:[P,ee,l,R]}),H=t.useMemo(()=>({selected:T,indexRef:M,textRef:u,selectedByFocus:E,hasRegistered:A}),[T,M,u,E,A]);return(0,O.jsx)(C_.Provider,{value:H,children:V})}));process.env.NODE_ENV!==`production`&&(T_.displayName=`SelectItem`);var E_=t.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=w_();return n||r?(0,O.jsx)(D_,{...e,ref:t}):null});process.env.NODE_ENV!==`production`&&(E_.displayName=`SelectItemIndicator`);var D_=t.memo(t.forwardRef((e,n)=>{let{render:r,className:i,keepMounted:a,...o}=e,{selected:s}=w_(),c=t.useRef(null),{transitionStatus:l,setMounted:u}=Et(s),d=J(`span`,e,{ref:[n,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:wt});return aa({open:s,ref:c,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!==`production`&&(D_.displayName=`Inner`);var O_=t.memo(t.forwardRef(function(e,n){let{indexRef:r,textRef:i,selectedByFocus:a,hasRegistered:o}=w_(),{selectedItemTextRef:s}=Hg(),{className:c,render:l,...u}=e;return J(`div`,e,{ref:[t.useCallback(e=>{if(!e||!o)return;let t=s.current===null||!s.current.isConnected;(a||t&&r.current===0)&&(s.current=e)},[s,r,a,o]),n,i],props:u})}));process.env.NODE_ENV!==`production`&&(O_.displayName=`SelectItemText`);var k_=Gg,A_=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsxs)(Xg,{ref:i,className:`flex h-11 w-full items-center justify-between rounded-xl border border-neutral-200 bg-white px-4 py-2 text-sm text-neutral-900 shadow-sm transition-all focus:border-blue-500 focus:outline-none focus:ring-4 focus:ring-blue-500/10 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 dark:focus:ring-blue-500/20 ${e||``}`,...n,children:[(0,O.jsx)(Qg,{placeholder:n.placeholder}),(0,O.jsx)($g,{className:`opacity-50 transition-transform data-[open]:rotate-180`,children:(0,O.jsx)(r.ChevronDown,{className:`size-4`})})]}));A_.displayName=`SelectTrigger`;var j_=t.forwardRef(({className:e,sideOffset:t=8,...n},r)=>(0,O.jsx)(t_,{children:(0,O.jsx)(s_,{sideOffset:t,children:(0,O.jsx)(g_,{ref:r,className:`z-50 max-h-96 min-w-[var(--anchor-width)] overflow-hidden rounded-xl border border-neutral-200 bg-white p-1.5 shadow-lg transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 origin-[var(--transform-origin)] ${e||``}`,...n})})}));j_.displayName=`SelectContent`;var M_=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsxs)(T_,{ref:i,className:`relative flex cursor-default select-none items-center justify-between rounded-lg px-3 py-2 text-sm font-medium outline-none transition-colors data-[highlighted]:bg-neutral-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:data-[highlighted]:bg-neutral-800 dark:data-[highlighted]:text-neutral-50 ${e||``}`,...n,children:[(0,O.jsx)(O_,{children:t}),(0,O.jsx)(E_,{children:(0,O.jsx)(r.Check,{className:`size-4`})})]}));M_.displayName=`SelectItem`;var N_=t.forwardRef(({className:e,orientation:t=`horizontal`,...n},r)=>(0,O.jsx)(Of,{ref:r,orientation:t,className:`shrink-0 bg-neutral-200 dark:bg-neutral-800 ${t===`horizontal`?`h-px w-full`:`h-full w-px`} ${e||``}`,...n}));N_.displayName=`Separator`;function P_(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function F_(e,t){return e-t}function I_(e,t,n){let r=e.slice();return r[t]=n,r.sort(F_)}function L_(e,t,n,r,i,a){let o=e;return o=Rp(o,n,r),i&&(o=I_(a,t,Rp(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function R_(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var z_={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...Mu},B_=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(B_.displayName=`SliderRootContext`);function V_(){let e=t.useContext(B_);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(62):`Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.`);return e}function H_(e){return`key`in e?Ze:He}function U_(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?P_(e,t):!1}var W_=t.forwardRef(function(e,n){let{"aria-labelledby":r,className:i,defaultValue:a,disabled:o=!1,id:s,format:c,largeStep:l=10,locale:u,render:d,max:f=100,min:m=0,minStepsBetweenValues:h=0,name:g,onValueChange:_,onValueCommitted:y,orientation:b=`horizontal`,step:S=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:E,...D}=e,A=ft(s),j=Gd(A),M=v(_),N=v(y),{clearErrors:P}=Bu(),{state:F,disabled:I,name:L,setTouched:R,setDirty:z,validityData:B,shouldValidateOnChange:ee,validation:V}=Fu(),{labelId:H}=Uu(),[U,W]=t.useState(),G=r??Kd(H,U),K=I||o,te=L??g,[q,ne]=p({controlled:E,default:a??m,name:`Slider`}),re=t.useRef(null),ie=t.useRef(null),ae=t.useRef([]),oe=t.useRef(null),se=t.useRef(null),ce=t.useRef(-1),le=t.useRef(null),ue=t.useRef(null),de=t.useRef(`none`),fe=Aa(c),[pe,me]=t.useState(-1),[he,ge]=t.useState(-1),[_e,ve]=t.useState(!1),[ye,be]=t.useState(()=>new Map),[xe,Se]=t.useState([void 0,void 0]),Ce=v(e=>{me(e),e!==-1&&ge(e)});Vu({id:A,commit:V.commit,value:q,controlRef:ie,name:te,getValue:()=>q}),Dl(q,()=>{P(te),ee()?V.commit(q):V.commit(q,!0);let e=B.initialValue,t;t=Array.isArray(q)&&Array.isArray(e)?!P_(q,e):q!==e,z(t)});let we=v(e=>{e&&(ie.current=e)}),Te=Array.isArray(q),Ee=t.useMemo(()=>Te?q.slice().sort(F_):[Rp(q,m,f)],[f,m,Te,q]),De=v((e,t)=>{if(Number.isNaN(e)||U_(e,q))return;let n=t??Y(`none`,void 0,void 0,{activeThumbIndex:-1});de.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:te}}),n.event=i,ue.current=e,M(e,n),!n.isCanceled&&ne(e)}),Oe=v((e,t,n)=>{let r=L_(e,t,m,f,Te,Ee);if(R_(r,S,h)){let e=H_(n);De(r,Y(e,n.nativeEvent,void 0,{activeThumbIndex:t})),R(!0),N(ue.current??r,it(e,n.nativeEvent))}});process.env.NODE_ENV!==`production`&&m>=f&&C("Slider `max` must be greater than `min`."),x(()=>{let e=Gn(Ci(re.current));K&&e&&re.current?.contains(e)&&e.blur()},[K]),K&&pe!==-1&&Ce(-1);let ke=t.useMemo(()=>({...F,activeThumbIndex:pe,disabled:K,dragging:_e,orientation:b,max:f,min:m,minStepsBetweenValues:h,step:S,values:Ee}),[F,pe,K,_e,f,m,h,b,S,Ee]),Ae=t.useMemo(()=>({active:pe,controlRef:ie,disabled:K,dragging:_e,validation:V,formatOptionsRef:fe,handleInputChange:Oe,indicatorPosition:xe,inset:T!==`center`,labelId:G,rootLabelId:j,largeStep:l,lastUsedThumbIndex:he,lastChangedValueRef:ue,lastChangeReasonRef:de,locale:u,max:f,min:m,minStepsBetweenValues:h,name:te,onValueCommitted:N,orientation:b,pressedInputRef:oe,pressedThumbCenterOffsetRef:se,pressedThumbIndexRef:ce,pressedValuesRef:le,registerFieldControlRef:we,renderBeforeHydration:T===`edge`,setActive:Ce,setDragging:ve,setIndicatorPosition:Se,setLabelId:W,setValue:De,state:ke,step:S,thumbCollisionBehavior:w,thumbMap:ye,thumbRefs:ae,values:Ee}),[pe,ie,G,j,K,_e,V,fe,Oe,xe,l,he,ue,de,u,f,m,h,te,N,b,oe,se,ce,le,we,Ce,ve,Se,W,De,ke,S,w,T,ye,ae,Ee]),je=J(`div`,e,{state:ke,ref:[n,re],props:[{"aria-labelledby":G,id:A,role:`group`},V.getValidationProps,D],stateAttributesMapping:z_});return(0,O.jsx)(B_.Provider,{value:Ae,children:(0,O.jsx)(k,{elementsRef:ae,onMapChange:be,children:je})})});process.env.NODE_ENV!==`production`&&(W_.displayName=`SliderRoot`);function G_(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function K_(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function q_(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(K_(t)))}var J_=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=V_();return J(`div`,e,{state:a,ref:t,props:[{style:{position:`relative`}},i],stateAttributesMapping:z_})});process.env.NODE_ENV!==`production`&&(J_.displayName=`SliderTrack`);var Y_=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),X_=`PageUp`,Z_=`PageDown`,Q_=new Set([Pi,Fi,Ii,Li,Ri,`End`,X_,Z_]);function $_(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Wm(e[t],r,n)} start range`:`${Wm(e[t],r,n)} end range`:n?Wm(e[t],r,n):void 0}function ev(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}var tv=t.forwardRef(function(e,n){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":s,"aria-labelledby":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:f,index:p,inputRef:m,onBlur:h,onFocus:g,onKeyDown:_,tabIndex:y,...b}=e,{nonce:S}=p_(),C=ft(f),{active:w,lastUsedThumbIndex:T,controlRef:E,disabled:D,validation:k,formatOptionsRef:A,handleInputChange:j,inset:M,labelId:N,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,name:ee,orientation:V,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:W,renderBeforeHydration:G,setActive:K,setIndicatorPosition:te,state:q,step:ne,values:re}=V_(),ie=P(),oe=l||D,se=re.length>1,ce=V===`vertical`,le=ie===`rtl`,{setTouched:ue,setFocused:de,validationMode:fe}=Fu(),pe=t.useRef(null),me=t.useRef(null),he=ft(),ge=jd(),_e=se?he:ge,{ref:ve,index:ye}=jt({metadata:t.useMemo(()=>({inputId:_e}),[_e])}),be=se?p??ye:0,xe=be===re.length-1,Se=re[be],Ce=Sg(Se,R,L),[we,Te]=t.useState(!1),[Ee,De]=t.useState();mt(()=>Te(!0));let Oe=T>=0&&T<re.length?T:-1,ke=v(()=>{let e=E.current,t=pe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ce/100)/r[i]*100;De(o),be===0?te(e=>[o,e[1]]):xe&&te(e=>[e[0],o])});x(()=>{M&&queueMicrotask(ke)},[ke,M]),x(()=>{M&&ke()},[ke,M,Ce]);let Ae=t.useCallback(()=>{let e=ce?`bottom`:`insetInlineStart`,t=ce?`left`:`top`,n;return se?w===be?n=2:Oe===be&&(n=1):w===be&&(n=1),M?{"--position":`${Ee}%`,visibility:G&&!we||Ee===void 0?`hidden`:void 0,position:`absolute`,[e]:`var(--position)`,[t]:`50%`,translate:`${(ce||!le?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:n}:Number.isFinite(Ce)?{position:`absolute`,[e]:`${Ce}%`,[t]:`50%`,translate:`${(ce||!le?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:n}:Na},[w,be,M,we,Ee,se,G,le,Oe,Ce,ce]),je;V===`vertical`&&(je=le?`vertical-rl`:`vertical-lr`);let Me=typeof u==`function`?u(be):s,Ne=ae({"aria-label":Me,"aria-labelledby":c??(Me==null?N:void 0),"aria-describedby":o,"aria-orientation":V,"aria-valuenow":Se,"aria-valuetext":typeof d==`function`?d(Wm(Se,I,A.current??void 0),Se,be):$_(re,be,A.current??void 0,I),disabled:oe,id:_e,max:L,min:R,name:ee,onChange(e){j(e.target.valueAsNumber,be,e)},onFocus(){K(be),de(!0)},onBlur(){pe.current&&(K(-1),ue(!0),de(!1),fe===`onBlur`&&k.commit(L_(Se,be,R,L,se,re)))},onKeyDown(e){if(!Q_.has(e.key))return;Gi.has(e.key)&&e.stopPropagation();let t=null,n=q_(Se,ne,R);switch(e.key){case Pi:t=ev(n,e.shiftKey?F:ne,1,R,L);break;case Li:t=ev(n,e.shiftKey?F:ne,le?-1:1,R,L);break;case Fi:t=ev(n,e.shiftKey?F:ne,-1,R,L);break;case Ii:t=ev(n,e.shiftKey?F:ne,le?1:-1,R,L);break;case X_:t=ev(n,F,1,R,L);break;case Z_:t=ev(n,F,-1,R,L);break;case`End`:t=L,se&&(t=Number.isFinite(re[be+1])?re[be+1]-ne*B:L);break;case Ri:t=R,se&&(t=Number.isFinite(re[be-1])?re[be-1]+ne*B:R);break;default:break}t!==null&&(j(t,be,e),e.preventDefault())},step:ne,style:{...Na,width:`100%`,height:`100%`,writingMode:je},tabIndex:y??void 0,type:`range`,value:Se??``},k.getInputValidationProps),Pe=z(me,k.inputRef,m);return J(`div`,e,{state:q,ref:[n,ve,pe],props:[{[Y_.index]:be,children:(0,O.jsxs)(t.Fragment,{children:[i,(0,O.jsx)(`input`,{ref:Pe,...Ne}),M&&!we&&G&&xe&&(0,O.jsx)(`script`,{nonce:S,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:C,onBlur:h,onFocus:g,onPointerDown(e){if(W.current=be,pe.current!=null){let t=V===`horizontal`?`x`:`y`,n=G_(pe.current);U.current=(V===`horizontal`?e.clientX:e.clientY)-n[t]}me.current!=null&&H.current!==me.current&&(H.current=me.current)},style:Ae(),suppressHydrationWarning:G||void 0,tabIndex:-1},b],stateAttributesMapping:z_})});process.env.NODE_ENV!==`production`&&(tv.displayName=`SliderThumb`);function nv(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&!a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function rv(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var iv=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=V_(),[m,h]=t.useState(!1);mt(()=>h(!0));let g=u===`vertical`,_=p.length>1,v=s?nv(g,_,o[0],o[1],d,m):rv(g,_,Sg(p[0],l,c),Sg(p[p.length-1],l,c));return J(`div`,e,{state:f,ref:n,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:v,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:z_})});process.env.NODE_ENV!==`production`&&(iv.displayName=`SliderIndicator`);var av=t.forwardRef(({className:e,...t},n)=>(0,O.jsxs)(W_,{ref:n,className:`relative flex w-full touch-none select-none items-center py-2 ${e||``}`,...t,children:[(0,O.jsx)(J_,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-800`,children:(0,O.jsx)(iv,{className:`absolute h-full bg-neutral-900 dark:bg-white`})}),(0,O.jsx)(tv,{className:`block size-5 cursor-grab rounded-full ring-2 ring-neutral-900 bg-white transition-colors focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-blue-500/20 active:cursor-grabbing disabled:pointer-events-none disabled:opacity-50 dark:ring-white dark:bg-neutral-950`})]}));av.displayName=`Slider`;var ov=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(ov.displayName=`SwitchRootContext`);function sv(){let e=t.useContext(ov);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(63):`Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.`);return e}var cv=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),lv={...Mu,checked(e){return e?{[cv.checked]:``}:{[cv.unchecked]:``}}},uv=t.forwardRef(function(e,n){let{checked:r,className:i,defaultChecked:a,"aria-labelledby":o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:m=!1,disabled:h=!1,render:g,uncheckedValue:_,value:y,...b}=e,{clearErrors:S}=Bu(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:D,setFocused:k,shouldValidateOnChange:A,validationMode:j,disabled:M,name:N,validation:P}=Fu(),{labelId:F}=Uu(),I=M||h,L=N??l,R=v(d),B=t.useRef(null),ee=z(B,c,P.inputRef),V=t.useRef(null),H=ft(),U=jd({id:s,implicit:!1,controlRef:V}),W=u?void 0:U,[G,K]=p({controlled:r,default:!!a,name:`Switch`,state:`checked`});Vu({id:H,commit:P.commit,value:G,controlRef:V,name:L,getValue:()=>G}),x(()=>{B.current&&D(B.current.checked)},[B,D]),Dl(G,()=>{S(L),T(G!==E.initialValue),D(G),A()?P.commit(G):P.commit(G,!0)});let{getButtonProps:te,buttonRef:q}=Sn({disabled:I,native:u}),ne=Wu(o,F,B,!u,W),re={id:u?U:H,role:`switch`,"aria-checked":G,"aria-readonly":f||void 0,"aria-required":m||void 0,"aria-labelledby":ne,onFocus(){I||k(!0)},onBlur(){let e=B.current;!e||I||(w(!0),k(!1),j===`onBlur`&&P.commit(e.checked))},onClick(e){f||I||(e.preventDefault(),B.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},ie=t.useMemo(()=>ae({checked:G,disabled:I,id:W,name:L,required:m,style:L?Pa:Na,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ee,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Y(Ne,e.nativeEvent);R?.(t,n),!n.isCanceled&&K(t)},onFocus(){V.current?.focus()}},P.getInputValidationProps,y===void 0?ve:{value:y}),[G,I,ee,W,L,R,m,K,P,y]),oe=t.useMemo(()=>({...C,checked:G,disabled:I,readOnly:f,required:m}),[C,G,I,f,m]),se=J(`span`,e,{state:oe,ref:[n,V,q],props:[re,P.getValidationProps,b,te],stateAttributesMapping:lv});return(0,O.jsxs)(ov.Provider,{value:oe,children:[se,!G&&L&&_!==void 0&&(0,O.jsx)(`input`,{type:`hidden`,name:L,value:_}),(0,O.jsx)(`input`,{...ie})]})});process.env.NODE_ENV!==`production`&&(uv.displayName=`SwitchRoot`);var dv=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=Fu(),o=sv();return J(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:lv,props:i})});process.env.NODE_ENV!==`production`&&(dv.displayName=`SwitchThumb`);var fv=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(uv,{ref:n,className:`group relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-neutral-200 transition-colors duration-200 focus:outline-none focus:ring-4 focus:ring-neutral-900/10 data-[checked]:bg-neutral-900 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:bg-neutral-700 dark:data-[checked]:bg-white ${e||``}`,...t,children:(0,O.jsx)(dv,{className:`pointer-events-none block size-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-200 data-[checked]:translate-x-5 dark:bg-neutral-950`})}));fv.displayName=`Switch`;var pv=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(pv.displayName=`TabsRootContext`);function mv(){let e=t.useContext(pv);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(64):`Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.`);return e}var hv=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({}),gv={tabActivationDirection:e=>({[hv.activationDirection]:e})},_v=t.forwardRef(function(e,n){let{className:r,defaultValue:i=0,onValueChange:a,orientation:o=`horizontal`,render:s,value:c,...l}=e,u=P(),d=Object.hasOwn(e,`defaultValue`),f=t.useRef([]),[m,h]=t.useState(()=>new Map),[g,_]=p({controlled:c,default:i,name:`Tabs`,state:`value`}),y=c!==void 0,[b,S]=t.useState(()=>new Map),[C,w]=t.useState(`none`),T=v((e,t)=>{a?.(e,t),!t.isCanceled&&(_(e),w(t.activationDirection))}),E=v((e,t)=>{h(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})}),D=v((e,t)=>{h(n=>{if(!n.has(e)||n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})}),A=t.useCallback(e=>m.get(e),[m]),j=t.useCallback(e=>{for(let t of b.values())if(e===t?.value)return t?.id},[b]),M=t.useCallback(e=>{if(e===void 0)return null;for(let[t,n]of b.entries())if(n!=null&&e===(n.value??n.index))return t;return null},[b]),N=t.useMemo(()=>({direction:u,getTabElementBySelectedValue:M,getTabIdByPanelValue:j,getTabPanelIdByValue:A,onValueChange:T,orientation:o,registerMountedTabPanel:E,setTabMap:S,unregisterMountedTabPanel:D,tabActivationDirection:C,value:g}),[u,M,j,A,T,o,E,S,D,C,g]),F=t.useMemo(()=>{for(let e of b.values())if(e!=null&&e.value===g)return e},[b,g]),I=t.useMemo(()=>{for(let e of b.values())if(e!=null&&!e.disabled)return e.value},[b]);x(()=>{if(y||b.size===0)return;let e=F?.disabled;if(d&&e&&g===i||!e&&!(F==null&&g!==null))return;let t=I??null;g!==t&&(_(t),w(`none`))},[i,I,d,y,F,w,_,b,g]);let L=J(`div`,e,{state:{orientation:o,tabActivationDirection:C},ref:n,props:l,stateAttributesMapping:gv});return(0,O.jsx)(pv.Provider,{value:N,children:(0,O.jsx)(k,{elementsRef:f,children:L})})});process.env.NODE_ENV!==`production`&&(_v.displayName=`TabsRoot`);var vv=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(vv.displayName=`TabsListContext`);function yv(){let e=t.useContext(vv);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(65):`Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.`);return e}var bv=t.forwardRef(function(e,n){let{className:r,disabled:i=!1,render:a,value:o,id:s,nativeButton:c=!0,...l}=e,{value:u,getTabPanelIdByValue:d,orientation:f}=mv(),{activateOnFocus:p,highlightedTabIndex:m,onTabActivation:h,registerTabResizeObserverElement:g,setHighlightedTabIndex:_,tabsListElement:v}=yv(),y=ft(s),{compositeProps:b,compositeRef:S,index:C}=op({metadata:t.useMemo(()=>({disabled:i,id:y,value:o}),[i,y,o])}),w=o===u,T=t.useRef(!1),E=t.useRef(null);t.useEffect(()=>{let e=E.current;if(e)return g(e)},[g]),x(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&m!==C))return;let e=v;if(e!=null){let t=Gn(Ci(e));if(t&&X(e,t))return}i||_(C)},[w,C,m,_,i,v]);let{getButtonProps:D,buttonRef:O}=Sn({disabled:i,native:c,focusableWhenDisabled:!0}),k=d(o),A=t.useRef(!1),j=t.useRef(!1);function M(e){w||i||h(o,Y(Ne,e.nativeEvent,void 0,{activationDirection:`none`}))}function N(e){w||(C>-1&&!i&&_(C),!i&&p&&(!A.current||A.current&&j.current)&&h(o,Y(Ne,e.nativeEvent,void 0,{activationDirection:`none`})))}function P(e){if(w||i)return;A.current=!0;function t(){A.current=!1,j.current=!1}(!e.button||e.button===0)&&(j.current=!0,Ci(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return J(`button`,e,{state:{disabled:i,active:w,orientation:f},ref:[n,O,S,E],props:[b,{role:`tab`,"aria-controls":k,"aria-selected":w,id:y,onClick:M,onFocus:N,onPointerDown:P,[Dg]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,D]})});process.env.NODE_ENV!==`production`&&(bv.displayName=`TabsTab`);var xv=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e[e.startingStyle=xt.startingStyle]=`startingStyle`,e[e.endingStyle=xt.endingStyle]=`endingStyle`,e}({}),Sv={...gv,...wt},Cv=t.forwardRef(function(e,n){let{className:r,value:i,render:a,keepMounted:o=!1,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f,unregisterMountedTabPanel:p}=mv(),m=ft(),{ref:h,index:g}=jt({metadata:t.useMemo(()=>({id:m,value:i}),[m,i])}),_=i===c,{mounted:v,transitionStatus:y,setMounted:b}=Et(_),S=!v,C=l(i),w={hidden:S,orientation:u,tabActivationDirection:d,transitionStatus:y},T=t.useRef(null),E=J(`div`,e,{state:w,ref:[n,h,T],props:[{"aria-labelledby":C,hidden:S,id:m,role:`tabpanel`,tabIndex:_?0:-1,inert:nu(!_),[xv.index]:g},s],stateAttributesMapping:Sv});return aa({open:_,ref:T,onComplete(){_||b(!1)}}),x(()=>{if(!(S&&!o)&&m!=null)return f(i,m),()=>{p(i,m)}},[S,o,i,m,f,p]),o||v?E:null});process.env.NODE_ENV!==`production`&&(Cv.displayName=`TabsPanel`);var wv=t.forwardRef(function(e,n){let{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:o,...s}=e,{getTabElementBySelectedValue:c,onValueChange:l,orientation:u,value:d,setTabMap:f,tabActivationDirection:p}=mv(),[m,h]=t.useState(0),[g,_]=t.useState(null),y=t.useRef(new Set),b=t.useRef(new Set),x=t.useRef(null),S=v(()=>{y.current.forEach(e=>{e()})});t.useEffect(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{y.current.size&&S()});return x.current=e,g&&e.observe(g),b.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),x.current=null}},[g,S]);let C=v(e=>(y.current.add(e),()=>{y.current.delete(e)})),w=v(e=>(b.current.add(e),x.current?.observe(e),()=>{b.current.delete(e),x.current?.unobserve(e)})),T=Ev(d,u,g,c),E=v((e,t)=>{e!==d&&(t.activationDirection=T(e),l(e,t))}),D={orientation:u,tabActivationDirection:p},k={"aria-orientation":u===`vertical`?`vertical`:void 0,role:`tablist`},A=t.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:m,registerIndicatorUpdateListener:C,registerTabResizeObserverElement:w,onTabActivation:E,setHighlightedTabIndex:h,tabsListElement:g}),[r,m,C,w,E,h,g]);return(0,O.jsx)(vv.Provider,{value:A,children:(0,O.jsx)(Fg,{render:o,className:i,state:D,refs:[n,_],props:[k,s],stateAttributesMapping:gv,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:a,orientation:u,onHighlightedIndexChange:h,onMapChange:f,disabledIndices:_e})})});process.env.NODE_ENV!==`production`&&(wv.displayName=`TabsList`);function Tv(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function Ev(e,n,r,i){let[a,o]=t.useState(null);return x(()=>{if(e==null||r==null){o(null);return}let t=i(e);if(t==null){o(null);return}let{left:a,top:s}=Tv(t,r);o(n===`horizontal`?a:s)},[n,i,r,e]),t.useCallback(t=>{if(t===e)return`none`;if(t==null)return o(null),`none`;if(t!=null&&r!=null){let e=i(t);if(e!=null){let{left:t,top:i}=Tv(e,r);if(a==null)return o(n===`horizontal`?t:i),`none`;if(n===`horizontal`){if(t<a)return o(t),`left`;if(t>a)return o(t),`right`}else if(i<a)return o(i),`up`;else if(i>a)return o(i),`down`}}return`none`},[i,n,a,r,e])}var Dv=_v,Ov=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(wv,{ref:n,className:`inline-flex h-11 items-center justify-center rounded-xl bg-neutral-100 p-1 text-neutral-500 shadow-inner dark:bg-neutral-900 dark:text-neutral-400 ${e||``}`,...t}));Ov.displayName=`TabsList`;var kv=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(bv,{ref:n,className:`inline-flex items-center justify-center whitespace-nowrap rounded-lg px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[selected]:bg-white data-[selected]:text-neutral-950 data-[selected]:shadow-sm dark:ring-offset-neutral-950 dark:focus-visible:ring-white dark:data-[selected]:bg-neutral-950 dark:data-[selected]:text-neutral-50 ${e||``}`,...t}));kv.displayName=`TabsTrigger`;var Av=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Cv,{ref:n,className:`mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2 dark:ring-offset-neutral-950 dark:focus-visible:ring-white transition-all duration-300 data-[starting-style]:opacity-0 ${e||``}`,...t}));Av.displayName=`TabsContent`;var jv=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(jv.displayName=`ToastContext`);function Mv(){let e=t.useContext(jv);if(!e)throw Error(process.env.NODE_ENV===`production`?I(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);return e}var Nv=0;function Pv(e){return Nv+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Nv}`}function Fv(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}var Iv=dc(e=>e.toasts,e=>{let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}),Lv={toasts:Z(e=>e.toasts),isEmpty:Z(e=>e.toasts.length===0),toast:Z(Iv,(e,t)=>e.get(t)?.value),toastIndex:Z(Iv,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:Z(Iv,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:Z(Iv,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:Z(e=>e.hovering),focused:Z(e=>e.focused),expanded:Z(e=>e.hovering||e.focused),expandedOrOutOfFocus:Z(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:Z(e=>e.prevFocusElement)},Rv=class extends Mc{timers=new Map;areTimersPaused=!1;constructor(e){super(e,{},Lv)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e){let t=Lv.toastIndex(this.state,e);if(t===-1)return;this.state.toasts[t]?.onRemove?.();let n=[...this.state.toasts];n.splice(t,1),this.setToasts(n)}addToast=e=>{let{toasts:t,timeout:n,limit:r}=this.state,i=e.id||Pv(`toast`),a={...e,id:i,transitionStatus:`starting`},o=[a,...t],s=o.filter(e=>e.transitionStatus!==`ending`);if(s.length>r){let e=s.length-r,t=s.slice(-e),n=new Set(t.map(e=>e.id));this.setToasts(o.map(e=>{let t=n.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(o.map(e=>e.limited?{...e,limited:!1}:e));let c=a.timeout??n;return a.type!==`loading`&&c>0&&this.scheduleTimer(i,c,()=>this.closeToast(i)),Lv.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,t)=>{this.updateToastInternal(e,t)};updateToastInternal=(e,t)=>{let{timeout:n,toasts:r}=this.state,i=Lv.toast(this.state,e)??null;if(!i||i.transitionStatus===`ending`)return;let a={...i,...t};this.setToasts(r.map(n=>n.id===e?{...n,...t}:n));let o=a.timeout??n,s=i?.timeout??n,c=Object.hasOwn(t,`timeout`),l=a.transitionStatus!==`ending`&&a.type!==`loading`&&o>0,u=this.timers.has(e),d=s!==o,f=i?.type===`loading`;if(!l&&u){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(l&&(!u||d||c||f)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,o,()=>this.closeToast(e)),Lv.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear();else{let t=Lv.toast(this.state,e);if(!t)return;i=[t];let n=this.timers.get(e);n?.timeout&&(n.timeout.clear(),this.timers.delete(e))}let a=0,o={toasts:r.map(r=>{if(t||r.id===e)return{...r,transitionStatus:`ending`,height:0};if(r.transitionStatus===`ending`)return r;let i=a>=n;return a+=1,r.limited===i?r:{...r,limited:i}})};(t||r.length===1)&&(o.hovering=!1,o.focused=!1),this.update(o),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Fv(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Fv(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Fv(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=fa.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=qn(e);X(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!Lv.expandedOrOutOfFocus(this.state),a=i?fa.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=Gn(Ci(this.state.viewport));if(!this.state.viewport||!X(this.state.viewport,t)||!Qn(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=Lv.toasts(this.state),r=Lv.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},zv=function(e){let{children:n,timeout:r=5e3,limit:i=3,toastManager:a}=e,o=h(()=>new Rv({timeout:r,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return mt(o.disposeEffect),t.useEffect(function(){if(a)return a[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?o.promiseToast(t.promise,t):e===`update`&&n?o.updateToast(n,t):e===`close`?o.closeToast(n):o.addToast(t)})},[o,r,a]),o.useSyncedValues({timeout:r,limit:i}),(0,O.jsx)(jv.Provider,{value:o,children:n})};process.env.NODE_ENV!==`production`&&(zv.displayName=`ToastProvider`);var Bv=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Bv.displayName=`ToastRootContext`);function Vv(){let e=t.useContext(Bv);if(!e)throw Error(process.env.NODE_ENV===`production`?I(66):`Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.`);return e}var Hv=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({}),Uv={...wt,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Wv=40,Gv=10,Kv=.5,qv=1,Jv=`${Ce},${we}`;function Yv(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function Xv(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var Zv=t.forwardRef(function(e,r){let{toast:i,render:a,className:o,swipeDirection:s=[`down`,`right`],...c}=e,l=i.positionerProps?.anchor!==void 0,u=[];l||(u=Array.isArray(s)?s:[s]);let d=u.length>0,f=Mv(),[p,m]=t.useState(void 0),[h,g]=t.useState(!1),[_,y]=t.useState(!1),[b,S]=t.useState(!1),[C,w]=t.useState({x:0,y:0}),[T,E]=t.useState({x:0,y:0,scale:1}),[D,k]=t.useState(),[A,j]=t.useState(),[M,N]=t.useState(null),P=t.useRef(null),F=t.useRef({x:0,y:0}),I=t.useRef({x:0,y:0,scale:1}),L=t.useRef(void 0),R=t.useRef(0),z=t.useRef(!1),B=t.useRef({x:0,y:0}),ee=t.useRef(!1),V=f.useState(`toastIndex`,i.id),H=f.useState(`toastVisibleIndex`,i.id),U=f.useState(`toastOffsetY`,i.id),W=f.useState(`focused`),G=f.useState(`expanded`);aa({open:i.transitionStatus!==`ending`,ref:P,onComplete(){i.transitionStatus===`ending`&&f.removeToast(i.id)}});let K=v((e=!1)=>{let t=P.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let a=t.offsetHeight;t.style.height=r;function o(){f.updateToastInternal(i.id,{ref:P,height:a,...i.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?n.flushSync(o):o()});x(K,[K]);function te(e,t){let n=e,r=t;return!u.includes(`left`)&&!u.includes(`right`)?n=e>0?e**Kv:-(Math.abs(e)**Kv):(!u.includes(`right`)&&e>0&&(n=e**Kv),!u.includes(`left`)&&e<0&&(n=-(Math.abs(e)**Kv))),!u.includes(`up`)&&!u.includes(`down`)?r=t>0?t**Kv:-(Math.abs(t)**Kv):(!u.includes(`down`)&&t>0&&(r=t**Kv),!u.includes(`up`)&&t<0&&(r=-(Math.abs(t)**Kv))),{x:n,y:r}}function q(e){if(e.button!==0)return;e.pointerType===`touch`&&f.pauseTimers();let t=qn(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],${Jv}`))){if(z.current=!1,L.current=void 0,R.current=0,F.current={x:e.clientX,y:e.clientY},B.current=F.current,P.current){let e=Xv(P.current);I.current=e,E(e),w({x:e.x,y:e.y})}f.setHovering(!0),g(!0),y(!1),N(null),ee.current=!0,P.current?.setPointerCapture(e.pointerId)}}function ne(e){if(!h)return;e.preventDefault(),ee.current&&=(F.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>B.current.y||i>0&&t<B.current.y)&&(B.current={x:B.current.x,y:t}),(r<0&&n>B.current.x||r>0&&n<B.current.x)&&(B.current={x:n,y:B.current.y});let a=n-F.current.x,o=t-F.current.y,s=t-B.current.y,c=n-B.current.x;if(!_&&Math.sqrt(a*a+o*o)>=qv&&(y(!0),M===null)){let e=u.includes(`left`)||u.includes(`right`),t=u.includes(`up`)||u.includes(`down`);e&&t&&N(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!L.current)M===`vertical`?o>0?l=`down`:o<0&&(l=`up`):M===`horizontal`?a>0?l=`right`:a<0&&(l=`left`):l=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,l&&u.includes(l)&&(L.current=l,R.current=Yv(l,a,o),m(l));else{let e=L.current,t=Yv(e,c,s);t>Wv?(z.current=!1,m(e)):!(u.includes(`left`)&&u.includes(`right`))&&!(u.includes(`up`)&&u.includes(`down`))&&R.current-t>=Gv&&(z.current=!0)}let d=te(a,o),f=I.current.x,p=I.current.y;M===`horizontal`?(u.includes(`left`)||u.includes(`right`))&&(f+=d.x):(M===`vertical`||(u.includes(`left`)||u.includes(`right`))&&(f+=d.x),(u.includes(`up`)||u.includes(`down`))&&(p+=d.y)),w({x:f,y:p})}function re(e){if(!h)return;if(g(!1),y(!1),N(null),P.current?.releasePointerCapture(e.pointerId),z.current){w({x:T.x,y:T.y}),m(void 0);return}let t=!1,n=C.x-T.x,r=C.y-T.y,a;for(let e of u){switch(e){case`right`:n>Wv&&(t=!0,a=`right`);break;case`left`:n<-Wv&&(t=!0,a=`left`);break;case`down`:r>Wv&&(t=!0,a=`down`);break;case`up`:r<-Wv&&(t=!0,a=`up`);break;default:break}if(t)break}t?(m(a),S(!0),f.closeToast(i.id)):(w({x:T.x,y:T.y}),m(void 0))}function ie(e){if(e.key===`Escape`){if(!P.current||!X(P.current,Gn(Ci(P.current))))return;f.closeToast(i.id)}}t.useEffect(()=>{if(!d)return;let e=P.current;if(!e)return;function t(t){X(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[d]);function ae(){if(!h&&C.x===T.x&&C.y===T.y&&!b)return{[Hv.swipeMovementX]:`0px`,[Hv.swipeMovementY]:`0px`};let e=C.x-T.x,t=C.y-T.y;return{transition:h?`none`:void 0,transform:h?`translateX(${C.x}px) translateY(${C.y}px) scale(${T.scale})`:void 0,[Hv.swipeMovementX]:`${e}px`,[Hv.swipeMovementY]:`${t}px`}}let oe=i.priority===`high`,se={role:oe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":D,"aria-describedby":A,"aria-hidden":oe&&!W?!0:void 0,onPointerDown:d?q:void 0,onPointerMove:d?ne:void 0,onPointerUp:d?re:void 0,onKeyDown:ie,inert:nu(i.limited),style:{...ae(),[Hv.index]:i.transitionStatus===`ending`?V:H,[Hv.offsetY]:`${U}px`,[Hv.height]:i.height?`${i.height}px`:void 0}},ce=t.useMemo(()=>({rootRef:P,toast:i,titleId:D,setTitleId:k,descriptionId:A,setDescriptionId:j,swiping:h,swipeDirection:p,recalculateHeight:K,index:V,visibleIndex:H,expanded:G}),[i,D,A,h,p,K,V,H,G]),le={transitionStatus:i.transitionStatus,expanded:G,limited:i.limited||!1,type:i.type,swiping:ce.swiping,swipeDirection:ce.swipeDirection},ue=J(`div`,e,{ref:[r,ce.rootRef],state:le,stateAttributesMapping:Uv,props:[se,c]});return(0,O.jsx)(Bv.Provider,{value:ce,children:ue})});process.env.NODE_ENV!==`production`&&(Zv.displayName=`ToastRoot`);var Qv=t.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setDescriptionId:c}=Vv(),l=a??s.description,u=!!l,d=dt(i);x(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=J(`p`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null});process.env.NODE_ENV!==`production`&&(Qv.displayName=`ToastDescription`);var $v=t.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setTitleId:c}=Vv(),l=a??s.title,u=!!l,d=dt(i);x(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=J(`h2`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null});process.env.NODE_ENV!==`production`&&($v.displayName=`ToastTitle`);var ey=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a,nativeButton:o=!0,...s}=e,c=Mv(),{toast:l}=Vv(),u=c.useState(`expanded`),[d,f]=t.useState(!1),{getButtonProps:p,buttonRef:m}=Sn({disabled:a,native:o}),h={type:l.type};return J(`button`,e,{ref:[n,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})});process.env.NODE_ENV!==`production`&&(ey.displayName=`ToastClose`);var ty=t.forwardRef(function(e,r){let{children:i,container:a,className:o,render:s,...c}=e,{portalNode:l,portalSubtree:u}=eo({container:a,ref:r,componentProps:e,elementProps:c});return!u&&!l?null:(0,O.jsxs)(t.Fragment,{children:[u,l&&n.createPortal(i,l)]})});process.env.NODE_ENV!==`production`&&(ty.displayName=`FloatingPortalLite`);var ny=zv,ry=t.forwardRef(({className:e,children:t,...n},i)=>(0,O.jsxs)(Zv,{ref:i,className:`pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-xl border border-neutral-200 bg-white p-4 pr-10 shadow-xl transition-all duration-300 data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-full data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[starting-style]:translate-x-full data-[ending-style]:translate-x-full dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 ${e||``}`,...n,children:[(0,O.jsx)(`div`,{className:`grid gap-1`,children:t}),(0,O.jsx)(ey,{className:`absolute right-3 top-3 rounded-md p-1.5 text-neutral-500 opacity-60 transition-opacity hover:text-neutral-900 hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 dark:hover:text-neutral-50`,children:(0,O.jsx)(r.X,{className:`size-4`})})]}));ry.displayName=`Toast`;var iy=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)($v,{ref:n,className:`text-sm font-semibold ${e||``}`,...t}));iy.displayName=`ToastTitle`;var ay=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Qv,{ref:n,className:`text-sm opacity-90 ${e||``}`,...t}));ay.displayName=`ToastDescription`;var oy=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(oy.displayName=`ToggleGroupContext`);function sy(e=!0){let n=t.useContext(oy);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(7):`Base UI: ToggleGroupContext is missing. ToggleGroup parts must be placed within <ToggleGroup>.`);return n}var cy=t.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,...f}=e,m=ft(u||void 0),h=sy(),g=h?.value??[],_=h?void 0:r,y=(i||h?.disabled)??!1;process.env.NODE_ENV!==`production`&&x(()=>{h&&u===void 0&&h.isValueInitialized&&vn("A `<Toggle>` component rendered in a `<ToggleGroup>` has no explicit `value` prop.",`This will cause issues between the Toggle Group and Toggle values.`,"Provide the `<Toggle>` with a `value` prop matching the `<ToggleGroup>` values prop type.")},[h,u,h?.isValueInitialized]);let[b,S]=p({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:_,name:`Toggle`,state:`pressed`}),C=v((e,t)=>{m&&h?.setGroupValue?.(m,e,t),o?.(e,t)}),{getButtonProps:w,buttonRef:T}=Sn({disabled:y,native:d}),E={disabled:y,pressed:b},D=[T,t],k=[{"aria-pressed":b,onClick(e){let t=!b,n=Y(Ne,e.nativeEvent);C(t,n),!n.isCanceled&&S(t)}},f,w],A=J(`button`,e,{enabled:!h,state:E,ref:D,props:k});return h?(0,O.jsx)(sp,{tag:`button`,render:c,className:n,state:E,refs:D,props:k}):A});process.env.NODE_ENV!==`production`&&(cy.displayName=`Toggle`);var ly=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(cy,{ref:n,className:`inline-flex h-10 items-center justify-center rounded-xl bg-transparent px-3 py-2 text-sm font-medium transition-colors hover:bg-neutral-100 hover:text-neutral-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[pressed]:bg-neutral-900 data-[pressed]:text-white dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:data-[pressed]:bg-white dark:data-[pressed]:text-neutral-900 ${e||``}`,...t}));ly.displayName=`Toggle`;var uy=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),dy={multiple(e){return e?{[uy.multiple]:``}:null}},fy=t.forwardRef(function(e,n){let{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:o,orientation:s=`horizontal`,multiple:c=!1,value:l,className:u,render:d,...f}=e,m=Gf(!0),h=t.useMemo(()=>{if(l===void 0)return r??[]},[l,r]),g=t.useMemo(()=>l!==void 0||r!==void 0,[l,r]),_=(m?.disabled??!1)||i,[y,b]=p({controlled:l,default:h,name:`ToggleGroup`,state:`value`}),x=v((e,t,n)=>{let r;if(c?(r=y.slice(),t?r.push(e):r.splice(y.indexOf(e),1)):r=t?[e]:[],Array.isArray(r)){if(o?.(r,n),n.isCanceled)return;b(r)}}),S={disabled:_,multiple:c,orientation:s},C=t.useMemo(()=>({disabled:_,orientation:s,setGroupValue:x,value:y,isValueInitialized:g}),[_,s,x,y,g]),w={role:`group`},T=J(`div`,e,{enabled:!!m,state:S,ref:n,props:[w,f],stateAttributesMapping:dy});return(0,O.jsx)(oy.Provider,{value:C,children:m?T:(0,O.jsx)(Fg,{render:d,className:u,state:S,refs:[n],props:[w,f],stateAttributesMapping:dy,loopFocus:a,enableHomeAndEndKeys:!0})})});process.env.NODE_ENV!==`production`&&(fy.displayName=`ToggleGroup`);var py=t.forwardRef(({className:e,...t},n)=>(0,O.jsx)(fy,{ref:n,className:`flex items-center justify-center gap-1 rounded-xl border border-neutral-200 bg-white p-1 dark:border-neutral-800 dark:bg-neutral-950 ${e||``}`,...t}));py.displayName=`ToggleGroup`;var my=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(my.displayName=`TooltipRootContext`);function hy(e){let n=t.useContext(my);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?I(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return n}var gy={...Wc,disabled:Z(e=>e.disabled),instantType:Z(e=>e.instantType),isInstantPhase:Z(e=>e.isInstantPhase),trackCursorAxis:Z(e=>e.trackCursorAxis),disableHoverablePopup:Z(e=>e.disableHoverablePopup),lastOpenChangeReason:Z(e=>e.openChangeReason),closeOnClick:Z(e=>e.closeOnClick),closeDelay:Z(e=>e.closeDelay),hasViewport:Z(e=>e.hasViewport)},_y=class e extends Mc{constructor(e){super({...vy(),...e},{popupRef:t.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Bc},gy)}setOpen=(e,t)=>{let r=t.reason,i=r===Fe,a=e&&r===`trigger-focus`,o=!e&&(r===`trigger-press`||r===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let s=()=>{let n={open:e,openChangeReason:r};a?n.instantType=`focus`:o?n.instantType=`dismiss`:r===`trigger-hover`&&(n.instantType=void 0);let i=t.trigger?.id??null;(i||e)&&(n.activeTriggerId=i,n.activeTriggerElement=t.trigger??null),this.update(n)};i?n.flushSync(s):s()};static useStore(t,n){let r=h(()=>new e(n)).current,i=t??r,a=qc({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function vy(){return{...Hc(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var yy=Sc(function(e){let{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:a=!1,trackCursorAxis:o=`none`,actionsRef:s,onOpenChange:c,onOpenChangeComplete:l,handle:u,triggerId:d,defaultTriggerId:f=null,children:p}=e,m=_y.useStore(u?.store,{open:r,openProp:i,activeTriggerId:f,triggerIdProp:d});ud(()=>{i===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:f})}),m.useControlledProp(`openProp`,i),m.useControlledProp(`triggerIdProp`,d),m.useContextCallback(`onOpenChange`,c),m.useContextCallback(`onOpenChangeComplete`,l);let h=m.useState(`open`),g=!n&&h,_=m.useState(`activeTriggerId`),v=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:a}),x(()=>{h&&n&&m.setOpen(!1,Y(tt))},[h,n,m]),m.useSyncedValue(`disabled`,n),Rc(m);let{forceUnmount:y,transitionStatus:b}=zc(g,m),S=m.useState(`isInstantPhase`),C=m.useState(`instantType`),w=m.useState(`lastOpenChangeReason`),T=t.useRef(null);x(()=>{b===`ending`&&w===`none`||b!==`ending`&&S?(C!==`delay`&&(T.current=C),m.set(`instantType`,`delay`)):T.current!==null&&(m.set(`instantType`,T.current),T.current=null)},[b,S,w,C,m]),x(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]);let E=t.useCallback(()=>{m.setOpen(!1,by(m,nt))},[m]);t.useImperativeHandle(s,()=>({unmount:y,close:E}),[y,E]);let D=m.useState(`floatingRootContext`),{getReferenceProps:k,getFloatingProps:A,getTriggerProps:j}=al([ko(D,{enabled:!n,referencePress:()=>m.select(`closeOnClick`)}),To(D,{enabled:!n&&o!==`none`,axis:o===`none`?void 0:o})]),M=t.useMemo(()=>k(),[k]),N=t.useMemo(()=>j(),[j]),P=t.useMemo(()=>A(),[A]);return m.useSyncedValues({activeTriggerProps:M,inactiveTriggerProps:N,popupProps:P}),(0,O.jsx)(my.Provider,{value:m,children:typeof p==`function`?p({payload:v}):p})});process.env.NODE_ENV!==`production`&&(yy.displayName=`TooltipRoot`);function by(e,t){let n=Y(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var xy=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(xy.displayName=`TooltipProviderContext`);function Sy(){return t.useContext(xy)}var Cy=function(e){return e[e.popupOpen=Ll.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),wy=Cc(function(e,n){let{className:r,render:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=hy(!0),m=a?.store??p;if(!m)throw Error(process.env.NODE_ENV===`production`?I(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let h=ft(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=t.useRef(null),b=c??600,x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=Lc(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=Sy(),{delayRef:T,isInstantPhase:E,hasProvider:D}=ka(v,{open:_});m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=s??O,A=m.useState(`trackCursorAxis`),j=m.useState(`disableHoverablePopup`),M=il(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?Tl():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:c??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return u==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g}),N=Yc(v,{enabled:!k}).reference,P={open:_},F=m.useState(`triggerProps`,C);return J(`button`,e,{state:P,ref:[n,S,y],props:[M,N,F,{onPointerDown(){m.set(`closeOnClick`,l)},id:h,[Cy.triggerDisabled]:k?``:void 0},f],stateAttributesMapping:Ul})});process.env.NODE_ENV!==`production`&&(wy.displayName=`TooltipTrigger`);var Ty=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Ty.displayName=`TooltipPortalContext`);function Ey(){let e=t.useContext(Ty);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(70):`Base UI: <Tooltip.Portal> is missing.`);return e}var Dy=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return hy().useState(`mounted`)||n?(0,O.jsx)(Ty.Provider,{value:n,children:(0,O.jsx)(ty,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(Dy.displayName=`TooltipPortal`);var Oy=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Oy.displayName=`TooltipPositionerContext`);function ky(){let e=t.useContext(Oy);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?I(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}var Ay=t.forwardRef(function(e,n){let{render:r,className:i,anchor:a,positionMethod:o=`absolute`,side:s=`top`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Ee,..._}=e,v=hy(),y=Ey(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=mf({anchor:a,positionMethod:o,floatingRootContext:w,mounted:x,side:s,sideOffset:l,align:c,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:m,arrowPadding:p,disableAnchorTracking:h,keepMounted:y,collisionAvoidance:g,adaptiveOrigin:v.useState(`hasViewport`)?df:void 0}),k=t.useMemo(()=>{let e={};return(!b||S===`both`||C)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...D.positionerStyles,...e}}},[b,S,C,x,D.positionerStyles]),A=t.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),j=t.useMemo(()=>({...A,arrowRef:D.arrowRef,arrowStyles:D.arrowStyles,arrowUncentered:D.arrowUncentered}),[A,D.arrowRef,D.arrowStyles,D.arrowUncentered]),M=J(`div`,e,{state:A,props:[k,gf(E),_],ref:[n,v.useStateSetter(`positionerElement`)],stateAttributesMapping:Gl});return(0,O.jsx)(Oy.Provider,{value:j,children:M})});process.env.NODE_ENV!==`production`&&(Ay.displayName=`TooltipPositioner`);var jy={...Gl,...wt},My=t.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=hy(),{side:o,align:s}=ky(),c=a.useState(`open`),l=a.useState(`instantType`),u=a.useState(`transitionStatus`),d=a.useState(`popupProps`),f=a.useState(`floatingRootContext`);aa({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});let p=a.useState(`disabled`),m=a.useState(`closeDelay`);return nl(f,{enabled:!p,closeDelay:m}),J(`div`,e,{state:{open:c,side:o,align:s,instant:l,transitionStatus:u},ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[d,gf(u),i],stateAttributesMapping:jy})});process.env.NODE_ENV!==`production`&&(My.displayName=`TooltipPopup`);var Ny=t.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=hy().useState(`instantType`),{open:o,arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=ky();return J(`div`,e,{state:{open:o,side:c,align:l,uncentered:u,instant:a},ref:[t,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:Gl})});process.env.NODE_ENV!==`production`&&(Ny.displayName=`TooltipArrow`);var Py=function(e){let{delay:n,closeDelay:r,timeout:i=400}=e,a=t.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),o=t.useMemo(()=>({open:n,close:r}),[n,r]);return(0,O.jsx)(xy.Provider,{value:a,children:(0,O.jsx)(Oa,{delay:o,timeoutMs:i,children:e.children})})};process.env.NODE_ENV!==`production`&&(Py.displayName=`TooltipProvider`);var Fy=Py,Iy=yy,Ly=wy,Ry=t.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,O.jsx)(Dy,{children:(0,O.jsx)(Ay,{sideOffset:t,children:(0,O.jsxs)(My,{ref:r,className:`z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-900 shadow-md transition-all duration-200 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50 ${e||``}`,...n,children:[(0,O.jsx)(Ny,{className:`fill-white dark:fill-neutral-950`}),n.children]})})}));Ry.displayName=`TooltipContent`,e.Accordion=sa,e.AccordionContent=ua,e.AccordionItem=ca,e.AccordionTrigger=la,e.AlertDialog=su,e.AlertDialogContent=du,e.AlertDialogDescription=pu,e.AlertDialogOverlay=uu,e.AlertDialogPortal=lu,e.AlertDialogTitle=fu,e.AlertDialogTrigger=cu,e.Avatar=Su,e.AvatarFallback=wu,e.AvatarImage=Cu,e.Button=Eu,e.Checkbox=ed,e.Collapsible=sd,e.CollapsibleContent=ld,e.CollapsibleTrigger=cd,e.Combobox=kf,e.ComboboxContent=jf,e.ComboboxEmpty=Nf,e.ComboboxInput=Af,e.ComboboxItem=Mf,e.ContextMenu=_p,e.ContextMenuContent=yp,e.ContextMenuItem=bp,e.ContextMenuTrigger=vp,e.Dialog=Sp,e.DialogContent=Ep,e.DialogDescription=Op,e.DialogOverlay=Tp,e.DialogPortal=wp,e.DialogTitle=Dp,e.DialogTrigger=Cp,e.Drawer=tm,e.DrawerContent=am,e.DrawerOverlay=im,e.DrawerPortal=rm,e.DrawerTrigger=nm,e.Field=ym,e.FieldDescription=xm,e.FieldError=Sm,e.FieldLabel=bm,e.Fieldset=Tm,e.FieldsetLegend=Em,e.Form=Om,e.Input=Am,e.Menu=jm,e.MenuContent=Nm,e.MenuItem=Pm,e.MenuSeparator=Fm,e.MenuTrigger=Mm,e.NumberField=Kh,e.Popover=fg,e.PopoverContent=mg,e.PopoverTrigger=pg,e.Progress=wg,e.RadioGroup=Rg,e.RadioGroupItem=zg,e.Select=k_,e.SelectContent=j_,e.SelectItem=M_,e.SelectTrigger=A_,e.Separator=N_,e.Slider=av,e.Switch=fv,e.Tabs=Dv,e.TabsContent=Av,e.TabsList=Ov,e.TabsTrigger=kv,e.Toast=ry,e.ToastDescription=ay,e.ToastProvider=ny,e.ToastTitle=iy,e.Toggle=ly,e.ToggleGroup=py,e.Tooltip=Iy,e.TooltipContent=Ry,e.TooltipProvider=Fy,e.TooltipTrigger=Ly});