tokentracker-cli 0.24.3 → 0.24.4
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/dashboard/dist/assets/{Card-BbZjsVbp.js → Card-C5P77HSA.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-D-c3ggwu.js → DashboardPage-BmDIVEqD.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-CXQozcPu.js → DevicePage-BR0iqEnH.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-DS3-rZmS.js → FadeIn-DS1EdnSK.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-B_Yuqgy3.js → HeaderGithubStar-B1bXtzLa.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-DvlCxm7c.js → IpCheckPage-DYqbDHcj.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-Cn-IoNno.js → LandingPage-CDrzg33z.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-CbiPJJPx.js → LeaderboardPage-CdE8dhBk.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-Bu7B-2jw.js → LeaderboardProfilePage-5hMz6KaV.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-B3rB2mq-.js → LimitsPage-DwXAQxub.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-D1zPQFPk.js → LoginPage-jyNw3XdL.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-nCve1OvO.js → PopoverPopup-D7vJTWph.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-DG0e09V6.js → ProviderIcon-DzG-9xmE.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-CrNFjpAc.js → SettingsPage-C5Dv25qs.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-BLA6DLai.js → SkillsPage-wl3RJj-l.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-DKqL5elk.js → WidgetsPage-DRjH3Emk.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-27gR4t07.js → WrappedPage-QI8eoOBi.js} +1 -1
- package/dashboard/dist/assets/check-CIkqYG5R.js +1 -0
- package/dashboard/dist/assets/{chevron-down-BK0-QwAZ.js → chevron-down-DYcTqEa_.js} +1 -1
- package/dashboard/dist/assets/{download-CRxOcuuE.js → download-Bx3IHqEk.js} +1 -1
- package/dashboard/dist/assets/{info-BnCcU5DC.js → info--12E1Ss4.js} +1 -1
- package/dashboard/dist/assets/{leaderboard-columns-D8bOHQ2L.js → leaderboard-columns-BSN7ezk1.js} +1 -1
- package/dashboard/dist/assets/{main-B8I3fQYO.js → main-BcIQOEq-.js} +2 -2
- package/dashboard/dist/assets/{use-limits-display-prefs-24Huwh6X.js → use-limits-display-prefs-CzrWmFCp.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-D58BqQED.js → use-native-settings-DdNs1QHP.js} +1 -1
- package/dashboard/dist/assets/{use-reduced-motion-D02YRYVH.js → use-reduced-motion-Bq2cqn-e.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-D5J2sCWb.js → use-usage-limits-oNdrbXVB.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-CqZS-EuJ.js → useCurrency-B02Q_emH.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/lib/pricing/curated-overrides.json +25 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/check-CZwZBCWJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as qo,r as d,aD as zo,aE as Ko,C as ee,a9 as Ke}from"./main-B8I3fQYO.js";const ks=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dl=qo("chevron-right",ks);const Ms=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Nl=qo("loader-circle",Ms),Go={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Xo={...Go,position:"fixed",top:0,left:0},Bl={...Go,position:"absolute"},ao={};function ke(e,t){const n=d.useRef(ao);return n.current===ao&&(n.current=e(t)),n}function Ut(e,t,n,o){const r=ke(Zo).current;return Ls(r,e,t,n,o)&&Jo(r,[e,t,n,o]),r.callback}function As(e){const t=ke(Zo).current;return Fs(t,e)&&Jo(t,e),t.callback}function Zo(){return{callback:null,cleanup:null,refs:[]}}function Ls(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Fs(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Jo(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Ds=()=>{},se=typeof document<"u"?d.useLayoutEffect:Ds,fn=zo[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Ns=fn&&fn!==d.useLayoutEffect?fn:e=>e();function Y(e){const t=ke(Bs).current;return t.next=e,Ns(t.effect),t.trampoline}function Bs(){const e={next:void 0,callback:$s,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function $s(){}function De(e){const t=ke(Ws,e).current;return t.next=e,se(t.effect),t}function Ws(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ye(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}var qt=Symbol("NOT_FOUND");function Vs(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function js(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Hs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var lo=e=>Array.isArray(e)?e:[e];function _s(e){const t=Array.isArray(e[0])?e[0]:e;return Hs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ys(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Us(e){let t;return{get(n){return t&&e(t.key,n)?t.value:qt},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qs(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return qt}function r(a,c){o(a)===qt&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var zs=(e,t)=>e===t;function Ks(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Gs(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=zs,maxSize:r=1,resultEqualityCheck:s}=n,i=Ks(o);let a=0;const c=r<=1?Us(i):qs(r,i);function l(){let u=c.get(arguments);if(u===qt){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(g=>s(g.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Xs=class{constructor(e){this.value=e}deref(){return this.value}},Zs=typeof WeakRef<"u"?WeakRef:Xs,Js=0,uo=1;function Nt(){return{s:Js,v:void 0,o:null,p:null}}function Qo(e,t={}){let n=Nt();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}else{let m=a.p;m===null&&(a.p=m=new Map);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}}const l=a;let u;if(a.s===uo)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Zs(u):u}return l.s=uo,l.v=u,u}return i.clearCache=()=>{n=Nt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function er(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Vs(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Qo,argsMemoizeOptions:m=[]}=u,h=lo(p),v=lo(m),E=_s(r),b=f(function(){return s++,l.apply(null,arguments)},...h),R=g(function(){i++;const S=Ys(E,arguments);return a=b.apply(null,S),a},...v);return Object.assign(R,{resultFunc:l,memoizedResultFunc:b,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(o,{withTypes:()=>o}),o}var Qs=er(Qo),ei=Object.assign((e,t=Qs)=>{js(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>ei});er({memoize:Gs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const K=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(Ye(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var dn={exports:{}},pn={};var fo;function ti(){if(fo)return pn;fo=1;var e=Ko();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),m=o({inst:{value:g,getSnapshot:p}}),h=m[0].inst,v=m[1];return s(function(){h.value=g,h.getSnapshot=p,c(h)&&v({inst:h})},[f,g,p]),r(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),i(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,pn}var po;function tr(){return po||(po=1,dn.exports=ti()),dn.exports}var ni=tr(),gn={exports:{}},mn={};var go;function oi(){if(go)return mn;go=1;var e=Ko(),t=tr();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return mn.useSyncExternalStoreWithSelector=function(l,u,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function E(C){if(!b){if(b=!0,R=C,C=p(C),g!==void 0&&h.hasValue){var T=h.value;if(g(T,C))return y=T}return y=C}if(T=y,o(R,C))return T;var I=p(C);return g!==void 0&&g(T,I)?(R=C,T):(R=C,y=I)}var b=!1,R,y,S=f===void 0?null:f;return[function(){return E(u())},S===null?void 0:function(){return E(S())}]},[u,f,p,g]);var v=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},mn}var mo;function ri(){return mo||(mo=1,gn.exports=oi()),gn.exports}var si=ri();const ii=parseInt(d.version,10);function Wn(e){return ii>=e}const ci=Wn(19),ai=ci?ui:fi;function li(e,t,n,o,r){return ai(e,t,n,o,r)}function ui(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return ni.useSyncExternalStore(e.subscribe,s,s)}function fi(e,t,n,o,r){return si.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ot{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Ot.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Ot.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Ot.prototype.setState.call(this,t)}}function nr(){}const $l=Object.freeze([]),Ee=Object.freeze({});class Vn extends Ot{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return li(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=Y(n??nr);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const di=[];function jn(e){d.useEffect(e,di)}const Bt=null;class pi{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $t=new pi;class Fe{static create(){return new Fe}static request(t){return $t.request(t)}static cancel(t){return $t.cancel(t)}currentId=Bt;request(t){this.cancel(),this.currentId=$t.request(()=>{this.currentId=Bt,t()})}cancel=()=>{this.currentId!==Bt&&($t.cancel(this.currentId),this.currentId=Bt)};disposeEffect=()=>this.cancel}function Hn(){const e=ke(Fe.create).current;return jn(e.disposeEffect),e}const Ct=0;class Ge{static create(){return new Ge}currentId=Ct;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,n()},t)}isStarted(){return this.currentId!==Ct}clear=()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)};disposeEffect=()=>this.clear}function ot(){const e=ke(Ge.create).current;return jn(e.disposeEffect),e}function tn(){return typeof window<"u"}function Xe(e){return _n(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Be(e){var t;return(t=(_n(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _n(e){return tn()?e instanceof Node||e instanceof he(e).Node:!1}function ie(e){return tn()?e instanceof Element||e instanceof he(e).Element:!1}function me(e){return tn()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Cn(e){return!tn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function gi(e){return/^(table|td|th)$/.test(Xe(e))}function nn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const mi=/transform|translate|scale|rotate|perspective|filter/,hi=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let hn;function Yn(e){const t=ie(e)?Ce(e):e;return tt(t.transform)||tt(t.translate)||tt(t.scale)||tt(t.rotate)||tt(t.perspective)||!on()&&(tt(t.backdropFilter)||tt(t.filter))||mi.test(t.willChange||"")||hi.test(t.contain||"")}function bi(e){let t=He(e);for(;me(t)&&!je(t);){if(Yn(t))return t;if(nn(t))return null;t=He(t)}return null}function on(){return hn==null&&(hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hn}function je(e){return/^(html|body|#document)$/.test(Xe(e))}function Ce(e){return he(e).getComputedStyle(e)}function rn(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||Be(e);return Cn(t)?t.host:t}function or(e){const t=He(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:me(t)&&st(t)?t:or(t)}function qe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=or(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=he(r);if(s){const a=Tn(i);return t.concat(i,i.visualViewport||[],st(r)?r:[],a&&n?qe(a):[])}else return t.concat(r,qe(r,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const yt=typeof navigator<"u",bn=Ri(),rr=wi(),sr=xi(),vi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ir=bn.platform==="MacIntel"&&bn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(bn.platform),yi=yt&&/apple/i.test(navigator.vendor),On=yt&&/android/i.test(rr)||/android/i.test(sr);yt&&rr.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ei=sr.includes("jsdom/");function Ri(){if(!yt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xi(){if(!yt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function wi(){if(!yt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Pn="data-base-ui-focusable",cr="active",ar="selected",lr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wl="ArrowLeft",Vl="ArrowRight",jl="ArrowUp",Hl="ArrowDown";function ft(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Cn(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Si(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function ur(e){return me(e)&&e.matches(lr)}function ho(e){return e?e.getAttribute("role")==="combobox"&&ur(e):!1}function In(e){return e?e.hasAttribute(Pn)?e:e.querySelector(`[${Pn}]`)||e:null}function nt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...nt(e,r.id,n)])}function bo(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ci(e){e.preventDefault(),e.stopPropagation()}function Ti(e){return"nativeEvent"in e}function Oi(e){return e.mozInputSource===0&&e.isTrusted?!0:On&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Pi(e){return Ei?!1:!On&&e.width===0&&e.height===0||On&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Ii=["top","right","bottom","left"],ht=Math.min,we=Math.max,zt=Math.round,Wt=Math.floor,Ne=e=>({x:e,y:e}),ki={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(e,t,n){return we(e,ht(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Un(e){return e==="x"?"y":"x"}function qn(e){return e==="y"?"height":"width"}function Oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zn(e){return Un(Oe(e))}function Mi(e,t,n){n===void 0&&(n=!1);const o=Ze(e),r=zn(e),s=qn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kt(i)),[i,Kt(i)]}function Ai(e){const t=Kt(e);return[Mn(e),t,Mn(t)]}function Mn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vo=["left","right"],yo=["right","left"],Li=["top","bottom"],Fi=["bottom","top"];function Di(e,t,n){switch(e){case"top":case"bottom":return n?t?yo:vo:t?vo:yo;case"left":case"right":return t?Li:Fi;default:return[]}}function Ni(e,t,n,o){const r=Ze(e);let s=Di(Re(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Mn)))),s}function Kt(e){const t=Re(e);return ki[t]+e.slice(t.length)}function Bi(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?Bi(e):{top:e,right:e,bottom:e,left:e}}function Gt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var $i=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Xt=$i.join(","),pr=typeof Element>"u",bt=pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zt=!pr&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Jt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Jt(t.parentNode));return i},Wi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gr=function(t,n,o){if(Jt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Xt));return n&&bt.call(t,Xt)&&r.unshift(t),r=r.filter(o),r},Qt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Jt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Qt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=bt.call(i,Xt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Jt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var g=Qt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,g):r.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return r},mr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Wi(t))&&!mr(t)?0:t.tabIndex},Vi=function(t,n){var o=hr(t);return o<0&&n&&!mr(t)?0:o},ji=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},br=function(t){return t.tagName==="INPUT"},Hi=function(t){return br(t)&&t.type==="hidden"},_i=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Yi=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ui=function(t){if(!t.name)return!0;var n=t.form||Zt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Yi(r,t.form);return!s||s===t},qi=function(t){return br(t)&&t.type==="radio"},zi=function(t){return qi(t)&&!Ui(t)},Ki=function(t){var n,o=t&&Zt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=Zt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},Eo=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Gi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=bt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(bt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=Zt(t);if(l&&!l.shadowRoot&&r(l)===!0)return Eo(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Ki(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Eo(t);return!1},Xi=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return bt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},An=function(t,n){return!(n.disabled||Hi(n)||Gi(n,t)||_i(n)||Xi(n))},Ln=function(t,n){return!(zi(n)||hr(n)<0||!An(t,n))},Zi=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=Vi(a,i),l=i?vr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(ji).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},At=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:Ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Zi}):o=gr(t,n.includeContainer,Ln.bind(null,n)),vr(o)},Ji=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:An.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gr(t,n.includeContainer,An.bind(null,n)),o},yr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bt.call(t,Xt)===!1?!1:Ln(n,t)};const Et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Er(e,t){const n=At(e,Et()),o=n.length;if(o===0)return;const r=ft(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Kn(e){return Er(fe(e).body,1)||e}function Rr(e){return Er(fe(e).body,-1)||e}function xr(e,t){if(!e)return null;const n=At(fe(e).body,Et()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Qi(e){return xr(e,1)}function ec(e){return xr(e,-1)}function dt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function tc(e){At(e,Et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ro(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const nc={...zo};let xo=0;function oc(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(xo+=1,o(`${t}-${xo}`))},[n,t]),r}const wo=nc.useId;function Rt(e,t){if(wo!==void 0){const n=wo();return e??(t?`${t}-${n}`:n)}return oc(e,t)}function wr(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(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)}}}class rc{nodesRef={current:[]};events=wr();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Sr=d.createContext(null),Cr=d.createContext(null),it=()=>d.useContext(Sr)?.id||null,xt=e=>{const t=d.useContext(Cr);return e??t};function sc(e){const t=Rt(),n=xt(e),o=it();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function ic(e){const{children:t,id:n}=e,o=it();return ee.jsx(Sr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function cc(e){const{children:t,externalTree:n}=e,o=ke(()=>n??new rc).current;return ee.jsx(Cr.Provider,{value:o,children:t})}const ac=500,lc={style:{transition:"none"}},Tr="data-base-ui-click-trigger",_l={fallbackAxisSide:"none"},uc={fallbackAxisSide:"end"},fc={clipPath:"inset(50%)",position:"fixed",top:0,left:0},dc="none",ze="trigger-press",Se="trigger-hover",Or="outside-press",Yl="item-press",Ul="close-press",It="focus-out",Pr="escape-key",ql="list-navigation",zl="cancel-open",Ir="imperative-action",Kl="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=Ee;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function kt(e){return`data-base-ui-${e}`}function vn(e,t,n){if(n&&!mt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function ct(e){return e?.ownerDocument||document}const vt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{yi&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Xo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let So=0;function yn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(So);const s=()=>e?.focus({preventScroll:n});r?s():So=requestAnimationFrame(s)}const pt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Co(e){return e==="inert"?pt.inert:e==="aria-hidden"?pt["aria-hidden"]:pt.none}let Vt=new WeakSet,jt={},En=0;const kr=e=>e&&(e.host||kr(e.parentNode)),pc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=kr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function gc(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=pc(t,e),a=new Set,c=new Set(i),l=[];jt[r]||(jt[r]=new WeakMap);const u=jt[r];i.forEach(f),p(t),a.clear();function f(g){!g||a.has(g)||(a.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||c.has(g)||[].forEach.call(g.children,m=>{if(Xe(m)!=="script")if(a.has(m))p(m);else{const h=s?m.getAttribute(s):null,v=h!==null&&h!=="false",E=Co(s),b=(E.get(m)||0)+1,R=(u.get(m)||0)+1;E.set(m,b),u.set(m,R),l.push(m),b===1&&v&&Vt.add(m),R===1&&m.setAttribute(r,""),!v&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return En+=1,()=>{l.forEach(g=>{const m=Co(s),v=(m.get(g)||0)-1,E=(u.get(g)||0)-1;m.set(g,v),u.set(g,E),v||(!Vt.has(g)&&s&&g.removeAttribute(s),Vt.delete(g)),E||g.removeAttribute(r)}),En-=1,En||(pt.inert=new WeakMap,pt["aria-hidden"]=new WeakMap,pt.none=new WeakMap,Vt=new WeakSet,jt={})}}function mc(e,t=!1,n=!1){const o=fe(e[0]).body;return gc(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function To(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Wn(19)?n?.ref:t.ref)??null}function Fn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function hc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function bc(e,t){return typeof e=="function"?e(t):e}function vc(e,t){return typeof e=="function"?e(t):e}const Pt={};function Mr(e,t,n,o,r){let s={...Dn(e,Pt)};return t&&(s=Tt(s,t)),n&&(s=Tt(s,n)),o&&(s=Tt(s,o)),r&&(s=Tt(s,r)),s}function yc(e){if(e.length===0)return Pt;if(e.length===1)return Dn(e[0],Pt);let t={...Dn(e[0],Pt)};for(let n=1;n<e.length;n+=1)t=Tt(t,e[n]);return t}function Tt(e,t){return Ar(t)?t(e):Ec(e,t)}function Ec(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Fn(e.style,o);break}case"className":{e[n]=Lr(e.className,o);break}default:Rc(n,o)?e[n]=xc(e[n],o):e[n]=o}}return e}function Rc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function Ar(e){return typeof e=="function"}function Dn(e,t){return Ar(e)?e(t):e??Pt}function xc(e,t){return t?e?n=>{if(wc(n)){const r=n;Nn(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Nn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lr(e,t){return t?e?t+" "+e:t:e}function wc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Je(e,t,n={}){const o=t.render,r=Sc(t,n);if(n.enabled===!1)return null;const s=n.state??Ee;return Cc(e,o,r,s)}function Sc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Ee,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?bc(n,s):void 0,f=l?vc(o,s):void 0,p=l?hc(s,c):Ee,g=l?Fn(p,Array.isArray(a)?yc(a):a)??Ee:Ee;return typeof document<"u"&&(l?Array.isArray(i)?g.ref=As([g.ref,To(r),...i]):g.ref=Ut(g.ref,To(r),i):Ut(null,null)),l?(u!==void 0&&(g.className=Lr(g.className,u)),f!==void 0&&(g.style=Fn(g.style,f)),g):Ee}function Cc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Mr(n,t.props);return r.ref=n.ref,d.cloneElement(t,r)}if(e&&typeof e=="string")return Tc(e,n);throw new Error(Ye(8))}function Tc(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const Fr=d.createContext(null),Dr=()=>d.useContext(Fr),Oc=kt("portal");function Pc(e={}){const{ref:t,container:n,componentProps:o=Ee,elementProps:r,elementState:s}=e,i=Rt(),c=Dr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),g=Y(E=>{E!==null&&p(E)}),m=d.useRef(null);se(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}if(i==null)return;const E=(n&&(_n(n)?n:n.current))??c??document.body;if(E==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==E&&(m.current=E,p(null),u(E))},[n,c,i]);const h=Je("div",o,{ref:[t,g],state:s,props:[{id:i,[Oc]:""},r]});return{portalNode:f,portalSubtree:l&&h?Ke.createPortal(h,l):null}}const Nr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Pc({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),g=d.useRef(null),m=d.useRef(null),[h,v]=d.useState(null),E=h?.modal,b=h?.open,R=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||E)return;function S(C){l&&C.relatedTarget&&dt(C)&&(C.type==="focusin"?Ro:tc)(l)}return l.addEventListener("focusin",S,!0),l.addEventListener("focusout",S,!0),()=>{l.removeEventListener("focusin",S,!0),l.removeEventListener("focusout",S,!0)}},[l,E]),d.useEffect(()=>{!l||b||Ro(l)},[b,l]);const y=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:l,setFocusManagerState:v}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(Fr.Provider,{value:y,children:[R&&l&&ee.jsx(vt,{"data-type":"outside",ref:f,onFocus:S=>{if(dt(S,l))g.current?.focus();else{const C=h?h.domReference:null;Rr(C)?.focus()}}}),R&&l&&ee.jsx("span",{"aria-owns":l.id,style:fc}),l&&Ke.createPortal(o,l),R&&l&&ee.jsx(vt,{"data-type":"outside",ref:p,onFocus:S=>{if(dt(S,l))m.current?.focus();else{const C=h?h.domReference:null;Kn(C)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(It,S.nativeEvent))}}})]})]})});function Ve(e){return e==null?e:"current"in e?e.current:e}function Ic(e,t){const n=he(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Oo=20;let Ue=[];function Gn(){Ue=Ue.filter(e=>e.isConnected)}function kc(e){Gn(),e&&Xe(e)!=="body"&&(Ue.push(e),Ue.length>Oo&&(Ue=Ue.slice(-Oo)))}function Rn(){return Gn(),Ue[Ue.length-1]}function Mc(e){if(!e)return null;const t=Et();return yr(e,t)?e:At(e,t)[0]||e}function Ac(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ce(e).display!=="none"}function Po(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Et(),r=Ji(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return yr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Br(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,E=v.useState("open"),b=v.useState("domReferenceElement"),R=v.useState("floatingElement"),{events:y,dataRef:S}=v.context,C=Y(()=>S.current.floatingContext?.nodeId),T=Y(f),I=s===!1,N=ho(b)&&I,k=De(r),F=De(s),A=De(i),O=De(u),D=xt(h),P=Dr(),V=d.useRef(null),B=d.useRef(null),w=d.useRef(!1),L=d.useRef(!1),Q=d.useRef(!1),G=d.useRef(-1),X=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),q=Ut(_,m,P?.beforeInsideRef),J=Ut(ne,P?.afterInsideRef),de=ot(),pe=ot(),ge=Hn(),$e=P!=null,x=In(R),U=Y((M=x)=>M?At(M,Et()):[]),$=Y(M=>{const W=U(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(z){z.key==="Tab"&&re(x,ft(fe(x)))&&U().length===0&&!N&&Ci(z)}const W=fe(x);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,x,c,k,N,U,$]),d.useEffect(()=>{if(o||!R)return;function M(W){const z=xe(W),oe=U().indexOf(z);oe!==-1&&(G.current=oe)}return R.addEventListener("focusin",M),()=>{R.removeEventListener("focusin",M)}},[o,R,U]),d.useEffect(()=>{if(o||!E)return;const M=fe(x);function W(){Q.current=!1}function z(oe){const H=xe(oe),j=re(R,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",z,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",z,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,R,b,x,E,P]),d.useEffect(()=>{if(o||!l)return;function M(){L.current=!0,pe.start(0,()=>{L.current=!1})}function W(H){const j=H.relatedTarget,be=H.currentTarget,ae=xe(H);queueMicrotask(()=>{const We=C(),Qe=v.context.triggerElements,at=j?.hasAttribute(kt("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p)].includes(j),et=!(re(b,j)||re(R,j)||re(j,R)||re(P?.portalNode,j)||j!=null&&Qe.hasElement(j)||Qe.hasMatchingElement(ve=>re(ve,j))||at||D&&(nt(D.nodesRef.current,We).find(ve=>re(ve.context?.elements.floating,j)||re(ve.context?.elements.domReference,j))||bo(D.nodesRef.current,We).find(ve=>[ve.context?.elements.floating,In(ve.context?.elements.floating)].includes(j)||ve.context?.elements.domReference===j)));if(be===b&&x&&Po(x,k),a&&be!==b&&!Ac(ae)&&ft(fe(x))===fe(x).body){if(me(x)&&(x.focus(),a==="popup")){ge.request(()=>{x.focus()});return}const ve=G.current,Me=U(),Ae=Me[ve]||Me[Me.length-1]||x;me(Ae)&&Ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(N||!c)&&j&&et&&!L.current&&(N||j!==Rn())&&(w.current=!0,v.setOpen(!1,ce(It,H)))})}function z(){Q.current||(S.current.insideReactTree=!0,de.start(0,()=>{S.current.insideReactTree=!1}))}const te=me(b)?b:null,oe=[];if(!(!R&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),R&&(R.addEventListener("focusout",W),P&&(R.addEventListener("focusout",z,!0),oe.push(()=>{R.removeEventListener("focusout",z,!0)})),oe.push(()=>{R.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,R,x,c,D,P,v,l,a,U,N,C,k,S,de,pe,ge,p,g]),d.useEffect(()=>{if(o||!R||!E)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${kt("portal")}]`)||[]),z=(D?bo(D.nodesRef.current,C()):[]).find(H=>ho(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[R,z,...M,...T(),V.current,B.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p),N?b:null].filter(H=>H!=null),oe=mc(te,c||N);return()=>{oe()}},[E,o,b,R,c,k,P,N,D,C,T,p,g]),se(()=>{if(!E||o||!me(x))return;const M=fe(x),W=ft(M);queueMicrotask(()=>{const z=$(x),te=F.current,oe=typeof te=="function"?te(O.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=z[0]||x:H=Ve(oe),H=H||z[0]||x,!re(x,W)&&yn(H,{preventScroll:H===x})})},[o,E,x,I,$,F,O]),se(()=>{if(o||!x)return;const M=fe(x),W=ft(M);kc(W);function z(H){if(H.open||(X.current=Ic(H.nativeEvent,Z.current)),H.reason===Se&&H.nativeEvent.type==="mouseleave"&&(w.current=!0),H.reason===Or)if(H.nested)w.current=!1;else if(Oi(H.nativeEvent)||Pi(H.nativeEvent))w.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?w.current=!1:w.current=!0}}y.on("openchange",z);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Xo),$e&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(X.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||Rn();return ae&&ae.isConnected?ae:te}const be=b||Rn()||te;return Ve(j)||be}return()=>{y.off("openchange",z);const H=ft(M),j=re(R,H)||D&&nt(D.nodesRef.current,C(),!1).some(ae=>re(ae.context?.elements.floating,H)),be=oe();queueMicrotask(()=>{const ae=Mc(be),We=typeof A.current!="boolean";A.current&&!w.current&&me(ae)&&(!(!We&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,R,x,A,S,y,D,$e,b,C]),d.useEffect(()=>{queueMicrotask(()=>{w.current=!1})},[o]),d.useEffect(()=>{if(o||!E)return;function M(z){xe(z)?.closest(`[${Tr}]`)&&(L.current=!0)}const W=fe(x);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,E,x]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:E,onOpenChange:v.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,E,v,l,b]),se(()=>{if(!(o||!x))return Po(x,k),()=>{queueMicrotask(Gn)}},[o,x,k]);const ue=!o&&(c?!N:!0)&&($e||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(vt,{"data-type":"inside",ref:q,onFocus:M=>{if(c){const W=$();yn(W[W.length-1])}else P?.portalNode&&(w.current=!1,dt(M,P.portalNode)?Kn(b)?.focus():Ve(g??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(vt,{"data-type":"inside",ref:J,onFocus:M=>{c?yn($()[0]):P?.portalNode&&(l&&(w.current=!0),dt(M,P.portalNode)?Rr(b)?.focus():Ve(p??P.afterOutsideRef)?.focus())}})]})}function Lc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=Hn(),p=ot(),g=d.useMemo(()=>({onPointerDown(m){u.current=m.pointerType},onMouseDown(m){const h=u.current,v=m.nativeEvent,E=n.select("open");if(m.button!==0||s==="click"||mt(h,!0)&&a)return;const b=o.current.openEvent,R=b?.type,y=n.select("domReferenceElement")!==m.currentTarget,S=E&&y||!(E&&i&&(!(b&&c)||R==="click"||R==="mousedown"));if(ur(v.target)){const T=ce(ze,v,v.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T);return}const C=m.currentTarget;f.request(()=>{const T=ce(ze,v,C);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T)})},onClick(m){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(mt(h,!0)&&a)return;const v=n.select("open"),E=o.current.openEvent,b=n.select("domReferenceElement")!==m.currentTarget,R=v&&b||!(v&&i&&(!(E&&c)||fr(E))),y=ce(ze,m.nativeEvent,m.currentTarget);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,y)}):n.setOpen(R,y)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:g}:Ee,[r,g])}function Io(e,t,n){let{reference:o,floating:r}=e;const s=Oe(t),i=zn(t),a=qn(i),c=Re(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let g;switch(c){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Ze(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}async function Fc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=_e(t,e),m=dr(g),v=a[p?f==="floating"?"reference":"floating":f],E=Gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},S=Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:R,strategy:c}):b);return{top:(E.top-S.top+m.top)/y.y,bottom:(S.bottom-E.bottom+m.bottom)/y.y,left:(E.left-S.left+m.left)/y.x,right:(S.right-E.right+m.right)/y.x}}const Dc=50,Nc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Fc},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Io(l,o,c),p=o,g=0;const m={};for(let h=0;h<s.length;h++){const v=s[h];if(!v)continue;const{name:E,fn:b}=v,{x:R,y,data:S,reset:C}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=R??u,f=y??f,m[E]={...m[E],...S},C&&g<Dc&&(g++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:u,y:f}=Io(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:m}},Bc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=_e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Re(r),b=Oe(a),R=Re(a)===a,y=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(R||!h?[Kt(a)]:Ai(a)),C=m!=="none";!p&&C&&S.push(...Ni(a,h,m,y));const T=[a,...S],I=await c.detectOverflow(t,v),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[E]),f){const D=Mi(r,i,y);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var F,A;const D=(((F=s.flip)==null?void 0:F.index)||0)+1,P=T[D];if(P&&(!(f==="alignment"?b!==Oe(P):!1)||k.every(w=>Oe(w.placement)===b?w.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter(B=>B.overflows[0]<=0).sort((B,w)=>B.overflows[1]-w.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(g){case"bestFit":{var O;const B=(O=k.filter(w=>{if(C){const L=Oe(w.placement);return L===b||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:O[0];B&&(V=B);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function ko(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mo(e){return Ii.some(t=>e[t]>=0)}const $c=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=_e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=ko(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Mo(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=ko(i,n.floating);return{data:{escapedOffsets:a,escaped:Mo(a)}}}default:return{}}}}},$r=new Set(["left","top"]);async function Wc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Re(n),a=Ze(n),c=Oe(n)==="y",l=$r.has(i)?-1:1,u=s&&c?-1:1,f=_e(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(g=a==="end"?m*-1:m),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const Vc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Wc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},jc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:E=>{let{x:b,y:R}=E;return{x:b,y:R}}},...l}=_e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=Oe(Re(r)),g=Un(p);let m=u[g],h=u[p];if(i){const E=g==="y"?"top":"left",b=g==="y"?"bottom":"right",R=m+f[E],y=m-f[b];m=kn(R,m,y)}if(a){const E=p==="y"?"top":"left",b=p==="y"?"bottom":"right",R=h+f[E],y=h-f[b];h=kn(R,h,y)}const v=c.fn({...t,[g]:m,[p]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:i,[p]:a}}}}}},Hc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=_e(e,t),u={x:n,y:o},f=Oe(r),p=Un(f);let g=u[p],m=u[f];const h=_e(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const R=p==="y"?"height":"width",y=s.reference[p]-s.floating[R]+v.mainAxis,S=s.reference[p]+s.reference[R]-v.mainAxis;g<y?g=y:g>S&&(g=S)}if(l){var E,b;const R=p==="y"?"width":"height",y=$r.has(Re(r)),S=s.reference[f]-s.floating[R]+(y&&((E=i.offset)==null?void 0:E[f])||0)+(y?0:v.crossAxis),C=s.reference[f]+s.reference[R]+(y?0:((b=i.offset)==null?void 0:b[f])||0)-(y?v.crossAxis:0);m<S?m=S:m>C&&(m=C)}return{[p]:g,[f]:m}}}},_c=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=_e(e,t),u=await i.detectOverflow(t,l),f=Re(r),p=Ze(r),g=Oe(r)==="y",{width:m,height:h}=s.floating;let v,E;f==="top"||f==="bottom"?(v=f,E=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,v=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,R=m-u.left-u.right,y=ht(h-u[v],b),S=ht(m-u[E],R),C=!t.middlewareData.shift;let T=y,I=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=b),C&&!p){const k=we(u.left,0),F=we(u.right,0),A=we(u.top,0),O=we(u.bottom,0);g?I=m-2*(k!==0||F!==0?k+F:we(u.left,u.right)):T=h-2*(A!==0||O!==0?A+O:we(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:T});const N=await i.getDimensions(a.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Wr(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=zt(n)!==s||zt(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Xn(e){return ie(e)?e:e.contextElement}function gt(e){const t=Xn(e);if(!me(t))return Ne(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Wr(t);let i=(s?zt(n.width):n.width)/o,a=(s?zt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Yc=Ne(0);function Vr(e){const t=he(e);return!on()||!t.visualViewport?Yc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Uc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Xn(e);let i=Ne(1);t&&(o?ie(o)&&(i=gt(o)):i=gt(e));const a=Uc(s,n,o)?Vr(s):Ne(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=he(s),g=o&&ie(o)?he(o):o;let m=p,h=Tn(m);for(;h&&o&&g!==m;){const v=gt(h),E=h.getBoundingClientRect(),b=Ce(h),R=E.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,y=E.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=R,l+=y,m=he(h),h=Tn(m)}}return Gt({width:u,height:f,x:c,y:l})}function sn(e,t){const n=rn(e).scrollLeft;return t?t.left+n:rt(Be(e)).left+n}function jr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-sn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function qc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Be(o),a=t?nn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Ne(1);const u=Ne(0),f=me(o);if((f||!f&&!s)&&((Xe(o)!=="body"||st(i))&&(c=rn(o)),f)){const g=rt(o);l=gt(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}const p=i&&!f&&!s?jr(i,c):Ne(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function zc(e){return Array.from(e.getClientRects())}function Kc(e){const t=Be(e),n=rn(e),o=e.ownerDocument.body,r=we(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=we(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+sn(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(i+=we(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const Ao=25;function Gc(e,t){const n=he(e),o=Be(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=on();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=sn(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-g);m<=Ao&&(s-=m)}else l<=Ao&&(s+=l);return{width:s,height:i,x:a,y:c}}function Xc(e,t){const n=rt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=me(e)?gt(e):Ne(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function Lo(e,t,n){let o;if(t==="viewport")o=Gc(e,n);else if(t==="document")o=Kc(Be(e));else if(ie(t))o=Xc(t,n);else{const r=Vr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Gt(o)}function Hr(e,t){const n=He(e);return n===t||!ie(n)||je(n)?!1:Ce(n).position==="fixed"||Hr(n,t)}function Zc(e,t){const n=t.get(e);if(n)return n;let o=qe(e,[],!1).filter(a=>ie(a)&&Xe(a)!=="body"),r=null;const s=Ce(e).position==="fixed";let i=s?He(e):e;for(;ie(i)&&!je(i);){const a=Ce(i),c=Yn(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||st(i)&&!c&&Hr(e,i))?o=o.filter(u=>u!==i):r=a,i=He(i)}return t.set(e,o),o}function Jc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?nn(t)?[]:Zc(t,this._c):[].concat(n),o],a=Lo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const g=Lo(t,i[p],r);c=we(g.top,c),l=ht(g.right,l),u=ht(g.bottom,u),f=we(g.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function Qc(e){const{width:t,height:n}=Wr(e);return{width:t,height:n}}function ea(e,t,n){const o=me(t),r=Be(t),s=n==="fixed",i=rt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Ne(0);function l(){c.x=sn(r)}if(o||!o&&!s)if((Xe(t)!=="body"||st(r))&&(a=rn(t)),o){const g=rt(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?jr(r,a):Ne(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function xn(e){return Ce(e).position==="static"}function Fo(e,t){if(!me(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Be(e)===n&&(n=n.ownerDocument.body),n}function _r(e,t){const n=he(e);if(nn(e))return n;if(!me(e)){let r=He(e);for(;r&&!je(r);){if(ie(r)&&!xn(r))return r;r=He(r)}return n}let o=Fo(e,t);for(;o&&gi(o)&&xn(o);)o=Fo(o,t);return o&&je(o)&&xn(o)&&!Yn(o)?n:o||bi(e)||n}const ta=async function(e){const t=this.getOffsetParent||_r,n=this.getDimensions,o=await n(e.floating);return{reference:ea(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function na(e){return Ce(e).direction==="rtl"}const oa={convertOffsetParentRelativeRectToViewportRelativeRect:qc,getDocumentElement:Be,getClippingRect:Jc,getOffsetParent:_r,getElementRects:ta,getClientRects:zc,getDimensions:Qc,getScale:gt,isElement:ie,isRTL:na};function Yr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ra(e,t){let n=null,o;const r=Be(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:g}=l;if(a||t(),!p||!g)return;const m=Wt(f),h=Wt(r.clientWidth-(u+p)),v=Wt(r.clientHeight-(f+g)),E=Wt(u),R={rootMargin:-m+"px "+-h+"px "+-v+"px "+-E+"px",threshold:we(0,ht(1,c))||1};let y=!0;function S(C){const T=C[0].intersectionRatio;if(T!==c){if(!y)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Yr(l,e.getBoundingClientRect())&&i(),y=!1}try{n=new IntersectionObserver(S,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,R)}n.observe(e)}return i(!0),s}function Do(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Xn(e),u=r||s?[...l?qe(l):[],...t?qe(t):[]]:[];u.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=l&&a?ra(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(E=>{let[b]=E;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let m,h=c?rt(e):null;c&&v();function v(){const E=rt(e);h&&!Yr(h,E)&&n(),h=E,m=requestAnimationFrame(v)}return n(),()=>{var E;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(E=g)==null||E.disconnect(),g=null,c&&cancelAnimationFrame(m)}}const sa=Vc,ia=jc,ca=Bc,aa=_c,la=$c,ua=Hc,fa=(e,t,n)=>{const o=new Map,r={platform:oa,...n},s={...r.platform,_c:o};return Nc(e,t,{...r,platform:s})};var da=typeof document<"u",pa=function(){},_t=da?d.useLayoutEffect:pa;function en(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!en(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ur(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function No(e,t){const n=Ur(e);return Math.round(t*n)/n}function wn(e){const t=d.useRef(e);return _t(()=>{t.current=e}),t}function ga(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(o);en(p,o)||g(o);const[m,h]=d.useState(null),[v,E]=d.useState(null),b=d.useCallback(w=>{w!==C.current&&(C.current=w,h(w))},[]),R=d.useCallback(w=>{w!==T.current&&(T.current=w,E(w))},[]),y=s||m,S=i||v,C=d.useRef(null),T=d.useRef(null),I=d.useRef(u),N=c!=null,k=wn(c),F=wn(r),A=wn(l),O=d.useCallback(()=>{if(!C.current||!T.current)return;const w={placement:t,strategy:n,middleware:p};F.current&&(w.platform=F.current),fa(C.current,T.current,w).then(L=>{const Q={...L,isPositioned:A.current!==!1};D.current&&!en(I.current,Q)&&(I.current=Q,Ke.flushSync(()=>{f(Q)}))})},[p,t,n,F,A]);_t(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[l]);const D=d.useRef(!1);_t(()=>(D.current=!0,()=>{D.current=!1}),[]),_t(()=>{if(y&&(C.current=y),S&&(T.current=S),y&&S){if(k.current)return k.current(y,S,O);O()}},[y,S,O,k,N]);const P=d.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:R}),[b,R]),V=d.useMemo(()=>({reference:y,floating:S}),[y,S]),B=d.useMemo(()=>{const w={position:n,left:0,top:0};if(!V.floating)return w;const L=No(V.floating,u.x),Q=No(V.floating,u.y);return a?{...w,transform:"translate("+L+"px, "+Q+"px)",...Ur(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:O,refs:P,elements:V,floatingStyles:B}),[u,O,P,V,B])}const ma=(e,t)=>{const n=sa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ha=(e,t)=>{const n=ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},ba=(e,t)=>({fn:ua(e).fn,options:[e,t]}),va=(e,t)=>{const n=ca(e);return{name:n.name,fn:n.fn,options:[e,t]}},ya=(e,t)=>{const n=aa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ea=(e,t)=>{const n=la(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ra={intentional:"onClick",sloppy:"onPointerDown"};function xa(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function qr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:v,externalTree:E}=t,b=xt(E),R=Y(typeof f=="function"?f:()=>!1),y=typeof f=="function"?R:f,S=d.useRef(!1),{escapeKey:C,outsidePress:T}=xa(v),I=d.useRef(null),N=ot(),k=ot(),F=Y(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),O=d.useRef(""),D=Y(x=>{O.current=x.pointerType}),P=Y(()=>{const x=O.current,U=x==="pen"||!x?"mouse":x,$=typeof p=="function"?p():p;return typeof $=="string"?$:$[U]}),V=Y(x=>{if(!o||!l||!u||x.key!=="Escape"||A.current)return;const U=c.current.floatingContext?.nodeId,$=b?nt(b.nodesRef.current,U):[];if(!C&&$.length>0){let W=!0;if($.forEach(z=>{z.context?.open&&!z.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=Ti(x)?x.nativeEvent:x,M=ce(Pr,ue);n.setOpen(!1,M),!C&&!M.isPropagationAllowed&&x.stopPropagation()}),B=Y(x=>{const U=P();return U==="intentional"&&x.type!=="click"||U==="sloppy"&&x.type==="click"}),w=Y(()=>{c.current.insideReactTree=!0,k.start(0,F)}),L=Y((x,U=!1)=>{if(B(x)){F();return}if(c.current.insideReactTree){F();return}if(P()==="intentional"&&U||typeof y=="function"&&!y(x))return;const $=xe(x),ue=`[${kt("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if($&&(W.hasElement($)||W.hasMatchingElement(j=>re(j,$))))return;let z=ie($)?$:null;for(;z&&!je(z);){const j=He(z);if(je(j)||!ie(j))break;z=j}if(M.length&&ie($)&&!Si($)&&!re($,n.select("floatingElement"))&&Array.from(M).every(j=>!re(z,j)))return;if(me($)&&!("touches"in x)){const j=je($),be=Ce($),ae=/auto|scroll/,We=j||ae.test(be.overflowX),Qe=j||ae.test(be.overflowY),at=We&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,et=Qe&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,ve=be.direction==="rtl",Me=et&&(ve?x.offsetX<=$.offsetWidth-$.clientWidth:x.offsetX>$.clientWidth),Ae=at&&x.offsetY>$.clientHeight;if(Me||Ae)return}const te=c.current.floatingContext?.nodeId,oe=b&&nt(b.nodesRef.current,te).some(j=>Pe(x,j.context?.elements.floating));if(Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||oe)return;const H=b?nt(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(Or,x)),F()}),Q=Y(x=>{P()!=="sloppy"||x.pointerType==="touch"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||L(x)}),G=Y(x=>{if(P()!=="sloppy"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];U&&(I.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),X=Y(x=>{const U=xe(x);function $(){G(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)}),Z=Y(x=>{const U=S.current;if(S.current=!1,N.clear(),x.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const $=xe(x);function ue(){x.type==="pointerdown"?Q(x):L(x,U),$?.removeEventListener(x.type,ue)}$?.addEventListener(x.type,ue)}),_=Y(x=>{if(P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];if(!U)return;const $=Math.abs(U.clientX-I.current.startX),ue=Math.abs(U.clientY-I.current.startY),M=Math.sqrt($*$+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(L(x),N.clear(),I.current=null)}),ne=Y(x=>{const U=xe(x);function $(){_(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)}),q=Y(x=>{P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&L(x),N.clear(),I.current=null)}),J=Y(x=>{const U=xe(x);function $(){q(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=T;const x=new Ge;function U(z){n.setOpen(!1,ce(dc,z))}function $(){x.clear(),A.current=!0}function ue(){x.start(on()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",$),M.addEventListener("compositionend",ue)),y&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",X,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=qe(i)),ie(r)&&(W=W.concat(qe(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(qe(s.contextElement)))),W=W.filter(z=>z!==M.defaultView?.visualViewport),W.forEach(z=>{z.addEventListener("scroll",U,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",$),M.removeEventListener("compositionend",ue)),y&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",X,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(z=>{z.removeEventListener("scroll",U)}),x.clear(),S.current=!1}},[c,r,s,i,u,y,o,a,h,l,C,T,V,L,Z,Q,X,ne,J,D,n]),d.useEffect(F,[y,F]);const de=d.useMemo(()=>({onKeyDown:V,...g&&{[Ra[m]]:x=>{n.setOpen(!1,ce(ze,x.nativeEvent))},...m!=="intentional"&&{onClick(x){n.setOpen(!1,ce(ze,x.nativeEvent))}}}}),[V,n,g,m]),pe=Y(x=>{const U=xe(x.nativeEvent);!re(n.select("floatingElement"),U)||x.button!==0||(S.current=!0)}),ge=Y(x=>{!o||!l||x.button!==0||(S.current=!0)}),$e=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:w,onMouseDownCapture(x){w(),ge(x)},onPointerDownCapture(x){w(),ge(x)},onMouseUpCapture:w,onTouchEndCapture:w,onTouchMoveCapture:w}),[V,pe,w,ge]);return d.useMemo(()=>l?{reference:de,floating:$e,trigger:de}:{},[l,de,$e])}const wa={open:K(e=>e.open),domReferenceElement:K(e=>e.domReferenceElement),referenceElement:K(e=>e.positionReference??e.referenceElement),floatingElement:K(e=>e.floatingElement),floatingId:K(e=>e.floatingId)};class Zn extends Vn{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:wr(),nested:n,noEmit:o,triggerElements:s},wa)}setOpen=(t,n)=>{if((!t||!this.state.open||fr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Sa(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Fe.request(()=>{r("ending")});return()=>{Fe.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Fe.request(()=>{r(void 0)});return()=>{Fe.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Fe.request(()=>{r("idle")});return()=>{Fe.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Mt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Ca={[Mt.startingStyle]:""},Ta={[Mt.endingStyle]:""},cn={transitionStatus(e){return e==="starting"?Ca:e==="ending"?Ta:null}};function zr(e,t=!1,n=!0){const o=Hn();return Y((r,s=null)=>{o.cancel();function i(){Ke.flushSync(r)}const a=Ve(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Mt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Jn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=zr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function Oa(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Pa(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Oa(e,n),i=Y(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Kr(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Gr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=Sa(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=Y(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Jn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class an{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Ia(){return new Zn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new an,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Xr(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Ia(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ee,inactiveTriggerProps:Ee,popupProps:Ee}}const Zr={open:K(e=>e.open),mounted:K(e=>e.mounted),transitionStatus:K(e=>e.transitionStatus),floatingRootContext:K(e=>e.floatingRootContext),preventUnmountingOnClose:K(e=>e.preventUnmountingOnClose),payload:K(e=>e.payload),activeTriggerId:K(e=>e.activeTriggerId),activeTriggerElement:K(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:K((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:K((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:K(e=>e.popupProps),popupElement:K(e=>e.popupElement),positionerElement:K(e=>e.positionerElement)};function ka(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Rt(),s=it()!=null,i=ke(()=>new Zn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new an,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Ma(e={}){const{nodeId:t,externalTree:n}=e,o=ka(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=xt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=ga({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(T=>{const I=ie(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;a(I),u.refs.setReference(I)},[u.refs]),[p,g]=d.useState(null),[m,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",m);const v=d.useCallback(T=>{(ie(T)||T===null)&&(c.current=T,g(T)),(ie(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!ie(T))&&u.refs.setReference(T)},[u.refs,g]),E=d.useCallback(T=>{h(T),u.refs.setFloating(T)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:v,setFloating:E,setPositionReference:f,domReference:c}),[u.refs,v,E,f]),R=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),y=r.useState("open"),S=r.useState("floatingId"),C=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:y,onOpenChange:r.setOpen,events:r.context.events,floatingId:S,refs:b,elements:R,nodeId:t,rootStore:r}),[u,b,R,t,r,y,S]);return se(()=>{r.context.dataRef.current.floatingContext=C;const T=l?.nodesRef.current.find(I=>I.id===t);T&&(T.context=C)}),d.useMemo(()=>({...u,context:C,refs:b,elements:R,rootStore:r}),[u,b,R,C,r])}function Jr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Rt(),i=it()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=ke(()=>new Zn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const Bn=kt("safe-polygon"),Aa=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lr}`;function La(e){return e?!!e.closest(Aa):!1}function Qr(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=ot(),l=ot(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Fa=new Set(["click","mousedown"]);function Da(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:g,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:v,handleCloseOptionsRef:E}=Qr(n),b=xt(l),R=it(),y=Y(()=>f.current?!0:i.current.openEvent?Fa.has(i.current.openEvent.type):!1),S=Y(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),C=d.useCallback((k,F=!0)=>{const A=Na(c,u.current);A&&!p.current?v.start(A,()=>n.setOpen(!1,ce(Se,k))):F&&(v.clear(),n.setOpen(!1,ce(Se,k)))},[c,p,n,u,v]),T=Y(()=>{m.current(),p.current=void 0}),I=Y(()=>{if(g.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute(Bn),g.current=!1}}),N=Y(k=>{const F=xe(k);if(!La(F)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,T(),I())},[o,u,h,f,T,I]),d.useEffect(()=>()=>{T()},[T]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&E.current?.blockPointerEvents&&S()&&ie(s)&&r){g.current=!0;const k=fe(r).body;k.setAttribute(Bn,"");const F=s,A=r,O=b?.nodesRef.current.find(D=>D.id===R)?.context?.elements.floating;return O&&(O.style.pointerEvents=""),k.style.pointerEvents="none",F.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",F.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,E,S,b,R,g]),d.useEffect(()=>{if(!a)return;function k(D){if(y()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),T(),y()||C(D))}function F(D){v.clear(),I(),p.current?.(D),T()}function A(D){y()||C(D,!1)}const O=r;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",A),O.addEventListener("pointerdown",N,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",A),O.removeEventListener("pointerdown",N,!0))}})}function Na(e,t){return t&&!mt(t)?0:typeof e=="function"?e():e}function Sn(e){return typeof e=="function"?e():e}const Ba={current:null};function $a(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Ba,externalTree:p,isActiveTrigger:g=!0}=t,m=xt(p),{pointerTypeRef:h,interactedInsideRef:v,handlerRef:E,blockMouseMoveRef:b,performedPointerEventsMutationRef:R,unbindMouseMoveRef:y,restTimeoutPendingRef:S,openChangeTimeout:C,restTimeout:T,handleCloseOptionsRef:I}=Qr(n),N=De(a),k=De(i),F=De(l);g&&(I.current=N.current?.__options);const A=Y(()=>v.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),O=d.useCallback((B,w=!0)=>{const L=vn(k.current,"close",h.current);L&&!E.current?C.start(L,()=>n.setOpen(!1,ce(Se,B))):w&&(C.clear(),n.setOpen(!1,ce(Se,B)))},[k,E,n,h,C]),D=Y(()=>{y.current(),E.current=void 0}),P=Y(()=>{if(R.current){const B=fe(n.select("domReferenceElement")).body;B.style.pointerEvents="",B.removeAttribute(Bn),R.current=!1}});d.useEffect(()=>{if(!s)return;function B(w){w.open||(C.clear(),T.clear(),b.current=!0,S.current=!1)}return r.on("openchange",B),()=>{r.off("openchange",B)}},[s,r,C,T,b,S]);const V=Y(B=>{if(A()||!o.current.floatingContext)return;const w=n.context.triggerElements;if(B.relatedTarget&&w.hasElement(B.relatedTarget))return;const L=f.current;N.current?.({...o.current.floatingContext,tree:m,x:B.clientX,y:B.clientY,onClose(){P(),D(),!A()&&L===n.select("domReferenceElement")&&O(B)}})(B)});return d.useEffect(()=>{if(!s)return;const B=f.current??(g?n.select("domReferenceElement"):null);if(!ie(B))return;function w(G){if(C.clear(),b.current=!1,c&&!mt(h.current)||Sn(F.current)>0&&!vn(k.current,"open"))return;const X=vn(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(G.target)||_.hasMatchingElement(pe=>re(pe,G.target)))&&(!Z||!re(Z,G.target)),q=G.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(Se,G,q)):X?C.start(X,()=>{de&&n.setOpen(!0,ce(Se,G,q))}):de&&n.setOpen(!0,ce(Se,G,q))}function L(G){if(A()){P();return}y.current();const X=n.select("domReferenceElement"),Z=fe(X);T.clear(),S.current=!1;const _=n.context.triggerElements;if(G.relatedTarget&&_.hasElement(G.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||C.clear();const q=f.current;E.current=N.current({...o.current.floatingContext,tree:m,x:G.clientX,y:G.clientY,onClose(){P(),D(),!A()&&q===n.select("domReferenceElement")&&O(G,!0)}});const J=E.current;J(G),Z.addEventListener("mousemove",J),y.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),G.relatedTarget))&&O(G)}function Q(G){V(G)}return n.select("open")&&B.addEventListener("mouseleave",Q),u&&B.addEventListener("mousemove",w,{once:!0}),B.addEventListener("mouseenter",w),B.addEventListener("mouseleave",L),()=>{B.removeEventListener("mouseleave",Q),u&&B.removeEventListener("mousemove",w),B.removeEventListener("mouseenter",w),B.removeEventListener("mouseleave",L)}},[D,P,b,o,k,O,n,s,N,V,g,A,c,u,h,F,T,S,C,f,m,y,E]),d.useMemo(()=>{function B(w){h.current=w.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(w){const{nativeEvent:L}=w,Q=w.currentTarget,G=n.select("domReferenceElement"),X=n.context.triggerElements,Z=n.select("open"),_=(X.hasElement(w.target)||X.hasMatchingElement(q=>re(q,w.target)))&&(!G||!re(G,w.target));if(c&&!mt(h.current)||Z&&!_||Sn(F.current)===0||!_&&S.current&&w.movementX**2+w.movementY**2<2)return;T.clear();function ne(){if(S.current=!1,A())return;const q=n.select("open");!b.current&&(!q||_)&&n.setOpen(!0,ce(Se,L,Q))}h.current==="touch"?Ke.flushSync(()=>{ne()}):_&&Z?ne():(S.current=!0,T.start(Sn(F.current),ne))}}},[b,A,c,n,h,F,T,S])}function Qn(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Ht(l,e,"reference"),t),i=d.useCallback(l=>Ht(l,e,"floating"),n),a=d.useCallback(l=>Ht(l,e,"item"),o),c=d.useCallback(l=>Ht(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Ht(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Pn]="");for(const i in e)r&&e&&(i===cr||i===ar)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Bo(s,a,r,o)}return Bo(s,e,r,o),s}function Bo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===cr||r===ar)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Wa=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function es(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=Rt(),u=s?.id||l,f=d.useMemo(()=>In(i)?.id||r,[i,r]),p=Wa.get(c)??c,m=it()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?Ee:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,m,c]),v=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),E=d.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:R,selected:y})=>{const S={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...S,"aria-selected":y}}return{}},[f,c]);return d.useMemo(()=>a?{reference:v,floating:E,item:b,trigger:h}:{},[a,v,E,h,b])}function $o(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function Va(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ja(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ge;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const g=performance.now(),m=g-c;if(i===null||a===null||m===0)return i=f,a=p,c=g,null;const h=f-i,v=p-a,b=Math.sqrt(h*h+v*v)/m;return i=f,a=p,c=g,b}const u=({x:f,y:p,placement:g,elements:m,onClose:h,nodeId:v,tree:E})=>function(R){function y(){r.clear(),h()}if(r.clear(),!m.domReference||!m.floating||g==null||f==null||p==null)return;const{clientX:S,clientY:C}=R,T=[S,C],I=xe(R),N=R.type==="mouseleave",k=re(m.floating,I),F=re(m.domReference,I),A=m.domReference.getBoundingClientRect(),O=m.floating.getBoundingClientRect(),D=g.split("-")[0],P=f>O.right-O.width/2,V=p>O.bottom-O.height/2,B=Va(T,A),w=O.width>A.width,L=O.height>A.height,Q=(w?A:O).left,G=(w?A:O).right,X=(L?A:O).top,Z=(L?A:O).bottom;if(k&&(s=!0,!N))return;if(F&&(s=!1),F&&!N){s=!0;return}if(N&&ie(R.relatedTarget)&&re(m.floating,R.relatedTarget)||E&&nt(E.nodesRef.current,v).some(({context:q})=>q?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return y();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,O.bottom-1],[G,O.bottom-1],[G,A.top+1]];break;case"bottom":_=[[Q,O.top+1],[Q,A.bottom-1],[G,A.bottom-1],[G,O.top+1]];break;case"left":_=[[O.right-1,Z],[O.right-1,X],[A.left+1,X],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,X],[O.left+1,X],[O.left+1,Z]];break}function ne([q,J]){switch(D){case"top":{const de=[w?q+t/2:P?q+t*4:q-t*4,J+t+1],pe=[w?q-t/2:P?q+t*4:q-t*4,J+t+1],ge=[[O.left,P||w?O.bottom-t:O.top],[O.right,P?w?O.bottom-t:O.top:O.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[w?q+t/2:P?q+t*4:q-t*4,J-t],pe=[w?q-t/2:P?q+t*4:q-t*4,J-t],ge=[[O.left,P||w?O.top+t:O.bottom],[O.right,P?w?O.top+t:O.bottom:O.top+t]];return[de,pe,...ge]}case"left":{const de=[q+t+1,L?J+t/2:V?J+t*4:J-t*4],pe=[q+t+1,L?J-t/2:V?J+t*4:J-t*4];return[...[[V||L?O.right-t:O.left,O.top],[V?L?O.right-t:O.left:O.right-t,O.bottom]],de,pe]}case"right":{const de=[q-t,L?J+t/2:V?J+t*4:J-t*4],pe=[q-t,L?J-t/2:V?J+t*4:J-t*4],ge=[[V||L?O.left+t:O.right,O.top],[V?L?O.left+t:O.right:O.left+t,O.bottom]];return[de,pe,...ge]}default:return[]}}if(!$o([S,C],_)){if(s&&!B)return y();if(!N&&o){const q=l(R.clientX,R.clientY);if(q!==null&&q<.1)return y()}$o([S,C],ne([f,p]))?!s&&o&&r.start(40,y):y()}};return u.__options={blockPointerEvents:n},u}function ts(e){return Rt(e,"base-ui")}function Ha(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ns(e){const[t,n]=d.useState(null),o=Y((a,c)=>{e||n(c||(ir?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Ha(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ie=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Mt.startingStyle]="startingStyle",e[e.endingStyle=Mt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),$n=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const _a={[$n.popupOpen]:""},Ya={[$n.popupOpen]:"",[$n.pressed]:""},Ua={[Ie.open]:""},qa={[Ie.closed]:""},za={[Ie.anchorHidden]:""},Ka={open(e){return e?_a:null}},Ga={open(e){return e?Ya:null}},Lt={open(e){return e?Ua:qa},anchorHidden(e){return e?za:null}},Xa=d.createContext(void 0);function Za(e=!1){const t=d.useContext(Xa);if(t===void 0&&!e)throw new Error(Ye(16));return t}function Ja(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[o,n,t,i,a,s,r])}}function Qa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Za(!0)!==void 0,a=Y(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=Ja({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),l=d.useCallback(()=>{const p=s.current;el(p)&&i&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,i]);se(l,[l]);const u=d.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:h,onKeyDown:v,onPointerDown:E,...b}=p;return Mr({type:r?"button":void 0,onClick(y){if(t){y.preventDefault();return}g?.(y)},onMouseDown(y){t||m?.(y)},onKeyDown(y){if(t||(Nn(y),v?.(y)),y.baseUIHandlerPrevented)return;const S=y.target===y.currentTarget&&!r&&!a()&&!t,C=y.key==="Enter",T=y.key===" ";S&&((T||C)&&y.preventDefault(),C&&g?.(y))},onKeyUp(y){t||(Nn(y),h?.(y)),!y.baseUIHandlerPrevented&&y.target===y.currentTarget&&!r&&!t&&y.key===" "&&g?.(y)},onPointerDown(y){if(t){y.preventDefault();return}E?.(y)}},r?void 0:{role:"button"},c,b)},[t,c,r,a]),f=Y(p=>{s.current=p,l()});return{getButtonProps:u,buttonRef:f}}function el(e){return me(e)&&e.tagName==="BUTTON"}function os(e){return Wn(19)?e:e?"true":void 0}let Wo={},Vo={},jo="";function tl(e){if(typeof document>"u")return!1;const t=ct(e);return he(t).innerWidth-t.documentElement.clientWidth>0}function nl(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=ct(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function ol(e){const t=ct(e),n=t.documentElement,o=t.body,r=st(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function rl(e){const t=ct(e),n=t.documentElement,o=t.body,r=he(n);let s=0,i=0,a=!1;const c=Fe.create();if(vi&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),g=r.getComputedStyle(o),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Wo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},jo=n.style.scrollBehavior,Vo={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||g.overflowY==="scroll",y=p.overflowX==="scroll"||g.overflowX==="scroll",S=Math.max(0,r.innerWidth-o.clientWidth),C=Math.max(0,r.innerHeight-o.clientHeight),T=parseFloat(g.marginTop)+parseFloat(g.marginBottom),I=parseFloat(g.marginLeft)+parseFloat(g.marginRight),N=st(n)?n:o;if(a=nl(e),a){n.style.scrollbarGutter=v,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(E||R)&&(n.style.overflowY="scroll"),(b||y)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||C?`calc(100dvh - ${T+C}px)`:"100dvh",width:I||S?`calc(100vw - ${I+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Wo),Object.assign(o.style,Vo),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=jo)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class sl{lockCount=0;restore=null;timeoutLock=Ge.create();timeoutUnlock=Ge.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=ct(t).documentElement,r=he(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nr;return}const s=ir||!tl(t);this.restore=s?ol(t):rl(t)}}const il=new sl;function rs(e=!0,t=null){se(()=>{if(e)return il.acquire(t)},[e,t])}const cl=d.createContext(void 0);function al(){return d.useContext(cl)?.direction??"ltr"}const ll=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=_e(e,t)||{};if(l==null)return{};const p=dr(u),g={x:n,y:o},m=zn(r),h=qn(m),v=await i.getDimensions(l),E=m==="y",b=E?"top":"left",R=E?"bottom":"right",y=E?"clientHeight":"clientWidth",S=s.reference[h]+s.reference[m]-g[m]-s.floating[h],C=g[m]-s.reference[m],T=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[y]||s.floating[h];(!I||!await i.isElement?.(T))&&(I=a.floating[y]||s.floating[h]);const N=S/2-C/2,k=I/2-v[h]/2-1,F=Math.min(p[b],k),A=Math.min(p[R],k),O=F,D=I-v[h]-A,P=I/2-v[h]/2+N,V=kn(O,P,D),B=!c.arrow&&Ze(r)!=null&&P!==V&&s.reference[h]/2-(P<O?F:A)-v[h]/2<0,w=B?P<O?P-O:P-D:0;return{[m]:g[m]+w,data:{[m]:V,centerOffset:P-V-w,...B&&{alignmentOffset:w}},reset:B}}}),ul=(e,t)=>({...ll(e),options:[e,t]}),fl={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Ea().fn(e)).data?.referenceHidden||s}}}},Yt={sideX:"left",sideY:"top"},dl={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=he(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Yt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=ct(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const g=Re(a);let m=t,h=n;g==="left"&&(m=p.width-(t+o.width)),g==="top"&&(h=p.height-(n+o.height));const v=g==="left"?"right":Yt.sideX,E=g==="top"?"bottom":Yt.sideY;return{x:m,y:h,data:{sideX:v,sideY:E}}}};function ss(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Ho(e,t,n){const{rects:o,placement:r}=e;return{side:ss(t,Re(r),n),align:Ze(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function pl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:g,mounted:m,collisionAvoidance:h,shiftCrossAxis:v=!1,nodeId:E,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:y}=e,[S,C]=d.useState(null);!m&&S!==null&&C(null);const T=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,F=Y(k),A=k?F:t,O=De(t),P=al()==="rtl",V=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],B=s==="center"?V:`${V}-${s}`;let w=c;const L=1,Q=o==="bottom"?L:0,G=o==="top"?L:0,X=o==="right"?L:0,Z=o==="left"?L:0;typeof w=="number"?w={top:w+Q,right:w+Z,bottom:w+G,left:w+X}:w&&(w={top:(w.top||0)+Q,right:(w.right||0)+Z,bottom:(w.bottom||0)+G,left:(w.left||0)+X});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:w},ne=d.useRef(null),q=De(r),J=De(i),ge=[ma(le=>{const ye=Ho(le,o,P),Le=typeof q.current=="function"?q.current(ye):q.current,Te=typeof J.current=="function"?J.current(ye):J.current;return{mainAxis:Le,crossAxis:Te,alignmentAxis:Te}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],$e=I==="none"&&T!=="shift",x=!$e&&(l||v||T==="shift"),U=T==="none"?null:va({..._,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!v&&T==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),$=$e?null:ha(le=>{const ye=ct(le.elements.floating).documentElement;return{..._,rootBoundary:v?{x:0,y:0,width:ye.clientWidth,height:ye.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:x,limiter:l||v?void 0:ba(Le=>{if(!ne.current)return{};const{width:Te,height:lt}=ne.current.getBoundingClientRect(),ut=Oe(Re(Le.placement)),Dt=ut==="y"?Te:lt,ln=ut==="y"?w.left+w.right:w.top+w.bottom;return{offset:Dt/2+ln/2}})}},[_,l,v,w,I]);T==="shift"||I==="shift"||s==="center"?ge.push($,U):ge.push(U,$),ge.push(ya({..._,apply({elements:{floating:le},rects:{reference:ye},availableWidth:Le,availableHeight:Te}){Object.entries({"--available-width":`${Le}px`,"--available-height":`${Te}px`,"--anchor-width":`${ye.width}px`,"--anchor-height":`${ye.height}px`}).forEach(([lt,ut])=>{le.style.setProperty(lt,ut)})}}),ul(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ye,middlewareData:Le,placement:Te,rects:lt,y:ut}=le,Dt=Re(Te),ln=Oe(Dt),io=ne.current,Rs=Le.arrow?.x||0,xs=Le.arrow?.y||0,ws=io?.clientWidth||0,Ss=io?.clientHeight||0,un=Rs+ws/2,co=xs+Ss/2,Cs=Math.abs(Le.shift?.y||0),Ts=lt.reference.height/2,St=typeof r=="function"?r(Ho(le,o,P)):r,Os=Cs>St,Ps={top:`${un}px calc(100% + ${St}px)`,bottom:`${un}px ${-St}px`,left:`calc(100% + ${St}px) ${co}px`,right:`${-St}px ${co}px`}[Dt],Is=`${un}px ${lt.reference.y+Ts-ut}px`;return ye.floating.style.setProperty("--transform-origin",x&&ln==="y"&&Os?Is:Ps),{}}},fl,b),se(()=>{!m&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,g]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:z,y:te,middlewareData:oe,update:H,placement:j,context:be,isPositioned:ae,floatingStyles:We}=Ma({rootContext:g,placement:B,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>Do(...le,ue),nodeId:E,externalTree:y}),{sideX:Qe,sideY:at}=oe.adaptiveOrigin||Yt,et=ae?n:"fixed",ve=d.useMemo(()=>b?{position:et,[Qe]:z,[at]:te}:{position:et,...We},[b,et,Qe,z,at,te,We]),Me=d.useRef(null);se(()=>{if(!m)return;const le=O.current,ye=typeof le=="function"?le():le,Te=(_o(ye)?ye.current:ye)||null||null;Te!==Me.current&&(M.setPositionReference(Te),Me.current=Te)},[m,M,A,O]),d.useEffect(()=>{if(!m)return;const le=O.current;typeof le!="function"&&_o(le)&&le.current!==Me.current&&(M.setPositionReference(le.current),Me.current=le.current)},[m,M,A,O]),d.useEffect(()=>{if(p&&m&&W.domReference&&W.floating)return Do(W.domReference,W.floating,H,ue)},[p,m,W,H,ue]);const Ae=Re(j),to=ss(o,Ae,P),no=Ze(j)||"center",oo=!!oe.hide?.referenceHidden;se(()=>{R&&m&&ae&&C(Ae)},[R,m,ae,Ae]);const ro=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),so=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ve,arrowStyles:ro,arrowRef:ne,arrowUncentered:so,side:to,align:no,physicalSide:Ae,anchorHidden:oo,refs:M,context:be,isPositioned:ae,update:H}),[ve,ro,ne,so,to,no,Ae,oo,M,be,ae,H])}function _o(e){return e!=null&&"current"in e}const is=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
1
|
+
import{c as qo,r as d,aD as zo,aE as Ko,C as ee,a9 as Ke}from"./main-BcIQOEq-.js";const ks=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Dl=qo("chevron-right",ks);const Ms=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Nl=qo("loader-circle",Ms),Go={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Xo={...Go,position:"fixed",top:0,left:0},Bl={...Go,position:"absolute"},ao={};function ke(e,t){const n=d.useRef(ao);return n.current===ao&&(n.current=e(t)),n}function Ut(e,t,n,o){const r=ke(Zo).current;return Ls(r,e,t,n,o)&&Jo(r,[e,t,n,o]),r.callback}function As(e){const t=ke(Zo).current;return Fs(t,e)&&Jo(t,e),t.callback}function Zo(){return{callback:null,cleanup:null,refs:[]}}function Ls(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Fs(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Jo(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Ds=()=>{},se=typeof document<"u"?d.useLayoutEffect:Ds,fn=zo[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Ns=fn&&fn!==d.useLayoutEffect?fn:e=>e();function Y(e){const t=ke(Bs).current;return t.next=e,Ns(t.effect),t.trampoline}function Bs(){const e={next:void 0,callback:$s,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function $s(){}function De(e){const t=ke(Ws,e).current;return t.next=e,se(t.effect),t}function Ws(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ye(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}var qt=Symbol("NOT_FOUND");function Vs(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function js(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Hs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var lo=e=>Array.isArray(e)?e:[e];function _s(e){const t=Array.isArray(e[0])?e[0]:e;return Hs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ys(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Us(e){let t;return{get(n){return t&&e(t.key,n)?t.value:qt},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function qs(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return qt}function r(a,c){o(a)===qt&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var zs=(e,t)=>e===t;function Ks(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Gs(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=zs,maxSize:r=1,resultEqualityCheck:s}=n,i=Ks(o);let a=0;const c=r<=1?Us(i):qs(r,i);function l(){let u=c.get(arguments);if(u===qt){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(g=>s(g.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var Xs=class{constructor(e){this.value=e}deref(){return this.value}},Zs=typeof WeakRef<"u"?WeakRef:Xs,Js=0,uo=1;function Nt(){return{s:Js,v:void 0,o:null,p:null}}function Qo(e,t={}){let n=Nt();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}else{let m=a.p;m===null&&(a.p=m=new Map);const h=m.get(g);h===void 0?(a=Nt(),m.set(g,a)):a=h}}const l=a;let u;if(a.s===uo)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Zs(u):u}return l.s=uo,l.v=u,u}return i.clearCache=()=>{n=Nt(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function er(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Vs(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Qo,argsMemoizeOptions:m=[]}=u,h=lo(p),v=lo(m),E=_s(r),b=f(function(){return s++,l.apply(null,arguments)},...h),R=g(function(){i++;const S=Ys(E,arguments);return a=b.apply(null,S),a},...v);return Object.assign(R,{resultFunc:l,memoizedResultFunc:b,dependencies:E,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(o,{withTypes:()=>o}),o}var Qs=er(Qo),ei=Object.assign((e,t=Qs)=>{js(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>ei});er({memoize:Gs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const K=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(Ye(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var dn={exports:{}},pn={};var fo;function ti(){if(fo)return pn;fo=1;var e=Ko();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),m=o({inst:{value:g,getSnapshot:p}}),h=m[0].inst,v=m[1];return s(function(){h.value=g,h.getSnapshot=p,c(h)&&v({inst:h})},[f,g,p]),r(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),i(g),g}function c(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return pn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,pn}var po;function tr(){return po||(po=1,dn.exports=ti()),dn.exports}var ni=tr(),gn={exports:{}},mn={};var go;function oi(){if(go)return mn;go=1;var e=Ko(),t=tr();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return mn.useSyncExternalStoreWithSelector=function(l,u,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function E(C){if(!b){if(b=!0,R=C,C=p(C),g!==void 0&&h.hasValue){var T=h.value;if(g(T,C))return y=T}return y=C}if(T=y,o(R,C))return T;var I=p(C);return g!==void 0&&g(T,I)?(R=C,T):(R=C,y=I)}var b=!1,R,y,S=f===void 0?null:f;return[function(){return E(u())},S===null?void 0:function(){return E(S())}]},[u,f,p,g]);var v=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},mn}var mo;function ri(){return mo||(mo=1,gn.exports=oi()),gn.exports}var si=ri();const ii=parseInt(d.version,10);function Wn(e){return ii>=e}const ci=Wn(19),ai=ci?ui:fi;function li(e,t,n,o,r){return ai(e,t,n,o,r)}function ui(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return ni.useSyncExternalStore(e.subscribe,s,s)}function fi(e,t,n,o,r){return si.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ot{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){Ot.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||Ot.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};Ot.prototype.setState.call(this,t)}}function nr(){}const $l=Object.freeze([]),Ee=Object.freeze({});class Vn extends Ot{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return li(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=Y(n??nr);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const di=[];function jn(e){d.useEffect(e,di)}const Bt=null;class pi{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const $t=new pi;class Fe{static create(){return new Fe}static request(t){return $t.request(t)}static cancel(t){return $t.cancel(t)}currentId=Bt;request(t){this.cancel(),this.currentId=$t.request(()=>{this.currentId=Bt,t()})}cancel=()=>{this.currentId!==Bt&&($t.cancel(this.currentId),this.currentId=Bt)};disposeEffect=()=>this.cancel}function Hn(){const e=ke(Fe.create).current;return jn(e.disposeEffect),e}const Ct=0;class Ge{static create(){return new Ge}currentId=Ct;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ct,n()},t)}isStarted(){return this.currentId!==Ct}clear=()=>{this.currentId!==Ct&&(clearTimeout(this.currentId),this.currentId=Ct)};disposeEffect=()=>this.clear}function ot(){const e=ke(Ge.create).current;return jn(e.disposeEffect),e}function tn(){return typeof window<"u"}function Xe(e){return _n(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Be(e){var t;return(t=(_n(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _n(e){return tn()?e instanceof Node||e instanceof he(e).Node:!1}function ie(e){return tn()?e instanceof Element||e instanceof he(e).Element:!1}function me(e){return tn()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function Cn(e){return!tn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function st(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function gi(e){return/^(table|td|th)$/.test(Xe(e))}function nn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const mi=/transform|translate|scale|rotate|perspective|filter/,hi=/paint|layout|strict|content/,tt=e=>!!e&&e!=="none";let hn;function Yn(e){const t=ie(e)?Ce(e):e;return tt(t.transform)||tt(t.translate)||tt(t.scale)||tt(t.rotate)||tt(t.perspective)||!on()&&(tt(t.backdropFilter)||tt(t.filter))||mi.test(t.willChange||"")||hi.test(t.contain||"")}function bi(e){let t=He(e);for(;me(t)&&!je(t);){if(Yn(t))return t;if(nn(t))return null;t=He(t)}return null}function on(){return hn==null&&(hn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),hn}function je(e){return/^(html|body|#document)$/.test(Xe(e))}function Ce(e){return he(e).getComputedStyle(e)}function rn(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function He(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||Be(e);return Cn(t)?t.host:t}function or(e){const t=He(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:me(t)&&st(t)?t:or(t)}function qe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=or(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=he(r);if(s){const a=Tn(i);return t.concat(i,i.visualViewport||[],st(r)?r:[],a&&n?qe(a):[])}else return t.concat(r,qe(r,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const yt=typeof navigator<"u",bn=Ri(),rr=wi(),sr=xi(),vi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ir=bn.platform==="MacIntel"&&bn.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(bn.platform),yi=yt&&/apple/i.test(navigator.vendor),On=yt&&/android/i.test(rr)||/android/i.test(sr);yt&&rr.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ei=sr.includes("jsdom/");function Ri(){if(!yt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xi(){if(!yt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function wi(){if(!yt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Pn="data-base-ui-focusable",cr="active",ar="selected",lr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wl="ArrowLeft",Vl="ArrowRight",jl="ArrowUp",Hl="ArrowDown";function ft(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Cn(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Si(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function ur(e){return me(e)&&e.matches(lr)}function ho(e){return e?e.getAttribute("role")==="combobox"&&ur(e):!1}function In(e){return e?e.hasAttribute(Pn)?e:e.querySelector(`[${Pn}]`)||e:null}function nt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...nt(e,r.id,n)])}function bo(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ci(e){e.preventDefault(),e.stopPropagation()}function Ti(e){return"nativeEvent"in e}function Oi(e){return e.mozInputSource===0&&e.isTrusted?!0:On&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Pi(e){return Ei?!1:!On&&e.width===0&&e.height===0||On&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Ii=["top","right","bottom","left"],ht=Math.min,we=Math.max,zt=Math.round,Wt=Math.floor,Ne=e=>({x:e,y:e}),ki={left:"right",right:"left",bottom:"top",top:"bottom"};function kn(e,t,n){return we(e,ht(t,n))}function _e(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Un(e){return e==="x"?"y":"x"}function qn(e){return e==="y"?"height":"width"}function Oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zn(e){return Un(Oe(e))}function Mi(e,t,n){n===void 0&&(n=!1);const o=Ze(e),r=zn(e),s=qn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Kt(i)),[i,Kt(i)]}function Ai(e){const t=Kt(e);return[Mn(e),t,Mn(t)]}function Mn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vo=["left","right"],yo=["right","left"],Li=["top","bottom"],Fi=["bottom","top"];function Di(e,t,n){switch(e){case"top":case"bottom":return n?t?yo:vo:t?vo:yo;case"left":case"right":return t?Li:Fi;default:return[]}}function Ni(e,t,n,o){const r=Ze(e);let s=Di(Re(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Mn)))),s}function Kt(e){const t=Re(e);return ki[t]+e.slice(t.length)}function Bi(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?Bi(e):{top:e,right:e,bottom:e,left:e}}function Gt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var $i=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Xt=$i.join(","),pr=typeof Element>"u",bt=pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zt=!pr&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Jt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Jt(t.parentNode));return i},Wi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gr=function(t,n,o){if(Jt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Xt));return n&&bt.call(t,Xt)&&r.unshift(t),r=r.filter(o),r},Qt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Jt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Qt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=bt.call(i,Xt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Jt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var g=Qt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,g):r.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return r},mr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Wi(t))&&!mr(t)?0:t.tabIndex},Vi=function(t,n){var o=hr(t);return o<0&&n&&!mr(t)?0:o},ji=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},br=function(t){return t.tagName==="INPUT"},Hi=function(t){return br(t)&&t.type==="hidden"},_i=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Yi=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ui=function(t){if(!t.name)return!0;var n=t.form||Zt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Yi(r,t.form);return!s||s===t},qi=function(t){return br(t)&&t.type==="radio"},zi=function(t){return qi(t)&&!Ui(t)},Ki=function(t){var n,o=t&&Zt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=Zt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},Eo=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Gi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=bt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(bt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=Zt(t);if(l&&!l.shadowRoot&&r(l)===!0)return Eo(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Ki(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Eo(t);return!1},Xi=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return bt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},An=function(t,n){return!(n.disabled||Hi(n)||Gi(n,t)||_i(n)||Xi(n))},Ln=function(t,n){return!(zi(n)||hr(n)<0||!An(t,n))},Zi=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=Vi(a,i),l=i?vr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(ji).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},At=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:Ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Zi}):o=gr(t,n.includeContainer,Ln.bind(null,n)),vr(o)},Ji=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Qt([t],n.includeContainer,{filter:An.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gr(t,n.includeContainer,An.bind(null,n)),o},yr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return bt.call(t,Xt)===!1?!1:Ln(n,t)};const Et=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Er(e,t){const n=At(e,Et()),o=n.length;if(o===0)return;const r=ft(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Kn(e){return Er(fe(e).body,1)||e}function Rr(e){return Er(fe(e).body,-1)||e}function xr(e,t){if(!e)return null;const n=At(fe(e).body,Et()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Qi(e){return xr(e,1)}function ec(e){return xr(e,-1)}function dt(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function tc(e){At(e,Et()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ro(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const nc={...zo};let xo=0;function oc(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(xo+=1,o(`${t}-${xo}`))},[n,t]),r}const wo=nc.useId;function Rt(e,t){if(wo!==void 0){const n=wo();return e??(t?`${t}-${n}`:n)}return oc(e,t)}function wr(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(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)}}}class rc{nodesRef={current:[]};events=wr();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Sr=d.createContext(null),Cr=d.createContext(null),it=()=>d.useContext(Sr)?.id||null,xt=e=>{const t=d.useContext(Cr);return e??t};function sc(e){const t=Rt(),n=xt(e),o=it();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function ic(e){const{children:t,id:n}=e,o=it();return ee.jsx(Sr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function cc(e){const{children:t,externalTree:n}=e,o=ke(()=>n??new rc).current;return ee.jsx(Cr.Provider,{value:o,children:t})}const ac=500,lc={style:{transition:"none"}},Tr="data-base-ui-click-trigger",_l={fallbackAxisSide:"none"},uc={fallbackAxisSide:"end"},fc={clipPath:"inset(50%)",position:"fixed",top:0,left:0},dc="none",ze="trigger-press",Se="trigger-hover",Or="outside-press",Yl="item-press",Ul="close-press",It="focus-out",Pr="escape-key",ql="list-navigation",zl="cancel-open",Ir="imperative-action",Kl="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=Ee;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function kt(e){return`data-base-ui-${e}`}function vn(e,t,n){if(n&&!mt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function ct(e){return e?.ownerDocument||document}const vt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{yi&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Xo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let So=0;function yn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(So);const s=()=>e?.focus({preventScroll:n});r?s():So=requestAnimationFrame(s)}const pt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Co(e){return e==="inert"?pt.inert:e==="aria-hidden"?pt["aria-hidden"]:pt.none}let Vt=new WeakSet,jt={},En=0;const kr=e=>e&&(e.host||kr(e.parentNode)),pc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=kr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function gc(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=pc(t,e),a=new Set,c=new Set(i),l=[];jt[r]||(jt[r]=new WeakMap);const u=jt[r];i.forEach(f),p(t),a.clear();function f(g){!g||a.has(g)||(a.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||c.has(g)||[].forEach.call(g.children,m=>{if(Xe(m)!=="script")if(a.has(m))p(m);else{const h=s?m.getAttribute(s):null,v=h!==null&&h!=="false",E=Co(s),b=(E.get(m)||0)+1,R=(u.get(m)||0)+1;E.set(m,b),u.set(m,R),l.push(m),b===1&&v&&Vt.add(m),R===1&&m.setAttribute(r,""),!v&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return En+=1,()=>{l.forEach(g=>{const m=Co(s),v=(m.get(g)||0)-1,E=(u.get(g)||0)-1;m.set(g,v),u.set(g,E),v||(!Vt.has(g)&&s&&g.removeAttribute(s),Vt.delete(g)),E||g.removeAttribute(r)}),En-=1,En||(pt.inert=new WeakMap,pt["aria-hidden"]=new WeakMap,pt.none=new WeakMap,Vt=new WeakSet,jt={})}}function mc(e,t=!1,n=!1){const o=fe(e[0]).body;return gc(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function To(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Wn(19)?n?.ref:t.ref)??null}function Fn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function hc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function bc(e,t){return typeof e=="function"?e(t):e}function vc(e,t){return typeof e=="function"?e(t):e}const Pt={};function Mr(e,t,n,o,r){let s={...Dn(e,Pt)};return t&&(s=Tt(s,t)),n&&(s=Tt(s,n)),o&&(s=Tt(s,o)),r&&(s=Tt(s,r)),s}function yc(e){if(e.length===0)return Pt;if(e.length===1)return Dn(e[0],Pt);let t={...Dn(e[0],Pt)};for(let n=1;n<e.length;n+=1)t=Tt(t,e[n]);return t}function Tt(e,t){return Ar(t)?t(e):Ec(e,t)}function Ec(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Fn(e.style,o);break}case"className":{e[n]=Lr(e.className,o);break}default:Rc(n,o)?e[n]=xc(e[n],o):e[n]=o}}return e}function Rc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function Ar(e){return typeof e=="function"}function Dn(e,t){return Ar(e)?e(t):e??Pt}function xc(e,t){return t?e?n=>{if(wc(n)){const r=n;Nn(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Nn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Lr(e,t){return t?e?t+" "+e:t:e}function wc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Je(e,t,n={}){const o=t.render,r=Sc(t,n);if(n.enabled===!1)return null;const s=n.state??Ee;return Cc(e,o,r,s)}function Sc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Ee,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?bc(n,s):void 0,f=l?vc(o,s):void 0,p=l?hc(s,c):Ee,g=l?Fn(p,Array.isArray(a)?yc(a):a)??Ee:Ee;return typeof document<"u"&&(l?Array.isArray(i)?g.ref=As([g.ref,To(r),...i]):g.ref=Ut(g.ref,To(r),i):Ut(null,null)),l?(u!==void 0&&(g.className=Lr(g.className,u)),f!==void 0&&(g.style=Fn(g.style,f)),g):Ee}function Cc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Mr(n,t.props);return r.ref=n.ref,d.cloneElement(t,r)}if(e&&typeof e=="string")return Tc(e,n);throw new Error(Ye(8))}function Tc(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const Fr=d.createContext(null),Dr=()=>d.useContext(Fr),Oc=kt("portal");function Pc(e={}){const{ref:t,container:n,componentProps:o=Ee,elementProps:r,elementState:s}=e,i=Rt(),c=Dr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),g=Y(E=>{E!==null&&p(E)}),m=d.useRef(null);se(()=>{if(n===null){m.current&&(m.current=null,p(null),u(null));return}if(i==null)return;const E=(n&&(_n(n)?n:n.current))??c??document.body;if(E==null){m.current&&(m.current=null,p(null),u(null));return}m.current!==E&&(m.current=E,p(null),u(E))},[n,c,i]);const h=Je("div",o,{ref:[t,g],state:s,props:[{id:i,[Oc]:""},r]});return{portalNode:f,portalSubtree:l&&h?Ke.createPortal(h,l):null}}const Nr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Pc({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),g=d.useRef(null),m=d.useRef(null),[h,v]=d.useState(null),E=h?.modal,b=h?.open,R=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||E)return;function S(C){l&&C.relatedTarget&&dt(C)&&(C.type==="focusin"?Ro:tc)(l)}return l.addEventListener("focusin",S,!0),l.addEventListener("focusout",S,!0),()=>{l.removeEventListener("focusin",S,!0),l.removeEventListener("focusout",S,!0)}},[l,E]),d.useEffect(()=>{!l||b||Ro(l)},[b,l]);const y=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:l,setFocusManagerState:v}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(Fr.Provider,{value:y,children:[R&&l&&ee.jsx(vt,{"data-type":"outside",ref:f,onFocus:S=>{if(dt(S,l))g.current?.focus();else{const C=h?h.domReference:null;Rr(C)?.focus()}}}),R&&l&&ee.jsx("span",{"aria-owns":l.id,style:fc}),l&&Ke.createPortal(o,l),R&&l&&ee.jsx(vt,{"data-type":"outside",ref:p,onFocus:S=>{if(dt(S,l))m.current?.focus();else{const C=h?h.domReference:null;Kn(C)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(It,S.nativeEvent))}}})]})]})});function Ve(e){return e==null?e:"current"in e?e.current:e}function Ic(e,t){const n=he(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Oo=20;let Ue=[];function Gn(){Ue=Ue.filter(e=>e.isConnected)}function kc(e){Gn(),e&&Xe(e)!=="body"&&(Ue.push(e),Ue.length>Oo&&(Ue=Ue.slice(-Oo)))}function Rn(){return Gn(),Ue[Ue.length-1]}function Mc(e){if(!e)return null;const t=Et();return yr(e,t)?e:At(e,t)[0]||e}function Ac(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Ce(e).display!=="none"}function Po(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Et(),r=Ji(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return yr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Br(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,E=v.useState("open"),b=v.useState("domReferenceElement"),R=v.useState("floatingElement"),{events:y,dataRef:S}=v.context,C=Y(()=>S.current.floatingContext?.nodeId),T=Y(f),I=s===!1,N=ho(b)&&I,k=De(r),F=De(s),A=De(i),O=De(u),D=xt(h),P=Dr(),V=d.useRef(null),B=d.useRef(null),w=d.useRef(!1),L=d.useRef(!1),Q=d.useRef(!1),G=d.useRef(-1),X=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),q=Ut(_,m,P?.beforeInsideRef),J=Ut(ne,P?.afterInsideRef),de=ot(),pe=ot(),ge=Hn(),$e=P!=null,x=In(R),U=Y((M=x)=>M?At(M,Et()):[]),$=Y(M=>{const W=U(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(z){z.key==="Tab"&&re(x,ft(fe(x)))&&U().length===0&&!N&&Ci(z)}const W=fe(x);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,x,c,k,N,U,$]),d.useEffect(()=>{if(o||!R)return;function M(W){const z=xe(W),oe=U().indexOf(z);oe!==-1&&(G.current=oe)}return R.addEventListener("focusin",M),()=>{R.removeEventListener("focusin",M)}},[o,R,U]),d.useEffect(()=>{if(o||!E)return;const M=fe(x);function W(){Q.current=!1}function z(oe){const H=xe(oe),j=re(R,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",z,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",z,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,R,b,x,E,P]),d.useEffect(()=>{if(o||!l)return;function M(){L.current=!0,pe.start(0,()=>{L.current=!1})}function W(H){const j=H.relatedTarget,be=H.currentTarget,ae=xe(H);queueMicrotask(()=>{const We=C(),Qe=v.context.triggerElements,at=j?.hasAttribute(kt("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p)].includes(j),et=!(re(b,j)||re(R,j)||re(j,R)||re(P?.portalNode,j)||j!=null&&Qe.hasElement(j)||Qe.hasMatchingElement(ve=>re(ve,j))||at||D&&(nt(D.nodesRef.current,We).find(ve=>re(ve.context?.elements.floating,j)||re(ve.context?.elements.domReference,j))||bo(D.nodesRef.current,We).find(ve=>[ve.context?.elements.floating,In(ve.context?.elements.floating)].includes(j)||ve.context?.elements.domReference===j)));if(be===b&&x&&Po(x,k),a&&be!==b&&!Ac(ae)&&ft(fe(x))===fe(x).body){if(me(x)&&(x.focus(),a==="popup")){ge.request(()=>{x.focus()});return}const ve=G.current,Me=U(),Ae=Me[ve]||Me[Me.length-1]||x;me(Ae)&&Ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(N||!c)&&j&&et&&!L.current&&(N||j!==Rn())&&(w.current=!0,v.setOpen(!1,ce(It,H)))})}function z(){Q.current||(S.current.insideReactTree=!0,de.start(0,()=>{S.current.insideReactTree=!1}))}const te=me(b)?b:null,oe=[];if(!(!R&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),R&&(R.addEventListener("focusout",W),P&&(R.addEventListener("focusout",z,!0),oe.push(()=>{R.removeEventListener("focusout",z,!0)})),oe.push(()=>{R.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,R,x,c,D,P,v,l,a,U,N,C,k,S,de,pe,ge,p,g]),d.useEffect(()=>{if(o||!R||!E)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${kt("portal")}]`)||[]),z=(D?bo(D.nodesRef.current,C()):[]).find(H=>ho(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[R,z,...M,...T(),V.current,B.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ve(g),Ve(p),N?b:null].filter(H=>H!=null),oe=mc(te,c||N);return()=>{oe()}},[E,o,b,R,c,k,P,N,D,C,T,p,g]),se(()=>{if(!E||o||!me(x))return;const M=fe(x),W=ft(M);queueMicrotask(()=>{const z=$(x),te=F.current,oe=typeof te=="function"?te(O.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=z[0]||x:H=Ve(oe),H=H||z[0]||x,!re(x,W)&&yn(H,{preventScroll:H===x})})},[o,E,x,I,$,F,O]),se(()=>{if(o||!x)return;const M=fe(x),W=ft(M);kc(W);function z(H){if(H.open||(X.current=Ic(H.nativeEvent,Z.current)),H.reason===Se&&H.nativeEvent.type==="mouseleave"&&(w.current=!0),H.reason===Or)if(H.nested)w.current=!1;else if(Oi(H.nativeEvent)||Pi(H.nativeEvent))w.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?w.current=!1:w.current=!0}}y.on("openchange",z);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Xo),$e&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(X.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||Rn();return ae&&ae.isConnected?ae:te}const be=b||Rn()||te;return Ve(j)||be}return()=>{y.off("openchange",z);const H=ft(M),j=re(R,H)||D&&nt(D.nodesRef.current,C(),!1).some(ae=>re(ae.context?.elements.floating,H)),be=oe();queueMicrotask(()=>{const ae=Mc(be),We=typeof A.current!="boolean";A.current&&!w.current&&me(ae)&&(!(!We&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,R,x,A,S,y,D,$e,b,C]),d.useEffect(()=>{queueMicrotask(()=>{w.current=!1})},[o]),d.useEffect(()=>{if(o||!E)return;function M(z){xe(z)?.closest(`[${Tr}]`)&&(L.current=!0)}const W=fe(x);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,E,x]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:E,onOpenChange:v.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,E,v,l,b]),se(()=>{if(!(o||!x))return Po(x,k),()=>{queueMicrotask(Gn)}},[o,x,k]);const ue=!o&&(c?!N:!0)&&($e||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(vt,{"data-type":"inside",ref:q,onFocus:M=>{if(c){const W=$();yn(W[W.length-1])}else P?.portalNode&&(w.current=!1,dt(M,P.portalNode)?Kn(b)?.focus():Ve(g??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(vt,{"data-type":"inside",ref:J,onFocus:M=>{c?yn($()[0]):P?.portalNode&&(l&&(w.current=!0),dt(M,P.portalNode)?Rr(b)?.focus():Ve(p??P.afterOutsideRef)?.focus())}})]})}function Lc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=Hn(),p=ot(),g=d.useMemo(()=>({onPointerDown(m){u.current=m.pointerType},onMouseDown(m){const h=u.current,v=m.nativeEvent,E=n.select("open");if(m.button!==0||s==="click"||mt(h,!0)&&a)return;const b=o.current.openEvent,R=b?.type,y=n.select("domReferenceElement")!==m.currentTarget,S=E&&y||!(E&&i&&(!(b&&c)||R==="click"||R==="mousedown"));if(ur(v.target)){const T=ce(ze,v,v.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T);return}const C=m.currentTarget;f.request(()=>{const T=ce(ze,v,C);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,T)}):n.setOpen(S,T)})},onClick(m){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(mt(h,!0)&&a)return;const v=n.select("open"),E=o.current.openEvent,b=n.select("domReferenceElement")!==m.currentTarget,R=v&&b||!(v&&i&&(!(E&&c)||fr(E))),y=ce(ze,m.nativeEvent,m.currentTarget);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,y)}):n.setOpen(R,y)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:g}:Ee,[r,g])}function Io(e,t,n){let{reference:o,floating:r}=e;const s=Oe(t),i=zn(t),a=qn(i),c=Re(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let g;switch(c){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Ze(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}async function Fc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=_e(t,e),m=dr(g),v=a[p?f==="floating"?"reference":"floating":f],E=Gt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},S=Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:R,strategy:c}):b);return{top:(E.top-S.top+m.top)/y.y,bottom:(S.bottom-E.bottom+m.bottom)/y.y,left:(E.left-S.left+m.left)/y.x,right:(S.right-E.right+m.right)/y.x}}const Dc=50,Nc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Fc},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Io(l,o,c),p=o,g=0;const m={};for(let h=0;h<s.length;h++){const v=s[h];if(!v)continue;const{name:E,fn:b}=v,{x:R,y,data:S,reset:C}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=R??u,f=y??f,m[E]={...m[E],...S},C&&g<Dc&&(g++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):C.rects),{x:u,y:f}=Io(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:m}},Bc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=_e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Re(r),b=Oe(a),R=Re(a)===a,y=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=p||(R||!h?[Kt(a)]:Ai(a)),C=m!=="none";!p&&C&&S.push(...Ni(a,h,m,y));const T=[a,...S],I=await c.detectOverflow(t,v),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[E]),f){const D=Mi(r,i,y);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var F,A;const D=(((F=s.flip)==null?void 0:F.index)||0)+1,P=T[D];if(P&&(!(f==="alignment"?b!==Oe(P):!1)||k.every(w=>Oe(w.placement)===b?w.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter(B=>B.overflows[0]<=0).sort((B,w)=>B.overflows[1]-w.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(g){case"bestFit":{var O;const B=(O=k.filter(w=>{if(C){const L=Oe(w.placement);return L===b||L==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((w,L)=>w[1]-L[1])[0])==null?void 0:O[0];B&&(V=B);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function ko(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mo(e){return Ii.some(t=>e[t]>=0)}const $c=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=_e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=ko(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Mo(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=ko(i,n.floating);return{data:{escapedOffsets:a,escaped:Mo(a)}}}default:return{}}}}},$r=new Set(["left","top"]);async function Wc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Re(n),a=Ze(n),c=Oe(n)==="y",l=$r.has(i)?-1:1,u=s&&c?-1:1,f=_e(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(g=a==="end"?m*-1:m),c?{x:g*u,y:p*l}:{x:p*l,y:g*u}}const Vc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Wc(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},jc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:E=>{let{x:b,y:R}=E;return{x:b,y:R}}},...l}=_e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=Oe(Re(r)),g=Un(p);let m=u[g],h=u[p];if(i){const E=g==="y"?"top":"left",b=g==="y"?"bottom":"right",R=m+f[E],y=m-f[b];m=kn(R,m,y)}if(a){const E=p==="y"?"top":"left",b=p==="y"?"bottom":"right",R=h+f[E],y=h-f[b];h=kn(R,h,y)}const v=c.fn({...t,[g]:m,[p]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:i,[p]:a}}}}}},Hc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=_e(e,t),u={x:n,y:o},f=Oe(r),p=Un(f);let g=u[p],m=u[f];const h=_e(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const R=p==="y"?"height":"width",y=s.reference[p]-s.floating[R]+v.mainAxis,S=s.reference[p]+s.reference[R]-v.mainAxis;g<y?g=y:g>S&&(g=S)}if(l){var E,b;const R=p==="y"?"width":"height",y=$r.has(Re(r)),S=s.reference[f]-s.floating[R]+(y&&((E=i.offset)==null?void 0:E[f])||0)+(y?0:v.crossAxis),C=s.reference[f]+s.reference[R]+(y?0:((b=i.offset)==null?void 0:b[f])||0)-(y?v.crossAxis:0);m<S?m=S:m>C&&(m=C)}return{[p]:g,[f]:m}}}},_c=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=_e(e,t),u=await i.detectOverflow(t,l),f=Re(r),p=Ze(r),g=Oe(r)==="y",{width:m,height:h}=s.floating;let v,E;f==="top"||f==="bottom"?(v=f,E=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(E=f,v=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,R=m-u.left-u.right,y=ht(h-u[v],b),S=ht(m-u[E],R),C=!t.middlewareData.shift;let T=y,I=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=b),C&&!p){const k=we(u.left,0),F=we(u.right,0),A=we(u.top,0),O=we(u.bottom,0);g?I=m-2*(k!==0||F!==0?k+F:we(u.left,u.right)):T=h-2*(A!==0||O!==0?A+O:we(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:T});const N=await i.getDimensions(a.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function Wr(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=zt(n)!==s||zt(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Xn(e){return ie(e)?e:e.contextElement}function gt(e){const t=Xn(e);if(!me(t))return Ne(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Wr(t);let i=(s?zt(n.width):n.width)/o,a=(s?zt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Yc=Ne(0);function Vr(e){const t=he(e);return!on()||!t.visualViewport?Yc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Uc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==he(e)?!1:t}function rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Xn(e);let i=Ne(1);t&&(o?ie(o)&&(i=gt(o)):i=gt(e));const a=Uc(s,n,o)?Vr(s):Ne(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=he(s),g=o&&ie(o)?he(o):o;let m=p,h=Tn(m);for(;h&&o&&g!==m;){const v=gt(h),E=h.getBoundingClientRect(),b=Ce(h),R=E.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,y=E.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=R,l+=y,m=he(h),h=Tn(m)}}return Gt({width:u,height:f,x:c,y:l})}function sn(e,t){const n=rn(e).scrollLeft;return t?t.left+n:rt(Be(e)).left+n}function jr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-sn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function qc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Be(o),a=t?nn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Ne(1);const u=Ne(0),f=me(o);if((f||!f&&!s)&&((Xe(o)!=="body"||st(i))&&(c=rn(o)),f)){const g=rt(o);l=gt(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}const p=i&&!f&&!s?jr(i,c):Ne(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function zc(e){return Array.from(e.getClientRects())}function Kc(e){const t=Be(e),n=rn(e),o=e.ownerDocument.body,r=we(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=we(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+sn(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(i+=we(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const Ao=25;function Gc(e,t){const n=he(e),o=Be(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=on();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=sn(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-g);m<=Ao&&(s-=m)}else l<=Ao&&(s+=l);return{width:s,height:i,x:a,y:c}}function Xc(e,t){const n=rt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=me(e)?gt(e):Ne(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function Lo(e,t,n){let o;if(t==="viewport")o=Gc(e,n);else if(t==="document")o=Kc(Be(e));else if(ie(t))o=Xc(t,n);else{const r=Vr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Gt(o)}function Hr(e,t){const n=He(e);return n===t||!ie(n)||je(n)?!1:Ce(n).position==="fixed"||Hr(n,t)}function Zc(e,t){const n=t.get(e);if(n)return n;let o=qe(e,[],!1).filter(a=>ie(a)&&Xe(a)!=="body"),r=null;const s=Ce(e).position==="fixed";let i=s?He(e):e;for(;ie(i)&&!je(i);){const a=Ce(i),c=Yn(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||st(i)&&!c&&Hr(e,i))?o=o.filter(u=>u!==i):r=a,i=He(i)}return t.set(e,o),o}function Jc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?nn(t)?[]:Zc(t,this._c):[].concat(n),o],a=Lo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const g=Lo(t,i[p],r);c=we(g.top,c),l=ht(g.right,l),u=ht(g.bottom,u),f=we(g.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function Qc(e){const{width:t,height:n}=Wr(e);return{width:t,height:n}}function ea(e,t,n){const o=me(t),r=Be(t),s=n==="fixed",i=rt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Ne(0);function l(){c.x=sn(r)}if(o||!o&&!s)if((Xe(t)!=="body"||st(r))&&(a=rn(t)),o){const g=rt(t,!0,s,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?jr(r,a):Ne(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function xn(e){return Ce(e).position==="static"}function Fo(e,t){if(!me(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Be(e)===n&&(n=n.ownerDocument.body),n}function _r(e,t){const n=he(e);if(nn(e))return n;if(!me(e)){let r=He(e);for(;r&&!je(r);){if(ie(r)&&!xn(r))return r;r=He(r)}return n}let o=Fo(e,t);for(;o&&gi(o)&&xn(o);)o=Fo(o,t);return o&&je(o)&&xn(o)&&!Yn(o)?n:o||bi(e)||n}const ta=async function(e){const t=this.getOffsetParent||_r,n=this.getDimensions,o=await n(e.floating);return{reference:ea(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function na(e){return Ce(e).direction==="rtl"}const oa={convertOffsetParentRelativeRectToViewportRelativeRect:qc,getDocumentElement:Be,getClippingRect:Jc,getOffsetParent:_r,getElementRects:ta,getClientRects:zc,getDimensions:Qc,getScale:gt,isElement:ie,isRTL:na};function Yr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ra(e,t){let n=null,o;const r=Be(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:g}=l;if(a||t(),!p||!g)return;const m=Wt(f),h=Wt(r.clientWidth-(u+p)),v=Wt(r.clientHeight-(f+g)),E=Wt(u),R={rootMargin:-m+"px "+-h+"px "+-v+"px "+-E+"px",threshold:we(0,ht(1,c))||1};let y=!0;function S(C){const T=C[0].intersectionRatio;if(T!==c){if(!y)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Yr(l,e.getBoundingClientRect())&&i(),y=!1}try{n=new IntersectionObserver(S,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,R)}n.observe(e)}return i(!0),s}function Do(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Xn(e),u=r||s?[...l?qe(l):[],...t?qe(t):[]]:[];u.forEach(E=>{r&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const f=l&&a?ra(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(E=>{let[b]=E;b&&b.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(t)})),n()}),l&&!c&&g.observe(l),t&&g.observe(t));let m,h=c?rt(e):null;c&&v();function v(){const E=rt(e);h&&!Yr(h,E)&&n(),h=E,m=requestAnimationFrame(v)}return n(),()=>{var E;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(E=g)==null||E.disconnect(),g=null,c&&cancelAnimationFrame(m)}}const sa=Vc,ia=jc,ca=Bc,aa=_c,la=$c,ua=Hc,fa=(e,t,n)=>{const o=new Map,r={platform:oa,...n},s={...r.platform,_c:o};return Nc(e,t,{...r,platform:s})};var da=typeof document<"u",pa=function(){},_t=da?d.useLayoutEffect:pa;function en(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!en(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!en(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ur(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function No(e,t){const n=Ur(e);return Math.round(t*n)/n}function wn(e){const t=d.useRef(e);return _t(()=>{t.current=e}),t}function ga(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=d.useState(o);en(p,o)||g(o);const[m,h]=d.useState(null),[v,E]=d.useState(null),b=d.useCallback(w=>{w!==C.current&&(C.current=w,h(w))},[]),R=d.useCallback(w=>{w!==T.current&&(T.current=w,E(w))},[]),y=s||m,S=i||v,C=d.useRef(null),T=d.useRef(null),I=d.useRef(u),N=c!=null,k=wn(c),F=wn(r),A=wn(l),O=d.useCallback(()=>{if(!C.current||!T.current)return;const w={placement:t,strategy:n,middleware:p};F.current&&(w.platform=F.current),fa(C.current,T.current,w).then(L=>{const Q={...L,isPositioned:A.current!==!1};D.current&&!en(I.current,Q)&&(I.current=Q,Ke.flushSync(()=>{f(Q)}))})},[p,t,n,F,A]);_t(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(w=>({...w,isPositioned:!1})))},[l]);const D=d.useRef(!1);_t(()=>(D.current=!0,()=>{D.current=!1}),[]),_t(()=>{if(y&&(C.current=y),S&&(T.current=S),y&&S){if(k.current)return k.current(y,S,O);O()}},[y,S,O,k,N]);const P=d.useMemo(()=>({reference:C,floating:T,setReference:b,setFloating:R}),[b,R]),V=d.useMemo(()=>({reference:y,floating:S}),[y,S]),B=d.useMemo(()=>{const w={position:n,left:0,top:0};if(!V.floating)return w;const L=No(V.floating,u.x),Q=No(V.floating,u.y);return a?{...w,transform:"translate("+L+"px, "+Q+"px)",...Ur(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:O,refs:P,elements:V,floatingStyles:B}),[u,O,P,V,B])}const ma=(e,t)=>{const n=sa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ha=(e,t)=>{const n=ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},ba=(e,t)=>({fn:ua(e).fn,options:[e,t]}),va=(e,t)=>{const n=ca(e);return{name:n.name,fn:n.fn,options:[e,t]}},ya=(e,t)=>{const n=aa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ea=(e,t)=>{const n=la(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ra={intentional:"onClick",sloppy:"onPointerDown"};function xa(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function qr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:v,externalTree:E}=t,b=xt(E),R=Y(typeof f=="function"?f:()=>!1),y=typeof f=="function"?R:f,S=d.useRef(!1),{escapeKey:C,outsidePress:T}=xa(v),I=d.useRef(null),N=ot(),k=ot(),F=Y(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),O=d.useRef(""),D=Y(x=>{O.current=x.pointerType}),P=Y(()=>{const x=O.current,U=x==="pen"||!x?"mouse":x,$=typeof p=="function"?p():p;return typeof $=="string"?$:$[U]}),V=Y(x=>{if(!o||!l||!u||x.key!=="Escape"||A.current)return;const U=c.current.floatingContext?.nodeId,$=b?nt(b.nodesRef.current,U):[];if(!C&&$.length>0){let W=!0;if($.forEach(z=>{z.context?.open&&!z.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=Ti(x)?x.nativeEvent:x,M=ce(Pr,ue);n.setOpen(!1,M),!C&&!M.isPropagationAllowed&&x.stopPropagation()}),B=Y(x=>{const U=P();return U==="intentional"&&x.type!=="click"||U==="sloppy"&&x.type==="click"}),w=Y(()=>{c.current.insideReactTree=!0,k.start(0,F)}),L=Y((x,U=!1)=>{if(B(x)){F();return}if(c.current.insideReactTree){F();return}if(P()==="intentional"&&U||typeof y=="function"&&!y(x))return;const $=xe(x),ue=`[${kt("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if($&&(W.hasElement($)||W.hasMatchingElement(j=>re(j,$))))return;let z=ie($)?$:null;for(;z&&!je(z);){const j=He(z);if(je(j)||!ie(j))break;z=j}if(M.length&&ie($)&&!Si($)&&!re($,n.select("floatingElement"))&&Array.from(M).every(j=>!re(z,j)))return;if(me($)&&!("touches"in x)){const j=je($),be=Ce($),ae=/auto|scroll/,We=j||ae.test(be.overflowX),Qe=j||ae.test(be.overflowY),at=We&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,et=Qe&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,ve=be.direction==="rtl",Me=et&&(ve?x.offsetX<=$.offsetWidth-$.clientWidth:x.offsetX>$.clientWidth),Ae=at&&x.offsetY>$.clientHeight;if(Me||Ae)return}const te=c.current.floatingContext?.nodeId,oe=b&&nt(b.nodesRef.current,te).some(j=>Pe(x,j.context?.elements.floating));if(Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||oe)return;const H=b?nt(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(be=>{be.context?.open&&!be.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(Or,x)),F()}),Q=Y(x=>{P()!=="sloppy"||x.pointerType==="touch"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||L(x)}),G=Y(x=>{if(P()!=="sloppy"||!n.select("open")||!l||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];U&&(I.current={startTime:Date.now(),startX:U.clientX,startY:U.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),X=Y(x=>{const U=xe(x);function $(){G(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)}),Z=Y(x=>{const U=S.current;if(S.current=!1,N.clear(),x.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const $=xe(x);function ue(){x.type==="pointerdown"?Q(x):L(x,U),$?.removeEventListener(x.type,ue)}$?.addEventListener(x.type,ue)}),_=Y(x=>{if(P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement")))return;const U=x.touches[0];if(!U)return;const $=Math.abs(U.clientX-I.current.startX),ue=Math.abs(U.clientY-I.current.startY),M=Math.sqrt($*$+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(L(x),N.clear(),I.current=null)}),ne=Y(x=>{const U=xe(x);function $(){_(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)}),q=Y(x=>{P()!=="sloppy"||!I.current||Pe(x,n.select("floatingElement"))||Pe(x,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&L(x),N.clear(),I.current=null)}),J=Y(x=>{const U=xe(x);function $(){q(x),U?.removeEventListener(x.type,$)}U?.addEventListener(x.type,$)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=C,c.current.__outsidePressBubbles=T;const x=new Ge;function U(z){n.setOpen(!1,ce(dc,z))}function $(){x.clear(),A.current=!0}function ue(){x.start(on()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",$),M.addEventListener("compositionend",ue)),y&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",X,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=qe(i)),ie(r)&&(W=W.concat(qe(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(qe(s.contextElement)))),W=W.filter(z=>z!==M.defaultView?.visualViewport),W.forEach(z=>{z.addEventListener("scroll",U,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",$),M.removeEventListener("compositionend",ue)),y&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",X,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(z=>{z.removeEventListener("scroll",U)}),x.clear(),S.current=!1}},[c,r,s,i,u,y,o,a,h,l,C,T,V,L,Z,Q,X,ne,J,D,n]),d.useEffect(F,[y,F]);const de=d.useMemo(()=>({onKeyDown:V,...g&&{[Ra[m]]:x=>{n.setOpen(!1,ce(ze,x.nativeEvent))},...m!=="intentional"&&{onClick(x){n.setOpen(!1,ce(ze,x.nativeEvent))}}}}),[V,n,g,m]),pe=Y(x=>{const U=xe(x.nativeEvent);!re(n.select("floatingElement"),U)||x.button!==0||(S.current=!0)}),ge=Y(x=>{!o||!l||x.button!==0||(S.current=!0)}),$e=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:w,onMouseDownCapture(x){w(),ge(x)},onPointerDownCapture(x){w(),ge(x)},onMouseUpCapture:w,onTouchEndCapture:w,onTouchMoveCapture:w}),[V,pe,w,ge]);return d.useMemo(()=>l?{reference:de,floating:$e,trigger:de}:{},[l,de,$e])}const wa={open:K(e=>e.open),domReferenceElement:K(e=>e.domReferenceElement),referenceElement:K(e=>e.positionReference??e.referenceElement),floatingElement:K(e=>e.floatingElement),floatingId:K(e=>e.floatingId)};class Zn extends Vn{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:wr(),nested:n,noEmit:o,triggerElements:s},wa)}setOpen=(t,n)=>{if((!t||!this.state.open||fr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Sa(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Fe.request(()=>{r("ending")});return()=>{Fe.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Fe.request(()=>{r(void 0)});return()=>{Fe.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Fe.request(()=>{r("idle")});return()=>{Fe.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Mt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Ca={[Mt.startingStyle]:""},Ta={[Mt.endingStyle]:""},cn={transitionStatus(e){return e==="starting"?Ca:e==="ending"?Ta:null}};function zr(e,t=!1,n=!0){const o=Hn();return Y((r,s=null)=>{o.cancel();function i(){Ke.flushSync(r)}const a=Ve(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Mt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Jn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=zr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function Oa(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Pa(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Oa(e,n),i=Y(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Kr(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Gr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=Sa(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=Y(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Jn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class an{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Ia(){return new Zn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new an,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Xr(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Ia(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ee,inactiveTriggerProps:Ee,popupProps:Ee}}const Zr={open:K(e=>e.open),mounted:K(e=>e.mounted),transitionStatus:K(e=>e.transitionStatus),floatingRootContext:K(e=>e.floatingRootContext),preventUnmountingOnClose:K(e=>e.preventUnmountingOnClose),payload:K(e=>e.payload),activeTriggerId:K(e=>e.activeTriggerId),activeTriggerElement:K(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:K((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:K((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:K((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:K(e=>e.popupProps),popupElement:K(e=>e.popupElement),positionerElement:K(e=>e.positionerElement)};function ka(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Rt(),s=it()!=null,i=ke(()=>new Zn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new an,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Ma(e={}){const{nodeId:t,externalTree:n}=e,o=ka(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=xt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=ga({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(T=>{const I=ie(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;a(I),u.refs.setReference(I)},[u.refs]),[p,g]=d.useState(null),[m,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",m);const v=d.useCallback(T=>{(ie(T)||T===null)&&(c.current=T,g(T)),(ie(u.refs.reference.current)||u.refs.reference.current===null||T!==null&&!ie(T))&&u.refs.setReference(T)},[u.refs,g]),E=d.useCallback(T=>{h(T),u.refs.setFloating(T)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:v,setFloating:E,setPositionReference:f,domReference:c}),[u.refs,v,E,f]),R=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),y=r.useState("open"),S=r.useState("floatingId"),C=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:y,onOpenChange:r.setOpen,events:r.context.events,floatingId:S,refs:b,elements:R,nodeId:t,rootStore:r}),[u,b,R,t,r,y,S]);return se(()=>{r.context.dataRef.current.floatingContext=C;const T=l?.nodesRef.current.find(I=>I.id===t);T&&(T.context=C)}),d.useMemo(()=>({...u,context:C,refs:b,elements:R,rootStore:r}),[u,b,R,C,r])}function Jr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Rt(),i=it()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=ke(()=>new Zn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const Bn=kt("safe-polygon"),Aa=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lr}`;function La(e){return e?!!e.closest(Aa):!1}function Qr(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=ot(),l=ot(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Fa=new Set(["click","mousedown"]);function Da(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:g,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:v,handleCloseOptionsRef:E}=Qr(n),b=xt(l),R=it(),y=Y(()=>f.current?!0:i.current.openEvent?Fa.has(i.current.openEvent.type):!1),S=Y(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),C=d.useCallback((k,F=!0)=>{const A=Na(c,u.current);A&&!p.current?v.start(A,()=>n.setOpen(!1,ce(Se,k))):F&&(v.clear(),n.setOpen(!1,ce(Se,k)))},[c,p,n,u,v]),T=Y(()=>{m.current(),p.current=void 0}),I=Y(()=>{if(g.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute(Bn),g.current=!1}}),N=Y(k=>{const F=xe(k);if(!La(F)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,T(),I())},[o,u,h,f,T,I]),d.useEffect(()=>()=>{T()},[T]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&E.current?.blockPointerEvents&&S()&&ie(s)&&r){g.current=!0;const k=fe(r).body;k.setAttribute(Bn,"");const F=s,A=r,O=b?.nodesRef.current.find(D=>D.id===R)?.context?.elements.floating;return O&&(O.style.pointerEvents=""),k.style.pointerEvents="none",F.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",F.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,E,S,b,R,g]),d.useEffect(()=>{if(!a)return;function k(D){if(y()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),T(),y()||C(D))}function F(D){v.clear(),I(),p.current?.(D),T()}function A(D){y()||C(D,!1)}const O=r;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",A),O.addEventListener("pointerdown",N,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",A),O.removeEventListener("pointerdown",N,!0))}})}function Na(e,t){return t&&!mt(t)?0:typeof e=="function"?e():e}function Sn(e){return typeof e=="function"?e():e}const Ba={current:null};function $a(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Ba,externalTree:p,isActiveTrigger:g=!0}=t,m=xt(p),{pointerTypeRef:h,interactedInsideRef:v,handlerRef:E,blockMouseMoveRef:b,performedPointerEventsMutationRef:R,unbindMouseMoveRef:y,restTimeoutPendingRef:S,openChangeTimeout:C,restTimeout:T,handleCloseOptionsRef:I}=Qr(n),N=De(a),k=De(i),F=De(l);g&&(I.current=N.current?.__options);const A=Y(()=>v.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),O=d.useCallback((B,w=!0)=>{const L=vn(k.current,"close",h.current);L&&!E.current?C.start(L,()=>n.setOpen(!1,ce(Se,B))):w&&(C.clear(),n.setOpen(!1,ce(Se,B)))},[k,E,n,h,C]),D=Y(()=>{y.current(),E.current=void 0}),P=Y(()=>{if(R.current){const B=fe(n.select("domReferenceElement")).body;B.style.pointerEvents="",B.removeAttribute(Bn),R.current=!1}});d.useEffect(()=>{if(!s)return;function B(w){w.open||(C.clear(),T.clear(),b.current=!0,S.current=!1)}return r.on("openchange",B),()=>{r.off("openchange",B)}},[s,r,C,T,b,S]);const V=Y(B=>{if(A()||!o.current.floatingContext)return;const w=n.context.triggerElements;if(B.relatedTarget&&w.hasElement(B.relatedTarget))return;const L=f.current;N.current?.({...o.current.floatingContext,tree:m,x:B.clientX,y:B.clientY,onClose(){P(),D(),!A()&&L===n.select("domReferenceElement")&&O(B)}})(B)});return d.useEffect(()=>{if(!s)return;const B=f.current??(g?n.select("domReferenceElement"):null);if(!ie(B))return;function w(G){if(C.clear(),b.current=!1,c&&!mt(h.current)||Sn(F.current)>0&&!vn(k.current,"open"))return;const X=vn(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(G.target)||_.hasMatchingElement(pe=>re(pe,G.target)))&&(!Z||!re(Z,G.target)),q=G.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(Se,G,q)):X?C.start(X,()=>{de&&n.setOpen(!0,ce(Se,G,q))}):de&&n.setOpen(!0,ce(Se,G,q))}function L(G){if(A()){P();return}y.current();const X=n.select("domReferenceElement"),Z=fe(X);T.clear(),S.current=!1;const _=n.context.triggerElements;if(G.relatedTarget&&_.hasElement(G.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||C.clear();const q=f.current;E.current=N.current({...o.current.floatingContext,tree:m,x:G.clientX,y:G.clientY,onClose(){P(),D(),!A()&&q===n.select("domReferenceElement")&&O(G,!0)}});const J=E.current;J(G),Z.addEventListener("mousemove",J),y.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),G.relatedTarget))&&O(G)}function Q(G){V(G)}return n.select("open")&&B.addEventListener("mouseleave",Q),u&&B.addEventListener("mousemove",w,{once:!0}),B.addEventListener("mouseenter",w),B.addEventListener("mouseleave",L),()=>{B.removeEventListener("mouseleave",Q),u&&B.removeEventListener("mousemove",w),B.removeEventListener("mouseenter",w),B.removeEventListener("mouseleave",L)}},[D,P,b,o,k,O,n,s,N,V,g,A,c,u,h,F,T,S,C,f,m,y,E]),d.useMemo(()=>{function B(w){h.current=w.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(w){const{nativeEvent:L}=w,Q=w.currentTarget,G=n.select("domReferenceElement"),X=n.context.triggerElements,Z=n.select("open"),_=(X.hasElement(w.target)||X.hasMatchingElement(q=>re(q,w.target)))&&(!G||!re(G,w.target));if(c&&!mt(h.current)||Z&&!_||Sn(F.current)===0||!_&&S.current&&w.movementX**2+w.movementY**2<2)return;T.clear();function ne(){if(S.current=!1,A())return;const q=n.select("open");!b.current&&(!q||_)&&n.setOpen(!0,ce(Se,L,Q))}h.current==="touch"?Ke.flushSync(()=>{ne()}):_&&Z?ne():(S.current=!0,T.start(Sn(F.current),ne))}}},[b,A,c,n,h,F,T,S])}function Qn(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Ht(l,e,"reference"),t),i=d.useCallback(l=>Ht(l,e,"floating"),n),a=d.useCallback(l=>Ht(l,e,"item"),o),c=d.useCallback(l=>Ht(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Ht(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Pn]="");for(const i in e)r&&e&&(i===cr||i===ar)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Bo(s,a,r,o)}return Bo(s,e,r,o),s}function Bo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===cr||r===ar)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Wa=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function es(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=Rt(),u=s?.id||l,f=d.useMemo(()=>In(i)?.id||r,[i,r]),p=Wa.get(c)??c,m=it()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?Ee:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,m,c]),v=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),E=d.useMemo(()=>{const R={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?R:{...R,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:R,selected:y})=>{const S={role:"option",...R&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...S,"aria-selected":y}}return{}},[f,c]);return d.useMemo(()=>a?{reference:v,floating:E,item:b,trigger:h}:{},[a,v,E,h,b])}function $o(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function Va(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ja(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ge;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const g=performance.now(),m=g-c;if(i===null||a===null||m===0)return i=f,a=p,c=g,null;const h=f-i,v=p-a,b=Math.sqrt(h*h+v*v)/m;return i=f,a=p,c=g,b}const u=({x:f,y:p,placement:g,elements:m,onClose:h,nodeId:v,tree:E})=>function(R){function y(){r.clear(),h()}if(r.clear(),!m.domReference||!m.floating||g==null||f==null||p==null)return;const{clientX:S,clientY:C}=R,T=[S,C],I=xe(R),N=R.type==="mouseleave",k=re(m.floating,I),F=re(m.domReference,I),A=m.domReference.getBoundingClientRect(),O=m.floating.getBoundingClientRect(),D=g.split("-")[0],P=f>O.right-O.width/2,V=p>O.bottom-O.height/2,B=Va(T,A),w=O.width>A.width,L=O.height>A.height,Q=(w?A:O).left,G=(w?A:O).right,X=(L?A:O).top,Z=(L?A:O).bottom;if(k&&(s=!0,!N))return;if(F&&(s=!1),F&&!N){s=!0;return}if(N&&ie(R.relatedTarget)&&re(m.floating,R.relatedTarget)||E&&nt(E.nodesRef.current,v).some(({context:q})=>q?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return y();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,O.bottom-1],[G,O.bottom-1],[G,A.top+1]];break;case"bottom":_=[[Q,O.top+1],[Q,A.bottom-1],[G,A.bottom-1],[G,O.top+1]];break;case"left":_=[[O.right-1,Z],[O.right-1,X],[A.left+1,X],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,X],[O.left+1,X],[O.left+1,Z]];break}function ne([q,J]){switch(D){case"top":{const de=[w?q+t/2:P?q+t*4:q-t*4,J+t+1],pe=[w?q-t/2:P?q+t*4:q-t*4,J+t+1],ge=[[O.left,P||w?O.bottom-t:O.top],[O.right,P?w?O.bottom-t:O.top:O.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[w?q+t/2:P?q+t*4:q-t*4,J-t],pe=[w?q-t/2:P?q+t*4:q-t*4,J-t],ge=[[O.left,P||w?O.top+t:O.bottom],[O.right,P?w?O.top+t:O.bottom:O.top+t]];return[de,pe,...ge]}case"left":{const de=[q+t+1,L?J+t/2:V?J+t*4:J-t*4],pe=[q+t+1,L?J-t/2:V?J+t*4:J-t*4];return[...[[V||L?O.right-t:O.left,O.top],[V?L?O.right-t:O.left:O.right-t,O.bottom]],de,pe]}case"right":{const de=[q-t,L?J+t/2:V?J+t*4:J-t*4],pe=[q-t,L?J-t/2:V?J+t*4:J-t*4],ge=[[V||L?O.left+t:O.right,O.top],[V?L?O.left+t:O.right:O.left+t,O.bottom]];return[de,pe,...ge]}default:return[]}}if(!$o([S,C],_)){if(s&&!B)return y();if(!N&&o){const q=l(R.clientX,R.clientY);if(q!==null&&q<.1)return y()}$o([S,C],ne([f,p]))?!s&&o&&r.start(40,y):y()}};return u.__options={blockPointerEvents:n},u}function ts(e){return Rt(e,"base-ui")}function Ha(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ns(e){const[t,n]=d.useState(null),o=Y((a,c)=>{e||n(c||(ir?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Ha(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ie=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Mt.startingStyle]="startingStyle",e[e.endingStyle=Mt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),$n=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const _a={[$n.popupOpen]:""},Ya={[$n.popupOpen]:"",[$n.pressed]:""},Ua={[Ie.open]:""},qa={[Ie.closed]:""},za={[Ie.anchorHidden]:""},Ka={open(e){return e?_a:null}},Ga={open(e){return e?Ya:null}},Lt={open(e){return e?Ua:qa},anchorHidden(e){return e?za:null}},Xa=d.createContext(void 0);function Za(e=!1){const t=d.useContext(Xa);if(t===void 0&&!e)throw new Error(Ye(16));return t}function Ja(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[o,n,t,i,a,s,r])}}function Qa(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Za(!0)!==void 0,a=Y(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=Ja({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),l=d.useCallback(()=>{const p=s.current;el(p)&&i&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,i]);se(l,[l]);const u=d.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:h,onKeyDown:v,onPointerDown:E,...b}=p;return Mr({type:r?"button":void 0,onClick(y){if(t){y.preventDefault();return}g?.(y)},onMouseDown(y){t||m?.(y)},onKeyDown(y){if(t||(Nn(y),v?.(y)),y.baseUIHandlerPrevented)return;const S=y.target===y.currentTarget&&!r&&!a()&&!t,C=y.key==="Enter",T=y.key===" ";S&&((T||C)&&y.preventDefault(),C&&g?.(y))},onKeyUp(y){t||(Nn(y),h?.(y)),!y.baseUIHandlerPrevented&&y.target===y.currentTarget&&!r&&!t&&y.key===" "&&g?.(y)},onPointerDown(y){if(t){y.preventDefault();return}E?.(y)}},r?void 0:{role:"button"},c,b)},[t,c,r,a]),f=Y(p=>{s.current=p,l()});return{getButtonProps:u,buttonRef:f}}function el(e){return me(e)&&e.tagName==="BUTTON"}function os(e){return Wn(19)?e:e?"true":void 0}let Wo={},Vo={},jo="";function tl(e){if(typeof document>"u")return!1;const t=ct(e);return he(t).innerWidth-t.documentElement.clientWidth>0}function nl(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=ct(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function ol(e){const t=ct(e),n=t.documentElement,o=t.body,r=st(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function rl(e){const t=ct(e),n=t.documentElement,o=t.body,r=he(n);let s=0,i=0,a=!1;const c=Fe.create();if(vi&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),g=r.getComputedStyle(o),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Wo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},jo=n.style.scrollBehavior,Vo={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||g.overflowY==="scroll",y=p.overflowX==="scroll"||g.overflowX==="scroll",S=Math.max(0,r.innerWidth-o.clientWidth),C=Math.max(0,r.innerHeight-o.clientHeight),T=parseFloat(g.marginTop)+parseFloat(g.marginBottom),I=parseFloat(g.marginLeft)+parseFloat(g.marginRight),N=st(n)?n:o;if(a=nl(e),a){n.style.scrollbarGutter=v,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(E||R)&&(n.style.overflowY="scroll"),(b||y)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||C?`calc(100dvh - ${T+C}px)`:"100dvh",width:I||S?`calc(100vw - ${I+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Wo),Object.assign(o.style,Vo),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=jo)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class sl{lockCount=0;restore=null;timeoutLock=Ge.create();timeoutUnlock=Ge.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=ct(t).documentElement,r=he(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nr;return}const s=ir||!tl(t);this.restore=s?ol(t):rl(t)}}const il=new sl;function rs(e=!0,t=null){se(()=>{if(e)return il.acquire(t)},[e,t])}const cl=d.createContext(void 0);function al(){return d.useContext(cl)?.direction??"ltr"}const ll=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=_e(e,t)||{};if(l==null)return{};const p=dr(u),g={x:n,y:o},m=zn(r),h=qn(m),v=await i.getDimensions(l),E=m==="y",b=E?"top":"left",R=E?"bottom":"right",y=E?"clientHeight":"clientWidth",S=s.reference[h]+s.reference[m]-g[m]-s.floating[h],C=g[m]-s.reference[m],T=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[y]||s.floating[h];(!I||!await i.isElement?.(T))&&(I=a.floating[y]||s.floating[h]);const N=S/2-C/2,k=I/2-v[h]/2-1,F=Math.min(p[b],k),A=Math.min(p[R],k),O=F,D=I-v[h]-A,P=I/2-v[h]/2+N,V=kn(O,P,D),B=!c.arrow&&Ze(r)!=null&&P!==V&&s.reference[h]/2-(P<O?F:A)-v[h]/2<0,w=B?P<O?P-O:P-D:0;return{[m]:g[m]+w,data:{[m]:V,centerOffset:P-V-w,...B&&{alignmentOffset:w}},reset:B}}}),ul=(e,t)=>({...ll(e),options:[e,t]}),fl={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Ea().fn(e)).data?.referenceHidden||s}}}},Yt={sideX:"left",sideY:"top"},dl={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=he(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Yt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=ct(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const g=Re(a);let m=t,h=n;g==="left"&&(m=p.width-(t+o.width)),g==="top"&&(h=p.height-(n+o.height));const v=g==="left"?"right":Yt.sideX,E=g==="top"?"bottom":Yt.sideY;return{x:m,y:h,data:{sideX:v,sideY:E}}}};function ss(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Ho(e,t,n){const{rects:o,placement:r}=e;return{side:ss(t,Re(r),n),align:Ze(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function pl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:g,mounted:m,collisionAvoidance:h,shiftCrossAxis:v=!1,nodeId:E,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:y}=e,[S,C]=d.useState(null);!m&&S!==null&&C(null);const T=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,F=Y(k),A=k?F:t,O=De(t),P=al()==="rtl",V=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],B=s==="center"?V:`${V}-${s}`;let w=c;const L=1,Q=o==="bottom"?L:0,G=o==="top"?L:0,X=o==="right"?L:0,Z=o==="left"?L:0;typeof w=="number"?w={top:w+Q,right:w+Z,bottom:w+G,left:w+X}:w&&(w={top:(w.top||0)+Q,right:(w.right||0)+Z,bottom:(w.bottom||0)+G,left:(w.left||0)+X});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:w},ne=d.useRef(null),q=De(r),J=De(i),ge=[ma(le=>{const ye=Ho(le,o,P),Le=typeof q.current=="function"?q.current(ye):q.current,Te=typeof J.current=="function"?J.current(ye):J.current;return{mainAxis:Le,crossAxis:Te,alignmentAxis:Te}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],$e=I==="none"&&T!=="shift",x=!$e&&(l||v||T==="shift"),U=T==="none"?null:va({..._,padding:{top:w.top+L,right:w.right+L,bottom:w.bottom+L,left:w.left+L},mainAxis:!v&&T==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),$=$e?null:ha(le=>{const ye=ct(le.elements.floating).documentElement;return{..._,rootBoundary:v?{x:0,y:0,width:ye.clientWidth,height:ye.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:x,limiter:l||v?void 0:ba(Le=>{if(!ne.current)return{};const{width:Te,height:lt}=ne.current.getBoundingClientRect(),ut=Oe(Re(Le.placement)),Dt=ut==="y"?Te:lt,ln=ut==="y"?w.left+w.right:w.top+w.bottom;return{offset:Dt/2+ln/2}})}},[_,l,v,w,I]);T==="shift"||I==="shift"||s==="center"?ge.push($,U):ge.push(U,$),ge.push(ya({..._,apply({elements:{floating:le},rects:{reference:ye},availableWidth:Le,availableHeight:Te}){Object.entries({"--available-width":`${Le}px`,"--available-height":`${Te}px`,"--anchor-width":`${ye.width}px`,"--anchor-height":`${ye.height}px`}).forEach(([lt,ut])=>{le.style.setProperty(lt,ut)})}}),ul(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ye,middlewareData:Le,placement:Te,rects:lt,y:ut}=le,Dt=Re(Te),ln=Oe(Dt),io=ne.current,Rs=Le.arrow?.x||0,xs=Le.arrow?.y||0,ws=io?.clientWidth||0,Ss=io?.clientHeight||0,un=Rs+ws/2,co=xs+Ss/2,Cs=Math.abs(Le.shift?.y||0),Ts=lt.reference.height/2,St=typeof r=="function"?r(Ho(le,o,P)):r,Os=Cs>St,Ps={top:`${un}px calc(100% + ${St}px)`,bottom:`${un}px ${-St}px`,left:`calc(100% + ${St}px) ${co}px`,right:`${-St}px ${co}px`}[Dt],Is=`${un}px ${lt.reference.y+Ts-ut}px`;return ye.floating.style.setProperty("--transform-origin",x&&ln==="y"&&Os?Is:Ps),{}}},fl,b),se(()=>{!m&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,g]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:z,y:te,middlewareData:oe,update:H,placement:j,context:be,isPositioned:ae,floatingStyles:We}=Ma({rootContext:g,placement:B,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>Do(...le,ue),nodeId:E,externalTree:y}),{sideX:Qe,sideY:at}=oe.adaptiveOrigin||Yt,et=ae?n:"fixed",ve=d.useMemo(()=>b?{position:et,[Qe]:z,[at]:te}:{position:et,...We},[b,et,Qe,z,at,te,We]),Me=d.useRef(null);se(()=>{if(!m)return;const le=O.current,ye=typeof le=="function"?le():le,Te=(_o(ye)?ye.current:ye)||null||null;Te!==Me.current&&(M.setPositionReference(Te),Me.current=Te)},[m,M,A,O]),d.useEffect(()=>{if(!m)return;const le=O.current;typeof le!="function"&&_o(le)&&le.current!==Me.current&&(M.setPositionReference(le.current),Me.current=le.current)},[m,M,A,O]),d.useEffect(()=>{if(p&&m&&W.domReference&&W.floating)return Do(W.domReference,W.floating,H,ue)},[p,m,W,H,ue]);const Ae=Re(j),to=ss(o,Ae,P),no=Ze(j)||"center",oo=!!oe.hide?.referenceHidden;se(()=>{R&&m&&ae&&C(Ae)},[R,m,ae,Ae]);const ro=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),so=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:ve,arrowStyles:ro,arrowRef:ne,arrowUncentered:so,side:to,align:no,physicalSide:Ae,anchorHidden:oo,refs:M,context:be,isPositioned:ae,update:H}),[ve,ro,ne,so,to,no,Ae,oo,M,be,ae,H])}function _o(e){return e!=null&&"current"in e}const is=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
2
2
|
0% 0%,
|
|
3
3
|
100% 0%,
|
|
4
4
|
100% 100%,
|