strata-ui-react 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20 -16
- package/dist/strata-ui-react.es.js +1477 -1662
- package/package.json +3 -7
- package/dist/strata-ui-react.cjs.js +0 -29
- package/dist/strata-ui-react.umd.js +0 -29
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`),require(`react-dom`)):typeof define==`function`&&define.amd?define([`exports`,`react`,`react-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`strata-ui-react`]={},e.React,e.ReactDOM))})(this,function(e,t,n){var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e));t=d(t),n=d(n);var f=l((e=>{var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),p=l((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=require(`react`).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){var n=t.H;return n===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
|
-
2. You might be breaking the Rules of Hooks
|
|
4
|
-
3. You might have more than one copy of React in the same app
|
|
5
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n.useMemoCache(e)}})()})),m=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=f():t.exports=p()}));function h(e,...t){let n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var g={};function _(e,n){let r=t.useRef(g);return r.current===g&&(r.current=e(n)),r}function v(e,t,n,r){let i=_(b).current;return x(i,e,t,n,r)&&C(i,[e,t,n,r]),i.callback}function y(e){let t=_(b).current;return S(t,e)&&C(t,e),t.callback}function b(){return{callback:null,cleanup:null,refs:[]}}function x(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function S(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function C(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 T(e){return w>=e}function E(e){if(!t.isValidElement(e))return null;let n=e,r=n.props;return(T(19)?r?.ref:n.ref)??null}function D(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function O(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 k(e,t){return typeof e==`function`?e(t):e}function A(e,t){return typeof e==`function`?e(t):e}var j={};function M(e,t,n,r,i){let a={...I(e,j)};return t&&(a=P(a,t)),n&&(a=P(a,n)),r&&(a=P(a,r)),i&&(a=P(a,i)),a}function N(e){if(e.length===0)return j;if(e.length===1)return I(e[0],j);let t={...I(e[0],j)};for(let n=1;n<e.length;n+=1)t=P(t,e[n]);return t}function P(e,t){return te(t)?t(e):ee(e,t)}function ee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=D(e.style,r);break;case`className`:e[n]=ne(e.className,r);break;default:F(n,r)?e[n]=L(e[n],r):e[n]=r}}return e}function F(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 te(e){return typeof e==`function`}function I(e,t){return te(e)?e(t):e??j}function L(e,t){return t?e?n=>{if(re(n)){let r=n;R(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function R(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ne(e,t){return t?e?t+` `+e:t:e}function re(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function z(){}let B=Object.freeze([]),V=Object.freeze({}),H={style:{transition:`none`}},ie={fallbackAxisSide:`end`},ae={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function U(e,t,n={}){let r=t.render,i=oe(t,n);return n.enabled===!1?null:se(e,r,i,n.state??V)}function oe(e,t={}){let{className:n,style:r,render:i}=e,{state:a=V,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?k(n,a):void 0,d=l?A(r,a):void 0,f=l?O(a,c):V,p=l?D(f,Array.isArray(s)?N(s):s)??V:V;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=y([p.ref,E(i),...o]):p.ref=v(p.ref,E(i),o):v(null,null)),l?(u!==void 0&&(p.className=ne(p.className,u)),d!==void 0&&(p.style=D(p.style,d)),p):V}function se(e,n,r,i){if(n){if(typeof n==`function`)return n(r,i);let e=M(r,n.props);return e.ref=r.ref,t.cloneElement(n,e)}if(e&&typeof e==`string`)return ce(e,r);throw Error(process.env.NODE_ENV===`production`?h(8):`Base UI: Render element or function are not defined.`)}function ce(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)}let le=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(le.displayName=`AvatarRootContext`);function ue(){let e=t.useContext(le);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(13):`Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.`);return e}let de={imageLoadingStatus:()=>null};var fe=l((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})),pe=l((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}`,te[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
6
|
-
let props = %s;
|
|
7
|
-
<%s {...props} />
|
|
8
|
-
React keys must be passed directly to JSX without using spread:
|
|
9
|
-
let props = %s;
|
|
10
|
-
<%s key={someKey} {...props} />`,o,p,m,p),te[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={},ee=m.react_stack_bottom_frame.bind(m,o)(),F=M(i(o)),te={};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`):ee,r?M(i(e)):F)},e.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):ee,r?M(i(e)):F)}})()})),W=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=fe():t.exports=pe()}))();let me=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,[o,s]=t.useState(`idle`),c=t.useMemo(()=>({imageLoadingStatus:o}),[o]),l=t.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=U(`span`,e,{state:c,ref:n,props:a,stateAttributesMapping:de});return(0,W.jsx)(le.Provider,{value:l,children:u})});process.env.NODE_ENV!==`production`&&(me.displayName=`AvatarRoot`);var he=t[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ge=he&&he!==t.useLayoutEffect?he:e=>e();function G(e){let t=_(_e).current;return t.next=e,ge(t.effect),t.trampoline}function _e(){let e={next:void 0,callback:ve,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ve(){if(process.env.NODE_ENV!==`production`)throw Error(`Base UI: Cannot call an event handler while rendering.`)}let K=typeof document<`u`?t.useLayoutEffect:()=>{};function ye(e,{referrerPolicy:n,crossOrigin:r}){let[i,a]=t.useState(`idle`);return K(()=>{if(!e)return a(`error`),z;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}let be=t.forwardRef(function(e,n){let{className:r,render:i,onLoadingStatusChange:a,referrerPolicy:o,crossOrigin:s,...c}=e,l=ue(),u=ye(e.src,{referrerPolicy:o,crossOrigin:s}),d=G(e=>{a?.(e),l.setImageLoadingStatus(e)});return K(()=>{u!==`idle`&&d(u)},[u,d]),U(`img`,e,{state:t.useMemo(()=>({imageLoadingStatus:u}),[u]),ref:n,props:c,stateAttributesMapping:de,enabled:u===`loaded`})});process.env.NODE_ENV!==`production`&&(be.displayName=`AvatarImage`);var xe=[];function Se(e){t.useEffect(e,xe)}var Ce=0,we=class e{static create(){return new e}currentId=Ce;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ce,t()},e)}isStarted(){return this.currentId!==Ce}clear=()=>{this.currentId!==Ce&&(clearTimeout(this.currentId),this.currentId=Ce)};disposeEffect=()=>this.clear};function Te(){let e=_(we.create).current;return Se(e.disposeEffect),e}let Ee=t.forwardRef(function(e,n){let{className:r,render:i,delay:a,...o}=e,{imageLoadingStatus:s}=ue(),[c,l]=t.useState(a===void 0),u=Te();return t.useEffect(()=>(a!==void 0&&u.start(a,()=>l(!0)),u.clear),[u,a]),U(`span`,e,{state:t.useMemo(()=>({imageLoadingStatus:s}),[s]),ref:n,props:o,stateAttributesMapping:de,enabled:s!==`loaded`&&c})});process.env.NODE_ENV!==`production`&&(Ee.displayName=`AvatarFallback`);function De(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=De(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Oe(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=De(e))&&(r&&(r+=` `),r+=t);return r}var ke=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ae=(e,t)=>({classGroupId:e,validator:t}),je=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Me=`-`,Ne=[],Pe=`arbitrary..`,Fe=e=>{let t=Re(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Le(e);let n=e.split(Me);return Ie(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ke(i,t):t:i||Ne}return n[e]||Ne}}},Ie=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ie(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Me):e.slice(t).join(Me),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Le=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Pe+r:void 0})(),Re=e=>{let{theme:t,classGroups:n}=e;return ze(n,t)},ze=(e,t)=>{let n=je();for(let r in e){let i=e[r];Be(i,n,r,t)}return n},Be=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ve(i,t,n,r)}},Ve=(e,t,n,r)=>{if(typeof e==`string`){He(e,t,n);return}if(typeof e==`function`){Ue(e,t,n,r);return}We(e,t,n,r)},He=(e,t,n)=>{let r=e===``?t:Ge(t,e);r.classGroupId=n},Ue=(e,t,n,r)=>{if(Ke(e)){Be(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ae(n,e))},We=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Be(o,Ge(t,a),n,r)}},Ge=(e,t)=>{let n=e,r=t.split(Me),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=je(),n.nextPart.set(t,i)),n=i}return n},Ke=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,qe=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Je=`!`,Ye=`:`,Xe=[],Ze=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Qe=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Ye){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Je)?(c=s.slice(0,-1),l=!0):s.startsWith(Je)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ze(t,l,c,u)};if(t){let e=t+Ye,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ze(Xe,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},$e=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},et=e=>({cache:qe(e.cacheSize),parseClassName:Qe(e),sortModifiers:$e(e),...Fe(e)}),tt=/\s+/,nt=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(tt),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Je:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},rt=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=it(n))&&(i&&(i+=` `),i+=r);return i},it=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=it(e[r]))&&(n&&(n+=` `),n+=t);return n},at=(e,...t)=>{let n,r,i,a,o=o=>(n=et(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=nt(e,n);return i(e,a),a};return a=o,(...e)=>a(rt(...e))},ot=[],st=e=>{let t=t=>t[e]||ot;return t.isThemeGetter=!0,t},ct=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ut=/^\d+\/\d+$/,dt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ft=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ht=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gt=e=>ut.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),_t=e=>!!e&&Number.isInteger(Number(e)),vt=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),yt=e=>dt.test(e),bt=()=>!0,xt=e=>ft.test(e)&&!pt.test(e),St=()=>!1,Ct=e=>mt.test(e),wt=e=>ht.test(e),Tt=e=>!J(e)&&!Y(e),Et=e=>Rt(e,Ht,St),J=e=>ct.test(e),Dt=e=>Rt(e,Ut,xt),Ot=e=>Rt(e,Wt,q),kt=e=>Rt(e,Bt,St),At=e=>Rt(e,Vt,wt),jt=e=>Rt(e,Kt,Ct),Y=e=>lt.test(e),Mt=e=>zt(e,Ut),Nt=e=>zt(e,Gt),Pt=e=>zt(e,Bt),Ft=e=>zt(e,Ht),It=e=>zt(e,Vt),Lt=e=>zt(e,Kt,!0),Rt=(e,t,n)=>{let r=ct.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zt=(e,t,n=!1)=>{let r=lt.exec(e);return r?r[1]?t(r[1]):n:!1},Bt=e=>e===`position`||e===`percentage`,Vt=e=>e===`image`||e===`url`,Ht=e=>e===`length`||e===`size`||e===`bg-size`,Ut=e=>e===`length`,Wt=e=>e===`number`,Gt=e=>e===`family-name`,Kt=e=>e===`shadow`,qt=at(()=>{let e=st(`color`),t=st(`font`),n=st(`text`),r=st(`font-weight`),i=st(`tracking`),a=st(`leading`),o=st(`breakpoint`),s=st(`container`),c=st(`spacing`),l=st(`radius`),u=st(`shadow`),d=st(`inset-shadow`),f=st(`text-shadow`),p=st(`drop-shadow`),m=st(`blur`),h=st(`perspective`),g=st(`aspect`),_=st(`ease`),v=st(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[gt,`full`,`auto`,...w()],E=()=>[_t,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,_t,Y,J]},_t,Y,J],O=()=>[_t,`auto`,Y,J],k=()=>[`auto`,`min`,`max`,`fr`,Y,J],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[gt,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Y,J],ee=()=>[...b(),Pt,kt,{position:[Y,J]}],F=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,Ft,Et,{size:[Y,J]}],I=()=>[vt,Mt,Dt],L=()=>[``,`none`,`full`,l,Y,J],R=()=>[``,q,Mt,Dt],ne=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[q,vt,Pt,kt],B=()=>[``,`none`,m,Y,J],V=()=>[`none`,q,Y,J],H=()=>[`none`,q,Y,J],ie=()=>[q,Y,J],ae=()=>[gt,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[yt],breakpoint:[yt],color:[bt],container:[yt],"drop-shadow":[yt],ease:[`in`,`out`,`in-out`],font:[Tt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[yt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[yt],shadow:[yt],spacing:[`px`,q],text:[yt],"text-shadow":[yt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,gt,J,Y,g]}],container:[`container`],columns:[{columns:[q,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[_t,`auto`,Y,J]}],basis:[{basis:[gt,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,gt,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[_t,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Mt,Dt]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Y,Ot]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,vt,J]}],"font-family":[{font:[Nt,J,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,Ot]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ne(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Dt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},_t,Y,J],radial:[``,Y,J],conic:[_t,Y,J]},It,At]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ne(),`hidden`,`none`]}],"divide-style":[{divide:[...ne(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ne(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,Mt,Dt]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Lt,jt]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Lt,jt]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[q,Dt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Lt,jt]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:B()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Lt,jt]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":[`scale-3d`],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[q,Mt,Dt,Ot]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function X(...e){return qt(Oe(e))}var Jt=m();let Yt=e=>{let t=(0,Jt.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`inline-flex size-xl items-center justify-center overflow-hidden rounded-full bg-surface-container align-middle font-medium select-none raised-2`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(me,{"data-slot":`avatar`,className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var Xt=m();let Zt=e=>{let t=(0,Xt.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`size-full object-cover`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,W.jsx)(be,{"data-slot":`avatar-image`,className:a,ref:i,...r}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o};var Qt=m();let $t=e=>{let t=(0,Qt.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`flex size-full items-center justify-center`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,W.jsx)(Ee,{"data-slot":`avatar-fallback`,className:a,ref:i,...r}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o};var en=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;let tn=Oe,nn=(e,t)=>n=>{if(t?.variants==null)return tn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=en(t)||en(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return tn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},rn=nn(`inline-flex items-center justify-center whitespace-nowrap select-none transition-all px-xs py-3xs gap-3xs font-medium`,{variants:{tone:{primary:``,secondary:``,tertiary:``,neutral:``,error:``,success:``,warning:``},style:{solid:`raised-1`,outline:`bg-transparent outline outline-2`},radius:{rounded:`rounded-lg`,circle:`rounded-full`}},defaultVariants:{tone:`neutral`,style:`solid`,radius:`rounded`},compoundVariants:[{tone:`primary`,style:`solid`,className:`bg-primary text-on-primary`},{tone:`primary`,style:`outline`,className:`outline-primary text-primary`},{tone:`secondary`,style:`solid`,className:`bg-secondary text-on-secondary`},{tone:`secondary`,style:`outline`,className:`outline-secondary text-secondary`},{tone:`tertiary`,style:`solid`,className:`bg-tertiary text-on-tertiary`},{tone:`tertiary`,style:`outline`,className:`outline-tertiary text-tertiary`},{tone:`neutral`,style:`solid`,className:`bg-surface-container`},{tone:`neutral`,style:`outline`,className:`outline-on-surface text-on-surface`},{tone:`error`,style:`solid`,className:`bg-error text-on-error`},{tone:`error`,style:`outline`,className:`outline-error text-error`},{tone:`success`,style:`solid`,className:`bg-success text-on-success`},{tone:`success`,style:`outline`,className:`outline-success text-success`},{tone:`warning`,style:`solid`,className:`bg-warning text-on-warning`},{tone:`warning`,style:`outline`,className:`outline-warning text-warning`}]});var an=m();let on=e=>{let t=(0,an.c)(18),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,tone:c,style:s,radius:a,children:n,ref:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l;t[8]!==r||t[9]!==a||t[10]!==s||t[11]!==c?(l=X(rn({className:r,tone:c,style:s,radius:a})),t[8]=r,t[9]=a,t[10]=s,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==n||t[14]!==i||t[15]!==o||t[16]!==l?(u=(0,W.jsx)(`div`,{className:l,ref:o,...i,children:n}),t[13]=n,t[14]=i,t[15]=o,t[16]=l,t[17]=u):u=t[17],u},sn=nn(`inline-flex items-center justify-center whitespace-nowrap rounded-full select-none transition-all disabled:pointer-events-none disabled:opacity-50 cursor-pointer`,{variants:{tone:{destructive:``,glass:``,neutral:``,primary:``,secondary:``,success:``,accent:``,warning:``},style:{solid:``,outline:`active:border-transparent`,ghost:``},size:{large:`h-2xl px-lg style-text-default-1 gap-xs [&>svg]:size-md`,medium:`h-xl px-md style-text-default-0 gap-2xs [&>svg]:size-sm`,small:`h-lg px-sm style-text-default--1 gap-3xs [&>svg]:size-xs`,iconLarge:`size-2xl p-0 [&>svg]:size-md`,iconMedium:`size-xl p-0 [&>svg]:size-sm`,iconSmall:`size-lg p-0 [&>svg]:size-xs`}},defaultVariants:{tone:`primary`,style:`solid`,size:`medium`},compoundVariants:[{tone:`primary`,style:`solid`,className:`bg-primary text-on-primary`},{tone:`primary`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`primary`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`primary`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`primary`,style:`outline`,className:`border-primary text-primary hover:text-on-primary-container hover:bg-primary-container active:bg-transparent`},{tone:`primary`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`primary`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`primary`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`primary`,style:`ghost`,className:`text-primary hover:surface-bright active:bg-surface-dim`},{tone:`primary`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`primary`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`primary`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`secondary`,style:`solid`,className:`bg-secondary text-on-secondary`},{tone:`secondary`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`secondary`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`secondary`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`secondary`,style:`outline`,className:`border-secondary text-secondary hover:text-on-secondary-container hover:bg-secondary-container active:bg-transparent`},{tone:`secondary`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`secondary`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`secondary`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`secondary`,style:`ghost`,className:`text-secondary hover:surface-bright active:bg-surface-dim`},{tone:`secondary`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`secondary`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`secondary`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`accent`,style:`solid`,className:`bg-accent text-on-accent`},{tone:`accent`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`accent`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`accent`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`accent`,style:`outline`,className:`border-accent text-accent hover:text-on-accent-container hover:bg-accent-container active:bg-transparent`},{tone:`accent`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`accent`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`accent`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`accent`,style:`ghost`,className:`text-accent hover:surface-bright active:bg-surface-dim`},{tone:`accent`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`accent`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`accent`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`success`,style:`solid`,className:`bg-success text-on-success`},{tone:`success`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`success`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`success`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`success`,style:`outline`,className:`border-success text-success hover:text-on-success-container hover:bg-success-container active:bg-transparent`},{tone:`success`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`success`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`success`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`success`,style:`ghost`,className:`text-success hover:surface-bright active:bg-surface-dim`},{tone:`success`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`success`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`success`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`warning`,style:`solid`,className:`bg-warning text-on-warning`},{tone:`warning`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`warning`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`warning`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`warning`,style:`outline`,className:`border-warning text-warning hover:text-on-warning-container hover:bg-warning-container active:bg-transparent`},{tone:`warning`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`warning`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`warning`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`warning`,style:`ghost`,className:`text-warning hover:surface-bright active:bg-surface-dim`},{tone:`warning`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`warning`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`warning`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`destructive`,style:`solid`,className:`bg-error text-on-error`},{tone:`destructive`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`destructive`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`destructive`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`destructive`,style:`outline`,className:`border-error text-error hover:text-on-error-container hover:bg-error-container active:bg-transparent`},{tone:`destructive`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`destructive`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`destructive`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`destructive`,style:`ghost`,className:`text-error hover:surface-bright active:bg-surface-dim`},{tone:`destructive`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`destructive`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`destructive`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`},{tone:`neutral`,style:`solid`,className:`bg-surface-container text-on-surface`},{tone:`neutral`,style:`solid`,size:[`small`,`iconSmall`],className:`raised-1 hover:raised-2 active:inset-shadow-1-shadow`},{tone:`neutral`,style:`solid`,size:[`medium`,`iconMedium`],className:`raised-2 hover:raised-4 active:inset-shadow-2-shadow`},{tone:`neutral`,style:`solid`,size:[`large`,`iconLarge`],className:`raised-4 hover:raised-8 active:inset-shadow-3-shadow`},{tone:`neutral`,style:`outline`,className:`border-outline text-on-surface hover:text-on-surface hover:bg-surface-container-high active:bg-transparent`},{tone:`neutral`,style:`outline`,size:[`small`,`iconSmall`],className:`border-1`},{tone:`neutral`,style:`outline`,size:[`medium`,`iconMedium`],className:`border-2`},{tone:`neutral`,style:`outline`,size:[`large`,`iconLarge`],className:`border-4`},{tone:`neutral`,style:`ghost`,className:`text-on-surface hover:surface-bright active:bg-surface-dim`},{tone:`neutral`,style:`ghost`,size:[`small`,`iconSmall`],className:`hover:raised-1 active:inset-shadow-1-shadow`},{tone:`neutral`,style:`ghost`,size:[`medium`,`iconMedium`],className:`hover:raised-2 active:inset-shadow-2-shadow`},{tone:`neutral`,style:`ghost`,size:[`large`,`iconLarge`],className:`hover:raised-4 active:inset-shadow-3-shadow`}]});var cn=m();function ln(e){let t=(0,cn.c)(16),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,tone:s,style:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c;t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s?(c=X(sn({tone:s,style:o,size:a,className:r})),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==n||t[13]!==i||t[14]!==c?(l=(0,W.jsx)(`button`,{className:c,...i,children:n}),t[12]=n,t[13]=i,t[14]=c,t[15]=l):l=t[15],l}function un({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(`
|
|
11
|
-
`))},[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(`
|
|
12
|
-
`))},[JSON.stringify(n)])}return[c,t.useCallback(e=>{a||s(e)},[])]}let dn={clip:`rect(0 0 0 0)`,overflow:`hidden`,whiteSpace:`nowrap`,position:`fixed`,top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},fn=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}({}),pn=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}({}),mn={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hn={valid(e){return e===null?null:e?{[pn.valid]:``}:{[pn.invalid]:``}}};function gn(e){return t.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[fn.checked]:``}:{[fn.unchecked]:``}},...hn}),[e.indeterminate])}let _n={...t};var vn=0;function yn(e,n=`mui`){let[r,i]=t.useState(e),a=e||r;return t.useEffect(()=>{r??(vn+=1,i(`${n}-${vn}`))},[r,n]),a}var bn=_n.useId;function xn(e,t){if(bn!==void 0){let n=bn();return e??(t?`${t}-${n}`:n)}return yn(e,t)}function Sn(e){return xn(e,`base-ui`)}function Cn(){return typeof window<`u`}function wn(e){return Dn(e)?(e.nodeName||``).toLowerCase():`#document`}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function En(e){return((Dn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Dn(e){return Cn()?e instanceof Node||e instanceof Tn(e).Node:!1}function Z(e){return Cn()?e instanceof Element||e instanceof Tn(e).Element:!1}function On(e){return Cn()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function kn(e){return!Cn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}var An=new Set([`inline`,`contents`]);function jn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!An.has(i)}var Mn=new Set([`table`,`td`,`th`]);function Nn(e){return Mn.has(wn(e))}var Pn=[`:popover-open`,`:modal`];function Fn(e){return Pn.some(t=>{try{return e.matches(t)}catch{return!1}})}var In=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Ln=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Rn=[`paint`,`layout`,`strict`,`content`];function zn(e){let t=Vn(),n=Z(e)?Wn(e):e;return In.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Ln.some(e=>(n.willChange||``).includes(e))||Rn.some(e=>(n.contain||``).includes(e))}function Bn(e){let t=Kn(e);for(;On(t)&&!Un(t);){if(zn(t))return t;if(Fn(t))return null;t=Kn(t)}return null}function Vn(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Hn=new Set([`html`,`body`,`#document`]);function Un(e){return Hn.has(wn(e))}function Wn(e){return Tn(e).getComputedStyle(e)}function Gn(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kn(e){if(wn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||kn(e)&&e.host||En(e);return kn(t)?t.host:t}function qn(e){let t=Kn(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&jn(t)?t:qn(t)}function Jn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qn(e),i=r===e.ownerDocument?.body,a=Tn(r);if(i){let e=Yn(a);return t.concat(a,a.visualViewport||[],jn(r)?r:[],e&&n?Jn(e):[])}return t.concat(r,Jn(r,[],n))}function Yn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Xn;process.env.NODE_ENV!==`production`&&(Xn=new Set);function Zn(...e){if(process.env.NODE_ENV!==`production`){let t=e.join(` `);Xn.has(t)||(Xn.add(t),console.error(`Base UI: ${t}`))}}let Qn=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Qn.displayName=`CompositeRootContext`);function $n(e=!1){let n=t.useContext(Qn);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(16):`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return n}function er(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 tr(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0}=e,o=t.useRef(null),s=$n(!0)!==void 0,c=G(()=>{let e=o.current;return!!(e?.tagName===`A`&&e?.href)}),{props:l}=er({focusableWhenDisabled:r,disabled:n,composite:s,tabIndex:i,isNativeButton:a});process.env.NODE_ENV!==`production`&&t.useEffect(()=>{if(!o.current)return;let e=o.current.tagName===`BUTTON`;a?e||Zn("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):e&&Zn("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[a]);let u=t.useCallback(()=>{let e=o.current;nr(e)&&s&&n&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,l.disabled,s]);return K(u,[u]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...u}=e;return M({type:a?`button`:void 0,onClick(e){if(n){e.preventDefault();return}t?.(e)},onMouseDown(e){n||r?.(e)},onKeyDown(e){if(n||(R(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!a&&!c()&&!n,i=e.key===`Enter`,s=e.key===` `;r&&((s||i)&&e.preventDefault(),i&&t?.(e))},onKeyUp(e){n||(R(e),i?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!a&&!n&&e.key===` `&&t?.(e)},onPointerDown(e){if(n){e.preventDefault();return}s?.(e)}},a?void 0:{role:`button`},l,u)},[n,l,a,c]),buttonRef:G(e=>{o.current=e,u()})}}function nr(e){return On(e)&&e.tagName===`BUTTON`}let rr=t.createContext({invalid:void 0,name:void 0,validityData:{state:mn,errors:[],error:``,value:``,initialValue:null},setValidityData:z,disabled:void 0,touched:!1,setTouched:z,dirty:!1,setDirty:z,filled:!1,setFilled:z,focused:!1,setFocused:z,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=V)=>e,getInputValidationProps:(e=V)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!==`production`&&(rr.displayName=`FieldRootContext`);function ir(e=!0){let n=t.useContext(rr);if(n.setValidityData===z&&!e)throw Error(process.env.NODE_ENV===`production`?h(28):`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return n}let ar=t.createContext({disabled:!1});process.env.NODE_ENV!==`production`&&(ar.displayName=`FieldItemContext`);function or(){return t.useContext(ar)}function sr(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let cr=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:z,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});process.env.NODE_ENV!==`production`&&(cr.displayName=`FormContext`);function lr(){return t.useContext(cr)}function ur(e){let{enabled:t=!0,value:r,id:i,name:a,controlRef:o,commit:s}=e,{formRef:c}=lr(),{invalid:l,markedDirtyRef:u,validityData:d,setValidityData:f}=ir(),p=G(e.getValue);K(()=>{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]),K(()=>{!t||!i||c.current.fields.set(i,{getValue:p,name:a,controlRef:o,validityData:sr(d,l),validate(){let e=r;e===void 0&&(e=p()),u.current=!0,n.flushSync(()=>s(e))}})},[s,o,t,c,p,i,l,u,a,d,r]),K(()=>{let e=c.current.fields;return()=>{i&&e.delete(i)}},[c,i])}let dr=t.createContext({controlId:void 0,setControlId:z,labelId:void 0,setLabelId:z,messageIds:[],setMessageIds:z,getDescriptionProps:e=>e});process.env.NODE_ENV!==`production`&&(dr.displayName=`LabelableContext`);function fr(){return t.useContext(dr)}let pr=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(pr.displayName=`CheckboxGroupContext`);function mr(e=!0){let n=t.useContext(pr);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(3):`Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.`);return n}let hr=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(hr.displayName=`CheckboxRootContext`);function gr(){let e=t.useContext(hr);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(14):`Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.`);return e}let _r=`none`,vr=`trigger-press`,yr=`trigger-hover`,br=`trigger-focus`,xr=`imperative-action`;function Sr(e,t,n,r){let i=!1,a=!1,o=r??V;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 Cr(e,n){let r=t.useRef(e),i=G(n);K(()=>{r.current!==e&&i(r.current)},[e,i]),K(()=>{r.current=e},[e])}let wr=t.forwardRef(function(e,n){let{checked:r,className:i,defaultChecked:a=!1,disabled:o=!1,id:s,indeterminate:c=!1,inputRef:l,name:u,onCheckedChange:d,parent:f=!1,readOnly:p=!1,render:m,required:h=!1,uncheckedValue:g,value:_,nativeButton:y=!1,...b}=e,{clearErrors:x}=lr(),{disabled:S,name:C,setDirty:w,setFilled:T,setFocused:E,setTouched:D,state:O,validationMode:k,validityData:A,shouldValidateOnChange:j,validation:N}=ir(),P=or(),{labelId:ee,controlId:F,setControlId:te,getDescriptionProps:I}=fr(),L=mr(),R=L?.parent,ne=R&&L.allValues,re=S||P.disabled||L?.disabled||o,B=C??u,H=_??B,ie=Sn(),ae=Sn(),oe=F;ne?oe=f?ae:`${R.id}-${H}`:s&&(oe=s);let se={};ne&&(f?se=L.parent.getParentProps():H&&(se=L.parent.getChildProps(H)));let ce=G(d),{checked:le=r,indeterminate:ue=c,onCheckedChange:de,...fe}=se,pe=L?.value,me=L?.setValue,he=L?.defaultValue,ge=t.useRef(null),{getButtonProps:_e,buttonRef:ve}=tr({disabled:re,native:y}),ye=L?.validation??N,[be,xe]=un({controlled:H&&pe&&!f?pe.includes(H):le,default:H&&he&&!f?he.includes(H):a,name:`Checkbox`,state:`checked`});K(()=>{if(te!==z)return te(oe),()=>{te(void 0)}},[oe,L,te,f]),ur({enabled:!L,id:ie,commit:ye.commit,value:be,controlRef:ge,name:B,getValue:()=>be});let Se=t.useRef(null),Ce=v(l,Se,ye.inputRef);K(()=>{Se.current&&(Se.current.indeterminate=ue,be&&T(!0))},[be,ue,T]),Cr(be,()=>{L&&!f||(x(B),T(be),w(be!==A.initialValue),j()?ye.commit(be):ye.commit(be,!0))});let we=M({checked:be,disabled:re,name:f?void 0:B,id:oe??void 0,required:h,ref:Ce,style:dn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Sr(_r,e.nativeEvent);de?.(t,n),ce(t,n),!n.isCanceled&&(xe(t),H&&pe&&me&&!f&&me(t?[...pe,H]:pe.filter(e=>e!==H),n))},onFocus(){ge.current?.focus()}},_===void 0?V:{value:(L?be&&_:_)||``},I,L?ye.getValidationProps:ye.getInputValidationProps),Te=ne?!!le:be,Ee=ne&&ue||c;t.useEffect(()=>{R&&H&&R.disabledStatesRef.current.set(H,re)},[R,re,H]);let De=t.useMemo(()=>({...O,checked:Te,disabled:re,readOnly:p,required:h,indeterminate:Ee}),[O,Te,re,p,h,Ee]),Oe=gn(De),ke=U(`span`,e,{state:De,ref:[ve,ge,n,L?.registerControlRef],props:[{id:ie,role:`checkbox`,"aria-checked":ue?`mixed`:be,"aria-readonly":p||void 0,"aria-required":h||void 0,"aria-labelledby":ee,"data-parent":f?``:void 0,onFocus(){E(!0)},onBlur(){let e=Se.current;e&&(D(!0),E(!1),k===`onBlur`&&ye.commit(L?pe:e.checked))},onClick(e){p||re||(e.preventDefault(),Se.current?.click())}},I,ye.getValidationProps,b,fe,_e],stateAttributesMapping:Oe});return(0,W.jsxs)(hr.Provider,{value:De,children:[ke,!be&&!L&&B&&!f&&g!==void 0&&(0,W.jsx)(`input`,{type:`hidden`,name:B,value:g}),(0,W.jsx)(`input`,{...we})]})});process.env.NODE_ENV!==`production`&&(wr.displayName=`CheckboxRoot`);function Tr(e){let t=_(Er,e).current;return t.next=e,K(t.effect),t}function Er(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Dr=null,Or=globalThis.requestAnimationFrame,kr=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===`test`&&Or!==requestAnimationFrame&&(Or=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)}},Ar=class e{static create(){return new e}static request(e){return kr.request(e)}static cancel(e){return kr.cancel(e)}currentId=Dr;request(e){this.cancel(),this.currentId=kr.request(()=>{this.currentId=Dr,e()})}cancel=()=>{this.currentId!==Dr&&(kr.cancel(this.currentId),this.currentId=Dr)};disposeEffect=()=>this.cancel};function jr(){let e=_(Ar.create).current;return Se(e.disposeEffect),e}function Mr(e){return e==null?e:`current`in e?e.current:e}function Nr(e,t=!1,r=!0){let i=jr();return G((a,o=null)=>{i.cancel();let s=Mr(e);s!=null&&(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED?a():i.request(()=>{function e(){s&&Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{o!=null&&o.aborted||n.flushSync(a)}).catch(()=>{if(r){if(o!=null&&o.aborted)return;n.flushSync(a)}else s.getAnimations().length>0&&s.getAnimations().some(e=>e.pending||e.playState!==`finished`)&&e()})}t?i.request(e):e()}))})}function Pr(e){let{enabled:n=!0,open:r,ref:i,onComplete:a}=e,o=Tr(r),s=G(a),c=Nr(i,r);t.useEffect(()=>{n&&c(()=>{r===o.current&&s()})},[n,r,s,c,o])}function Fr(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),K(()=>{if(!e&&o&&i!==`ending`&&r){let e=Ar.request(()=>{a(`ending`)});return()=>{Ar.cancel(e)}}},[e,o,i,r]),K(()=>{if(!e||n)return;let t=Ar.request(()=>{a(void 0)});return()=>{Ar.cancel(t)}},[n,e]),K(()=>{if(!e||!n)return;e&&o&&i!==`idle`&&a(`starting`);let t=Ar.request(()=>{a(`idle`)});return()=>{Ar.cancel(t)}},[n,e,o,a,i]),t.useMemo(()=>({mounted:o,setMounted:s,transitionStatus:i}),[o,i])}let Ir=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({});var Lr={[Ir.startingStyle]:``},Rr={[Ir.endingStyle]:``};let zr={transitionStatus(e){return e===`starting`?Lr:e===`ending`?Rr:null}},Br=t.forwardRef(function(e,n){let{render:r,className:i,keepMounted:a=!1,...o}=e,s=gr(),c=s.checked||s.indeterminate,{transitionStatus:l,setMounted:u}=Fr(c),d=t.useRef(null),f=t.useMemo(()=>({...s,transitionStatus:l}),[s,l]);Pr({open:c,ref:d,onComplete(){c||u(!1)}});let p=gn(s),m=t.useMemo(()=>({...p,...zr,...hn}),[p]),h=a||c,g=U(`span`,e,{enabled:h,ref:[n,d],state:f,stateAttributesMapping:m,props:o});return h?g:null});process.env.NODE_ENV!==`production`&&(Br.displayName=`CheckboxIndicator`);var Vr=m();let Hr=e=>{let t=(0,Vr.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,W.jsx)(Br,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};var Ur=new Map([[`bold`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),t.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),Wr=new Map([[`bold`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),t.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),Gr=new Map([[`bold`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),t.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,t.createElement(t.Fragment,null,t.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),Kr=(0,t.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),qr=t.forwardRef((e,n)=>{let{alt:r,color:i,size:a,weight:o,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=t.useContext(Kr);return t.createElement(`svg`,{ref:n,xmlns:`http://www.w3.org/2000/svg`,width:a??f,height:a??f,fill:i??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!r&&t.createElement(`title`,null,r),c,l.get(o??p))});qr.displayName=`IconBase`;var Jr=t.forwardRef((e,n)=>t.createElement(qr,{ref:n,...e,weights:Ur}));Jr.displayName=`CaretUpIcon`;var Yr=t.forwardRef((e,n)=>t.createElement(qr,{ref:n,...e,weights:Wr}));Yr.displayName=`CheckIcon`;var Xr=t.forwardRef((e,n)=>t.createElement(qr,{ref:n,...e,weights:Gr}));Xr.displayName=`XIcon`;var Zr=m();let Qr=e=>{let t=(0,Zr.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:n,ref:s,label:a,id:i,disabled:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c;t[7]===n?c=t[8]:(c=X(`flex size-md items-center text-on-accent justify-center rounded-sm bg-surface-dim inset-shadow-1-shadow data-checked:bg-accent data-checked:raised-1 hover:cursor-pointer transition-colors hover:disabled:cursor-not-allowed`,n),t[7]=n,t[8]=c);let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(Hr,{children:(0,W.jsx)(Yr,{weight:`bold`})}),t[9]=l):l=t[9];let u;t[10]!==r||t[11]!==i||t[12]!==o||t[13]!==s||t[14]!==c?(u=(0,W.jsx)(wr,{id:i,disabled:r,className:c,ref:s,...o,children:l}),t[10]=r,t[11]=i,t[12]=o,t[13]=s,t[14]=c,t[15]=u):u=t[15];let d;t[16]!==r||t[17]!==i||t[18]!==a?(d=a&&(0,W.jsx)(`label`,{htmlFor:i,className:X(`body-base cursor-pointer`,r&&`text-text-neutral-primary-disabled cursor-not-allowed`),children:a}),t[16]=r,t[17]=i,t[18]=a,t[19]=d):d=t[19];let f;return t[20]!==u||t[21]!==d?(f=(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,d]}),t[20]=u,t[21]=d,t[22]=f):f=t[22],f},$r=t.createContext(void 0);process.env.NODE_ENV!==`production`&&($r.displayName=`DialogRootContext`);function ei(e){let n=t.useContext($r);if(e===!1&&n===void 0)throw Error(process.env.NODE_ENV===`production`?h(27):`Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.`);return n}let ti=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Ir.startingStyle]=`startingStyle`,e[e.endingStyle=Ir.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e}({}),ni=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({});var ri={[ni.popupOpen]:``};ni.popupOpen,ni.pressed;var ii={[ti.open]:``},ai={[ti.closed]:``},oi={[ti.anchorHidden]:``};let si={open(e){return e?ri:null}},ci={open(e){return e?ii:ai},anchorHidden(e){return e?oi:null}};var li={...ci,...zr};let ui=t.forwardRef(function(e,n){let{render:r,className:i,forceRender:a=!1,...o}=e,{store:s}=ei(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d=s.useState(`transitionStatus`);return U(`div`,e,{state:t.useMemo(()=>({open:c,transitionStatus:d}),[c,d]),ref:[s.context.backdropRef,n],stateAttributesMapping:li,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});process.env.NODE_ENV!==`production`&&(ui.displayName=`DialogBackdrop`);let di=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=ei(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Sr(`close-press`,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=tr({disabled:a,native:o});return U(`button`,e,{state:t.useMemo(()=>({disabled:a}),[a]),ref:[n,f],props:[{onClick:u},s,d]})});process.env.NODE_ENV!==`production`&&(di.displayName=`DialogClose`);let fi=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=ei(),s=Sn(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),U(`p`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(fi.displayName=`DialogDescription`);var pi=typeof navigator<`u`,mi=Ci(),hi=Ti(),gi=wi();let _i=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),vi=mi.platform===`MacIntel`&&mi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(mi.platform);pi&&/firefox/i.test(gi);let yi=pi&&/apple/i.test(navigator.vendor);pi&&/Edg/i.test(gi);let bi=pi&&/android/i.test(hi)||/android/i.test(gi),xi=pi&&hi.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,Si=gi.includes(`jsdom/`);function Ci(){if(!pi)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 wi(){if(!pi)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Ti(){if(!pi)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}let Ei=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Di(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&kn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Oi(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ki(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 Ai(e){return e.matches(`html,body`)}function ji(e){return e?.ownerDocument||document}function Mi(e){return On(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ni(e){return e?e.getAttribute(`role`)===`combobox`&&Mi(e):!1}function Pi(e){if(!e||Si)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Fi(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ii(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ii(e,t.id,n)])}function Li(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 Ri(e){e.preventDefault(),e.stopPropagation()}function zi(e){return`nativeEvent`in e}function Bi(e){return e.mozInputSource===0&&e.isTrusted?!0:bi&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Vi(e){return Si?!1:!bi&&e.width===0&&e.height===0||bi&&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 Hi(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ui(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Wi=[`top`,`right`,`bottom`,`left`],Gi=Math.min,Ki=Math.max,qi=Math.round,Ji=Math.floor,Yi=e=>({x:e,y:e}),Xi={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Zi={start:`end`,end:`start`};function Qi(e,t,n){return Ki(e,Gi(t,n))}function $i(e,t){return typeof e==`function`?e(t):e}function ea(e){return e.split(`-`)[0]}function ta(e){return e.split(`-`)[1]}function na(e){return e===`x`?`y`:`x`}function ra(e){return e===`y`?`height`:`width`}var ia=new Set([`top`,`bottom`]);function aa(e){return ia.has(ea(e))?`y`:`x`}function oa(e){return na(aa(e))}function sa(e,t,n){n===void 0&&(n=!1);let r=ta(e),i=oa(e),a=ra(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ga(o)),[o,ga(o)]}function ca(e){let t=ga(e);return[la(e),t,la(t)]}function la(e){return e.replace(/start|end/g,e=>Zi[e])}var ua=[`left`,`right`],da=[`right`,`left`],fa=[`top`,`bottom`],pa=[`bottom`,`top`];function ma(e,t,n){switch(e){case`top`:case`bottom`:return n?t?da:ua:t?ua:da;case`left`:case`right`:return t?fa:pa;default:return[]}}function ha(e,t,n,r){let i=ta(e),a=ma(ea(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(la)))),a}function ga(e){return e.replace(/left|right|bottom|top/g,e=>Xi[e])}function _a(e){return{top:0,right:0,bottom:0,left:0,...e}}function va(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_a(e)}function ya(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 ba(e,t,n){return Math.floor(e/t)!==n}function xa(e,t){return t<0||t>=e.current.length}function Sa(e,t){return wa(e,{disabledIndices:t})}function Ca(e,t){return wa(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function wa(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&&ka(e,a,r));return a}function Ta(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=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!ka(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===`ArrowUp`){let n=g(`up`);if(n!==void 0)u&&Ri(t),d=n;else{if(u&&Ri(t),l===-1)d=c;else if(d=wa(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}xa(e,d)&&(d=l)}}if(t.key===`ArrowDown`){let n=g(`down`);n===void 0?(u&&Ri(t),l===-1?d=s:(d=wa(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=wa(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),xa(e,d)&&(d=l)):(u&&Ri(t),d=n)}if(n===`both`){let n=Ji(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&Ri(t),l%a===a-1?r&&(d=wa(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=wa(e,{startingIndex:l,disabledIndices:o}),r&&ba(d,a,n)&&(d=wa(e,{startingIndex:l-l%a-1,disabledIndices:o}))),ba(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&Ri(t),l%a===0?r&&(d=wa(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=wa(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&ba(d,a,n)&&(d=wa(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),ba(d,a,n)&&(d=l));let s=Ji(c/a)===n;xa(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:wa(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function Ea(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(process.env.NODE_ENV===`production`?h(29,o):`[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 Da(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 Oa(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function ka(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var Aa=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`].join(`,`),ja=typeof Element>`u`,Ma=ja?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Na=!ja&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Pa=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&Pa(e.parentNode)},Fa=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Ia=function(e,t,n){if(Pa(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Aa));return t&&Ma.call(e,Aa)&&r.unshift(e),r=r.filter(n),r},La=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Pa(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=La(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Ma.call(a,Aa)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Pa(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=La(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},Ra=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},za=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Fa(e))&&!Ra(e)?0:e.tabIndex},Ba=function(e,t){var n=za(e);return n<0&&t&&!Ra(e)?0:n},Va=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ha=function(e){return e.tagName===`INPUT`},Ua=function(e){return Ha(e)&&e.type===`hidden`},Wa=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ga=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Ka=function(e){if(!e.name)return!0;var t=e.form||Na(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=Ga(r,e.form);return!i||i===e},qa=function(e){return Ha(e)&&e.type===`radio`},Ja=function(e){return qa(e)&&!Ka(e)},Ya=function(e){var t=e&&Na(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=Na(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Xa=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Za=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=Ma.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Ma.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=Na(e);if(o&&!o.shadowRoot&&r(o)===!0)return Xa(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Ya(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Xa(e);return!1},Qa=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 Ma.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},$a=function(e,t){return!(t.disabled||Pa(t)||Ua(t)||Za(t,e)||Wa(t)||Qa(t))},eo=function(e,t){return!(Ja(t)||za(t)<0||!$a(e,t))},to=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},no=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Ba(a,i),s=i?no(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(Va).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ro=function(e,t){return t||={},no(t.getShadowRoot?La([e],t.includeContainer,{filter:eo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:to}):Ia(e,t.includeContainer,eo.bind(null,t)))},io=function(e,t){return t||={},t.getShadowRoot?La([e],t.includeContainer,{filter:$a.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ia(e,t.includeContainer,$a.bind(null,t))},ao=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Ma.call(e,Aa)===!1?!1:eo(t,e)};let oo=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function so(e,t){let n=ro(e,oo()),r=n.length;if(r===0)return;let i=Di(ji(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function co(e){return so(ji(e).body,1)||e}function lo(e){return so(ji(e).body,-1)||e}function uo(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function fo(e){ro(e,oo()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function po(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function mo(){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 ho=t.createContext(null);process.env.NODE_ENV!==`production`&&(ho.displayName=`FloatingNodeContext`);var go=t.createContext(null);process.env.NODE_ENV!==`production`&&(go.displayName=`FloatingTreeContext`);let _o=()=>t.useContext(ho)?.id||null,vo=e=>{let n=t.useContext(go);return e??n};function yo(e){return`data-base-ui-${e}`}yo(`safe-polygon`),`${Ei}`;function bo(e,t,n){if(n&&!Hi(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var xo=t.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new we,currentIdRef:{current:null},currentContextRef:{current:null}});process.env.NODE_ENV!==`production`&&(xo.displayName=`FloatingDelayGroupContext`);function So(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=Te();return(0,W.jsx)(xo.Provider,{value:t.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:o,currentIdRef:s,timeoutMs:i,currentContextRef:c,timeout:l}),[i,l]),children:n})}function Co(e,n={open:!1}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{enabled:a=!0,open:o}=n,{currentIdRef:s,delayRef:c,timeoutMs:l,initialDelayRef:u,currentContextRef:d,hasProvider:f,timeout:p}=t.useContext(xo),[m,h]=t.useState(!1);return K(()=>{function e(){h(!1),d.current?.setIsInstantPhase(!1),s.current=null,d.current=null,c.current=u.current}if(a&&s.current&&!o&&s.current===i){if(h(!1),l){let t=i;return p.start(l,()=>{r.select(`open`)||s.current&&s.current!==t||e()}),()=>{p.clear()}}e()}},[a,o,i,s,c,l,u,d,p,r]),K(()=>{if(!a||!o)return;let e=d.current,t=s.current;p.clear(),d.current={onOpenChange:r.setOpen,setIsInstantPhase:h},s.current=i,c.current={open:0,close:bo(u.current,`close`)},t!==null&&t!==i?(h(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Sr(_r))):(h(!1),e?.setIsInstantPhase(!1))},[a,o,i,r,s,c,l,u,d,p]),K(()=>()=>{d.current=null},[d]),t.useMemo(()=>({hasProvider:f,delayRef:c,isInstantPhase:m}),[f,c,m])}function wo(e){return e?.ownerDocument||document}let To=t.forwardRef(function(e,n){let[r,i]=t.useState();K(()=>{yi&&i(`button`)},[]);let a={tabIndex:0,role:r};return(0,W.jsx)(`span`,{...e,ref:n,style:dn,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":``})});process.env.NODE_ENV!==`production`&&(To.displayName=`FocusGuard`);var Eo=0;function Do(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Eo);let a=()=>e?.focus({preventScroll:n});i?a():Eo=requestAnimationFrame(a)}var Oo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ko(e){return e===`inert`?Oo.inert:e===`aria-hidden`?Oo[`aria-hidden`]:Oo.none}var Ao=new WeakSet,jo={},Mo=0,No=e=>e&&(e.host||No(e.parentNode)),Po=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=No(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Fo(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Po(t,e),s=new Set,c=new Set(o),l=[];jo[i]||(jo[i]=new WeakMap);let u=jo[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(wn(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=ko(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Ao.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Mo+=1,()=>{l.forEach(e=>{let t=ko(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Ao.has(e)&&a&&e.removeAttribute(a),Ao.delete(e)),r||e.removeAttribute(i)}),--Mo,Mo||(Oo.inert=new WeakMap,Oo[`aria-hidden`]=new WeakMap,Oo.none=new WeakMap,Ao=new WeakSet,jo={})}}function Io(e,t=!1,n=!1){let r=ji(e[0]).body;return Fo(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var Lo=t.createContext(null);process.env.NODE_ENV!==`production`&&(Lo.displayName=`PortalContext`);let Ro=()=>t.useContext(Lo);var zo=yo(`portal`);function Bo(e={}){let{ref:r,container:i,componentProps:a=V,elementProps:o,elementState:s}=e,c=xn(),l=Ro()?.portalNode,[u,d]=t.useState(null),[f,p]=t.useState(null),m=t.useRef(null);K(()=>{if(i===null){m.current&&(m.current=null,p(null),d(null));return}if(c==null)return;let e=(i&&(Dn(i)?i:i.current))??l??document.body;if(e==null){m.current&&(m.current=null,p(null),d(null));return}m.current!==e&&(m.current=e,p(null),d(e))},[i,l,c]);let h=U(`div`,a,{ref:[r,p],state:s,props:[{id:c,[zo]:``},o]});return{portalNode:f,portalSubtree:u&&h?n.createPortal(h,u):null}}let Vo=t.forwardRef(function(e,r){let{children:i,container:a,className:o,render:s,renderGuards:c,...l}=e,{portalNode:u,portalSubtree:d}=Bo({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&&uo(e)&&(e.type===`focusin`?po:fo)(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||po(u)},[y,u]);let x=t.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:u,setFocusManagerState:_}),[u]);return(0,W.jsxs)(t.Fragment,{children:[d,(0,W.jsxs)(Lo.Provider,{value:x,children:[b&&u&&(0,W.jsx)(To,{"data-type":`outside`,ref:f,onFocus:e=>{uo(e,u)?m.current?.focus():lo(g?g.domReference:null)?.focus()}}),b&&u&&(0,W.jsx)(`span`,{"aria-owns":u.id,style:ae}),u&&n.createPortal(i,u),b&&u&&(0,W.jsx)(To,{"data-type":`outside`,ref:p,onFocus:e=>{uo(e,u)?h.current?.focus():(co(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Sr(`focus-out`,e.nativeEvent)))}})]})]})});process.env.NODE_ENV!==`production`&&(Vo.displayName=`FloatingPortal`);function Ho(e,t){let n=Tn(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 Uo=20,Wo=[];function Go(){Wo=Wo.filter(e=>e.isConnected)}function Ko(e){Go(),e&&wn(e)!==`body`&&(Wo.push(e),Wo.length>Uo&&(Wo=Wo.slice(-Uo)))}function qo(){return Go(),Wo[Wo.length-1]}function Jo(e){if(!e)return null;let t=oo();return ao(e,t)?e:ro(e,t)[0]||e}function Yo(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Wn(e).display!==`none`}function Xo(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=oo(),r=io(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ao(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 Zo(e){let{context:n,children:r,disabled:i=!1,order:a=[`content`],initialFocus:o=!0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g}=e,_=`rootStore`in n?n.rootStore:n,y=_.useState(`open`),b=_.useState(`domReferenceElement`),x=_.useState(`floatingElement`),{events:S,dataRef:C}=_.context,w=G(()=>C.current.floatingContext?.nodeId),T=G(f),E=o===!1,D=Ni(b)&&E,O=Tr(a),k=Tr(o),A=Tr(s),j=Tr(d),M=vo(g),N=Ro(),P=t.useRef(null),ee=t.useRef(null),F=t.useRef(!1),te=t.useRef(!1),I=t.useRef(!1),L=t.useRef(-1),R=t.useRef(``),ne=t.useRef(``),re=Te(),z=Te(),B=jr(),V=N!=null,H=Fi(x),ie=G((e=H)=>e?ro(e,oo()):[]),ae=G(e=>{let t=ie(e);return O.current.map(()=>t).filter(Boolean).flat()});t.useEffect(()=>{if(i||!l)return;function e(e){e.key===`Tab`&&Q(H,Di(ji(H)))&&ie().length===0&&!D&&Ri(e)}let t=ji(H);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[i,b,H,l,O,D,ie,ae]),t.useEffect(()=>{if(i||!x)return;function e(e){let t=Oi(e),n=ie().indexOf(t);n!==-1&&(L.current=n)}return x.addEventListener(`focusin`,e),()=>{x.removeEventListener(`focusin`,e)}},[i,x,ie]),t.useEffect(()=>{if(i||!y)return;let e=ji(H);function t(){I.current=!1}function n(e){let t=Oi(e);I.current=!(Q(x,t)||Q(b,t)||Q(N?.portalNode,t)),ne.current=e.pointerType||`keyboard`}function r(){ne.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,x,b,H,y,N]),t.useEffect(()=>{if(i||!u)return;function e(){te.current=!0,z.start(0,()=>{te.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=Oi(e);queueMicrotask(()=>{let i=w(),a=_.context.triggerElements,o=!(Q(b,t)||Q(x,t)||Q(t,x)||Q(N?.portalNode,t)||t!=null&&a.hasElement(t)||a.hasMatchingElement(e=>Q(e,t))||t?.hasAttribute(yo(`focus-guard`))||M&&(Ii(M.nodesRef.current,i).find(e=>Q(e.context?.elements.floating,t)||Q(e.context?.elements.domReference,t))||Li(M.nodesRef.current,i).find(e=>[e.context?.elements.floating,Fi(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===b&&H&&Xo(H,O),c&&n!==b&&!Yo(r)&&Di(ji(H))===ji(H).body){if(On(H)&&(H.focus(),c===`popup`)){B.request(()=>{H.focus()});return}let e=L.current,t=ie(),n=t[e]||t[t.length-1]||H;On(n)&&n.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(D||!l)&&t&&o&&!te.current&&(D||t!==qo())&&(F.current=!0,_.setOpen(!1,Sr(`focus-out`,e)))})}function n(){I.current||(C.current.insideReactTree=!0,re.start(0,()=>{C.current.insideReactTree=!1}))}let r=On(b)?b:null,a=[];if(!(!x&&!r))return r&&(r.addEventListener(`focusout`,t),r.addEventListener(`pointerdown`,e),a.push(()=>{r.removeEventListener(`focusout`,t),r.removeEventListener(`pointerdown`,e)})),x&&(x.addEventListener(`focusout`,t),N&&(x.addEventListener(`focusout`,n,!0),a.push(()=>{x.removeEventListener(`focusout`,n,!0)})),a.push(()=>{x.removeEventListener(`focusout`,t)})),()=>{a.forEach(e=>{e()})}},[i,b,x,H,l,M,N,_,u,c,ie,D,w,O,C,re,z,B]);let U=t.useRef(null),oe=t.useRef(null),se=v(U,h,N?.beforeInsideRef),ce=v(oe,N?.afterInsideRef);t.useEffect(()=>{if(i||!x||!y)return;let e=Array.from(N?.portalNode?.querySelectorAll(`[${yo(`portal`)}]`)||[]),t=Io([x,(M?Li(M.nodesRef.current,w()):[]).find(e=>Ni(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,...T(),P.current,ee.current,U.current,oe.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,Mr(m),Mr(p),D?b:null].filter(e=>e!=null),l||D);return()=>{t()}},[y,i,b,x,l,O,N,D,M,w,T,p,m]),K(()=>{if(!y||i||!On(H))return;let e=Di(ji(H));queueMicrotask(()=>{let t=ae(H),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]||H:Mr(r),i=i||t[0]||H,!Q(H,e)&&Do(i,{preventScroll:i===H})})},[i,y,H,E,ae,k,j]),K(()=>{if(i||!H)return;let e=ji(H);Ko(Di(e));function t(e){if(e.open||(R.current=Ho(e.nativeEvent,ne.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(F.current=!0),e.reason===`outside-press`)if(e.nested)F.current=!1;else if(Bi(e.nativeEvent)||Vi(e.nativeEvent))F.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}S.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,dn),V&&b&&b.insertAdjacentElement(`afterend`,n);function r(){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=b||qo();return e&&e.isConnected?e:n}let r=b||qo()||n;return Mr(t)||r}return()=>{S.off(`openchange`,t);let i=Di(e),a=Q(x,i)||M&&Ii(M.nodesRef.current,w(),!1).some(e=>Q(e.context?.elements.floating,i)),o=r();queueMicrotask(()=>{let t=Jo(o),r=typeof A.current!=`boolean`;A.current&&!F.current&&On(t)&&(!(!r&&t!==i&&i!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[i,x,H,A,C,S,M,V,b,w]),t.useEffect(()=>{queueMicrotask(()=>{F.current=!1})},[i]),t.useEffect(()=>{if(i||!y)return;function e(e){Oi(e)?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0)}let t=ji(H);return t.addEventListener(`pointerdown`,e,!0),()=>{t.removeEventListener(`pointerdown`,e,!0)}},[i,y,H]),K(()=>{if(!i&&N)return N.setFocusManagerState({modal:l,closeOnFocusOut:u,open:y,onOpenChange:_.setOpen,domReference:b}),()=>{N.setFocusManagerState(null)}},[i,N,l,y,_,u,b]),K(()=>{if(!(i||!H))return Xo(H,O),()=>{queueMicrotask(Go)}},[i,H,O]);let le=!i&&(l?!D:!0)&&(V||l);return(0,W.jsxs)(t.Fragment,{children:[le&&(0,W.jsx)(To,{"data-type":`inside`,ref:se,onFocus:e=>{if(l){let e=ae();Do(e[e.length-1])}else N?.portalNode&&(F.current=!1,uo(e,N.portalNode)?co(b)?.focus():Mr(m??N.beforeOutsideRef)?.focus())}}),r,le&&(0,W.jsx)(To,{"data-type":`inside`,ref:ce,onFocus:e=>{l?Do(ae()[0]):N?.portalNode&&(u&&(F.current=!0),uo(e,N.portalNode)?lo(b)?.focus():Mr(p??N.afterOutsideRef)?.focus())}})]})}function Qo(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}=n,d=t.useRef(void 0),f=jr(),p=Te(),m=t.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,n=e.nativeEvent,a=r.select(`open`);if(e.button!==0||o===`click`||Hi(t,!0)&&c)return;let m=i.current.openEvent,h=m?.type,g=r.select(`domReferenceElement`)!==e.currentTarget,_=a&&g||!(a&&s&&(!(m&&l)||h===`click`||h===`mousedown`));if(Mi(n.target)){let e=Sr(vr,n,n.target);_&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(_,e);return}let v=e.currentTarget;f.request(()=>{let e=Sr(vr,n,v);_&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,e)}):r.setOpen(_,e)})},onClick(e){if(o===`mousedown-only`)return;let t=d.current;if(o===`mousedown`&&t){d.current=void 0;return}if(Hi(t,!0)&&c)return;let n=r.select(`open`),a=i.current.openEvent,f=r.select(`domReferenceElement`)!==e.currentTarget,m=n&&f||!(n&&s&&(!(a&&l)||Ui(a))),h=Sr(vr,e.nativeEvent,e.currentTarget);m&&t===`touch`&&u>0?p.start(u,()=>{r.setOpen(!0,h)}):r.setOpen(m,h)},onKeyDown(){d.current=void 0}}),[i,o,c,r,l,s,f,p,u]);return t.useMemo(()=>a?{reference:m}:V,[a,m])}function $o(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 es(e){return e!=null&&e.clientX!=null}function ts(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`,x:u=null,y:d=null}=n,f=t.useRef(!1),p=t.useRef(null),[m,h]=t.useState(),[g,_]=t.useState([]),v=G((e,t)=>{f.current||s.current.openEvent&&!es(s.current.openEvent)||r.set(`positionReference`,$o(o,{x:e,y:t,axis:l,dataRef:s,pointerType:m}))}),y=G(e=>{u!=null||d!=null||(i?p.current||_([]):v(e.clientX,e.clientY))}),b=Hi(m)?a:i,x=t.useCallback(()=>{if(!b||!c||u!=null||d!=null)return;let e=Tn(a);function t(n){Q(a,Oi(n))?(e.removeEventListener(`mousemove`,t),p.current=null):v(n.clientX,n.clientY)}if(!s.current.openEvent||es(s.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),p.current=null};return p.current=n,n}r.set(`positionReference`,o)},[b,c,u,d,a,s,o,r,v]);t.useEffect(()=>x(),[x,g]),t.useEffect(()=>{c&&!a&&(f.current=!1)},[c,a]),t.useEffect(()=>{!c&&i&&(f.current=!0)},[c,i]),K(()=>{c&&(u!=null||d!=null)&&(f.current=!1,v(u,d))},[c,u,d,v]);let S=t.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return t.useMemo(()=>c?{reference:S}:{},[c,S])}function ns(e,t,n){let{reference:r,floating:i}=e,a=aa(t),o=oa(t),s=ra(o),c=ea(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(ta(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var rs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ns(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=ns(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function is(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}=$i(t,e),p=va(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ya(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=ya(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 as=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}=$i(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ea(r),_=aa(o),v=ea(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ga(o)]:ca(o)),x=p!==`none`;!d&&x&&b.push(...ha(o,m,p,y));let S=[o,...b],C=await is(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=sa(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`&&_!==aa(t))||T.every(e=>aa(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=aa(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 os(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ss(e){return Wi.some(t=>e[t]>=0)}var cs=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=$i(e,t);switch(r){case`referenceHidden`:{let e=os(await is(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ss(e)}}}case`escaped`:{let e=os(await is(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ss(e)}}}default:return{}}}}},ls=new Set([`left`,`top`]);async function us(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ea(n),s=ta(n),c=aa(n)===`y`,l=ls.has(o)?-1:1,u=a&&c?-1:1,d=$i(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 ds=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 us(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}}}}},fs=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=$i(e,t),l={x:n,y:r},u=await is(t,c),d=aa(ea(i)),f=na(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Qi(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Qi(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},ps=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}=$i(e,t),u={x:n,y:r},d=aa(i),f=na(d),p=u[f],m=u[d],h=$i(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=ls.has(ea(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}}}},ms=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}=$i(e,t),u=await is(t,l),d=ea(i),f=ta(i),p=aa(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=Gi(h-u[g],v),x=Gi(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=Ki(u.left,0),t=Ki(u.right,0),n=Ki(u.top,0),r=Ki(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ki(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ki(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 hs(e){let t=Wn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=On(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=qi(n)!==a||qi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function gs(e){return Z(e)?e:e.contextElement}function _s(e){let t=gs(e);if(!On(t))return Yi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hs(t),o=(a?qi(n.width):n.width)/r,s=(a?qi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vs=Yi(0);function ys(e){let t=Tn(e);return!Vn()||!t.visualViewport?vs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Tn(e)?!1:t}function xs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=gs(e),o=Yi(1);t&&(r?Z(r)&&(o=_s(r)):o=_s(e));let s=bs(a,n,r)?ys(a):Yi(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=Tn(a),t=r&&Z(r)?Tn(r):r,n=e,i=Yn(n);for(;i&&r&&t!==n;){let e=_s(i),t=i.getBoundingClientRect(),r=Wn(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=Tn(i),i=Yn(n)}}return ya({width:u,height:d,x:c,y:l})}function Ss(e,t){let n=Gn(e).scrollLeft;return t?t.left+n:xs(En(e)).left+n}function Cs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ss(e,n),y:n.top+t.scrollTop}}function ws(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=En(r),s=t?Fn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Yi(1),u=Yi(0),d=On(r);if((d||!d&&!a)&&((wn(r)!==`body`||jn(o))&&(c=Gn(r)),On(r))){let e=xs(r);l=_s(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Cs(o,c):Yi(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 Ts(e){return Array.from(e.getClientRects())}function Es(e){let t=En(e),n=Gn(e),r=e.ownerDocument.body,i=Ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Ss(e),s=-n.scrollTop;return Wn(r).direction===`rtl`&&(o+=Ki(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ds=25;function Os(e,t){let n=Tn(e),r=En(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Vn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Ss(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<=Ds&&(a-=o)}else l<=Ds&&(a+=l);return{width:a,height:o,x:s,y:c}}var ks=new Set([`absolute`,`fixed`]);function As(e,t){let n=xs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=On(e)?_s(e):Yi(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function js(e,t,n){let r;if(t===`viewport`)r=Os(e,n);else if(t===`document`)r=Es(En(e));else if(Z(t))r=As(t,n);else{let n=ys(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ya(r)}function Ms(e,t){let n=Kn(e);return n===t||!Z(n)||Un(n)?!1:Wn(n).position===`fixed`||Ms(n,t)}function Ns(e,t){let n=t.get(e);if(n)return n;let r=Jn(e,[],!1).filter(e=>Z(e)&&wn(e)!==`body`),i=null,a=Wn(e).position===`fixed`,o=a?Kn(e):e;for(;Z(o)&&!Un(o);){let t=Wn(o),n=zn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&ks.has(i.position)||jn(o)&&!n&&Ms(e,o))?r=r.filter(e=>e!==o):i=t,o=Kn(o)}return t.set(e,r),r}function Ps(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Fn(t)?[]:Ns(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=js(t,n,i);return e.top=Ki(r.top,e.top),e.right=Gi(r.right,e.right),e.bottom=Gi(r.bottom,e.bottom),e.left=Ki(r.left,e.left),e},js(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Fs(e){let{width:t,height:n}=hs(e);return{width:t,height:n}}function Is(e,t,n){let r=On(t),i=En(t),a=n===`fixed`,o=xs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Yi(0);function l(){c.x=Ss(i)}if(r||!r&&!a)if((wn(t)!==`body`||jn(i))&&(s=Gn(t)),r){let e=xs(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?Cs(i,s):Yi(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 Ls(e){return Wn(e).position===`static`}function Rs(e,t){if(!On(e)||Wn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return En(e)===n&&(n=n.ownerDocument.body),n}function zs(e,t){let n=Tn(e);if(Fn(e))return n;if(!On(e)){let t=Kn(e);for(;t&&!Un(t);){if(Z(t)&&!Ls(t))return t;t=Kn(t)}return n}let r=Rs(e,t);for(;r&&Nn(r)&&Ls(r);)r=Rs(r,t);return r&&Un(r)&&Ls(r)&&!zn(r)?n:r||Bn(e)||n}var Bs=async function(e){let t=this.getOffsetParent||zs,n=this.getDimensions,r=await n(e.floating);return{reference:Is(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Vs(e){return Wn(e).direction===`rtl`}var Hs={convertOffsetParentRelativeRectToViewportRelativeRect:ws,getDocumentElement:En,getClippingRect:Ps,getOffsetParent:zs,getElementRects:Bs,getClientRects:Ts,getDimensions:Fs,getScale:_s,isElement:Z,isRTL:Vs};function Us(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ws(e,t){let n=null,r,i=En(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=Ji(d),h=Ji(i.clientWidth-(u+f)),g=Ji(i.clientHeight-(d+p)),_=Ji(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ki(0,Gi(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&&!Us(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 Gs(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=gs(e),u=i||a?[...l?Jn(l):[],...Jn(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ws(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?xs(e):null;c&&g();function g(){let t=xs(e);h&&!Us(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 Ks=ds,qs=fs,Js=as,Ys=ms,Xs=cs,Zs=ps,Qs=(e,t,n)=>{let r=new Map,i={platform:Hs,...n},a={...i.platform,_c:r};return rs(e,t,{...i,platform:a})},$s=typeof document<`u`?t.useLayoutEffect:function(){};function ec(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(!ec(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)&&!ec(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function tc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nc(e,t){let n=tc(e);return Math.round(t*n)/n}function rc(e){let n=t.useRef(e);return $s(()=>{n.current=e}),n}function ic(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);ec(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=rc(u),k=rc(o),A=rc(d),j=t.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:r,strategy:i,middleware:m};k.current&&(e.platform=k.current),Qs(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!ec(E.current,t)&&(E.current=t,n.flushSync(()=>{p(t)}))})},[m,r,i,k,A]);$s(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=t.useRef(!1);$s(()=>(M.current=!0,()=>{M.current=!1}),[]),$s(()=>{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]),ee=t.useMemo(()=>{let e={position:i,left:0,top:0};if(!P.floating)return e;let t=nc(P.floating,f.x),n=nc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+n+`px)`,...tc(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:ee}),[f,j,N,P,ee])}var ac=(e,t)=>({...Ks(e),options:[e,t]}),oc=(e,t)=>({...qs(e),options:[e,t]}),sc=(e,t)=>({...Zs(e),options:[e,t]}),cc=(e,t)=>({...Js(e),options:[e,t]}),lc=(e,t)=>({...Ys(e),options:[e,t]}),uc=(e,t)=>({...Xs(e),options:[e,t]}),dc={intentional:`onClick`,sloppy:`onPointerDown`};function fc(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pc(e,n={}){let r=`rootStore`in e?e.rootStore:e,i=r.useState(`open`),a=r.useState(`floatingElement`),o=r.useState(`referenceElement`),s=r.useState(`domReferenceElement`),{onOpenChange:c,dataRef:l}=r.context,{enabled:u=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p=`sloppy`,referencePress:m=!1,referencePressEvent:h=`sloppy`,ancestorScroll:g=!1,bubbles:_,externalTree:v}=n,y=vo(v),b=G(typeof f==`function`?f:()=>!1),x=typeof f==`function`?b:f,S=t.useRef(!1),{escapeKey:C,outsidePress:w}=fc(_),T=t.useRef(null),E=Te(),D=Te(),O=G(()=>{D.clear(),l.current.insideReactTree=!1}),k=t.useRef(!1),A=t.useRef(``),j=G(e=>{A.current=e.pointerType}),M=G(()=>{let e=A.current,t=e===`pen`||!e?`mouse`:e,n=typeof p==`function`?p():p;return typeof n==`string`?n:n[t]}),N=G(e=>{if(!i||!u||!d||e.key!==`Escape`||k.current)return;let t=l.current.floatingContext?.nodeId,n=y?Ii(y.nodesRef.current,t):[];if(!C&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Sr(`escape-key`,zi(e)?e.nativeEvent:e);r.setOpen(!1,a),!C&&!a.isPropagationAllowed&&e.stopPropagation()}),P=G(e=>{let t=M();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),ee=G(()=>{l.current.insideReactTree=!0,D.start(0,O)}),F=G((e,t=!1)=>{if(P(e)){O();return}if(l.current.insideReactTree){O();return}if(M()===`intentional`&&t||typeof x==`function`&&!x(e))return;let n=Oi(e),i=`[${yo(`inert`)}]`,a=ji(r.select(`floatingElement`)).querySelectorAll(i),o=r.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Q(e,n))))return;let s=Z(n)?n:null;for(;s&&!Un(s);){let e=Kn(s);if(Un(e)||!Z(e))break;s=e}if(a.length&&Z(n)&&!Ai(n)&&!Q(n,r.select(`floatingElement`))&&Array.from(a).every(e=>!Q(s,e)))return;if(On(n)&&!(`touches`in e)){let t=Un(n),r=Wn(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}let c=l.current.floatingContext?.nodeId,u=y&&Ii(y.nodesRef.current,c).some(t=>ki(e,t.context?.elements.floating));if(ki(e,r.select(`floatingElement`))||ki(e,r.select(`domReferenceElement`))||u)return;let d=y?Ii(y.nodesRef.current,c):[];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,Sr(`outside-press`,e)),O()}),te=G(e=>{M()!==`sloppy`||e.pointerType===`touch`||!r.select(`open`)||!u||ki(e,r.select(`floatingElement`))||ki(e,r.select(`domReferenceElement`))||F(e)}),I=G(e=>{if(M()!==`sloppy`||!r.select(`open`)||!u||ki(e,r.select(`floatingElement`))||ki(e,r.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),L=G(e=>{let t=Oi(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),R=G(e=>{let t=S.current;if(S.current=!1,E.clear(),e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)return;let n=Oi(e);function r(){e.type===`pointerdown`?te(e):F(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),ne=G(e=>{if(M()!==`sloppy`||!T.current||ki(e,r.select(`floatingElement`))||ki(e,r.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),i=Math.abs(t.clientY-T.current.startY),a=Math.sqrt(n*n+i*i);a>5&&(T.current.dismissOnTouchEnd=!0),a>10&&(F(e),E.clear(),T.current=null)}),re=G(e=>{let t=Oi(e);function n(){ne(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),z=G(e=>{M()!==`sloppy`||!T.current||ki(e,r.select(`floatingElement`))||ki(e,r.select(`domReferenceElement`))||(T.current.dismissOnTouchEnd&&F(e),E.clear(),T.current=null)}),B=G(e=>{let t=Oi(e);function n(){z(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});t.useEffect(()=>{if(!i||!u)return;l.current.__escapeKeyBubbles=C,l.current.__outsidePressBubbles=w;let e=new we;function t(e){r.setOpen(!1,Sr(_r,e))}function n(){e.clear(),k.current=!0}function c(){e.start(Vn()?5:0,()=>{k.current=!1})}let f=ji(a);f.addEventListener(`pointerdown`,j,!0),d&&(f.addEventListener(`keydown`,N),f.addEventListener(`compositionstart`,n),f.addEventListener(`compositionend`,c)),x&&(f.addEventListener(`click`,R,!0),f.addEventListener(`pointerdown`,R,!0),f.addEventListener(`touchstart`,L,!0),f.addEventListener(`touchmove`,re,!0),f.addEventListener(`touchend`,B,!0),f.addEventListener(`mousedown`,R,!0));let p=[];return g&&(Z(s)&&(p=Jn(s)),Z(a)&&(p=p.concat(Jn(a))),!Z(o)&&o&&o.contextElement&&(p=p.concat(Jn(o.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,j,!0),d&&(f.removeEventListener(`keydown`,N),f.removeEventListener(`compositionstart`,n),f.removeEventListener(`compositionend`,c)),x&&(f.removeEventListener(`click`,R,!0),f.removeEventListener(`pointerdown`,R,!0),f.removeEventListener(`touchstart`,L,!0),f.removeEventListener(`touchmove`,re,!0),f.removeEventListener(`touchend`,B,!0),f.removeEventListener(`mousedown`,R,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear()}},[l,a,o,s,d,x,i,c,g,u,C,w,N,F,R,te,L,re,B,j,r]),t.useEffect(O,[x,O]);let V=t.useMemo(()=>({onKeyDown:N,...m&&{[dc[h]]:e=>{r.setOpen(!1,Sr(`trigger-press`,e.nativeEvent))},...h!==`intentional`&&{onClick(e){r.setOpen(!1,Sr(`trigger-press`,e.nativeEvent))}}}}),[N,r,m,h]),H=G(e=>{let t=Oi(e.nativeEvent);!Q(r.select(`floatingElement`),t)||e.button!==0||(S.current=!0)}),ie=t.useMemo(()=>({onKeyDown:N,onPointerDown:H,onMouseDown:H,onMouseUp:H,onClickCapture:ee,onMouseDownCapture:ee,onPointerDownCapture:ee,onMouseUpCapture:ee,onTouchEndCapture:ee,onTouchMoveCapture:ee}),[N,H,ee]);return t.useMemo(()=>u?{reference:V,floating:ie,trigger:V}:{},[u,V,ie])}var mc=(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
|
|
13
|
-
\`createSelector([state => state.todos], todos => todos)\`
|
|
14
|
-
This could lead to inefficient memoization and unnecessary re-renders.
|
|
15
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},hc=(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.
|
|
16
|
-
This means your output selector will likely run more frequently than intended.
|
|
17
|
-
Avoid returning a new reference inside your input selector, e.g.
|
|
18
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},gc={inputStabilityCheck:`once`,identityFunctionCheck:`once`},_c=Symbol(`NOT_FOUND`);function vc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function yc(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function bc(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 xc=e=>Array.isArray(e)?e:[e];function Sc(e){let t=Array.isArray(e[0])?e[0]:e;return bc(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Cc(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var wc=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...gc,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:mc},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:hc}}};function Tc(e){let t;return{get(n){return t&&e(t.key,n)?t.value:_c},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ec(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 _c}function i(t,i){r(t)===_c&&(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 Dc=(e,t)=>e===t;function Oc(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 kc(e,t){let{equalityCheck:n=Dc,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Oc(n),o=0,s=r<=1?Tc(a):Ec(r,a);function c(){let t=s.get(arguments);if(t===_c){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 Ac=class{constructor(e){this.value=e}deref(){return this.value}},jc=typeof WeakRef<`u`?WeakRef:Ac,Mc=0,Nc=1;function Pc(){return{s:Mc,v:void 0,o:null,p:null}}function Fc(e,t={}){let n=Pc(),{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=Pc(),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=Pc(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Nc)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 jc(c):c}return s.s=Nc,s.v=c,c}return o.clearCache=()=>{n=Pc(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Ic(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()),vc(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Fc,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=xc(c),p=xc(u),m=Sc(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=Cc(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=wc(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=Cc(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 Lc=Ic(Fc),Rc=Object.assign((e,t=Lc)=>{yc(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:()=>Rc});Ic({memoize:kc,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});let $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(process.env.NODE_ENV===`production`?h(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};var zc=l((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})),Bc=l((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())})()})),Vc=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=zc():t.exports=Bc()})),Hc=l((e=>{var t=require(`react`),n=Vc();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}})),Uc=l((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=Vc(),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())})()})),Wc=l(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Hc():t.exports=Uc()})),Gc=Vc(),Kc=Wc(),qc=T(19)?Yc:Xc;function Jc(e,t,n,r,i){return qc(e,t,n,r,i)}function Yc(e,n,r,i,a){let o=t.useCallback(()=>n(e.getSnapshot(),r,i,a),[e,n,r,i,a]);return(0,Gc.useSyncExternalStore)(e.subscribe,o,o)}function Xc(e,t,n,r,i){return(0,Kc.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Zc=class e{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(t){for(let n in t)if(!Object.is(this.state[n],t[n])){e.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||e.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){let t={...this.state};e.prototype.setState.call(this,t)}},Qc=class extends Zc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}controlledValues=new Map;useSyncedValue(e,n){t.useDebugValue(e),K(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,t){K(()=>(this.state[e]!==t&&this.set(e,t),()=>{this.set(e,void 0)}),[e,t])}useSyncedValues(e){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.`)}K(()=>{this.update(e)},Object.values(e))}useControlledProp(e,n,r){t.useDebugValue(e);let i=n!==void 0;if(process.env.NODE_ENV!==`production`){let t=this.controlledValues.get(e);t!==void 0&&t!==i&&console.error(`A component is changing the ${i?``:`un`}controlled state of ${e.toString()} to be ${i?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(e)||(this.controlledValues.set(e,i),!i&&!Object.is(this.state[e],r)&&super.setState({...this.state,[e]:r})),K(()=>{i&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,r,i])}set(e,t){this.controlledValues.get(e)!==!0&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&this.controlledValues.get(e)===!0){delete t[e];continue}super.setState({...this.state,...t})}select=(e,t,n,r)=>{let i=this.selectors[e];return i(this.state,t,n,r)};useState=(e,n,r,i)=>{t.useDebugValue(e);let a=this.selectors[e];return Jc(this,a,n,r,i)};useContextCallback(e,n){t.useDebugValue(e);let r=G(n??z);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 $c(){let[,e]=t.useState({});return t.useCallback(()=>{e({})},[])}var el={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},tl=class extends Qc{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:mo(),nested:t,noEmit:n,triggerElements:i},el)}setOpen=(e,t)=>{if((!e||!this.state.open||Ui(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 nl(e,n){let r=t.useRef(null);return t.useCallback(t=>{e!==void 0&&(r.current!==null&&(n.context.triggerElements.delete(r.current),r.current=null),t!==null&&(r.current=e,n.context.triggerElements.add(e,t)))},[n,e])}function rl(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=nl(e,n),o=G(t=>{a(t),t!==null&&n.select(`open`)&&n.select(`activeTriggerId`)==null&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return K(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function il(e){let t=e.useState(`open`);K(()=>{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 al(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Fr(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=G(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Pr({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var ol=class{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);if(n!==t&&(n!==void 0&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t),process.env.NODE_ENV!==`production`&&this.elements.size!==this.idMap.size))throw Error(process.env.NODE_ENV===`production`?h(87):`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`)}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}};function sl(){return new tl({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ol,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function cl(){return{open:!1,mounted:!1,transitionStatus:`idle`,floatingRootContext:sl(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:V,inactiveTriggerProps:V,popupProps:V}}let ll={open:$(e=>e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:$(e=>e.activeTriggerId),activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function ul(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=xn(),a=_o()!=null;if(process.env.NODE_ENV!==`production`){let e=r.reference;e&&!Z(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=_(()=>new tl({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new ol,floatingId:i,nested:a,noEmit:e.noEmit||!1})).current;return K(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Z(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=e.noEmit||!1,o}function dl(e={}){let{nodeId:n,externalTree:r}=e,i=ul(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=vo(r);K(()=>{o.domReference&&(l.current=o.domReference)},[o.domReference]);let d=ic({...e,elements:{...o,...s&&{reference:s}}}),f=t.useCallback(e=>{let t=Z(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`,Z(p)?p:null),a.useSyncedValue(`floatingElement`,h);let _=t.useCallback(e=>{(Z(e)||e===null)&&(l.current=e,m(e)),(Z(d.refs.reference.current)||d.refs.reference.current===null||e!==null&&!Z(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]),x=a.useState(`open`),S=a.useState(`floatingId`),C=t.useMemo(()=>({...d,dataRef:a.context.dataRef,open:x,onOpenChange:a.setOpen,events:a.context.events,floatingId:S,refs:y,elements:b,nodeId:n,rootStore:a}),[d,y,b,n,a,x,S]);return K(()=>{a.context.dataRef.current.floatingContext=C;let e=u?.nodesRef.current.find(e=>e.id===n);e&&(e.context=C)}),t.useMemo(()=>({...d,context:C,refs:y,elements:b,rootStore:a}),[d,y,b,C,a])}function fl(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=xn(),o=_o()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=_(()=>new tl({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return K(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};Z(c)&&(e.domReferenceElement=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var pl=xi&&yi;function ml(e,n={}){let r=`rootStore`in e?e.rootStore:e,{events:i,dataRef:a}=r.context,{enabled:o=!0,visibleOnly:s=!0}=n,c=t.useRef(!1),l=Te(),u=t.useRef(!0);t.useEffect(()=>{let e=r.select(`domReferenceElement`);if(!o)return;let t=Tn(e);function n(){!r.select(`open`)&&On(e)&&e===Di(ji(e))&&(c.current=!0)}function i(){u.current=!0}function a(){u.current=!1}return t.addEventListener(`blur`,n),pl&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,a,!0)),()=>{t.removeEventListener(`blur`,n),pl&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,a,!0))}},[r,o]),t.useEffect(()=>{if(!o)return;function e(e){(e.reason===`trigger-press`||e.reason===`escape-key`)&&(c.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,o]);let d=t.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;let t=Oi(e.nativeEvent);if(s&&Z(t)){if(pl&&!e.relatedTarget){if(!u.current&&!Mi(t))return}else if(!Pi(t))return}r.setOpen(!0,Sr(br,e.nativeEvent,e.currentTarget))},onBlur(e){c.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=Z(t)&&t.hasAttribute(yo(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let o=r.select(`domReferenceElement`),s=Di(o?o.ownerDocument:document);!t&&s===o||Q(a.current.floatingContext?.refs.floating.current,s)||Q(o,s)||i||r.context.triggerElements.hasElement(e.relatedTarget)||r.setOpen(!1,Sr(br,n))})}}),[a,r,s,l]);return t.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}let hl=yo(`safe-polygon`);var gl=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ei}`;function _l(e){return e?!!e.closest(gl):!1}function vl(e){let n=t.useRef(void 0),r=t.useRef(!1),i=t.useRef(void 0),a=t.useRef(!0),o=t.useRef(!1),s=t.useRef(()=>{}),c=t.useRef(!1),l=Te(),u=Te(),d=t.useRef(void 0);return t.useMemo(()=>{let t=e.context.dataRef.current;return t.hoverInteractionState||={pointerTypeRef:n,interactedInsideRef:r,handlerRef:i,blockMouseMoveRef:a,performedPointerEventsMutationRef:o,unbindMouseMoveRef:s,restTimeoutPendingRef:c,openChangeTimeout:l,restTimeout:u,handleCloseOptionsRef:d},t.hoverInteractionState},[e,n,r,i,a,o,s,c,l,u,d])}var yl=new Set([`click`,`mousedown`]);function bl(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,externalTree:u}=n,{pointerTypeRef:d,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:h,restTimeoutPendingRef:g,openChangeTimeout:_,handleCloseOptionsRef:v}=vl(r),y=vo(u),b=_o(),x=G(()=>f.current?!0:s.current.openEvent?yl.has(s.current.openEvent.type):!1),S=G(()=>{let e=s.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),C=t.useCallback((e,t=!0)=>{let n=xl(l,d.current);n&&!p.current?_.start(n,()=>r.setOpen(!1,Sr(yr,e))):t&&(_.clear(),r.setOpen(!1,Sr(yr,e)))},[l,p,r,d,_]),w=G(()=>{h.current(),p.current=void 0}),T=G(()=>{if(m.current){let e=ji(a).body;e.style.pointerEvents=``,e.removeAttribute(hl),m.current=!1}}),E=G(e=>{if(!_l(Oi(e))){f.current=!1;return}f.current=!0});K(()=>{i||(d.current=void 0,g.current=!1,f.current=!1,w(),T())},[i,d,g,f,w,T]),t.useEffect(()=>()=>{w()},[w]),t.useEffect(()=>T,[T]),K(()=>{if(c&&i&&v.current?.blockPointerEvents&&S()&&Z(o)&&a){m.current=!0;let e=ji(a).body;e.setAttribute(hl,``);let t=o,n=a,r=y?.nodesRef.current.find(e=>e.id===b)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[c,i,o,a,v,S,y,b,m]),t.useEffect(()=>{if(!c)return;function e(e){if(x()||!s.current.floatingContext||!r.select(`open`))return;let t=r.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(T(),w(),x()||C(e))}function t(e){_.clear(),T(),p.current?.(e),w()}function n(e){x()||C(e,!1)}let i=a;return i&&(i.addEventListener(`mouseleave`,e),i.addEventListener(`mouseenter`,t),i.addEventListener(`mouseleave`,n),i.addEventListener(`pointerdown`,E,!0)),()=>{i&&(i.removeEventListener(`mouseleave`,e),i.removeEventListener(`mouseenter`,t),i.removeEventListener(`mouseleave`,n),i.removeEventListener(`pointerdown`,E,!0))}})}function xl(e,t){return t&&!Hi(t)?0:typeof e==`function`?e():e}function Sl(e){return typeof e==`function`?e():e}var Cl={current:null};function wl(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=Cl,externalTree:m,isActiveTrigger:h=!0}=r,g=vo(m),{pointerTypeRef:_,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:x,unbindMouseMoveRef:S,restTimeoutPendingRef:C,openChangeTimeout:w,restTimeout:T,handleCloseOptionsRef:E}=vl(i),D=Tr(l),O=Tr(c),k=Tr(d);h&&(E.current=D.current?.__options);let A=G(()=>v.current?!0:a.current.openEvent?[`click`,`mousedown`].includes(a.current.openEvent.type):!1),j=t.useCallback((e,t=!0)=>{let n=bo(O.current,`close`,_.current);n&&!y.current?w.start(n,()=>i.setOpen(!1,Sr(yr,e))):t&&(w.clear(),i.setOpen(!1,Sr(yr,e)))},[O,y,i,_,w]),M=G(()=>{S.current(),y.current=void 0}),N=G(()=>{if(x.current){let e=ji(i.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(hl),x.current=!1}});t.useEffect(()=>{if(!s)return;function e(e){e.open||(w.clear(),T.clear(),b.current=!0,C.current=!1)}return o.on(`openchange`,e),()=>{o.off(`openchange`,e)}},[s,o,w,T,b,C]);let P=G(e=>{if(A()||!a.current.floatingContext)return;let t=i.context.triggerElements;if(e.relatedTarget&&t.hasElement(e.relatedTarget))return;let n=p.current;D.current?.({...a.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&n===i.select(`domReferenceElement`)&&j(e)}})(e)});return t.useEffect(()=>{if(!s)return;let e=p.current??(h?i.select(`domReferenceElement`):null);if(!Z(e))return;function t(e){if(w.clear(),b.current=!1,u&&!Hi(_.current)||Sl(k.current)>0&&!bo(O.current,`open`))return;let t=bo(O.current,`open`,_.current),n=i.select(`domReferenceElement`),r=i.context.triggerElements,a=(r.hasElement(e.target)||r.hasMatchingElement(t=>Q(t,e.target)))&&(!n||!Q(n,e.target)),o=e.currentTarget??null,s=!i.select(`open`)||a;t?w.start(t,()=>{s&&i.setOpen(!0,Sr(yr,e,o))}):s&&i.setOpen(!0,Sr(yr,e,o))}function n(e){if(A()){N();return}S.current();let t=ji(i.select(`domReferenceElement`));T.clear(),C.current=!1;let n=i.context.triggerElements;if(!(e.relatedTarget&&n.hasElement(e.relatedTarget))){if(D.current&&a.current.floatingContext){i.select(`open`)||w.clear();let n=p.current;y.current=D.current({...a.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),M(),!A()&&n===i.select(`domReferenceElement`)&&j(e,!0)}});let r=y.current;r(e),t.addEventListener(`mousemove`,r),S.current=()=>{t.removeEventListener(`mousemove`,r)};return}(_.current!==`touch`||!Q(i.select(`floatingElement`),e.relatedTarget))&&j(e)}}function r(e){P(e)}return i.select(`open`)&&e.addEventListener(`mouseleave`,r),f&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,n),()=>{e.removeEventListener(`mouseleave`,r),f&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,n)}},[M,N,b,a,O,j,i,s,D,P,h,A,u,f,_,k,T,C,w,p,g,S,y]),t.useMemo(()=>{function e(e){_.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,a=i.select(`domReferenceElement`),o=i.context.triggerElements,s=i.select(`open`),c=(o.hasElement(e.target)||o.hasMatchingElement(t=>Q(t,e.target)))&&(!a||!Q(a,e.target));if(u&&!Hi(_.current)||s&&!c||Sl(k.current)===0||!c&&C.current&&e.movementX**2+e.movementY**2<2)return;T.clear();function l(){!b.current&&(!s||c)&&i.setOpen(!0,Sr(yr,t,r))}_.current===`touch`?n.flushSync(()=>{l()}):c&&s?l():(C.current=!0,T.start(Sl(k.current),l))}}},[b,u,i,_,k,T,C])}function Tl(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=>El(t,e,`reference`),n),s=t.useCallback(t=>El(t,e,`floating`),r),c=t.useCallback(t=>El(t,e,`item`),i),l=t.useCallback(t=>El(t,e,`trigger`),a);return t.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c,getTriggerProps:l}),[o,s,c,l])}function El(e,t,n){let r=new Map,i=n===`item`,a={};for(let t in n===`floating`&&(a.tabIndex=-1,a[`data-base-ui-focusable`]=``),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&&Dl(a,s,i,r)}return Dl(a,e,i,r),a}function Dl(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 Ol=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function kl(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`),{enabled:c=!0,role:l=`dialog`}=n,u=xn(),d=o?.id||u,f=t.useMemo(()=>Fi(s)?.id||a,[s,a]),p=Ol.get(l)??l,m=_o()!=null,h=t.useMemo(()=>p===`tooltip`||l===`label`?V:{"aria-haspopup":p===`alertdialog`?`dialog`:p,"aria-expanded":`false`,...p===`listbox`&&{role:`combobox`},...p===`menu`&&m&&{role:`menuitem`},...l===`select`&&{"aria-autocomplete":`none`},...l===`combobox`&&{"aria-autocomplete":`list`}},[p,m,l]),g=t.useMemo(()=>p===`tooltip`||l===`label`?{[`aria-${l===`label`?`labelledby`:`describedby`}`]:i?f:void 0}:{...h,"aria-expanded":i?`true`:`false`,"aria-controls":i?f:void 0,...p===`menu`&&{id:d}},[p,f,i,d,l,h]),_=t.useMemo(()=>{let e={id:f,...p&&{role:p}};return p===`tooltip`||l===`label`?e:{...e,...p===`menu`&&{"aria-labelledby":d}}},[p,f,d,l]),v=t.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${f}-fui-option`}};switch(l){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[f,l]);return t.useMemo(()=>c?{reference:g,floating:_,item:v,trigger:h}:{},[c,g,_,h,v])}function Al(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function jl(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ml(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new we,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=Oi(f),v=f.type===`mouseleave`,y=Q(s.floating,_),b=Q(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=jl(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Z(f.relatedTarget)&&Q(s.floating,f.relatedTarget)||d&&Ii(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break;default:}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]];default:return[]}}if(!Al([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}Al([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}let Nl=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Pl=function(e){return e[e.open=ti.open]=`open`,e[e.closed=ti.closed]=`closed`,e[e.startingStyle=ti.startingStyle]=`startingStyle`,e[e.endingStyle=ti.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Fl=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Fl.displayName=`DialogPortalContext`);function Il(){let e=t.useContext(Fl);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(26):`Base UI: <Dialog.Portal> is missing.`);return e}let Ll=`ArrowUp`,Rl=`ArrowDown`,zl=`ArrowLeft`,Bl=`ArrowRight`,Vl=`Home`,Hl=new Set([zl,Bl]),Ul=new Set([zl,Bl,Vl,`End`]),Wl=new Set([Ll,Rl]),Gl=new Set([Ll,Rl,Vl,`End`]),Kl=new Set([...Hl,...Wl]),ql=new Set([...Kl,Vl,`End`]),Jl=new Set([Ll,Rl,zl,Bl,Vl,`End`]),Yl=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function Xl(e){return On(e)&&e.tagName===`INPUT`}function Zl(e){return!!(Xl(e)&&e.selectionStart!=null||On(e)&&e.tagName===`TEXTAREA`)}function Ql(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=$l(e,t,`left`),a=eu(e),o=eu(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=$l(e,t,`top`),r=eu(e),i=eu(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 $l(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 eu(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 tu={...ci,...zr,nestedDialogOpen(e){return e?{[Pl.nestedDialogOpen]:``}:null}};let nu=t.forwardRef(function(e,n){let{className:r,finalFocus:i,initialFocus:a,render:o,...s}=e,{store:c}=ei(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`);Il(),Pr({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=a===void 0?S:a,w=g>0,T=U(`div`,e,{state:t.useMemo(()=>({open:_,nested:h,transitionStatus:b,nestedDialogOpen:w}),[_,h,b,w]),props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){Jl.has(e.key)&&e.stopPropagation()},style:{[Nl.nestedDialogs]:g}},s],ref:[n,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:tu});return(0,W.jsx)(Zo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:i,modal:p!==!1,restoreFocus:`popup`,children:T})});process.env.NODE_ENV!==`production`&&(nu.displayName=`DialogPopup`);function ru(e){return T(19)?e:e?`true`:void 0}let iu=t.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
|
|
19
|
-
0% 0%,
|
|
20
|
-
100% 0%,
|
|
21
|
-
100% 100%,
|
|
22
|
-
0% 100%,
|
|
23
|
-
0% 0%,
|
|
24
|
-
${e.left}px ${e.top}px,
|
|
25
|
-
${e.left}px ${e.bottom}px,
|
|
26
|
-
${e.right}px ${e.bottom}px,
|
|
27
|
-
${e.right}px ${e.top}px,
|
|
28
|
-
${e.left}px ${e.top}px
|
|
29
|
-
)`}return(0,W.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`&&(iu.displayName=`InternalBackdrop`);let au=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=ei(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,W.jsx)(Fl.Provider,{value:n,children:(0,W.jsxs)(Vo,{ref:t,...r,children:[a&&o===!0&&(0,W.jsx)(iu,{ref:i.context.internalBackdropRef,inert:ru(!open)}),e.children]})}):null});process.env.NODE_ENV!==`production`&&(au.displayName=`DialogPortal`);var ou={},su={},cu=``;function lu(e){if(typeof document>`u`)return!1;let t=wo(e);return Tn(t).innerWidth-t.documentElement.clientWidth>0}function uu(e){let t=wo(e),n=t.documentElement,r=t.body,i=jn(n)?n:r,a=i.style.overflow;return i.style.overflow=`hidden`,()=>{i.style.overflow=a}}function du(e){let t=wo(e),n=t.documentElement,r=t.body,i=Tn(n),a=0,o=0,s=Ar.create(),c=typeof CSS<`u`&&CSS.supports?.(`scrollbar-gutter`,`stable`);if(_i&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let e=i.getComputedStyle(n),t=i.getComputedStyle(r),s=(e.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,ou={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cu=n.style.scrollBehavior,su={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 l=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,d=e.overflowY===`scroll`||t.overflowY===`scroll`,f=e.overflowX===`scroll`||t.overflowX===`scroll`,p=Math.max(0,i.innerWidth-n.clientWidth),m=Math.max(0,i.innerHeight-n.clientHeight),h=parseFloat(t.marginTop)+parseFloat(t.marginBottom),g=parseFloat(t.marginLeft)+parseFloat(t.marginRight),_=jn(n)?n:r;if(c){n.style.scrollbarGutter=s,_.style.overflowY=`hidden`,_.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(l||d)&&(n.style.overflowY=`scroll`),(u||f)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:h||m?`calc(100dvh - ${h+m}px)`:`100dvh`,width:g||p?`calc(100vw - ${g+p}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,ou),Object.assign(r.style,su),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=cu)}function d(){u(),s.request(l)}return l(),i.addEventListener(`resize`,d),()=>{s.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var fu=new class{lockCount=0;restore=null;timeoutLock=we.create();timeoutUnlock=we.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=wo(e).documentElement,n=Tn(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=z;return}this.restore=vi||!lu(e)?uu(e):du(e)}};function pu(e=!0,t=null){K(()=>{if(e)return fu.acquire(t)},[e,t])}function mu(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 hu(e){let[n,r]=t.useState(null),i=G((t,n)=>{e||r(n)}),a=t.useCallback(()=>{r(null)},[]),{onClick:o,onPointerDown:s}=mu(i);return t.useMemo(()=>({openMethod:n,reset:a,triggerProps:{onClick:o,onPointerDown:s}}),[n,a,o,s])}function gu(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,reset:d}=hu(a);il(n);let{forceUnmount:f}=al(a,n,()=>{d()}),p=G(e=>{let t=Sr(e);return t.preventUnmountOnClose=()=>{n.set(`preventUnmountingOnClose`,!0)},t}),m=t.useCallback(()=>{n.setOpen(!1,p(xr))},[n,p]);t.useImperativeHandle(i,()=>({unmount:f,close:m}),[f,m]);let h=fl({popupStore:n,onOpenChange:n.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,_]=t.useState(0),v=g===0,y=kl(h),b=pc(h,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let t=Oi(e);if(v&&!o){let e=t;return s&&(n.context.internalBackdropRef.current||n.context.backdropRef.current)?n.context.internalBackdropRef.current===e||n.context.backdropRef.current===e||Q(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:v});pu(a&&s===!0,c);let{getReferenceProps:x,getFloatingProps:S,getTriggerProps:C}=Tl([y,b]);n.useContextCallback(`onNestedDialogOpen`,e=>{_(e+1)}),n.useContextCallback(`onNestedDialogClose`,()=>{_(0)}),t.useEffect(()=>(r?.onNestedDialogOpen&&a&&r.onNestedDialogOpen(g),r?.onNestedDialogClose&&!a&&r.onNestedDialogClose(),()=>{r?.onNestedDialogClose&&a&&r.onNestedDialogClose()}),[a,r,g]);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:h,nestedOpenDialogCount:g})}var _u={...ll,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},vu=class extends Qc{constructor(e){super(yu(e),{popupRef:t.createRef(),backdropRef:t.createRef(),internalBackdropRef:t.createRef(),triggerElements:new ol,onOpenChange:void 0,onOpenChangeComplete:void 0},_u)}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 yu(e={}){return{...cl(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function bu(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=ei(!0),m=!!p,h=_(()=>u?.store??new vu({open:r??i,activeTriggerId:d===void 0?f:d,modal:c,disablePointerDismissal:s,nested:m})).current;h.useControlledProp(`open`,r,i),h.useControlledProp(`activeTriggerId`,d,f),h.useSyncedValues({disablePointerDismissal:s,nested:m,modal:c}),h.useContextCallback(`onOpenChange`,a),h.useContextCallback(`onOpenChangeComplete`,o);let g=h.useState(`payload`);gu({store:h,actionsRef:l,parentContext:p?.store.context,onOpenChange:a,triggerIdProp:d});let v=t.useMemo(()=>({store:h}),[h]);return(0,W.jsx)($r.Provider,{value:v,children:typeof n==`function`?n({payload:g}):n})}let xu=t.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=ei(),s=Sn(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),U(`h2`,e,{ref:t,props:[{id:s},a]})});process.env.NODE_ENV!==`production`&&(xu.displayName=`DialogTitle`);let Su=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=ei(!0),f=l?.store??d?.store;if(!f)throw Error(process.env.NODE_ENV===`production`?h(79):`Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.`);let p=Sn(s),m=f.useState(`floatingRootContext`),g=f.useState(`isOpenedByTrigger`,p),_=t.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=rl(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=tr({disabled:a,native:o}),S=Tl([Qo(m,{enabled:m!=null})]),C=t.useMemo(()=>({disabled:a,open:g}),[a,g]),w=f.useState(`triggerProps`,y);return U(`button`,e,{state:C,ref:[x,n,v,_],props:[S.getReferenceProps(),w,{"data-base-ui-click-trigger":``,id:p},u,b],stateAttributesMapping:si})});process.env.NODE_ENV!==`production`&&(Su.displayName=`DialogTrigger`);var Cu=m();let wu=e=>{let t=(0,Cu.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(ln,{style:`ghost`,tone:`neutral`,children:`Close`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,W.jsx)(di,{className:o,ref:a,...i,render:s,children:n}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c};var Tu=m();let Eu=e=>{let t=(0,Tu.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`text-prose-0 mb-0`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(fi,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var Du=m();let Ou=e=>{let t=(0,Du.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,showCloseButton:o,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?!0:o,c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,W.jsx)(ui,{className:`fixed inset-[0px] min-h-dvh bg-scrim opacity-50 transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute`}),t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=X(`fixed top-1/2 left-1/2 min-w-1/3 max-w-[calc(100vw-3rem)] px-md py-sm space-y-2xs -translate-x-1/2 -translate-y-1/2 rounded-lg bg-surface-container outline-1 outline-outline transition-all duration-150 data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0`,r),t[7]=r,t[8]=l);let u;t[9]===s?u=t[10]:(u=s&&(0,W.jsx)(wu,{}),t[9]=s,t[10]=u);let d;t[11]===u?d=t[12]:(d=(0,W.jsx)(`div`,{className:`flex justify-end`,children:u}),t[11]=u,t[12]=d);let f;return t[13]!==n||t[14]!==i||t[15]!==a||t[16]!==l||t[17]!==d?(f=(0,W.jsxs)(au,{children:[c,(0,W.jsxs)(nu,{className:l,ref:a,...i,children:[n,d]})]}),t[13]=n,t[14]=i,t[15]=a,t[16]=l,t[17]=d,t[18]=f):f=t[18],f};var ku=m();let Au=e=>{let t=(0,ku.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`text-strong-2`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(xu,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var ju=m();let Mu=e=>{let t=(0,ju.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(Su,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var Nu=m();let Pu=e=>{let t=(0,Nu.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,W.jsx)(bu,{...n}),t[2]=n,t[3]=r),r};var Fu=new WeakMap,Iu=new WeakMap,Lu={current:[]},Ru=!1,zu=0,Bu=new Set,Vu=new Map;function Hu(e){let t=Array.from(e).sort((e,t)=>e instanceof Yu&&e.options.deps.includes(t)?1:t instanceof Yu&&t.options.deps.includes(e)?-1:0);for(let e of t){if(Lu.current.includes(e))continue;Lu.current.push(e),e.recompute();let t=Iu.get(e);if(t)for(let e of t){let t=Fu.get(e);t&&Hu(t)}}}function Uu(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Wu(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Gu(e){if(zu>0&&!Vu.has(e)&&Vu.set(e,e.prevState),Bu.add(e),!(zu>0)&&!Ru)try{for(Ru=!0;Bu.size>0;){let e=Array.from(Bu);Bu.clear();for(let t of e)t.prevState=Vu.get(t)??t.prevState,Uu(t);for(let t of e){let e=Fu.get(t);e&&(Lu.current.push(t),Hu(e))}for(let t of e){let e=Fu.get(t);if(e)for(let t of e)Wu(t)}}}finally{Ru=!1,Lu.current=[],Vu.clear()}}function Ku(e){zu++;try{e()}finally{if(zu--,zu===0){let e=Bu.values().next().value;e&&Gu(e)}}}function qu(e){return typeof e==`function`}var Ju=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):qu(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),Gu(this)}},Yu=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof Ju){let e=Fu.get(n);e||(e=new Set,Fu.set(n,e)),e.add(this);let t=Iu.get(this);t||(t=new Set,Iu.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof Ju){let e=Fu.get(n);e&&e.delete(this);let t=Iu.get(this);t&&t.delete(n)}}},Xu=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Zu(e,t){return new Xu(e,t).maybeExecute}var Qu=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},$u=new class extends Qu{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function ed(e,t){return typeof e==`function`?e(t):e}function td(e,t){return dd(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function nd(e,t,n){let r=dd(t);function i(e){if(!r.length)return ed(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function rd(e,t){let n=dd(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var id=/^(\d+)$/gm,ad=/\.(\d+)(?=\.)/gm,od=/^(\d+)\./gm,sd=/\.(\d+$)/gm,cd=/\.{2,}/gm,ld=`__int__`,ud=`${ld}$1`;function dd(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);return e.replace(/(^\[)|]/gm,``).replace(/\[/g,`.`).replace(id,ud).replace(ad,`.${ud}.`).replace(od,`${ud}.`).replace(sd,`.${ud}`).replace(cd,`.`).split(`.`).map(e=>{if(e.startsWith(ld)){let t=e.substring(7),n=parseInt(t,10);return String(n)===t?n:t}return e})}function fd(e,t){return e.length===0?t:t.length===0?e:t.startsWith(`[`)||t.startsWith(`.`)?e+t:`${e}.${t}`}function pd(e){return!(Array.isArray(e)&&e.length===0)}function md(e,t){return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function hd(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,validators:t.validators,event:{type:e,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0;break}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var gd=e=>!!e&&typeof e==`object`&&`fields`in e;function _d(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!_d(e[i],t[i]))return!1;return!0}var vd=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},yd=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function bd(e,t){return e==null?t:{...e,...t}}for(var xd=256,Sd=[],Cd;xd--;)Sd[xd]=(xd+256).toString(16).substring(1);function wd(){let e=0,t,n=``;if(!Cd||xd+16>256){for(Cd=Array(256),e=256;e--;)Cd[e]=256*Math.random()|0;e=0,xd=0}for(;e<16;e++)t=Cd[xd+e],e===6?n+=Sd[t&15|64]:e===8?n+=Sd[t&63|128]:n+=Sd[t],e&1&&e>1&&e<11&&(n+=`-`);return xd++,n}var Td=Zu(e=>$u.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300}),Ed=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function Dd(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);Array.isArray(i)&&!Number.isNaN(o)?a+=`[${o}]`:a+=(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var Od=(e,t)=>{let n=Dd(e,t);return{form:n,fields:n}},kd={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:Od(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:Od(r.issues,e)}},Ad=e=>!!e&&`~standard`in e,jd={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function Md(e){function t(t,n,r){let i=o(t,n,`move`,r),s=Math.min(n,r),l=Math.max(n,r);for(let e=s;e<=l;e++)i.push(a(t,e));let u=Object.keys(e.fieldInfo).reduce((r,i)=>(i.startsWith(a(t,n))&&r.set(i,e.getFieldMeta(i)),r),new Map);c(i,n<r?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(a(t,r))).forEach(i=>{let o=i.replace(a(t,r),a(t,n)),s=u.get(o);s&&e.setFieldMeta(i,s)})}function n(e,t){c(o(e,t,`remove`),`up`)}function r(t,n,r){o(t,n,`swap`,r).forEach(i=>{if(!i.toString().startsWith(a(t,n)))return;let o=i.toString().replace(a(t,n),a(t,r)),[s,c]=[e.getFieldMeta(i),e.getFieldMeta(o)];s&&e.setFieldMeta(o,s),c&&e.setFieldMeta(i,c)})}function i(t,n){let r=o(t,n,`insert`);c(r,`down`),r.forEach(r=>{r.toString().startsWith(a(t,n))&&e.setFieldMeta(r,l())})}function a(e,t){return`${e}[${t}]`}function o(t,n,r,i){let o=[a(t,n)];switch(r){case`swap`:o.push(a(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)o.push(a(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)o.push(a(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>o.some(t=>e.startsWith(t)))}function s(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function c(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=s(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,l())})}let l=()=>jd;return{handleArrayMove:t,handleArrayRemove:n,handleArraySwap:r,handleArrayInsert:i}}function Nd(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var Pd=class{constructor(e){this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{let e=this.fieldMetaDerived.mount(),t=this.store.mount(),n=this.store.subscribe(()=>{Td(this)}),r=$u.on(`request-form-state`,e=>{e.payload.id===this._formId&&$u.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),i=$u.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),a=$u.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),o=()=>{a(),i(),r(),n(),e(),t(),$u.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:s}=this.options.validators||{};return $u.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),s&&this.validateSync(`mount`),o},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=!!e.transform?.deps?.some((e,t)=>e!==this.prevTransformArray[t]),r=e.defaultValues&&!_d(e.defaultValues,t.defaultValues)&&!this.state.isTouched,i=!_d(e.defaultState,t.defaultState)&&!this.state.isTouched;!r&&!i&&!n||(Ku(()=>{this.baseStore.setState(()=>Nd(Object.assign({},this.state,i?e.defaultState:{},r?{values:e.defaultValues}:{},n?{_force_re_eval:!this.state._force_re_eval}:{})))}),$u.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}))},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>Nd({...this.options.defaultState,values:e??this.options.defaultValues??this.options.defaultState?.values,fieldMetaBase:r}))},this.validateAllFields=async e=>{let t=[];return Ku(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0}))),n.instance.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return Ku(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;return n?(n.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)):[]},this.validateSync=e=>{let t=md(e,{...this.options,form:this,validationLogic:this.options.validationLogic||Ed}),n=!1,r={};return Ku(()=>{for(let e of t){if(!e.validate)continue;let{formError:t,fieldErrors:i}=Fd(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),a=Id(e.cause),o=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]);for(let e of o){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??jd,o=i?.[e],{newErrorValue:s,newSource:c}=vd({newFormValidatorError:o,isPreviousErrorFromFormValidator:n?.[a]===`form`,previousErrorValue:t?.[a]});c===`form`&&(r[e]={...r[e],[a]:o}),t?.[a]!==s&&this.setFieldMeta(e,(e=jd)=>({...e,errorMap:{...e.errorMap,[a]:s},errorSourceMap:{...e.errorSourceMap,[a]:c}}))}this.state.errorMap?.[a]!==t&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:t}})),(t||i)&&(n=!0)}let i=Id(`submit`);this.state.errorMap?.[i]&&e!==`submit`&&!n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[i]:void 0}}));let a=Id(`server`);this.state.errorMap?.[a]&&e!==`server`&&!n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}))}),{hasErrored:n,fieldsErrorMap:r}},this.validateAsync=async e=>{let t=hd(e,{...this.options,form:this,validationLogic:this.options.validationLogic||Ed});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let n=[],r;for(let e of t){if(!e.validate)continue;let t=Id(e.cause);this.state.validationMetaMap[t]?.lastAbortController.abort();let i=new AbortController;this.state.validationMetaMap[t]={lastAbortController:i},n.push(new Promise(async t=>{let n;try{n=await new Promise((t,n)=>{setTimeout(async()=>{if(i.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:i.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){n=e}let{formError:a,fieldErrors:o}=Fd(n);o&&(r=r?{...r,...o}:o);let s=Id(e.cause);for(let e of Object.keys(this.state.fieldMeta)){if(this.baseStore.state.fieldMetaBase[e]===void 0)continue;let t=this.getFieldMeta(e);if(!t)continue;let{errorMap:n,errorSourceMap:i}=t,a=r?.[e],{newErrorValue:o,newSource:c}=vd({newFormValidatorError:a,isPreviousErrorFromFormValidator:i?.[s]===`form`,previousErrorValue:n?.[s]});n?.[s]!==o&&this.setFieldMeta(e,e=>({...e,errorMap:{...e.errorMap,[s]:o},errorSourceMap:{...e.errorSourceMap,[s]:c}}))}this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[s]:a}})),t(r?{fieldErrors:r,errorMapKey:s}:void 0)}))}let i=[],a={};if(n.length){i=await Promise.all(n);for(let e of i)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))a[n]={...a[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),a},this.validate=e=>{let{hasErrored:t,fieldsErrorMap:n}=this.validateSync(e);return t&&!this.options.asyncAlways?n:this.validateAsync(e)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Ku(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),$u.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),$u.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}Ku(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.options.listeners?.onSubmit?.({value:e.instance.state.value,fieldApi:e.instance})})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),Ku(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),$u.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),$u.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>td(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:ed(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=jd,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Ku(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:nd(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t!==n&&t.startsWith(n)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=rd(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],bd(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),Md(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),bd(r,{dontValidate:!0})),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),bd(n,{dontValidate:!0})),Md(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return nd(nd(e,`${t}`,i),`${n}`,r)},bd(r,{dontValidate:!0})),Md(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},bd(r,{dontValidate:!0})),Md(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],bd(t,{dontValidate:!0})),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>({...t,fieldMetaBase:{...t.fieldMetaBase,[e]:jd},values:this.options.defaultValues?nd(t.values,e,td(this.options.defaultValues,e)):t.values}))},this.setErrorMap=e=>{Ku(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(gd(t)){let{formError:e,fieldErrors:r}=Fd(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>kd.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>kd.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??wd(),this._devtoolsSubmissionOverride=!1,this.baseStore=new Ju(Nd({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values})),this.fieldMetaDerived=new Yu({deps:[this.baseStore],fn:({prevDepVals:e,currDepVals:t,prevVal:n})=>{let r=n,i=e?.[0],a=t[0],o=0,s={};for(let e of Object.keys(a.fieldMetaBase)){let t=a.fieldMetaBase[e],n=i?.fieldMetaBase[e],c=r?.[e],l=td(a.values,e),u=c?.errors;if(!n||t.errorMap!==n.errorMap){u=Object.values(t.errorMap??{}).filter(e=>e!==void 0);let n=this.getFieldInfo(e)?.instance;n&&!n.options.disableErrorFlat&&(u=u.flat(1))}let d=!pd(u),f=!t.isDirty,p=_d(l,td(this.options.defaultValues,e))||_d(l,this.getFieldInfo(e)?.instance?.options.defaultValue);if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&t===n){s[e]=c,o++;continue}s[e]={...t,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(a.fieldMetaBase).length&&r&&o===Object.keys(a.fieldMetaBase).length?r:s}}),this.store=new Yu({deps:[this.baseStore,this.fieldMetaDerived],fn:({prevDepVals:e,currDepVals:t,prevVal:n})=>{let r=n,i=e?.[0],a=t[0],o=t[1],s=Object.values(o).filter(Boolean),c=s.some(e=>e.isValidating),l=s.every(e=>e.isValid),u=s.some(e=>e.isTouched),d=s.some(e=>e.isBlurred),f=s.every(e=>e.isDefaultValue),p=u&&a.errorMap?.onMount,m=s.some(e=>e.isDirty),h=!m,g=!!(a.errorMap?.onMount||s.some(e=>e?.errorMap?.onMount)),_=!!c,v=r?.errors??[];(!i||a.errorMap!==i.errorMap)&&(v=Object.values(a.errorMap).reduce((e,t)=>t===void 0?e:t&&gd(t)?(e.push(t.form),e):(e.push(t),e),[]));let y=v.length===0,b=l&&y,x=this.options.canSubmitWhenInvalid??!1,S=a.submissionAttempts===0&&!u&&!g||!_&&!a.isSubmitting&&b||x,C=a.errorMap;if(p&&(v=v.filter(e=>e!==a.errorMap.onMount),C=Object.assign(C,{onMount:void 0})),r&&i&&r.errorMap===C&&r.fieldMeta===this.fieldMetaDerived.state&&r.errors===v&&r.isFieldsValidating===c&&r.isFieldsValid===l&&r.isFormValid===y&&r.isValid===b&&r.canSubmit===S&&r.isTouched===u&&r.isBlurred===d&&r.isPristine===h&&r.isDefaultValue===f&&r.isDirty===m&&_d(i,a))return r;let w={...a,errorMap:C,fieldMeta:this.fieldMetaDerived.state,errors:v,isFieldsValidating:c,isFieldsValid:l,isFormValid:y,isValid:b,canSubmit:S,isTouched:u,isBlurred:d,isPristine:h,isDefaultValue:f,isDirty:m},T=this.options.transform?.deps??[];if(T.length!==this.prevTransformArray.length||T.some((e,t)=>e!==this.prevTransformArray[t])){let e=Object.assign({},this,{state:w});this.options.transform?.fn(e),w=e.state,this.prevTransformArray=T}return w}}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return Ad(e.validate)?kd[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Fd(e){return e?gd(e)?{formError:Fd(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function Id(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;case`change`:default:return`onChange`}}var Ld=class{constructor(e){this.options={},this.mount=()=>{let e=this.store.mount();this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let t=this.getInfo();t.instance=this,this.update(this.options);let{onMount:n}=this.options.validators||{};if(n){let e=this.runValidator({validate:n,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),e},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(_d(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,bd(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,bd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,bd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,bd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,bd(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,bd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,bd(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,bd(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=e=>{let t=Object.values(this.form.fieldInfo),n=[];for(let r of t){if(!r.instance)continue;let{onChangeListenTo:t,onBlurListenTo:i}=r.instance.options.validators||{};e===`change`&&t?.includes(this.name)&&n.push(r.instance),e===`blur`&&i?.includes(this.name)&&n.push(r.instance)}return n},this.validateSync=(e,t)=>{let n=md(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Ed}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=md(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Ed});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Ku(()=>{let e=(e,n)=>{let r=zd(n.cause),a=n.validate?Rd(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=yd({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=zd(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=hd(e,{...this.options,form:this.form,validationLogic:this.form.options.validationLogic||Ed}),r=await t,i=this.getLinkedFields(e),a=i.reduce((t,n)=>{let r=hd(e,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Ed});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),o=[],s=[],c=n.some(e=>e.validate)||a.some(e=>e.validate);if(c){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of i)e.setMeta(e=>({...e,isValidating:!0}))}let l=(e,t,n)=>{let i=zd(t.cause);e.getInfo().validationMetaMap[i]?.lastAbortController.abort();let a=new AbortController;this.getInfo().validationMetaMap[i]={lastAbortController:a},n.push(new Promise(async n=>{let o;try{o=await new Promise((n,r)=>{this.timeoutIds.validations[t.cause]&&clearTimeout(this.timeoutIds.validations[t.cause]),this.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(a.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:a.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){o=e}if(a.signal.aborted)return n(void 0);let s=Rd(o),c=r[this.name]?.[i],{newErrorValue:l,newSource:u}=yd({formLevelError:c,fieldLevelError:s});e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,o);for(let e of a)e.validate&&l(e.field,e,s);let u=[];if((o.length||s.length)&&(u=await Promise.all(o),await Promise.all(s)),c){this.setMeta(e=>({...e,isValidating:!1}));for(let e of i)e.setMeta(e=>({...e,isValidating:!1}))}return u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e),{hasErrored:r}=this.validateSync(e,n[this.name]??{});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[zd(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e);return this.validateAsync(e,i)},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>kd.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>kd.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},this.form=e.form,this.name=e.name,this.options=e,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=new Yu({deps:[this.form.store],fn:()=>{let t=this.form.getFieldMeta(this.name)??{...jd,...e.defaultMeta},n=this.form.getFieldValue(this.name);return!t.isTouched&&n===void 0&&this.options.defaultValue!==void 0&&!_d(n,this.options.defaultValue)&&(n=this.options.defaultValue),{value:n,meta:t}}})}get state(){return this.store.state}runValidator(e){return Ad(e.validate)?kd[e.type](e.value,e.validate):e.validate(e.value)}triggerOnBlurListener(){let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})}};function Rd(e){if(e)return e}function zd(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;case`change`:default:return`onChange`}}var Bd=class e{constructor(t){if(this.getFormFieldName=e=>{if(typeof this.fieldsMap==`string`)return fd(this.fieldsMap,e);let t=dd(e)[0];if(typeof t!=`string`)return``;let n=e.slice(t.length),r=this.fieldsMap[t];return fd(r,n)},this.getFormFieldOptions=e=>{let t={...e},n=t.validators;if(t.name=this.getFormFieldName(e.name),n&&(n.onChangeListenTo||n.onBlurListenTo)){let e={...n},r=e=>{if(e)return e.map(e=>this.getFormFieldName(e))};e.onChangeListenTo=r(n.onChangeListenTo),e.onBlurListenTo=r(n.onBlurListenTo),t.validators=e}return t},this.mount=()=>this.store.mount(),this.validateArrayFieldsStartingFrom=async(e,t,n)=>this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(e),t,n),this.validateField=(e,t)=>this.form.validateField(this.getFormFieldName(e),t),this.getFieldValue=e=>this.form.getFieldValue(this.getFormFieldName(e)),this.getFieldMeta=e=>this.form.getFieldMeta(this.getFormFieldName(e)),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(this.getFormFieldName(e),t),this.setFieldValue=(e,t,n)=>this.form.setFieldValue(this.getFormFieldName(e),t,n),this.deleteField=e=>this.form.deleteField(this.getFormFieldName(e)),this.pushFieldValue=(e,t,n)=>this.form.pushFieldValue(this.getFormFieldName(e),t,n),this.insertFieldValue=async(e,t,n,r)=>this.form.insertFieldValue(this.getFormFieldName(e),t,n,r),this.replaceFieldValue=async(e,t,n,r)=>this.form.replaceFieldValue(this.getFormFieldName(e),t,n,r),this.removeFieldValue=async(e,t,n)=>this.form.removeFieldValue(this.getFormFieldName(e),t,n),this.swapFieldValues=(e,t,n,r)=>this.form.swapFieldValues(this.getFormFieldName(e),t,n,r),this.moveFieldValues=(e,t,n,r)=>this.form.moveFieldValues(this.getFormFieldName(e),t,n,r),this.clearFieldValues=(e,t)=>this.form.clearFieldValues(this.getFormFieldName(e),t),this.resetField=e=>this.form.resetField(this.getFormFieldName(e)),this.validateAllFields=e=>this.form.validateAllFields(e),t.form instanceof e){let e=t.form;if(this.form=e.form,typeof t.fields==`string`)this.fieldsMap=e.getFormFieldName(t.fields);else{let n={...t.fields};for(let t in n)n[t]=e.getFormFieldName(n[t]);this.fieldsMap=n}}else this.form=t.form,this.fieldsMap=t.fields;this.store=new Yu({deps:[this.form.store],fn:({currDepVals:e})=>{let t=e[0],n;if(typeof this.fieldsMap==`string`)n=td(t.values,this.fieldsMap);else{n={};let e=this.fieldsMap;for(let r in e)n[r]=td(t.values,e[r])}return{values:n}}})}get state(){return this.store.state}async handleSubmit(e){return this.form.handleSubmit(e)}},Vd=Wc();function Hd(e,t=e=>e,n={}){let r=n.equal??Ud;return(0,Vd.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function Ud(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Wd(e);if(n.length!==Wd(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Wd(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var Gd=typeof window<`u`?t.useLayoutEffect:t.useEffect;function Kd(e){let[n,r]=(0,t.useState)(()=>({form:e.form,name:e.name})),[i,a]=(0,t.useState)(()=>new Ld({...e}));(n.form!==e.form||n.name!==e.name)&&(a(new Ld({...e})),r({form:e.form,name:e.name}));let o=Hd(i.store,e.mode===`array`?e=>Object.keys(e.value??[]).length:e=>e.value),s=Hd(i.store,e=>e.meta.isTouched),c=Hd(i.store,e=>e.meta.isBlurred),l=Hd(i.store,e=>e.meta.isDirty),u=Hd(i.store,e=>e.meta.errorMap),d=Hd(i.store,e=>e.meta.errorSourceMap),f=Hd(i.store,e=>e.meta.isValidating),p=(0,t.useMemo)(()=>{let t={...i,get state(){return{value:e.mode===`array`?i.state.value:o,get meta(){return{...i.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}};return t.Field=qd,t},[i,e.mode,o,s,c,l,u,d,f]);return Gd(i.mount,[i]),Gd(()=>{i.update(e)}),p}var qd=(({children:e,...n})=>{let r=Kd(n);return(0,W.jsx)(W.Fragment,{children:(0,t.useMemo)(()=>ed(e,r),[e,r])})});function Jd(){return(0,t.useState)(()=>wd())[0]}var Yd=t.version.split(`.`)[0]===`17`?Jd:t.useId;function Xd({form:e,selector:t,children:n}){return(0,W.jsx)(W.Fragment,{children:ed(n,Hd(e.store,t))})}function Zd(e){let n=Yd(),[r,i]=(0,t.useState)(e?.formId),[a,o]=(0,t.useState)(()=>new Pd({...e,formId:e?.formId??n}));if(r!==e?.formId){let t=e?.formId??n;o(new Pd({...e,formId:t})),i(t)}let s=(0,t.useMemo)(()=>{let e={...a,handleSubmit:((...e)=>a._handleSubmit(...e)),get formId(){return a._formId},get state(){return a.store.state}};return e.Field=function(e){return(0,W.jsx)(qd,{...e,form:a})},e.Subscribe=function(e){return(0,W.jsx)(Xd,{form:a,selector:e.selector,children:e.children})},e},[a]);return Gd(a.mount,[]),Gd(()=>{a.update(e)}),s}function Qd({lens:e,selector:t,children:n}){return(0,W.jsx)(W.Fragment,{children:ed(n,Hd(e.store,t))})}function $d(e){let[n]=(0,t.useState)(()=>{let t=new Bd(e),r=e.form instanceof Bd?e.form.form:e.form,i=t;return i.AppForm=function(e){return(0,W.jsx)(r.AppForm,{...e})},i.AppField=function(e){return(0,W.jsx)(r.AppField,{...n.getFormFieldOptions(e)})},i.Field=function(e){return(0,W.jsx)(r.Field,{...n.getFormFieldOptions(e)})},i.Subscribe=function(e){return(0,W.jsx)(Qd,{lens:n,selector:e.selector,children:e.children})},Object.assign(i,{...e.formComponents})});return Gd(n.mount,[n]),n}var ef=(0,t.createContext)(null),tf=(0,t.createContext)(null);function nf(){function e(){let e=(0,t.useContext)(ef);if(!e)throw Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return e}function n(){let e=(0,t.useContext)(tf);if(!e)throw Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return e}return{fieldContext:ef,useFieldContext:e,useFormContext:n,formContext:tf}}function rf({fieldComponents:e,fieldContext:n,formContext:r,formComponents:i}){function a(a){let o=Zd(a),s=(0,t.useMemo)(()=>({children:e})=>(0,W.jsx)(r.Provider,{value:o,children:e}),[o]),c=(0,t.useMemo)(()=>(({children:t,...r})=>(0,W.jsx)(o.Field,{...r,children:r=>(0,W.jsx)(n.Provider,{value:r,children:t(Object.assign(r,e))})})),[o]);return(0,t.useMemo)(()=>Object.assign(o,{AppField:c,AppForm:s,...i}),[o,c,s])}function o({render:e,props:t}){return n=>e({...t,...n})}function s({render:e,props:n,defaultValues:r}){return function(a){let o=$d((0,t.useMemo)(()=>({form:a.form,fields:a.fields,defaultValues:r,formComponents:i}),[a.form,a.fields]));return e({...n,...a,group:o})}}return{useAppForm:a,withForm:o,withFieldGroup:s}}let{fieldContext:af,useFieldContext:of,formContext:sf,useFormContext:cf}=nf();var lf=m();let uf=e=>{let t=(0,lf.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=of(),s;t[5]===r?s=t[6]:(s=X(``,r),t[5]=r,t[6]=s);let c;t[7]===o.state.meta.errors?c=t[8]:(c=o.state.meta.errors.length>0&&(0,W.jsx)(`div`,{className:`mt-2`,children:o.state.meta.errors.map(df)}),t[7]=o.state.meta.errors,t[8]=c);let l;return t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==c?(l=(0,W.jsxs)(`div`,{className:s,ref:a,...i,children:[n,c]}),t[9]=n,t[10]=i,t[11]=a,t[12]=s,t[13]=c,t[14]=l):l=t[14],l};function df(e,t){return(0,W.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}function ff(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:a}=fr(),o=Sn(t);return K(()=>{if(!(!n&&!t||a===z)){if(n){let e=r?.current;Z(e)&&e.closest(`label`)!=null?a(t??null):a(i??o)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,r,i,a,n,o]),i??o}let pf=t.forwardRef(function(e,n){let{render:r,className:i,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,...d}=e,{state:f,name:p,disabled:m}=ir(),h=m||c,g=p??o,_=t.useMemo(()=>({...f,disabled:h}),[f,h]),{setTouched:v,setDirty:y,validityData:b,setFocused:x,setFilled:S,validationMode:C,validation:w}=ir(),{labelId:T}=fr(),E=ff({id:a});K(()=>{let e=s!=null;w.inputRef.current?.value||e&&s!==``?S(!0):e&&s===``&&S(!1)},[w.inputRef,S,s]);let[D,O]=un({controlled:s,default:u,name:`FieldControl`,state:`value`}),k=s!==void 0,A=G((e,t)=>{l?.(e,t),!t.isCanceled&&O(e)});return ur({id:E,name:g,commit:w.commit,value:D,getValue:()=>w.inputRef.current?.value,controlRef:w.inputRef}),U(`input`,e,{ref:n,state:_,props:[{id:E,disabled:h,name:g,ref:w.inputRef,"aria-labelledby":T,...k?{value:D}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;A(t,Sr(_r,e.nativeEvent)),y(t!==b.initialValue),S(t!==``)},onFocus(){x(!0)},onBlur(e){v(!0),x(!1),C===`onBlur`&&w.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(v(!0),w.commit(e.currentTarget.value))}},w.getInputValidationProps(),d],stateAttributesMapping:hn})});process.env.NODE_ENV!==`production`&&(pf.displayName=`FieldControl`);let mf=t.forwardRef(function(e,t){return(0,W.jsx)(pf,{ref:t,...e})});process.env.NODE_ENV!==`production`&&(mf.displayName=`Input`);var hf=m();let gf=e=>{let t=(0,hf.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(``,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(`div`,{className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var _f=m();let vf=e=>{let n=(0,_f.c)(20),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({leadingIcon:i,showSeparator:s,className:r,ref:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=s===void 0?!0:s,l=a.disabled,u=a.disabled,d;n[6]===r?d=n[7]:(d=X(`flex items-center gap-xs px-md w-full py-sm group h-xl inset-shadow-2-shadow inset-shadow-sm bg-surface-dim rounded-xl data-[disabled=true]:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:hover:outline-transparent outline-2 outline-transparent hover:not-focus-within:outline-outline focus-within:outline-primary focus-within:caret-primary transition-all`,r),n[6]=r,n[7]=d);let f;n[8]!==i||n[9]!==c?(f=i&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:X(`flex items-center text-on-surface-variant justify-center [&>svg]:size-s group-focus-within:text-primary transition-all`),children:(0,t.createElement)(i,{weight:`bold`})}),c&&(0,W.jsx)(gf,{orientation:`vertical`,className:`group-focus-within:bg-primary`})]}),n[8]=i,n[9]=c,n[10]=f):f=n[10];let p;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=X(`outline-none w-full`,`placeholder:opacity-60`,`disabled:text-text-neutral-primary-disabled disabled:cursor-not-allowed`,`overflow-ellipsis`),n[11]=p):p=n[11];let m;n[12]!==a||n[13]!==o?(m=(0,W.jsx)(mf,{className:p,ref:o,...a}),n[12]=a,n[13]=o,n[14]=m):m=n[14];let h;return n[15]!==a.disabled||n[16]!==d||n[17]!==f||n[18]!==m?(h=(0,W.jsxs)(`div`,{"aria-disabled":l,"data-disabled":u,className:d,children:[f,m]}),n[15]=a.disabled,n[16]=d,n[17]=f,n[18]=m,n[19]=h):h=n[19],h};var yf=m();let bf=e=>{let t=(0,yf.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=of(),s=o.name,c=o.name,l=o.state.value,u;t[5]===o?u=t[6]:(u=e=>o.handleChange(e.target.value),t[5]=o,t[6]=u);let d;t[7]===o?d=t[8]:(d=o.state.value&&o.getMeta().errors.length>0&&`outline-error`,t[7]=o,t[8]=d);let f;t[9]===o?f=t[10]:(f=o.state.value&&o.getMeta().isValid&&`outline-success`,t[9]=o,t[10]=f);let p;t[11]!==r||t[12]!==d||t[13]!==f?(p=X(d,f,r),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==n||t[16]!==o.name||t[17]!==o.state.value||t[18]!==i||t[19]!==a||t[20]!==u||t[21]!==p?(m=(0,W.jsx)(vf,{required:!0,type:`text`,id:s,name:c,value:l,onChange:u,className:p,ref:a,...i,children:n}),t[15]=n,t[16]=o.name,t[17]=o.state.value,t[18]=i,t[19]=a,t[20]=u,t[21]=p,t[22]=m):m=t[22],m};var xf=m();let Sf=e=>{let t=(0,xf.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({submittingText:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`Submitting...`:o,c=cf(),l;t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==a||t[10]!==s?(l=e=>{let[t,o]=e;return(0,W.jsx)(ln,{type:`submit`,disabled:!t||o,className:X(`w-full`,r),ref:a,...i,children:o?s:n})},t[6]=n,t[7]=r,t[8]=i,t[9]=a,t[10]=s,t[11]=l):l=t[11];let u;return t[12]!==c.Subscribe||t[13]!==l?(u=(0,W.jsx)(c.Subscribe,{selector:Cf,children:l}),t[12]=c.Subscribe,t[13]=l,t[14]=u):u=t[14],u};function Cf(e){return[e.canSubmit,e.isSubmitting]}var wf=m();let Tf=e=>{let t=(0,wf.c)(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=Hd(cf().store,Ef),s;t[5]===r?s=t[6]:(s=X(``,r),t[5]=r,t[6]=s);let c;t[7]===o?c=t[8]:(c=o.map(Df),t[7]=o,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,W.jsx)(`div`,{className:`mt-2`,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==n||t[12]!==i||t[13]!==a||t[14]!==s||t[15]!==l?(u=(0,W.jsxs)(`div`,{className:s,ref:a,...i,children:[n,l]}),t[11]=n,t[12]=i,t[13]=a,t[14]=s,t[15]=l,t[16]=u):u=t[16],u};function Ef(e){return e.errors}function Df(e,t){return(0,W.jsx)(`p`,{className:`text-error text-sm`,children:e.message},t)}let Of=rf({fieldComponents:{FieldErrors:uf,FieldInput:bf},formComponents:{FormErrors:Tf,FormSubmit:Sf},fieldContext:af,formContext:sf});var kf=m();let Af=e=>{let t=(0,kf.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=X(`hover:cursor-pointer`,r),t[5]=r,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,W.jsx)(`label`,{"data-slot":`label`,className:o,ref:a,...i,children:n}),t[7]=n,t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s};var jf=m();let Mf=e=>{let t=(0,jf.c)(36),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({className:r,imageUrl:a,fallbackText:i,profileName:c,profileEmail:l,compact:u,children:n,ref:s,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let d=c===void 0?``:c,f=l===void 0?``:l,p=u===void 0?!1:u,m;t[10]===r?m=t[11]:(m=X(`flex items-center gap-xs transition-colors`,r),t[10]=r,t[11]=m);let h;t[12]===a?h=t[13]:(h=(0,W.jsx)(Zt,{src:a}),t[12]=a,t[13]=h);let g;t[14]===i?g=t[15]:(g=(0,W.jsx)($t,{children:i}),t[14]=i,t[15]=g);let _;t[16]!==n||t[17]!==h||t[18]!==g?(_=(0,W.jsxs)(Yt,{children:[h,g,n]}),t[16]=n,t[17]=h,t[18]=g,t[19]=_):_=t[19];let v=p&&`hidden`,y;t[20]===v?y=t[21]:(y=X(`flex flex-col justify-start items-start`,v),t[20]=v,t[21]=y);let b;t[22]===d?b=t[23]:(b=(0,W.jsx)(`span`,{className:`text-prose-0`,children:d}),t[22]=d,t[23]=b);let x;t[24]===f?x=t[25]:(x=(0,W.jsx)(`span`,{className:`text-on-surface-variant text-prose--1`,children:f}),t[24]=f,t[25]=x);let S;t[26]!==b||t[27]!==x||t[28]!==y?(S=(0,W.jsxs)(`div`,{className:y,children:[b,x]}),t[26]=b,t[27]=x,t[28]=y,t[29]=S):S=t[29];let C;return t[30]!==o||t[31]!==s||t[32]!==S||t[33]!==m||t[34]!==_?(C=(0,W.jsxs)(`button`,{className:m,ref:s,...o,children:[_,S]}),t[30]=o,t[31]=s,t[32]=S,t[33]=m,t[34]=_,t[35]=C):C=t[35],C},Nf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Nf.displayName=`ScrollAreaRootContext`);function Pf(){let e=t.useContext(Nf);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(53):`Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.`);return e}let Ff=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});function If(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=n===`x`?`Inline`:`Block`;return n===`x`&&t===`margin`?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let Lf=function(e){return e.orientation=`data-orientation`,e.hovering=`data-hovering`,e.scrolling=`data-scrolling`,e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({});var Rf=`base-ui-disable-scrollbar`;let zf={className:Rf,element:(0,W.jsx)(`style`,{href:Rf,precedence:`base-ui:low`,children:`.${Rf}{scrollbar-width:none}.${Rf}::-webkit-scrollbar{display:none}`})},Bf=function(e){return e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),Vf={hasOverflowX:e=>e?{[Bf.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[Bf.hasOverflowY]:``}:null,overflowXStart:e=>e?{[Bf.overflowXStart]:``}:null,overflowXEnd:e=>e?{[Bf.overflowXEnd]:``}:null,overflowYStart:e=>e?{[Bf.overflowYStart]:``}:null,overflowYEnd:e=>e?{[Bf.overflowYEnd]:``}:null,cornerHidden:()=>null};var Hf={width:0,height:0},Uf={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1};let Wf=t.forwardRef(function(e,n){let{render:r,className:i,overflowEdgeThreshold:a,...o}=e,[s,c]=t.useState(!1),[l,u]=t.useState(!1),[d,f]=t.useState(!1),[p,m]=t.useState(Hf),[h,g]=t.useState(Hf),[_,v]=t.useState(!1),[y,b]=t.useState(Uf),x=Sn(),S=t.useRef(null),C=t.useRef(null),w=t.useRef(null),T=t.useRef(null),E=t.useRef(null),D=t.useRef(null),O=t.useRef(null),k=t.useRef(!1),A=t.useRef(0),j=t.useRef(0),M=t.useRef(0),N=t.useRef(0),P=t.useRef(`vertical`),ee=Te(),F=Te(),te=t.useRef({x:0,y:0}),[I,L]=t.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),R=Gf(a),ne=G(e=>{let t=e.x-te.current.x,n=e.y-te.current.y;te.current=e,n!==0&&(f(!0),ee.start(500,()=>{f(!1)})),t!==0&&(u(!0),F.start(500,()=>{u(!1)}))}),re=G(e=>{e.button===0&&(k.current=!0,A.current=e.clientY,j.current=e.clientX,P.current=e.currentTarget.getAttribute(Lf.orientation),C.current&&(M.current=C.current.scrollTop,N.current=C.current.scrollLeft),E.current&&P.current===`vertical`&&E.current.setPointerCapture(e.pointerId),D.current&&P.current===`horizontal`&&D.current.setPointerCapture(e.pointerId))}),z=G(e=>{if(!k.current)return;let t=e.clientY-A.current,n=e.clientX-j.current;if(C.current){let r=C.current.scrollHeight,i=C.current.clientHeight,a=C.current.scrollWidth,o=C.current.clientWidth;if(E.current&&w.current&&P.current===`vertical`){let n=If(w.current,`padding`,`y`),a=If(E.current,`margin`,`y`),o=E.current.offsetHeight,s=t/(w.current.offsetHeight-o-n-a);C.current.scrollTop=M.current+s*(r-i),e.preventDefault(),f(!0),ee.start(500,()=>{f(!1)})}if(D.current&&T.current&&P.current===`horizontal`){let t=If(T.current,`padding`,`x`),r=If(D.current,`margin`,`x`),i=D.current.offsetWidth,s=n/(T.current.offsetWidth-i-t-r);C.current.scrollLeft=N.current+s*(a-o),e.preventDefault(),u(!0),F.start(500,()=>{u(!1)})}}}),B=G(e=>{k.current=!1,E.current&&P.current===`vertical`&&E.current.releasePointerCapture(e.pointerId),D.current&&P.current===`horizontal`&&D.current.releasePointerCapture(e.pointerId)});function V(e){let t=e.pointerType===`touch`;v(t),t||c(Q(S.current,e.target))}let H=t.useMemo(()=>({hasOverflowX:!I.scrollbarXHidden,hasOverflowY:!I.scrollbarYHidden,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:I.cornerHidden}),[I.scrollbarXHidden,I.scrollbarYHidden,I.cornerHidden,y]),ie={role:`presentation`,onPointerEnter:V,onPointerMove:V,onPointerDown({pointerType:e}){v(e===`touch`)},onPointerLeave(){c(!1)},style:{position:`relative`,[Ff.scrollAreaCornerHeight]:`${p.height}px`,[Ff.scrollAreaCornerWidth]:`${p.width}px`}},ae=U(`div`,e,{state:H,ref:[n,S],props:[ie,o],stateAttributesMapping:Vf}),oe=t.useMemo(()=>({handlePointerDown:re,handlePointerMove:z,handlePointerUp:B,handleScroll:ne,cornerSize:p,setCornerSize:m,thumbSize:h,setThumbSize:g,touchModality:_,cornerRef:O,scrollingX:l,setScrollingX:u,scrollingY:d,setScrollingY:f,hovering:s,setHovering:c,viewportRef:C,rootRef:S,scrollbarYRef:w,scrollbarXRef:T,thumbYRef:E,thumbXRef:D,rootId:x,hiddenState:I,setHiddenState:L,overflowEdges:y,setOverflowEdges:b,viewportState:H,overflowEdgeThreshold:R}),[re,z,B,ne,p,h,_,O,l,u,d,f,s,c,C,S,w,T,E,D,x,I,y,H,R]);return(0,W.jsxs)(Nf.Provider,{value:oe,children:[zf.element,ae]})});process.env.NODE_ENV!==`production`&&(Wf.displayName=`ScrollAreaRoot`);function Gf(e){if(typeof e==`number`){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}let Kf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Kf.displayName=`ScrollAreaViewportContext`);let qf=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(qf.displayName=`DirectionContext`);function Jf(){return t.useContext(qf)?.direction??`ltr`}function Yf(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Xf(e,t){if(typeof IntersectionObserver>`u`)return()=>{};let n=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let Zf=function(e){return e.scrollAreaOverflowXStart=`--scroll-area-overflow-x-start`,e.scrollAreaOverflowXEnd=`--scroll-area-overflow-x-end`,e.scrollAreaOverflowYStart=`--scroll-area-overflow-y-start`,e.scrollAreaOverflowYEnd=`--scroll-area-overflow-y-end`,e}({});var Qf=!1;function $f(){Qf||_i||(typeof CSS<`u`&&`registerProperty`in CSS&&[Zf.scrollAreaOverflowXStart,Zf.scrollAreaOverflowXEnd,Zf.scrollAreaOverflowYStart,Zf.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),Qf=!0)}let ep=t.forwardRef(function(e,r){let{render:i,className:a,...o}=e,{viewportRef:s,scrollbarYRef:c,scrollbarXRef:l,thumbYRef:u,thumbXRef:d,cornerRef:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,handleScroll:v,setHovering:y,setOverflowEdges:b,overflowEdges:x,overflowEdgeThreshold:S}=Pf(),C=Jf(),w=t.useRef(!0),T=Te(),E=Te();function D(){let e=s.current,t=c.current,n=l.current,r=u.current,i=d.current,a=f.current;if(!e)return;let o=e.scrollHeight,h=e.scrollWidth,_=e.clientHeight,v=e.clientWidth,y=e.scrollTop,x=e.scrollLeft;if(o===0||h===0)return;let w=_>=o,T=v>=h,E=v/h,D=_/o,O=Math.max(0,h-v),k=Math.max(0,o-_),A=0,j=0;T||(A=Yf(C===`rtl`?-x:x,0,O),j=O-A);let M=w?0:Yf(y,0,k),N=w?0:k-M,P=T?0:v,ee=w?0:_,F=If(n,`padding`,`x`),te=If(t,`padding`,`y`),I=If(i,`margin`,`x`),L=If(r,`margin`,`y`),R=P-F-I,ne=ee-te-L,re=n?Math.min(n.offsetWidth,R):R,z=t?Math.min(t.offsetHeight,ne):ne,B=Math.max(16,re*E),V=Math.max(16,z*D);if(m(e=>e.height===V&&e.width===B?e:{width:B,height:V}),t&&r){let e=t.offsetHeight-V-te-L,n=o-_,i=n===0?0:y/n,a=Math.min(e,Math.max(0,i*e));r.style.transform=`translate3d(0,${a}px,0)`}if(n&&i){let e=n.offsetWidth-B-F-I,t=h-v,r=t===0?0:x/t,a=C===`rtl`?Yf(r*e,-e,0):Yf(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let H=Yf(A,0,O),ie=Yf(j,0,O),ae=Yf(M,0,k),U=Yf(N,0,k),oe=[[Zf.scrollAreaOverflowXStart,H],[Zf.scrollAreaOverflowXEnd,ie],[Zf.scrollAreaOverflowYStart,ae],[Zf.scrollAreaOverflowYEnd,U]];for(let[t,n]of oe)e.style.setProperty(t,`${n}px`);a&&(T||w?p({width:0,height:0}):!T&&!w&&p({width:t?.offsetWidth||0,height:n?.offsetHeight||0})),g(e=>{let t=w||T;return e.scrollbarYHidden===w&&e.scrollbarXHidden===T&&e.cornerHidden===t?e:{scrollbarYHidden:w,scrollbarXHidden:T,cornerHidden:t}});let se={xStart:!T&&H>S.xStart,xEnd:!T&&ie>S.xEnd,yStart:!w&&ae>S.yStart,yEnd:!w&&U>S.yEnd};b(e=>e.xStart===se.xStart&&e.xEnd===se.xEnd&&e.yStart===se.yStart&&e.yEnd===se.yEnd?e:se)}let O=G(()=>{n.flushSync(D)});K(()=>{if(s.current)return $f(),Xf(s.current,O)},[O,s]),K(()=>{queueMicrotask(O)},[O,_,C]),K(()=>{s.current?.matches(`:hover`)&&y(!0)},[s,y]),t.useEffect(()=>{let e=s.current;if(typeof ResizeObserver>`u`||!e)return;let t=new ResizeObserver(O);return t.observe(e),E.start(0,()=>{Promise.all(e.getAnimations({subtree:!0}).map(e=>e.finished)).then(O).catch(()=>{})}),()=>{t.disconnect(),E.clear()}},[O,s,E]);function k(){w.current=!1}let A={role:`presentation`,...h&&{"data-id":`${h}-viewport`},...(!_.scrollbarXHidden||!_.scrollbarYHidden)&&{tabIndex:0},className:zf.className,style:{overflow:`scroll`},onScroll(){s.current&&(O(),w.current||v({x:s.current.scrollLeft,y:s.current.scrollTop}),T.start(100,()=>{w.current=!0}))},onWheel:k,onTouchMove:k,onPointerMove:k,onPointerEnter:k,onKeyDown:k},j=t.useMemo(()=>({hasOverflowX:!_.scrollbarXHidden,hasOverflowY:!_.scrollbarYHidden,overflowXStart:x.xStart,overflowXEnd:x.xEnd,overflowYStart:x.yStart,overflowYEnd:x.yEnd,cornerHidden:_.cornerHidden}),[_.scrollbarXHidden,_.scrollbarYHidden,_.cornerHidden,x]),M=U(`div`,e,{ref:[r,s],state:j,props:[A,o],stateAttributesMapping:Vf}),N=t.useMemo(()=>({computeThumbPosition:O}),[O]);return(0,W.jsx)(Kf.Provider,{value:N,children:M})});process.env.NODE_ENV!==`production`&&(ep.displayName=`ScrollAreaViewport`);let tp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(tp.displayName=`ScrollAreaScrollbarContext`);function np(){let e=t.useContext(tp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(54):`Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.`);return e}let rp=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({}),ip=t.forwardRef(function(e,n){let{render:r,className:i,orientation:a=`vertical`,keepMounted:o=!1,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,overflowEdges:f,scrollbarYRef:p,scrollbarXRef:m,viewportRef:h,thumbYRef:g,thumbXRef:_,handlePointerDown:v,handlePointerUp:y,rootId:b,thumbSize:x}=Pf(),S=t.useMemo(()=>({hovering:c,scrolling:{horizontal:l,vertical:u}[a],orientation:a,hasOverflowX:!d.scrollbarXHidden,hasOverflowY:!d.scrollbarYHidden,overflowXStart:f.xStart,overflowXEnd:f.xEnd,overflowYStart:f.yStart,overflowYEnd:f.yEnd,cornerHidden:d.cornerHidden}),[c,l,u,a,d,f]),C=Jf();t.useEffect(()=>{let e=h.current,t=a===`vertical`?p.current:m.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),a===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(a===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;a===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[a,m,p,h]);let w={...b&&{"data-id":`${b}-scrollbar`},onPointerDown(e){if(e.button===0&&e.currentTarget===e.target&&h.current){if(g.current&&p.current&&a===`vertical`){let t=If(g.current,`margin`,`y`),n=If(p.current,`padding`,`y`),r=g.current.offsetHeight,i=p.current.getBoundingClientRect(),a=e.clientY-i.top-r/2-n+t/2,o=h.current.scrollHeight,s=h.current.clientHeight,c=a/(p.current.offsetHeight-r-n-t)*(o-s);h.current.scrollTop=c}if(_.current&&m.current&&a===`horizontal`){let t=If(_.current,`margin`,`x`),n=If(m.current,`padding`,`x`),r=_.current.offsetWidth,i=m.current.getBoundingClientRect(),a=e.clientX-i.left-r/2-n+t/2,o=h.current.scrollWidth,s=h.current.clientWidth,c=a/(m.current.offsetWidth-r-n-t),l;C===`rtl`?(l=(1-c)*(o-s),h.current.scrollLeft<=0&&(l=-l)):l=c*(o-s),h.current.scrollLeft=l}v(e)}},onPointerUp:y,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,...a===`vertical`&&{top:0,bottom:`var(${Ff.scrollAreaCornerHeight})`,insetInlineEnd:0,[rp.scrollAreaThumbHeight]:`${x.height}px`},...a===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${Ff.scrollAreaCornerWidth})`,bottom:0,[rp.scrollAreaThumbWidth]:`${x.width}px`}}},T=U(`div`,e,{ref:[n,a===`vertical`?p:m],state:S,props:[w,s],stateAttributesMapping:Vf}),E=t.useMemo(()=>({orientation:a}),[a]),D=a===`vertical`?d.scrollbarYHidden:d.scrollbarXHidden;return o||!D?(0,W.jsx)(tp.Provider,{value:E,children:T}):null});process.env.NODE_ENV!==`production`&&(ip.displayName=`ScrollAreaScrollbar`);let ap=t.forwardRef(function(e,n){let{render:r,className:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,setScrollingX:d,setScrollingY:f}=Pf(),{orientation:p}=np(),m=t.useMemo(()=>({orientation:p}),[p]);return U(`div`,e,{ref:[n,p===`vertical`?o:s],state:m,props:[{onPointerDown:c,onPointerMove:l,onPointerUp(e){p===`vertical`&&f(!1),p===`horizontal`&&d(!1),u(e)},style:{...p===`vertical`&&{height:`var(${rp.scrollAreaThumbHeight})`},...p===`horizontal`&&{width:`var(${rp.scrollAreaThumbWidth})`}}},a]})});process.env.NODE_ENV!==`production`&&(ap.displayName=`ScrollAreaThumb`);let op=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:o,hiddenState:s}=Pf(),c=U(`div`,e,{ref:[t,a],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},i]});return s.cornerHidden?null:c});process.env.NODE_ENV!==`production`&&(op.displayName=`ScrollAreaCorner`);var sp=m();let cp=e=>{let t=(0,sp.c)(26),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({orientation:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`vertical`:o,c=s===`horizontal`&&`h-full`,l;t[6]!==r||t[7]!==c?(l=X(`h-[200px] rounded-lg bg-surface-container`,c,r),t[6]=r,t[7]=c,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=(0,W.jsx)(ep,{className:`h-full overscroll-contain flex flex-col gap-xs py-2xs pr-sm pl-sm prose-step-0`,children:n}),t[9]=n,t[10]=u);let d=s===`vertical`&&`w-2xs mr-2xs my-2xs`,f=s===`horizontal`&&`h-2xs flex-col mb-2xs mx-xs`,p;t[11]!==r||t[12]!==d||t[13]!==f?(p=X(`inset-shadow-1-shadow flex justify-center rounded p-[2px] bg-surface-dim opacity-0 transition-opacity delay-300 data-hovering:opacity-100 data-hovering:delay-0 data-hovering:duration-75 data-scrolling:opacity-100 data-scrolling:delay-0 data-scrolling:duration-75 hover:cursor-pointer`,d,f,r),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.jsx)(ap,{className:`w-full h-full rounded-full bg-accent rounded-1`}),t[15]=m):m=t[15];let h;t[16]!==s||t[17]!==p?(h=(0,W.jsx)(ip,{orientation:s,className:p,children:m}),t[16]=s,t[17]=p,t[18]=h):h=t[18];let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(op,{}),t[19]=g):g=t[19];let _;return t[20]!==i||t[21]!==a||t[22]!==l||t[23]!==u||t[24]!==h?(_=(0,W.jsxs)(Wf,{className:l,ref:a,...i,children:[u,h,g]}),t[20]=i,t[21]=a,t[22]=l,t[23]=u,t[24]=h,t[25]=_):_=t[25],_},lp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(lp.displayName=`TooltipRootContext`);function up(e){let n=t.useContext(lp);if(n===void 0&&!e)throw Error(process.env.NODE_ENV===`production`?h(72):`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return n}var dp={...ll,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeDelay:$(e=>e.closeDelay)},fp=class e extends Qc{constructor(e){super({...pp(),...e},{popupRef:t.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new ol},dp)}setOpen=(e,t)=>{let r=t.reason,i=r===yr,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=_(()=>t??new e(n)).current,i=fl({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}};function pp(){return{...cl(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function mp(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=fp.useStore(u?.store,{open:i??r,activeTriggerId:d===void 0?f:d});m.useControlledProp(`open`,i,r),m.useControlledProp(`activeTriggerId`,d,f),m.useContextCallback(`onOpenChange`,c),m.useContextCallback(`onOpenChangeComplete`,l);let h=m.useState(`open`),g=m.useState(`activeTriggerId`),_=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:a});let v=!n&&h;K(()=>{h&&n&&m.setOpen(!1,Sr(`disabled`))},[h,n,m]),m.useSyncedValue(`disabled`,n),il(m);let{forceUnmount:y,transitionStatus:b}=al(v,m),x=m.useState(`isInstantPhase`),S=m.useState(`instantType`),C=m.useState(`lastOpenChangeReason`),w=t.useRef(null);K(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),m.set(`instantType`,`delay`)):w.current!==null&&(m.set(`instantType`,w.current),w.current=null)},[b,x,C,S,m]),K(()=>{v&&(g??m.set(`payload`,void 0))},[m,g,v]);let T=t.useCallback(()=>{m.setOpen(!1,hp(m,xr))},[m]);t.useImperativeHandle(s,()=>({unmount:y,close:T}),[y,T]);let E=m.useState(`floatingRootContext`),{getReferenceProps:D,getFloatingProps:O,getTriggerProps:k}=Tl([ml(E,{enabled:!n}),pc(E,{enabled:!n,referencePress:!0}),ts(E,{enabled:!n&&o!==`none`,axis:o===`none`?void 0:o})]),A=t.useMemo(()=>D(),[D]),j=t.useMemo(()=>k(),[k]),M=t.useMemo(()=>O(),[O]);return m.useSyncedValues({floatingRootContext:E,activeTriggerProps:A,inactiveTriggerProps:j,popupProps:M}),(0,W.jsx)(lp.Provider,{value:m,children:typeof p==`function`?p({payload:_}):p})}function hp(e,t){let n=Sr(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}let gp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(gp.displayName=`TooltipProviderContext`);function _p(){return t.useContext(gp)}let vp=t.forwardRef(function(e,n){let{className:r,render:i,handle:a,payload:o,disabled:s,delay:c,closeDelay:l,id:u,...d}=e,f=up(!0),p=a?.store??f;if(!p)throw Error(process.env.NODE_ENV===`production`?h(82):`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let m=Sn(u),g=p.useState(`isTriggerActive`,m),_=p.useState(`floatingRootContext`),v=p.useState(`isOpenedByTrigger`,m),y=t.useRef(null),b=c??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=rl(m,y,p,{payload:o,closeDelay:x}),w=_p(),{delayRef:T,isInstantPhase:E,hasProvider:D}=Co(_,{open:v});p.useSyncedValue(`isInstantPhase`,E);let O=p.useState(`disabled`),k=s??O,A=p.useState(`trackCursorAxis`),j=p.useState(`disableHoverablePopup`),M=wl(_,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?Ml():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 l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g}),N=t.useMemo(()=>({open:v}),[v]),P=p.useState(`triggerProps`,C);return U(`button`,e,{state:N,ref:[n,S,y],props:[M,P,{id:m},d],stateAttributesMapping:si})});process.env.NODE_ENV!==`production`&&(vp.displayName=`TooltipTrigger`);let yp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(yp.displayName=`TooltipPortalContext`);function bp(){let e=t.useContext(yp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(70):`Base UI: <Tooltip.Portal> is missing.`);return e}let xp=t.forwardRef(function(e,r){let{children:i,container:a,className:o,render:s,...c}=e,{portalNode:l,portalSubtree:u}=Bo({container:a,ref:r,componentProps:e,elementProps:c});return!u&&!l?null:(0,W.jsxs)(t.Fragment,{children:[u,l&&n.createPortal(i,l)]})});process.env.NODE_ENV!==`production`&&(xp.displayName=`FloatingPortalLite`);let Sp=t.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return up().useState(`mounted`)||n?(0,W.jsx)(yp.Provider,{value:n,children:(0,W.jsx)(xp,{ref:t,...r})}):null});process.env.NODE_ENV!==`production`&&(Sp.displayName=`TooltipPortal`);let Cp=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Cp.displayName=`TooltipPositionerContext`);function wp(){let e=t.useContext(Cp);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(71):`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}let Tp=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`}=$i(e,t)||{};if(l==null)return{};let f=va(u),p={x:n,y:r},m=oa(i),h=ra(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=Qi(k,j,A),N=!c.arrow&&ta(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}}}),Ep=(e,t)=>({...Tp(e),options:[e,t]}),Dp={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 uc().fn(e)).data?.referenceHidden||a}}}},Op={sideX:`left`,sideY:`top`},kp={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Tn(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Op};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=wo(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=ea(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`:Op.sideX,g=f===`top`?`bottom`:Op.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Ap(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 jp(e,t,n){let{rects:r,placement:i}=e;return{side:Ap(t,ea(i),n),align:ta(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Mp(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:v,adaptiveOrigin:y,lazyFlip:b=!1,externalTree:x}=e,[S,C]=t.useState(null);!h&&S!==null&&C(null);let w=g.side||`flip`,T=g.align||`flip`,E=g.fallbackAxisSide||`end`,D=typeof n==`function`?n:void 0,O=G(D),k=D?O:n,A=Tr(n),j=Jf()===`rtl`,M=S||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[i],N=o===`center`?M:`${M}-${o}`,P=l,ee=i===`bottom`?1:0,F=i===`top`?1:0,te=i===`right`?1:0,I=i===`left`?1:0;typeof P==`number`?P={top:P+ee,right:P+I,bottom:P+F,left:P+te}:P&&={top:(P.top||0)+ee,right:(P.right||0)+I,bottom:(P.bottom||0)+F,left:(P.left||0)+te};let L={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:P},R=t.useRef(null),ne=Tr(a),re=Tr(s),z=[ac(e=>{let t=jp(e,i,j),n=typeof ne.current==`function`?ne.current(t):ne.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[typeof a==`function`?0:a,typeof s==`function`?0:s,j,i])],B=T===`none`&&w!==`shift`,V=!B&&(u||_||w===`shift`),H=w===`none`?null:cc({...L,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!_&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),ie=B?null:oc(e=>{let t=wo(e.elements.floating).documentElement;return{...L,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:T!==`none`,crossAxis:V,limiter:u||_?void 0:sc(e=>{if(!R.current)return{};let{width:t,height:n}=R.current.getBoundingClientRect(),r=aa(ea(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[L,u,_,P,T]);w===`shift`||T===`shift`||o===`center`?z.push(ie,H):z.push(H,ie),z.push(lc({...L,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}}),Ep(()=>({element:R.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=ea(r),l=aa(c),u=R.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(jp(e,i,j)):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`,V&&l===`y`&&b?S:x),{}}},Dp,y),K(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);let ae=t.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:U,elements:oe,x:se,y:ce,middlewareData:le,update:ue,placement:de,context:fe,isPositioned:pe,floatingStyles:W}=dl({rootContext:m,placement:N,middleware:z,strategy:r,whileElementsMounted:p?void 0:(...e)=>Gs(...e,ae),nodeId:v,externalTree:x}),{sideX:me,sideY:he}=le.adaptiveOrigin||Op,ge=pe?r:`fixed`,_e=t.useMemo(()=>y?{position:ge,[me]:se,[he]:ce}:{position:ge,...W},[y,ge,me,se,he,ce,W]),ve=t.useRef(null);K(()=>{if(!h)return;let e=A.current,t=typeof e==`function`?e():e,n=(Np(t)?t.current:t)||null;n!==ve.current&&(U.setPositionReference(n),ve.current=n)},[h,U,k,A]),t.useEffect(()=>{if(!h)return;let e=A.current;typeof e!=`function`&&Np(e)&&e.current!==ve.current&&(U.setPositionReference(e.current),ve.current=e.current)},[h,U,k,A]),t.useEffect(()=>{if(p&&h&&oe.domReference&&oe.floating)return Gs(oe.domReference,oe.floating,ue,ae)},[p,h,oe,ue,ae]);let ye=ea(de),be=Ap(i,ye,j),xe=ta(de)||`center`,Se=!!le.hide?.referenceHidden;K(()=>{b&&h&&pe&&C(ye)},[b,h,pe,ye]);let Ce=t.useMemo(()=>({position:`absolute`,top:le.arrow?.y,left:le.arrow?.x}),[le.arrow]),we=le.arrow?.centerOffset!==0;return t.useMemo(()=>({positionerStyles:_e,arrowStyles:Ce,arrowRef:R,arrowUncentered:we,side:be,align:xe,physicalSide:ye,anchorHidden:Se,refs:U,context:fe,isPositioned:pe,update:ue}),[_e,Ce,R,we,be,xe,ye,Se,U,fe,pe,ue])}function Np(e){return e!=null&&`current`in e}function Pp(e){return e===`starting`?H:V}let Fp=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=ie,..._}=e,v=up(),y=bp(),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=Mp({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:kp}),O=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]),k=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]),A=t.useMemo(()=>({...k,arrowRef:D.arrowRef,arrowStyles:D.arrowStyles,arrowUncentered:D.arrowUncentered}),[k,D.arrowRef,D.arrowStyles,D.arrowUncentered]),j=U(`div`,e,{state:k,props:[O,Pp(E),_],ref:[n,v.useStateSetter(`positionerElement`)],stateAttributesMapping:ci});return(0,W.jsx)(Cp.Provider,{value:A,children:j})});process.env.NODE_ENV!==`production`&&(Fp.displayName=`TooltipPositioner`);function Ip(e){let t=Wn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=On(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(qi(n)!==a||qi(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Lp=typeof ResizeObserver<`u`,Rp=()=>!0;function zp(e){let{popupElement:n,positionerElement:r,content:i,mounted:a,enabled:o=Rp,onMeasureLayout:s,onMeasureLayoutComplete:c,side:l,direction:u}=e,d=t.useRef(!0),f=Nr(n,!0,!1),p=jr(),m=t.useRef(null),h=G(s),g=G(c),_=t.useMemo(()=>{let e=l===`top`,t=l===`left`;return u===`rtl`?(e||=l===`inline-end`,t||=l===`inline-end`):(e||=l===`inline-start`,t||=l===`inline-start`),e?{position:`absolute`,[l===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:V},[l,u]);K(()=>{if(!a||!o()||!Lp){d.current=!0,m.current=null;return}if(!n||!r)return;Object.entries(_).forEach(([e,t])=>{n.style.setProperty(e,t)});let e=new ResizeObserver(e=>{let t=e[0];t&&(m.current===null?m.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)}:(m.current.width=Math.ceil(t.borderBoxSize[0].inlineSize),m.current.height=Math.ceil(t.borderBoxSize[0].blockSize)))});e.observe(n),n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`);let t=Bp(n,`position`,`static`),i=Bp(n,`transform`,`none`),s=Bp(n,`scale`,`1`),c=Bp(r,`--available-width`,`max-content`),l=Bp(r,`--available-height`,`max-content`);if(h?.(),d.current||m.current===null){r.style.setProperty(`--positioner-width`,`max-content`),r.style.setProperty(`--positioner-height`,`max-content`);let a=Ip(n);return r.style.setProperty(`--positioner-width`,`${a.width}px`),r.style.setProperty(`--positioner-height`,`${a.height}px`),t(),i(),s(),c(),l(),g?.(null,a),d.current=!1,()=>{e.disconnect()}}n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`),r.style.setProperty(`--positioner-width`,`max-content`),r.style.setProperty(`--positioner-height`,`max-content`);let u=Ip(n);n.style.setProperty(`--popup-width`,`${m.current.width}px`),n.style.setProperty(`--popup-height`,`${m.current.height}px`),t(),i(),c(),l(),g?.(m.current,u),r.style.setProperty(`--positioner-width`,`${u.width}px`),r.style.setProperty(`--positioner-height`,`${u.height}px`);let v=new AbortController;return p.request(()=>{n.style.setProperty(`--popup-width`,`${u.width}px`),n.style.setProperty(`--popup-height`,`${u.height}px`),f(()=>{n.style.setProperty(`--popup-width`,`auto`),n.style.setProperty(`--popup-height`,`auto`)},v.signal)}),()=>{e.disconnect(),v.abort(),p.cancel()}},[i,n,r,f,p,o,a,h,g,_])}function Bp(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}var Vp={...ci,...zr};let Hp=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,o=up(),{side:s,align:c}=wp(),l=o.useState(`open`),u=o.useState(`mounted`),d=o.useState(`instantType`),f=o.useState(`transitionStatus`),p=o.useState(`popupProps`),m=o.useState(`payload`),h=o.useState(`popupElement`),g=o.useState(`positionerElement`),_=o.useState(`floatingRootContext`),v=Jf();Pr({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});function y(){_.context.events.emit(`measure-layout`)}function b(e,t){_.context.events.emit(`measure-layout-complete`,{previousDimensions:e,nextDimensions:t})}zp({popupElement:h,positionerElement:g,mounted:u,content:m,enabled:t.useCallback(()=>o.context.triggerElements.size>1,[o]),onMeasureLayout:y,onMeasureLayoutComplete:b,side:s,direction:v});let x=o.useState(`disabled`),S=o.useState(`closeDelay`);return bl(_,{enabled:!x,closeDelay:S}),U(`div`,e,{state:t.useMemo(()=>({open:l,side:s,align:c,instant:d,transitionStatus:f}),[l,s,c,d,f]),ref:[n,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[p,Pp(f),a],stateAttributesMapping:Vp})});process.env.NODE_ENV!==`production`&&(Hp.displayName=`TooltipPopup`);let Up=t.forwardRef(function(e,n){let{className:r,render:i,...a}=e,o=up().useState(`instantType`),{open:s,arrowRef:c,side:l,align:u,arrowUncentered:d,arrowStyles:f}=wp();return U(`div`,e,{state:t.useMemo(()=>({open:s,side:l,align:u,uncentered:d,instant:o}),[s,l,u,d,o]),ref:[n,c],props:[{style:f,"aria-hidden":!0},a],stateAttributesMapping:ci})});process.env.NODE_ENV!==`production`&&(Up.displayName=`TooltipArrow`);let Wp=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,W.jsx)(gp.Provider,{value:a,children:(0,W.jsx)(So,{delay:o,timeoutMs:i,children:e.children})})};process.env.NODE_ENV!==`production`&&(Wp.displayName=`TooltipProvider`);var Gp=m();let Kp=e=>{let t=(0,Gp.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,W.jsx)(Wp,{children:(0,W.jsx)(mp,{...r,children:n})}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};var qp=m();let Jp=e=>{let t=(0,qp.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,W.jsx)(vp,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i};var Yp=m();let Xp=e=>{let t=(0,Yp.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=X(`bg-surface-container-high origin-(--transform-origin) px-xs py-3xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md text-sm text-balance`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(Up,{className:`data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180`,children:(0,W.jsx)(Jr,{weight:`fill`,className:`fill-surface-container-high `})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,W.jsx)(Sp,{children:(0,W.jsx)(Fp,{sideOffset:10,children:(0,W.jsxs)(Hp,{className:a,...i,children:[o,n]})})}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s},Zp=({sliderInstance:e,isActive:n,onKeyDownHandler:r,onMouseDownHandler:i,onTouchStart:a,value:o,className:s,children:c,ref:l,...u})=>{let[d,f]=(0,t.useState)(!1);return(0,W.jsxs)(Kp,{open:n||d,trackCursorAxis:`x`,children:[(0,W.jsx)(Jp,{render:(0,W.jsx)(`button`,{onKeyDown:r,onMouseDown:i,onTouchStart:a,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),role:`slider`,"aria-valuemin":e.options.min,"aria-valuemax":e.options.max,"aria-valuenow":o,style:{left:`${e.getPercentageForValue(o)}%`,zIndex:n?`1`:`0`},className:X(`absolute top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full outline-none border-2 border-primary bg-surface-container hover:cursor-pointer active:border-secondary hover:border-secondary transition-[width,height,border] aspect-square`,n?`size-md shadow-4-shadow`:`size-sm shadow-1-shadow`,s),ref:l,...u,children:c})}),(0,W.jsx)(Xp,{children:(0,W.jsx)(`span`,{children:o})})]})},Qp=({index:e,steps:t,left:n,width:r,className:i,children:a,ref:o,...s})=>(0,W.jsx)(`div`,{className:X(`absolute bg-primary h-full rounded-full inset-shadow-1-shadow`,i),style:{background:`${e===t-1?`transparent`:`var(--color-primary)`}`,left:`${n}%`,width:`${r}%`},ref:o,...s,children:a}),$p=({className:e,children:t,ref:n,...r})=>(0,W.jsx)(`p`,{className:X(`absolute text-[0.6rem] top-full -translate-x-1/2 translate-y-[1.2rem] whitespace-nowrap style-text-default--1 text-on-surface-variant`,e),ref:n,...r,children:t}),em=({percentage:e,className:t,children:n,ref:r,...i})=>(0,W.jsxs)(`div`,{className:X(`absolute top-2xs -translate-x-1/2`,t),ref:r,...i,style:{left:`${e}%`},children:[(0,W.jsx)(`span`,{className:`absolute bg-on-surface-variant rounded-full left-0 h-2xs w-[2px] -translate-x-1/2 translate-y-[0.7rem]`}),n]}),tm=({className:e,children:t,sliderRef:n,...r})=>(0,W.jsx)(`div`,{className:X(`relative h-2xs inset-shadow-1-shadow rounded-full bg-surface-dim grow`,e),ref:n,...r,children:t});var nm=e=>{let t=e.getBoundingClientRect();return{left:Math.ceil(t.left),width:Math.ceil(t.width)}},rm=e=>[...e].map(Number).sort((e,t)=>e-t),im={getPercentageForValue:(e,t,n)=>Math.max(0,Math.min(100,(e-t)/(n-t)*100)),getValueForClientX:(e,t,n,r)=>{let{left:i,width:a}=t,o=(e-i)/a;return(r-n)*o+n}},am=class{constructor(e){this.sortedValues=[],this.rangerElement=null,this._willUpdate=()=>{let e=this.options.getRangerElement();this.rangerElement!==e&&(this.rangerElement=e)},this.getValueForClientX=e=>{let t=nm(this.rangerElement);return this.options.interpolator.getValueForClientX(e,t,this.options.min,this.options.max)},this.getNextStep=(e,t)=>{let{min:n,max:r}=this.options;if(`steps`in this.options){let{steps:n}=this.options,r=n.indexOf(e)+t;return r>=0&&r<n.length?n[r]:e}else{let i=e+this.options.stepSize*t;return i>=n&&i<=r?i:e}},this.roundToStep=e=>{let{min:t,max:n}=this.options,r=t,i=n;if(`steps`in this.options)this.options.steps.forEach(t=>{t<=e&&t>r&&(r=t),t>=e&&t<i&&(i=t)});else{let{stepSize:t}=this.options;for(;r<e&&r+t<e;)r+=t;i=Math.min(r+t,n)}return e-r<i-e?r:i},this.handleDrag=e=>{if(this.activeHandleIndex===void 0)return;let t=e.type===`touchmove`?e.changedTouches[0].clientX:e.clientX,n=this.getValueForClientX(t),r=this.roundToStep(n);this.sortedValues=[...this.options.values.slice(0,this.activeHandleIndex),r,...this.options.values.slice(this.activeHandleIndex+1)],this.options.onDrag?this.options.onDrag(this):(this.tempValues=this.sortedValues,this.options.rerender())},this.handleKeyDown=(e,t)=>{let{values:n}=this.options;if(e.keyCode===37||e.keyCode===39){this.activeHandleIndex=t;let r=e.keyCode===37?-1:1,i=this.getNextStep(n[t],r);this.sortedValues=rm([...n.slice(0,t),i,...n.slice(t+1)]),this.options.onChange&&this.options.onChange(this)}},this.handlePress=(e,t)=>{this.activeHandleIndex=t,this.options.rerender();let n=()=>{let{tempValues:e,handleDrag:t}=this;document.removeEventListener(`mousemove`,t),document.removeEventListener(`touchmove`,t),document.removeEventListener(`mouseup`,n),document.removeEventListener(`touchend`,n),this.sortedValues=rm(e||this.options.values),this.options.onChange&&this.options.onChange(this),this.options.onDrag&&this.options.onDrag(this),this.activeHandleIndex=void 0,this.tempValues=void 0,this.options.rerender()},{handleDrag:r}=this;document.addEventListener(`mousemove`,r),document.addEventListener(`touchmove`,r),document.addEventListener(`mouseup`,n),document.addEventListener(`touchend`,n)},this.getPercentageForValue=e=>this.options.interpolator.getPercentageForValue(e,this.options.min,this.options.max),this.getTicks=()=>{let e=[];if(this.options.ticks)e=[...this.options.ticks];else if(`steps`in this.options)e=[...this.options.steps];else{for(e=[this.options.min];e[e.length-1]<this.options.max-this.options.tickSize;)e.push(e[e.length-1]+this.options.tickSize);e.push(this.options.max)}return e.map((e,t)=>({value:e,key:t,percentage:this.getPercentageForValue(e)}))},this.getSteps=()=>{let e=rm(this.tempValues||this.options.values);return[...e,this.options.max].map((t,n)=>{let r=e[n-1],i=r===void 0?this.options.min:r,a=this.getPercentageForValue(i);return{left:a,width:this.getPercentageForValue(t)-a}})},this.handles=()=>(this.tempValues||this.options.values).map((e,t)=>({value:e,isActive:t===this.activeHandleIndex,onKeyDownHandler:e=>{this.handleKeyDown(e,t)},onMouseDownHandler:e=>{this.handlePress(e,t)},onTouchStart:e=>{this.handlePress(e,t)}})),this.setOptions(e)}setOptions(e){Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,tickSize:10,interpolator:im,onChange:()=>{},...e}}},om=typeof window<`u`?t.useLayoutEffect:t.useEffect;function sm(e){let n=t.useReducer(()=>({}),{})[1],r={...e,rerender:n,onChange:t=>{n(),e.onChange?.(t)}},[i]=t.useState(()=>new am(r));return i.setOptions(r),om(()=>i._willUpdate()),i}let cm=({leadingIcon:e,trailingIcon:n,min:r,max:i,stepSize:a,defaultValues:o,showTickLabels:s,label:c,className:l,ref:u,...d})=>{let f=(0,t.useRef)(null),[p,m]=(0,t.useState)(o||[50]),h=sm({getRangerElement:()=>f.current,values:p,min:r??0,max:i??100,stepSize:a??1,onChange:e=>{m(e.sortedValues)}});return(0,W.jsxs)(`div`,{ref:u,className:X(`space-y-2xs`,l),...d,children:[c&&(0,W.jsx)(`p`,{className:`style-text-default--1 text-on-surface-variant`,children:c}),(0,W.jsxs)(`div`,{className:`flex items-center w-full gap-sm`,children:[e&&(0,W.jsx)(e,{className:`size-sm`,weight:`bold`}),(0,W.jsxs)(tm,{sliderRef:f,children:[s&&h.getTicks().map(({value:e,key:t,percentage:n})=>(0,W.jsx)(em,{percentage:n,children:(0,W.jsx)($p,{children:e})},t)),h.getSteps().map(({left:e,width:t},n)=>(0,W.jsx)(Qp,{index:n,steps:h.getSteps().length,left:e,width:t},n)),h.handles().map(({isActive:e,onKeyDownHandler:t,onMouseDownHandler:n,onTouchStart:r,value:i},a)=>(0,W.jsx)(Zp,{sliderInstance:h,isActive:e,onKeyDownHandler:t,onMouseDownHandler:n,onTouchStart:r,value:i},a))]}),n&&(0,W.jsx)(n,{className:`size-sm`,weight:`bold`})]})]})},lm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(lm.displayName=`SwitchRootContext`);function um(){let e=t.useContext(lm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(63):`Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.`);return e}let dm=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}({}),fm={...hn,checked(e){return e?{[dm.checked]:``}:{[dm.unchecked]:``}}},pm=t.forwardRef(function(e,n){let{checked:r,className:i,defaultChecked:a,id:o,inputRef:s,name:c,nativeButton:l=!1,onCheckedChange:u,readOnly:d=!1,required:f=!1,disabled:p=!1,render:m,uncheckedValue:h,...g}=e,{clearErrors:_}=lr(),{state:y,setTouched:b,setDirty:x,validityData:S,setFilled:C,setFocused:w,shouldValidateOnChange:T,validationMode:E,disabled:D,name:O,validation:k}=ir(),{labelId:A}=fr(),j=D||p,N=O??c,P=G(u),ee=t.useRef(null),F=v(ee,s,k.inputRef),te=t.useRef(null),I=Sn(),L=ff({id:o,implicit:!1,controlRef:te}),[R,ne]=un({controlled:r,default:!!a,name:`Switch`,state:`checked`});ur({id:I,commit:k.commit,value:R,controlRef:te,name:N,getValue:()=>R}),K(()=>{ee.current&&C(ee.current.checked)},[ee,C]),Cr(R,()=>{_(N),x(R!==S.initialValue),C(R),T()?k.commit(R):k.commit(R,!0)});let{getButtonProps:re,buttonRef:z}=tr({disabled:j,native:l}),B={id:I,role:`switch`,"aria-checked":R,"aria-readonly":d||void 0,"aria-labelledby":A,onFocus(){j||w(!0)},onBlur(){let e=ee.current;!e||j||(b(!0),w(!1),E===`onBlur`&&k.commit(e.checked))},onClick(e){d||j||(e.preventDefault(),ee?.current?.click())}},V=t.useMemo(()=>M({checked:R,disabled:j,id:L,name:N,required:f,style:dn,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Sr(_r,e.nativeEvent);P?.(t,n),!n.isCanceled&&ne(t)},onFocus(){te.current?.focus()}},k.getInputValidationProps),[R,j,F,L,N,P,f,ne,k]),H=t.useMemo(()=>({...y,checked:R,disabled:j,readOnly:d,required:f}),[y,R,j,d,f]),ie=U(`span`,e,{state:H,ref:[n,te,z],props:[B,k.getValidationProps,g,re],stateAttributesMapping:fm});return(0,W.jsxs)(lm.Provider,{value:H,children:[ie,!R&&N&&h!==void 0&&(0,W.jsx)(`input`,{type:`hidden`,name:N,value:h}),(0,W.jsx)(`input`,{...V})]})});process.env.NODE_ENV!==`production`&&(pm.displayName=`SwitchRoot`);let mm=t.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=ir(),o=um();return U(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:fm,props:i})});process.env.NODE_ENV!==`production`&&(mm.displayName=`SwitchThumb`);var hm=m();let gm=e=>{let t=(0,hm.c)(18),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({label:r,className:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=X(`relative group transition-colors flex items-center h-[26px] w-[50px] rounded-full bg-surface-dim bg-size-[6.5rem_100%] inset-shadow-1-shadow p-0.5 ease-[cubic-bezier(0.26,0.75,0.38,0.45)] before:absolute before:rounded-full data-checked:bg-accent data-checked:active:bg-gray-500 outline-2 outline-transparent not-disabled:hover:outline-accent hover:cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,n),t[5]=n,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,W.jsx)(mm,{className:`size-[14px] data-checked:size-[18px] rounded-full bg-accent transition-transform duration-500 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)] translate-x-[6px] shadow-xs data-checked:translate-x-[26px] data-checked:scale-[1.1] data-unchecked:bg-accent data-checked:bg-on-accent`}),t[7]=s):s=t[7];let c;t[8]!==i||t[9]!==a||t[10]!==o?(c=(0,W.jsx)(pm,{className:o,ref:a,...i,children:s}),t[8]=i,t[9]=a,t[10]=o,t[11]=c):c=t[11];let l;t[12]!==r||t[13]!==i?(l=r&&(0,W.jsx)(Af,{htmlFor:i.id,children:r}),t[12]=r,t[13]=i,t[14]=l):l=t[14];let u;return t[15]!==c||t[16]!==l?(u=(0,W.jsxs)(`div`,{className:`flex items-center gap-xs`,children:[c,l]}),t[15]=c,t[16]=l,t[17]=u):u=t[17],u},_m=(0,t.createContext)(`vertical`),vm=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!==`production`&&(vm.displayName=`CompositeListContext`);function ym(){return t.useContext(vm)}function bm(e){let{children:n,elementsRef:r,labelsRef:i,onMapChange:a}=e,o=G(a),s=t.useRef(0),c=_(Sm).current,l=_(xm).current,[u,d]=t.useState(0),f=t.useRef(u),p=G((e,t)=>{l.set(e,t??null),f.current+=1,d(f.current)}),m=G(e=>{l.delete(e),f.current+=1,d(f.current)}),h=t.useMemo(()=>{let e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(Cm).forEach((t,n)=>{let r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,u]);K(()=>{if(typeof MutationObserver!=`function`||h.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 h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),K(()=>{f.current===u&&(r.current.length!==h.size&&(r.current.length=h.size),i&&i.current.length!==h.size&&(i.current.length=h.size),s.current=h.size),o(h)},[o,h,r,i,u]),K(()=>()=>{r.current=[]},[r]),K(()=>()=>{i&&(i.current=[])},[i]);let g=G(e=>(c.add(e),()=>{c.delete(e)}));K(()=>{c.forEach(e=>e(h))},[c,h]);let v=t.useMemo(()=>({register:p,unregister:m,subscribeMapChange:g,elementsRef:r,labelsRef:i,nextIndexRef:s}),[p,m,g,r,i,s]);return(0,W.jsx)(vm.Provider,{value:v,children:n})}function xm(){return new Map}function Sm(){return new Set}function Cm(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}let wm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(wm.displayName=`TabsRootContext`);function Tm(){let e=t.useContext(wm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(64):`Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.`);return e}let Em=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({}),Dm={tabActivationDirection:e=>({[Em.activationDirection]:e})},Om=t.forwardRef(function(e,n){let{className:r,defaultValue:i=0,onValueChange:a,orientation:o=`horizontal`,render:s,value:c,...l}=e,u=Jf(),d=Object.hasOwn(e,`defaultValue`),f=t.useRef([]),[p,m]=t.useState(()=>new Map),[h,g]=un({controlled:c,default:i,name:`Tabs`,state:`value`}),_=c!==void 0,[v,y]=t.useState(()=>new Map),[b,x]=t.useState(`none`),S=G((e,t)=>{a?.(e,t),!t.isCanceled&&(g(e),x(t.activationDirection))}),C=G((e,t)=>{m(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})}),w=G((e,t)=>{m(n=>{if(!n.has(e)||n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})}),T=t.useCallback(e=>p.get(e),[p]),E=t.useCallback(e=>{for(let t of v.values())if(e===t?.value)return t?.id},[v]),D=t.useCallback(e=>{if(e===void 0)return null;for(let[t,n]of v.entries())if(n!=null&&e===(n.value??n.index))return t;return null},[v]),O=t.useMemo(()=>({direction:u,getTabElementBySelectedValue:D,getTabIdByPanelValue:E,getTabPanelIdByValue:T,onValueChange:S,orientation:o,registerMountedTabPanel:C,setTabMap:y,unregisterMountedTabPanel:w,tabActivationDirection:b,value:h}),[u,D,E,T,S,o,C,y,w,b,h]),k=t.useMemo(()=>{for(let e of v.values())if(e!=null&&e.value===h)return e},[v,h]),A=t.useMemo(()=>{for(let e of v.values())if(e!=null&&!e.disabled)return e.value},[v]);K(()=>{if(_||v.size===0)return;let e=k?.disabled;if(d&&e&&h===i||!e&&!(k==null&&h!==null))return;let t=A??null;h!==t&&(g(t),x(`none`))},[i,A,d,_,k,x,g,v,h]);let j=U(`div`,e,{state:{orientation:o,tabActivationDirection:b},ref:n,props:l,stateAttributesMapping:Dm});return(0,W.jsx)(wm.Provider,{value:O,children:(0,W.jsx)(bm,{elementsRef:f,children:j})})});process.env.NODE_ENV!==`production`&&(Om.displayName=`TabsRoot`);let km=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Am(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}=ym(),p=t.useRef(-1),[m,h]=t.useState(o??(a===km.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 K(()=>{if(o!=null)return;let e=g.current;if(e)return s(e,r),()=>{c(e)}},[o,s,c,r]),K(()=>{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,_])}function jm(e={}){let{highlightItemOnHover:n,highlightedIndex:r,onHighlightedIndexChange:i}=$n(),{ref:a,index:o}=Am(e),s=r===o,c=t.useRef(null),l=v(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}}let Mm=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(Mm.displayName=`TabsListContext`);function Nm(){let e=t.useContext(Mm);if(e===void 0)throw Error(process.env.NODE_ENV===`production`?h(65):`Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.`);return e}let Pm=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}=Tm(),{activateOnFocus:p,highlightedTabIndex:m,onTabActivation:h,setHighlightedTabIndex:g,tabsListElement:_}=Nm(),v=Sn(s),{compositeProps:y,compositeRef:b,index:x}=jm({metadata:t.useMemo(()=>({disabled:i,id:v,value:o}),[i,v,o])}),S=o===u,C=t.useRef(!1);K(()=>{if(C.current){C.current=!1;return}if(!(S&&x>-1&&m!==x))return;let e=_;if(e!=null){let t=Di(wo(e));if(t&&Q(e,t))return}i||g(x)},[S,x,m,g,i,_]);let{getButtonProps:w,buttonRef:T}=tr({disabled:i,native:c,focusableWhenDisabled:!0}),E=d(o),D=t.useRef(!1),O=t.useRef(!1);function k(e){S||i||h(o,Sr(_r,e.nativeEvent,void 0,{activationDirection:`none`}))}function A(e){S||(x>-1&&!i&&g(x),!i&&p&&(!D.current||D.current&&O.current)&&h(o,Sr(_r,e.nativeEvent,void 0,{activationDirection:`none`})))}function j(e){if(S||i)return;D.current=!0;function t(){D.current=!1,O.current=!1}(!e.button||e.button===0)&&(O.current=!0,wo(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return U(`button`,e,{state:t.useMemo(()=>({disabled:i,active:S,orientation:f}),[i,S,f]),ref:[n,T,b],props:[y,{role:`tab`,"aria-controls":E,"aria-selected":S,id:v,onClick:k,onFocus:A,onPointerDown:j,"data-composite-item-active":S?``:void 0,onKeyDownCapture(){C.current=!0}},l,w]})});process.env.NODE_ENV!==`production`&&(Pm.displayName=`TabsTab`);let Fm=function(e){return e.activeTabLeft=`--active-tab-left`,e.activeTabRight=`--active-tab-right`,e.activeTabTop=`--active-tab-top`,e.activeTabBottom=`--active-tab-bottom`,e.activeTabWidth=`--active-tab-width`,e.activeTabHeight=`--active-tab-height`,e}({});var Im={...Dm,activeTabPosition:()=>null,activeTabSize:()=>null};let Lm=t.forwardRef(function(e,n){let{className:r,render:i,renderBeforeHydration:a=!1,...o}=e,{getTabElementBySelectedValue:s,orientation:c,tabActivationDirection:l,value:u}=Tm(),{tabsListElement:d}=Nm(),[f,p]=t.useState(!1),{value:m}=Tm();Se(()=>p(!0));let h=$c();t.useEffect(()=>{if(u!=null&&d!=null&&typeof ResizeObserver<`u`){let e=new ResizeObserver(h);return e.observe(d),()=>{e.disconnect()}}},[u,d,h]);let g=0,_=0,v=0,y=0,b=0,x=0,S=!1;if(u!=null&&d!=null){let e=s(u);if(S=!0,e!=null){let{width:t,height:n}=Ip(e),{width:r,height:i}=Ip(d),a=e.getBoundingClientRect(),o=d.getBoundingClientRect(),s=r>0?o.width/r:1,c=i>0?o.height/i:1;if(Math.abs(s)>2**-52&&Math.abs(c)>2**-52){let e=a.left-o.left,t=a.top-o.top;g=e/s+d.scrollLeft-d.clientLeft,v=t/c+d.scrollTop-d.clientTop}else g=e.offsetLeft,v=e.offsetTop;b=t,x=n,_=d.scrollWidth-g-b,y=d.scrollHeight-v-x}}let C=t.useMemo(()=>S?{left:g,right:_,top:v,bottom:y}:null,[g,_,v,y,S]),w=t.useMemo(()=>S?{width:b,height:x}:null,[b,x,S]),T=t.useMemo(()=>{if(S)return{[Fm.activeTabLeft]:`${g}px`,[Fm.activeTabRight]:`${_}px`,[Fm.activeTabTop]:`${v}px`,[Fm.activeTabBottom]:`${y}px`,[Fm.activeTabWidth]:`${b}px`,[Fm.activeTabHeight]:`${x}px`}},[g,_,v,y,b,x,S]),E=S&&b>0&&x>0,D=U(`span`,e,{state:t.useMemo(()=>({orientation:c,activeTabPosition:C,activeTabSize:w,tabActivationDirection:l}),[c,C,w,l]),ref:n,props:[{role:`presentation`,style:T,hidden:!E},o,{suppressHydrationWarning:!0}],stateAttributesMapping:Im});return m==null?null:(0,W.jsxs)(t.Fragment,{children:[D,!f&&a&&(0,W.jsx)(`script`,{dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});process.env.NODE_ENV!==`production`&&(Lm.displayName=`TabsIndicator`);let Rm=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e}({}),zm=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}=Tm(),m=Sn(),{ref:h,index:g}=Am({metadata:t.useMemo(()=>({id:m,value:i}),[m,i])}),_=i!==c,v=l(i),y=U(`div`,e,{state:t.useMemo(()=>({hidden:_,orientation:u,tabActivationDirection:d}),[_,u,d]),ref:[n,h],props:[{"aria-labelledby":v,hidden:_,id:m??void 0,role:`tabpanel`,tabIndex:_?-1:0,[Rm.index]:g},s],stateAttributesMapping:Dm});return K(()=>{if(!(_&&!o)&&m!=null)return f(i,m),()=>{p(i,m)}},[_,o,i,m,f,p]),!_||o?y:null});process.env.NODE_ENV!==`production`&&(zm.displayName=`TabsPanel`);function Bm(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Vm=[];function Hm(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=Vm}=e,[h,g]=t.useState(0),_=r>1,y=t.useRef(null),b=v(y,u),x=t.useRef([]),S=t.useRef(!1),C=c??h,w=G((e,t=!1)=>{if((l??g)(e),t){let t=x.current[e];Ql(y.current,t,s,o)}}),T=G(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),Ql(y.current,n,s,o)}),E=t.useMemo(()=>({"aria-orientation":o===`both`?void 0:o,ref:b,onFocus(e){!y.current||!Zl(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let t=d?ql:Kl;if(!t.has(e.key)||Um(e,m)||!y.current)return;let c=s===`rtl`,l=c?zl:Bl,u={horizontal:l,vertical:Rl,both:l}[o],h=c?Bl:zl,g={horizontal:h,vertical:Ll,both:h}[o];if(Zl(e.target)&&!Bm(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=Sa(x,p),S=Ca(x,p);if(_){let t=n||Array.from({length:x.current.length},()=>({width:1,height:1})),s=Ea(t,r,a),l=s.findIndex(e=>e!=null&&!ka(x,e,p)),u=s.reduce((e,t,n)=>t!=null&&!ka(x,t,p)?n:e,-1);v=s[Ta({current:s.map(e=>e?x.current[e]:null)},{event:e,orientation:o,loopFocus:i,cols:r,disabledIndices:Oa([...p||x.current.map((e,t)=>ka(x,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:Da(C>S?b:C,t,s,r,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Rl],both:[l,Rl]}[o],E={horizontal:[h],vertical:[Ll],both:[h,Ll]}[o],D=_?t:{horizontal:d?Ul:Hl,vertical:d?Gl:Wl,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:wa(x,{startingIndex:v,decrement:E.includes(e.key),disabledIndices:p})),v!==C&&!xa(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 Um(e,t){for(let n of Yl.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Wm(e){let{render:n,className:r,refs:i=B,props:a=B,state:o=V,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:O,relayKeyboardEvent:k}=Hm({itemSizes:f,cols:m,loopFocus:p,dense:d,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:Jf(),disabledIndices:y,modifierKeys:b}),A=U(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=t.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,W.jsx)(Qn.Provider,{value:j,children:(0,W.jsx)(bm,{elementsRef:D,onMapChange:e=>{g?.(e),O(e)},children:A})})}let Gm=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}=Tm(),[m,h]=t.useState(0),[g,_]=t.useState(null),v=qm(d,u,g,c),y=G((e,t)=>{e!==d&&(t.activationDirection=v(e),l(e,t))}),b=t.useMemo(()=>({orientation:u,tabActivationDirection:p}),[u,p]),x={"aria-orientation":u===`vertical`?`vertical`:void 0,role:`tablist`},S=t.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:m,onTabActivation:y,setHighlightedTabIndex:h,tabsListElement:g,value:d}),[r,m,y,h,g,d]);return(0,W.jsx)(Mm.Provider,{value:S,children:(0,W.jsx)(Wm,{render:o,className:i,state:b,refs:[n,_],props:[x,s],stateAttributesMapping:Dm,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:a,orientation:u,onHighlightedIndexChange:h,onMapChange:f,disabledIndices:B})})});process.env.NODE_ENV!==`production`&&(Gm.displayName=`TabsList`);function Km(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function qm(e,n,r,i){let[a,o]=t.useState(null);return K(()=>{if(e==null||r==null){o(null);return}let t=i(e);if(t==null){o(null);return}let{left:a,top:s}=Km(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}=Km(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 Jm=m();let Ym=e=>{let n=(0,Jm.c)(13),r,i;if(n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i),(0,t.useContext)(_m)===`horizontal`){let e;n[3]===r?e=n[4]:(e=X(`absolute left-1/2 h-11 md:h-12 top-0 z-[-1] w-(--active-tab-width) translate-y-(--active-tab-top) -translate-x-1/2 rounded-2xl md:rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]`,r),n[3]=r,n[4]=e);let t;return n[5]!==i||n[6]!==e?(t=(0,W.jsx)(Lm,{className:e,...i}),n[5]=i,n[6]=e,n[7]=t):t=n[7],t}let a;n[8]===r?a=n[9]:(a=X(`absolute top-1/2 h-11 md:h-12 left-0 z-[-1] w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-1/2 rounded-full bg-surface-brand-primary-default transition-all duration-300 ease-[cubic-bezier(0.68,-0.55,0.27,1.55)]`,r),n[8]=r,n[9]=a);let o;return n[10]!==i||n[11]!==a?(o=(0,W.jsx)(Lm,{className:a,...i}),n[10]=i,n[11]=a,n[12]=o):o=n[12],o};var Xm=m();let Zm=e=>{let n=(0,Xm.c)(13),r,i;if(n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i),(0,t.useContext)(_m)===`horizontal`){let e;n[3]===r?e=n[4]:(e=X(`relative z-0 flex flex-col h-fit grow gap-2 p-2 bg-surface-neutral-primary-default rounded-3xl`,r),n[3]=r,n[4]=e);let t;return n[5]!==i||n[6]!==e?(t=(0,W.jsx)(Gm,{className:e,...i}),n[5]=i,n[6]=e,n[7]=t):t=n[7],t}let a;n[8]===r?a=n[9]:(a=X(`relative z-0 flex gap-1 p-2 bg-surface-neutral-primary-default rounded-full`,r),n[8]=r,n[9]=a);let o;return n[10]!==i||n[11]!==a?(o=(0,W.jsx)(Gm,{className:a,...i}),n[10]=i,n[11]=a,n[12]=o):o=n[12],o};var Qm=m();let $m=e=>{let n=(0,Qm.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=(0,t.useContext)(_m)===`horizontal`?`flex-1 min-h-0 h-full`:`grow`,o;n[3]!==r||n[4]!==a?(o=X(`relative rounded-xl bg-surface-neutral-primary-default`,a,`flex items-center justify-center p-4 overflow-auto`,r),n[3]=r,n[4]=a,n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==o?(s=(0,W.jsx)(zm,{className:o,...i}),n[6]=i,n[7]=o,n[8]=s):s=n[8],s};var eh=m();let th=e=>{let t=(0,eh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`inline-flex rounded-2xl md:rounded-full h-11 md:h-12 px-6 body-base-semibold w-full text-text-brand-primary-default text-center items-center justify-center border-0 break-keep whitespace-nowrap outline-none select-none focus-visible:relative focus-visible:before:absolute focus-visible:before:outline data-selected:text-text-inverse-primary-default transition-colors duration-300 hover:cursor-pointer aria-[selected=false]:hover:bg-surface-neutral-primary-hover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,W.jsx)(Pm,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};var nh=m();let rh=e=>{let n=(0,nh.c)(15),{className:r,ref:i,...a}=e,[o,s]=(0,t.useState)(a.orientation??`vertical`);if((0,t.useEffect)(()=>{let e=()=>{window.innerWidth<768?s(`horizontal`):s(a.orientation??`vertical`)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[a.orientation]),a.orientation=o,a.orientation===`horizontal`){let e=a.orientation,t;n[0]===r?t=n[1]:(t=X(`flex flex-wrap gap-4 overflow-auto`,r),n[0]=r,n[1]=t);let o;n[2]!==a||n[3]!==i||n[4]!==t?(o=(0,W.jsx)(Om,{className:t,ref:i,...a}),n[2]=a,n[3]=i,n[4]=t,n[5]=o):o=n[5];let s;return n[6]!==a.orientation||n[7]!==o?(s=(0,W.jsx)(_m.Provider,{value:e,children:o}),n[6]=a.orientation,n[7]=o,n[8]=s):s=n[8],s}let c;n[9]===r?c=n[10]:(c=X(`flex flex-col gap-2 overflow-clip`,r),n[9]=r,n[10]=c);let l;return n[11]!==a||n[12]!==i||n[13]!==c?(l=(0,W.jsx)(Om,{className:c,ref:i,...a}),n[11]=a,n[12]=i,n[13]=c,n[14]=l):l=n[14],l};var ih=0;function ah(e){return ih+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ih}`}let oh=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(oh.displayName=`ToastContext`);function sh(){let e=t.useContext(oh);if(!e)throw Error(process.env.NODE_ENV===`production`?h(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);return e}function ch(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}let lh=function(e){let{children:n,timeout:r=5e3,limit:i=3,toastManager:a}=e,[o,s]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[f,p]=t.useState(null);o.length===0&&(c&&l(!1),u&&d(!1));let m=c||u,h=t.useRef(new Map),g=t.useRef(null),_=t.useRef(!0),v=t.useRef(!1);function y(e){let t=Di(wo(g.current));if(!g.current||!Q(g.current,t)||!Pi(t))return;let n=o.findIndex(t=>t.id===e),r=null,i=n+1;for(;i<o.length;){if(o[i].transitionStatus!==`ending`){r=o[i];break}i+=1}if(!r)for(i=n-1;i>=0;){if(o[i].transitionStatus!==`ending`){r=o[i];break}--i}r?r.ref?.current?.focus():f?.focus({preventScroll:!0})}let b=G(()=>{v.current||(v.current=!0,h.current.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}),x=G(()=>{v.current&&(v.current=!1,h.current.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=we.create(),e.timeout.start(e.remaining,()=>{h.current.delete(t),e.callback()}),e.start=Date.now()}))}),S=G(e=>{s(t=>{let n=t.map(t=>t.id===e?{...t,transitionStatus:`ending`,height:0}:t),r=n.filter(e=>e.transitionStatus!==`ending`);return n.map(e=>{if(e.transitionStatus===`ending`)return e;let t=r.indexOf(e)>=i;return{...e,limited:t}})});let t=h.current.get(e);t&&t.timeout&&(t.timeout.clear(),h.current.delete(e)),o.find(t=>t.id===e)?.onClose?.(),y(e),o.length===1&&(l(!1),d(!1))}),C=G(e=>{s(t=>t.filter(t=>t.id!==e)),o.find(t=>t.id===e)?.onRemove?.()}),w=G((e,t,n)=>{let r=Date.now(),i=_.current&&!c&&!u,a=i?we.create():void 0;a?.start(t,()=>{h.current.delete(e),n()}),h.current.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}),T=G(e=>{let t=e.id||ah(`toast`),n={...e,id:t,transitionStatus:`starting`};s(e=>{let t=[n,...e],r=t.filter(e=>e.transitionStatus!==`ending`);if(r.length>i){let e=r.length-i,n=r.slice(-e);return t.map(e=>n.some(t=>t.id===e.id)?{...e,limited:!0}:{...e,limited:!1})}return t.map(e=>({...e,limited:!1}))});let a=n.timeout??r;return n.type!==`loading`&&a>0&&w(t,a,()=>S(t)),(c||u||!_.current)&&b(),t}),E=G((e,t)=>{s(n=>n.map(n=>n.id===e?{...n,...t}:n))}),D=G((e,t)=>{let n=T({...ch(t.loading),type:`loading`}),i=e.then(e=>{let i=ch(t.success,e);E(n,{...i,type:`success`});let a=i.timeout??r;return a>0&&w(n,a,()=>S(n)),(c||u||!_.current)&&b(),e}).catch(e=>{let i=ch(t.error,e);E(n,{...i,type:`error`});let a=i.timeout??r;return a>0&&w(n,a,()=>S(n)),(c||u||!_.current)&&b(),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i});t.useEffect(function(){if(a)return a[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?D(t.promise,t):e===`update`&&n?E(n,t):e===`close`&&n?S(n):T(t)})},[T,E,w,r,a,D,S]);let O=t.useMemo(()=>({toasts:o,setToasts:s,hovering:c,setHovering:l,focused:u,setFocused:d,expanded:m,add:T,close:S,remove:C,update:E,promise:D,pauseTimers:b,resumeTimers:x,prevFocusElement:f,setPrevFocusElement:p,viewportRef:g,scheduleTimer:w,windowFocusedRef:_}),[T,S,u,c,m,b,f,D,C,x,w,o,E]);return(0,W.jsx)(oh.Provider,{value:O,children:n})};process.env.NODE_ENV!==`production`&&(lh.displayName=`ToastProvider`);let uh=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(uh.displayName=`ToastViewportContext`);let dh=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),fh=t.forwardRef(function(e,n){let{render:r,className:i,children:a,...o}=e,{toasts:s,pauseTimers:c,resumeTimers:l,setHovering:u,setFocused:d,viewportRef:f,windowFocusedRef:p,prevFocusElement:m,setPrevFocusElement:h,expanded:g,focused:_}=sh(),v=t.useRef(!1),y=t.useRef(!1),b=s.length,x=s[0]?.height??0,S=t.useMemo(()=>s.some(e=>e.transitionStatus===`ending`),[s]);t.useEffect(()=>{if(!f.current)return;function e(e){b!==0&&e.key===`F6`&&e.target!==f.current&&(e.preventDefault(),h(Di(wo(f.current))),f.current?.focus({preventScroll:!0}),c(),d(!0))}let t=Tn(f.current);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[c,d,h,b,f]),t.useEffect(()=>{if(!f.current||!b)return;let e=Tn(f.current);function t(t){t.target===e&&(p.current=!1,c())}function n(t){if(t.relatedTarget||t.target===e)return;let n=Oi(t),r=Di(wo(f.current));(!Q(f.current,n)||!Pi(r))&&l(),setTimeout(()=>{p.current=!0})}return e.addEventListener(`blur`,t,!0),e.addEventListener(`focus`,n,!0),()=>{e.removeEventListener(`blur`,t,!0),e.removeEventListener(`focus`,n,!0)}},[c,l,f,p,d,b]),t.useEffect(()=>{let e=f.current;if(!e||b===0)return;let t=wo(e);function n(t){t.pointerType===`touch`&&(Q(e,Oi(t))||(l(),u(!1),d(!1)))}return t.addEventListener(`pointerdown`,n,!0),()=>{t.removeEventListener(`pointerdown`,n,!0)}},[b,l,d,u,f]);function C(e){f.current&&(v.current=!0,e.relatedTarget===f.current?s[0]?.ref?.current?.focus():m?.focus({preventScroll:!0}))}function w(e){e.key===`Tab`&&e.shiftKey&&e.target===f.current&&(e.preventDefault(),m?.focus({preventScroll:!0}),l())}t.useEffect(()=>{!p.current||S||!y.current||(l(),u(!1),y.current=!1)},[S,l,u,p]);function T(){c(),u(!0),y.current=!1}function E(){s.some(e=>e.transitionStatus===`ending`)?y.current=!0:(l(),u(!1))}function D(){if(v.current){v.current=!1;return}_||Pi(wo(f.current).activeElement)&&(d(!0),c())}function O(e){!_||Q(f.current,e.relatedTarget)||(d(!1),l())}let k={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:T,onMouseMove:T,onMouseLeave:E,onFocus:D,onBlur:O,onKeyDown:w,onClick:D},A=t.useMemo(()=>({expanded:g}),[g]),j=U(`div`,e,{ref:[n,f],state:A,props:[k,{style:{[dh.frontmostHeight]:x?`${x}px`:void 0}},o,{children:(0,W.jsxs)(t.Fragment,{children:[b>0&&m&&(0,W.jsx)(To,{onFocus:C}),a,b>0&&m&&(0,W.jsx)(To,{onFocus:C})]})}]}),M=t.useMemo(()=>({viewportRef:f}),[f]),N=t.useMemo(()=>s.filter(e=>e.priority===`high`),[s]);return(0,W.jsxs)(uh.Provider,{value:M,children:[b>0&&m&&(0,W.jsx)(To,{onFocus:C}),j,!_&&N.length>0&&(0,W.jsx)(`div`,{style:dn,children:N.map(e=>(0,W.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,W.jsx)(`div`,{children:e.title}),(0,W.jsx)(`div`,{children:e.description})]},e.id))})]})});process.env.NODE_ENV!==`production`&&(fh.displayName=`ToastViewport`);let ph=t.createContext(void 0);process.env.NODE_ENV!==`production`&&(ph.displayName=`ToastRootContext`);function mh(){let e=t.useContext(ph);if(!e)throw Error(process.env.NODE_ENV===`production`?h(66):`Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.`);return e}let hh=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}({});var gh={...zr,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},_h=40,vh=10,yh=.5,bh=1;function xh(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 Sh(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}}let Ch=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,{toasts:f,focused:p,close:m,remove:h,setToasts:g,pauseTimers:_,expanded:v,setHovering:y}=sh(),[b,x]=t.useState(void 0),[S,C]=t.useState(!1),[w,T]=t.useState(!1),[E,D]=t.useState(!1),[O,k]=t.useState({x:0,y:0}),[A,j]=t.useState({x:0,y:0,scale:1}),[M,N]=t.useState(),[P,ee]=t.useState(),[F,te]=t.useState(null),I=t.useRef(null),L=t.useRef({x:0,y:0}),R=t.useRef({x:0,y:0,scale:1}),ne=t.useRef(void 0),re=t.useRef(0),z=t.useRef(!1),B=t.useRef({x:0,y:0}),V=t.useRef(!1),H=t.useMemo(()=>f.indexOf(i),[i,f]),ie=t.useMemo(()=>f.filter(e=>e.transitionStatus!==`ending`).indexOf(i),[i,f]),ae=t.useMemo(()=>f.slice(0,f.indexOf(i)).reduce((e,t)=>e+(t.height||0),0),[f,i]);Pr({open:i.transitionStatus!==`ending`,ref:I,onComplete(){i.transitionStatus===`ending`&&h(i.id)}});let oe=G((e=!1)=>{let t=I.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let a=t.offsetHeight;t.style.height=r;function o(){g(e=>e.map(e=>e.id===i.id?{...e,ref:I,height:a,transitionStatus:void 0}:e))}e?n.flushSync(o):o()});K(oe,[oe]);function se(e,t){let n=e,r=t;return!u.includes(`left`)&&!u.includes(`right`)?n=e>0?e**yh:-(Math.abs(e)**yh):(!u.includes(`right`)&&e>0&&(n=e**yh),!u.includes(`left`)&&e<0&&(n=-(Math.abs(e)**yh))),!u.includes(`up`)&&!u.includes(`down`)?r=t>0?t**yh:-(Math.abs(t)**yh):(!u.includes(`down`)&&t>0&&(r=t**yh),!u.includes(`up`)&&t<0&&(r=-(Math.abs(t)**yh))),{x:n,y:r}}function ce(e){if(e.button!==0)return;e.pointerType===`touch`&&_();let t=Oi(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(z.current=!1,ne.current=void 0,re.current=0,L.current={x:e.clientX,y:e.clientY},B.current=L.current,I.current){let e=Sh(I.current);R.current=e,j(e),k({x:e.x,y:e.y})}y(!0),C(!0),T(!1),te(null),V.current=!0,I.current?.setPointerCapture(e.pointerId)}}function le(e){if(!S)return;e.preventDefault(),V.current&&=(L.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-L.current.x,o=t-L.current.y,s=t-B.current.y,c=n-B.current.x;if(!w&&Math.sqrt(a*a+o*o)>=bh&&(T(!0),F===null)){let e=u.includes(`left`)||u.includes(`right`),t=u.includes(`up`)||u.includes(`down`);e&&t&&te(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let l;if(!ne.current)F===`vertical`?o>0?l=`down`:o<0&&(l=`up`):F===`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)&&(ne.current=l,re.current=xh(l,a,o),x(l));else{let e=ne.current,t=xh(e,c,s);t>_h?(z.current=!1,x(e)):!(u.includes(`left`)&&u.includes(`right`))&&!(u.includes(`up`)&&u.includes(`down`))&&re.current-t>=vh&&(z.current=!0)}let d=se(a,o),f=R.current.x,p=R.current.y;F===`horizontal`?(u.includes(`left`)||u.includes(`right`))&&(f+=d.x):(F===`vertical`||(u.includes(`left`)||u.includes(`right`))&&(f+=d.x),(u.includes(`up`)||u.includes(`down`))&&(p+=d.y)),k({x:f,y:p})}function ue(e){if(!S)return;if(C(!1),T(!1),te(null),I.current?.releasePointerCapture(e.pointerId),z.current){k({x:A.x,y:A.y}),x(void 0);return}let t=!1,n=O.x-A.x,r=O.y-A.y,a;for(let e of u){switch(e){case`right`:n>_h&&(t=!0,a=`right`);break;case`left`:n<-_h&&(t=!0,a=`left`);break;case`down`:r>_h&&(t=!0,a=`down`);break;case`up`:r<-_h&&(t=!0,a=`up`);break;default:break}if(t)break}t?(x(a),D(!0),m(i.id)):(k({x:A.x,y:A.y}),x(void 0))}function de(e){if(e.key===`Escape`){if(!I.current||!Q(I.current,Di(wo(I.current))))return;m(i.id)}}t.useEffect(()=>{if(!d)return;let e=I.current;if(!e)return;function t(t){Q(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[d]);function fe(){if(!S&&O.x===A.x&&O.y===A.y&&!E)return{[hh.swipeMovementX]:`0px`,[hh.swipeMovementY]:`0px`};let e=O.x-A.x,t=O.y-A.y;return{transition:S?`none`:void 0,transform:S?`translateX(${O.x}px) translateY(${O.y}px) scale(${A.scale})`:void 0,[hh.swipeMovementX]:`${e}px`,[hh.swipeMovementY]:`${t}px`}}let pe=i.priority===`high`,me={role:pe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":M,"aria-describedby":P,"aria-hidden":pe&&!p?!0:void 0,onPointerDown:d?ce:void 0,onPointerMove:d?le:void 0,onPointerUp:d?ue:void 0,onKeyDown:de,inert:ru(i.limited),style:{...fe(),[hh.index]:i.transitionStatus===`ending`?H:ie,[hh.offsetY]:`${ae}px`,[hh.height]:i.height?`${i.height}px`:void 0}},he=t.useMemo(()=>({rootRef:I,toast:i,titleId:M,setTitleId:N,descriptionId:P,setDescriptionId:ee,swiping:S,swipeDirection:b,recalculateHeight:oe,index:H,visibleIndex:ie,expanded:v}),[i,M,P,S,b,oe,H,ie,v]),ge=t.useMemo(()=>({transitionStatus:i.transitionStatus,expanded:v,limited:i.limited||!1,type:i.type,swiping:he.swiping,swipeDirection:he.swipeDirection}),[v,i.transitionStatus,i.limited,i.type,he.swiping,he.swipeDirection]),_e=U(`div`,e,{ref:[r,he.rootRef],state:ge,stateAttributesMapping:gh,props:[me,c]});return(0,W.jsx)(ph.Provider,{value:he,children:_e})});process.env.NODE_ENV!==`production`&&(Ch.displayName=`ToastRoot`);let wh=t.forwardRef(function(e,n){let{render:r,className:i,id:a,children:o,...s}=e,{toast:c}=mh(),l=o??c.description,u=!!l,d=xn(a),{setDescriptionId:f}=mh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=U(`p`,e,{ref:n,state:t.useMemo(()=>({type:c.type}),[c.type]),props:{...s,id:d,children:l}});return u?p:null});process.env.NODE_ENV!==`production`&&(wh.displayName=`ToastDescription`);let Th=t.forwardRef(function(e,n){let{render:r,className:i,id:a,children:o,...s}=e,{toast:c}=mh(),l=o??c.title,u=!!l,d=xn(a),{setTitleId:f}=mh();K(()=>{if(u)return f(d),()=>{f(void 0)}},[u,d,f]);let p=U(`h2`,e,{ref:n,state:t.useMemo(()=>({type:c.type}),[c.type]),props:{...s,id:d,children:l}});return u?p:null});process.env.NODE_ENV!==`production`&&(Th.displayName=`ToastTitle`);let Eh=t.forwardRef(function(e,n){let{render:r,className:i,disabled:a,nativeButton:o=!0,...s}=e,{close:c,expanded:l}=sh(),{toast:u}=mh(),[d,f]=t.useState(!1),{getButtonProps:p,buttonRef:m}=tr({disabled:a,native:o}),h=t.useMemo(()=>({type:u.type}),[u.type]);return U(`button`,e,{ref:[n,m],state:h,props:[{"aria-hidden":!l&&!d,onClick(){c(u.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})});process.env.NODE_ENV!==`production`&&(Eh.displayName=`ToastClose`);let Dh=xp;function Oh(){let e=t.useContext(oh);if(!e)throw Error(process.env.NODE_ENV===`production`?h(73):`Base UI: useToastManager must be used within <Toast.Provider>.`);let{toasts:n,add:r,close:i,update:a,promise:o}=e;return t.useMemo(()=>({toasts:n,add:r,close:i,update:a,promise:o}),[n,r,i,a,o])}let kh=({className:e,children:t,position:n=`top-right`,ref:r,...i})=>{let{toasts:a}=Oh(),o=e=>{switch(e){case`top-left`:return`left`;case`bottom-left`:return`left`;case`top-right`:return`right`;case`bottom-right`:return`right`;case`top-center`:return`up`;case`bottom-center`:return`down`;default:return`right`}};return a.map(a=>(0,W.jsxs)(Ch,{toast:a,swipeDirection:o(n),className:X(n===`bottom-right`||n===`bottom-center`||n===`bottom-left`?`absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*-15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-outline bg-surface-container bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:bottom-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[""] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] flex flex-col gap-3xs`:`absolute top-0 right-0 left-0 z-[calc(1000-var(--toast-index))] mx-auto w-full transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+calc(min(var(--toast-index),10)*15px)))_scale(calc(max(0,1-(var(--toast-index)*0.1))))] rounded-lg border border-gray-200 bg-gray-50 bg-clip-padding p-sm shadow-lg transition-all [transition-property:opacity,transform] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] select-none after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-[''] data-ending-style:opacity-0 data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-offset-y)+calc(var(--toast-index)*var(--gap))+var(--toast-swipe-movement-y)))] data-limited:opacity-0 data-starting-style:transform-[translateY(-150%)] [&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:transform-[translateY(-150%)] data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+150%))] data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))] data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e,a.data.variant===`success`&&`border-success bg-success-container`,a.data.variant===`error`&&`border-error bg-error-container`,a.data.variant===`warning`&&`border-warning bg-warning-container`),style:{"--gap":`1rem`,"--offset-y":`calc(var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y))`},ref:r,...i,children:[t,(0,W.jsx)(Th,{className:X(`text-sm font-semibold text-on-surface`,a.data.variant===`success`&&`text-on-success-container`,a.data.variant===`error`&&`text-on-error-container`,a.data.variant===`warning`&&`text-on-warning-container`)}),(0,W.jsx)(wh,{className:X(`text-sm text-on-surface`,a.data.variant===`success`&&`text-on-success-container`,a.data.variant===`error`&&`text-on-error-container`,a.data.variant===`warning`&&`text-on-warning-container`)}),(0,W.jsx)(Eh,{className:`absolute top-xs right-2xs flex size-xs items-center justify-center rounded border-none bg-transparent text-on-surface hover:cursor-pointer`,"aria-label":`Close`,children:(0,W.jsx)(Xr,{weight:`bold`})})]},a.id))};var Ah=m();e.Avatar=Yt,e.AvatarFallback=$t,e.AvatarImage=Zt,e.Badge=on,e.Button=ln,e.Checkbox=Qr,e.CheckboxIndicator=Hr,e.Dialog=Pu,e.DialogClose=wu,e.DialogDescription=Eu,e.DialogPopup=Ou,e.DialogTitle=Au,e.DialogTrigger=Mu,e.FieldErrors=uf,e.FieldInput=bf,e.Form=Of,e.FormErrors=Tf,e.FormSubmit=Sf,e.Input=vf,e.Label=Af,e.Profile=Mf,e.ScrollArea=cp,e.Separator=gf,e.Slider=cm,e.SliderHandle=Zp,e.SliderSegment=Qp,e.SliderTick=em,e.SliderTickLabel=$p,e.SliderTrack=tm,e.Switch=gm,e.Tabs=rh,e.TabsIndicator=Ym,e.TabsList=Zm,e.TabsPanel=$m,e.TabsTab=th,e.Toast=kh,e.ToastProvider=e=>{let t=(0,Ah.c)(24),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({position:o,className:r,children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=o===void 0?`bottom-center`:o,c=s===`top-left`,l=s===`top-center`,u=s===`top-right`,d=s===`bottom-left`,f=s===`bottom-center`,p=s===`bottom-right`,m;t[6]!==r||t[7]!==c||t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==f||t[12]!==p?(m=X({"fixed z-10 top-[1rem] left-[1rem] right-auto bottom-auto mx-0 flex w-1/4":c,"fixed z-10 top-[1rem] left-1/2 right-auto bottom-auto mx-auto flex w-1/4 -translate-x-1/2":l,"fixed z-10 top-[1rem] right-[1rem] left-auto bottom-auto mx-0 flex w-1/4":u,"fixed z-10 bottom-[6rem] left-[1rem] right-auto top-auto mx-0 flex w-1/4":d,"fixed z-10 bottom-[6rem] left-1/2 right-auto top-auto mx-auto flex w-1/4 -translate-x-1/2":f,"fixed z-10 bottom-[6rem] right-[1rem] left-auto top-auto mx-0 flex w-1/4":p},r),t[6]=r,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]===s?h=t[15]:(h=(0,W.jsx)(kh,{position:s}),t[14]=s,t[15]=h);let g;t[16]!==i||t[17]!==a||t[18]!==m||t[19]!==h?(g=(0,W.jsx)(Dh,{children:(0,W.jsx)(fh,{className:m,ref:a,...i,children:h})}),t[16]=i,t[17]=a,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==n||t[22]!==g?(_=(0,W.jsxs)(lh,{timeout:5e3,children:[n,g]}),t[21]=n,t[22]=g,t[23]=_):_=t[23],_},e.Tooltip=Kp,e.TooltipContent=Xp,e.TooltipTrigger=Jp,e.cn=X});
|