1import{Lg as e,Rg as t,Ug as n,zg as r}from"./messages-B7vy2gX4.js";import{U as i,W as a}from"./index-CI4CH93Q.js";import{B as o,D as s,E as c,F as l,L as u,M as d,P as f,R as p,_ as m,a as h,b as g,g as _,m as v,o as y,p as b,u as x,v as S,w as ee,x as C,y as w,z as T}from"./button-scB-LEnO.js";import{B as te,F as E,I as D,L as ne,M as re,S as ie,T as O,U as k,V as A,_ as j,a as M,b as N,d as P,h as ae,o as F,t as I,v as L,w as oe,x as R,y as se,z}from"./createBaseUIEventDetails-DqK8p_0w.js";var B=n(r()),V=[];function H(e){B.useEffect(e,V)}var U=0,W=class e{static create(){return new e}currentId=U;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=U,t()},e)}isStarted(){return this.currentId!==U}clear=()=>{this.currentId!==U&&(clearTimeout(this.currentId),this.currentId=U)};disposeEffect=()=>this.clear};function ce(){let e=T(W.create).current;return H(e.disposeEffect),e}function le(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...le(e,t.id,n)])}function ue(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function G(e){e.preventDefault(),e.stopPropagation()}function de(e){return`nativeEvent`in e}function fe(e){return e.pointerType===``&&e.isTrusted?!0:E&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function pe(e){return ne?!1:!E&&e.width===0&&e.height===0||E&&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 me(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function he(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ge=[`top`,`right`,`bottom`,`left`],_e=Math.min,ve=Math.max,K=Math.round,q=Math.floor,J=e=>({x:e,y:e}),ye={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function be(e,t,n){return ve(e,_e(t,n))}function xe(e,t){return typeof e==`function`?e(t):e}function Se(e){return e.split(`-`)[0]}function Ce(e){return e.split(`-`)[1]}function we(e){return e===`x`?`y`:`x`}function Te(e){return e===`y`?`height`:`width`}function Ee(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function De(e){return we(Ee(e))}function Oe(e,t,n){n===void 0&&(n=!1);let r=Ce(e),i=De(e),a=Te(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Le(o)),[o,Le(o)]}function ke(e){let t=Le(e);return[Ae(e),t,Ae(t)]}function Ae(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var je=[`left`,`right`],Me=[`right`,`left`],Ne=[`top`,`bottom`],Pe=[`bottom`,`top`];function Fe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Me:je:t?je:Me;case`left`:case`right`:return t?Ne:Pe;default:return[]}}function Ie(e,t,n,r){let i=Ce(e),a=Fe(Se(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ae)))),a}function Le(e){let t=Se(e);return ye[t]+e.slice(t.length)}function Re(e){return{top:0,right:0,bottom:0,left:0,...e}}function ze(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Re(e)}function Be(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ve(e,t,n){return Math.floor(e/t)!==n}function He(e,t){return t<0||t>=e.current.length}function Ue(e,t){return Y(e,{disabledIndices:t})}function We(e,t){return Y(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Y(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&Ye(e,a,r));return a}
1function Ge(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f;if(t.key===`ArrowUp`?f=`up`:t.key===`ArrowDown`&&(f=`down`),f){let n=[],i=[],p=!1,m=0;{let t=null,r=-1;e.current.forEach((e,a)=>{if(e==null)return;m+=1;let o=e.closest(`[role="row"]`);o&&(p=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(a),i[a]=r})}let h=!1,g=0;if(p)for(let e of n){let t=e.length;t>g&&(g=t),t!==a&&(h=!0)}let _=h&&m<e.current.length,v=g||a,y=t=>{if(!h||l===-1)return;let a=i[l];if(a==null)return;let s=n[a].indexOf(l),c=t===`up`?-1:1;for(let t=a+c,i=0;i<n.length;i+=1,t+=c){if(t<0||t>=n.length){if(!r||_)return;t=t<0?n.length-1:0}let i=n[t];for(let t=Math.min(s,i.length-1);t>=0;--t){let n=i[t];if(!Ye(e,n,o))return n}}},b=t=>{if(!_||l===-1)return;let n=l%v,i=t===`up`?-v:v,a=c-c%v,s=q(c/v)+1;for(let t=l-n+i,u=0;u<s;u+=1,t+=i){if(t<0||t>c){if(!r)return;t=t<0?a:0}let i=Math.min(t+v-1,c);for(let r=Math.min(t+n,i);r>=t;--r)if(!Ye(e,r,o))return r}};u&&G(t);let x=y(f)??b(f);if(x!==void 0)d=x;else if(l===-1)d=f===`up`?c:s;else if(d=Y(e,{startingIndex:l,amount:v,decrement:f===`up`,disabledIndices:o}),r){if(f===`up`&&(l-v<s||d<0)){let e=l%v,t=c%v,n=c-(t-e);d=t===e?c:t>e?n:n-v}f===`down`&&l+v>c&&(d=Y(e,{startingIndex:l%v-v,amount:v,disabledIndices:o}))}He(e,d)&&(d=l)}if(n===`both`){let n=q(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&G(t),l%a===a-1?r&&(d=Y(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=Y(e,{startingIndex:l,disabledIndices:o}),r&&Ve(d,a,n)&&(d=Y(e,{startingIndex:l-l%a-1,disabledIndices:o}))),Ve(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&G(t),l%a===0?r&&(d=Y(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=Y(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&Ve(d,a,n)&&(d=Y(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),Ve(d,a,n)&&(d=l));let s=q(c/a)===n;He(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:Y(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function Ke(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function qe(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function Je(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Ye(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e.current[t];return r?Xe(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function Xe(e){return y(e).display!==`none`}var Ze=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),Qe=typeof Element>`u`,$e=Qe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,et=!Qe&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},tt=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):tt(e.parentNode))},nt=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},rt=function(e,t,n){if(tt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ze));return t&&$e.call(e,Ze)&&r.unshift(e),r=r.filter(n),r},it=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!tt(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=it(o.length?o:a.children,!0,n);
1n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{$e.call(a,Ze)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!tt(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=it(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},at=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ot=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||nt(e))&&!at(e)?0:e.tabIndex},st=function(e,t){var n=ot(e);return n<0&&t&&!at(e)?0:n},ct=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},lt=function(e){return e.tagName===`INPUT`},ut=function(e){return lt(e)&&e.type===`hidden`},dt=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},ft=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},pt=function(e){if(!e.name)return!0;var t=e.form||et(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=ft(r,e.form);return!i||i===e},mt=function(e){return lt(e)&&e.type===`radio`},ht=function(e){return mt(e)&&!pt(e)},gt=function(e){var t=e&&et(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=et(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},_t=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},vt=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=$e.call(e,`details>summary:first-of-type`)?e.parentElement:e;if($e.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=et(e);if(o&&!o.shadowRoot&&r(o)===!0)return _t(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(gt(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return _t(e);return!1},yt=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return $e.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},bt=function(e,t){return!(t.disabled||ut(t)||vt(t,e)||dt(t)||yt(t))},xt=function(e,t){return!(ht(t)||ot(t)<0||!bt(e,t))},St=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Ct=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=st(a,i),s=i?Ct(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ct).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},wt=function(e,t){return t||={},Ct(t.getShadowRoot?it([e],t.includeContainer,{filter:xt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:St}):rt(e,t.includeContainer,xt.bind(null,t)))},Tt=function(e,t){return t||={},t.getShadowRoot?it([e],t.includeContainer,{filter:bt.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):rt(e,t.includeContainer,bt.bind(null,t))},Et=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $e.call(e,Ze)===!1?!1:xt(t,e)},Dt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Ot(e,t){let n=wt(e,Dt()),r=n.length;if(r===0)return;let i=j(A(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function kt(e){return Ot(A(e).body,1)||e}function At(e){return Ot(A(e).body,-1)||e}function jt(e,t){if(!e)return null;let n=wt(A(e).body,Dt()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Mt(e){return jt(e,1)}function Nt(e){return jt(e,-1)}function Pt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!L(n,r)}
1function Ft(e){wt(e,Dt()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function It(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Lt=null;globalThis.requestAnimationFrame;var Rt=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},X=class e{static create(){return new e}static request(e){return Rt.request(e)}static cancel(e){return Rt.cancel(e)}currentId=Lt;request(e){this.cancel(),this.currentId=Rt.request(()=>{this.currentId=Lt,e()})}cancel=()=>{this.currentId!==Lt&&(Rt.cancel(this.currentId),this.currentId=Lt)};
1disposeEffect=()=>this.cancel};function zt(){let e=T(X.create).current;return H(e.disposeEffect),e}var Bt=n(t()),Z=e();function Q(e){return e==null?e:`current`in e?e.current:e}var Vt=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Ht={[Vt.startingStyle]:``},Ut={[Vt.endingStyle]:``},Wt={transitionStatus(e){return e===`starting`?Ht:e===`ending`?Ut:null}},Gt=a(),Kt=i();function qt(e,t=!1,n=!0){let r=zt();return c((i,a=null)=>{r.cancel();function o(){Bt.flushSync(i)}let s=Q(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=Vt.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function Jt(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=c(i),o=qt(r,n,!1);B.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function Yt(e,t=!1,n=!1){let[r,i]=B.useState(e&&t?`idle`:void 0),[a,o]=B.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),h(()=>{if(!e&&a&&r!==`ending`&&n){let e=X.request(()=>{i(`ending`)});return()=>{X.cancel(e)}}},[e,a,r,n]),h(()=>{if(!e||t)return;let n=X.request(()=>{i(void 0)});return()=>{X.cancel(n)}},[t,e]),h(()=>
1{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=X.request(()=>{i(`idle`)});return()=>{X.cancel(n)}},[t,e,a,i,r]),B.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var Xt=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Vt.startingStyle]=`startingStyle`,e[e.endingStyle=Vt.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Zt=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Qt={[Zt.popupOpen]:``},$t={[Zt.popupOpen]:``,[Zt.pressed]:``},en={[Xt.open]:``},tn={[Xt.closed]:``},nn={[Xt.anchorHidden]:``},rn={open(e){return e?Qt:null}},an={open(e){return e?$t:null}},on={open(e){return e?en:tn},anchorHidden(e){return e?nn:null}};function sn(e){let t=T(cn,e).current;return t.next=e,h(t.effect),t}function cn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ln={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},un={...ln,position:`fixed`,top:0,left:0},dn={...ln,position:`absolute`},fn=B.forwardRef(function(e,t){let[n,r]=B.useState();h(()=>{z&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:un,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function pn(e){return`data-base-ui-${e}`}var mn=0;function hn(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(mn);let a=()=>e?.focus({preventScroll:n});i?a():mn=requestAnimationFrame(a)}var gn={inert:new WeakMap,"aria-hidden":new WeakMap},_n=`data-base-ui-inert`,vn={inert:new WeakSet,"aria-hidden":new WeakSet},yn=new WeakMap,bn=0;function xn(e){return vn[e]}function Sn(e){return e?C(e)?e.host:Sn(e.parentNode):null}var Cn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Sn(t);return e.contains(n)?n:null}).filter(e=>e!=null),wn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Tn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{x(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function En(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Cn(t,e),u=i?Cn(t,a):[],d=new Set(u),f=i?Tn(t,wn(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=gn[o],n=xn(o);c=n,s=e;let r=Cn(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Tn(t,wn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(yn.get(e)||0)+1;yn.set(e,t),m.push(e),t===1&&e.setAttribute(_n,``)}),bn+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(yn.get(e)||0)-1;yn.set(e,t),t||e.removeAttribute(_n)}),--bn,bn||(gn.inert=new WeakMap,gn[`aria-hidden`]=new WeakMap,vn.inert=new WeakSet,vn[`aria-hidden`]=new WeakSet,yn=new WeakMap)}}function Dn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=A(e[0]).body;return En(e,o,n,r,{mark:i,markerIgnoreElements:a})}var On=B.createContext(null),kn=()=>B.useContext(On),An=pn(`portal`);function jn(e={}){let{ref:t,container:n,componentProps:r=f,elementProps:i}=e,a=k(),o=kn()?.portalNode,[l,u]=B.useState(null),[d,p]=B.useState(null),m=c(e=>{e!==null&&p(e)}),g=B.useRef(null);h(()=>{if(n===null){g.current&&(g.current=null,p(null),u(null));return}if(a==null)return;let e=(n&&(w(n)?n:n.current))??o??document.body;if(e==null){g.current&&(g.current=null,p(null),u(null));return}g.current!==e&&(g.current=e,p(null),u(e))},[n,o,a]);let _=s(`div`,r,{ref:[t,m],props:[{id:a,[An]:``},i]});return{portalNode:d,portalSubtree:l&&_?Bt.createPortal(_,l):null}}var Mn=B.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=jn({container:r,ref:t,componentProps:e,elementProps:s}),u=B.useRef(null),f=B.useRef(null),p=B.useRef(null),m=B.useRef(null),[h,g]=B.use
1State(null),_=h?.modal,v=h?.open,y=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!c;B.useEffect(()=>{if(!c||_)return;function e(e){c&&e.relatedTarget&&Pt(e)&&(e.type===`focusin`?It:Ft)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,_]),B.useEffect(()=>{!c||v||It(c)},[v,c]);let b=B.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,Z.jsxs)(B.Fragment,{children:[l,(0,Z.jsxs)(On.Provider,{value:b,children:[y&&c&&(0,Z.jsx)(fn,{"data-type":`outside`,ref:u,onFocus:e=>{Pt(e,c)?p.current?.focus():At(h?h.domReference:null)?.focus()}}),y&&c&&(0,Z.jsx)(`span`,{"aria-owns":c.id,style:d}),c&&Bt.createPortal(n,c),y&&c&&(0,Z.jsx)(fn,{"data-type":`outside`,ref:f,onFocus:e=>{Pt(e,c)?m.current?.focus():(kt(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,I(`focus-out`,e.nativeEvent)))}})]})]})});function Nn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Pn=class{nodesRef={current:[]};events=Nn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Fn=B.createContext(null),In=B.createContext(null),Ln=()=>B.useContext(Fn)?.id||null,Rn=e=>{let t=B.useContext(In);return e??t};function zn(e){let t=k(),n=Rn(e),r=Ln();return h(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Bn(e){let{children:t,id:n}=e,r=Ln();return(0,Z.jsx)(Fn.Provider,{value:B.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Vn(e){let{children:t,externalTree:n}=e,r=T(()=>n??new Pn).current;return(0,Z.jsx)(In.Provider,{value:r,children:t})}function Hn(e,t){let n=v(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Un=20,Wn=[];function Gn(){Wn=Wn.filter(e=>e.deref()?.isConnected)}function Kn(e){Gn(),e&&x(e)!==`body`&&(Wn.push(new WeakRef(e)),Wn.length>Un&&(Wn=Wn.slice(-20)))}function qn(){return Gn(),Wn[Wn.length-1]?.deref()}function Jn(e){if(!e)return null;let t=Dt();return Et(e,t)?e:wt(e,t)[0]||e}function Yn(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():Xe(e)}function Xn(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Dt(),r=Tt(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Et(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Zn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:g,externalTree:_,getInsideElements:v}=e,y=`rootStore`in t?t.rootStore:t,b=y.useState(`open`),x=y.useState(`domReferenceElement`),S=y.useState(`floatingElement`),{events:ee,dataRef:C}=y.context,w=c(()=>C.current.floatingContext?.nodeId),T=i===!1,E=oe(x)&&T,D=B.useRef([`content`]),ne=sn(i),re=sn(a),ie=sn(u),k=Rn(_),M=kn(),P=B.useRef(!1),ae=B.useRef(!1),R=B.useRef(!1),z=B.useRef(-1),V=B.useRef(``),H=B.useRef(``),U=B.useRef(null),W=B.useRef(null),de=p(U,g,M?.beforeInsideRef),me=p(W,M?.afterInsideRef),he=ce(),ge=ce(),_e=zt(),ve=M!=null,K=se(S),q=c((e=K)=>e?wt(e,Dt()):[]),J=c(()=>v?.().filter(e=>e!=null)??[]),ye=c(e=>{let t=q(e);return D.current.map(()=>t).filter(Boolean).flat()});B.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&L(K,j(A(K)))&&q().length===0&&!E&&G(e)}let t=A(K);
1return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,x,K,s,D,E,q,ye]),B.useEffect(()=>{if(r||!b)return;let e=A(K);function t(){R.current=!1}function n(e){let t=N(e),n=J();R.current=!(L(S,t)||L(x,t)||L(M?.portalNode,t)||n.some(e=>e===t||L(e,t))),H.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(ae.current=!0)}function i(){H.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,S,x,K,b,M,J]),B.useEffect(()=>{if(r||!l)return;let e=A(K);function t(){ae.current=!0,ge.start(0,()=>{ae.current=!1})}function n(e){let t=N(e),n=q().indexOf(t);n!==-1&&(z.current=n)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=N(t);queueMicrotask(()=>{let a=w(),c=y.context.triggerElements,l=J(),u=n?.hasAttribute(pn(`focus-guard`))&&[U.current,W.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Q(f),Q(d)].includes(n),p=!(L(x,n)||L(S,n)||L(n,S)||L(M?.portalNode,n)||l.some(e=>e===n||L(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>L(e,n))||u||k&&(le(k.nodesRef.current,a).find(e=>L(e.context?.elements.floating,n)||L(e.context?.elements.domReference,n))||ue(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,se(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===x&&K&&Xn(K,D),o&&r!==x&&!Yn(i)&&j(e)===e.body){if(m(K)&&(K.focus(),o===`popup`)){_e.request(()=>{K.focus()});return}let e=z.current,t=q(),n=t[e]||t[t.length-1]||K;m(n)&&n.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(E||!s)&&n&&p&&!ae.current&&(E||n!==qn())&&(P.current=!0,y.setOpen(!1,I(F,t)))})}function a(){R.current||(C.current.insideReactTree=!0,he.start(0,()=>{C.current.insideReactTree=!1}))}let c=m(x)?x:null,u=[];if(!(!S&&!c))return c&&(c.addEventListener(`focusout`,i),c.addEventListener(`pointerdown`,t),u.push(()=>{c.removeEventListener(`focusout`,i),c.removeEventListener(`pointerdown`,t)})),S&&(S.addEventListener(`focusin`,n),S.addEventListener(`focusout`,i),M&&(S.addEventListener(`focusout`,a,!0),u.push(()=>{S.removeEventListener(`focusout`,a,!0)})),u.push(()=>{S.removeEventListener(`focusin`,n),S.removeEventListener(`focusout`,i)})),()=>{u.forEach(e=>{e()})}},[r,x,S,K,s,k,M,y,l,o,q,E,w,D,C,he,ge,_e,d,f,J]),B.useEffect(()=>{if(r||!S||!b)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${pn(`portal`)}]`)||[]),t=(k?ue(k.nodesRef.current,w()):[]).find(e=>oe(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Dn([S,...e,U.current,W.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...J(),t,Q(f),Q(d),E?x:null].filter(e=>e!=null),{ariaHidden:s||E,mark:!1}),i=Dn([S,...e].filter(e=>e!=null));return()=>{i(),n()}},[b,r,x,S,s,D,M,E,k,w,d,f,J]),h(()=>
1{if(!b||r||!m(K))return;let e=j(A(K));queueMicrotask(()=>{let t=ye(K),n=ne.current,r=typeof n==`function`?n(ie.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||K:Q(r),i=i||t[0]||K,!L(K,e)&&hn(i,{preventScroll:i===K})})},[r,b,K,T,ye,ne,ie]),h(()=>{if(r||!K)return;let e=A(K);Kn(j(e));function t(e){if(e.open||(V.current=Hn(e.nativeEvent,H.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(P.current=!0),e.reason===`outside-press`)if(e.nested)P.current=!1;else if(fe(e.nativeEvent)||pe(e.nativeEvent))P.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}ee.on(`openchange`,t);function n(){let e=re.current,t=typeof e==`function`?e(V.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=x||qn();return e&&e.isConnected?e:null}let n=x||qn();return Q(t)||n||null}return()=>{ee.off(`openchange`,t);let r=j(e),i=J(),a=L(S,r)||i.some(e=>e===r||L(e,r))||k&&le(k.nodesRef.current,w(),!1).some(e=>L(e.context?.elements.floating,r)),o=n();queueMicrotask(()=>{let t=Jn(o),n=typeof re.current!=`boolean`;re.current&&!P.current&&m(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),P.current=!1})}},[r,S,K,re,C,ee,k,x,w,J]),h(()=>
1{if(!te||b||!S)return;let e=j(A(S));!m(e)||!O(e)||L(S,e)&&e.blur()},[b,S]),h(()=>{if(!(r||!M))return M.setFocusManagerState({modal:s,closeOnFocusOut:l,open:b,onOpenChange:y.setOpen,domReference:x}),()=>{M.setFocusManagerState(null)}},[r,M,s,b,y,l,x]),h(()=>{if(!(r||!K))return Xn(K,D),()=>{queueMicrotask(Gn)}},[r,K,D]);let be=!r&&(s?!E:!0)&&(ve||s);return(0,Z.jsxs)(B.Fragment,{children:[be&&(0,Z.jsx)(fn,{"data-type":`inside`,ref:de,onFocus:e=>{if(s){let e=ye();hn(e[e.length-1])}else M?.portalNode&&(P.current=!1,Pt(e,M.portalNode)?kt(x)?.focus():Q(f??M.beforeOutsideRef)?.focus())}}),n,be&&(0,Z.jsx)(fn,{"data-type":`inside`,ref:me,onFocus:e=>{s?hn(ye()[0]):M?.portalNode&&(l&&(P.current=!0),Pt(e,M.portalNode)?At(x)?.focus():Q(d??M.afterOutsideRef)?.focus())}})]})}function Qn(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=ae}=t,d=B.useRef(void 0),p=zt(),m=ce(),h=B.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,f=n.select(`open`);if(e.button!==0||a===`click`||me(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=f&&_||!(f&&o&&(!(h&&c)||g===`click`||g===`mousedown`));if(O(i.target)){let e=I(u,i,i.target);v&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let y=e.currentTarget;p.request(()=>{let e=I(u,i,y);v&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(me(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,p=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&p||!(i&&o&&(!(f&&c)||he(f))),g=I(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?m.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,p,m,l,u]);return B.useMemo(()=>i?{reference:h}:f,[i,h])}var $n={intentional:`onClick`,sloppy:`onPointerDown`};function er(){return!1}function tr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function nr(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u=`sloppy`,referencePress:d=er,referencePressEvent:f=`sloppy`,bubbles:p,externalTree:h}=t,g=Rn(h),v=c(typeof l==`function`?l:()=>!1),x=typeof l==`function`?v:l,w=x!==!1,T=c(()=>u),te=B.useRef(!1),E=B.useRef(!1),D=B.useRef(!1),{escapeKey:ne,outsidePress:re}=tr(p),O=B.useRef(null),k=ce(),j=ce(),F=c(()=>{j.clear(),a.current.insideReactTree=!1}),oe=B.useRef(!1),se=B.useRef(``),z=c(d),V=c(e=>{if(!r||!o||!s||e.key!==`Escape`||oe.current)return;let t=a.current.floatingContext?.nodeId,i=g?le(g.nodesRef.current,t):[];if(!ne&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=I(M,de(e)?e.nativeEvent:e);n.setOpen(!1,c),!ne&&!c.isPropagationAllowed&&e.stopPropagation()}),H=c(()=>{a.current.insideReactTree=!0,j.start(0,F)});B.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=ne,a.current.__outsidePressBubbles=re;let e=new W,t=new W;function c(){e.clear(),oe.current=!0}function l(){e.start(ee()?5:0,()=>{oe.current=!1})}function u(){D.current=!0,t.start(0,()=>{D.current=!1})}function d(){te.current=!1,E.current=!1}function f(){let e=se.current,t=e===`pen`||!e?`mouse`:e,n=T(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=g&&le(g.nodesRef.current,t).some(t=>R(e,t.context?.elements.floating));return R(e,n.select(`floatingElement`))||R(e,n.select(`domReferenceElement`))||r}function v(e){if(p(e)){F();return}if(a.current.insideReactTree){F();return}let r=N(e),i=`[${pn(`inert`)}]`,o=Array.from(A(n.select(`floatingElement`)).querySelectorAll(i)),s=_(r)?r.getRootNode():null;
1C(s)&&(o=o.concat(Array.from(s.querySelectorAll(i))));let c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>L(e,r))))return;let l=_(r)?r:null;for(;l&&!S(l);){let e=b(l);if(S(e)||!_(e))break;l=e}if(o.length&&_(r)&&!ie(r)&&!L(r,n.select(`floatingElement`))&&o.every(e=>!L(l,e)))return;if(m(r)&&!(`touches`in e)){let t=S(r),n=y(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&D.current){t.clear(),D.current=!1;return}if(typeof x==`function`&&!x(e))return;let u=a.current.floatingContext?.nodeId,d=g?le(g.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,I(P,e)),F()}function j(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||R(e,n.select(`floatingElement`))||R(e,n.select(`domReferenceElement`))||v(e)}function M(e){if(f()!==`sloppy`||!n.select(`open`)||!o||R(e,n.select(`floatingElement`))||R(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function ae(e){se.current=`touch`;let t=N(e);function n(){M(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function z(e){if(k.clear(),e.type===`pointerdown`&&(se.current=e.pointerType),e.type===`mousedown`&&O.current&&!O.current.dismissOnMouseDown)return;let t=N(e);function n(){e.type===`pointerdown`?j(e):v(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function B(e){if(!te.current)return;let n=E.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof x==`function`&&!x(e)||(t.clear(),D.current=!0,F())}}}function H(e){if(f()!==`sloppy`||!O.current||R(e,n.select(`floatingElement`))||R(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-O.current.startX),i=Math.abs(t.clientY-O.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(O.current.dismissOnTouchEnd=!0),a>10&&(v(e),k.clear(),O.current=null)}function U(e){let t=N(e);function n(){H(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function ce(e){f()!==`sloppy`||!O.current||R(e,n.select(`floatingElement`))||R(e,n.select(`domReferenceElement`))||(O.current.dismissOnTouchEnd&&v(e),k.clear(),O.current=null)}function ue(e){let t=N(e);function n(){ce(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}let G=A(i);return s&&(G.addEventListener(`keydown`,V),G.addEventListener(`compositionstart`,c),G.addEventListener(`compositionend`,l)),w&&(G.addEventListener(`click`,z,!0),G.addEventListener(`pointerdown`,z,!0),G.addEventListener(`pointerup`,B,!0),G.addEventListener(`pointercancel`,B,!0),G.addEventListener(`mousedown`,z,!0),G.addEventListener(`mouseup`,B,!0),G.addEventListener(`touchstart`,ae,!0),G.addEventListener(`touchmove`,U,!0),G.addEventListener(`touchend`,ue,!0)),()=>{s&&(G.removeEventListener(`keydown`,V),G.removeEventListener(`compositionstart`,c),G.removeEventListener(`compositionend`,l)),w&&(G.removeEventListener(`click`,z,!0),G.removeEventListener(`pointerdown`,z,!0),G.removeEventListener(`pointerup`,B,!0),G.removeEventListener(`pointercancel`,B,!0),G.removeEventListener(`mousedown`,z,!0),G.removeEventListener(`mouseup`,B,!0),G.removeEventListener(`touchstart`,ae,!0),G.removeEventListener(`touchmove`,U,!0),G.removeEventListener(`touchend`,ue,!0)),e.clear(),t.clear(),d(),D.current=!1}},[a,i,s,w,x,r,o,ne,re,V,F,T,g,n,k]),B.useEffect(F,[x,F]);let U=B.useMemo(()=>({onKeyDown:V,[$n[f]]:e=>{z()&&n.setOpen(!1,I(ae,e.nativeEvent))},...f!==`intentional`&&{onClick(e){z()&&n.setOpen(!1,I(`trigger-press`,e.nativeEvent))}}}),[V,n,f,z]),ue=c(e=>{if(!r||!o||e.button!==0)return;let t=N(e.nativeEvent);L(n.select(`floatingElement`),t)&&(te.current||(te.current=!0,E.current=!1))}),G=c(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&te.current&&(E.current=!0)}),fe=B.useMemo(()=>({onKeyDown:V,onPointerDown:G,onMouseDown:G,onClickCapture:H,onMouseDownCapture(e){H(),ue(e)},onPointerDownCapture(e){H(),ue(e)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,H,ue,G]);return B.useMemo(()=>o?{reference:U,floating:fe,trigger:U}:{},[o,U,fe])}var rr=Symbol(`NOT_FOUND`);function ir(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function ar(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function or(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var sr=e=>Array.isArray(e)?e:[e];function cr(e){let t=Array.isArray(e[0])?e[0]:e;return or(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function lr(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function ur(e){let t;return{get(n){return t&&e(t.key,n)?t.value:rr},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function dr(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return rr}function i(t,i){r(t)===rr&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var fr=(e,t)=>e===t;function pr(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function mr(e,t){let{equalityCheck:n=fr,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=pr(n),o=0,s=r<=1?ur(a):dr(r,a);function c(){let t=s.get(arguments);if(t===rr){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var hr=class{constructor(e){this.value=e}deref(){return this.value}},gr=typeof WeakRef<`u`?WeakRef:hr,_r=0,vr=1;function yr(){return{s:_r,v:void 0,o:null,p:null}}function br(e,t={}){let n=yr(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=yr(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=yr(),e.set(n,t)):t=r}}let s=t,c;if(t.s===vr)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new gr(c):c}return s.s=vr,s.v=c,c}return o.clearCache=()=>{n=yr(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function xr(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),ir(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=br,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=sr(c),p=sr(u),m=cr(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=lr(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,depen
1dencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Sr=xr(br),Cr=Object.assign((e,t=Sr)=>{ar(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Cr});xr({memoize:mr,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var $=(e,t,n,r,i,a,...s)=>{if(s.length>0)throw Error(o(1));let c;if(e&&t&&n&&r&&i&&a)c=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)c=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)c=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)c=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)c=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)c=e;else throw Error(`Missing arguments`);return c},wr=[],Tr=void 0;function Er(){return Tr}function Dr(e){wr.push(e)}function Or(e){let t=(t,n)=>{let r=T(Ar).current,i;try{Tr=r;for(let e of wr)e.before(r);i=e(t,n);for(let e of wr)e.after(r);r.didInitialize=!0}finally{Tr=void 0}return i};return t.displayName=e.displayName||e.name,t}function kr(e){return B.forwardRef(Or(e))}function Ar(){return{didInitialize:!1}}var jr=u(19)?Pr:Fr;function Mr(e,t,n,r,i){return jr(e,t,n,r,i)}function Nr(e,t,n,r,i){let a=B.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Gt.useSyncExternalStore)(e.subscribe,a,a)}Dr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Gt.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Pr(e,t,n,r,i){let a=Er();if(!a)return Nr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function Fr(e,t,n,r,i){return(0,Kt.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Ir=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Mr(this,e,t,n,r)}},Lr=class extends Ir{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){B.useDebugValue(e),h(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;h(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;h(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){B.useDebugValue(e);let n=t!==void 0;h(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return B.useDebugValue(e),Mr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){B.useDebugValue(e);let n=c(t??l);this.context[e]=n}useStateSetter(e){let t=B.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Rr={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},zr=class extends Lr{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Nn(),nested:t,noEmit:n,triggerElements:i},Rr)}setOpen=(e,t)=>{if((!e||!this.state.open||he(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function Br(e,t){let n=B.useRef(null),r=B.useRef(null);return B.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function Vr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Br(e,n),o=c(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return h(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Hr(e){let t=e.useState(`open`);h(()=>
1{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function Ur(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Yt(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=c(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Jt({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var Wr=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Gr(){return new zr({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Wr,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function Kr(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:Gr(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:f,inactiveTriggerProps:f,popupProps:f}}var qr=$(e=>e.triggerIdProp??e.activeTriggerId),Jr={open:$(e=>e.openProp??e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:qr,activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&qr(e)===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&qr(e)===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&qr(e)===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function Yr(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=k(),o=Ln()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=T(()=>new zr({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return h(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};_(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}function Xr(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=B.useCallback(t=>Zr(t,e,`reference`),t),o=B.useCallback(t=>Zr(t,e,`floating`),n),s=B.useCallback(t=>Zr(t,e,`item`),r),c=B.useCallback(t=>Zr(t,e,`trigger`),i);return B.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Zr(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[re]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Qr(a,s,i,r)}return Qr(a,e,i,r),a}function Qr(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var $r=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function ei(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=k(),l=a?.id||c,u=B.useMemo(()=>se(o)?.id||i,[o,i]),d=$r.get(s)??s,p=Ln()!=null,m=B.useMemo(()=>d===`tooltip`||s===`label`?f:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&p&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,p,s]),h=B.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...m,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,m]),g=B.useMemo(()=>
1{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),_=B.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return B.useMemo(()=>({reference:h,floating:g,item:_,trigger:m}),[h,g,m,_])}var ti=`ArrowUp`,ni=`ArrowDown`,ri=`ArrowLeft`,ii=`ArrowRight`,ai=`Home`,oi=new Set([ri,ii]),si=new Set([ti,ni]),ci=new Set([...oi,...si]);new Set([...ci,ai,`End`]);var li=new Set([ti,ni,ri,ii,ai,`End`]);function ui(e){return u(19)?e:e?`true`:void 0}var di=B.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon( 2 0% 0%, 3 100% 0%, 4 100% 100%, 5 0% 100%, 6 0% 0%, 7 ${e.left}px ${e.top}px, 8 ${e.left}px ${e.bottom}px, 9 ${e.right}px ${e.bottom}px, 10 ${e.right}px ${e.top}px, 11 ${e.left}px ${e.top}px 12 )`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function fi(e){let t=B.useRef(!0);t.current&&(t.current=!1,e())}var pi={},mi={},hi=``;function gi(e){if(typeof document>`u`)return!1;let t=A(e);return v(t).innerWidth-t.documentElement.clientWidth>0}function _i(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=A(e),n=t.documentElement,r=t.body,i=g(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function vi(e){let t=A(e),n=t.documentElement,r=t.body,i=g(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function yi(e){let t=A(e),n=t.documentElement,r=t.body,i=v(n),a=0,o=0,s=!1,c=X.create();if(te&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,pi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hi=n.style.scrollBehavior,mi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),_=parseFloat(c.marginTop)+parseFloat(c.marginBottom),v=parseFloat(c.marginLeft)+parseFloat(c.marginRight),y=g(n)?n:r;if(s=_i(e),s){n.style.scrollbarGutter=l,y.style.overflowY=`hidden`,y.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:_||h?`calc(100dvh - ${_+h}px)`:`100dvh`,width:v||m?`calc(100vw - ${v+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,pi),Object.assign(r.style,mi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=hi)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var bi=new class{lockCount=0;restore=null;timeoutLock=W.create();timeoutUnlock=W.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=A(e).documentElement,n=v(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=l;return}let r=D||!gi(e);this.restore=r?vi(e):yi(e)}};function xi(e=!0,t=null){h(()=>
12{if(e)return bi.acquire(t)},[e,t])}function Si(e){let t=B.useRef(``),n=B.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:B.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Ci(e,t){let n=B.useRef(e),r=c(t);h(()=>{n.current!==e&&r(n.current)},[e,r]),h(()=>{n.current=e},[e])}function wi(e){let[t,n]=B.useState(null),r=c((t,r)=>{e||n(r||(D?`touch`:``))});Ci(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=Si(r);return B.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}export{Jt as $,nr as A,Le as At,jn as B,fe as Bt,zr as C,Ce as Ct,Or as D,ke as Dt,Mr as E,Te as Et,zn as F,_e as Ft,dn as G,ce as Gt,pn as H,G as Ht,Ln as I,Be as It,Zt as J,sn as K,H as Kt,Rn as L,K as Lt,Zn as M,Se as Mt,Bn as N,Ee as Nt,kr as O,we as Ot,Vn as P,ve as Pt,Yt as Q,Pn as R,ge as Rt,Br as S,q as St,Ir as T,Oe as Tt,fn as U,le as Ut,hn as V,pe as Vt,un as W,W as Wt,an as X,on as Y,rn as Z,Jr as _,He as _t,di as a,kt as at,Ur as b,J as bt,ri as c,Pt as ct,li as d,qe as dt,qt as et,ai as f,Je as ft,Kr as g,Xe as gt,Yr as h,Ue as ht,fi as i,zt as it,Qn as j,ze as jt,$ as k,Ie as kt,ii as l,Ke as lt,Xr as m,We as mt,Ci as n,Wt as nt,ui as o,Mt as ot,ei as p,Ge as pt,Xt as q,xi as r,X as rt,ni as s,Nt as st,wi as t,Vt as tt,ti as u,Y as ut,Wr as v,Ye as vt,Lr as w,De as wt,Vr as x,xe as xt,Hr as y,be as yt,Mn as z,me as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.