@auersperg/flare 0.3.6 → 0.3.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/cli/{chunk-r3ceakrn.js → chunk-y6e2h40n.js} +187 -20
- package/dist/cli/flare.js +15 -4
- package/dist/platform/admin.js +91 -50
- package/dist/platform/dashboard/_astro/auth-view.EASEF9BN.js +1 -0
- package/dist/platform/dashboard/_astro/cli-approval.DwZVHdyo.js +1 -0
- package/dist/platform/dashboard/_astro/common.TAClb6G9.js +1 -0
- package/dist/platform/dashboard/_astro/data-view.BaHEU4Xa.js +1 -0
- package/dist/platform/dashboard/_astro/functions-view.BGOYuDwu.js +1 -0
- package/dist/platform/dashboard/_astro/index.BPQdjJ4j.css +2 -0
- package/dist/platform/dashboard/_astro/index.astro_astro_type_script_index_0_lang.Blg5hU9g.js +3 -0
- package/dist/platform/dashboard/_astro/{input-group.CJxPRHej.js → input-group.DUp-h0xx.js} +1 -1
- package/dist/platform/dashboard/_astro/{sdk-view.COmbEZrF.js → sdk-view.2ErPn4cO.js} +1 -1
- package/dist/platform/dashboard/_astro/services-view.iZujitxl.js +1 -0
- package/dist/platform/dashboard/_astro/settings-view.CqK-mrlB.js +3 -0
- package/dist/platform/dashboard/index.html +1 -1
- package/dist/platform/manifest.json +39 -39
- package/dist/platform/runtime.js +214 -35
- package/package.json +1 -1
- package/dist/platform/dashboard/_astro/auth-view.UTGGCEHc.js +0 -1
- package/dist/platform/dashboard/_astro/cli-approval.BZAWmpiR.js +0 -1
- package/dist/platform/dashboard/_astro/common.DPoFQu44.js +0 -1
- package/dist/platform/dashboard/_astro/data-view.BgYyTCMN.js +0 -1
- package/dist/platform/dashboard/_astro/functions-view.PUkng3T1.js +0 -1
- package/dist/platform/dashboard/_astro/index.astro_astro_type_script_index_0_lang.BEuO3H0E.js +0 -4
- package/dist/platform/dashboard/_astro/index.lobU7uK5.css +0 -2
- package/dist/platform/dashboard/_astro/services-view.C34dy0dk.js +0 -1
- package/dist/platform/dashboard/_astro/settings-view.IuD2r5JW.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,r}from"./client.BeKNsjPN.js";var i=e(r(),1),a=e(n(),1);function o(e,t,n,r=e=>new WebSocket(e)){let i=!1,a,o,s,c,l=1e3,u=()=>{s||=setTimeout(()=>{s=void 0,i||t()},200)},d=()=>{if(i)return;n(`connecting`);let t=new URL(`/api/${e}/live`,location.origin);t.protocol=`wss:`,a=r(t.href),a.onmessage=e=>{if(!i)try{let t=JSON.parse(e.data);t.type===`ready`&&(l=1e3,n(`connected`),u()),t.type===`invalidate`&&u()}catch{a?.close(1002,`Invalid frame`)}},a.onclose=async t=>{if(!i){if(t.code===1008&&t.reason!==`Expired`)i=!0,clearTimeout(s),s=void 0,n(`revoked`);else{if(n(`disconnected`),t.code===1006){c=new AbortController;try{let t=await fetch(new URL(`/api/${e}/health`,location.origin),{redirect:`manual`,signal:AbortSignal.any([c.signal,AbortSignal.timeout(5e3)])});if(await t.body?.cancel(),[401,403,404].includes(t.status)||t.type===`opaqueredirect`){i||(i=!0,clearTimeout(s),n(`revoked`));return}}catch{}if(i)return}o=setTimeout(d,l+Math.floor(Math.random()*250)),l=Math.min(3e4,l*2)}}}};return d(),()=>{i=!0,clearTimeout(o),clearTimeout(s),c?.abort(),a?.close()}}var s=t((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})),c=t(((e,t)=>{t.exports=s()})),l=c(),u=(0,i.createContext)({scope:``,epoch:0});function d({scope:e,children:t}){let[n,r]=(0,i.useState)(0),[a,s]=(0,i.useState)(`connecting`);return(0,i.useEffect)(()=>o(e,()=>r(e=>e+1),s),[e]),a===`revoked`?(0,l.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Live access was revoked or could not be verified. Reload and sign in again.`}):(0,l.jsxs)(u.Provider,{value:{scope:e,epoch:n},children:[(0,l.jsxs)(`span`,{className:`sr-only`,role:`status`,children:[`Live updates: `,a]}),a===`disconnected`&&(0,l.jsx)(`p`,{role:`status`,className:`px-4 text-xs text-muted-foreground`,children:`Live updates disconnected. Showing the last snapshot; reconnecting.`}),t]})}var f=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function p(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:f(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var m=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},h=e=>{let t=m(e);return t.charAt(0).toUpperCase()+t.slice(1)},g=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function v(e){return e!=null}function y(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??_.width,a=e.size??e.height??_.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?g(...c):g(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??_[`stroke-width`])*Number(e.size??e.width??_.width)/Number(t.size??t.width??_.width):t.strokeWidth??_[`stroke-width`];return[`svg`,{...Object.entries(_).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&v(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&v(t.width)&&{[r(`width`)]:t.width},...`height`in t&&v(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function b(e,t={}){return y(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var x=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},S=(0,i.createContext)({}),C=()=>(0,i.useContext)(S),w=(0,i.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:s,className:c=``,children:l,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:_=!1,nonScalingStroke:v=!1,color:y=`currentColor`,className:S=``}=C()??{},w=!!l||x(f),[T,E,D=[]]=b(d,{color:e??y,width:n??t??m,height:r??t??m,strokeWidth:a??h,absoluteStrokeWidth:o??_,nonScalingStroke:s??v,className:g(S,c),hasA11yProp:w,attributes:f});return(0,i.createElement)(T,{ref:p,...E},[...D.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(l)?l:[l]])});function T(e,t=[],n=[]){let r=typeof e==`string`?p(e,t,n):e,a=(0,i.forwardRef)(({className:e,...t},n)=>(0,i.createElement)(w,{ref:n,icon:r,className:e,...t}));return r.name&&(a.displayName=h(r.name)),a}var E={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};E.node;var D=T(E),O={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};O.node;var k=T(O),A={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};A.node;var j=T(A),M={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};M.node;var N=T(M);function P(){return typeof window<`u`}function F(e){return R(e)?(e.nodeName||``).toLowerCase():`#document`}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function L(e){return((R(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function R(e){return P()?e instanceof Node||e instanceof I(e).Node:!1}function z(e){return P()?e instanceof Element||e instanceof I(e).Element:!1}function B(e){return P()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function V(e){return!P()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function H(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ee(e){return/^(table|td|th)$/.test(F(e))}function U(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var te=/transform|translate|scale|rotate|perspective|filter/,ne=/paint|layout|strict|content/,re=e=>!!e&&e!==`none`,ie;function W(e){let t=z(e)?se(e):e;return re(t.transform)||re(t.translate)||re(t.scale)||re(t.rotate)||re(t.perspective)||!oe()&&(re(t.backdropFilter)||re(t.filter))||te.test(t.willChange||``)||ne.test(t.contain||``)}function ae(e){let t=le(e);for(;B(t)&&!G(t);){if(W(t))return t;if(U(t))return null;t=le(t)}return null}function oe(){return ie??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ie}function G(e){return/^(html|body|#document)$/.test(F(e))}function se(e){return I(e).getComputedStyle(e)}function ce(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function le(e){if(F(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||V(e)&&e.host||L(e);return V(t)?t.host:t}function ue(e){let t=le(e);return G(t)?(e.ownerDocument||e).body:B(t)&&H(t)?t:ue(t)}function de(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ue(e),i=r===e.ownerDocument?.body,a=I(r);if(i){let e=fe(a);return t.concat(a,a.visualViewport||[],H(r)?r:[],e&&n?de(e):[])}return t.concat(r,de(r,[],n))}function fe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var K={...i},pe={};function me(e,t){let n=i.useRef(pe);return n.current===pe&&(n.current=e(t)),n}var he=K.useInsertionEffect,ge=he&&he!==K.useLayoutEffect?he:e=>e();function q(e){let t=me(_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(){}var J=typeof document<`u`?i.useLayoutEffect:()=>{};function ye(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var be={};function xe(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ce(t);let a=Ce(e);return t&&(a=we(a,t)),n&&(a=we(a,n)),r&&(a=we(a,r)),i&&(a=we(a,i)),a}function Se(e){if(e.length===0)return be;if(e.length===1)return Ce(e[0]);let t=Ce(e[0]);for(let n=1;n<e.length;n+=1)t=we(t,e[n]);return t}function Ce(e){return Oe(e)?{...e(be)}:Te(e)}function we(e,t){return Oe(t)?t(e):Ee(e,t)}function Te(e){let t={...e};for(let e in t){let n=t[e];De(e,n)&&(t[e]=Ae(n))}return t}function Ee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ye(e.style,r);break;case`className`:e[n]=Me(e.className,r);break;default:e[n]=De(n,r)?ke(e[n],r):r}}return e}function De(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 Oe(e){return typeof e==`function`}function ke(e,t){return t?e?(...n)=>{let r=n[0];if(Ne(r)){let i=r;je(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ae(t):e}function Ae(e){return e&&((...t)=>{let n=t[0];return Ne(n)&&je(n),e(...t)})}function je(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Me(e,t){return t?e?t+` `+e:t:e}function Ne(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Pe(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Fe=Pe(`https://base-ui.com/production-error`,`Base UI`),Ie=i.createContext(void 0);function Le(e=!1){let t=i.useContext(Ie);if(t===void 0&&!e)throw Error(Fe(16));return t}function Re(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,s=r&&t!==!1,c=r&&t===!1;return{props:i.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,o,a])}}function Y(e){return e?.ownerDocument||document}function ze(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(I(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Be(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=i.useRef(null),c=Le(!0),l=o??c!==void 0,{props:u}=Re({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=i.useCallback(()=>{let e=s.current;Ve(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return J(d,[d]),{getButtonProps:i.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return xe({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(je(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=Ve(r),s=!a&&He(r),c=n&&(a?i:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),ze(r,e))}else!c||a||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ze(r,e)))},onKeyUp(e){t||(je(e),i?.(e),e.target===e.currentTarget&&a&&l&&Ve(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),ze(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},u,c)},[t,u,l,a]),buttonRef:q(e=>{s.current=e,d()})}}function Ve(e){return B(e)&&e.tagName===`BUTTON`}function He(e){return B(e)&&e.tagName===`A`&&!!e.href}function Ue(e,t,n,r){let i=me(Ge).current;return Ke(i,e,t,n,r)&&Je(i,[e,t,n,r]),i.callback}function We(e){let t=me(Ge).current;return qe(t,e)&&Je(t,e),t.callback}function Ge(){return{callback:null,cleanup:null,refs:[]}}function Ke(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function qe(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Je(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null: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}}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}}}}}}var Ye=19;function Xe(e){return Ye>=e}function Ze(e){if(!i.isValidElement(e))return null;let t=e,n=t.props;return(Xe(19)?n?.ref:t.ref)??null}function X(){}var Qe=Object.freeze([]),$e=Object.freeze({});function et(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)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function tt(e,t){return typeof e==`function`?e(t):e}function nt(e,t){return typeof e==`function`?e(t):e}function Z(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=ot(r));let i=rt(t,n,r);if(n.enabled===!1)return null;let a=n.state??$e;return st(e,r,i,a)}function rt(e,t,n){let{className:r,style:i}=e,{state:a=$e,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?tt(r,a):void 0,d=l?nt(i,a):void 0,f=l?et(a,c):$e,p=l&&s?it(s):void 0,m=l?ye(f,p)??{}:$e;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?We([m.ref,Ze(n),...o]):Ue(m.ref,Ze(n),o):Ue(null,null)),l?(u!==void 0&&(m.className=Me(m.className,u)),d!==void 0&&(m.style=ye(m.style,d)),m):$e}function it(e){return Array.isArray(e)?Se(e):xe(void 0,e)}var at=Symbol.for(`react.lazy`);function ot(e){if(e?.$$typeof!==at)return e;let t=i.Children.toArray(e)[0];return i.isValidElement(t)?t:e}function st(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=xe(n,t.props);return e.ref=n.ref,i.cloneElement(t,e)}return ct(e,n)}function ct(e,t){return e===`button`?(0,i.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,i.createElement)(`img`,{alt:``,...t,key:t.key}):i.createElement(e,t)}var lt=i.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Be({disabled:i,focusableWhenDisabled:a,native:o});return Z(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function ut(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=ut(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function dt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ut(e))&&(r&&(r+=` `),r+=t);return r}var ft=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,pt=dt,mt=(e,t)=>n=>{if(t?.variants==null)return pt(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=ft(t)||ft(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 pt(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)},ht=48,gt=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-ht-t;return n},_t=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},vt=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-ht;n+=i>>>1^-(i&1),t[r]=n}return t},yt=384,bt=[],xt=_t(gt(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),St=_t(gt(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Ct=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,wt=(()=>{let e=xt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=xt[n];i<xt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(xt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=xt[i];a<xt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Tt=gt(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Et=_t(gt(`123333359346463635126536711576`)),Dt=gt(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Ot=gt(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),kt=vt(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),At=(()=>{let e=new Int32Array(319).fill(-1),t=vt(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=vt(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),jt=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Mt=vt(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Nt=vt(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Pt=vt(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),Ft=new Int32Array(995),It=new Int32Array(995),Lt=new Int32Array(995),Rt=``,zt=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Mt.length;r++)for(let i of jt[Pt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),zt[a*2]=Rt.length,zt[a*2+1]=i.length,Rt+=i),Ft[n]=Mt[r],It[n]=Nt[r],Lt[n]=a,n++}}var Bt=vt(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Vt=_t(gt(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Ht=vt(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Ut=gt(`ij`),Wt=gt(``),Gt=gt(`1`),Kt={GROUP_COUNT:yt,customValidatorNames:bt,edgeStart:xt,labelStart:St,labelText:Ct,edgeTarget:wt,nodeGroup:Tt,nodeVlist:At,vlistPat:Et,vlistOps:Dt,vlistRef:Ot,vlistGroup:kt,litAnchor:Ft,litGroup:It,litPool:Lt,poolOffsets:zt,poolText:Rt,adjGid:Bt,adjStart:Vt,adjTgt:Ht,patGid:Ut,patTgt:Wt,postfixLookupGroups:Gt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},qt=`line`in Error(),Jt=-1,Yt=-1,Xt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Zt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Qt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Xt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Xt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,H=V.length,ee=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),U=/\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$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,W=-1,ae=-1,oe=-1,G=-1,se=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ce=e=>/\s/.test(String.fromCharCode(e)),le=(e,t,n)=>{if(ie=0,W=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;oe=t+1,G=n-1;let a=t+1;if(se(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!se(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(W=t+1,ae=a,oe=a+1)}},ue=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},de=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K=e=>!!e&&!Number.isNaN(Number(e)),pe=(e,t,n)=>{if(n-t<11||!ue(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ue(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ue(e,t+10,t+18,`-normal/`)},me=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],he=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ge=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],q=(e,t,n,r)=>{if(e>=10){if(e>=25)return ee[e-25](t.slice(n,r));let i=e-10;if(ie!==me[i])return!1;if(W>=0){for(let e of he[i])if(ue(t,W,ae,e))return!0;return!1}switch(ge[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(oe,G);return U.test(e)&&!te.test(e)}case 3:return K(t.slice(oe,G));case 4:return re.test(t.slice(oe,G));default:return ne.test(t.slice(oe,G))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return de.test(t.slice(n,r));case 5:return K(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&K(t.slice(n,r-1));case 8:return fe.test(t.slice(n,r));default:return pe(t,n,r)}},_e=new Set(typeof E==`string`?E.split(` `):E),ve=(e,t,n,r,i,a)=>{let o=Xt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},J=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||_e.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Me=new Int32Array(Oe),Ne=new Uint8Array(Oe),Pe=0,Fe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Pe++&3))c=e|Pe>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Me[c]=o,Ne[c]=s},Ie=()=>Ae.fill(null),Le=256,Re=[new Int32Array(Le),new Int32Array(Le),new Int32Array(Le),new Int32Array(Le)],[Y,ze,Be,Ve]=Re,He=new Uint8Array(Le),Ue=new Uint8Array(Le),We=()=>{Le*=2,Re=Re.map(e=>{let t=new Int32Array(Le);return t.set(e),t}),[Y,ze,Be,Ve]=Re;let e=new Uint8Array(Le);e.set(He),He=e,Ue=new Uint8Array(Le)},Ge=64,Ke=new Int32Array(Ge),qe=new Int32Array(Ge),Je=new Int32Array(r),Ye=2048,Xe=21,Ze=new Float64Array(Ye),X=new Int32Array(Ye),Qe=0,$e=(e,t)=>{if(e===0&&t<r)return Je[t]===Qe?1:(Je[t]=Qe,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Xe;for(;X[i]===Qe;){if(Ze[i]===n)return 1;i=i+1&Ye-1}return Ze[i]=n,X[i]=Qe,0},et=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Jt:ve(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=qe[t];if(r>n)continue;let i=Ke[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;le(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(q(d[t],e,r,n))return p[h+t]}return Jt},tt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||J.size>xe)&&(J=new Map,ye=new Map,be=2,Ie()),we>Te&&(Ce=new Map,we=r,Ie());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ce(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ce(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Le&&We();let _=n++;Y[_]=p,ze[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Be[_]=je[t],Ve[_]=Me[t],He[_]=Ne[t];continue}}}let b=p;if(H!==0){if(h-p<=H||!e.startsWith(V,p)){Be[_]=Jt,Fe(y,e,p,h,v,Jt,0,0);continue}b=p+H}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ke[0]=0,qe[0]=M,R=1);let z=Yt,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Yt:P,B=R),P!==Yt){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Yt;else{let e=i[P],t=i[P+1],c=Yt;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Ge){Ge*=2;let e=new Int32Array(Ge);e.set(Ke),Ke=e;let t=new Int32Array(Ge);t.set(qe),qe=t}Ke[R]=r,qe[R]=t+2,R++}}A===D&&(z=F<I?Yt:P,B=R);let ee=F<I?Yt:P,U,te=!1;if(A>=0){if(te=!0,U=et(e,E,A,z,B),U!==Jt&&U<r&&j[U]){let t=et(e,E,D,ee,R);t!==Jt&&t!==U&&(U=t,te=!1)}else U===Jt&&(U=et(e,E,D,ee,R),te=!1)}else U=et(e,E,D,ee,R);let ne=0,re=0;U===Jt?Be[_]=Jt:(re=+!!te,ne=b>=C?+!!O:ve(J,e,b,C,+!!O,e=>Se(e,O)),Be[_]=U,He[_]=re,Ve[_]=ne),Fe(y,e,p,h,v,U,ne,re)}if(n===0)return``;if(n===1)return Y[0]===0&&ze[0]===t?e:e.slice(Y[0],ze[0]);if(n*k>Ye){for(;n*k>Ye;)Ye<<=1,Xe--;Ze=new Float64Array(Ye),X=new Int32Array(Ye)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);Qe=Qe+1|0,Qe===0&&(Je.fill(0),X.fill(0),Qe=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Be[e];if(t===Jt){Ue[e]=1;continue}let n=Ve[e];if($e(n,t)===1)Ue[e]=0,f=!0;else if(Ue[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)$e(n,x[e]);if(He[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&$e(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ue[m]){m++;continue}let t=Y[m],r=ze[m],i=m+1;for(;i<n&&Ue[i]&&Y[i]===r+1&&e.charCodeAt(r)===32;)r=ze[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},nt=16384,Z=new Int32Array(nt*2),rt=0,it=1,at=Object.create(null),ot=Object.create(null),st=new Map,ct=new Map,lt=0,ut=0,dt=()=>{rt^=nt,it=it+1|0,ut=0},ft=e=>{let t=at[e];if(t!==void 0)return t;let n=Zt(e,0,e.length),r=(n&16383)+rt,i=Z[r]===(n^it)||Z[r^nt]===(n^it-1);return i&&(t=ot[e],t!==void 0)?(at[e]=t,t):(t=tt(e),i?(at[e]=t,++lt>z&&(lt=0,ot=at,at=Object.create(null),dt())):(Z[r]=n^it,++ut>nt&&dt()),t)},pt=e=>{let t=st.get(e);if(t!==void 0)return t;let n=Zt(e,0,e.length),r=(n&16383)+rt,i=Z[r]===(n^it)||Z[r^nt]===(n^it-1);return i&&(t=ct.get(e),t!==void 0)?(st.set(e,t),t):(t=tt(e),i?(st.set(e,t),++lt>z&&(lt=0,ct=st,st=new Map,dt())):(Z[r]=n^it,++ut>nt&&dt()),t)},mt=e=>{let t=Zt(e,0,e.length),n=(t&16383)+rt;return Z[n]===(t^it)||Z[n^nt]===(t^it-1)||(Z[n]=t^it,++ut>nt&&dt(),!1)},ht=z===0?tt:qt?e=>{let t=st.get(e);return t===void 0?pt(e):t}:ft;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?ht(arguments[0]):ht(tn.apply(null,arguments))},mergeString:ht,seenBefore:z===0?()=>!1:mt,mergeUncached:tt}},$t=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:$t(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},en=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:$t(i,t);a&&(n&&(n+=` `),n+=a)}return n},tn=function(){return en(arguments,!1)},nn=256,rn=16,an=1024,on=4096,sn=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(on).fill(``),l=Array(on).fill(``),u=Array(on).fill(``));let i=Zt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=$t(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>rn&&(_.miss=rn,_.skip=an,_.e.length=0,_.at=0);let u=_.e;u.length<nn?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e($t(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},cn=Qt(Kt),Q=sn(cn.mergeString,cn);cn.merge;var ln=mt(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function un({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,l.jsx)(lt,{"data-slot":`button`,className:Q(ln({variant:t,size:n,className:e})),...r})}var dn=`data-valid`,fn=`data-invalid`,pn={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mn={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},hn={valid(e){return e===null?null:e?{[dn]:``}:{[fn]:``}}},gn={invalid:void 0,name:void 0,validityData:{state:pn,errors:[],error:``,value:``,initialValue:null},setValidityData:X,disabled:void 0,setTouched:X,setDirty:X,setFilled:X,setFocused:X,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:mn,registerFieldControl:X,validation:{getValidationProps:(e,t=$e)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:X,getInputControl:()=>null,commit:async()=>{},change:X}},_n=i.createContext(gn);function vn(e=!0){let t=i.useContext(_n);if(t.setValidityData===X&&!e)throw Error(Fe(28));return t}var yn=i.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:X,validationMode:`onSubmit`,submitCountRef:{current:0}});function bn(){return i.useContext(yn)}function xn(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}var Sn=0;function Cn(e,t=`mui`){let n=i.useRef(void 0),r=xn(),a=e??n.current;return i.useEffect(()=>{n.current??(Sn+=1,n.current=`${t}-${Sn}`,e??r())},[e,t,r]),a}var wn=K.useId;function Tn(e,t){if(wn!==void 0){let n=wn();return e??(t?`${t}-${n}`:n)}return Cn(e,t)}function En(e){return Tn(e,`base-ui`)}var Dn=i.createContext({controlId:void 0,registerControlId:X,resetControlId:X,labelId:void 0,setLabelId:X,messageIds:[],setMessageIds:X,getDescriptionProps:e=>e});function On(){return i.useContext(Dn)}function kn(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:a,resetControlId:o}=On(),s=En(),c=me(()=>Symbol()),l=i.useRef(!1),u=i.useRef(!1),d=q(()=>{l.current&&a!==X&&(l.current=!1,a(c.current,void 0))});return J(()=>{if(!n||a===X){d();return}let e;if(t!==void 0)u.current=!0,e=t;else if(u.current)e=s;else{o();return}e===void 0?d():(l.current=!0,a(c.current,e))},[t,n,a,o,s,c,d]),J(()=>d,[d]),(n?r:void 0)??t??s}function An(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:jn,platform:Mn,maxTouchPoints:Nn}=An(),Pn=jn.toLowerCase(),Fn=Mn.toLowerCase(),In=/^i(os$|p)/.test(Fn)||Fn===`macintel`&&Nn>1,Ln=`android`,Rn=Fn===Ln||Pn.includes(Ln),zn=!In&&Fn.startsWith(`mac`);Fn.startsWith(`win`),!Rn&&/^(linux|chrome os)/.test(Fn);var Bn=zn||In,Vn=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Vn&&Pn.includes(`firefox`),!Vn&&Pn.includes(`chrom`);var Hn=Bn,Un=/jsdom|happydom/.test(Pn);function Wn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&V(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Gn(e,t){let n=e;for(;n;){if(z(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(V(n)?n.host:null)}return null}function Kn(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var qn=`data-base-ui-focusable`,Jn=`ArrowLeft`,Yn=`ArrowRight`,Xn=`ArrowUp`,Zn=`ArrowDown`,Qn=`data-starting-style`,$n=`data-ending-style`,er={[Qn]:``},tr={[$n]:``},nr={transitionStatus(e){return e===`starting`?er:e===`ending`?tr:null}},rr=`data-open`,ir=`data-closed`,ar=`data-anchor-hidden`,or=`data-popup-open`,sr=`data-pressed`,cr={[or]:``},lr={[or]:``,[sr]:``},ur={[rr]:``},dr={[ir]:``},fr={[ar]:``},pr={open(e){return e?cr:null}},mr={open(e){return e?lr:null}},hr={open(e){return e?ur:dr},anchorHidden(e){return e?fr:null}},gr={...hr,...nr};function _r(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 vr(e){return e.matches(`html,body`)}function yr(e){return B(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function br(e){return e?e.getAttribute(`role`)===`combobox`&&yr(e):!1}function xr(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Sr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Sr(e,t.id,n)])}function Cr(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 wr(e){e.preventDefault(),e.stopPropagation()}function Tr(e){return`nativeEvent`in e}function Er(e){return e.pointerType===``&&e.isTrusted?!0:Rn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Dr(e){return Un?!1:!Rn&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Rn||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Or(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function kr(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Ar=Math.min,jr=Math.max,Mr=Math.round,Nr=Math.floor,Pr=e=>({x:e,y:e}),Fr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ir(e,t,n){return jr(e,Ar(t,n))}function Lr(e,t){return typeof e==`function`?e(t):e}function Rr(e){return e.split(`-`)[0]}function zr(e){return e.split(`-`)[1]}function Br(e){return e===`x`?`y`:`x`}function Vr(e){return e===`y`?`height`:`width`}function Hr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ur(e){return Br(Hr(e))}function Wr(e,t,n){n===void 0&&(n=!1);let r=zr(e),i=Ur(e),a=Vr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$r(o)),[o,$r(o)]}function Gr(e){let t=$r(e);return[Kr(e),t,Kr(t)]}function Kr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var qr=[`left`,`right`],Jr=[`right`,`left`],Yr=[`top`,`bottom`],Xr=[`bottom`,`top`];function Zr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Jr:qr:t?qr:Jr;case`left`:case`right`:return t?Yr:Xr;default:return[]}}function Qr(e,t,n,r){let i=zr(e),a=Zr(Rr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Kr)))),a}function $r(e){let t=Rr(e);return Fr[t]+e.slice(t.length)}function ei(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ti(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ei(e)}function ni(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 ri(e,t){return t<0||t>=e.length}function ii(e,t){return si(e.current,{disabledIndices:t})}function ai(e,t){return si(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function oi(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>si(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:ri(e,u)?-1:u,wrapped:d}}function si(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.length-1&&ci(e,a,r));return a}function ci(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ui(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function li(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ui(e,t=e?se(e):null){return!e||!e.isConnected||!t||li(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var di=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function fi(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return V(n)?n.host:null}function pi(e){for(let t of Array.from(e.children))if(F(t)===`summary`)return t;return null}function mi(e,t){let n=pi(t);return!!n&&(e===n||$(n,e))}function hi(e){let t=e?F(e):``;return e!=null&&e.matches(di)&&(t!==`summary`||e.parentElement!=null&&F(e.parentElement)===`details`&&pi(e.parentElement)===e)&&(t!==`details`||pi(e)==null)&&(t!==`input`||e.type!==`hidden`)}function gi(e){if(!hi(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=fi(t)){let n=t!==e,r=F(t)===`slot`;if(t.hasAttribute(`inert`)||n&&F(t)===`details`&&!t.open&&!mi(e,t)||t.hasAttribute(`hidden`)||!r&&!_i(t,n))return!1}return!0}function _i(e,t){let n=se(e);return t?n.display!==`none`:ui(e,n)}function vi(e){let t=e.tabIndex;if(t<0){let t=F(e);if(t===`details`||t===`audio`||t===`video`||B(e)&&e.isContentEditable)return 0}return t}function yi(e){if(F(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function bi(e,t){let n=yi(e);if(!n)return!0;let r=t.find(e=>{let t=yi(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=yi(e);return t?.name===n.name&&t.form===n.form})===n}function xi(e){if(B(e)&&F(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return B(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Si(e,t){xi(e).forEach(e=>{hi(e)&&t.push(e),Si(e,t)})}function Ci(e,t,n){xi(e).forEach(e=>{B(e)&&e.matches(t)&&n.push(e),Ci(e,t,n)})}function wi(e){return gi(e)&&vi(e)>=0}function Ti(e){let t=[];return Si(e,t),t.filter(gi)}function Ei(e){let t=Ti(e);return t.filter(e=>vi(e)>=0&&bi(e,t))}function Di(e,t){let n=Ei(e),r=n.length;if(r===0)return;let i=Wn(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Oi(e){return Di(Y(e).body,1)||e}function ki(e){return Di(Y(e).body,-1)||e}function Ai(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function ji(e){Ei(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Mi(e){let t=[];Ci(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Ni(e){i.useEffect(e,Qe)}var Pi=0,Fi=class e{static create(){return new e}currentId=Pi;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pi,t()},e)}isStarted(){return this.currentId!==Pi}clear=()=>{this.currentId!==Pi&&(clearTimeout(this.currentId),this.currentId=Pi)};disposeEffect=()=>this.clear};function Ii(){let e=me(Fi.create).current;return Ni(e.disposeEffect),e}var Li=null;globalThis.requestAnimationFrame;var Ri=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;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},zi=class e{static create(){return new e}static request(e){return Ri.request(e)}static cancel(e){return Ri.cancel(e)}currentId=Li;request(e){this.cancel(),this.currentId=Ri.request(()=>{this.currentId=Li,e()})}cancel=()=>{this.currentId!==Li&&(Ri.cancel(this.currentId),this.currentId=Li)};disposeEffect=()=>this.cancel};function Bi(){let e=me(zi.create).current;return Ni(e.disposeEffect),e}function Vi(e){return e==null?e:`current`in e?e.current:e}function Hi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Ui=null;function Wi(e){if(!Ui){let e=[];Ui=e,queueMicrotask(()=>{Ui=null,a.flushSync(()=>{for(let t of e)t()})})}Ui.push(e)}function Gi(e,t=!1,n=!1){let r=Bi();return q((i,o=null)=>{r.cancel();let s=Vi(e);if(s==null)return;let c=s,l=()=>{n?Wi(()=>{o?.aborted||i()}):a.flushSync(i)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function u(){Promise.all(Hi(c).map(e=>e.finished.then(X))).then(()=>{o?.aborted||l()},()=>{o?.aborted||(Hi(c).some(e=>e.pending||e.playState!==`finished`)?u():l())})}if(t){let e=Qn;if(!c.hasAttribute(e)){r.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),o?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(u)})}function Ki(e){let{enabled:t=!0,open:n,ref:r,batch:a=!1,onComplete:o}=e,s=q(o),c=Gi(r,n,a);i.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}function qi(e,t=!1,n=!1,r=!1){let[a,o]=i.useState(e&&t?`idle`:void 0),[s,c]=i.useState(e&&!r);return e&&!s&&(c(!0),o(`starting`)),!e&&s&&a!==`ending`&&!n&&o(`ending`),!e&&!s&&a===`ending`&&o(void 0),J(()=>{if(!e&&s&&a!==`ending`&&n){let e=zi.request(()=>{o(`ending`)});return()=>{zi.cancel(e)}}},[e,s,a,n]),J(()=>{if(!e||t||a===void 0)return;let n=zi.request(()=>{o(void 0)});return()=>{zi.cancel(n)}},[t,e,a]),J(()=>{if(!e||!t)return;e&&s&&a!==`idle`&&o(`starting`);let n=zi.request(()=>{o(`idle`)});return()=>{zi.cancel(n)}},[t,e,s,a]),{mounted:s,setMounted:c,transitionStatus:a}}function Ji(e,t,n){let{setFocused:r,focusOwnerRef:i}=vn(),a=q(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return J(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Yi(e,t,n,r,i=!0,a){let{registerFieldControl:o}=vn(),s=me(()=>Symbol());J(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),J(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Xi(e,t){let n=i.useRef(e),r=q(t);J(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Zi(e,t,n,r){let i=!1,a=!1,o=r??$e;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}}var Qi=`none`,$i=`trigger-press`,ea=`outside-press`,ta=`item-press`,na=`close-press`,ra=`focus-out`,ia=`escape-key`,aa=`list-navigation`,oa=`cancel-open`,sa=`disabled`,ca=`missing`,la=`initial`,ua=`imperative-action`,da=`window-resize`,fa=i.forwardRef(function(e,t){let{render:n,className:r,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=vn(),{clearErrors:C,elementRef:w,submitCountRef:T}=bn(),E=g||c,D=h??o,O={...m,disabled:E},{labelId:k}=On(),A=kn({id:a}),j=s!==void 0,M=s==null?void 0:String(s),N=q(()=>S.inputRef.current?.value);Yi(S.inputRef,A,M,N,!E,o),J(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,u,S.inputRef,b]),Xi(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=i.useRef(null),F=Ji(E,P),I=Ii();return Z(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:d,...j?{value:s}:{defaultValue:u},onChange(e){let t=e.currentTarget.value,n=Zi(Qi,e.nativeEvent);l?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(_(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){_(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},p,e=>S.getValidationProps(E,e)],stateAttributesMapping:hn})}),pa=i.forwardRef(function(e,t){return(0,l.jsx)(fa,{ref:t,...e})});function ma({className:e,type:t,...n}){return(0,l.jsx)(pa,{type:t,"data-slot":`input`,className:Q(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function ha({controlled:e,default:t,name:n,state:r=`value`}){let{current:a}=i.useRef(e!==void 0),[o,s]=i.useState(()=>t);return[a&&e!==void 0?e:o,i.useCallback(e=>{a||s(e)},[])]}var ga=i.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function _a(){return i.useContext(ga)}function va(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=q(a),[,s]=i.useState(0),c=me(ba).current,u=me(ya).current,d=i.useRef(0),f=i.useRef(!0),p=i.useRef(null),m=i.useRef(null),h=q(()=>{f.current||(f.current=!0,s(e=>e+1))}),g=q((e,t)=>{u.set(e,t),h()}),_=q(e=>{u.delete(e),h()}),v=q(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),d.current=n.current.length,t});function y(e){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Ca(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&wa(r,n)>0){t.disconnect(),h();return}r=n}});m.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Sa(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let b=q(()=>{let[e,t]=xa(u),n=v(e),r=p.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});y(t),p.current=e,f.current=!1,i&&(c.forEach(e=>e(n)),o(n))});J(()=>(!f.current&&p.current&&v(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,v]),J(()=>{f.current&&b()}),J(()=>()=>{m.current?.disconnect(),f.current=!0},[]);let x=q(e=>(c.add(e),()=>{c.delete(e)})),S=i.useMemo(()=>({register:g,unregister:_,subscribeMapChange:x,nextIndexRef:d}),[g,_,x,d]);return(0,l.jsx)(ga.Provider,{value:S,children:t})}function ya(){return new Map}function ba(){return new Set}function xa(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>wa(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Sa(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Ca(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function wa(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Ta(e={}){let{guess:t,label:n,metadata:r,textRef:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,nextIndexRef:u}=_a(),d=i.useRef(-1),[f,p]=i.useState(o==null&&t?()=>{if(d.current===-1){let e=u.current;u.current+=1,d.current=e}return d.current}:-1),m=o??f,h=i.useRef(null),g=i.useCallback(e=>{let t=h.current;t&&c(t),h.current=e,e&&s(e,{metadata:r??null,index:o??null,label:n,textRef:a})},[o,s,c,r,n,a]);return J(()=>{if(o==null)return l(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&p(t)})},[o,l]),{ref:g,index:m}}var Ea=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Da=t(((e,t)=>{t.exports=Ea()})),Oa=Da(),ka=i.createContext(void 0),Aa={disableStyleElements:!1};function ja(){return i.useContext(ka)??Aa}function Ma(e){return Xe(19)?e:e?`true`:void 0}function Na(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Pa=`ArrowUp`,Fa=`ArrowDown`,Ia=`ArrowLeft`,La=`ArrowRight`,Ra=`Home`,za=new Set([Pa,Fa,Ia,La,Ra,`End`]),Ba=[`Shift`,`Control`,`Alt`,`Meta`];function Va(e){return B(e)&&e.tagName===`INPUT`}function Ha(e){return!!(Va(e)&&e.selectionStart!=null||B(e)&&e.tagName===`TEXTAREA`)}function Ua(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=Wa(e,t,`left`),a=Ga(e),o=Ga(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.scrollMarginLeft<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=Wa(e,t,`top`),r=Ga(e),i=Ga(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 Wa(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 Ga(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 Ka=i.createContext(void 0);function qa(){return i.useContext(Ka)?.direction??`ltr`}function Ja({className:e,...t}){return(0,l.jsx)(`textarea`,{"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-none border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function Ya({className:e,...t}){return(0,l.jsx)(`label`,{"data-slot":`label`,className:Q(`flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Xa({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`field-group`,className:Q(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var Za=mt(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Qa({className:e,orientation:t=`vertical`,...n}){return(0,l.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:Q(Za({orientation:t}),e),...n})}function $a({className:e,...t}){return(0,l.jsx)(Ya,{"data-slot":`field-label`,className:Q(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-1 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function eo({className:e,...t}){return(0,l.jsx)(`p`,{"data-slot":`field-description`,className:Q(`text-left text-xs/relaxed leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var to={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},no={...to,position:`fixed`,margin:0,top:0,left:0},ro={...to,position:`absolute`};function io(e){let t=i.useRef(!0);t.current&&(t.current=!1,e())}function ao(e){let[t,n]=i.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function oo(e){let t=me(so,e).current;return t.next=e,J(t.effect),t}function so(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var co=t((e=>{var t=r(),n=Da();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),lo=t(((e,t)=>{t.exports=co()}))(),uo=[],fo=void 0;function po(){return fo}function mo(e){uo.push(e)}function ho(e){let t=(t,n)=>{let r=me(go).current,i;try{fo=r;for(let e of uo)e.before(r);i=e(t,n);for(let e of uo)e.after(r);r.didInitialize=!0}finally{fo=void 0}return i};return t.displayName=e.displayName||e.name,t}function go(){return{didInitialize:!1}}var _o=Xe(19)?bo:xo;function vo(e,t,n,r,i){return _o(e,t,n,r,i)}function yo(e,t,n,r,a){let o=i.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return(0,Oa.useSyncExternalStore)(e.subscribe,o,o)}mo({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Oa.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function bo(e,t,n,r,i){let a=po();if(!a)return yo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function xo(e,t,n,r,i){return(0,lo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var So=class{static create(e){return new this(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(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return vo(this,e,t,n,r)}},Co=class extends So{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){i.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;J(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){i.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return i.useDebugValue(e),vo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){i.useDebugValue(e);let n=q(t??X);this.context[e]=n}useStateSetter(e){let t=i.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.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 wo(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function To(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Eo=i.forwardRef(function(e,t){let[n,r]=i.useState();J(()=>{Hn&&Vn&&r(`button`)},[]);let a={tabIndex:0,role:n};return(0,l.jsx)(`span`,{...e,ref:t,style:no,"aria-hidden":!n||void 0,...a,"data-base-ui-focus-guard":``})});function Do(e){return`data-base-ui-${e}`}var Oo=0;function ko(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Oo);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),X;let o=requestAnimationFrame(a);return Oo=o,()=>{Oo===o&&(cancelAnimationFrame(o),Oo=0)}}var Ao=`data-base-ui-inert`,jo=new WeakMap,Mo=new WeakSet,No=new WeakMap,Po=0;function Fo(e){return e?V(e)?e.host:Fo(e.parentNode):null}var Io=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Fo(t);return e.contains(n)?n:null}).filter(e=>e!=null),Lo=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ro=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{F(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function zo(e,t,n,{mark:r=!0}){let i=Io(t,e),a=r?Ro(t,Lo(i),new Set(i)):[],o=[],s=[];if(n){let e=Io(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Ro(t,Lo(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(jo.get(e)||0)+1;jo.set(e,r),o.push(e),r===1&&n&&Mo.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(No.get(e)||0)+1;No.set(e,t),s.push(e),t===1&&e.setAttribute(Ao,``)}),Po+=1,()=>{o.forEach(e=>{let t=(jo.get(e)||0)-1;jo.set(e,t),t||(Mo.has(e)||e.removeAttribute(`aria-hidden`),Mo.delete(e))}),r&&s.forEach(e=>{let t=(No.get(e)||0)-1;No.set(e,t),t||e.removeAttribute(Ao)}),--Po,Po||(jo=new WeakMap,Mo=new WeakSet,No=new WeakMap)}}function Bo(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Y(e[0]).body;return zo(e,i,n,{mark:r})}var Vo={style:{transition:`none`}},Ho={fallbackAxisSide:`none`},Uo={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Wo=i.createContext(null),Go=()=>i.useContext(Wo),Ko=Do(`portal`);function qo(e={}){let{ref:t,container:n,componentProps:r=$e,elementProps:o}=e,s=Tn(),c=Go()?.portalNode,[l,u]=i.useState(null),[d,f]=i.useState(null),p=q(e=>{e!==null&&f(e)}),m=i.useRef(null);J(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(R(n)?n:n.current))??c??document.body;e==null?m.current&&(m.current=null,f(null),u(null)):m.current!==e&&(m.current=e,f(null),u(e))},[n,c]);let h=Z(`div`,r,{ref:[t,p],props:[{id:s,[Ko]:``},o]}),g=l&&h?a.createPortal(h,l):null;return{node:d,nodeId:i.isValidElement(h)?h.props.id:void 0,subtree:g}}var Jo=i.forwardRef(function(e,t){let{render:n,className:r,style:o,children:s,container:c,portalOwnerRole:u,...d}=e,{node:f,nodeId:p,subtree:m}=qo({container:c,ref:t,componentProps:e,elementProps:d}),h=i.useRef(null),g=i.useRef(null),_=i.useRef(null),v=i.useRef(null),[y,b]=i.useState(null),x=i.useRef(!1),S=y?.modal,C=y?.open,w=!!y&&!y.modal&&y.open&&!!f;i.useEffect(()=>{if(!f||S)return;function e(e){f&&e.relatedTarget&&Ai(e)&&(e.type===`focusin`?x.current&&=(Mi(f),!1):(ji(f),x.current=!0))}return wo(To(f,`focusin`,e,!0),To(f,`focusout`,e,!0))},[f,S]),J(()=>{f&&C===!0&&x.current&&(Mi(f),x.current=!1)},[C,f]);let T=i.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:g,beforeInsideRef:_,afterInsideRef:v,portalNode:f,setFocusManagerState:b}),[f]);return(0,l.jsxs)(i.Fragment,{children:[m,(0,l.jsxs)(Wo.Provider,{value:T,children:[w&&f&&(0,l.jsx)(Eo,{"data-type":`outside`,ref:h,onFocus:e=>{Ai(e,f)?_.current?.focus():ki(y?y.domReference:null)?.focus()}}),w&&f&&(0,l.jsx)(`span`,{role:u,"aria-owns":p,style:Uo}),f&&a.createPortal(s,f),w&&f&&(0,l.jsx)(Eo,{"data-type":`outside`,ref:g,onFocus:e=>{Ai(e,f)?v.current?.focus():(Oi(y?y.domReference:null)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Zi(`focus-out`,e.nativeEvent)))}})]})]})});function Yo(){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 Xo=i.createContext(null),Zo=i.createContext(null),Qo=()=>i.useContext(Xo)?.id||null,$o=e=>{let t=i.useContext(Zo);return e??t};function es(e,t){let n=I(Kn(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Er(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ts=20,ns=[];function rs(){ns=ns.filter(e=>e.deref()?.isConnected)}function is(e){rs(),e&&F(e)!==`body`&&(ns.push(new WeakRef(e)),ns.length>ts&&(ns=ns.slice(-20)))}function as(){return rs(),ns[ns.length-1]?.deref()}function os(e){return e?wi(e)?e:Ei(e)[0]||e:null}function ss(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Ti(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return wi(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function cs(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,explicitReturnFocus:s,restoreFocus:c=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:f=``,nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),b=t.useState(`floatingElement`),{events:x,dataRef:S}=t.context,C=q(()=>S.current.floatingContext?.nodeId),w=a===!1,T=br(y)&&w,E=oo(a),D=oo(o),O=oo(s),k=oo(f),A=oo(v),j=$o(g),M=Go(),N=i.useRef(!1),P=i.useRef(!1),I=i.useRef(!1),L=i.useRef(null),R=i.useRef(``),z=i.useRef(``),V=i.useRef(null),H=i.useRef(null),ee=Ue(V,h,M?.beforeInsideRef),U=Ue(H,M?.afterInsideRef),te=Ii(),ne=Ii(),re=Bi(),ie=M!=null,W=xr(b),ae=q((e=W)=>e?Ei(e):[]),oe=q(()=>_?.().filter(e=>e!=null)??[]);i.useEffect(()=>{if(r||!u)return;function e(e){e.key===`Tab`&&$(W,Wn(Y(W)))&&ae().length===0&&!T&&wr(e)}return To(Y(W),`keydown`,e)},[r,W,u,T,ae]),i.useEffect(()=>{if(r||!v)return;let e=Y(W);function t(){I.current=!1}function n(e){let t=Kn(e),n=oe(),r=$(b,t)||$(y,t)||$(M?.portalNode,t)||n.some(e=>e===t||$(e,t));I.current=!r,z.current=e.pointerType||`keyboard`,Gn(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,ne.start(0,()=>{P.current=!1}))}function i(){z.current=`keyboard`}return wo(To(e,`pointerdown`,n,!0),To(e,`pointerup`,t,!0),To(e,`pointercancel`,t,!0),To(e,`keydown`,i,!0),t)},[r,b,y,W,v,M,ne,oe]),i.useEffect(()=>{if(r||!d)return;let e=Y(W);function n(){P.current=!0,ne.start(0,()=>{P.current=!1})}function i(e){let t=Kn(e);wi(t)&&(L.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Kn(n);u&&r==null&&a!=null&&$(b,a)&&is(a),queueMicrotask(()=>{let o=C(),s=t.context.triggerElements,l=oe(),d=r?.hasAttribute(Do(`focus-guard`))&&[V.current,H.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Vi(m),Vi(p)].includes(r),f=!($(y,r)||$(b,r)||$(r,b)||$(M?.portalNode,r)||l.some(e=>e===r||$(e,r))||s.hasMatchingElement(e=>$(e,r))||d||j&&(Sr(j.nodesRef.current,o).find(e=>$(e.context?.elements.floating,r)||$(e.context?.elements.domReference,r))||Cr(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,xr(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&W&&ss(W),c&&i!==y&&!ui(a)&&Wn(e)===e.body){if(B(W)&&(W.focus(),c===`popup`)){re.request(()=>{W.focus()});return}let e=ae(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;B(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(T||!u)&&r&&f&&!P.current&&(T||r!==as())&&(N.current=!0,t.setOpen(!1,Zi(ra,n)))})}function o(){I.current||(S.current.insideReactTree=!0,te.start(0,()=>{S.current.insideReactTree=!1}))}let s=B(y)?y:null;if(b||s)return wo(s&&To(s,`focusout`,a),s&&To(s,`pointerdown`,n),b&&To(b,`focusin`,i),b&&To(b,`focusout`,a),b&&M&&To(b,`focusout`,o,!0))},[r,y,b,W,u,j,M,t,d,c,ae,T,C,S,te,ne,re,p,m,oe]),i.useEffect(()=>{if(r||!b||!v)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Do(`portal`)}]`)||[]),t=(j?Cr(j.nodesRef.current,C()):[]).find(e=>br(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Bo([b,...e,V.current,H.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...oe(),t,Vi(m),Vi(p),T?y:null].filter(e=>e!=null),{ariaHidden:u||T,mark:!1}),i=Bo([b,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,b,u,M,T,j,C,p,m,oe]),J(()=>{if(!v||r||!B(W))return;R.current=``,z.current=``;let e=Y(W),t=Wn(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(W,t))return;let i=null,a=()=>(i??=ae(W),i[0]||W),o;o=r===!0||r===null?a():Vi(r),o||=a();let s=$(W,Wn(e)),c=S.current.openEvent,l=c?.type===`mousedown`&&Er(c);ko(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Wn(e);return!(t!==o&&$(W,t))}})})},[r,v,W,ae,E,k,A,S]);let G=i.useRef(null);J(()=>{if(r||!W){G.current=null;return}G.current&&=(G.current.cancelled=!0,null);let e=Y(W),t=Wn(e),n=k.current==null;is(t);function i(e){if(e.open||(R.current=es(e.nativeEvent,z.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Do(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(Er(e.nativeEvent)||Dr(e.nativeEvent))N.current=!1;else{let e=!1;Y(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}x.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&F(t)!==`body`?t:null,s=n?o||a:a||o;return s||=as()||null,typeof i==`boolean`?s:Vi(i)||s||null}return()=>{x.off(`openchange`,i);let t=Wn(e),n=oe(),r=$(b,t)||n.some(e=>e===t||$(e,t))||j&&Sr(j.nodesRef.current,C(),!1).some(e=>$(e.context?.elements.floating,t)),o=D.current,s=R.current,c=a(s),l={cancelled:!1};G.current=l,queueMicrotask(()=>{G.current===l&&(G.current=null);let n=os(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&B(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,b,W,D,O,k,x,j,y,C,oe]),J(()=>{if(!Vn||v||!b)return;let e=Wn(Y(b));B(e)&&yr(e)&&$(b,e)&&e.blur()},[v,b]),J(()=>{if(!r&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:d,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,u,v,t,d,y]),J(()=>{if(!r&&W)return ss(W),()=>{queueMicrotask(rs)}},[r,W]);let se=!r&&(!u||!T)&&(ie||u);return(0,l.jsxs)(i.Fragment,{children:[se&&(0,l.jsx)(Eo,{"data-type":`inside`,ref:ee,onFocus:e=>{if(u){let e=ae();ko(e[e.length-1])}else M?.portalNode&&(N.current=!1,Ai(e,M.portalNode)?Oi(y)?.focus():Vi(m??M.beforeOutsideRef)?.focus())}}),n,se&&(0,l.jsx)(Eo,{"data-type":`inside`,ref:U,onFocus:e=>{u?ko(ae()[0]):M?.portalNode&&(d&&(N.current=!0),Ai(e,M.portalNode)?ki(y)?.focus():Vi(p??M.afterOutsideRef)?.focus())}})]})}function ls(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=$i}=t,u=e.context.dataRef,d=i.useRef(void 0),f=Bi(),p=Ii(),m=i.useMemo(()=>{function t(t,n,r,i){let a=Zi(l,n,r);t&&i===`touch`&&c>0?p.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let i=u.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!a?!0:i&&(typeof s==`function`?s():s)?!r(i.type):!1}return{onPointerDown(e){d.current=Or(e.pointerType,!0)&&Dr(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let a=d.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Or(a,!0)&&o)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),u=Kn(s),p=yr(u);if(p||a===`virtual`){t(l,s,p?u:i.currentTarget,a);return}let m=i.currentTarget;f.request(()=>{t(l,s,m,a)})},onClick(i){if(r===`mousedown-only`)return;let a=d.current;r===`mousedown`&&a?d.current=void 0:Or(a,!0)&&o||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,a)},onKeyDown(){d.current=void 0}}},[u,r,o,l,e,s,a,f,p,c]);return i.useMemo(()=>n?{reference:m}:$e,[n,m])}function us(){return!1}function ds(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function fs(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:a=!0,outsidePressEvent:o=`sloppy`,referencePress:s=us,bubbles:c,externalTree:l}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:f,events:p}=e.context,m=$o(l),h=q(typeof a==`function`?a:()=>!1),g=typeof a==`function`?h:a,_=g!==!1,v=q(()=>o),{escapeKey:y,outsidePress:b}=ds(c),x=i.useRef(!1),S=i.useRef(!1),C=i.useRef(!1),w=i.useRef(!1),T=i.useRef(!1),E=i.useRef(``),D=i.useRef(null),O=Ii(),k=Ii(),A=Ii(),j=q(()=>{k.clear(),f.current.insideReactTree=!1}),M=q(e=>{let t=f.current.floatingContext?.nodeId;return(m?Sr(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=q(t=>_r(t,e.select(`floatingElement`))||_r(t,e.select(`domReferenceElement`))),P=q(t=>{s()&&e.setOpen(!1,Zi($i,t.nativeEvent))}),F=q(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=Tr(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=Zi(ia,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=q(()=>{f.current.insideReactTree=!0,k.start(0,j)}),L=q(t=>{if(!u||!n||t.button!==0)return;let r=Kn(t.nativeEvent);$(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=q(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});i.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),i.useEffect(()=>j,[j]),i.useEffect(()=>{if(!u||!n)return u||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let t=new Fi,i=Y(d);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Vn?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function l(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=l();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=f.current.floatingContext?.nodeId,n=m&&Sr(m.nodesRef.current,t).some(t=>_r(e,t.context?.elements.floating));return N(e)||n}function k(n){if(p(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let r=Kn(n),i=`[${Do(`inert`)}]`,a=z(r)?r.getRootNode():null,o=Array.from((V(a)?a:Y(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>$(e,r))))return;let c=z(r)?r:null;for(;c&&!G(c);){let e=le(c);if(G(e)||!z(e))break;c=e}if(!(o.length&&z(r)&&!vr(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(B(r)&&!(`touches`in n)){let e=G(r),t=se(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!h(n)){if(l()===`intentional`){if(n.detail!==0&&!Er(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(n))&&(M(`__outsidePressBubbles`)||(e.setOpen(!1,Zi(ea,n)),j()))}}}function P(t){l()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(l()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Kn(e);if(!n)return;let r=To(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function H(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function ee(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),l()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function U(e){if(l()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function te(e){L(e,U)}function ne(e){l()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function re(e){L(e,ne)}let ie=wo(r&&wo(To(i,`keydown`,F),To(i,`compositionstart`,a),To(i,`compositionend`,o)),_&&wo(To(i,`click`,H,!0),To(i,`pointerdown`,H,!0),To(i,`pointerup`,ee,!0),To(i,`pointercancel`,ee,!0),To(i,`mousedown`,H,!0),To(i,`mouseup`,ee,!0),To(i,`touchstart`,R,{capture:!0,passive:!0}),To(i,`touchmove`,te,{capture:!0,passive:!0}),To(i,`touchend`,re,{capture:!0,passive:!0})));return()=>{ie(),t.clear(),c(),C.current=!1}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,e,O,A]);let H=i.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=i.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return i.useMemo(()=>n?{reference:H,floating:ee,trigger:H}:{},[n,H,ee])}function ps(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};z(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function ms(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:a,onUnmount:o,animateInitialOpen:s}=e,c=q(a),{mounted:l,setMounted:u,transitionStatus:d}=qi(t,!1,!1,s),f=!t&&r;J(()=>{t&&c(!1)},[t,c]);let p=i.useRef(l),m=i.useRef(!1),h=xn(),g=()=>{p.current=!1,u(!1),o()};J(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=q(()=>{p.current&&(t?(m.current=!0,h()):g())});return Ki({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var hs={tabIndex:-1,[qn]:``};function gs(e){return t=>t!==`touch`||e.current}function _s(e,t=!1){let n=Tn(),r=Qo()!=null,i=me(()=>e(n,r)).current;return ps({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function vs({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function ys(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function bs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function xs(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=i.useRef(null),a=e.useState(`open`);J(()=>{if(!a){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){i.activeTriggerId=t,i.activeTriggerElement=n,r.current=t;break}i.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n,r.current=e}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Zi(Qi);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[a,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ss(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ms({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return me(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Cs(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:$e,inactiveTriggerProps:$e,popupProps:$e})},[e])}function ws(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ts=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Es={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ds=class extends Co{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Yo(),nested:n,triggerElements:i},Es),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&kr(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Os(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Ds({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:$e,inactiveTriggerProps:$e,popupProps:$e}}var ks=e=>e.triggerIdProp??e.activeTriggerId,As=e=>e.openProp??e.open,js=e=>(e.popupElement?.id??e.floatingId)||void 0;function Ms(e,t){return t!==void 0&&As(e)&&ks(e)===t}function Ns(e,t){return Ms(e,t)?!0:t!==void 0&&As(e)&&ks(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Ps={open:As,mounted:e=>e.mounted,transitionStatus:e=>As(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ks,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:js,isTriggerActive:(e,t)=>t!==void 0&&ks(e)===t,isOpenedByTrigger:(e,t)=>Ms(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ks(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ns(e,t)?js(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Fs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Tn(),a=Qo()!=null,o=me(()=>new Ds({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ts,floatingId:i,syncOnly:!1,nested:a})).current;return J(()=>{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}function Is(e){return Vn&&e.movementX===0&&e.movementY===0}function Ls(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Rs(e,t){return Ls(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function zs(e,t,n){return Ls(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Bs(e,t,n){return Ls(t,n?e===Jn:e===Yn,e===Zn)}function Vs(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ls(t,n?e===Yn:e===Jn,e===Xn)}function Hs(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=xr(D),j=br(O),M=oo(A),N=Qo(),P=$o(S),F=i.useRef(p),I=i.useRef(s??-1),L=i.useRef(null),R=i.useRef(!0),z=q(e=>{a(I.current===-1?null:I.current,e)}),V=i.useRef(!!D),H=i.useRef(E),ee=i.useRef(!1),U=i.useRef(!1),te=i.useRef(null),ne=oo(g),re=oo(E),ie=oo(s),W=oo(x),ae=Bi(),oe=Bi(),G=q(()=>{ae.cancel();function e(e){f||(te.current=ko(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[I.current],r=U.current;t&&e(t),(ee.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),fe&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{k.current.orientation=_},[k,_]),J(()=>{E||(L.current=null),(!E||p!==`auto`)&&(F.current=p)},[E,p]),J(()=>{o&&(E&&D?(I.current=s??-1,F.current&&s!=null&&(U.current=!0,z())):V.current&&(I.current=-1,z()))},[o,E,D,s,z]),J(()=>{if(o){if(!E)ee.current=!1;else if(D){if(r==null){if(ee.current=!1,ie.current!=null)return;if(V.current&&(I.current=-1,G()),(!H.current||!V.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||zs(L.current,v,d)||u?ii(n):ai(n),L.current=null,z())};t()}}else ri(n.current,r)||(I.current=r,G(),U.current=!1)}}},[o,E,D,r,ie,u,n,v,d,z,G,oe]),J(()=>{if(!o||D||!P||f||!V.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Wn(Y(O??t??null)),r=e.some(e=>e.context&&$(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[o,D,O,P,N,f]),J(()=>{H.current=E,V.current=!!D});let se=r!=null,ce=q(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),le=q(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),ue=q(()=>ii(n,ne.current)),de=q(t=>{if(R.current=!1,ee.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(u&&Vs(t.key,_,d,T)){Rs(t.key,le())||wr(t),e.setOpen(!1,Zi(aa,t.nativeEvent));let n=C?.current??O;B(n)&&n.focus();return}r!=null&&r!==I.current&&!ri(n.current,r)&&(I.current=r);let i=I.current,a=ii(n,g),o=ai(n,g);if(j||(t.key===`Home`&&(wr(t),I.current=a,z(t)),t.key===`End`&&(wr(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,l,d,g,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(Rs(t.key,_)){wr(t);let e=Wn(t.currentTarget.ownerDocument);if(E&&!f&&$(t.currentTarget,e)&&!n.current.some(t=>t!=null&&$(t,e))){I.current=zs(t.key,_,d)?a:o,z(t),r===I.current&&G();return}let{index:s,wrapped:u}=oi(n.current,i,{decrement:!zs(t.key,_,d),loopFocus:l,allowEscape:c,disabledIndices:g,minIndex:a,maxIndex:o});u&&(ee.current=!1),I.current=s,z(t)}}),fe=i.useMemo(()=>({onFocus(e){ee.current=!0,ce(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){Is(e)||(ee.current=!0,U.current=!1,m&&ce(e))},onPointerLeave(e){if(!re.current||!R.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&W.current&&(te.current?.(),te.current=null,I.current=-1,z(e),!f)){let e=M.current,t=Wn(Y(e));e&&$(e,t)&&e.focus({preventScroll:!0})}}}),[ce,re,M,m,n,z,W,f]),K=i.useMemo(()=>f&&E&&se&&{"aria-activedescendant":`${b}-${r}`},[f,E,se,b,r]),pe=i.useMemo(()=>({...j?{}:K,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=Kn(t.nativeEvent);if(n&&!$(M.current,n))return;wr(t);let r=Zi(ra,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&B(i)&&i.focus()}else de(t)},onPointerMove(e){Is(e)||(R.current=!0)}}),[K,de,M,j,e,E,f,O,C]),me=i.useMemo(()=>{function t(t){e.setOpen(!0,Zi(aa,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&Er(e.nativeEvent)&&(F.current=!f)}function r(e){F.current=p,p===`auto`&&Dr(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Bs(n.key,le(),d),o=Rs(n.key,r?_:v),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||yr(n.currentTarget)))return de(n);if(r||h||!i){if(s){let e=Rs(n.key,le());L.current=u&&e?null:n.key}u?a&&(wr(n),r?(I.current=ue(),z(n),f&&M.current?.focus()):t(n)):o&&(ie.current!=null&&(I.current=ie.current),wr(n),!r&&h?t(n):de(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,p,ue,u,z,e,h,_,v,le,d,ie,f,M]),he=i.useMemo(()=>({...K,...me}),[K,me]);return i.useMemo(()=>o?{reference:he,floating:pe,item:fe,trigger:me}:{},[o,he,pe,me,fe])}function Us(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=q(c),p=e.useState(`open`),m=Ii(),h=i.useRef(``),g=i.useRef(d??a??-1),_=i.useRef(null),v=q(e=>{function t(e){return r?.current[e]}function i(e){let n=t(e);return n&&!ui(n)||n?.matches(`:disabled`)?!1:s==null||!ci(Qe,e,s)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,a=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(a)&&i(n))return n}return-1}let l=n.current;if(h.current.length>0&&e.key===` `&&(wr(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(l,h.current)===-1&&e.key!==` `&&f?.(!1),l==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(wr(e),f?.(!0));let v=h.current===``;v&&(g.current=d??a??-1),l.every((e,t)=>e&&i(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let y=((v?d??a??-1:g.current)??0)+1,b=c(l,h.current,y);b===-1?e.key!==` `&&(h.current=``,f?.(!1)):(o?.(b,e),_.current=b)}),y=q(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);$(r,n)||$(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});J(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let b=i.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return i.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}function Ws(e,t,n){let{reference:r,floating:i}=e,a=Hr(t),o=Ur(t),s=Vr(o),c=Rr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=zr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Gs(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}=Lr(t,e),p=ti(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ni(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=ni(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 Ks=50,qs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Gs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ws(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ks&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ws(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Js=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}=Lr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rr(r),_=Hr(o),v=Rr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[$r(o)]:Gr(o)),x=p!==`none`;!d&&x&&b.push(...Qr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Wr(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`||_===Hr(t)||T.every(e=>Hr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Ys=new Set([`left`,`top`]);async function Xs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rr(n),s=zr(n),c=Hr(n)===`y`,l=Ys.has(o)?-1:1,u=a&&c?-1:1,d=Lr(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 Zs=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 Xs(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}}}}},Qs=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hr(i),p=Br(f),m=u[p],h=u[f],g=(e,t)=>Ir(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$s=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}=Lr(e,t),u={x:n,y:r},d=Hr(i),f=Br(d),p=u[f],m=u[d],h=Lr(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ys.has(Rr(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}}}},ec=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Lr(e,t),c=await i.detectOverflow(t,s),l=Rr(n),u=zr(n),d=Hr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ar(p-c[m],g),y=Ar(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*jr(c.left,c.right):S=p-2*jr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tc(e){let t=se(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=B(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Mr(n)!==a||Mr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function nc(e){return z(e)?e:e.contextElement}function rc(e){let t=nc(e);if(!B(t))return Pr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=tc(t),o=(a?Mr(n.width):n.width)/r,s=(a?Mr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ic=Pr(0);function ac(e){let t=I(e);return!oe()||!t.visualViewport?ic:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===I(e)}function sc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=nc(e),o=Pr(1);t&&(r?z(r)&&(o=rc(r)):o=rc(e));let s=oc(a,n,r)?ac(a):Pr(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=I(a),t=z(r)?I(r):r,n=e,i=fe(n);for(;i&&t!==n;){let e=rc(i),t=i.getBoundingClientRect(),r=se(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=I(i),i=fe(n)}}return ni({width:u,height:d,x:c,y:l})}function cc(e,t){let n=ce(e).scrollLeft;return t?t.left+n:sc(L(e)).left+n}function lc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cc(e,n),y:n.top+t.scrollTop}}function uc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=L(r),s=t?U(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Pr(1),u=Pr(0),d=B(r);if((d||!a)&&((F(r)!==`body`||H(o))&&(c=ce(r)),d)){let e=sc(r);l=rc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?lc(o,c):Pr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function dc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fc(e){let t=ce(e),n=e.ownerDocument.body,r=jr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=jr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+cc(e),o=-t.scrollTop;return se(n).direction===`rtl`&&(a+=jr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var pc=25;function mc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=I(e),a=L(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!oe()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(cc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=pc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function hc(e,t){let n=sc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=mc(e,n,t);else if(t===`document`)r=fc(L(e));else if(z(t))r=hc(t,n);else{let n=ac(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ni(r)}function _c(e,t){let n=t.get(e);if(n)return n;let r=de(e,[],!1).filter(e=>z(e)&&F(e)!==`body`),i=null,a=se(e).position===`fixed`,o=a?le(e):e;for(;z(o)&&!G(o);){let e=se(o),t=W(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=le(o)}return t.set(e,r),r}function vc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?U(t)?[]:_c(t,this._c):[].concat(n),r],o=gc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=gc(t,a[e],i);s=jr(n.top,s),c=Ar(n.right,c),l=Ar(n.bottom,l),u=jr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function yc(e){let{width:t,height:n}=tc(e);return{width:t,height:n}}function bc(e,t,n){let r=B(t),i=L(t),a=n===`fixed`,o=sc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Pr(0);if((r||!a)&&((F(t)!==`body`||H(i))&&(s=ce(t)),r)){let e=sc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=cc(i));let l=i&&!r&&!a?lc(i,s):Pr(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function xc(e){return se(e).position===`static`}function Sc(e,t){if(!B(e)||se(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return L(e)===n&&(n=n.ownerDocument.body),n}function Cc(e,t){let n=I(e);if(U(e))return n;if(!B(e)){let t=le(e);for(;t&&!G(t);){if(z(t)&&!xc(t))return t;t=le(t)}return n}let r=Sc(e,t);for(;r&&ee(r)&&xc(r);)r=Sc(r,t);return r&&G(r)&&xc(r)&&!W(r)?n:r||ae(e)||n}var wc=async function(e){let t=this.getOffsetParent||Cc,n=this.getDimensions,r=await n(e.floating);return{reference:bc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tc(e){return se(e).direction===`rtl`}var Ec={convertOffsetParentRelativeRectToViewportRelativeRect:uc,getDocumentElement:L,getClippingRect:vc,getOffsetParent:Cc,getElementRects:wc,getClientRects:dc,getDimensions:yc,getScale:rc,isElement:z,isRTL:Tc};function Dc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oc(e,t,n){let r=null,i,a=L(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Nr(d),h=Nr(a.clientWidth-(u+f)),g=Nr(a.clientHeight-(d+p)),_=Nr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:jr(0,Ar(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Dc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=I(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function kc(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=nc(e),u=i||a?[...l?de(l):[],...t?de(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Oc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?sc(e):null;c&&g();function g(){let t=sc(e);h&&!Dc(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 Ac=Zs,jc=Qs,Mc=Js,Nc=ec,Pc=$s,Fc=(e,t,n)=>{let r=new Map,i=n??{},a={...Ec,...i.platform,_c:r};return qs(e,t,{...i,platform:a})},Ic=typeof document<`u`?i.useLayoutEffect:function(){};function Lc(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(!Lc(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)&&!Lc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zc(e,t){let n=Rc(e);return Math.round(t*n)/n}function Bc(e){let t=i.useRef(e);return Ic(()=>{t.current=e}),t}function Vc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=i.useState(r);Lc(m,r)||h(r);let[g,_]=i.useState(null),[v,y]=i.useState(null),b=i.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=i.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=s||g,C=c||v,w=i.useRef(null),T=i.useRef(null),E=i.useRef(f),D=u!=null,O=Bc(u),k=Bc(o),A=Bc(d),j=i.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Fc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Lc(E.current,t)&&(E.current=t,a.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Ic(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=i.useRef(!1);Ic(()=>(M.current=!0,()=>{M.current=!1}),[]),Ic(()=>{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=i.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=i.useMemo(()=>({reference:S,floating:C}),[S,C]),F=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=zc(P.floating,f.x),r=zc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Hc=(e,t)=>{let n=Ac(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uc=(e,t)=>{let n=jc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wc=(e,t)=>({fn:Pc(e).fn,options:[e,t]}),Gc=(e,t)=>{let n=Mc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kc=(e,t)=>{let n=Nc(e);return{name:n.name,fn:n.fn,options:[e,t]}},qc=i.createContext(void 0),Jc=i.createContext(void 0);function Yc(){let e=i.useContext(qc);if(e===void 0)throw Error(Fe(60));return e}function Xc(){let e=i.useContext(Jc);if(e===void 0)throw Error(Fe(61));return e}function Zc(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Qc=(e,t)=>Object.is(e,t);function $c(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function el(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Zc(e,t,(e,t)=>$c(e,t,n)):e!==t}function tl(e,t,n){return e?e.some(e=>e!==void 0&&$c(t,e,n)):!1}function nl(e,t,n){return e?e.findIndex(e=>e!==void 0&&$c(e,t,n)):-1}function rl(e,t){if(t!==Qc)return n=>tl(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function il(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(rl(t,n)):nl(e,t,n);return i===-1?null:i}function al(e,t,n,r,i,a){return tl(r,t,i)?a!=null&&e>a&&tl(r,n[a],i)?a:e:e===a?il(n,r,i,!0):a}function ol(e,t,n){return e.filter(e=>!$c(t,e,n))}function sl(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function cl(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function ll(e){return cl(e?.[0])}function ul(e){return ll(e)?e.flatMap(e=>e.items):e}function dl(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(ll(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function fl(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return sl(e)}function pl(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?sl(e.value):sl(e)}function ml(e,t,n){function r(){return fl(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=ul(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function hl(e,t,n){return e.reduce((e,r,a)=>(a>0&&e.push(`, `),e.push((0,l.jsx)(i.Fragment,{children:ml(r,t,n)},a)),e),[])}var gl={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:pl(t,r)!==``},hasNullItemLabel:(e,t)=>t?dl(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>$c(t,e,n)):$c(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function _l(e){let t=i.useRef(``),n=i.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:i.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function vl(e,t){let{onClick:n,onPointerDown:r}=_l(q((n,r)=>{(typeof e==`function`?e():e)||t(r||(In?`touch`:``))}));return i.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function yl(e){let[t,n]=i.useState(null),r=vl(e,n);return Xi(e,t=>{t&&!e&&n(null)}),i.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function bl(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function xl(e,t){return Math.max(0,e-t)}function Sl(e,t){if(t<=0)return 0;let n=bl(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Cl(e){let{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,name:u,form:d,autoComplete:f,disabled:p=!1,readOnly:m=!1,required:h=!1,modal:g=!0,actionsRef:_,inputRef:v,onOpenChangeComplete:y,items:b,multiple:x=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=Qc,highlightItemOnHover:T=!0,children:E}=e,{clearErrors:D}=bn(),{setDirty:O,setTouched:k,setFocused:A,validityData:j,setFilled:M,name:N,disabled:P,validation:F,validationMode:I}=vn(),L=kn({id:t}),R=P||p,z=N??u,[B,V]=ha({controlled:n,default:x?r??Qe:r,name:`Select`,state:`value`}),[H,ee]=ha({controlled:o,default:s,name:`Select`,state:`open`}),U=i.useRef([]),te=i.useRef([]),ne=i.useRef(null),re=i.useRef(null),ie=i.useRef(0),W=i.useRef(null),ae=i.useRef([]),oe=i.useRef(!1),G=i.useRef(null),se=i.useRef(null),ce=i.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),le=i.useRef(!1),ue=i.useRef(B),{openMethod:de,triggerProps:fe}=yl(H),K=me(()=>new Co({id:L,labelId:void 0,modal:g,multiple:x,disabled:R,readOnly:m,required:h,highlightItemOnHover:T,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:B,open:H,mounted:H,transitionStatus:void 0,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:$e,triggerProps:$e,itemRoot:{props:$e,multiple:x,disabled:R,readOnly:m,isItemEqualToValue:w},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:X,setOpen:X,handleScrollArrowVisibility:X,onOpenChangeComplete:X,listRef:U,popupRef:ne,scrollHandlerRef:re,scrollArrowsMountedCountRef:ie,valueRef:W,valuesRef:ae,labelsRef:te,typingRef:oe,selectionRef:ce,firstItemTextRef:G,selectedItemTextRef:se,alignItemWithTriggerActiveRef:le,initialValueRef:ue},gl)).current,[pe,he]=i.useState(!1),{mounted:ge,transitionStatus:_e,forceUnmount:ve}=ms({open:H,ref:ne,preventUnmountOnClose:pe,setPreventUnmountOnClose:he,onUnmount(){K.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),y?.(!1)}}),ye=K.useState(`activeIndex`),be=K.useState(`selectedIndex`),Se=K.useState(`triggerElement`),Ce=K.useState(`positionerElement`),we=ao(de),Te=de??we,Ee=i.useMemo(()=>x?``:pl(B,C),[x,B,C]),De=i.useMemo(()=>x&&Array.isArray(B)?B.map(e=>pl(e,C)):pl(B,C),[x,B,C]);Yi(oo(Se),L,B,q(()=>De),!R,u);let Oe=x?Array.isArray(B)&&B.length>0:B!=null&&Ee!==``;J(()=>{M(Oe)},[Oe,M]),J(function(){let e=il(ae.current,B,w,x);e===null&&(se.current=null),!H&&K.set(`selectedIndex`,e)},[x,H,B,w,K]),Xi(B,()=>{D(z),O(el(B,j.initialValue,w)),F.change(B)});let ke=q((e,t)=>{let n=t,r=bs(n);c?.(e,n),!t.isCanceled&&(e||he(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(k(!0),A(!1),I===`onBlur`&&F.commit(B)))});i.useImperativeHandle(_,()=>({unmount:ve,close:()=>{K.state.open&&ke(!1,Zi(ua))}}),[ve,ke,K]);let Ae=q((e,t)=>{a?.(e,t),!t.isCanceled&&V(e)}),je=q(e=>{let t=xl(e.scrollHeight,e.clientHeight),n=Sl(e.scrollTop,t),r=n>0,i=n<t;K.set(`scrollUpArrowVisible`,r),K.set(`scrollDownArrowVisible`,i)}),Me=Fs({open:H,onOpenChange:ke,elements:{reference:Se,floating:Ce}}),Ne=ls(Me,{enabled:!R,event:`mousedown`}),Pe=fs(Me),Fe=Hs(Me,{enabled:!R,listRef:U,activeIndex:ye,selectedIndex:be,disabledIndices:Qe,onNavigate(e){(e!==null||H)&&K.set(`activeIndex`,e)},focusItemOnHover:T}),Ie=Us(Me,{enabled:!R&&(H||!m&&!x),listRef:te,activeIndex:ye,selectedIndex:be,disabledIndices:e=>Na(U.current[e]),onMatch(e){H?K.set(`activeIndex`,e):Ae(ae.current[e],Zi(Qi))},onTyping(e){oe.current=e}}),Le=i.useMemo(()=>xe(Ie.reference,Fe.reference,Pe.reference,Ne.reference,fe),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,fe]),Re=i.useMemo(()=>xe(hs,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),Y=Fe.item??$e,ze=i.useMemo(()=>({props:Y,multiple:x,disabled:R,readOnly:m,isItemEqualToValue:w}),[Y,x,R,m,w]);K.useContextCallback(`setValue`,Ae),K.useContextCallback(`setOpen`,ke),K.useContextCallback(`handleScrollArrowVisibility`,je),K.useContextCallback(`onOpenChangeComplete`,y),io(()=>{K.update({popupProps:Re,triggerProps:Le,itemRoot:ze})}),K.useSyncedValues({id:L,modal:g,multiple:x,disabled:R,readOnly:m,required:h,highlightItemOnHover:T,value:B,open:H,mounted:ge,transitionStatus:_e,popupProps:Re,triggerProps:Le,itemRoot:ze,items:b,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:Te});let Be=Ue(v,F.inputRef),Ve=x?void 0:z,He=i.useMemo(()=>!x||!Array.isArray(B)||!z?null:B.map(e=>{let t=pl(e,C);return(0,l.jsx)(`input`,{type:`hidden`,form:d,name:z,value:t,disabled:R},t)}),[x,B,d,z,C,R]);return(0,l.jsxs)(qc.Provider,{value:K,children:[(0,l.jsx)(Jc.Provider,{value:Me,children:E}),(0,l.jsx)(`input`,{...F.getValidationProps(R,{onFocus(){K.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||R||m)return;let t=e.currentTarget.value,n=Zi(Qi,e.nativeEvent);function r(){if(x)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>pl(t,C).toLowerCase()===e||fl(t,S).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=te.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&Ae(i,n)}K.set(`forceMount`,!0),queueMicrotask(r)}}),id:L&&Ve==null?`${L}-hidden-input`:void 0,form:d,name:Ve,autoComplete:f,value:Ee,disabled:R,required:h&&!(x&&Oe),readOnly:m,ref:Be,style:z?ro:no,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}function wl(e,t){return e??t}var Tl=5;function El(e,t){let n=Dl(t);return e.clientX>=n.left-Tl&&e.clientX<=n.right+Tl&&e.clientY>=n.top-Tl&&e.clientY<=n.bottom+Tl}function Dl(e){let t=e.getBoundingClientRect(),n=I(e);if(Un)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var Ol=`data-popup-side`,kl=400,Al={...mr,...hn,popupSide:e=>e?{[Ol]:e}:null,value:()=>null},jl=i.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,validationMode:d,validation:f,state:p,disabled:m}=vn(),{labelId:h}=On(),g=Yc(),_=g.useState(`readOnly`),v=g.useState(`required`),y=g.useState(`disabled`),b=m||y||o,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=a??O,N=wl(h,k);kn({id:a});let P=oo(T),F=i.useRef(null),I=Ji(b,F),{getButtonProps:L,buttonRef:R}=Be({disabled:b,native:s}),z=g.useStateSetter(`triggerElement`),B=Ii(),V=Ii(),H=Ii();i.useEffect(()=>{if(x)return H.start(kl,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{H.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,g,V,H]);let ee=xe(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??xr(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){I(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,Zi(Qi,e.nativeEvent)),B.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){$(T,e.relatedTarget)||(u(!0),I(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=Y(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;$(F.current,t)||$(P.current,t)||El(e,F.current)||g.context.setOpen(!1,Zi(oa,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},l,L),U=f.getValidationProps(b,ee);U.role=`combobox`;let te={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return Z(`button`,e,{ref:[t,F,R,z],state:te,stateAttributesMapping:Al,props:U})}),Ml={value:()=>null},Nl=i.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Yc(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?hl(l,u,d):ml(l,u,d)),Z(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:Ml})}),Pl=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Z(`span`,e,{state:{open:Yc().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:pr})}),Fl=i.forwardRef(function(e,t){let n=Yc(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,l.jsx)(Jo,{ref:t,...e}):null});function Il(e){let{nodeId:t,externalTree:n,rootContext:r}=e,a=r.useState(`referenceElement`),o=r.useState(`floatingElement`),s=r.useState(`domReferenceElement`),c=r.useState(`open`),l=r.useState(`floatingId`),[u,d]=i.useState(null),f=i.useRef(null),p=$o(n),m=i.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),h=Vc({...e,elements:{...m,...u&&{reference:u}}}),g=i.useCallback(e=>{let t=z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),h.refs.setReference(t)},[h.refs]),_=i.useMemo(()=>({...h.refs,setPositionReference:g,domReference:f}),[h.refs,g]),v=i.useMemo(()=>({...h.elements,domReference:s}),[h.elements,s]),y=i.useMemo(()=>({...h,dataRef:r.context.dataRef,open:c,onOpenChange:r.setOpen,events:r.context.events,floatingId:l,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,c,l]);return J(()=>{s&&(f.current=s)},[s]),J(()=>{r.context.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),i.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var Ll=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}=Lr(e,t)||{};if(l==null)return{};let d=ti(u),f={x:n,y:r},p=Ur(i),m=Vr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Ir(D,k,O),j=!c.arrow&&zr(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Rl=(e,t)=>{let{name:n,fn:r}=Ll(e);return{name:n,fn:r,options:[e,t]}},zl={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,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Bl={sideX:`left`,sideY:`top`},Vl=`--available-width`,Hl=`--available-height`,Ul=`--anchor-width`,Wl=`--anchor-height`,Gl=`--transform-origin`,Kl=Vl,ql=Hl;function Jl(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 Yl(e,t,n){let{rects:r,placement:i}=e;return{side:Jl(t,Rr(i),n),align:zr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Xl(e){return Zl(e,Il)}function Zl(e,t){let{anchor:n,positionMethod:r=`absolute`,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=q(k),j=k?A:n,M=oo(n),N=oo(_),P=qa()===`rtl`,[F,L]=i.useState(null);!_&&F!==null&&L(null);let R=S===`placement`,z=F?Rr(F):null,B=F&&R?zr(F)||`center`:null,V=z||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[a],H=B||s,ee=H===`center`?V:`${V}-${H}`,U=u;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let te=+(a===`bottom`),ne=+(a===`top`),re=+(a===`right`),ie=+(a===`left`),W={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:U},ae=i.useRef(null),oe=oo(o),G=oo(c),se=typeof o==`function`?0:o,ce=typeof c==`function`?0:c,le=[];m&&le.push(m),le.push(Hc(e=>{let t=Yl(e,a,P),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof G.current==`function`?G.current(t):G.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,P,a]));let ue=T===`none`&&w!==`shift`,de=!ue&&(d||D||w===`shift`),fe=w===`none`?null:Gc({...W,padding:{top:U.top+1+te,right:U.right+1+ie,bottom:U.bottom+1+ne,left:U.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),K=ue?null:Uc({...W,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:d||D?void 0:Wc(e=>{if(!ae.current)return{};let{width:t,height:n}=ae.current.getBoundingClientRect(),r=Hr(Rr(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[W,d,D,O,U,T]);w===`shift`||T===`shift`||H===`center`?le.push(K,fe):le.push(fe,K),le.push(Kc({...W,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Kl,`${t}px`),i.setProperty(ql,`${n}px`);let a=I(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ul,`${u}px`),i.setProperty(Wl,`${d}px`)}}),Rl(e=>({element:ae.current||Y(e.elements.floating).createElement(`div`),padding:ae.current?f:0}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:i,rects:s,y:c}=e,l=Rr(r),u=zr(r),d=Hr(l)===`y`,f=ae.current,p=typeof o==`function`?o(Yl(e,a,P)):o,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&i.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Gl,d?`${m} ${h}`:`${h} ${m}`),{}}},zl,x),J(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=i.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:ee,middleware:le,strategy:r,whileElementsMounted:h?void 0:(...e)=>kc(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Bl,Ee=Se?r:`fixed`,De=i.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Kl]=`100vw`,e[ql]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=i.useRef(null);J(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=(Ql(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,j,M]),i.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&Ql(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,j,M]),i.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return kc(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Rr(be),Ae=Jl(a,ke,P),je=zr(be)||`center`,Me=!!ve.hide?.referenceHidden;J(()=>{S&&_&&Se&&(ke!==V||R&&je!==H)&&L(be)},[S,R,_,Se,be,ke,je,V,H]);let Ne=i.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return i.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ae,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,ae,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function Ql(e){return e!=null&&`current`in e}var $l=i.createContext(void 0);function eu(){let e=i.useContext($l);if(!e)throw Error(Fe(59));return e}var tu=i.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,l.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function nu(e,t){e&&Object.assign(e.style,t)}var ru={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function iu(e){return e===`starting`?Vo:$e}function au(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Z(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},iu(r),i],stateAttributesMapping:hr})}var ou={},su={},cu=``;function lu(e,t){return H(e)?e:t}function uu(e,t,n){return/hidden|clip/.test(e.getComputedStyle(lu(t,n)).overflowY)}function du(e){if(typeof document>`u`)return!1;let t=Y(e);return I(t).innerWidth-t.documentElement.clientWidth>0}function fu(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=lu(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function pu(e){let t=Y(e),n=t.documentElement,r=t.body,i=lu(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function mu(e){let t=Y(e),n=t.documentElement,r=t.body,i=I(n),a=0,o=0,s=!1,c=zi.create();if(Vn&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,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 u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=lu(n,r);s=fu(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`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),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=cu)}function d(){u(),c.request(l)}l();let f=To(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var hu=new class{lockCount=0;restore=null;timeoutLock=Fi.create();timeoutUnlock=Fi.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=Y(e),n=t.documentElement,r=t.body,i=I(n);if(uu(i,n,r)){let t=new i.MutationObserver(()=>{uu(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=In||!du(e);this.restore=a?pu(e):mu(e)}};function gu(e=!0,t=null){J(()=>{if(e)return hu.acquire(t)},[e,t])}var _u=20;function vu(e,t,n,r){let[a,o]=i.useState(!1);J(()=>{if(!e||!t||n==null){o(!1);return}let r=Y(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-_u)},[e,t,n]),gu(e&&(!t||a),r)}var yu={position:`fixed`},bu=i.forwardRef(function(e,t){let{anchor:n,className:r,render:a,positionMethod:o,side:s,align:c,sideOffset:u,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m,sticky:h,disableAnchorTracking:g,alignItemWithTrigger:_=!0,collisionAvoidance:v=Ho,style:y,...b}=e,x=Yc(),S=Xc(),C=x.useState(`open`),w=x.useState(`mounted`),T=x.useState(`modal`),E=x.useState(`value`),D=x.useState(`openMethod`),O=x.useState(`positionerElement`),k=x.useState(`triggerElement`),A=x.useState(`isItemEqualToValue`),j=x.useState(`transitionStatus`),M=i.useRef(null),N=i.useRef(null),[P,F]=i.useState(_),I=w&&P&&D!==`touch`;!w&&P!==_&&F(_),i.useImperativeHandle(x.context.alignItemWithTriggerActiveRef,()=>I),vu((I||T)&&C,D===`touch`,O,k);let L=Xl({anchor:n,floatingRootContext:S,positionMethod:o,mounted:w,side:s,sideOffset:u,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g??I,collisionAvoidance:v,keepMounted:!0}),R=I?`none`:L.side,z=I?yu:L.positionerStyles,B={open:C,side:R,align:L.align,anchorHidden:L.anchorHidden};J(()=>{x.set(`popupSide`,L.side)},[x,L.side]);let V=au(e,B,{styles:z,transitionStatus:j,props:b,refs:[t,x.useStateSetter(`positionerElement`)],hidden:!w,inert:!C}),H=i.useRef(0),ee=q(e=>{if(x.context.valuesRef.current.length===0)return;let t=H.current;H.current=e.size;let n=Zi(Qi);if(t!==0&&!x.state.multiple&&E!==null&&nl(x.context.valuesRef.current,E,A)===-1){let e=x.context.initialValueRef.current,t=e!=null&&nl(x.context.valuesRef.current,e,A)!==-1?e:null;x.context.setValue(t,n),t===null&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(E)){let e=E.filter(e=>nl(x.context.valuesRef.current,e,A)!==-1);e.length!==E.length&&(x.context.setValue(e,n),e.length===0&&(x.set(`selectedIndex`,null),x.context.selectedItemTextRef.current=null))}if(C&&I){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};nu(O,e),nu(x.context.popupRef.current,e)}}),U=i.useMemo(()=>({...L,side:R,alignItemWithTriggerActive:I,setControlledAlignItemWithTrigger:F,scrollUpArrowRef:M,scrollDownArrowRef:N}),[L,R,I,F]);return(0,l.jsx)(va,{elementsRef:x.context.listRef,labelsRef:x.context.labelsRef,onMapChange:ee,children:(0,l.jsxs)($l.Provider,{value:U,children:[w&&T&&(0,l.jsx)(tu,{inert:Ma(!C),cutout:k}),V]})})}),xu=`base-ui-disable-scrollbar`,Su={className:xu,getElement(e){return(0,l.jsx)(`style`,{nonce:e,href:xu,precedence:`base-ui:low`,children:`.${xu}{scrollbar-width:none}.${xu}::-webkit-scrollbar{display:none}`})}},Cu=i.createContext(void 0);function wu(e){let t=i.useContext(Cu);if(t===void 0&&!e)throw Error(Fe(69));return t}var Tu=`--transform-origin`,Eu={...hr,...nr},Du=i.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,c=Yc(),u=c.useState(`multiple`),d=c.useState(`readOnly`),f=c.useState(`highlightItemOnHover`),p=Xc(),{side:m,align:h,alignItemWithTriggerActive:g,isPositioned:_,setControlledAlignItemWithTrigger:v}=eu(),y=wu(!0)!=null,b=qa(),{nonce:x,disableStyleElements:S}=ja(),C=c.useState(`id`),w=c.useState(`open`),T=c.useState(`openMethod`),E=c.useState(`mounted`),D=c.useState(`popupProps`),O=c.useState(`transitionStatus`),k=c.useState(`triggerElement`),A=c.useState(`positionerElement`),j=c.useState(`listElement`),M=i.useRef(!1),N=i.useRef(!1),P=i.useRef({}),F=Bi(),L=q(e=>{if(!A||!c.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!g||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=Au(A),i=ju(A.getBoundingClientRect().height,`y`,r),a=Y(A),o=I(A),s=o.getComputedStyle(A),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Ou(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=ku(e),h=null,_=e=>{A.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=bl(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(M.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),h!=null){let t=bl(h,0,ku(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),c.context.handleScrollArrowVisibility(e)});i.useImperativeHandle(c.context.scrollHandlerRef,()=>L,[L]),Ki({open:w,ref:c.context.popupRef,onComplete(){w&&c.context.onOpenChangeComplete(!0)}});let R={open:w,transitionStatus:O,side:m,align:h};J(()=>{A&&c.context.popupRef.current&&!Object.keys(P.current).length&&(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[c,A]),J(()=>{w||g||(N.current=!1,M.current=!1,nu(A,P.current))},[w,g,A]),J(()=>{let e=c.context.popupRef.current;if(!w||!k||!A||!e||g&&!_||c.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(Tu),!g){F.request(()=>c.context.handleScrollArrowVisibility(j||e));return}let t=Pu(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=I(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=Y(k),s=Au(k),l=Mu(k.getBoundingClientRect(),s),u=Mu(A.getBoundingClientRect(),s),d=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,y=parseFloat(i.minHeight)||100,x=Ou(a),S=o.documentElement.clientHeight-g-_,C=o.documentElement.clientWidth,w=S-l.bottom+d,T,E=b===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=Mu(n.getBoundingClientRect(),s);T=Mu(t.getBoundingClientRect(),s),E=u.left+(b===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let O=w+D+_+h,N=Math.min(S,O),F=S-g-_,L=O-N,R=C-5;A.style.left=`${bl(E,5,R-u.width)}px`,A.style.height=`${N}px`,A.style.maxHeight=`none`,A.style.marginTop=`${g}px`,A.style.marginBottom=`${_}px`,e.style.height=`100%`;let z=ku(p),B=L>=z-1;B&&(N=Math.min(S,u.height)-(L-z));let V=l.top<20||l.bottom>S-20||Math.ceil(N)+1<Math.min(m,y),H=(r.visualViewport?.scale??1)!==1&&Vn;if(V||H){nu(A,P.current),v(!1);return}let ee=Math.max(y,N);if(B){let e=Math.max(0,S-O);A.style.top=u.height>=F?`0`:`${e}px`,A.style.height=`${N}px`,p.scrollTop=ku(p)}else A.style.bottom=`0`,p.scrollTop=L;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=bl(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Tu,`50% ${i}%`)}(ee===S||N>=x)&&(M.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,w,A,k,g,v,F,j,f,b,_]),i.useEffect(()=>{if(!g||!A||!w)return;let e=I(A);function t(e){c.context.setOpen(!1,Zi(da,e))}return To(e,`resize`,t)},[c,g,A,w]);let z={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":u||void 0,"aria-readonly":d||void 0,id:`${C}-list`},onKeyDown(e){y&&za.has(e.key)&&e.stopPropagation()},onScroll(e){j||L(e.currentTarget)},...g&&{style:j?{height:`100%`}:ru},className:!j&&g?Su.className:void 0},B=Z(`div`,e,{ref:[t,c.context.popupRef],state:R,stateAttributesMapping:Eu,props:[D,z,iu(O),s]});return(0,l.jsxs)(i.Fragment,{children:[!S&&Su.getElement(x),(0,l.jsx)(cs,{context:p,modal:!1,disabled:!E,openInteractionType:T,returnFocus:o,restoreFocus:!0,children:B})]})});function Ou(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function ku(e){return xl(e.scrollHeight,e.clientHeight)}function Au(e){return Ec.getScale(e)}function ju(e,t,n){return e/n[t]}function Mu(e,t){return ni({x:ju(e.x,`x`,t),y:ju(e.y,`y`,t),width:ju(e.width,`x`,t),height:ju(e.height,`y`,t)})}var Nu=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Pu(e){let{style:t}=e,n={};for(let[e,r]of Nu)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Nu){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Fu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Yc(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=eu(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:ru},className:u&&d!==`touch`?Su.className:void 0};return Z(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),Iu=i.createContext(void 0);function Lu(){let e=i.useContext(Iu);if(!e)throw Error(Fe(57));return e}var Ru=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,value:o=null,label:s,disabled:c=!1,nativeButton:u=!1,...d}=e,f=i.useRef(null),p=Ta({guess:!0,label:s,textRef:f}),m=Yc(),{props:h,multiple:g,disabled:_,readOnly:v,isItemEqualToValue:y}=m.useState(`itemRoot`),b=_||c,x=m.useState(`isActive`,p.index),S=m.useState(`open`),C=m.useState(`isSelected`,o),w=m.useState(`isSelectedByFocus`,p.index),T=p.index,E=i.useRef(null);J(()=>{let e=m.context.valuesRef.current;return e[T]=o,()=>{delete e[T]}},[T,o,m]),J(()=>{let e=m.state.value,t=m.state.selectedIndex,n=t,r;g&&Array.isArray(e)?(n=al(T,o,m.context.valuesRef.current,e,y,t),r=n===T,T===t&&!r&&(m.context.selectedItemTextRef.current=null)):(r=e!==void 0&&$c(o,e,y),r&&(n=T)),m.set(`selectedIndex`,n),r&&f.current&&(m.context.selectedItemTextRef.current=f.current)},[T,g,y,m,o]);let D=i.useRef(`mouse`),O=i.useRef(!1),{getButtonProps:k,buttonRef:A}=Be({disabled:b,focusableWhenDisabled:!0,native:u,composite:!0}),j={disabled:b,selected:C,highlighted:x};function M(e){if(_||v)return;let t=m.state.value;if(g){let n=Array.isArray(t)?t:[],r=C?ol(n,o,y):[...n,o];m.context.setValue(r,Zi(ta,e))}else m.context.setValue(o,Zi(ta,e)),m.context.setOpen(!1,Zi(ta,e))}function N(){m.context.selectionRef.current.dragY=0}let P={role:`option`,"aria-selected":C,tabIndex:S&&x?0:-1,onKeyDown(e){m.set(`activeIndex`,T),e.key===` `&&m.context.typingRef.current&&e.preventDefault()},onClick(e){let t=D.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Er(e.nativeEvent)&&(n!==void 0||x),i=t&&!r&&!O.current;O.current=!1,!(b||i)&&M(e.nativeEvent)},onPointerEnter(e){D.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=m.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){D.current=e.pointerType,O.current=!0,N()},onMouseUp(){if(N(),b||D.current===`touch`||O.current)return;let e=!m.context.selectionRef.current.allowSelectedMouseUp&&C,t=!m.context.selectionRef.current.allowUnselectedMouseUp&&!C;e||t||(O.current=!0,E.current?.click(),O.current=!1)}},F=Z(`div`,e,{ref:[A,t,p.ref,E],state:j,props:[h,P,d,k]}),I=i.useMemo(()=>({selected:C,index:T,textRef:f,selectedByFocus:w}),[C,T,f,w]);return(0,l.jsx)(Iu.Provider,{value:I,children:F})})),zu=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,keepMounted:o,selected:s,...c}=e,l=i.useRef(null),{transitionStatus:u,setMounted:d}=qi(s),f=Z(`span`,e,{ref:[t,l],state:{selected:s,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},c],stateAttributesMapping:nr});return Ki({batch:!0,enabled:!s,open:s,ref:l,onComplete(){s||d(!1)}}),f})),Bu=i.forwardRef(function(e,t){let{selected:n}=Lu();return e.keepMounted||n?(0,l.jsx)(zu,{...e,selected:n,ref:t}):null}),Vu=i.memo(i.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:a}=Lu(),o=Yc(),{render:s,className:c,style:l,...u}=e;return Z(`div`,e,{ref:[i.useCallback(e=>{e&&(n===0&&(o.context.firstItemTextRef.current=e),a&&(o.context.selectedItemTextRef.current=e))},[o,n,a]),t,r],props:u})})),Hu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Yc(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=eu(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=Ii(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=qi(g);J(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),Ki({open:g,ref:v,onComplete(){g||x(!1)}});let S=Z(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=xl(e.scrollHeight,e.clientHeight),r=Sl(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=Uu(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:nr});return y||o?S:null});function Uu(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Sl(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Sl(l.offsetTop+l.offsetHeight-r+i,a):a}var Wu=i.forwardRef(function(e,t){return(0,l.jsx)(Hu,{...e,ref:t,direction:`down`})}),Gu=i.forwardRef(function(e,t){return(0,l.jsx)(Hu,{...e,ref:t,direction:`up`})}),Ku=Cl;function qu({className:e,...t}){return(0,l.jsx)(Nl,{"data-slot":`select-value`,className:Q(`flex flex-1 text-left`,e),...t})}function Ju({className:e,size:t=`default`,children:n,...r}){return(0,l.jsxs)(jl,{"data-slot":`select-trigger`,"data-size":t,className:Q(`flex w-fit items-center justify-between gap-1.5 rounded-none border border-input bg-transparent py-2 pr-2 pl-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,l.jsx)(Pl,{render:(0,l.jsx)(k,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Yu({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,l.jsx)(Fl,{children:(0,l.jsx)(bu,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,l.jsxs)(Du,{"data-slot":`select-content`,"data-align-trigger":o,className:Q(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,l.jsx)(Zu,{}),(0,l.jsx)(Fu,{children:t}),(0,l.jsx)(Qu,{})]})})})}function Xu({className:e,children:t,...n}){return(0,l.jsxs)(Ru,{"data-slot":`select-item`,className:Q(`relative flex w-full cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,l.jsx)(Vu,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,l.jsx)(Bu,{render:(0,l.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,l.jsx)(D,{className:`pointer-events-none`})})]})}function Zu({className:e,...t}){return(0,l.jsx)(Gu,{"data-slot":`select-scroll-up-button`,className:Q(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,l.jsx)(j,{})})}function Qu({className:e,...t}){return(0,l.jsx)(Wu,{"data-slot":`select-scroll-down-button`,className:Q(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,l.jsx)(k,{})})}var $u=i.createContext(void 0);function ed(e){let t=i.useContext($u);if(!e&&t===void 0)throw Error(Fe(27));return t}var td=i.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=ed(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Z(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:gr,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),nd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=ed(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Be({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Zi(na,e.nativeEvent))}return Z(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),rd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ed(),c=En(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Z(`p`,e,{ref:t,props:[{id:c},o]})}),id=i.createContext(void 0);function ad(){let e=i.useContext(id);if(e===void 0)throw Error(Fe(26));return e}var od=`--nested-dialogs`,sd=`data-nested-dialog-open`,cd={...hr,...nr,nestedDialogOpen(e){return e?{[sd]:``}:null}},ld=i.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=ed(),u=c.useState(`descriptionElementId`),d=c.useState(`disablePointerDismissal`),f=c.useState(`floatingRootContext`),p=c.useState(`popupProps`),m=c.useState(`modal`),h=c.useState(`mounted`),g=c.useState(`nested`),_=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),y=c.useState(`openMethod`),b=c.useState(`titleElementId`),x=c.useState(`transitionStatus`),S=c.useState(`role`),C=f.useState(`floatingId`);ad(),Ki({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?gs(c.context.popupRef):o,T=_>0,E=c.useStateSetter(`popupElement`),D=Z(`div`,e,{state:{open:v,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[p,{id:C,"aria-labelledby":b,"aria-describedby":u,role:S,...hs,hidden:!h,onKeyDown(e){za.has(e.key)&&e.stopPropagation()},style:{[od]:_}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:cd});return(0,l.jsx)(cs,{context:f,openInteractionType:y,disabled:!h,closeOnFocusOut:!d,initialFocus:w,returnFocus:a,modal:m!==!1,restoreFocus:`popup`,children:D})}),ud=i.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=ed(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,l.jsx)(id.Provider,{value:n,children:(0,l.jsxs)(Jo,{ref:t,...r,children:[a&&o===!0&&(0,l.jsx)(tu,{ref:i.context.internalBackdropRef,inert:Ma(!s)}),e.children]})}):null});function dd({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),a=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=i.useState(0),[f,p]=i.useState(0),m=u===0,h=fs(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Kn(t);if(m&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||$(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return gu(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),J(()=>{!r&&!a&&(d(0),p(0))},[r,a]),J(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),Cs(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var fd={...Ps,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},pd=class extends Co{constructor(e,t,n){let r=new Ts,i=md(e,r,t,n);super(i,hd(r),fd)}setOpen=(e,t)=>{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&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(ys(this.state,e,t.trigger)))}};function md(e,t,n,r=!1){return{...Os(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function hd(e){return{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function gd(e,t){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:d,handle:f,triggerId:p,defaultTriggerId:m=null}=t,h=e===`drawer`,g=e===`alert-dialog`,_=g?!0:u,v=g||c,y=g?`alertdialog`:`dialog`,b=ed(!0),x={modal:_,disablePointerDismissal:v,nested:b!=null,role:y},S=_s((e,t)=>new pd({open:a,openProp:r,activeTriggerId:m,triggerIdProp:p,...x},e,t),!0);S.useControlledProp(`openProp`,r),S.useControlledProp(`triggerIdProp`,p),S.useSyncedValues(x),S.useContextCallback(`onOpenChange`,o),S.useContextCallback(`onOpenChangeComplete`,s);let C=S.useState(`open`),w=S.useState(`mounted`),T=S.useState(`payload`);ws(S,C),xs(S);let{forceUnmount:E}=Ss(C,S);i.useImperativeHandle(d,()=>({unmount:E,close:()=>S.setOpen(!1,Zi(ua))}),[E,S]);let D=C||w||f!=null;return(0,l.jsxs)($u.Provider,{value:S,children:[f&&(0,l.jsx)(vs,{handle:f,store:S}),D&&(0,l.jsx)(dd,{store:S,parentContext:b?.context,isDrawer:h}),typeof n==`function`?n({payload:T}):n]})}var _d=ho(function(e){return gd(`dialog`,e)}),vd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ed(),c=En(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Z(`h2`,e,{ref:t,props:[{id:c},o]})});function yd({...e}){return(0,l.jsx)(_d,{"data-slot":`dialog`,...e})}function bd({...e}){return(0,l.jsx)(ud,{"data-slot":`dialog-portal`,...e})}function xd({className:e,...t}){return(0,l.jsx)(td,{"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Sd({className:e,children:t,showCloseButton:n=!0,...r}){return(0,l.jsxs)(bd,{children:[(0,l.jsx)(xd,{}),(0,l.jsxs)(ld,{"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,l.jsxs)(nd,{"data-slot":`dialog-close`,render:(0,l.jsx)(un,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,l.jsx)(N,{}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Cd({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`dialog-header`,className:Q(`flex flex-col gap-1 text-left`,e),...t})}function wd({className:e,showCloseButton:t=!1,children:n,...r}){return(0,l.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,l.jsx)(nd,{render:(0,l.jsx)(un,{variant:`outline`}),children:`Close`})]})}function Td({className:e,...t}){return(0,l.jsx)(vd,{"data-slot":`dialog-title`,className:Q(`font-heading text-sm font-medium`,e),...t})}function Ed({className:e,...t}){return(0,l.jsx)(rd,{"data-slot":`dialog-description`,className:Q(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Dd({className:e,containerClassName:t,...n}){return(0,l.jsx)(`div`,{"data-slot":`table-container`,className:Q(`relative w-full overflow-x-auto`,t),children:(0,l.jsx)(`table`,{"data-slot":`table`,className:Q(`w-full caption-bottom text-xs`,e),...n})})}function Od({className:e,...t}){return(0,l.jsx)(`thead`,{"data-slot":`table-header`,className:Q(`[&_tr]:border-b`,e),...t})}function kd({className:e,...t}){return(0,l.jsx)(`tbody`,{"data-slot":`table-body`,className:Q(`[&_tr:last-child]:border-0`,e),...t})}function Ad({className:e,...t}){return(0,l.jsx)(`tr`,{"data-slot":`table-row`,className:Q(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function jd({className:e,...t}){return(0,l.jsx)(`th`,{"data-slot":`table-head`,className:Q(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function Md({className:e,...t}){return(0,l.jsx)(`td`,{"data-slot":`table-cell`,className:Q(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}var Nd=mt(`group/alert relative grid w-full gap-0.5 rounded-none border px-2.5 py-2 text-left text-xs has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Pd({className:e,variant:t,...n}){return(0,l.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Q(Nd({variant:t}),e),...n})}function Fd({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`alert-description`,className:Q(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-2`,e),...t})}function Id({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`empty`,className:Q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-none border-dashed p-6 text-center text-balance`,e),...t})}function Ld({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`empty-header`,className:Q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function Rd({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`empty-title`,className:Q(`font-heading text-sm font-medium`,e),...t})}function zd({className:e,...t}){return(0,l.jsx)(`div`,{"data-slot":`empty-description`,className:Q(`text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}async function Bd(e,t,n){let r=await fetch(`/api/`+e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?{}:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),signal:n,redirect:`error`});if(!r.headers.get(`content-type`)?.includes(`application/json`))throw Error(`Session expired. Sign in again through Cloudflare Access.`);let i=await r.json();if(!r.ok)throw Error(i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:`HTTP ${r.status}`);return i}var Vd=(e,t)=>`projects/${e.id}/${t}`;function Hd(e){return e instanceof Error?e.message:`Request failed`}function Ud(e){return e==null?`null`:Array.isArray(e)?`List · ${e.length}`:typeof e==`object`?`Object`:String(e).slice(0,2e3)}function Wd(e,t){let n={};return e.forEach((e,r)=>{let i=t(`m${r}`);if(![`value`,`omit`,`null`].includes(String(i)))throw Error(`Invalid value mode: ${e.name}`);if(i===`omit`){if(e.required&&!e.defaultMode)throw Error(`${e.name} is required`);return}if(i===`null`){if(!e.nullable)throw Error(`${e.name} cannot be null`);Object.defineProperty(n,e.name,{value:null,enumerable:!0,writable:!0,configurable:!0});return}let a=String(t(`v${r}`)??``),o=a;if(e.choices){let t=Number(a);if(!Number.isInteger(t)||t<0||t>=e.choices.length)throw Error(`Invalid ${e.name}`);o=e.choices[t]}else if(e.type===`number`||e.type===`integer`){let t=Number(a);if(!a.trim()||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)||e.minimum!==void 0&&t<e.minimum||e.maximum!==void 0&&t>e.maximum)throw Error(`Invalid number: ${e.name}`);o=t}else if(e.type===`boolean`){if(a!==`true`&&a!==`false`)throw Error(`Invalid boolean: ${e.name}`);o=a===`true`}else if([`object`,`array`,`json`].includes(e.type)&&(o=JSON.parse(a),e.type!==`json`&&(e.type===`array`?!Array.isArray(o):!o||typeof o!=`object`||Array.isArray(o))))throw Error(`Invalid ${e.type}: ${e.name}`);Object.defineProperty(n,e.name,{value:o,enumerable:!0,writable:!0,configurable:!0})}),n}function Gd(e){return Object.entries(e?.properties??{}).map(([t,n])=>{let r=n.anyOf??(Array.isArray(n.type)?n.type.map(e=>({type:e})):[n]),i={...n,...r.find(e=>e.type!==`null`)},a=r.some(e=>e.type===`null`||e.const===null),o=new Set(r.filter(e=>e.type!==`null`).map(e=>e.type)),s=n.enum??(r.every(e=>Object.hasOwn(e,`const`))?r.map(e=>e.const):i.enum);return{name:t,type:o.size===1&&typeof i.type==`string`?i.type:`json`,...a?{nullable:!0}:{},...typeof i.description==`string`?{description:i.description}:{},required:e.required?.includes(t),value:i.default,choices:s,minimum:i.minimum,maximum:i.maximum}})}function Kd(e){let t=(0,i.useContext)(u),n=e.startsWith(t.scope+`/`)?t.epoch:0,[r,a]=(0,i.useState)({path:e,loading:!0}),[o,s]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let t=new AbortController;return a(t=>t.path===e&&t.data!==void 0?{...t,error:void 0,loading:!0}:{path:e,loading:!0}),Bd(e,void 0,t.signal).then(n=>{t.signal.aborted||a({path:e,data:n,loading:!1})}).catch(n=>{t.signal.aborted||a({path:e,error:Hd(n),loading:!1})}),()=>t.abort()},[e,o,n]),(0,i.useEffect)(()=>{let e=0,t=()=>{let t=Date.now();document.visibilityState===`visible`&&t-e>500&&(e=t,s(e=>e+1))};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[]),{...r.path===e?r:{path:e,loading:!0},refresh:()=>s(e=>e+1)}}function qd({children:e}){return(0,l.jsx)(Pd,{variant:`destructive`,children:(0,l.jsx)(Fd,{children:e})})}function Jd({loading:e,error:t}){return t?(0,l.jsx)(qd,{children:t}):e?(0,l.jsx)(`p`,{role:`status`,className:`p-4 text-xs text-muted-foreground`,children:`Loading…`}):null}function Yd({title:e,children:t}){return(0,l.jsx)(Id,{children:(0,l.jsxs)(Ld,{children:[(0,l.jsx)(Rd,{children:e}),t&&(0,l.jsx)(zd,{children:t})]})})}function Xd({value:e,onChange:t,items:n,label:r,className:i,name:a,disabled:o,id:s}){return(0,l.jsxs)(Ku,{name:a,disabled:o,value:e,onValueChange:e=>{e!==null&&t(e)},items:n,children:[(0,l.jsx)(Ju,{id:s,"aria-label":r,className:i,children:(0,l.jsx)(qu,{})}),(0,l.jsx)(Yu,{align:`start`,alignItemWithTrigger:!1,children:n.map(e=>(0,l.jsx)(Xu,{value:e.value,children:e.label},e.value))})]})}function Zd({rows:e,columns:t,labels:n={},renderCell:r}){return(0,l.jsxs)(Dd,{children:[(0,l.jsx)(Od,{children:(0,l.jsx)(Ad,{children:t.map(e=>(0,l.jsx)(jd,{children:n[e]??e},e))})}),(0,l.jsx)(kd,{children:e.slice(0,100).map((e,n)=>(0,l.jsx)(Ad,{children:t.map(t=>(0,l.jsx)(Md,{className:`max-w-sm truncate`,children:r?r(t,e[t]):[`at`,`dueAt`].includes(t)&&typeof e[t]==`number`?new Date(e[t]).toLocaleString():Ud(e[t])},t))},n))})]})}function Qd({value:e,depth:t=0}){if(t>4)return(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Nested value`});if(Array.isArray(e)){let n=e.slice(0,100);return n.length&&n.every(e=>e&&typeof e==`object`&&!Array.isArray(e))?(0,l.jsx)(Zd,{rows:n,columns:[...new Set(n.flatMap(e=>Object.keys(e)))].slice(0,40)}):e.length?(0,l.jsx)(`ol`,{className:`list-inside list-decimal space-y-2`,children:n.map((e,n)=>(0,l.jsx)(`li`,{children:(0,l.jsx)(Qd,{value:e,depth:t+1})},n))}):(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Empty list`})}return e&&typeof e==`object`?(0,l.jsx)(`dl`,{className:`grid grid-cols-[minmax(80px,auto)_1fr] gap-4`,children:Object.entries(e).slice(0,40).map(([e,n])=>(0,l.jsxs)(`div`,{className:`contents`,children:[(0,l.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,l.jsx)(`dd`,{className:`min-w-0 overflow-auto`,children:(0,l.jsx)(Qd,{value:n,depth:t+1})})]},e))}):(0,l.jsx)(`span`,{className:`break-all`,children:Ud(e)})}function $d({items:e}){return(0,l.jsxs)(Xa,{children:[!e.length&&(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No arguments required.`}),e.map((e,t)=>(0,l.jsx)(ef,{field:e,index:t},e.name))]})}function ef({field:e,index:t}){let n=e.value===null&&e.nullable?`null`:e.value===void 0&&(!e.required||e.defaultMode)?`omit`:`value`,[r,a]=(0,i.useState)(n),[o,s]=(0,i.useState)(e.choices?String(Math.max(0,e.choices.indexOf(e.value))):String(e.value===!0)),c=(0,i.useId)();return(0,l.jsxs)(Qa,{children:[(0,l.jsxs)($a,{htmlFor:c,children:[(0,l.jsxs)(`span`,{children:[e.name,e.required?` *`:``]}),(0,l.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:e.type})]}),(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.choices||e.type===`boolean`?(0,l.jsx)(Xd,{id:c,name:`v${t}`,label:e.name,className:`w-full`,disabled:r!==`value`,value:o,onChange:s,items:e.choices?e.choices.map((e,t)=>({value:String(t),label:String(e)})):[{value:`false`,label:`false`},{value:`true`,label:`true`}]}):[`object`,`array`,`json`].includes(e.type)?(0,l.jsx)(Ja,{id:c,name:`v${t}`,disabled:r!==`value`,defaultValue:e.value===void 0?``:JSON.stringify(e.value,null,2),placeholder:e.type===`json`?`JSON value`:e.type===`array`?`[]`:`{}`}):(0,l.jsx)(ma,{id:c,name:`v${t}`,type:e.type===`password`?`password`:[`number`,`integer`].includes(e.type)?`number`:`text`,autoComplete:e.type===`password`?`new-password`:void 0,minLength:e.type===`password`?6:void 0,maxLength:e.type===`password`?128:void 0,required:e.required&&r===`value`,step:e.type===`integer`?1:`any`,min:e.minimum,max:e.maximum,disabled:r!==`value`,defaultValue:e.value===null||e.value===void 0?``:String(e.value)})}),!e.required||e.defaultMode||e.nullable?(0,l.jsx)(Xd,{name:`m${t}`,className:`w-32 shrink-0`,label:`Value mode for ${e.name}`,value:r,onChange:a,items:[{value:`value`,label:`Value`},...!e.required||e.defaultMode?[{value:`omit`,label:e.defaultMode?`Default`:`Omit`}]:[],...e.nullable?[{value:`null`,label:`NULL`}]:[]]}):(0,l.jsx)(`input`,{type:`hidden`,name:`m${t}`,value:`value`})]}),e.description&&(0,l.jsx)(eo,{children:e.description})]})}function tf(e,t){let n=new FormData(e);return Wd(t,e=>n.get(e))}function nf({modal:e,onClose:t}){let[n,r]=(0,i.useState)(!1),[a,o]=(0,i.useState)(``);return(0,l.jsx)(yd,{open:!0,onOpenChange:e=>{!e&&!n&&t()},children:(0,l.jsxs)(Sd,{className:`max-h-[85vh] overflow-auto`,showCloseButton:!n,children:[(0,l.jsxs)(Cd,{children:[(0,l.jsx)(Td,{children:e.title}),(0,l.jsx)(Ed,{children:e.description})]}),(0,l.jsxs)(`form`,{className:`space-y-4`,onSubmit:async i=>{if(i.preventDefault(),!n){r(!0),o(``);try{let n=i.currentTarget;if(e.productionId&&new FormData(n).get(`confirm`)!==e.productionId)throw Error(`Project ID does not match`);await e.submit(n),t()}catch(e){o(Hd(e))}finally{r(!1)}}},children:[e.fields&&(0,l.jsx)($d,{items:e.fields}),` `,e.content,e.productionId&&(0,l.jsxs)(Qa,{children:[(0,l.jsx)($a,{htmlFor:`production-confirm`,children:`Production change: type project ID`}),(0,l.jsx)(`code`,{className:`block select-all`,children:e.productionId}),(0,l.jsx)(ma,{id:`production-confirm`,name:`confirm`,required:!0,autoComplete:`off`})]}),a&&(0,l.jsx)(qd,{children:a}),(0,l.jsxs)(wd,{children:[(0,l.jsx)(un,{type:`button`,variant:`outline`,disabled:n,onClick:t,children:`Cancel`}),(0,l.jsx)(un,{type:`submit`,variant:e.destructive?`destructive`:`default`,disabled:n,children:n?`Working…`:e.submitLabel??`Confirm`})]})]})]})})}export{qi as $,$a as A,c as At,Ha as B,yd as C,Le as Ct,Td as D,q as Dt,Cd as E,J as Et,La as F,va as G,Na as H,Pa as I,sa as J,ha as K,za as L,qa as M,Fa as N,Qa as O,T as Ot,Ia as P,Zi as Q,Ra as R,Ad as S,Ie as St,Ed as T,xe as Tt,Ma as U,Ua as V,Ta as W,ca as X,la as Y,Qi as Z,Dd as _,Qe as _t,nf as a,ci as at,jd as b,Be as bt,Qd as c,Qn as ct,Gd as d,Kn as dt,Ki as et,Wd as f,En as ft,Vd as g,Z as gt,Ud as h,mt as ht,$d as i,ri as it,Ja as j,Xa as k,d as kt,tf as l,Wn as lt,Hd as m,Q as mt,Yd as n,ai as nt,Zd as o,nr as ot,Bd as p,un as pt,ma as q,qd as r,ii as rt,Jd as s,$n as st,Xd as t,si as tt,Kd as u,$ as ut,kd as v,$e as vt,Sd as w,Fe as wt,Od as x,Y as xt,Md as y,Ue as yt,Ba as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./client.BeKNsjPN.js";import{At as n,Ot as r,S as i,_ as a,a as o,b as s,d as c,g as l,h as u,l as d,n as f,p,pt as m,s as h,u as g,v as _,x as v,y}from"./common.TAClb6G9.js";import{i as b,n as x,r as S,t as C}from"./input-group.DUp-h0xx.js";import{f as w,m as T,p as E,s as D}from"./index.astro_astro_type_script_index_0_lang.Blg5hU9g.js";var O={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};O.node;var k=r(O),A=e(t(),1),j=n();function M(e,t){return e.filter(e=>e.name!==`_id`&&e.name!==`_creationTime`).map(e=>{let n=c({properties:{[e.name]:e.schema??{type:/INT|REAL/i.test(e.type)?`number`:`string`}},required:e.notnull?[e.name]:[]})[0];return{...n,defaultMode:!t&&e.dflt_value!==null,value:t?t[e.name]:n.value}})}function N(e){let t=l(e.project,e.env),n=g(t+`/schema`),[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(``),s=n.data?.tables??[],c=s.find(e=>e.name===r)?.name??s[0]?.name;return(0,j.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,j.jsxs)(`section`,{className:`explorer-sidebar overflow-y-auto`,"aria-label":`Application tables`,children:[(0,j.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`h1`,{className:`page-title`,children:`Data`}),(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s.length,` tables`]})]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(x,{children:(0,j.jsx)(b,{})}),(0,j.jsx)(S,{"aria-label":`Search tables`,placeholder:`Search tables…`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,j.jsx)(`div`,{className:`space-y-1 px-2`,children:s.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())).map(e=>(0,j.jsxs)(m,{variant:`ghost`,className:`w-full justify-start gap-2 ${c===e.name?`bg-accent`:``}`,onClick:()=>i(e.name),children:[(0,j.jsx)(T,{}),e.name]},e.name))}),(0,j.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`Tables are defined in code.`})]}),(0,j.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,j.jsx)(h,{...n}),c?(0,j.jsx)(P,{...e,table:c},c):n.data?(0,j.jsx)(f,{title:`No application tables in this release`}):null]})]})}function P({project:e,env:t,session:n,table:r}){let[c,b]=(0,A.useState)(void 0),[x,S]=(0,A.useState)(),C=l(e,t),T=g(C+`/data?table=`+encodeURIComponent(r)+(c===void 0?``:`&cursor=`+encodeURIComponent(c))),O=T.data,N=O?.columns.find(e=>e.pk===1)?.name,P=n.role!==`viewer`,F=(n,i)=>{if(!O)return;let a=n===`delete`?void 0:M(O.columns,i);S({title:n===`insert`?`Add row`:n===`update`?`Edit row`:`Delete row`,description:n===`delete`?`This deletes the selected row. The change is audited.`:`Primary keys are immutable. NULL and defaults are explicit. Changes are revision-checked and audited.`,fields:a,productionId:t===`prod`?e.id:void 0,submit:async e=>{await p(C+`/edit`,{operation:n,table:r,key:i&&N?i[N]:void 0,values:a?d(e,a):void 0,expectedRevision:O.revision,confirm:t===`prod`?new FormData(e).get(`confirm`):void 0}),T.refresh()}})};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`detail-header`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:r}),O&&(0,j.jsxs)(D,{variant:`secondary`,children:[O.rows.length,` rows`]})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(m,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reload snapshot`,title:`Reload snapshot`,disabled:T.loading,onClick:T.refresh,children:(0,j.jsx)(w,{})}),P&&(0,j.jsxs)(m,{disabled:!O||T.loading,onClick:()=>F(`insert`),children:[(0,j.jsx)(E,{}),`Add row`]})]})]}),(0,j.jsxs)(`div`,{className:`flex justify-between border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(`span`,{children:O?`${O.columns.length} columns · revision ${O.revision}`:`Loading table`}),(0,j.jsx)(`span`,{children:`Snapshot · updates after edits and when returning to this tab`})]}),(0,j.jsx)(h,{...T}),O&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,"aria-label":`Table rows`,role:`region`,tabIndex:0,children:[(0,j.jsxs)(a,{containerClassName:`overflow-visible`,children:[(0,j.jsx)(v,{className:`sticky top-0 z-10 bg-background`,children:(0,j.jsxs)(i,{children:[O.columns.map(e=>(0,j.jsxs)(s,{children:[(0,j.jsx)(`span`,{children:e.name}),(0,j.jsxs)(`small`,{className:`block font-normal text-muted-foreground`,children:[e.type.toLowerCase(),e.pk?` · primary`:``]})]},e.name)),P&&(0,j.jsx)(s,{children:`Actions`})]})}),(0,j.jsx)(_,{children:O.rows.map((e,t)=>(0,j.jsxs)(i,{children:[O.columns.map(t=>(0,j.jsx)(y,{className:`max-w-sm truncate font-mono`,title:u(e[t.name]),children:u(e[t.name])},t.name)),P&&(0,j.jsx)(y,{children:N?(0,j.jsxs)(`div`,{className:`flex gap-1`,children:[(0,j.jsx)(m,{size:`xs`,variant:`ghost`,onClick:()=>F(`update`,e),disabled:T.loading,children:`Edit`}),(0,j.jsx)(m,{size:`xs`,variant:`destructive`,onClick:()=>F(`delete`,e),disabled:T.loading,children:`Delete`})]}):`Read only`})]},N?String(e[N]):t))})]}),!O.rows.length&&(0,j.jsx)(f,{title:`No rows yet`,children:`Add a row or call a mutation from your app.`})]}),(0,j.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-4 border-t p-4`,children:[(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Up to 50 rows per page · changes are audited`}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(m,{variant:`outline`,disabled:c===void 0||T.loading,onClick:()=>b(void 0),children:`First page`}),(0,j.jsxs)(m,{variant:`outline`,disabled:O.next===null||T.loading,onClick:()=>b(O.next??void 0),children:[`Next page`,(0,j.jsx)(k,{})]})]})]})]}),x&&(0,j.jsx)(o,{modal:x,onClose:()=>S(void 0)})]})}export{M as columnFields,N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./client.BeKNsjPN.js";import{At as n,Ot as r,c as i,d as a,g as o,i as s,l as c,m as l,n as u,p as d,pt as f,r as p,s as m,u as h}from"./common.TAClb6G9.js";import{i as g,n as _,r as v,t as y}from"./input-group.DUp-h0xx.js";import{a as b,c as x,d as S,h as C,l as w,o as T,u as E}from"./index.astro_astro_type_script_index_0_lang.Blg5hU9g.js";import{i as D,t as O}from"./client.BUUZgEFj.js";var k={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};k.node;var A=r(k),j={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};j.node;var M=r(j),N=e(t(),1),P=n();function F(e){let t=h(o(e.project,e.env)+`/functions`),[n,r]=(0,N.useState)(``),[i,a]=(0,N.useState)(``),s=Object.entries(t.data?.functions??{}),c=s.find(([e])=>e===i)??s[0],l=new Map;return s.filter(([e])=>e.toLowerCase().includes(n.toLowerCase())).forEach(e=>{let t=e[0].includes(`/`)?e[0].slice(0,e[0].lastIndexOf(`/`)):`Functions`,n=l.get(t)??[];n.push(e),l.set(t,n)}),(0,P.jsxs)(`div`,{className:`flex min-h-full`,children:[(0,P.jsxs)(`section`,{className:`explorer-sidebar`,"aria-label":`Deployed functions`,children:[(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Functions`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.length})]}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{children:(0,P.jsx)(g,{})}),(0,P.jsx)(v,{"aria-label":`Search functions`,placeholder:`Search functions…`,value:n,onChange:e=>r(e.target.value)})]})]}),(0,P.jsx)(`div`,{className:`space-y-2 px-2`,children:[...l].map(([e,t])=>(0,P.jsxs)(`details`,{open:!0,children:[(0,P.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-2 py-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(A,{className:`size-4`}),e]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:t.map(([e,t])=>(0,P.jsxs)(f,{variant:`ghost`,onClick:()=>a(e),className:`w-full justify-between ${c?.[0]===e?`bg-accent`:``}`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()}),(0,P.jsx)(b,{kind:t.kind})]},e))})]},e))}),(0,P.jsxs)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:[`Active release · `,e.env]})]}),(0,P.jsxs)(`section`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(m,{...t}),c?(0,P.jsx)(L,{...e,path:c[0],fn:c[1]},c[0]+`:`+JSON.stringify(c[1])):t.data?(0,P.jsx)(u,{title:`No deployed functions`}):null]})]})}function I(e,t,n){return e===`dev`&&t!==`viewer`&&[`query`,`mutation`,`action`].includes(n)}function L({project:e,env:t,session:n,path:r,fn:m}){let h=a(m.input),g=I(t,n.role,m.kind)&&m.auth!==`internal`,[_,v]=(0,N.useState)(!1),[y,k]=(0,N.useState)(``),[A,j]=(0,N.useState)(),[F,L]=(0,N.useState)(!1),[R,z]=(0,N.useState)(),B=(0,N.useRef)(!0),V=(0,N.useRef)(void 0),H=(0,N.useRef)(void 0);return(0,N.useEffect)(()=>(B.current=!0,()=>{B.current=!1,H.current?.abort(),V.current?.dispose()}),[]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`detail-header`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,P.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:r}),(0,P.jsx)(b,{kind:m.kind}),(0,P.jsx)(T,{status:m.auth,children:m.auth===`required`?`Authentication required`:m.auth})]}),(0,P.jsxs)(f,{type:`submit`,form:`function-run`,disabled:!g||_,children:[(0,P.jsx)(M,{}),_?`Running…`:`Run Function`]})]}),(0,P.jsxs)(x,{defaultValue:`runner`,children:[(0,P.jsxs)(E,{variant:`line`,className:`mx-4 mt-4`,children:[(0,P.jsx)(S,{value:`runner`,children:`Function runner`}),(0,P.jsx)(S,{value:`contract`,children:`Contract`})]}),(0,P.jsx)(w,{value:`runner`,className:`mt-4`,children:(0,P.jsxs)(`div`,{className:`grid lg:grid-cols-2`,children:[(0,P.jsxs)(`section`,{className:`space-y-4 border-b p-4 lg:border-r lg:border-b-0`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Arguments`}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[h.length,` fields`]})]}),(0,P.jsx)(`form`,{id:`function-run`,onSubmit:async n=>{if(n.preventDefault(),!g||_||H.current)return;let i=new AbortController;H.current=i,v(!0),k(``),z(void 0),j(void 0),L(!1);try{let a=c(n.currentTarget,h),s=await d(o(e,t)+`/dev-token`,{},i.signal);if(!B.current||i.signal.aborted)return;V.current=O({url:s.url,getToken:()=>s.token});let l=performance.now(),u=await V.current[m.kind](D(r,m.kind),a);B.current&&!i.signal.aborted&&(j(u),L(!0),z(Math.round(performance.now()-l)))}catch(e){B.current&&!i.signal.aborted&&k(l(e))}finally{V.current?.dispose(),H.current===i&&(H.current=void 0),B.current&&v(!1)}},children:(0,P.jsx)(s,{items:h})}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Development execution only. Mutations and actions can change data. Live subscriptions use the SDK. Writes are not automatically retried. Internal functions are called only by server capabilities or scheduled jobs, not this HTTP runner.`})]}),(0,P.jsxs)(`section`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Result`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_?`Running…`:y?`Failed`:R===void 0?`Not executed`:`Completed · ${R} ms round trip`})]}),y?(0,P.jsx)(p,{children:y}):F?(0,P.jsx)(i,{value:A}):(0,P.jsx)(u,{title:`Run this function to see its result`,children:(0,P.jsx)(C,{className:`mx-auto mt-3 size-7`})})]})]})}),(0,P.jsxs)(w,{value:`contract`,className:`space-y-4 p-4`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Input contract`}),(0,P.jsx)(i,{value:m.input})]}),(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Output contract`}),(0,P.jsx)(i,{value:m.output})]})]})]})]})}export{I as canRun,F as default};
|