vite-plugin-asset-manager 1.0.2 → 1.0.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/README.md +59 -2
- package/dist/client/assets/index-4W13jd9f.js +2 -0
- package/dist/client/assets/index-CA_WpBq4.js +134 -0
- package/dist/client/assets/index-DcCGbVNT.css +1 -0
- package/dist/client/assets/vendor-ui-ClWphj76.js +12 -0
- package/dist/client/index.html +3 -3
- package/package.json +37 -44
- package/dist/client/assets/index-D5_jxj65.js +0 -2
- package/dist/client/assets/index-DJcW-X-b.js +0 -134
- package/dist/client/assets/index-L33N3g1d.css +0 -1
- package/dist/client/assets/vendor-ui-CBXnYcgF.js +0 -12
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{r as d,R as ui,a as Tt,j as ce,b as di,c as ee,d as Pl}from"./vendor-react-CZ2o2ZY4.js";function ko(){return typeof window<"u"}function Kt(e){return Cr(e)?(e.nodeName||"").toLowerCase():"#document"}function Ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kt(e){var t;return(t=(Cr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cr(e){return ko()?e instanceof Node||e instanceof Ze(e).Node:!1}function De(e){return ko()?e instanceof Element||e instanceof Ze(e).Element:!1}function Ue(e){return ko()?e instanceof HTMLElement||e instanceof Ze(e).HTMLElement:!1}function sr(e){return!ko()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ze(e).ShadowRoot}const Ol=new Set(["inline","contents"]);function an(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ol.has(r)}const Al=new Set(["table","td","th"]);function Ll(e){return Al.has(Kt(e))}const Dl=[":popover-open",":modal"];function Po(e){return Dl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Nl=["transform","translate","scale","rotate","perspective"],Fl=["transform","translate","scale","rotate","perspective","filter"],Vl=["paint","layout","strict","content"];function Tr(e){const t=Oo(),n=De(e)?mt(e):e;return Nl.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Fl.some(o=>(n.willChange||"").includes(o))||Vl.some(o=>(n.contain||"").includes(o))}function Bl(e){let t=Mt(e);for(;Ue(t)&&!St(t);){if(Tr(t))return t;if(Po(t))return null;t=Mt(t)}return null}function Oo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Hl=new Set(["html","body","#document"]);function St(e){return Hl.has(Kt(e))}function mt(e){return Ze(e).getComputedStyle(e)}function Ao(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mt(e){if(Kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sr(e)&&e.host||kt(e);return sr(t)?t.host:t}function fi(e){const t=Mt(e);return St(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ue(t)&&an(t)?t:fi(t)}function jt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=fi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Ze(r);if(s){const l=ir(i);return t.concat(i,i.visualViewport||[],an(r)?r:[],l&&n?jt(l):[])}return t.concat(r,jt(r,[],n))}function ir(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ds={};function lt(e,t){const n=d.useRef(ds);return n.current===ds&&(n.current=e(t)),n}const zo=ui[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],_l=zo&&zo!==d.useLayoutEffect?zo:e=>e();function se(e){const t=lt(jl).current;return t.next=e,_l(t.effect),t.trampoline}function jl(){const e={next:void 0,callback:zl,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function zl(){}const Ul=()=>{},ie=typeof document<"u"?d.useLayoutEffect:Ul;function ar(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Nn={};function Yt(e,t,n,o,r){let s={...lr(e,Nn)};return t&&(s=Ln(s,t)),n&&(s=Ln(s,n)),o&&(s=Ln(s,o)),r&&(s=Ln(s,r)),s}function Wl(e){if(e.length===0)return Nn;if(e.length===1)return lr(e[0],Nn);let t={...lr(e[0],Nn)};for(let n=1;n<e.length;n+=1)t=Ln(t,e[n]);return t}function Ln(e,t){return pi(t)?t(e):$l(e,t)}function $l(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=ar(e.style,o);break}case"className":{e[n]=gi(e.className,o);break}default:Yl(n,o)?e[n]=Kl(e[n],o):e[n]=o}}return e}function Yl(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 pi(e){return typeof e=="function"}function lr(e,t){return pi(e)?e(t):e??Nn}function Kl(e,t){return t?e?n=>{if(Gl(n)){const r=n;cr(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function cr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function gi(e,t){return t?e?t+" "+e:t:e}function Gl(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ge(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.`}const mi=d.createContext(void 0);function Mr(e=!1){const t=d.useContext(mi);if(t===void 0&&!e)throw new Error(Ge(16));return t}function ql(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,l=o&&t===!1;return{props:d.useMemo(()=>{const u={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return o||(u.tabIndex=r,!s&&n&&(u.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||l)&&(u.disabled=n),u},[o,n,t,i,l,s,r])}}function Ft(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Mr(!0)!==void 0,l=se(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:c}=ql({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),u=d.useCallback(()=>{const p=s.current;Xl(p)&&i&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,i]);ie(u,[u]);const f=d.useCallback((p={})=>{const{onClick:m,onMouseDown:h,onKeyUp:b,onKeyDown:R,onPointerDown:g,...y}=p;return Yt({type:r?"button":void 0,onClick(E){if(t){E.preventDefault();return}m?.(E)},onMouseDown(E){t||h?.(E)},onKeyDown(E){if(t||(cr(E),R?.(E)),E.baseUIHandlerPrevented)return;const v=E.target===E.currentTarget&&!r&&!l()&&!t,T=E.key==="Enter",M=E.key===" ";v&&((M||T)&&E.preventDefault(),T&&m?.(E))},onKeyUp(E){t||(cr(E),b?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!r&&!t&&E.key===" "&&m?.(E)},onPointerDown(E){if(t){E.preventDefault();return}g?.(E)}},r?void 0:{role:"button"},c,y)},[t,c,r,l]),a=se(p=>{s.current=p,u()});return{getButtonProps:f,buttonRef:a}}function Xl(e){return Ue(e)&&e.tagName==="BUTTON"}function It(e,t,n,o){const r=lt(hi).current;return Zl(r,e,t,n,o)&&bi(r,[e,t,n,o]),r.callback}function Jl(e){const t=lt(hi).current;return Ql(t,e)&&bi(t,e),t.callback}function hi(){return{callback:null,cleanup:null,refs:[]}}function Zl(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Ql(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function bi(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 ec=parseInt(d.version,10);function Ir(e){return ec>=e}function fs(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Ir(19)?n?.ref:t.ref)??null}function tc(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 nc(e,t){return typeof e=="function"?e(t):e}function oc(e,t){return typeof e=="function"?e(t):e}function dt(){}const Dt=Object.freeze([]),$e=Object.freeze({}),rc=500,sc=500,ic={style:{transition:"none"}},yi="data-base-ui-click-trigger",vi={fallbackAxisSide:"none"},ac={fallbackAxisSide:"end"},lc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ae(e,t,n={}){const o=t.render,r=cc(t,n);if(n.enabled===!1)return null;const s=n.state??$e;return uc(e,o,r,s)}function cc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=$e,ref:i,props:l,stateAttributesMapping:c,enabled:u=!0}=t,f=u?nc(n,s):void 0,a=u?oc(o,s):void 0,p=u?tc(s,c):$e,m=u?ar(p,Array.isArray(l)?Wl(l):l)??$e:$e;return typeof document<"u"&&(u?Array.isArray(i)?m.ref=Jl([m.ref,fs(r),...i]):m.ref=It(m.ref,fs(r),i):It(null,null)),u?(f!==void 0&&(m.className=gi(m.className,f)),a!==void 0&&(m.style=ar(m.style,a)),m):$e}function uc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Yt(n,t.props);return r.ref=n.ref,d.cloneElement(t,r)}if(e&&typeof e=="string")return dc(e,n);throw new Error(Ge(8))}function dc(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 jg=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,focusableWhenDisabled:i=!1,nativeButton:l=!0,...c}=t,{getButtonProps:u,buttonRef:f}=Ft({disabled:s,focusableWhenDisabled:i,native:l}),a=d.useMemo(()=>({disabled:s}),[s]);return Ae("button",t,{state:a,ref:[n,f],props:[c,u]})});function xi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=xi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function fc(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=xi(e))&&(o&&(o+=" "),o+=t);return o}const ps=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gs=fc,zg=(e,t)=>n=>{var o;if(t?.variants==null)return gs(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(u=>{const f=n?.[u],a=s?.[u];if(f===null)return null;const p=ps(f)||ps(a);return r[u][p]}),l=n&&Object.entries(n).reduce((u,f)=>{let[a,p]=f;return p===void 0||(u[a]=p),u},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:a,className:p,...m}=f;return Object.entries(m).every(h=>{let[b,R]=h;return Array.isArray(R)?R.includes({...s,...l}[b]):{...s,...l}[b]===R})?[...u,a,p]:u},[]);return gs(e,i,c,n?.class,n?.className)},pc=(e,t)=>{const n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},gc=(e,t)=>({classGroupId:e,validator:t}),wi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ho="-",ms=[],mc="arbitrary..",hc=e=>{const t=yc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return bc(i);const l=i.split(ho),c=l[0]===""&&l.length>1?1:0;return Ri(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=o[i],u=n[i];return c?u?pc(u,c):c:u||ms}return n[i]||ms}}},Ri=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const u=Ri(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const l=t===0?e.join(ho):e.slice(t).join(ho),c=i.length;for(let u=0;u<c;u++){const f=i[u];if(f.validator(l))return f.classGroupId}},bc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?mc+o:void 0})(),yc=e=>{const{theme:t,classGroups:n}=e;return vc(n,t)},vc=(e,t)=>{const n=wi();for(const o in e){const r=e[o];kr(r,n,o,t)}return n},kr=(e,t,n,o)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];xc(i,t,n,o)}},xc=(e,t,n,o)=>{if(typeof e=="string"){wc(e,t,n);return}if(typeof e=="function"){Rc(e,t,n,o);return}Ec(e,t,n,o)},wc=(e,t,n)=>{const o=e===""?t:Ei(t,e);o.classGroupId=n},Rc=(e,t,n,o)=>{if(Sc(e)){kr(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(gc(n,e))},Ec=(e,t,n,o)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];kr(c,Ei(t,l),n,o)}},Ei=(e,t)=>{let n=e;const o=t.split(ho),r=o.length;for(let s=0;s<r;s++){const i=o[s];let l=n.nextPart.get(i);l||(l=wi(),n.nextPart.set(i,l)),n=l}return n},Sc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Cc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const r=(s,i)=>{n[s]=i,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=o[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},ur="!",hs=":",Tc=[],bs=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),Mc=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const s=[];let i=0,l=0,c=0,u;const f=r.length;for(let b=0;b<f;b++){const R=r[b];if(i===0&&l===0){if(R===hs){s.push(r.slice(c,b)),c=b+1;continue}if(R==="/"){u=b;continue}}R==="["?i++:R==="]"?i--:R==="("?l++:R===")"&&l--}const a=s.length===0?r:r.slice(c);let p=a,m=!1;a.endsWith(ur)?(p=a.slice(0,-1),m=!0):a.startsWith(ur)&&(p=a.slice(1),m=!0);const h=u&&u>c?u-c:void 0;return bs(s,m,p,h)};if(t){const r=t+hs,s=o;o=i=>i.startsWith(r)?s(i.slice(r.length)):bs(Tc,!1,i,void 0,!0)}if(n){const r=o;o=s=>n({className:s,parseClassName:r})}return o},Ic=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(i)):r.push(i)}return r.length>0&&(r.sort(),o.push(...r)),o}},kc=e=>({cache:Cc(e.cacheSize),parseClassName:Mc(e),sortModifiers:Ic(e),...hc(e)}),Pc=/\s+/,Oc=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(Pc);let c="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:a,modifiers:p,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:b}=n(f);if(a){c=f+(c.length>0?" "+c:c);continue}let R=!!b,g=o(R?h.substring(0,b):h);if(!g){if(!R){c=f+(c.length>0?" "+c:c);continue}if(g=o(h),!g){c=f+(c.length>0?" "+c:c);continue}R=!1}const y=p.length===0?"":p.length===1?p[0]:s(p).join(":"),x=m?y+ur:y,E=x+g;if(i.indexOf(E)>-1)continue;i.push(E);const v=r(g,R);for(let T=0;T<v.length;++T){const M=v[T];i.push(x+M)}c=f+(c.length>0?" "+c:c)}return c},Ac=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=Si(n))&&(r&&(r+=" "),r+=o);return r},Si=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Si(e[o]))&&(n&&(n+=" "),n+=t);return n},Lc=(e,...t)=>{let n,o,r,s;const i=c=>{const u=t.reduce((f,a)=>a(f),e());return n=kc(u),o=n.cache.get,r=n.cache.set,s=l,l(c)},l=c=>{const u=o(c);if(u)return u;const f=Oc(c,n);return r(c,f),f};return s=i,(...c)=>s(Ac(...c))},Dc=[],et=e=>{const t=n=>n[e]||Dc;return t.isThemeGetter=!0,t},Ci=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ti=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nc=/^\d+\/\d+$/,Fc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_c=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ln=e=>Nc.test(e),ke=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>!!e&&Number.isInteger(Number(e)),Uo=e=>e.endsWith("%")&&ke(e.slice(0,-1)),At=e=>Fc.test(e),jc=()=>!0,zc=e=>Vc.test(e)&&!Bc.test(e),Mi=()=>!1,Uc=e=>Hc.test(e),Wc=e=>_c.test(e),$c=e=>!pe(e)&&!ge(e),Yc=e=>Sn(e,Pi,Mi),pe=e=>Ci.test(e),Zt=e=>Sn(e,Oi,zc),Wo=e=>Sn(e,Jc,ke),ys=e=>Sn(e,Ii,Mi),Kc=e=>Sn(e,ki,Wc),Xn=e=>Sn(e,Ai,Uc),ge=e=>Ti.test(e),On=e=>Cn(e,Oi),Gc=e=>Cn(e,Zc),vs=e=>Cn(e,Ii),qc=e=>Cn(e,Pi),Xc=e=>Cn(e,ki),Jn=e=>Cn(e,Ai,!0),Sn=(e,t,n)=>{const o=Ci.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},Cn=(e,t,n=!1)=>{const o=Ti.exec(e);return o?o[1]?t(o[1]):n:!1},Ii=e=>e==="position"||e==="percentage",ki=e=>e==="image"||e==="url",Pi=e=>e==="length"||e==="size"||e==="bg-size",Oi=e=>e==="length",Jc=e=>e==="number",Zc=e=>e==="family-name",Ai=e=>e==="shadow",Qc=()=>{const e=et("color"),t=et("font"),n=et("text"),o=et("font-weight"),r=et("tracking"),s=et("leading"),i=et("breakpoint"),l=et("container"),c=et("spacing"),u=et("radius"),f=et("shadow"),a=et("inset-shadow"),p=et("text-shadow"),m=et("drop-shadow"),h=et("blur"),b=et("perspective"),R=et("aspect"),g=et("ease"),y=et("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],v=()=>[...E(),ge,pe],T=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],S=()=>[ge,pe,c],P=()=>[ln,"full","auto",...S()],H=()=>[Ht,"none","subgrid",ge,pe],j=()=>["auto",{span:["full",Ht,ge,pe]},Ht,ge,pe],L=()=>[Ht,"auto",ge,pe],C=()=>["auto","min","max","fr",ge,pe],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...S()],O=()=>[ln,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],w=()=>[e,ge,pe],F=()=>[...E(),vs,ys,{position:[ge,pe]}],N=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",qc,Yc,{size:[ge,pe]}],te=()=>[Uo,On,Zt],I=()=>["","none","full",u,ge,pe],$=()=>["",ke,On,Zt],K=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[ke,Uo,vs,ys],J=()=>["","none",h,ge,pe],ue=()=>["none",ke,ge,pe],G=()=>["none",ke,ge,pe],de=()=>[ke,ge,pe],k=()=>[ln,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[At],breakpoint:[At],color:[jc],container:[At],"drop-shadow":[At],ease:["in","out","in-out"],font:[$c],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[At],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[At],shadow:[At],spacing:["px",ke],text:[At],"text-shadow":[At],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ln,pe,ge,R]}],container:["container"],columns:[{columns:[ke,pe,ge,l]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ht,"auto",ge,pe]}],basis:[{basis:[ln,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,ln,"auto","initial","none",pe]}],grow:[{grow:["",ke,ge,pe]}],shrink:[{shrink:["",ke,ge,pe]}],order:[{order:[Ht,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[l,"screen",...O()]}],"min-w":[{"min-w":[l,"screen","none",...O()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",n,On,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,ge,Wo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Uo,pe]}],"font-family":[{font:[Gc,pe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ge,pe]}],"line-clamp":[{"line-clamp":[ke,"none",ge,Wo]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",ge,Zt]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[ke,"auto",ge,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ht,ge,pe],radial:["",ge,pe],conic:[Ht,ge,pe]},Xc,Kc]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,ge,pe]}],"outline-w":[{outline:["",ke,On,Zt]}],"outline-color":[{outline:w()}],shadow:[{shadow:["","none",f,Jn,Xn]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":["none",a,Jn,Xn]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[ke,Zt]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":["none",p,Jn,Xn]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[ke,ge,pe]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:J()}],brightness:[{brightness:[ke,ge,pe]}],contrast:[{contrast:[ke,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",m,Jn,Xn]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:["",ke,ge,pe]}],"hue-rotate":[{"hue-rotate":[ke,ge,pe]}],invert:[{invert:["",ke,ge,pe]}],saturate:[{saturate:[ke,ge,pe]}],sepia:[{sepia:["",ke,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[ke,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[ke,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",ke,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[ke,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[ke,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,ge,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",ge,pe]}],ease:[{ease:["linear","initial",g,ge,pe]}],delay:[{delay:[ke,ge,pe]}],animate:[{animate:["none",y,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ge,pe]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":["translate-none"],accent:[{accent:w()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,pe]}],fill:[{fill:["none",...w()]}],"stroke-w":[{stroke:[ke,On,Zt,Wo]}],stroke:[{stroke:["none",...w()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ug=Lc(Qc),Li=d.createContext(void 0);function Pr(e){const t=d.useContext(Li);if(t===void 0&&!e)throw new Error(Ge(33));return t}const Or=d.createContext(void 0);function Pt(e){const t=d.useContext(Or);if(t===void 0&&!e)throw new Error(Ge(36));return t}let Bn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const eu={[Bn.startingStyle]:""},tu={[Bn.endingStyle]:""},Tn={transitionStatus(e){return e==="starting"?eu:e==="ending"?tu:null}};let Qt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Bn.startingStyle]="startingStyle",e[e.endingStyle=Bn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),dr=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const nu={[dr.popupOpen]:""},ou={[dr.popupOpen]:"",[dr.pressed]:""},ru={[Qt.open]:""},su={[Qt.closed]:""},iu={[Qt.anchorHidden]:""},Ar={open(e){return e?nu:null}},bo={open(e){return e?ou:null}},Mn={open(e){return e?ru:su},anchorHidden(e){return e?iu:null}},Di=d.createContext(void 0);function zn(e=!0){const t=d.useContext(Di);if(t===void 0&&!e)throw new Error(Ge(25));return t}const nn="none",zt="trigger-press",ut="trigger-hover",Fn="trigger-focus",Lo="outside-press",Vn="item-press",au="close-press",on="focus-out",Lr="escape-key",fo="list-navigation",Dr="cancel-open",Dn="sibling-open",Ni="imperative-action",lu="window-resize";function yo({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=d.useRef(e!==void 0),[s,i]=d.useState(t),l=r?e:s,c=d.useCallback(u=>{r||i(u)},[]);return[l,c]}const cu={type:"regular-item"};function Fi(e){const{closeOnClick:t,disabled:n=!1,highlighted:o,id:r,store:s,nativeButton:i,itemMetadata:l,nodeId:c}=e,u=d.useRef(null),f=zn(!0),a=f!==void 0,{events:p}=s.useState("floatingTreeRoot"),{getButtonProps:m,buttonRef:h}=Ft({disabled:n,focusableWhenDisabled:!0,native:i}),b=d.useCallback(g=>Yt({id:r,role:"menuitem",tabIndex:o?0:-1,onMouseMove(y){c&&p.emit("itemhover",{nodeId:c,target:y.currentTarget})},onMouseEnter(){l.type==="submenu-trigger"&&l.setActive()},onKeyUp(y){y.key===" "&&s.context.typingRef.current&&y.preventBaseUIHandler()},onClick(y){t&&p.emit("close",{domEvent:y,reason:Vn})},onMouseUp(y){if(f){const x=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,a&&x&&Math.abs(y.clientX-x.x)<=1&&Math.abs(y.clientY-x.y)<=1)return}u.current&&s.context.allowMouseUpTriggerRef.current&&(!a||y.button===2)&&l.type==="regular-item"&&u.current.click()}},g,m),[r,o,m,t,p,s,a,f,l,c]),R=It(u,h);return d.useMemo(()=>({getItemProps:b,itemRef:R}),[b,R])}const Vi=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function uu(){return d.useContext(Vi)}let Bi=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Un(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:l,subscribeMapChange:c,elementsRef:u,labelsRef:f,nextIndexRef:a}=uu(),p=d.useRef(-1),[m,h]=d.useState(s??(r===Bi.GuessFromOrder?()=>{if(p.current===-1){const g=a.current;a.current+=1,p.current=g}return p.current}:-1)),b=d.useRef(null),R=d.useCallback(g=>{if(b.current=g,m!==-1&&g!==null&&(u.current[m]=g,f)){const y=t!==void 0;f.current[m]=y?t:o?.current?.textContent??g.textContent}},[m,u,f,t,o]);return ie(()=>{if(s!=null)return;const g=b.current;if(g)return i(g,n),()=>{l(g)}},[s,i,l,n]),ie(()=>{if(s==null)return c(g=>{const y=b.current?g.get(b.current)?.index:null;y!=null&&h(y)})},[s,c,h]),d.useMemo(()=>({ref:R,index:m}),[m,R])}const du={...ui};let xs=0;function fu(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(xs+=1,o(`${t}-${xs}`))},[n,t]),r}const ws=du.useId;function Gt(e,t){if(ws!==void 0){const n=ws();return e??(t?`${t}-${n}`:n)}return fu(e,t)}function bt(e){return Gt(e,"base-ui")}function xe(e,t,n,o){let r=!1,s=!1;const i=o??$e;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}}const pu=[];function Hi(e){d.useEffect(e,pu)}const Zn=null;class gu{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 Qn=new gu;class Et{static create(){return new Et}static request(t){return Qn.request(t)}static cancel(t){return Qn.cancel(t)}currentId=Zn;request(t){this.cancel(),this.currentId=Qn.request(()=>{this.currentId=Zn,t()})}cancel=()=>{this.currentId!==Zn&&(Qn.cancel(this.currentId),this.currentId=Zn)};disposeEffect=()=>this.cancel}function Wn(){const e=lt(Et.create).current;return Hi(e.disposeEffect),e}function $n(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),ie(()=>{if(!e&&s&&o!=="ending"&&n){const l=Et.request(()=>{r("ending")});return()=>{Et.cancel(l)}}},[e,s,o,n]),ie(()=>{if(!e||t)return;const l=Et.request(()=>{r(void 0)});return()=>{Et.cancel(l)}},[t,e]),ie(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const l=Et.request(()=>{r("idle")});return()=>{Et.cancel(l)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}function Lt(e){return e==null?e:"current"in e?e.current:e}function mu(e,t=!1,n=!0){const o=Wn();return se((r,s=null)=>{o.cancel();function i(){Tt.flushSync(r)}const l=Lt(e);if(l==null)return;const c=l;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let u=function(){const a=Bn.startingStyle;if(!c.hasAttribute(a)){o.request(f);return}const p=new MutationObserver(()=>{c.hasAttribute(a)||(p.disconnect(),f())});p.observe(c,{attributes:!0,attributeFilter:[a]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},f=function(){Promise.all(c.getAnimations().map(a=>a.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const a=c.getAnimations();if(n){if(s?.aborted)return;i()}else a.length>0&&a.some(p=>p.pending||p.playState!=="finished")&&f()})};if(t){u();return}o.request(f)}})}function qt(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=se(r),i=mu(o,n,!1);d.useEffect(()=>{if(!t)return;const l=new AbortController;return i(s,l.signal),()=>{l.abort()}},[t,n,s,i])}const _i=d.createContext(void 0);function hu(){const e=d.useContext(_i);if(e===void 0)throw new Error(Ge(31));return e}const Wg=d.forwardRef(function(t,n){const{render:o,className:r,...s}=t,[i,l]=d.useState(void 0),c=d.useMemo(()=>({setLabelId:l}),[l]),u=Ae("div",t,{ref:n,props:{role:"group","aria-labelledby":i,...s}});return ce.jsx(_i.Provider,{value:c,children:u})}),$g=d.forwardRef(function(t,n){const{className:o,render:r,id:s,...i}=t,l=bt(s),{setLabelId:c}=hu();return ie(()=>(c(l),()=>{c(void 0)}),[c,l]),Ae("div",t,{ref:n,props:{id:l,role:"presentation",...i}})}),Yg=d.forwardRef(function(t,n){const{render:o,className:r,id:s,label:i,nativeButton:l=!1,disabled:c=!1,closeOnClick:u=!0,...f}=t,a=Un({label:i}),p=Pr(!0),m=bt(s),{store:h}=Pt(),b=h.useState("isActive",a.index),R=h.useState("itemProps"),{getItemProps:g,itemRef:y}=Fi({closeOnClick:u,disabled:c,highlighted:b,id:m,store:h,nativeButton:l,nodeId:p?.nodeId,itemMetadata:cu}),x=d.useMemo(()=>({disabled:c,highlighted:b}),[c,b]);return Ae("div",t,{state:x,props:[R,f,g],ref:[y,n,a.ref]})}),An=0;class rn{static create(){return new rn}currentId=An;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=An,n()},t)}isStarted(){return this.currentId!==An}clear=()=>{this.currentId!==An&&(clearTimeout(this.currentId),this.currentId=An)};disposeEffect=()=>this.clear}function Ke(){const e=lt(rn.create).current;return Hi(e.disposeEffect),e}function tt(e){const t=lt(bu,e).current;return t.next=e,ie(t.effect),t}function bu(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const In=typeof navigator<"u",$o=vu(),ji=wu(),zi=xu(),Ui=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Wi=$o.platform==="MacIntel"&&$o.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test($o.platform),$i=In&&/apple/i.test(navigator.vendor),fr=In&&/android/i.test(ji)||/android/i.test(zi),yu=In&&ji.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Yi=zi.includes("jsdom/");function vu(){if(!In)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 xu(){if(!In)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function wu(){if(!In)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const pr="data-base-ui-focusable",Ki="active",Gi="selected",qi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ut="ArrowLeft",Wt="ArrowRight",Nr="ArrowUp",Yn="ArrowDown";function vt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Se(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&sr(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function st(e){return"composedPath"in e?e.composedPath()[0]:e.target}function yt(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 Ru(e){return e.matches("html,body")}function qe(e){return e?.ownerDocument||document}function Fr(e){return Ue(e)&&e.matches(qi)}function gr(e){return e?e.getAttribute("role")==="combobox"&&Fr(e):!1}function Eu(e){if(!e||Yi)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Hn(e){return e?e.hasAttribute(pr)?e:e.querySelector(`[${pr}]`)||e:null}function tn(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...tn(e,r.id,n)])}function Rs(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 rt(e){e.preventDefault(),e.stopPropagation()}function Su(e){return"nativeEvent"in e}function Xi(e){return e.mozInputSource===0&&e.isTrusted?!0:fr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ji(e){return Yi?!1:!fr&&e.width===0&&e.height===0||fr&&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 yn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Zi(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Cu=["top","right","bottom","left"],vn=Math.min,pt=Math.max,vo=Math.round,un=Math.floor,Ct=e=>({x:e,y:e}),Tu={left:"right",right:"left",bottom:"top",top:"bottom"},Mu={start:"end",end:"start"};function mr(e,t,n){return pt(e,vn(t,n))}function Nt(e,t){return typeof e=="function"?e(t):e}function gt(e){return e.split("-")[0]}function Xt(e){return e.split("-")[1]}function Vr(e){return e==="x"?"y":"x"}function Br(e){return e==="y"?"height":"width"}const Iu=new Set(["top","bottom"]);function ht(e){return Iu.has(gt(e))?"y":"x"}function Hr(e){return Vr(ht(e))}function ku(e,t,n){n===void 0&&(n=!1);const o=Xt(e),r=Hr(e),s=Br(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=xo(i)),[i,xo(i)]}function Pu(e){const t=xo(e);return[hr(e),t,hr(t)]}function hr(e){return e.replace(/start|end/g,t=>Mu[t])}const Es=["left","right"],Ss=["right","left"],Ou=["top","bottom"],Au=["bottom","top"];function Lu(e,t,n){switch(e){case"top":case"bottom":return n?t?Ss:Es:t?Es:Ss;case"left":case"right":return t?Ou:Au;default:return[]}}function Du(e,t,n,o){const r=Xt(e);let s=Lu(gt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(hr)))),s}function xo(e){return e.replace(/left|right|bottom|top/g,t=>Tu[t])}function Nu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qi(e){return typeof e!="number"?Nu(e):{top:e,right:e,bottom:e,left:e}}function wo(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}}function eo(e,t,n){return Math.floor(e/t)!==n}function dn(e,t){return t<0||t>=e.current.length}function po(e,t){return ot(e,{disabledIndices:t})}function br(e,t){return ot(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ot(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&$t(e,s,o));return s}function ea(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:f=!1}){let a=u;const p=[],m={};let h=!1;{let g=null,y=-1;e.current.forEach((x,E)=>{if(x==null)return;const v=x.closest('[role="row"]');v&&(h=!0),(v!==g||y===-1)&&(g=v,y+=1,p[y]=[]),p[y].push(E),m[E]=y})}const b=h&&p.length>0&&p.some(g=>g.length!==s);function R(g){if(!b||u===-1)return;const y=m[u];if(y==null)return;const x=p[y].indexOf(u);let E=g==="up"?y-1:y+1;o&&(E<0?E=p.length-1:E>=p.length&&(E=0));const v=new Set;for(;E>=0&&E<p.length&&!v.has(E);){v.add(E);const T=p[E];if(T.length===0){E=g==="up"?E-1:E+1;continue}const M=Math.min(x,T.length-1);for(let S=M;S>=0;S-=1){const P=T[S];if(!$t(e,P,i))return P}E=g==="up"?E-1:E+1,o&&(E<0?E=p.length-1:E>=p.length&&(E=0))}}if(t.key===Nr){const g=R("up");if(g!==void 0)f&&rt(t),a=g;else{if(f&&rt(t),u===-1)a=c;else if(a=ot(e,{startingIndex:a,amount:s,decrement:!0,disabledIndices:i}),o&&(u-s<l||a<0)){const y=u%s,x=c%s,E=c-(x-y);x===y?a=c:a=x>y?E:E-s}dn(e,a)&&(a=u)}}if(t.key===Yn){const g=R("down");g!==void 0?(f&&rt(t),a=g):(f&&rt(t),u===-1?a=l:(a=ot(e,{startingIndex:u,amount:s,disabledIndices:i}),o&&u+s>c&&(a=ot(e,{startingIndex:u%s-s,amount:s,disabledIndices:i}))),dn(e,a)&&(a=u))}if(n==="both"){const g=un(u/s);t.key===(r?Ut:Wt)&&(f&&rt(t),u%s!==s-1?(a=ot(e,{startingIndex:u,disabledIndices:i}),o&&eo(a,s,g)&&(a=ot(e,{startingIndex:u-u%s-1,disabledIndices:i}))):o&&(a=ot(e,{startingIndex:u-u%s-1,disabledIndices:i})),eo(a,s,g)&&(a=u)),t.key===(r?Wt:Ut)&&(f&&rt(t),u%s!==0?(a=ot(e,{startingIndex:u,decrement:!0,disabledIndices:i}),o&&eo(a,s,g)&&(a=ot(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:i}))):o&&(a=ot(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:i})),eo(a,s,g)&&(a=u));const y=un(c/s)===g;dn(e,a)&&(o&&y?a=t.key===(r?Wt:Ut)?c:ot(e,{startingIndex:u-u%s-1,disabledIndices:i}):a=u)}return a}function ta(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},l)=>{let c=!1;for(n&&(r=0);!c;){const u=[];for(let f=0;f<s;f+=1)for(let a=0;a<i;a+=1)u.push(r+f+a*t);r%t+s<=t&&u.every(f=>o[f]==null)?(u.forEach(f=>{o[f]=l}),c=!0):r+=1}}),[...o]}function na(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function oa(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function $t(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var Fu=["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] *)"],Ro=Fu.join(","),ra=typeof Element>"u",xn=ra?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Eo=!ra&&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},So=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]"):So(t.parentNode));return i},Vu=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},sa=function(t,n,o){if(So(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Ro));return n&&xn.call(t,Ro)&&r.unshift(t),r=r.filter(o),r},Co=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!So(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),c=l.length?l:i.children,u=Co(c,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:i,candidates:u})}else{var f=xn.call(i,Ro);f&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var a=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!So(a,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(a&&p){var m=Co(a===!0?i.children:a.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return r},ia=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},aa=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Vu(t))&&!ia(t)?0:t.tabIndex},Bu=function(t,n){var o=aa(t);return o<0&&n&&!ia(t)?0:o},Hu=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},la=function(t){return t.tagName==="INPUT"},_u=function(t){return la(t)&&t.type==="hidden"},ju=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},zu=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Uu=function(t){if(!t.name)return!0;var n=t.form||Eo(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},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=zu(r,t.form);return!s||s===t},Wu=function(t){return la(t)&&t.type==="radio"},$u=function(t){return Wu(t)&&!Uu(t)},Yu=function(t){var n,o=t&&Eo(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,l,c;for(s=!!((i=r)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var u,f,a;o=Eo(r),r=(u=o)===null||u===void 0?void 0:u.host,s=!!((f=r)!==null&&f!==void 0&&(a=f.ownerDocument)!==null&&a!==void 0&&a.contains(r))}}return s},Cs=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Ku=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=xn.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(xn.call(l,"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 u=t.parentElement,f=Eo(t);if(u&&!u.shadowRoot&&r(u)===!0)return Cs(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=c}if(Yu(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Cs(t);return!1},Gu=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 xn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},yr=function(t,n){return!(n.disabled||_u(n)||Ku(n,t)||ju(n)||Gu(n))},vr=function(t,n){return!($u(n)||aa(n)<0||!yr(t,n))},qu=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ca=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,l=i?r.scopeParent:r,c=Bu(l,i),u=i?ca(r.candidates):l;c===0?i?n.push.apply(n,u):n.push(l):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:u})}),o.sort(Hu).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Kn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Co([t],n.includeContainer,{filter:vr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:qu}):o=sa(t,n.includeContainer,vr.bind(null,n)),ca(o)},Xu=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Co([t],n.includeContainer,{filter:yr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=sa(t,n.includeContainer,yr.bind(null,n)),o},ua=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,Ro)===!1?!1:vr(n,t)};const kn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function da(e,t){const n=Kn(e,kn()),o=n.length;if(o===0)return;const r=vt(qe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function _r(e){return da(qe(e).body,1)||e}function fa(e){return da(qe(e).body,-1)||e}function pa(e,t){if(!e)return null;const n=Kn(qe(e).body,kn()),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 Ju(e){return pa(e,1)}function Zu(e){return pa(e,-1)}function fn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Se(n,o)}function Qu(e){Kn(e,kn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ts(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function ga(){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 jr{nodesRef={current:[]};events=ga();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 ma=d.createContext(null),ha=d.createContext(null),Vt=()=>d.useContext(ma)?.id||null,Jt=e=>{const t=d.useContext(ha);return e??t};function ba(e){const t=Gt(),n=Jt(e),o=Vt();return ie(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function ed(e){const{children:t,id:n}=e,o=Vt();return ce.jsx(ma.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function td(e){const{children:t,externalTree:n}=e,o=lt(()=>n??new jr).current;return ce.jsx(ha.Provider,{value:o,children:t})}function wn(e){return`data-base-ui-${e}`}function Yo(e,t,n){if(n&&!yn(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]}const ya={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Do={...ya,position:"fixed",top:0,left:0},va={...ya,position:"absolute"};function it(e){return e?.ownerDocument||document}const Rn=d.forwardRef(function(t,n){const[o,r]=d.useState();ie(()=>{$i&&r("button")},[]);const s={tabIndex:0,role:o};return ce.jsx("span",{...t,ref:n,style:Do,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Ms=0;function go(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Ms);const s=()=>e?.focus({preventScroll:n});r?s():Ms=requestAnimationFrame(s)}const pn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Is(e){return e==="inert"?pn.inert:e==="aria-hidden"?pn["aria-hidden"]:pn.none}let to=new WeakSet,no={},Ko=0;const xa=e=>e&&(e.host||xa(e.parentNode)),nd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=xa(n);return e.contains(o)?o:null}).filter(n=>n!=null);function od(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=nd(t,e),l=new Set,c=new Set(i),u=[];no[r]||(no[r]=new WeakMap);const f=no[r];i.forEach(a),p(t),l.clear();function a(m){!m||l.has(m)||(l.add(m),m.parentNode&&a(m.parentNode))}function p(m){!m||c.has(m)||[].forEach.call(m.children,h=>{if(Kt(h)!=="script")if(l.has(h))p(h);else{const b=s?h.getAttribute(s):null,R=b!==null&&b!=="false",g=Is(s),y=(g.get(h)||0)+1,x=(f.get(h)||0)+1;g.set(h,y),f.set(h,x),u.push(h),y===1&&R&&to.add(h),x===1&&h.setAttribute(r,""),!R&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return Ko+=1,()=>{u.forEach(m=>{const h=Is(s),R=(h.get(m)||0)-1,g=(f.get(m)||0)-1;h.set(m,R),f.set(m,g),R||(!to.has(m)&&s&&m.removeAttribute(s),to.delete(m)),g||m.removeAttribute(r)}),Ko-=1,Ko||(pn.inert=new WeakMap,pn["aria-hidden"]=new WeakMap,pn.none=new WeakMap,to=new WeakSet,no={})}}function rd(e,t=!1,n=!1){const o=qe(e[0]).body;return od(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const wa=d.createContext(null),Ra=()=>d.useContext(wa),sd=wn("portal");function id(e={}){const{ref:t,container:n,componentProps:o=$e,elementProps:r,elementState:s}=e,i=Gt(),c=Ra()?.portalNode,[u,f]=d.useState(null),[a,p]=d.useState(null),m=se(g=>{g!==null&&p(g)}),h=d.useRef(null);ie(()=>{if(n===null){h.current&&(h.current=null,p(null),f(null));return}if(i==null)return;const g=(n&&(Cr(n)?n:n.current))??c??document.body;if(g==null){h.current&&(h.current=null,p(null),f(null));return}h.current!==g&&(h.current=g,p(null),f(g))},[n,c,i]);const b=Ae("div",o,{ref:[t,m],state:s,props:[{id:i,[sd]:""},r]});return{portalNode:a,portalSubtree:u&&b?Tt.createPortal(b,u):null}}const zr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:l,...c}=t,{portalNode:u,portalSubtree:f}=id({container:r,ref:n,componentProps:t,elementProps:c}),a=d.useRef(null),p=d.useRef(null),m=d.useRef(null),h=d.useRef(null),[b,R]=d.useState(null),g=b?.modal,y=b?.open,x=typeof l=="boolean"?l:!!b&&!b.modal&&b.open&&!!u;d.useEffect(()=>{if(!u||g)return;function v(T){u&&T.relatedTarget&&fn(T)&&(T.type==="focusin"?Ts:Qu)(u)}return u.addEventListener("focusin",v,!0),u.addEventListener("focusout",v,!0),()=>{u.removeEventListener("focusin",v,!0),u.removeEventListener("focusout",v,!0)}},[u,g]),d.useEffect(()=>{!u||y||Ts(u)},[y,u]);const E=d.useMemo(()=>({beforeOutsideRef:a,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:u,setFocusManagerState:R}),[u]);return ce.jsxs(d.Fragment,{children:[f,ce.jsxs(wa.Provider,{value:E,children:[x&&u&&ce.jsx(Rn,{"data-type":"outside",ref:a,onFocus:v=>{if(fn(v,u))m.current?.focus();else{const T=b?b.domReference:null;fa(T)?.focus()}}}),x&&u&&ce.jsx("span",{"aria-owns":u.id,style:lc}),u&&Tt.createPortal(o,u),x&&u&&ce.jsx(Rn,{"data-type":"outside",ref:p,onFocus:v=>{if(fn(v,u))h.current?.focus();else{const T=b?b.domReference:null;_r(T)?.focus(),b?.closeOnFocusOut&&b?.onOpenChange(!1,xe(on,v.nativeEvent))}}})]})]})});function ad(e,t){const n=Ze(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 ks=20;let _t=[];function Ur(){_t=_t.filter(e=>e.isConnected)}function ld(e){Ur(),e&&Kt(e)!=="body"&&(_t.push(e),_t.length>ks&&(_t=_t.slice(-ks)))}function Go(){return Ur(),_t[_t.length-1]}function cd(e){if(!e)return null;const t=kn();return ua(e,t)?e:Kn(e,t)[0]||e}function ud(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():mt(e).display!=="none"}function Ps(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=kn(),r=Xu(e,n).filter(i=>{const l=i.getAttribute("data-tabindex")||"";return ua(i,n)||i.hasAttribute("data-tabindex")&&!l.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 Wr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:f="",getInsideElements:a=()=>[],nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:b}=e,R="rootStore"in t?t.rootStore:t,g=R.useState("open"),y=R.useState("domReferenceElement"),x=R.useState("floatingElement"),{events:E,dataRef:v}=R.context,T=se(()=>v.current.floatingContext?.nodeId),M=se(a),S=s===!1,P=gr(y)&&S,H=tt(r),j=tt(s),L=tt(i),C=tt(f),V=Jt(b),D=Ra(),A=d.useRef(null),O=d.useRef(null),w=d.useRef(!1),F=d.useRef(!1),N=d.useRef(!1),B=d.useRef(-1),te=d.useRef(""),I=d.useRef(""),$=d.useRef(null),K=d.useRef(null),z=It($,h,D?.beforeInsideRef),W=It(K,D?.afterInsideRef),J=Ke(),ue=Ke(),G=Wn(),de=D!=null,k=Hn(x),re=se((U=k)=>U?Kn(U,kn()):[]),Z=se(U=>{const Y=re(U);return H.current.map(()=>Y).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function U(ne){ne.key==="Tab"&&Se(k,vt(qe(k)))&&re().length===0&&!P&&rt(ne)}const Y=qe(k);return Y.addEventListener("keydown",U),()=>{Y.removeEventListener("keydown",U)}},[o,y,k,c,H,P,re,Z]),d.useEffect(()=>{if(o||!x)return;function U(Y){const ne=st(Y),fe=re().indexOf(ne);fe!==-1&&(B.current=fe)}return x.addEventListener("focusin",U),()=>{x.removeEventListener("focusin",U)}},[o,x,re]),d.useEffect(()=>{if(o||!g)return;const U=qe(k);function Y(){N.current=!1}function ne(fe){const le=st(fe),X=Se(x,le)||Se(y,le)||Se(D?.portalNode,le);N.current=!X,I.current=fe.pointerType||"keyboard"}function q(){I.current="keyboard"}return U.addEventListener("pointerdown",ne,!0),U.addEventListener("pointerup",Y,!0),U.addEventListener("pointercancel",Y,!0),U.addEventListener("keydown",q,!0),()=>{U.removeEventListener("pointerdown",ne,!0),U.removeEventListener("pointerup",Y,!0),U.removeEventListener("pointercancel",Y,!0),U.removeEventListener("keydown",q,!0)}},[o,x,y,k,g,D]),d.useEffect(()=>{if(o||!u)return;function U(){F.current=!0,ue.start(0,()=>{F.current=!1})}function Y(le){const X=le.relatedTarget,_=le.currentTarget,ae=st(le);queueMicrotask(()=>{const Q=T(),we=R.context.triggerElements,Te=X?.hasAttribute(wn("focus-guard"))&&[$.current,K.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,Lt(m),Lt(p)].includes(X),Pe=!(Se(y,X)||Se(x,X)||Se(X,x)||Se(D?.portalNode,X)||X!=null&&we.hasElement(X)||we.hasMatchingElement(Ce=>Se(Ce,X))||Te||V&&(tn(V.nodesRef.current,Q).find(Ce=>Se(Ce.context?.elements.floating,X)||Se(Ce.context?.elements.domReference,X))||Rs(V.nodesRef.current,Q).find(Ce=>[Ce.context?.elements.floating,Hn(Ce.context?.elements.floating)].includes(X)||Ce.context?.elements.domReference===X)));if(_===y&&k&&Ps(k,H),l&&_!==y&&!ud(ae)&&vt(qe(k))===qe(k).body){if(Ue(k)&&(k.focus(),l==="popup")){G.request(()=>{k.focus()});return}const Ce=B.current,Me=re(),He=Me[Ce]||Me[Me.length-1]||k;Ue(He)&&He.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(P||!c)&&X&&Pe&&!F.current&&(P||X!==Go())&&(w.current=!0,R.setOpen(!1,xe(on,le)))})}function ne(){N.current||(v.current.insideReactTree=!0,J.start(0,()=>{v.current.insideReactTree=!1}))}const q=Ue(y)?y:null,fe=[];if(!(!x&&!q))return q&&(q.addEventListener("focusout",Y),q.addEventListener("pointerdown",U),fe.push(()=>{q.removeEventListener("focusout",Y),q.removeEventListener("pointerdown",U)})),x&&(x.addEventListener("focusout",Y),D&&(x.addEventListener("focusout",ne,!0),fe.push(()=>{x.removeEventListener("focusout",ne,!0)})),fe.push(()=>{x.removeEventListener("focusout",Y)})),()=>{fe.forEach(le=>{le()})}},[o,y,x,k,c,V,D,R,u,l,re,P,T,H,v,J,ue,G,p,m]),d.useEffect(()=>{if(o||!x||!g)return;const U=Array.from(D?.portalNode?.querySelectorAll(`[${wn("portal")}]`)||[]),ne=(V?Rs(V.nodesRef.current,T()):[]).find(le=>gr(le.context?.elements.domReference||null))?.context?.elements.domReference,q=[x,ne,...U,...M(),A.current,O.current,$.current,K.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,Lt(m),Lt(p),P?y:null].filter(le=>le!=null),fe=rd(q,c||P);return()=>{fe()}},[g,o,y,x,c,H,D,P,V,T,M,p,m]),ie(()=>{if(!g||o||!Ue(k))return;const U=qe(k),Y=vt(U);queueMicrotask(()=>{const ne=Z(k),q=j.current,fe=typeof q=="function"?q(C.current||""):q;if(fe===void 0||fe===!1)return;let le;fe===!0||fe===null?le=ne[0]||k:le=Lt(fe),le=le||ne[0]||k,!Se(k,Y)&&go(le,{preventScroll:le===k})})},[o,g,k,S,Z,j,C]),ie(()=>{if(o||!k)return;const U=qe(k),Y=vt(U);ld(Y);function ne(le){if(le.open||(te.current=ad(le.nativeEvent,I.current)),le.reason===ut&&le.nativeEvent.type==="mouseleave"&&(w.current=!0),le.reason===Lo)if(le.nested)w.current=!1;else if(Xi(le.nativeEvent)||Ji(le.nativeEvent))w.current=!1;else{let X=!1;document.createElement("div").focus({get preventScroll(){return X=!0,!1}}),X?w.current=!1:w.current=!0}}E.on("openchange",ne);const q=U.createElement("span");q.setAttribute("tabindex","-1"),q.setAttribute("aria-hidden","true"),Object.assign(q.style,Do),de&&y&&y.insertAdjacentElement("afterend",q);function fe(){const le=L.current;let X=typeof le=="function"?le(te.current):le;if(X===void 0||X===!1)return null;if(X===null&&(X=!0),typeof X=="boolean"){const ae=y||Go();return ae&&ae.isConnected?ae:q}const _=y||Go()||q;return Lt(X)||_}return()=>{E.off("openchange",ne);const le=vt(U),X=Se(x,le)||V&&tn(V.nodesRef.current,T(),!1).some(ae=>Se(ae.context?.elements.floating,le)),_=fe();queueMicrotask(()=>{const ae=cd(_),Q=typeof L.current!="boolean";L.current&&!w.current&&Ue(ae)&&(!(!Q&&ae!==le&&le!==U.body)||X)&&ae.focus({preventScroll:!0}),q.remove()})}},[o,x,k,L,v,E,V,de,y,T]),d.useEffect(()=>{queueMicrotask(()=>{w.current=!1})},[o]),d.useEffect(()=>{if(o||!g)return;function U(ne){st(ne)?.closest(`[${yi}]`)&&(F.current=!0)}const Y=qe(k);return Y.addEventListener("pointerdown",U,!0),()=>{Y.removeEventListener("pointerdown",U,!0)}},[o,g,k]),ie(()=>{if(!o&&D)return D.setFocusManagerState({modal:c,closeOnFocusOut:u,open:g,onOpenChange:R.setOpen,domReference:y}),()=>{D.setFocusManagerState(null)}},[o,D,c,g,R,u,y]),ie(()=>{if(!(o||!k))return Ps(k,H),()=>{queueMicrotask(Ur)}},[o,k,H]);const be=!o&&(c?!P:!0)&&(de||c);return ce.jsxs(d.Fragment,{children:[be&&ce.jsx(Rn,{"data-type":"inside",ref:z,onFocus:U=>{if(c){const Y=Z();go(Y[Y.length-1])}else D?.portalNode&&(w.current=!1,fn(U,D.portalNode)?_r(y)?.focus():Lt(m??D.beforeOutsideRef)?.focus())}}),n,be&&ce.jsx(Rn,{"data-type":"inside",ref:W,onFocus:U=>{c?go(Z()[0]):D?.portalNode&&(u&&(w.current=!0),fn(U,D.portalNode)?fa(y)?.focus():Lt(p??D.afterOutsideRef)?.focus())}})]})}function No(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:l=!1,stickIfOpen:c=!0,touchOpenDelay:u=0}=t,f=d.useRef(void 0),a=Wn(),p=Ke(),m=d.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const b=f.current,R=h.nativeEvent,g=n.select("open");if(h.button!==0||s==="click"||yn(b,!0)&&l)return;const y=o.current.openEvent,x=y?.type,E=n.select("domReferenceElement")!==h.currentTarget,v=g&&E||!(g&&i&&(!(y&&c)||x==="click"||x==="mousedown"));if(Fr(R.target)){const M=xe(zt,R,R.target);v&&b==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,M)}):n.setOpen(v,M);return}const T=h.currentTarget;a.request(()=>{const M=xe(zt,R,T);v&&b==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,M)}):n.setOpen(v,M)})},onClick(h){if(s==="mousedown-only")return;const b=f.current;if(s==="mousedown"&&b){f.current=void 0;return}if(yn(b,!0)&&l)return;const R=n.select("open"),g=o.current.openEvent,y=n.select("domReferenceElement")!==h.currentTarget,x=R&&y||!(R&&i&&(!(g&&c)||Zi(g))),E=xe(zt,h.nativeEvent,h.currentTarget);x&&b==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,E)}):n.setOpen(x,E)},onKeyDown(){f.current=void 0}}),[o,s,l,n,c,i,a,p,u]);return d.useMemo(()=>r?{reference:m}:$e,[r,m])}function Os(e,t,n){let{reference:o,floating:r}=e;const s=ht(t),i=Hr(t),l=Br(i),c=gt(t),u=s==="y",f=o.x+o.width/2-r.width/2,a=o.y+o.height/2-r.height/2,p=o[l]/2-r[l]/2;let m;switch(c){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:a};break;case"left":m={x:o.x-r.width,y:a};break;default:m={x:o.x,y:o.y}}switch(Xt(t)){case"start":m[i]-=p*(n&&u?-1:1);break;case"end":m[i]+=p*(n&&u?-1:1);break}return m}const dd=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:a}=Os(u,o,c),p=o,m={},h=0;for(let b=0;b<l.length;b++){const{name:R,fn:g}=l[b],{x:y,y:x,data:E,reset:v}=await g({x:f,y:a,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:u,platform:i,elements:{reference:e,floating:t}});f=y??f,a=x??a,m={...m,[R]:{...m[R],...E}},v&&h<=50&&(h++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(u=v.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):v.rects),{x:f,y:a}=Os(u,p,c)),b=-1)}return{x:f,y:a,placement:p,strategy:r,middlewareData:m}};async function _n(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:a="floating",altBoundary:p=!1,padding:m=0}=Nt(t,e),h=Qi(m),R=l[p?a==="floating"?"reference":"floating":a],g=wo(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:c})),y=a==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},v=wo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(g.top-v.top+h.top)/E.y,bottom:(v.bottom-g.bottom+h.bottom)/E.y,left:(g.left-v.left+h.left)/E.x,right:(v.right-g.right+h.right)/E.x}}const fd=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:l,platform:c,elements:u}=t,{mainAxis:f=!0,crossAxis:a=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:b=!0,...R}=Nt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=gt(r),y=ht(l),x=gt(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),v=p||(x||!b?[xo(l)]:Pu(l)),T=h!=="none";!p&&T&&v.push(...Du(l,b,h,E));const M=[l,...v],S=await _n(t,R),P=[];let H=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&P.push(S[g]),a){const V=ku(r,i,E);P.push(S[V[0]],S[V[1]])}if(H=[...H,{placement:r,overflows:P}],!P.every(V=>V<=0)){var j,L;const V=(((j=s.flip)==null?void 0:j.index)||0)+1,D=M[V];if(D&&(!(a==="alignment"?y!==ht(D):!1)||H.every(w=>ht(w.placement)===y?w.overflows[0]>0:!0)))return{data:{index:V,overflows:H},reset:{placement:D}};let A=(L=H.filter(O=>O.overflows[0]<=0).sort((O,w)=>O.overflows[1]-w.overflows[1])[0])==null?void 0:L.placement;if(!A)switch(m){case"bestFit":{var C;const O=(C=H.filter(w=>{if(T){const F=ht(w.placement);return F===y||F==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(F=>F>0).reduce((F,N)=>F+N,0)]).sort((w,F)=>w[1]-F[1])[0])==null?void 0:C[0];O&&(A=O);break}case"initialPlacement":A=l;break}if(r!==A)return{reset:{placement:A}}}return{}}}};function As(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ls(e){return Cu.some(t=>e[t]>=0)}const pd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Nt(e,t);switch(o){case"referenceHidden":{const s=await _n(t,{...r,elementContext:"reference"}),i=As(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ls(i)}}}case"escaped":{const s=await _n(t,{...r,altBoundary:!0}),i=As(s,n.floating);return{data:{escapedOffsets:i,escaped:Ls(i)}}}default:return{}}}}},Ea=new Set(["left","top"]);async function gd(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=gt(n),l=Xt(n),c=ht(n)==="y",u=Ea.has(i)?-1:1,f=s&&c?-1:1,a=Nt(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return l&&typeof h=="number"&&(m=l==="end"?h*-1:h),c?{x:m*f,y:p*u}:{x:p*u,y:m*f}}const md=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:l}=t,c=await gd(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},hd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:R=>{let{x:g,y}=R;return{x:g,y}}},...c}=Nt(e,t),u={x:n,y:o},f=await _n(t,c),a=ht(gt(r)),p=Vr(a);let m=u[p],h=u[a];if(s){const R=p==="y"?"top":"left",g=p==="y"?"bottom":"right",y=m+f[R],x=m-f[g];m=mr(y,m,x)}if(i){const R=a==="y"?"top":"left",g=a==="y"?"bottom":"right",y=h+f[R],x=h-f[g];h=mr(y,h,x)}const b=l.fn({...t,[p]:m,[a]:h});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[p]:s,[a]:i}}}}}},bd=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Nt(e,t),f={x:n,y:o},a=ht(r),p=Vr(a);let m=f[p],h=f[a];const b=Nt(l,t),R=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const x=p==="y"?"height":"width",E=s.reference[p]-s.floating[x]+R.mainAxis,v=s.reference[p]+s.reference[x]-R.mainAxis;m<E?m=E:m>v&&(m=v)}if(u){var g,y;const x=p==="y"?"width":"height",E=Ea.has(gt(r)),v=s.reference[a]-s.floating[x]+(E&&((g=i.offset)==null?void 0:g[a])||0)+(E?0:R.crossAxis),T=s.reference[a]+s.reference[x]+(E?0:((y=i.offset)==null?void 0:y[a])||0)-(E?R.crossAxis:0);h<v?h=v:h>T&&(h=T)}return{[p]:m,[a]:h}}}},yd=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:l}=t,{apply:c=()=>{},...u}=Nt(e,t),f=await _n(t,u),a=gt(r),p=Xt(r),m=ht(r)==="y",{width:h,height:b}=s.floating;let R,g;a==="top"||a==="bottom"?(R=a,g=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=a,R=p==="end"?"top":"bottom");const y=b-f.top-f.bottom,x=h-f.left-f.right,E=vn(b-f[R],y),v=vn(h-f[g],x),T=!t.middlewareData.shift;let M=E,S=v;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(M=y),T&&!p){const H=pt(f.left,0),j=pt(f.right,0),L=pt(f.top,0),C=pt(f.bottom,0);m?S=h-2*(H!==0||j!==0?H+j:pt(f.left,f.right)):M=b-2*(L!==0||C!==0?L+C:pt(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:M});const P=await i.getDimensions(l.floating);return h!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}};function Sa(e){const t=mt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ue(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=vo(n)!==s||vo(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function $r(e){return De(e)?e:e.contextElement}function gn(e){const t=$r(e);if(!Ue(t))return Ct(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Sa(t);let i=(s?vo(n.width):n.width)/o,l=(s?vo(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const vd=Ct(0);function Ca(e){const t=Ze(e);return!Oo()||!t.visualViewport?vd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ze(e)?!1:t}function sn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=$r(e);let i=Ct(1);t&&(o?De(o)&&(i=gn(o)):i=gn(e));const l=xd(s,n,o)?Ca(s):Ct(0);let c=(r.left+l.x)/i.x,u=(r.top+l.y)/i.y,f=r.width/i.x,a=r.height/i.y;if(s){const p=Ze(s),m=o&&De(o)?Ze(o):o;let h=p,b=ir(h);for(;b&&o&&m!==h;){const R=gn(b),g=b.getBoundingClientRect(),y=mt(b),x=g.left+(b.clientLeft+parseFloat(y.paddingLeft))*R.x,E=g.top+(b.clientTop+parseFloat(y.paddingTop))*R.y;c*=R.x,u*=R.y,f*=R.x,a*=R.y,c+=x,u+=E,h=Ze(b),b=ir(h)}}return wo({width:f,height:a,x:c,y:u})}function Fo(e,t){const n=Ao(e).scrollLeft;return t?t.left+n:sn(kt(e)).left+n}function Ta(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Fo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function wd(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=kt(o),l=t?Po(t.floating):!1;if(o===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Ct(1);const f=Ct(0),a=Ue(o);if((a||!a&&!s)&&((Kt(o)!=="body"||an(i))&&(c=Ao(o)),Ue(o))){const m=sn(o);u=gn(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const p=i&&!a&&!s?Ta(i,c):Ct(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-c.scrollTop*u.y+f.y+p.y}}function Rd(e){return Array.from(e.getClientRects())}function Ed(e){const t=kt(e),n=Ao(e),o=e.ownerDocument.body,r=pt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=pt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Fo(e);const l=-n.scrollTop;return mt(o).direction==="rtl"&&(i+=pt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ds=25;function Sd(e,t){const n=Ze(e),o=kt(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const f=Oo();(!f||f&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const u=Fo(o);if(u<=0){const f=o.ownerDocument,a=f.body,p=getComputedStyle(a),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(o.clientWidth-a.clientWidth-m);h<=Ds&&(s-=h)}else u<=Ds&&(s+=u);return{width:s,height:i,x:l,y:c}}const Cd=new Set(["absolute","fixed"]);function Td(e,t){const n=sn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ue(e)?gn(e):Ct(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,u=o*s.y;return{width:i,height:l,x:c,y:u}}function Ns(e,t,n){let o;if(t==="viewport")o=Sd(e,n);else if(t==="document")o=Ed(kt(e));else if(De(t))o=Td(t,n);else{const r=Ca(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return wo(o)}function Ma(e,t){const n=Mt(e);return n===t||!De(n)||St(n)?!1:mt(n).position==="fixed"||Ma(n,t)}function Md(e,t){const n=t.get(e);if(n)return n;let o=jt(e,[],!1).filter(l=>De(l)&&Kt(l)!=="body"),r=null;const s=mt(e).position==="fixed";let i=s?Mt(e):e;for(;De(i)&&!St(i);){const l=mt(i),c=Tr(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Cd.has(r.position)||an(i)&&!c&&Ma(e,i))?o=o.filter(f=>f!==i):r=l,i=Mt(i)}return t.set(e,o),o}function Id(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Po(t)?[]:Md(t,this._c):[].concat(n),o],l=i[0],c=i.reduce((u,f)=>{const a=Ns(t,f,r);return u.top=pt(a.top,u.top),u.right=vn(a.right,u.right),u.bottom=vn(a.bottom,u.bottom),u.left=pt(a.left,u.left),u},Ns(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function kd(e){const{width:t,height:n}=Sa(e);return{width:t,height:n}}function Pd(e,t,n){const o=Ue(t),r=kt(t),s=n==="fixed",i=sn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Ct(0);function u(){c.x=Fo(r)}if(o||!o&&!s)if((Kt(t)!=="body"||an(r))&&(l=Ao(t)),o){const m=sn(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?Ta(r,l):Ct(0),a=i.left+l.scrollLeft-c.x-f.x,p=i.top+l.scrollTop-c.y-f.y;return{x:a,y:p,width:i.width,height:i.height}}function qo(e){return mt(e).position==="static"}function Fs(e,t){if(!Ue(e)||mt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kt(e)===n&&(n=n.ownerDocument.body),n}function Ia(e,t){const n=Ze(e);if(Po(e))return n;if(!Ue(e)){let r=Mt(e);for(;r&&!St(r);){if(De(r)&&!qo(r))return r;r=Mt(r)}return n}let o=Fs(e,t);for(;o&&Ll(o)&&qo(o);)o=Fs(o,t);return o&&St(o)&&qo(o)&&!Tr(o)?n:o||Bl(e)||n}const Od=async function(e){const t=this.getOffsetParent||Ia,n=this.getDimensions,o=await n(e.floating);return{reference:Pd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ad(e){return mt(e).direction==="rtl"}const Ld={convertOffsetParentRelativeRectToViewportRelativeRect:wd,getDocumentElement:kt,getClippingRect:Id,getOffsetParent:Ia,getElementRects:Od,getClientRects:Rd,getDimensions:kd,getScale:gn,isElement:De,isRTL:Ad};function ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dd(e,t){let n=null,o;const r=kt(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:f,top:a,width:p,height:m}=u;if(l||t(),!p||!m)return;const h=un(a),b=un(r.clientWidth-(f+p)),R=un(r.clientHeight-(a+m)),g=un(f),x={rootMargin:-h+"px "+-b+"px "+-R+"px "+-g+"px",threshold:pt(0,vn(1,c))||1};let E=!0;function v(T){const M=T[0].intersectionRatio;if(M!==c){if(!E)return i();M?i(!1,M):o=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!ka(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(v,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(v,x)}n.observe(e)}return i(!0),s}function Vs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=$r(e),f=r||s?[...u?jt(u):[],...jt(t)]:[];f.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const a=u&&l?Dd(u,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let h,b=c?sn(e):null;c&&R();function R(){const g=sn(e);b&&!ka(b,g)&&n(),b=g,h=requestAnimationFrame(R)}return n(),()=>{var g;f.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),a?.(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const Nd=md,Fd=hd,Vd=fd,Bd=yd,Hd=pd,_d=bd,jd=(e,t,n)=>{const o=new Map,r={platform:Ld,...n},s={...r.platform,_c:o};return dd(e,t,{...r,platform:s})};var zd=typeof document<"u",Ud=function(){},mo=zd?d.useLayoutEffect:Ud;function To(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(!To(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)&&!To(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bs(e,t){const n=Pa(e);return Math.round(t*n)/n}function Xo(e){const t=d.useRef(e);return mo(()=>{t.current=e}),t}function Wd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[f,a]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(o);To(p,o)||m(o);const[h,b]=d.useState(null),[R,g]=d.useState(null),y=d.useCallback(w=>{w!==T.current&&(T.current=w,b(w))},[]),x=d.useCallback(w=>{w!==M.current&&(M.current=w,g(w))},[]),E=s||h,v=i||R,T=d.useRef(null),M=d.useRef(null),S=d.useRef(f),P=c!=null,H=Xo(c),j=Xo(r),L=Xo(u),C=d.useCallback(()=>{if(!T.current||!M.current)return;const w={placement:t,strategy:n,middleware:p};j.current&&(w.platform=j.current),jd(T.current,M.current,w).then(F=>{const N={...F,isPositioned:L.current!==!1};V.current&&!To(S.current,N)&&(S.current=N,Tt.flushSync(()=>{a(N)}))})},[p,t,n,j,L]);mo(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,a(w=>({...w,isPositioned:!1})))},[u]);const V=d.useRef(!1);mo(()=>(V.current=!0,()=>{V.current=!1}),[]),mo(()=>{if(E&&(T.current=E),v&&(M.current=v),E&&v){if(H.current)return H.current(E,v,C);C()}},[E,v,C,H,P]);const D=d.useMemo(()=>({reference:T,floating:M,setReference:y,setFloating:x}),[y,x]),A=d.useMemo(()=>({reference:E,floating:v}),[E,v]),O=d.useMemo(()=>{const w={position:n,left:0,top:0};if(!A.floating)return w;const F=Bs(A.floating,f.x),N=Bs(A.floating,f.y);return l?{...w,transform:"translate("+F+"px, "+N+"px)",...Pa(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:N}},[n,l,A.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:C,refs:D,elements:A,floatingStyles:O}),[f,C,D,A,O])}const $d=(e,t)=>({...Nd(e),options:[e,t]}),Yd=(e,t)=>({...Fd(e),options:[e,t]}),Kd=(e,t)=>({..._d(e),options:[e,t]}),Gd=(e,t)=>({...Vd(e),options:[e,t]}),qd=(e,t)=>({...Bd(e),options:[e,t]}),Xd=(e,t)=>({...Hd(e),options:[e,t]}),Jd={intentional:"onClick",sloppy:"onPointerDown"};function Zd(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Yr(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:l,dataRef:c}=n.context,{enabled:u=!0,escapeKey:f=!0,outsidePress:a=!0,outsidePressEvent:p="sloppy",referencePress:m=!1,referencePressEvent:h="sloppy",ancestorScroll:b=!1,bubbles:R,externalTree:g}=t,y=Jt(g),x=se(typeof a=="function"?a:()=>!1),E=typeof a=="function"?x:a,v=d.useRef(!1),{escapeKey:T,outsidePress:M}=Zd(R),S=d.useRef(null),P=Ke(),H=Ke(),j=se(()=>{H.clear(),c.current.insideReactTree=!1}),L=d.useRef(!1),C=d.useRef(""),V=se(k=>{C.current=k.pointerType}),D=se(()=>{const k=C.current,re=k==="pen"||!k?"mouse":k,Z=typeof p=="function"?p():p;return typeof Z=="string"?Z:Z[re]}),A=se(k=>{if(!o||!u||!f||k.key!=="Escape"||L.current)return;const re=c.current.floatingContext?.nodeId,Z=y?tn(y.nodesRef.current,re):[];if(!T&&Z.length>0){let Y=!0;if(Z.forEach(ne=>{ne.context?.open&&!ne.context.dataRef.current.__escapeKeyBubbles&&(Y=!1)}),!Y)return}const be=Su(k)?k.nativeEvent:k,U=xe(Lr,be);n.setOpen(!1,U),!T&&!U.isPropagationAllowed&&k.stopPropagation()}),O=se(k=>{const re=D();return re==="intentional"&&k.type!=="click"||re==="sloppy"&&k.type==="click"}),w=se(()=>{c.current.insideReactTree=!0,H.start(0,j)}),F=se((k,re=!1)=>{if(O(k)){j();return}if(c.current.insideReactTree){j();return}if(D()==="intentional"&&re||typeof E=="function"&&!E(k))return;const Z=st(k),be=`[${wn("inert")}]`,U=qe(n.select("floatingElement")).querySelectorAll(be),Y=n.context.triggerElements;if(Z&&(Y.hasElement(Z)||Y.hasMatchingElement(X=>Se(X,Z))))return;let ne=De(Z)?Z:null;for(;ne&&!St(ne);){const X=Mt(ne);if(St(X)||!De(X))break;ne=X}if(U.length&&De(Z)&&!Ru(Z)&&!Se(Z,n.select("floatingElement"))&&Array.from(U).every(X=>!Se(ne,X)))return;if(Ue(Z)&&!("touches"in k)){const X=St(Z),_=mt(Z),ae=/auto|scroll/,Q=X||ae.test(_.overflowX),we=X||ae.test(_.overflowY),Te=Q&&Z.clientWidth>0&&Z.scrollWidth>Z.clientWidth,Pe=we&&Z.clientHeight>0&&Z.scrollHeight>Z.clientHeight,Ce=_.direction==="rtl",Me=Pe&&(Ce?k.offsetX<=Z.offsetWidth-Z.clientWidth:k.offsetX>Z.clientWidth),He=Te&&k.offsetY>Z.clientHeight;if(Me||He)return}const q=c.current.floatingContext?.nodeId,fe=y&&tn(y.nodesRef.current,q).some(X=>yt(k,X.context?.elements.floating));if(yt(k,n.select("floatingElement"))||yt(k,n.select("domReferenceElement"))||fe)return;const le=y?tn(y.nodesRef.current,q):[];if(le.length>0){let X=!0;if(le.forEach(_=>{_.context?.open&&!_.context.dataRef.current.__outsidePressBubbles&&(X=!1)}),!X)return}n.setOpen(!1,xe(Lo,k)),j()}),N=se(k=>{D()!=="sloppy"||k.pointerType==="touch"||!n.select("open")||!u||yt(k,n.select("floatingElement"))||yt(k,n.select("domReferenceElement"))||F(k)}),B=se(k=>{if(D()!=="sloppy"||!n.select("open")||!u||yt(k,n.select("floatingElement"))||yt(k,n.select("domReferenceElement")))return;const re=k.touches[0];re&&(S.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{S.current&&(S.current.dismissOnTouchEnd=!1,S.current.dismissOnMouseDown=!1)}))}),te=se(k=>{const re=st(k);function Z(){B(k),re?.removeEventListener(k.type,Z)}re?.addEventListener(k.type,Z)}),I=se(k=>{const re=v.current;if(v.current=!1,P.clear(),k.type==="mousedown"&&S.current&&!S.current.dismissOnMouseDown)return;const Z=st(k);function be(){k.type==="pointerdown"?N(k):F(k,re),Z?.removeEventListener(k.type,be)}Z?.addEventListener(k.type,be)}),$=se(k=>{if(D()!=="sloppy"||!S.current||yt(k,n.select("floatingElement"))||yt(k,n.select("domReferenceElement")))return;const re=k.touches[0];if(!re)return;const Z=Math.abs(re.clientX-S.current.startX),be=Math.abs(re.clientY-S.current.startY),U=Math.sqrt(Z*Z+be*be);U>5&&(S.current.dismissOnTouchEnd=!0),U>10&&(F(k),P.clear(),S.current=null)}),K=se(k=>{const re=st(k);function Z(){$(k),re?.removeEventListener(k.type,Z)}re?.addEventListener(k.type,Z)}),z=se(k=>{D()!=="sloppy"||!S.current||yt(k,n.select("floatingElement"))||yt(k,n.select("domReferenceElement"))||(S.current.dismissOnTouchEnd&&F(k),P.clear(),S.current=null)}),W=se(k=>{const re=st(k);function Z(){z(k),re?.removeEventListener(k.type,Z)}re?.addEventListener(k.type,Z)});d.useEffect(()=>{if(!o||!u)return;c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=M;const k=new rn;function re(ne){n.setOpen(!1,xe(nn,ne))}function Z(){k.clear(),L.current=!0}function be(){k.start(Oo()?5:0,()=>{L.current=!1})}const U=qe(r);U.addEventListener("pointerdown",V,!0),f&&(U.addEventListener("keydown",A),U.addEventListener("compositionstart",Z),U.addEventListener("compositionend",be)),E&&(U.addEventListener("click",I,!0),U.addEventListener("pointerdown",I,!0),U.addEventListener("touchstart",te,!0),U.addEventListener("touchmove",K,!0),U.addEventListener("touchend",W,!0),U.addEventListener("mousedown",I,!0));let Y=[];return b&&(De(i)&&(Y=jt(i)),De(r)&&(Y=Y.concat(jt(r))),!De(s)&&s&&s.contextElement&&(Y=Y.concat(jt(s.contextElement)))),Y=Y.filter(ne=>ne!==U.defaultView?.visualViewport),Y.forEach(ne=>{ne.addEventListener("scroll",re,{passive:!0})}),()=>{U.removeEventListener("pointerdown",V,!0),f&&(U.removeEventListener("keydown",A),U.removeEventListener("compositionstart",Z),U.removeEventListener("compositionend",be)),E&&(U.removeEventListener("click",I,!0),U.removeEventListener("pointerdown",I,!0),U.removeEventListener("touchstart",te,!0),U.removeEventListener("touchmove",K,!0),U.removeEventListener("touchend",W,!0),U.removeEventListener("mousedown",I,!0)),Y.forEach(ne=>{ne.removeEventListener("scroll",re)}),k.clear(),v.current=!1}},[c,r,s,i,f,E,o,l,b,u,T,M,A,F,I,N,te,K,W,V,n]),d.useEffect(j,[E,j]);const J=d.useMemo(()=>({onKeyDown:A,...m&&{[Jd[h]]:k=>{n.setOpen(!1,xe(zt,k.nativeEvent))},...h!=="intentional"&&{onClick(k){n.setOpen(!1,xe(zt,k.nativeEvent))}}}}),[A,n,m,h]),ue=se(k=>{const re=st(k.nativeEvent);!Se(n.select("floatingElement"),re)||k.button!==0||(v.current=!0)}),G=se(k=>{!o||!u||k.button!==0||(v.current=!0)}),de=d.useMemo(()=>({onKeyDown:A,onPointerDown:ue,onMouseDown:ue,onMouseUp:ue,onClickCapture:w,onMouseDownCapture(k){w(),G(k)},onPointerDownCapture(k){w(),G(k)},onMouseUpCapture:w,onTouchEndCapture:w,onTouchMoveCapture:w}),[A,ue,w,G]);return d.useMemo(()=>u?{reference:J,floating:de,trigger:J}:{},[u,J,de])}var Mo=Symbol("NOT_FOUND");function Qd(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ef(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tf(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 Hs=e=>Array.isArray(e)?e:[e];function nf(e){const t=Array.isArray(e[0])?e[0]:e;return tf(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function of(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function rf(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Mo},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function sf(e,t){let n=[];function o(l){const c=n.findIndex(u=>t(l,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return Mo}function r(l,c){o(l)===Mo&&(n.unshift({key:l,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var af=(e,t)=>e===t;function lf(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 cf(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=af,maxSize:r=1,resultEqualityCheck:s}=n,i=lf(o);let l=0;const c=r<=1?rf(i):sf(r,i);function u(){let f=c.get(arguments);if(f===Mo){if(f=e.apply(null,arguments),l++,s){const p=c.getEntries().find(m=>s(m.value,f));p&&(f=p.value,l!==0&&l--)}c.put(arguments,f)}return f}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>l,u.resetResultsCount=()=>{l=0},u}var uf=class{constructor(e){this.value=e}deref(){return this.value}},df=typeof WeakRef<"u"?WeakRef:uf,ff=0,_s=1;function oo(){return{s:ff,v:void 0,o:null,p:null}}function Oa(e,t={}){let n=oo();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let l=n;const{length:c}=arguments;for(let a=0,p=c;a<p;a++){const m=arguments[a];if(typeof m=="function"||typeof m=="object"&&m!==null){let h=l.o;h===null&&(l.o=h=new WeakMap);const b=h.get(m);b===void 0?(l=oo(),h.set(m,l)):l=b}else{let h=l.p;h===null&&(l.p=h=new Map);const b=h.get(m);b===void 0?(l=oo(),h.set(m,l)):l=b}}const u=l;let f;if(l.s===_s)f=l.v;else if(f=e.apply(null,arguments),s++,o){const a=r?.deref?.()??r;a!=null&&o(a,f)&&(f=a,s!==0&&s--),r=typeof f=="object"&&f!==null||typeof f=="function"?new df(f):f}return u.s=_s,u.v=f,f}return i.clearCache=()=>{n=oo(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Aa(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,l,c={},u=r.pop();typeof u=="object"&&(c=u,u=r.pop()),Qd(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...n,...c},{memoize:a,memoizeOptions:p=[],argsMemoize:m=Oa,argsMemoizeOptions:h=[]}=f,b=Hs(p),R=Hs(h),g=nf(r),y=a(function(){return s++,u.apply(null,arguments)},...b),x=m(function(){i++;const v=of(g,arguments);return l=y.apply(null,v),l},...R);return Object.assign(x,{resultFunc:u,memoizedResultFunc:y,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:a,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var pf=Aa(Oa),gf=Object.assign((e,t=pf)=>{ef(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,l,c)=>(i[n[c]]=l,i),{}))},{withTypes:()=>gf});Aa({memoize:cf,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const oe=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(Ge(1));let l;if(e)l=e;else throw new Error("Missing arguments");return l};var Jo={exports:{}},Zo={};var js;function mf(){if(js)return Zo;js=1;var e=di();function t(a,p){return a===p&&(a!==0||1/a===1/p)||a!==a&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(a,p){var m=p(),h=o({inst:{value:m,getSnapshot:p}}),b=h[0].inst,R=h[1];return s(function(){b.value=m,b.getSnapshot=p,c(b)&&R({inst:b})},[a,m,p]),r(function(){return c(b)&&R({inst:b}),a(function(){c(b)&&R({inst:b})})},[a]),i(m),m}function c(a){var p=a.getSnapshot;a=a.value;try{var m=p();return!n(a,m)}catch{return!0}}function u(a,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return Zo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Zo}var zs;function La(){return zs||(zs=1,Jo.exports=mf()),Jo.exports}var hf=La(),Qo={exports:{}},er={};var Us;function bf(){if(Us)return er;Us=1;var e=di(),t=La();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,c=e.useDebugValue;return er.useSyncExternalStoreWithSelector=function(u,f,a,p,m){var h=s(null);if(h.current===null){var b={hasValue:!1,value:null};h.current=b}else b=h.current;h=l(function(){function g(T){if(!y){if(y=!0,x=T,T=p(T),m!==void 0&&b.hasValue){var M=b.value;if(m(M,T))return E=M}return E=T}if(M=E,o(x,T))return M;var S=p(T);return m!==void 0&&m(M,S)?(x=T,M):(x=T,E=S)}var y=!1,x,E,v=a===void 0?null:a;return[function(){return g(f())},v===null?void 0:function(){return g(v())}]},[f,a,p,m]);var R=r(u,h[0],h[1]);return i(function(){b.hasValue=!0,b.value=R},[R]),c(R),R},er}var Ws;function yf(){return Ws||(Ws=1,Qo.exports=bf()),Qo.exports}var vf=yf();const xf=Ir(19),wf=xf?Rf:Ef;function Ee(e,t,n,o,r){return wf(e,t,n,o,r)}function Rf(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return hf.useSyncExternalStore(e.subscribe,s,s)}function Ef(e,t,n,o,r){return vf.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class mn{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])){mn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||mn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};mn.prototype.setState.call(this,t)}}class Kr extends mn{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),ie(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;ie(()=>(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);ie(()=>{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})),ie(()=>{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 Ee(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=se(n??dt);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 l=r;r=i,n(i,l,this)}})}}const Sf={open:oe(e=>e.open),domReferenceElement:oe(e=>e.domReferenceElement),referenceElement:oe(e=>e.positionReference??e.referenceElement),floatingElement:oe(e=>e.floatingElement),floatingId:oe(e=>e.floatingId)};class Gr extends Kr{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:ga(),nested:n,noEmit:o,triggerElements:s},Sf)}setOpen=(t,n)=>{if((!t||!this.state.open||Zi(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 Da(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,l=t.context.triggerElements.getById(s);i&&l===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 Na(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Da(e,n),i=se(l=>{if(s(l),!l||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:l,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:l,...o})});return ie(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Fa(e){const t=e.useState("open");ie(()=>{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 Va(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=$n(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=se(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),l=t.useState("preventUnmountingOnClose");return qt({enabled:!l,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class Vo{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 Cf(){return new Gr({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Vo,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ba(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Cf(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:$e,inactiveTriggerProps:$e,popupProps:$e}}const Ha={open:oe(e=>e.open),mounted:oe(e=>e.mounted),transitionStatus:oe(e=>e.transitionStatus),floatingRootContext:oe(e=>e.floatingRootContext),preventUnmountingOnClose:oe(e=>e.preventUnmountingOnClose),payload:oe(e=>e.payload),activeTriggerId:oe(e=>e.activeTriggerId),activeTriggerElement:oe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:oe((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:oe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:oe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:oe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:oe(e=>e.popupProps),popupElement:oe(e=>e.popupElement),positionerElement:oe(e=>e.positionerElement)};function _a(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Gt(),s=Vt()!=null,i=lt(()=>new Gr({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new Vo,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return ie(()=>{const l={open:t,floatingId:r};o.reference!==void 0&&(l.referenceElement=o.reference,l.domReferenceElement=De(o.reference)?o.reference:null),o.floating!==void 0&&(l.floatingElement=o.floating),i.update(l)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Tf(e={}){const{nodeId:t,externalTree:n}=e,o=_a(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,l]=d.useState(null),c=d.useRef(null),u=Jt(n);ie(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const f=Wd({...e,elements:{...s,...i&&{reference:i}}}),a=d.useCallback(M=>{const S=De(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;l(S),f.refs.setReference(S)},[f.refs]),[p,m]=d.useState(null),[h,b]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",De(p)?p:null),r.useSyncedValue("floatingElement",h);const R=d.useCallback(M=>{(De(M)||M===null)&&(c.current=M,m(M)),(De(f.refs.reference.current)||f.refs.reference.current===null||M!==null&&!De(M))&&f.refs.setReference(M)},[f.refs,m]),g=d.useCallback(M=>{b(M),f.refs.setFloating(M)},[f.refs]),y=d.useMemo(()=>({...f.refs,setReference:R,setFloating:g,setPositionReference:a,domReference:c}),[f.refs,R,g,a]),x=d.useMemo(()=>({...f.elements,domReference:s.domReference}),[f.elements,s.domReference]),E=r.useState("open"),v=r.useState("floatingId"),T=d.useMemo(()=>({...f,dataRef:r.context.dataRef,open:E,onOpenChange:r.setOpen,events:r.context.events,floatingId:v,refs:y,elements:x,nodeId:t,rootStore:r}),[f,y,x,t,r,E,v]);return ie(()=>{r.context.dataRef.current.floatingContext=T;const M=u?.nodesRef.current.find(S=>S.id===t);M&&(M.context=T)}),d.useMemo(()=>({...f,context:T,refs:y,elements:x,rootStore:r}),[f,y,x,T,r])}function ja(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Gt(),i=Vt()!=null,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(o?"popupElement":"positionerElement"),f=t.context.triggerElements,a=lt(()=>new Gr({open:l,referenceElement:c,floatingElement:u,triggerElements:f,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return ie(()=>{const p={open:l,floatingId:s,referenceElement:c,floatingElement:u};De(c)&&(p.domReferenceElement=c),a.state.positionReference===a.state.referenceElement&&(p.positionReference=c),a.update(p)},[l,s,c,u,a]),a.context.onOpenChange=r,a.context.nested=i,a.context.noEmit=n,a}const tr=yu&&$i;function Mf(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:o,dataRef:r}=n.context,{enabled:s=!0,visibleOnly:i=!0,delay:l}=t,c=d.useRef(!1),u=d.useRef(null),f=Ke(),a=d.useRef(!0);d.useEffect(()=>{const m=n.select("domReferenceElement");if(!s)return;const h=Ze(m);function b(){const y=n.select("domReferenceElement");!n.select("open")&&Ue(y)&&y===vt(qe(y))&&(c.current=!0)}function R(){a.current=!0}function g(){a.current=!1}return h.addEventListener("blur",b),tr&&(h.addEventListener("keydown",R,!0),h.addEventListener("pointerdown",g,!0)),()=>{h.removeEventListener("blur",b),tr&&(h.removeEventListener("keydown",R,!0),h.removeEventListener("pointerdown",g,!0))}},[n,s]),d.useEffect(()=>{if(!s)return;function m(h){if(h.reason===zt||h.reason===Lr){const b=n.select("domReferenceElement");De(b)&&(u.current=b,c.current=!0)}}return o.on("openchange",m),()=>{o.off("openchange",m)}},[o,s,n]);const p=d.useMemo(()=>({onMouseLeave(){c.current=!1,u.current=null},onFocus(m){const h=m.currentTarget;if(c.current){if(u.current===h)return;c.current=!1,u.current=null}const b=st(m.nativeEvent);if(i&&De(b)){if(tr&&!m.relatedTarget){if(!a.current&&!Fr(b))return}else if(!Eu(b))return}const R=m.relatedTarget&&n.context.triggerElements.hasElement(m.relatedTarget),{nativeEvent:g,currentTarget:y}=m,x=typeof l=="function"?l():l;if(n.select("open")&&R||x===0||x===void 0){n.setOpen(!0,xe(Fn,g,y));return}f.start(x,()=>{c.current||n.setOpen(!0,xe(Fn,g,y))})},onBlur(m){c.current=!1,u.current=null;const h=m.relatedTarget,b=m.nativeEvent,R=De(h)&&h.hasAttribute(wn("focus-guard"))&&h.getAttribute("data-type")==="outside";f.start(0,()=>{const g=n.select("domReferenceElement"),y=vt(g?g.ownerDocument:document);if(!h&&y===g||Se(r.current.floatingContext?.refs.floating.current,y)||Se(g,y)||R)return;const x=h??y;if(De(x)){const E=n.context.triggerElements;if(E.hasElement(x)||E.hasMatchingElement(v=>Se(v,x)))return}n.setOpen(!1,xe(Fn,b))})}}),[r,n,i,f,l]);return d.useMemo(()=>s?{reference:p,trigger:p}:{},[s,p])}const xr=wn("safe-polygon"),If=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${qi}`;function kf(e){return e?!!e.closest(If):!1}function za(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(()=>{}),l=d.useRef(!1),c=Ke(),u=Ke(),f=d.useRef(void 0);return d.useMemo(()=>{const a=e.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:l,openChangeTimeout:c,restTimeout:u,handleCloseOptionsRef:f}),a.hoverInteractionState},[e,t,n,o,r,s,i,l,c,u,f])}const Pf=new Set(["click","mousedown"]);function Of(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:l=!0,closeDelay:c=0,externalTree:u}=t,{pointerTypeRef:f,interactedInsideRef:a,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:h,restTimeoutPendingRef:b,openChangeTimeout:R,handleCloseOptionsRef:g}=za(n),y=Jt(u),x=Vt(),E=se(()=>a.current?!0:i.current.openEvent?Pf.has(i.current.openEvent.type):!1),v=se(()=>{const H=i.current.openEvent?.type;return H?.includes("mouse")&&H!=="mousedown"}),T=d.useCallback((H,j=!0)=>{const L=Af(c,f.current);L&&!p.current?R.start(L,()=>n.setOpen(!1,xe(ut,H))):j&&(R.clear(),n.setOpen(!1,xe(ut,H)))},[c,p,n,f,R]),M=se(()=>{h.current(),p.current=void 0}),S=se(()=>{if(m.current){const H=qe(r).body;H.style.pointerEvents="",H.removeAttribute(xr),m.current=!1}}),P=se(H=>{const j=st(H);if(!kf(j)){a.current=!1;return}a.current=!0});ie(()=>{o||(f.current=void 0,b.current=!1,a.current=!1,M(),S())},[o,f,b,a,M,S]),d.useEffect(()=>()=>{M()},[M]),d.useEffect(()=>S,[S]),ie(()=>{if(l&&o&&g.current?.blockPointerEvents&&v()&&De(s)&&r){m.current=!0;const H=qe(r).body;H.setAttribute(xr,"");const j=s,L=r,C=y?.nodesRef.current.find(V=>V.id===x)?.context?.elements.floating;return C&&(C.style.pointerEvents=""),H.style.pointerEvents="none",j.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{H.style.pointerEvents="",j.style.pointerEvents="",L.style.pointerEvents=""}}},[l,o,s,r,g,v,y,x,m]),d.useEffect(()=>{if(!l)return;function H(V){if(E()||!i.current.floatingContext||!n.select("open"))return;const D=n.context.triggerElements;V.relatedTarget&&D.hasElement(V.relatedTarget)||(S(),M(),E()||T(V))}function j(V){R.clear(),S(),p.current?.(V),M()}function L(V){E()||T(V,!1)}const C=r;return C&&(C.addEventListener("mouseleave",H),C.addEventListener("mouseenter",j),C.addEventListener("mouseleave",L),C.addEventListener("pointerdown",P,!0)),()=>{C&&(C.removeEventListener("mouseleave",H),C.removeEventListener("mouseenter",j),C.removeEventListener("mouseleave",L),C.removeEventListener("pointerdown",P,!0))}})}function Af(e,t){return t&&!yn(t)?0:typeof e=="function"?e():e}function nr(e){return typeof e=="function"?e():e}const Lf={current:null};function Ua(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:l=null,mouseOnly:c=!1,restMs:u=0,move:f=!0,triggerElementRef:a=Lf,externalTree:p,isActiveTrigger:m=!0}=t,h=Jt(p),{pointerTypeRef:b,interactedInsideRef:R,handlerRef:g,blockMouseMoveRef:y,performedPointerEventsMutationRef:x,unbindMouseMoveRef:E,restTimeoutPendingRef:v,openChangeTimeout:T,restTimeout:M,handleCloseOptionsRef:S}=za(n),P=tt(l),H=tt(i),j=tt(u);m&&(S.current=P.current?.__options);const L=se(()=>R.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),C=d.useCallback((O,w=!0)=>{const F=Yo(H.current,"close",b.current);F&&!g.current?T.start(F,()=>n.setOpen(!1,xe(ut,O))):w&&(T.clear(),n.setOpen(!1,xe(ut,O)))},[H,g,n,b,T]),V=se(()=>{E.current(),g.current=void 0}),D=se(()=>{if(x.current){const O=qe(n.select("domReferenceElement")).body;O.style.pointerEvents="",O.removeAttribute(xr),x.current=!1}});d.useEffect(()=>{if(!s)return;function O(w){w.open||(T.clear(),M.clear(),y.current=!0,v.current=!1)}return r.on("openchange",O),()=>{r.off("openchange",O)}},[s,r,T,M,y,v]);const A=se(O=>{if(L()||!o.current.floatingContext)return;const w=n.context.triggerElements;if(O.relatedTarget&&w.hasElement(O.relatedTarget))return;const F=a.current;P.current?.({...o.current.floatingContext,tree:h,x:O.clientX,y:O.clientY,onClose(){D(),V(),!L()&&F===n.select("domReferenceElement")&&C(O)}})(O)});return d.useEffect(()=>{if(!s)return;const O=a.current??(m?n.select("domReferenceElement"):null);if(!De(O))return;function w(B){if(T.clear(),y.current=!1,c&&!yn(b.current)||nr(j.current)>0&&!Yo(H.current,"open"))return;const te=Yo(H.current,"open",b.current),I=n.select("domReferenceElement"),$=n.context.triggerElements,K=($.hasElement(B.target)||$.hasMatchingElement(ue=>Se(ue,B.target)))&&(!I||!Se(I,B.target)),z=B.currentTarget??null,W=n.select("open"),J=!W||K;K&&W?n.setOpen(!0,xe(ut,B,z)):te?T.start(te,()=>{J&&n.setOpen(!0,xe(ut,B,z))}):J&&n.setOpen(!0,xe(ut,B,z))}function F(B){if(L()){D();return}E.current();const te=n.select("domReferenceElement"),I=qe(te);M.clear(),v.current=!1;const $=n.context.triggerElements;if(B.relatedTarget&&$.hasElement(B.relatedTarget))return;if(P.current&&o.current.floatingContext){n.select("open")||T.clear();const z=a.current;g.current=P.current({...o.current.floatingContext,tree:h,x:B.clientX,y:B.clientY,onClose(){D(),V(),!L()&&z===n.select("domReferenceElement")&&C(B,!0)}});const W=g.current;W(B),I.addEventListener("mousemove",W),E.current=()=>{I.removeEventListener("mousemove",W)};return}(b.current!=="touch"||!Se(n.select("floatingElement"),B.relatedTarget))&&C(B)}function N(B){A(B)}return n.select("open")&&O.addEventListener("mouseleave",N),f&&O.addEventListener("mousemove",w,{once:!0}),O.addEventListener("mouseenter",w),O.addEventListener("mouseleave",F),()=>{O.removeEventListener("mouseleave",N),f&&O.removeEventListener("mousemove",w),O.removeEventListener("mouseenter",w),O.removeEventListener("mouseleave",F)}},[V,D,y,o,H,C,n,s,P,A,m,L,c,f,b,j,M,v,T,a,h,E,g]),d.useMemo(()=>{function O(w){b.current=w.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(w){const{nativeEvent:F}=w,N=w.currentTarget,B=n.select("domReferenceElement"),te=n.context.triggerElements,I=n.select("open"),$=(te.hasElement(w.target)||te.hasMatchingElement(z=>Se(z,w.target)))&&(!B||!Se(B,w.target));if(c&&!yn(b.current)||I&&!$||nr(j.current)===0||!$&&v.current&&w.movementX**2+w.movementY**2<2)return;M.clear();function K(){if(v.current=!1,L())return;const z=n.select("open");!y.current&&(!z||$)&&n.setOpen(!0,xe(ut,F,N))}b.current==="touch"?Tt.flushSync(()=>{K()}):$&&I?K():(v.current=!0,M.start(nr(j.current),K))}}},[y,L,c,n,b,j,M,v])}function Pn(e=[]){const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),o=e.map(u=>u?.item),r=e.map(u=>u?.trigger),s=d.useCallback(u=>ro(u,e,"reference"),t),i=d.useCallback(u=>ro(u,e,"floating"),n),l=d.useCallback(u=>ro(u,e,"item"),o),c=d.useCallback(u=>ro(u,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:l,getTriggerProps:c}),[s,i,l,c])}function ro(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[pr]="");for(const i in e)r&&e&&(i===Ki||i===Gi)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let l;const c=t[i]?.[n];typeof c=="function"?l=e?c(e):null:l=c,l&&$s(s,l,r,o)}return $s(s,e,r,o),s}function $s(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Ki||r===Gi)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(l=>l(...i)).find(l=>l!==void 0))):e[r]=s)}}const Df="Escape";function Bo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function so(e,t){return Bo(t,e===Nr||e===Yn,e===Ut||e===Wt)}function or(e,t,n){return Bo(t,e===Yn,n?e===Ut:e===Wt)||e==="Enter"||e===" "||e===""}function Nf(e,t,n){return Bo(t,n?e===Ut:e===Wt,e===Yn)}function Ff(e,t,n,o){const r=n?e===Wt:e===Ut,s=e===Nr;return t==="both"||t==="horizontal"&&o&&o>1?e===Df:Bo(t,r,s)}function Wa(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:l,activeIndex:c,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:a=null,allowEscape:p=!1,loopFocus:m=!1,nested:h=!1,rtl:b=!1,virtual:R=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:x=!0,disabledIndices:E=void 0,orientation:v="vertical",parentOrientation:T,cols:M=1,scrollItemIntoView:S=!0,itemSizes:P,dense:H=!1,id:j,resetOnPointerLeave:L=!0,externalTree:C}=t,V=Hn(r),D=tt(V),A=Vt(),O=Jt(C);ie(()=>{i.current.orientation=v},[i,v]);const w=gr(s),F=d.useRef(g),N=d.useRef(a??-1),B=d.useRef(null),te=d.useRef(!0),I=se(_=>{u(N.current===-1?null:N.current,_)}),$=d.useRef(I),K=d.useRef(!!r),z=d.useRef(o),W=d.useRef(!1),J=d.useRef(!1),ue=tt(E),G=tt(o),de=tt(S),k=tt(a),re=tt(L),Z=se(()=>{function _(Te){R?O?.events.emit("virtualfocus",Te):go(Te,{sync:W.current,preventScroll:!0})}const ae=l.current[N.current],Q=J.current;ae&&_(ae),(W.current?Te=>Te():requestAnimationFrame)(()=>{const Te=l.current[N.current]||ae;if(!Te)return;ae||_(Te);const Pe=de.current;Pe&&U&&(Q||!te.current)&&Te.scrollIntoView?.(typeof Pe=="boolean"?{block:"nearest",inline:"nearest"}:Pe)})});ie(()=>{f&&(o&&r?(N.current=a??-1,F.current&&a!=null&&(J.current=!0,I())):K.current&&(N.current=-1,$.current()))},[f,o,r,a,I]),ie(()=>{if(f){if(!o){W.current=!1;return}if(r)if(c==null){if(W.current=!1,k.current!=null)return;if(K.current&&(N.current=-1,Z()),(!z.current||!K.current)&&F.current&&(B.current!=null||F.current===!0&&B.current==null)){let _=0;const ae=()=>{l.current[0]==null?(_<2&&(_?requestAnimationFrame:queueMicrotask)(ae),_+=1):(N.current=B.current==null||or(B.current,v,b)||h?po(l):br(l),B.current=null,I())};ae()}}else dn(l,c)||(N.current=c,Z(),J.current=!1)}},[f,o,r,c,k,h,l,v,b,I,Z,ue]),ie(()=>{if(!f||r||!O||R||!K.current)return;const _=O.nodesRef.current,ae=_.find(Te=>Te.id===A)?.context?.elements.floating,Q=vt(qe(r)),we=_.some(Te=>Te.context&&Se(Te.context.elements.floating,Q));ae&&!we&&te.current&&ae.focus({preventScroll:!0})},[f,r,O,A,R]),ie(()=>{$.current=I,z.current=o,K.current=!!r}),ie(()=>{o||(B.current=null,F.current=g)},[o,g]);const be=c!=null,U=d.useMemo(()=>{function _(Q){if(!G.current)return;const we=l.current.indexOf(Q.currentTarget);we!==-1&&N.current!==we&&(N.current=we,I(Q))}return{onFocus(Q){W.current=!0,_(Q)},onClick:({currentTarget:Q})=>Q.focus({preventScroll:!0}),onMouseMove(Q){W.current=!0,J.current=!1,y&&_(Q)},onPointerLeave(Q){if(!G.current||!te.current||Q.pointerType==="touch")return;W.current=!0;const we=Q.relatedTarget;!y||l.current.includes(we)||re.current&&(N.current=-1,I(Q),R||D.current?.focus({preventScroll:!0}))}}},[G,D,y,l,I,re,R]),Y=d.useCallback(()=>T??O?.nodesRef.current.find(_=>_.id===A)?.context?.dataRef?.current.orientation,[A,O,T]),ne=se(_=>{if(te.current=!1,W.current=!0,_.which===229||!G.current&&_.currentTarget===D.current)return;if(h&&Ff(_.key,v,b,M)){so(_.key,Y())||rt(_),n.setOpen(!1,xe(fo,_.nativeEvent)),Ue(s)&&(R?O?.events.emit("virtualfocus",s):s.focus());return}const ae=N.current,Q=po(l,E),we=br(l,E);if(w||(_.key==="Home"&&(rt(_),N.current=Q,I(_)),_.key==="End"&&(rt(_),N.current=we,I(_))),M>1){const Te=P||Array.from({length:l.current.length},()=>({width:1,height:1})),Pe=ta(Te,M,H),Ce=Pe.findIndex(Be=>Be!=null&&!$t(l,Be,E)),Me=Pe.reduce((Be,Fe,he)=>Fe!=null&&!$t(l,Fe,E)?he:Be,-1),He=Pe[ea({current:Pe.map(Be=>Be!=null?l.current[Be]:null)},{event:_,orientation:v,loopFocus:m,rtl:b,cols:M,disabledIndices:oa([...(typeof E!="function"?E:null)||l.current.map((Be,Fe)=>$t(l,Fe,E)?Fe:void 0),void 0],Pe),minIndex:Ce,maxIndex:Me,prevIndex:na(N.current>we?Q:N.current,Te,Pe,M,_.key===Yn?"bl":_.key===(b?Ut:Wt)?"tr":"tl"),stopEvent:!0})];if(He!=null&&(N.current=He,I(_)),v==="both")return}if(so(_.key,v)){if(rt(_),o&&!R&&vt(_.currentTarget.ownerDocument)===_.currentTarget){N.current=or(_.key,v,b)?Q:we,I(_);return}or(_.key,v,b)?m?ae>=we?p&&ae!==l.current.length?N.current=-1:(W.current=!1,N.current=Q):N.current=ot(l,{startingIndex:ae,disabledIndices:E}):N.current=Math.min(we,ot(l,{startingIndex:ae,disabledIndices:E})):m?ae<=Q?p&&ae!==-1?N.current=l.current.length:(W.current=!1,N.current=we):N.current=ot(l,{startingIndex:ae,decrement:!0,disabledIndices:E}):N.current=Math.max(Q,ot(l,{startingIndex:ae,decrement:!0,disabledIndices:E})),dn(l,N.current)&&(N.current=-1),I(_)}}),q=d.useMemo(()=>R&&o&&be&&{"aria-activedescendant":`${j}-${c}`},[R,o,be,j,c]),fe=d.useMemo(()=>({"aria-orientation":v==="both"?void 0:v,...w?{}:q,onKeyDown(_){if(_.key==="Tab"&&_.shiftKey&&o&&!R){const ae=st(_.nativeEvent);if(ae&&!Se(D.current,ae))return;rt(_),n.setOpen(!1,xe(on,_.nativeEvent)),Ue(s)&&s.focus();return}ne(_)},onPointerMove(){te.current=!0}}),[q,ne,D,v,w,n,o,R,s]),le=d.useMemo(()=>{function _(Q){g==="auto"&&Xi(Q.nativeEvent)&&(F.current=!R)}function ae(Q){F.current=g,g==="auto"&&Ji(Q.nativeEvent)&&(F.current=!0)}return{onKeyDown(Q){const we=n.select("open");te.current=!1;const Te=Q.key.startsWith("Arrow"),Pe=Nf(Q.key,Y(),b),Ce=so(Q.key,v),Me=(h?Pe:Ce)||Q.key==="Enter"||Q.key.trim()==="";if(R&&we)return ne(Q);if(!(!we&&!x&&Te)){if(Me){const He=so(Q.key,Y());B.current=h&&He?null:Q.key}if(h){Pe&&(rt(Q),we?(N.current=po(l,ue.current),I(Q)):n.setOpen(!0,xe(fo,Q.nativeEvent,Q.currentTarget)));return}Ce&&(k.current!=null&&(N.current=k.current),rt(Q),!we&&x?n.setOpen(!0,xe(fo,Q.nativeEvent,Q.currentTarget)):ne(Q),we&&I(Q))}},onFocus(Q){n.select("open")&&!R&&(N.current=-1,I(Q))},onPointerDown:ae,onPointerEnter:ae,onMouseDown:_,onClick:_}},[ne,ue,g,l,h,I,n,x,v,Y,b,k,R]),X=d.useMemo(()=>({...q,...le}),[q,le]);return d.useMemo(()=>f?{reference:X,floating:fe,item:U,trigger:le}:{},[f,X,fe,le,U])}const Vf=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $a(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:l=!0,role:c="dialog"}=t,u=Gt(),f=s?.id||u,a=d.useMemo(()=>Hn(i)?.id||r,[i,r]),p=Vf.get(c)??c,h=Vt()!=null,b=d.useMemo(()=>p==="tooltip"||c==="label"?$e:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&h&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,h,c]),R=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?a:void 0}:{...b,"aria-expanded":o?"true":"false","aria-controls":o?a:void 0,...p==="menu"&&{id:f}},[p,a,o,f,c,b]),g=d.useMemo(()=>{const x={id:a,...p&&{role:p}};return p==="tooltip"||c==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":f}}},[p,a,f,c]),y=d.useCallback(({active:x,selected:E})=>{const v={role:"option",...x&&{id:`${a}-fui-option`}};switch(c){case"select":case"combobox":return{...v,"aria-selected":E}}return{}},[a,c]);return d.useMemo(()=>l?{reference:R,floating:g,item:y,trigger:b}:{},[l,R,g,b,y])}function Ya(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.context.dataRef,{listRef:s,activeIndex:i,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:f=null,resetMs:a=750,ignoreKeys:p=Dt,selectedIndex:m=null}=t,h=Ke(),b=d.useRef(""),R=d.useRef(m??i??-1),g=d.useRef(null);ie(()=>{o&&(h.clear(),g.current=null,b.current="")},[o,h]),ie(()=>{o&&b.current===""&&(R.current=m??i??-1)},[o,m,i]);const y=se(T=>{T?r.current.typing||(r.current.typing=T,c?.(T)):r.current.typing&&(r.current.typing=T,c?.(T))}),x=se(T=>{function M(L,C,V){const D=f?f(C,V):C.find(A=>A?.toLocaleLowerCase().indexOf(V.toLocaleLowerCase())===0);return D?L.indexOf(D):-1}const S=s.current;if(b.current.length>0&&b.current[0]!==" "&&(M(S,S,b.current)===-1?y(!1):T.key===" "&&rt(T)),S==null||p.includes(T.key)||T.key.length!==1||T.ctrlKey||T.metaKey||T.altKey)return;o&&T.key!==" "&&(rt(T),y(!0)),S.every(L=>L?L[0]?.toLocaleLowerCase()!==L[1]?.toLocaleLowerCase():!0)&&b.current===T.key&&(b.current="",R.current=g.current),b.current+=T.key,h.start(a,()=>{b.current="",R.current=g.current,y(!1)});const H=R.current,j=M(S,[...S.slice((H||0)+1),...S.slice(0,(H||0)+1)],b.current);j!==-1?(l?.(j),g.current=j):T.key!==" "&&(b.current="",y(!1))}),E=d.useMemo(()=>({onKeyDown:x}),[x]),v=d.useMemo(()=>({onKeyDown:x,onKeyUp(T){T.key===" "&&y(!1)}}),[x,y]);return d.useMemo(()=>u?{reference:E,floating:v}:{},[u,E,v])}function Ys(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,l=s-1;i<s;l=i++){const[c,u]=t[i]||[0,0],[f,a]=t[l]||[0,0];u>=o!=a>=o&&n<=(f-c)*(o-u)/(a-u)+c&&(r=!r)}return r}function Bf(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ka(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new rn;let s=!1,i=null,l=null,c=typeof performance<"u"?performance.now():0;function u(a,p){const m=performance.now(),h=m-c;if(i===null||l===null||h===0)return i=a,l=p,c=m,null;const b=a-i,R=p-l,y=Math.sqrt(b*b+R*R)/h;return i=a,l=p,c=m,y}const f=({x:a,y:p,placement:m,elements:h,onClose:b,nodeId:R,tree:g})=>function(x){function E(){r.clear(),b()}if(r.clear(),!h.domReference||!h.floating||m==null||a==null||p==null)return;const{clientX:v,clientY:T}=x,M=[v,T],S=st(x),P=x.type==="mouseleave",H=Se(h.floating,S),j=Se(h.domReference,S),L=h.domReference.getBoundingClientRect(),C=h.floating.getBoundingClientRect(),V=m.split("-")[0],D=a>C.right-C.width/2,A=p>C.bottom-C.height/2,O=Bf(M,L),w=C.width>L.width,F=C.height>L.height,N=(w?L:C).left,B=(w?L:C).right,te=(F?L:C).top,I=(F?L:C).bottom;if(H&&(s=!0,!P))return;if(j&&(s=!1),j&&!P){s=!0;return}if(P&&De(x.relatedTarget)&&Se(h.floating,x.relatedTarget)||g&&tn(g.nodesRef.current,R).some(({context:z})=>z?.open))return;if(V==="top"&&p>=L.bottom-1||V==="bottom"&&p<=L.top+1||V==="left"&&a>=L.right-1||V==="right"&&a<=L.left+1)return E();let $=[];switch(V){case"top":$=[[N,L.top+1],[N,C.bottom-1],[B,C.bottom-1],[B,L.top+1]];break;case"bottom":$=[[N,C.top+1],[N,L.bottom-1],[B,L.bottom-1],[B,C.top+1]];break;case"left":$=[[C.right-1,I],[C.right-1,te],[L.left+1,te],[L.left+1,I]];break;case"right":$=[[L.right-1,I],[L.right-1,te],[C.left+1,te],[C.left+1,I]];break}function K([z,W]){switch(V){case"top":{const J=[w?z+t/2:D?z+t*4:z-t*4,W+t+1],ue=[w?z-t/2:D?z+t*4:z-t*4,W+t+1],G=[[C.left,D||w?C.bottom-t:C.top],[C.right,D?w?C.bottom-t:C.top:C.bottom-t]];return[J,ue,...G]}case"bottom":{const J=[w?z+t/2:D?z+t*4:z-t*4,W-t],ue=[w?z-t/2:D?z+t*4:z-t*4,W-t],G=[[C.left,D||w?C.top+t:C.bottom],[C.right,D?w?C.top+t:C.bottom:C.top+t]];return[J,ue,...G]}case"left":{const J=[z+t+1,F?W+t/2:A?W+t*4:W-t*4],ue=[z+t+1,F?W-t/2:A?W+t*4:W-t*4];return[...[[A||F?C.right-t:C.left,C.top],[A?F?C.right-t:C.left:C.right-t,C.bottom]],J,ue]}case"right":{const J=[z-t,F?W+t/2:A?W+t*4:W-t*4],ue=[z-t,F?W-t/2:A?W+t*4:W-t*4],G=[[A||F?C.left+t:C.right,C.top],[A?F?C.left+t:C.right:C.left+t,C.bottom]];return[J,ue,...G]}default:return[]}}if(!Ys([v,T],$)){if(s&&!O)return E();if(!P&&o){const z=u(x.clientX,x.clientY);if(z!==null&&z<.1)return E()}Ys([v,T],K([a,p]))?!s&&o&&r.start(40,E):E()}};return f.__options={blockPointerEvents:n},f}const Hf=d.createContext(void 0);function Ga(e){return d.useContext(Hf)}const hn="ArrowUp",en="ArrowDown",jn="ArrowLeft",bn="ArrowRight",Gn="Home",qn="End",qa=new Set([jn,bn]),_f=new Set([jn,bn,Gn,qn]),Xa=new Set([hn,en]),jf=new Set([hn,en,Gn,qn]),Ja=new Set([...qa,...Xa]),zf=new Set([...Ja,Gn,qn]),qr=new Set([hn,en,jn,bn,Gn,qn]),Uf="Shift",Wf="Control",$f="Alt",Yf="Meta",Kf=new Set([Uf,Wf,$f,Yf]);function Gf(e){return Ue(e)&&e.tagName==="INPUT"}function Ks(e){return!!(Gf(e)&&e.selectionStart!=null||Ue(e)&&e.tagName==="TEXTAREA")}function Gs(e,t,n,o){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(i&&o!=="vertical"){const c=qs(e,t,"left"),u=io(e),f=io(t);n==="ltr"&&(c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight?r=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight:c-f.scrollMarginLeft<e.scrollLeft+u.scrollPaddingLeft&&(r=c-f.scrollMarginLeft-u.scrollPaddingLeft)),n==="rtl"&&(c-f.scrollMarginRight<e.scrollLeft+u.scrollPaddingLeft?r=c-f.scrollMarginLeft-u.scrollPaddingLeft:c+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-u.scrollPaddingRight&&(r=c+t.offsetWidth+f.scrollMarginRight-e.clientWidth+u.scrollPaddingRight))}if(l&&o!=="horizontal"){const c=qs(e,t,"top"),u=io(e),f=io(t);c-f.scrollMarginTop<e.scrollTop+u.scrollPaddingTop?s=c-f.scrollMarginTop-u.scrollPaddingTop:c+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-u.scrollPaddingBottom&&(s=c+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+u.scrollPaddingBottom)}e.scrollTo({left:r,top:s,behavior:"auto"})}function qs(e,t,n){const o=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[o],t.offsetParent!==e);)t=t.offsetParent;return r}function io(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Za(e){return e==="starting"?ic:$e}const qf={...Mn,...Tn},Kg=d.forwardRef(function(t,n){const{render:o,className:r,finalFocus:s,...i}=t,{store:l}=Pt(),{side:c,align:u}=Pr(),f=Ga()!=null,a=l.useState("open"),p=l.useState("transitionStatus"),m=l.useState("popupProps"),h=l.useState("mounted"),b=l.useState("instantType"),R=l.useState("activeTriggerElement"),g=l.useState("parent"),y=l.useState("lastOpenChangeReason"),x=l.useState("rootId"),E=l.useState("floatingRootContext"),v=l.useState("floatingTreeRoot"),T=l.useState("closeDelay"),M=l.useState("activeTriggerElement"),S=g.type==="context-menu";qt({open:a,ref:l.context.popupRef,onComplete(){a&&l.context.onOpenChangeComplete?.(!0)}}),d.useEffect(()=>{function V(D){l.setOpen(!1,xe(D.reason,D.domEvent))}return v.events.on("close",V),()=>{v.events.off("close",V)}},[v.events,l]);const P=l.useState("hoverEnabled"),H=l.useState("disabled");Of(E,{enabled:P&&!H&&!S&&g.type!=="menubar",closeDelay:T});const j=d.useMemo(()=>({transitionStatus:p,side:c,align:u,open:a,nested:g.type==="menu",instant:b}),[p,c,u,a,g.type,b]),L=Ae("div",t,{state:j,ref:[n,l.context.popupRef],stateAttributesMapping:qf,props:[m,{onKeyDown(V){f&&qr.has(V.key)&&V.stopPropagation()}},Za(p),i,{"data-rootownerid":x}]});let C=g.type===void 0||S;return(R||g.type==="menubar"&&y!==Lo)&&(C=!0),ce.jsx(Wr,{context:E,modal:S,disabled:!h,returnFocus:s===void 0?C:s,initialFocus:g.type!=="menu",restoreFocus:!0,externalTree:g.type!=="menubar"?v:void 0,previousFocusableElement:M,nextFocusableElement:g.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?l.context.beforeContentFocusGuardRef:void 0,children:L})}),Qa=d.createContext(void 0);function Xf(){const e=d.useContext(Qa);if(e===void 0)throw new Error(Ge(32));return e}const Gg=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Pt();return s.useState("mounted")||o?ce.jsx(Qa.Provider,{value:o,children:ce.jsx(zr,{ref:n,...r})}):null});function Xr(e){return Ir(19)?e:e?"true":void 0}const Jf=d.createContext(void 0);function Ho(){return d.useContext(Jf)?.direction??"ltr"}const Zf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:f=0,offsetParent:a="real"}=Nt(e,t)||{};if(u==null)return{};const p=Qi(f),m={x:n,y:o},h=Hr(r),b=Br(h),R=await i.getDimensions(u),g=h==="y",y=g?"top":"left",x=g?"bottom":"right",E=g?"clientHeight":"clientWidth",v=s.reference[b]+s.reference[h]-m[h]-s.floating[b],T=m[h]-s.reference[h],M=a==="real"?await i.getOffsetParent?.(u):l.floating;let S=l.floating[E]||s.floating[b];(!S||!await i.isElement?.(M))&&(S=l.floating[E]||s.floating[b]);const P=v/2-T/2,H=S/2-R[b]/2-1,j=Math.min(p[y],H),L=Math.min(p[x],H),C=j,V=S-R[b]-L,D=S/2-R[b]/2+P,A=mr(C,D,V),O=!c.arrow&&Xt(r)!=null&&D!==A&&s.reference[b]/2-(D<C?j:L)-R[b]/2<0,w=O?D<C?D-C:D-V:0;return{[h]:m[h]+w,data:{[h]:A,centerOffset:D-A-w,...O&&{alignmentOffset:w}},reset:O}}}),Qf=(e,t)=>({...Zf(e),options:[e,t]}),ep={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 Xd().fn(e)).data?.referenceHidden||s}}}},tp={sideX:"left",sideY:"top"};function el(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 Xs(e,t,n){const{rects:o,placement:r}=e;return{side:el(t,gt(r),n),align:Xt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function tl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:l,collisionPadding:c=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:a=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:b,shiftCrossAxis:R=!1,nodeId:g,adaptiveOrigin:y,lazyFlip:x=!1,externalTree:E}=e,[v,T]=d.useState(null);!h&&v!==null&&T(null);const M=b.side||"flip",S=b.align||"flip",P=b.fallbackAxisSide||"end",H=typeof t=="function"?t:void 0,j=se(H),L=H?j:t,C=tt(t),D=Ho()==="rtl",A=v||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":D?"left":"right","inline-start":D?"right":"left"}[o],O=s==="center"?A:`${A}-${s}`;let w=c;const F=1,N=o==="bottom"?F:0,B=o==="top"?F:0,te=o==="right"?F:0,I=o==="left"?F:0;typeof w=="number"?w={top:w+N,right:w+I,bottom:w+B,left:w+te}:w&&(w={top:(w.top||0)+N,right:(w.right||0)+I,bottom:(w.bottom||0)+B,left:(w.left||0)+te});const $={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:w},K=d.useRef(null),z=tt(r),W=tt(i),G=[$d(Ne=>{const Ve=Xs(Ne,o,D),Le=typeof z.current=="function"?z.current(Ve):z.current,Xe=typeof W.current=="function"?W.current(Ve):W.current;return{mainAxis:Le,crossAxis:Xe,alignmentAxis:Xe}},[typeof r!="function"?r:0,typeof i!="function"?i:0,D,o])],de=S==="none"&&M!=="shift",k=!de&&(u||R||M==="shift"),re=M==="none"?null:Gd({...$,padding:{top:w.top+F,right:w.right+F,bottom:w.bottom+F,left:w.left+F},mainAxis:!R&&M==="flip",crossAxis:S==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),Z=de?null:Yd(Ne=>{const Ve=it(Ne.elements.floating).documentElement;return{...$,rootBoundary:R?{x:0,y:0,width:Ve.clientWidth,height:Ve.clientHeight}:void 0,mainAxis:S!=="none",crossAxis:k,limiter:u||R?void 0:Kd(Le=>{if(!K.current)return{};const{width:Xe,height:nt}=K.current.getBoundingClientRect(),Ye=ht(gt(Le.placement)),at=Ye==="y"?Xe:nt,ye=Ye==="y"?w.left+w.right:w.top+w.bottom;return{offset:at/2+ye/2}})}},[$,u,R,w,S]);M==="shift"||S==="shift"||s==="center"?G.push(Z,re):G.push(re,Z),G.push(qd({...$,apply({elements:{floating:Ne},rects:{reference:Ve},availableWidth:Le,availableHeight:Xe}){Object.entries({"--available-width":`${Le}px`,"--available-height":`${Xe}px`,"--anchor-width":`${Ve.width}px`,"--anchor-height":`${Ve.height}px`}).forEach(([nt,Ye])=>{Ne.style.setProperty(nt,Ye)})}}),Qf(()=>({element:K.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ne){const{elements:Ve,middlewareData:Le,placement:Xe,rects:nt,y:Ye}=Ne,at=gt(Xe),ye=ht(at),je=K.current,We=Le.arrow?.x||0,Qe=Le.arrow?.y||0,xt=je?.clientWidth||0,me=je?.clientHeight||0,Ie=We+xt/2,Je=Qe+me/2,ze=Math.abs(Le.shift?.y||0),_e=nt.reference.height/2,ft=typeof r=="function"?r(Xs(Ne,o,D)):r,wt=ze>ft,us={top:`${Ie}px calc(100% + ${ft}px)`,bottom:`${Ie}px ${-ft}px`,left:`calc(100% + ${ft}px) ${Je}px`,right:`${-ft}px ${Je}px`}[at],kl=`${Ie}px ${nt.reference.y+_e-Ye}px`;return Ve.floating.style.setProperty("--transform-origin",k&&ye==="y"&&wt?kl:us),{}}},ep,y),ie(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);const be=d.useMemo(()=>({elementResize:!a&&typeof ResizeObserver<"u",layoutShift:!a&&typeof IntersectionObserver<"u"}),[a]),{refs:U,elements:Y,x:ne,y:q,middlewareData:fe,update:le,placement:X,context:_,isPositioned:ae,floatingStyles:Q}=Tf({rootContext:m,placement:O,middleware:G,strategy:n,whileElementsMounted:p?void 0:(...Ne)=>Vs(...Ne,be),nodeId:g,externalTree:E}),{sideX:we,sideY:Te}=fe.adaptiveOrigin||tp,Pe=ae?n:"fixed",Ce=d.useMemo(()=>y?{position:Pe,[we]:ne,[Te]:q}:{position:Pe,...Q},[y,Pe,we,ne,Te,q,Q]),Me=d.useRef(null);ie(()=>{if(!h)return;const Ne=C.current,Ve=typeof Ne=="function"?Ne():Ne,Xe=(Js(Ve)?Ve.current:Ve)||null||null;Xe!==Me.current&&(U.setPositionReference(Xe),Me.current=Xe)},[h,U,L,C]),d.useEffect(()=>{if(!h)return;const Ne=C.current;typeof Ne!="function"&&Js(Ne)&&Ne.current!==Me.current&&(U.setPositionReference(Ne.current),Me.current=Ne.current)},[h,U,L,C]),d.useEffect(()=>{if(p&&h&&Y.domReference&&Y.floating)return Vs(Y.domReference,Y.floating,le,be)},[p,h,Y,le,be]);const He=gt(X),Be=el(o,He,D),Fe=Xt(X)||"center",he=!!fe.hide?.referenceHidden;ie(()=>{x&&h&&ae&&T(He)},[x,h,ae,He]);const Re=d.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Oe=fe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:Ce,arrowStyles:Re,arrowRef:K,arrowUncentered:Oe,side:Be,align:Fe,physicalSide:He,anchorHidden:he,refs:U,context:_,isPositioned:ae,update:le}),[Ce,Re,K,Oe,Be,Fe,He,he,U,_,ae,le])}function Js(e){return e!=null&&"current"in e}function _o(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=se(r),i=d.useRef(0),l=lt(op).current,c=lt(np).current,[u,f]=d.useState(0),a=d.useRef(u),p=se((g,y)=>{c.set(g,y??null),a.current+=1,f(a.current)}),m=se(g=>{c.delete(g),a.current+=1,f(a.current)}),h=d.useMemo(()=>{const g=new Map;return Array.from(c.keys()).filter(x=>x.isConnected).sort(rp).forEach((x,E)=>{const v=c.get(x)??{};g.set(x,{...v,index:E})}),g},[c,u]);ie(()=>{if(typeof MutationObserver!="function"||h.size===0)return;const g=new MutationObserver(y=>{const x=new Set,E=v=>x.has(v)?x.delete(v):x.add(v);y.forEach(v=>{v.removedNodes.forEach(E),v.addedNodes.forEach(E)}),x.size===0&&(a.current+=1,f(a.current))});return h.forEach((y,x)=>{x.parentElement&&g.observe(x.parentElement,{childList:!0})}),()=>{g.disconnect()}},[h]),ie(()=>{a.current===u&&(n.current.length!==h.size&&(n.current.length=h.size),o&&o.current.length!==h.size&&(o.current.length=h.size),i.current=h.size),s(h)},[s,h,n,o,u]),ie(()=>()=>{n.current=[]},[n]),ie(()=>()=>{o&&(o.current=[])},[o]);const b=se(g=>(l.add(g),()=>{l.delete(g)}));ie(()=>{l.forEach(g=>g(h))},[l,h]);const R=d.useMemo(()=>({register:p,unregister:m,subscribeMapChange:b,elementsRef:n,labelsRef:o,nextIndexRef:i}),[p,m,b,n,o,i]);return ce.jsx(Vi.Provider,{value:R,children:t})}function np(){return new Map}function op(){return new Set}function rp(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Jr=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
2
|
-
0% 0%,
|
|
3
|
-
100% 0%,
|
|
4
|
-
100% 100%,
|
|
5
|
-
0% 100%,
|
|
6
|
-
0% 0%,
|
|
7
|
-
${i.left}px ${i.top}px,
|
|
8
|
-
${i.left}px ${i.bottom}px,
|
|
9
|
-
${i.right}px ${i.bottom}px,
|
|
10
|
-
${i.right}px ${i.top}px,
|
|
11
|
-
${i.left}px ${i.top}px
|
|
12
|
-
)`}return ce.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),qg=d.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:l,align:c,sideOffset:u=0,alignOffset:f=0,collisionBoundary:a="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:b=!1,collisionAvoidance:R=vi,...g}=t,{store:y}=Pt(),x=Xf(),E=zn(!0),v=y.useState("parent"),T=y.useState("floatingRootContext"),M=y.useState("floatingTreeRoot"),S=y.useState("mounted"),P=y.useState("open"),H=y.useState("modal"),j=y.useState("activeTriggerElement"),L=y.useState("lastOpenChangeReason"),C=y.useState("floatingNodeId"),V=y.useState("floatingParentNodeId");let D=o,A=u,O=f,w=c,F=R;v.type==="context-menu"&&(D=o??v.context?.anchor,w=w??"start",!l&&w!=="center"&&(O=t.alignOffset??2,A=t.sideOffset??-5));let N=l,B=w;v.type==="menu"?(N=N??"inline-end",B=B??"start",F=t.collisionAvoidance??ac):v.type==="menubar"&&(N=N??"bottom",B=B??"start");const te=v.type==="context-menu",I=tl({anchor:D,floatingRootContext:T,positionMethod:E?"fixed":r,mounted:S,side:N,sideOffset:A,align:B,alignOffset:O,arrowPadding:te?0:m,collisionBoundary:a,collisionPadding:p,sticky:h,nodeId:C,keepMounted:x,disableAnchorTracking:b,collisionAvoidance:F,shiftCrossAxis:te,externalTree:M}),$=d.useMemo(()=>{const G={};return P||(G.pointerEvents="none"),{role:"presentation",hidden:!S,style:{...I.positionerStyles,...G}}},[P,S,I.positionerStyles]);d.useEffect(()=>{function G(de){de.open?(de.parentNodeId===C&&y.set("hoverEnabled",!1),de.nodeId!==C&&de.parentNodeId===y.select("floatingParentNodeId")&&y.setOpen(!1,xe(Dn))):de.parentNodeId===C&&de.reason!==Dn&&y.set("hoverEnabled",!0)}return M.events.on("menuopenchange",G),()=>{M.events.off("menuopenchange",G)}},[y,M.events,C]),d.useEffect(()=>{if(y.select("floatingParentNodeId")==null)return;function G(de){if(de.open||de.nodeId!==y.select("floatingParentNodeId"))return;const k=de.reason??Dn;y.setOpen(!1,xe(k))}return M.events.on("menuopenchange",G),()=>{M.events.off("menuopenchange",G)}},[M.events,y]),d.useEffect(()=>{function G(de){!P||de.nodeId!==y.select("floatingParentNodeId")||de.target&&j&&j!==de.target&&y.setOpen(!1,xe(Dn))}return M.events.on("itemhover",G),()=>{M.events.off("itemhover",G)}},[M.events,P,j,y]),d.useEffect(()=>{const G={open:P,nodeId:C,parentNodeId:V,reason:y.select("lastOpenChangeReason")};M.events.emit("menuopenchange",G)},[M.events,P,y,C,V]);const K=d.useMemo(()=>({open:P,side:I.side,align:I.align,anchorHidden:I.anchorHidden,nested:v.type==="menu"}),[P,I.side,I.align,I.anchorHidden,v.type]),z=d.useMemo(()=>({side:I.side,align:I.align,arrowRef:I.arrowRef,arrowUncentered:I.arrowUncentered,arrowStyles:I.arrowStyles,nodeId:I.context.nodeId}),[I.side,I.align,I.arrowRef,I.arrowUncentered,I.arrowStyles,I.context.nodeId]),W=Ae("div",t,{state:K,stateAttributesMapping:Mn,ref:[n,y.useStateSetter("positionerElement")],props:[$,g]}),J=S&&v.type!=="menu"&&(v.type!=="menubar"&&H&&L!==ut||v.type==="menubar"&&v.context.modal);let ue=null;return v.type==="menubar"?ue=v.context.contentElement:v.type===void 0&&(ue=j),ce.jsxs(Li.Provider,{value:z,children:[J&&ce.jsx(Jr,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Xr(!P),cutout:ue}),ce.jsx(ed,{id:C,children:ce.jsx(_o,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:W})})]})});let Zs={},Qs={},ei="";function sp(e){if(typeof document>"u")return!1;const t=it(e);return Ze(t).innerWidth-t.documentElement.clientWidth>0}function ip(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=it(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 ap(e){const t=it(e),n=t.documentElement,o=t.body,r=an(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function lp(e){const t=it(e),n=t.documentElement,o=t.body,r=Ze(n);let s=0,i=0,l=!1;const c=Et.create();if(Ui&&(r.visualViewport?.scale??1)!==1)return()=>{};function u(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),R=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Zs={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ei=n.style.scrollBehavior,Qs={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 g=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,x=p.overflowY==="scroll"||m.overflowY==="scroll",E=p.overflowX==="scroll"||m.overflowX==="scroll",v=Math.max(0,r.innerWidth-o.clientWidth),T=Math.max(0,r.innerHeight-o.clientHeight),M=parseFloat(m.marginTop)+parseFloat(m.marginBottom),S=parseFloat(m.marginLeft)+parseFloat(m.marginRight),P=an(n)?n:o;if(l=ip(e),l){n.style.scrollbarGutter=R,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(g||x)&&(n.style.overflowY="scroll"),(y||E)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:M||T?`calc(100dvh - ${M+T}px)`:"100dvh",width:S||v?`calc(100vw - ${S+v}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 f(){Object.assign(n.style,Zs),Object.assign(o.style,Qs),l||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ei)}function a(){f(),c.request(u)}return u(),r.addEventListener("resize",a),()=>{c.cancel(),f(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",a)}}class cp{lockCount=0;restore=null;timeoutLock=rn.create();timeoutUnlock=rn.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=it(t).documentElement,r=Ze(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=dt;return}const s=Wi||!sp(t);this.restore=s?ap(t):lp(t)}}const up=new cp;function Zr(e=!0,t=null){ie(()=>{if(e)return up.acquire(t)},[e,t])}const dp=d.createContext(null);function nl(e){return d.useContext(dp)}function fp(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 Qr(e){const[t,n]=d.useState(null),o=se((l,c)=>{e||n(c||(Wi?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=fp(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}const pp={...Ha,disabled:oe(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:oe(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:oe(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:oe(e=>e.stickIfOpen),parent:oe(e=>e.parent),rootId:oe(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:oe(e=>e.activeIndex),isActive:oe((e,t)=>e.activeIndex===t),hoverEnabled:oe(e=>e.hoverEnabled),instantType:oe(e=>e.instantType),lastOpenChangeReason:oe(e=>e.openChangeReason),floatingTreeRoot:oe(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:oe(e=>e.floatingNodeId),floatingParentNodeId:oe(e=>e.floatingParentNodeId),itemProps:oe(e=>e.itemProps),closeDelay:oe(e=>e.closeDelay),keyboardEventRelay:oe(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class es extends Kr{constructor(t){super({...gp(),...t},{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new Vo},pp),this.observe(oe(n=>n.allowMouseEnter),(n,o)=>{this.state.parent.type==="menu"&&n!==o&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const o=lt(()=>new es(n)).current;return t??o}unsubscribeParentListener=null}function gp(){return{...Ba(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new jr,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:$e,keyboardEventRelay:void 0,closeDelay:0}}const ol=d.createContext(void 0);function rl(){return d.useContext(ol)}function sl(e){const{children:t,open:n,onOpenChange:o,onOpenChangeComplete:r,defaultOpen:s=!1,disabled:i=!1,modal:l,loopFocus:c=!0,orientation:u="vertical",actionsRef:f,closeParentOnEsc:a=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:b=!0}=e,R=zn(!0),g=Pt(!0),y=nl(),x=rl(),E=d.useMemo(()=>x&&g?{type:"menu",store:g.store}:y?{type:"menubar",context:y}:R&&!g?{type:"context-menu",context:R}:{type:void 0},[R,g,y,x]),v=es.useStore(p?.store,{parent:E}),T=v.useState("floatingTreeRoot"),M=ba(T),S=Vt();ie(()=>{R&&!g?v.update({parent:{type:"context-menu",context:R},floatingNodeId:M,floatingParentNodeId:S}):g&&v.update({floatingNodeId:M,floatingParentNodeId:S})},[R,g,M,S,v]),v.useControlledProp("open",n,s),v.useControlledProp("activeTriggerId",m,h),v.useContextCallback("onOpenChangeComplete",r);const P=v.useState("open"),H=v.useState("activeTriggerElement"),j=v.useState("positionerElement"),L=v.useState("hoverEnabled"),C=v.useState("modal"),V=v.useState("disabled"),D=v.useState("lastOpenChangeReason"),A=v.useState("parent"),O=v.useState("activeIndex"),w=v.useState("payload"),F=v.useState("floatingParentNodeId"),N=d.useRef(null),B=F!=null;let te;v.useSyncedValues({disabled:i,modal:A.type===void 0?l:void 0,rootId:Gt()});const{openMethod:I,triggerProps:$,reset:K}=Qr(P);Fa(v);const{forceUnmount:z}=Va(P,v,()=>{v.update({allowMouseEnter:!1,stickIfOpen:!0}),K()}),W=d.useRef(A.type!=="context-menu"),J=Ke();d.useEffect(()=>{if(P||(N.current=null),A.type==="context-menu"){if(!P){J.clear(),W.current=!1;return}J.start(500,()=>{W.current=!0})}},[J,P,A.type]),Zr(P&&C&&D!==ut&&I!=="touch",j),ie(()=>{!P&&!L&&v.set("hoverEnabled",!0)},[P,L,v]);const ue=d.useRef(!0),G=Ke(),de=se((he,Re)=>{const Oe=Re.reason;if(P===he&&Re.trigger===H&&D===Oe||(Re.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},!he&&Re.trigger==null&&(Re.trigger=H??void 0),o?.(he,Re),Re.isCanceled))return;const Ne={open:he,nativeEvent:Re.event,reason:Re.reason,nested:B};te?.emit("openchange",Ne);const Ve=Re.event;if(he===!1&&Ve?.type==="click"&&Ve.pointerType==="touch"&&!ue.current)return;if(!he&&O!==null){const Ye=v.context.itemDomElements.current[O];queueMicrotask(()=>{Ye?.setAttribute("tabindex","-1")})}he&&Oe===Fn?(ue.current=!1,G.start(300,()=>{ue.current=!0})):(ue.current=!0,G.clear());const Le=(Oe===zt||Oe===Vn)&&Ve.detail===0&&Ve?.isTrusted,Xe=!he&&(Oe===Lr||Oe==null);function nt(){const Ye={open:he,openChangeReason:Oe};N.current=Re.event??null;const at=Re.trigger?.id??null;(at||he)&&(Ye.activeTriggerId=at,Ye.activeTriggerElement=Re.trigger??null),v.update(Ye)}Oe===ut?Tt.flushSync(nt):nt(),A.type==="menubar"&&(Oe===Fn||Oe===on||Oe===ut||Oe===fo||Oe===Dn)?v.set("instantType","group"):Le||Xe?v.set("instantType",Le?"click":"dismiss"):v.set("instantType",void 0)}),k=d.useCallback(he=>{const Re=xe(he);return Re.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},Re},[v]),re=d.useCallback(()=>{v.setOpen(!1,k(Ni))},[v,k]);d.useImperativeHandle(f,()=>({unmount:z,close:re}),[z,re]);let Z;A.type==="context-menu"&&(Z=A.context),d.useImperativeHandle(Z?.positionerRef,()=>j,[j]),d.useImperativeHandle(Z?.actionsRef,()=>({setOpen:de}),[de]);const be=ja({popupStore:v,onOpenChange:de});te=be.context.events,d.useEffect(()=>{const he=({open:Re,eventDetails:Oe})=>de(Re,Oe);return te.on("setOpen",he),()=>{te?.off("setOpen",he)}},[te,de]);const U=Yr(be,{enabled:!V,bubbles:{escapeKey:a&&A.type==="menu"},outsidePress(){return A.type!=="context-menu"||N.current?.type==="contextmenu"?!0:W.current},externalTree:B?T:void 0}),Y=$a(be,{role:"menu"}),ne=Ho(),q=d.useCallback(he=>{v.select("activeIndex")!==he&&v.set("activeIndex",he)},[v]),fe=Wa(be,{enabled:!V,listRef:v.context.itemDomElements,activeIndex:O,nested:A.type!==void 0,loopFocus:c,orientation:u,parentOrientation:A.type==="menubar"?A.context.orientation:void 0,rtl:ne==="rtl",disabledIndices:Dt,onNavigate:q,openOnArrowKeyDown:A.type!=="context-menu",externalTree:B?T:void 0,focusItemOnHover:b}),le=d.useCallback(he=>{v.context.typingRef.current=he},[v]),X=Ya(be,{listRef:v.context.itemLabels,activeIndex:O,resetMs:rc,onMatch:he=>{P&&he!==O&&v.set("activeIndex",he)},onTypingChange:le}),{getReferenceProps:_,getFloatingProps:ae,getItemProps:Q,getTriggerProps:we}=Pn([U,Y,fe,X]),Te=d.useMemo(()=>{const he=Yt(_(),{onMouseEnter(){v.set("hoverEnabled",!0)},onMouseMove(){v.set("allowMouseEnter",!0)}},$);return delete he.role,he},[_,v,$]),Pe=d.useMemo(()=>{const he=we();if(!he)return he;const Re=Yt(he,$);return delete Re.role,delete Re["aria-controls"],Re},[we,$]),Ce=Wn(),Me=d.useMemo(()=>ae({onMouseEnter(){A.type==="menu"&&Ce.request(()=>v.set("hoverEnabled",!1))},onMouseMove(){v.set("allowMouseEnter",!0)},onClick(){v.select("hoverEnabled")&&v.set("hoverEnabled",!1)},onKeyDown(he){const Re=v.select("keyboardEventRelay");Re&&!he.isPropagationStopped()&&Re(he)}}),[ae,A.type,Ce,v]),He=d.useMemo(()=>Q(),[Q]);v.useSyncedValues({floatingRootContext:be,activeTriggerProps:Te,inactiveTriggerProps:Pe,popupProps:Me,itemProps:He});const Be=d.useMemo(()=>({store:v,parent:E}),[v,E]),Fe=ce.jsx(Or.Provider,{value:Be,children:typeof t=="function"?t({payload:w}):t});return A.type===void 0||A.type==="context-menu"?ce.jsx(td,{externalTree:T,children:Fe}):Fe}function Xg(e){const t=Pt().store,n=d.useMemo(()=>({parentMenu:t}),[t]);return ce.jsx(ol.Provider,{value:n,children:ce.jsx(sl,{...e})})}function il(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,l=parseFloat(o.width)||0,c=parseFloat(o.height)||0,u=Math.max(t.width,s,l),f=Math.max(t.height,i,c),a=u-t.width,p=f-t.height;return{left:t.left-a/2,right:t.right+a/2,top:t.top-p/2,bottom:t.bottom+p/2}}function al(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:o}=Mr(),{ref:r,index:s}=Un(e),i=n===s,l=d.useRef(null),c=It(r,l);return{compositeProps:d.useMemo(()=>({tabIndex:i?0:-1,onFocus(){o(s)},onMouseMove(){const f=l.current;if(!t||!f)return;const a=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!a&&f.focus()}}),[i,o,s,t]),compositeRef:c,index:s}}function mp(e){const{render:t,className:n,state:o=$e,props:r=Dt,refs:s=Dt,metadata:i,stateAttributesMapping:l,tag:c="div",...u}=e,{compositeProps:f,compositeRef:a}=al({metadata:i});return Ae(c,e,{state:o,ref:[...s,a],props:[f,...r,u],stateAttributesMapping:l})}function ts(e){if(Ue(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!St(e))return ts(Mt(e))}function hp(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,r=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!o||n==="close"&&o)&&(r.current=!0,it(s.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:s=>{r.current&&(r.current=!1,s.preventBaseUIHandler())}}:$e,[t,n,o])}const ao=2,Jg=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:l,openOnHover:c,delay:u=100,closeDelay:f=0,handle:a,payload:p,...m}=t,h=Pt(!0),b=a?.store??h?.store;if(!b)throw new Error(Ge(85));const R=bt(l),g=b.useState("isTriggerActive",R),y=b.useState("floatingRootContext"),x=b.useState("isOpenedByTrigger",R),E=d.useRef(null),v=yp(),T=Mr(!0),M=Jt(),S=d.useMemo(()=>M??new jr,[M]),P=ba(S),H=Vt(),{registerTrigger:j,isMountedByThisTrigger:L}=Na(R,E,b,{payload:p,closeDelay:f,parent:v,floatingTreeRoot:S,floatingNodeId:P,floatingParentNodeId:H,keyboardEventRelay:T?.relayKeyboardEvent}),C=v.type==="menubar",V=b.useState("disabled"),D=s||V||C&&v.context.disabled,{getButtonProps:A,buttonRef:O}=Ft({disabled:D,native:i});d.useEffect(()=>{!x&&v.type===void 0&&(b.context.allowMouseUpTriggerRef.current=!1)},[b,x,v.type]);const w=d.useRef(null),F=Ke(),N=se(Y=>{if(!w.current)return;F.clear(),b.context.allowMouseUpTriggerRef.current=!1;const ne=Y.target;if(Se(w.current,ne)||Se(b.select("positionerElement"),ne)||ne===w.current||ne!=null&&ts(ne)===b.select("rootId"))return;const q=il(w.current);Y.clientX>=q.left-ao&&Y.clientX<=q.right+ao&&Y.clientY>=q.top-ao&&Y.clientY<=q.bottom+ao||S.events.emit("close",{domEvent:Y,reason:Dr})});d.useEffect(()=>{x&&b.select("lastOpenChangeReason")===ut&&it(w.current).addEventListener("mouseup",N,{once:!0})},[x,N,b]);const B=C&&v.context.hasSubmenuOpen,I=Ua(y,{enabled:(c??B)&&!D&&v.type!=="context-menu"&&(!C||B&&!L),handleClose:Ka({blockPointerEvents:!C}),mouseOnly:!0,move:!1,restMs:v.type===void 0?u:void 0,delay:{close:f},triggerElementRef:E,externalTree:S,isActiveTrigger:g}),$=bp(x,b.select("lastOpenChangeReason")),K=No(y,{enabled:!D&&v.type!=="context-menu",event:x&&C?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?$:!1}),z=Mf(y,{enabled:!D&&B}),W=hp({open:x,enabled:C,mouseDownAction:"open"}),J=Pn([K,z]),ue=d.useMemo(()=>({disabled:D,open:x}),[D,x]),G=b.useState("triggerProps",L),de=[w,n,O,j,E],k=[J.getReferenceProps(),I??$e,G,{"aria-haspopup":"menu",id:R,onMouseDown:Y=>{if(b.select("open"))return;F.start(200,()=>{b.context.allowMouseUpTriggerRef.current=!0}),it(Y.currentTarget).addEventListener("mouseup",N,{once:!0})}},C?{role:"menuitem"}:{},W,m,A],re=d.useRef(null),Z=se(Y=>{Tt.flushSync(()=>{b.setOpen(!1,xe(on,Y.nativeEvent,Y.currentTarget))}),Zu(re.current)?.focus()}),be=se(Y=>{const ne=b.select("positionerElement");if(ne&&fn(Y,ne))b.context.beforeContentFocusGuardRef.current?.focus();else{Tt.flushSync(()=>{b.setOpen(!1,xe(on,Y.nativeEvent,Y.currentTarget))});let q=Ju(b.context.triggerFocusTargetRef.current||E.current);for(;q!==null&&Se(ne,q);){const fe=q;if(q=_r(q),q===fe)break}q?.focus()}}),U=Ae("button",t,{enabled:!C,stateAttributesMapping:bo,state:ue,ref:de,props:k});return C?ce.jsx(mp,{tag:"button",render:o,className:r,state:ue,refs:de,props:k,stateAttributesMapping:bo}):x?ce.jsxs(d.Fragment,{children:[ce.jsx(Rn,{ref:re,onFocus:Z},`${R}-pre-focus-guard`),ce.jsx(d.Fragment,{children:U},R),ce.jsx(Rn,{ref:b.context.triggerFocusTargetRef,onFocus:be},`${R}-post-focus-guard`)]}):ce.jsx(d.Fragment,{children:U},R)});function bp(e,t){const n=Ke(),[o,r]=d.useState(!1);return ie(()=>{e&&t==="trigger-hover"?(r(!0),n.start(sc,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}function yp(){const e=zn(!0),t=Pt(!0),n=nl();return d.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const Zg=d.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t,l=d.useMemo(()=>({orientation:s}),[s]);return Ae("div",t,{state:l,ref:n,props:[{role:"separator","aria-orientation":s},i]})}),Qg=d.forwardRef(function(t,n){const{render:o,className:r,label:s,id:i,nativeButton:l=!1,openOnHover:c=!0,delay:u=100,closeDelay:f=0,disabled:a=!1,...p}=t,m=Un(),h=Pr(),{store:b}=Pt(),R=bt(i),g=b.useState("open"),y=b.useState("floatingRootContext"),x=b.useState("floatingTreeRoot"),E=Da(R,b),v=d.useCallback(K=>{const z=E(K);return K!==null&&b.select("open")&&b.select("activeTriggerId")==null&&b.update({activeTriggerId:R,activeTriggerElement:K,closeDelay:f}),z},[E,f,b,R]),T=d.useRef(null),M=d.useCallback(K=>{T.current=K,b.set("activeTriggerElement",K)},[b]),S=rl();if(!S?.parentMenu)throw new Error(Ge(37));b.useSyncedValue("closeDelay",f);const P=S.parentMenu,H=P.useState("itemProps"),j=P.useState("isActive",m.index),L=d.useMemo(()=>({type:"submenu-trigger",setActive:()=>P.set("activeIndex",m.index)}),[P,m.index]),C=b.useState("disabled"),V=a||C,{getItemProps:D,itemRef:A}=Fi({closeOnClick:!1,disabled:V,highlighted:j,id:R,store:b,nativeButton:l,itemMetadata:L,nodeId:h?.nodeId}),O=b.useState("hoverEnabled"),w=b.useState("allowMouseEnter"),F=Ua(y,{enabled:O&&c&&!V&&w,handleClose:Ka({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:f},triggerElementRef:T,externalTree:x}),N=No(y,{enabled:!V,event:"mousedown",toggle:!c,ignoreMouse:c,stickIfOpen:!1}),B=Pn([N]),te=b.useState("triggerProps",!0);delete te.id;const I=d.useMemo(()=>({disabled:V,highlighted:j,open:g}),[V,j,g]);return Ae("div",t,{state:I,stateAttributesMapping:Ar,props:[B.getReferenceProps(),F,te,H,{tabIndex:g||j?0:-1,onBlur(){j&&P.set("activeIndex",null)}},p,D],ref:[n,m.ref,A,v,M]})});function em(e){const[t,n]=d.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),o=d.useRef(null),r=d.useRef(null),s=d.useRef(null),i=d.useRef(null),l=d.useRef(!0),c=d.useRef(null),u=Gt(),f=d.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:s,backdropRef:o,internalBackdropRef:r,positionerRef:i,allowMouseUpTriggerRef:l,initialCursorPointRef:c,rootId:u}),[t,u]);return ce.jsx(Di.Provider,{value:f,children:ce.jsx(Or.Provider,{value:void 0,children:ce.jsx(sl,{...e})})})}const ti=500,tm=d.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{setAnchor:i,actionsRef:l,internalBackdropRef:c,backdropRef:u,positionerRef:f,allowMouseUpTriggerRef:a,initialCursorPointRef:p,rootId:m}=zn(!1),{store:h}=Pt(!1),b=h.useState("open"),R=d.useRef(null),g=d.useRef(null),y=Ke(),x=Ke(),E=d.useRef(!1);function v(L,C,V){const D=V.type.startsWith("touch");p.current={x:L,y:C},i({getBoundingClientRect(){return DOMRect.fromRect({width:D?10:0,height:D?10:0,x:L,y:C})}}),E.current=!1,l.current?.setOpen(!0,xe(zt,V)),x.start(ti,()=>{E.current=!0})}function T(L){a.current=!0,rt(L),v(L.clientX,L.clientY,L.nativeEvent),it(R.current).addEventListener("mouseup",V=>{if(a.current=!1,!E.current)return;x.clear(),E.current=!1;const D=st(V);Se(f.current,D)||m&&D&&ts(D)===m||l.current?.setOpen(!1,xe(Dr,V))},{once:!0})}function M(L){if(a.current=!1,L.touches.length===1){L.stopPropagation();const C=L.touches[0];g.current={x:C.clientX,y:C.clientY},y.start(ti,()=>{g.current&&v(g.current.x,g.current.y,L.nativeEvent)})}}function S(L){if(y.isStarted()&&g.current&&L.touches.length===1){const C=L.touches[0],V=10,D=Math.abs(C.clientX-g.current.x),A=Math.abs(C.clientY-g.current.y);(D>V||A>V)&&y.clear()}}function P(){y.clear(),g.current=null}d.useEffect(()=>{function L(V){const A=st(V);(Se(R.current,A)||Se(c.current,A)||Se(u.current,A))&&V.preventDefault()}const C=it(R.current);return C.addEventListener("contextmenu",L),()=>{C.removeEventListener("contextmenu",L)}},[u,c]);const H=d.useMemo(()=>({open:b}),[b]);return Ae("div",t,{state:H,ref:[R,n],props:[{onContextMenu:T,onTouchStart:M,onTouchMove:S,onTouchEnd:P,onTouchCancel:P,style:{WebkitTouchCallout:"none"}},s],stateAttributesMapping:bo})});function ll(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),l=t.useState("popupElement"),{openMethod:c,triggerProps:u,reset:f}=Qr(r);Fa(t);const{forceUnmount:a}=Va(r,t,()=>{f()}),p=se(H=>{const j=xe(H);return j.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},j}),m=d.useCallback(()=>{t.setOpen(!1,p(Ni))},[t,p]);d.useImperativeHandle(o,()=>({unmount:a,close:m}),[a,m]);const h=ja({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[b,R]=d.useState(0),g=b===0,y=$a(h),x=Yr(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if("button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const j=st(H);if(g&&!s){const L=j;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===L||t.context.backdropRef.current===L||Se(L,l)&&!L?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:g});Zr(r&&i===!0,l);const{getReferenceProps:E,getFloatingProps:v,getTriggerProps:T}=Pn([y,x]);t.useContextCallback("onNestedDialogOpen",H=>{R(H+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),d.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(b),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,b]);const M=d.useMemo(()=>E(u),[E,u]),S=d.useMemo(()=>T(u),[T,u]),P=d.useMemo(()=>v(),[v]);t.useSyncedValues({openMethod:c,activeTriggerProps:M,inactiveTriggerProps:S,popupProps:P,floatingRootContext:h,nestedOpenDialogCount:b})}const ns=d.createContext(void 0);function Bt(e){const t=d.useContext(ns);if(e===!1&&t===void 0)throw new Error(Ge(27));return t}const vp={...Ha,modal:oe(e=>e.modal),nested:oe(e=>e.nested),nestedOpenDialogCount:oe(e=>e.nestedOpenDialogCount),disablePointerDismissal:oe(e=>e.disablePointerDismissal),openMethod:oe(e=>e.openMethod),descriptionElementId:oe(e=>e.descriptionElementId),titleElementId:oe(e=>e.titleElementId),viewportElement:oe(e=>e.viewportElement),role:oe(e=>e.role)};class cl extends Kr{constructor(t){super(xp(t),{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),triggerElements:new Vo,onOpenChange:void 0,onOpenChangeComplete:void 0},vp)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function xp(e={}){return{...Ba(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function nm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,actionsRef:i,handle:l,triggerId:c,defaultTriggerId:u=null}=e,f=Bt(),a=!!f,p=lt(()=>l?.store??new cl({open:n??o,activeTriggerId:c!==void 0?c:u,modal:!0,disablePointerDismissal:!0,nested:a,role:"alertdialog"})).current;p.useControlledProp("open",n,o),p.useControlledProp("activeTriggerId",c,u),p.useSyncedValue("nested",a),p.useContextCallback("onOpenChange",r),p.useContextCallback("onOpenChangeComplete",s);const m=p.useState("payload");ll({store:p,actionsRef:i,parentContext:f?.store.context});const h=d.useMemo(()=>({store:p}),[p]);return ce.jsx(ns.Provider,{value:h,children:typeof t=="function"?t({payload:m}):t})}const wp={...Mn,...Tn},om=d.forwardRef(function(t,n){const{render:o,className:r,forceRender:s=!1,...i}=t,{store:l}=Bt(),c=l.useState("open"),u=l.useState("nested"),f=l.useState("mounted"),a=l.useState("transitionStatus"),p=d.useMemo(()=>({open:c,transitionStatus:a}),[c,a]);return Ae("div",t,{state:p,ref:[l.context.backdropRef,n],stateAttributesMapping:wp,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!u})}),rm=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...l}=t,{store:c}=Bt(),u=c.useState("open");function f(h){u&&c.setOpen(!1,xe(au,h.nativeEvent))}const{getButtonProps:a,buttonRef:p}=Ft({disabled:s,native:i}),m=d.useMemo(()=>({disabled:s}),[s]);return Ae("button",t,{state:m,ref:[n,p],props:[{onClick:f},l,a]})}),sm=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:l}=Bt(),c=bt(s);return l.useSyncedValueWithCleanup("descriptionElementId",c),Ae("p",t,{ref:n,props:[{id:c},i]})});let Rp=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Ep=(function(e){return e[e.open=Qt.open]="open",e[e.closed=Qt.closed]="closed",e[e.startingStyle=Qt.startingStyle]="startingStyle",e[e.endingStyle=Qt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const ul=d.createContext(void 0);function Sp(){const e=d.useContext(ul);if(e===void 0)throw new Error(Ge(26));return e}const Cp={...Mn,...Tn,nestedDialogOpen(e){return e?{[Ep.nestedDialogOpen]:""}:null}},im=d.forwardRef(function(t,n){const{className:o,finalFocus:r,initialFocus:s,render:i,...l}=t,{store:c}=Bt(),u=c.useState("descriptionElementId"),f=c.useState("disablePointerDismissal"),a=c.useState("floatingRootContext"),p=c.useState("popupProps"),m=c.useState("modal"),h=c.useState("mounted"),b=c.useState("nested"),R=c.useState("nestedOpenDialogCount"),g=c.useState("open"),y=c.useState("openMethod"),x=c.useState("titleElementId"),E=c.useState("transitionStatus"),v=c.useState("role");Sp(),qt({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}});function T(j){return j==="touch"?c.context.popupRef.current:!0}const M=s===void 0?T:s,S=R>0,P=d.useMemo(()=>({open:g,nested:b,transitionStatus:E,nestedDialogOpen:S}),[g,b,E,S]),H=Ae("div",t,{state:P,props:[p,{"aria-labelledby":x??void 0,"aria-describedby":u??void 0,role:v,tabIndex:-1,hidden:!h,onKeyDown(j){qr.has(j.key)&&j.stopPropagation()},style:{[Rp.nestedDialogs]:R}},l],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:Cp});return ce.jsx(Wr,{context:a,openInteractionType:y,disabled:!h,closeOnFocusOut:!f,initialFocus:M,returnFocus:r,modal:m!==!1,restoreFocus:"popup",children:H})}),am=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Bt(),i=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return i||o?ce.jsx(ul.Provider,{value:o,children:ce.jsxs(zr,{ref:n,...r,children:[i&&l===!0&&ce.jsx(Jr,{ref:s.context.internalBackdropRef,inert:Xr(!c)}),t.children]})}):null}),lm=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:l}=Bt(),c=bt(s);return l.useSyncedValueWithCleanup("titleElementId",c),Ae("h2",t,{ref:n,props:[{id:c},i]})}),cm=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:l,payload:c,handle:u,...f}=t,a=Bt(!0),p=u?.store??a?.store;if(!p)throw new Error(Ge(79));const m=bt(l),h=p.useState("floatingRootContext"),b=p.useState("isOpenedByTrigger",m),R=d.useRef(null),{registerTrigger:g,isMountedByThisTrigger:y}=Na(m,R,p,{payload:c}),{getButtonProps:x,buttonRef:E}=Ft({disabled:s,native:i}),v=No(h,{enabled:h!=null}),T=Pn([v]),M=d.useMemo(()=>({disabled:s,open:b}),[s,b]),S=p.useState("triggerProps",y);return Ae("button",t,{state:M,ref:[E,n,g,R],props:[T.getReferenceProps(),S,{[yi]:"",id:m},f,x],stateAttributesMapping:Ar})});function Tp(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Mp=e=>{switch(e){case"success":return Pp;case"info":return Ap;case"warning":return Op;case"error":return Lp;default:return null}},Ip=Array(12).fill(0),kp=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},Ip.map((n,o)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Pp=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Op=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ap=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Lp=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Dp=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Np=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let wr=1;class Fp{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:wr++,i=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:o}),{...c,...t,id:s,dismissible:l,title:o}):c):this.addToast({title:o,...r,dismissible:l,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let s=o!==void 0,i;const l=r.then(async u=>{if(i=["resolve",u],ee.isValidElement(u))s=!1,this.create({id:o,type:"default",message:u});else if(Bp(u)&&!u.ok){s=!1;const a=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,h=typeof a=="object"&&!ee.isValidElement(a)?a:{message:a};this.create({id:o,type:"error",description:p,...h})}else if(u instanceof Error){s=!1;const a=typeof n.error=="function"?await n.error(u):n.error,p=typeof n.description=="function"?await n.description(u):n.description,h=typeof a=="object"&&!ee.isValidElement(a)?a:{message:a};this.create({id:o,type:"error",description:p,...h})}else if(n.success!==void 0){s=!1;const a=typeof n.success=="function"?await n.success(u):n.success,p=typeof n.description=="function"?await n.description(u):n.description,h=typeof a=="object"&&!ee.isValidElement(a)?a:{message:a};this.create({id:o,type:"success",description:p,...h})}}).catch(async u=>{if(i=["reject",u],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(u):n.error,a=typeof n.description=="function"?await n.description(u):n.description,m=typeof f=="object"&&!ee.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:a,...m})}}).finally(()=>{s&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,f)=>l.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof o!="string"&&typeof o!="number"?{unwrap:c}:Object.assign(o,{unwrap:c})},this.custom=(t,n)=>{const o=n?.id||wr++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ct=new Fp,Vp=(e,t)=>{const n=t?.id||wr++;return ct.addToast({title:e,...t,id:n}),n},Bp=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Hp=Vp,_p=()=>ct.toasts,jp=()=>ct.getActiveToasts(),um=Object.assign(Hp,{success:ct.success,info:ct.info,warning:ct.warning,error:ct.error,custom:ct.custom,message:ct.message,promise:ct.promise,dismiss:ct.dismiss,loading:ct.loading},{getHistory:_p,getToasts:jp});Tp("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function lo(e){return e.label!==void 0}const zp=3,Up="24px",Wp="16px",ni=4e3,$p=356,Yp=14,Kp=45,Gp=200;function Rt(...e){return e.filter(Boolean).join(" ")}function qp(e){const[t,n]=e.split("-"),o=[];return t&&o.push(t),n&&o.push(n),o}const Xp=e=>{var t,n,o,r,s,i,l,c,u;const{invert:f,toast:a,unstyled:p,interacting:m,setHeights:h,visibleToasts:b,heights:R,index:g,toasts:y,expanded:x,removeToast:E,defaultRichColors:v,closeButton:T,style:M,cancelButtonStyle:S,actionButtonStyle:P,className:H="",descriptionClassName:j="",duration:L,position:C,gap:V,expandByDefault:D,classNames:A,icons:O,closeButtonAriaLabel:w="Close toast"}=e,[F,N]=ee.useState(null),[B,te]=ee.useState(null),[I,$]=ee.useState(!1),[K,z]=ee.useState(!1),[W,J]=ee.useState(!1),[ue,G]=ee.useState(!1),[de,k]=ee.useState(!1),[re,Z]=ee.useState(0),[be,U]=ee.useState(0),Y=ee.useRef(a.duration||L||ni),ne=ee.useRef(null),q=ee.useRef(null),fe=g===0,le=g+1<=b,X=a.type,_=a.dismissible!==!1,ae=a.className||"",Q=a.descriptionClassName||"",we=ee.useMemo(()=>R.findIndex(ye=>ye.toastId===a.id)||0,[R,a.id]),Te=ee.useMemo(()=>{var ye;return(ye=a.closeButton)!=null?ye:T},[a.closeButton,T]),Pe=ee.useMemo(()=>a.duration||L||ni,[a.duration,L]),Ce=ee.useRef(0),Me=ee.useRef(0),He=ee.useRef(0),Be=ee.useRef(null),[Fe,he]=C.split("-"),Re=ee.useMemo(()=>R.reduce((ye,je,We)=>We>=we?ye:ye+je.height,0),[R,we]),Oe=Np(),Ne=a.invert||f,Ve=X==="loading";Me.current=ee.useMemo(()=>we*V+Re,[we,Re]),ee.useEffect(()=>{Y.current=Pe},[Pe]),ee.useEffect(()=>{$(!0)},[]),ee.useEffect(()=>{const ye=q.current;if(ye){const je=ye.getBoundingClientRect().height;return U(je),h(We=>[{toastId:a.id,height:je,position:a.position},...We]),()=>h(We=>We.filter(Qe=>Qe.toastId!==a.id))}},[h,a.id]),ee.useLayoutEffect(()=>{if(!I)return;const ye=q.current,je=ye.style.height;ye.style.height="auto";const We=ye.getBoundingClientRect().height;ye.style.height=je,U(We),h(Qe=>Qe.find(me=>me.toastId===a.id)?Qe.map(me=>me.toastId===a.id?{...me,height:We}:me):[{toastId:a.id,height:We,position:a.position},...Qe])},[I,a.title,a.description,h,a.id,a.jsx,a.action,a.cancel]);const Le=ee.useCallback(()=>{z(!0),Z(Me.current),h(ye=>ye.filter(je=>je.toastId!==a.id)),setTimeout(()=>{E(a)},Gp)},[a,E,h,Me]);ee.useEffect(()=>{if(a.promise&&X==="loading"||a.duration===1/0||a.type==="loading")return;let ye;return x||m||Oe?(()=>{if(He.current<Ce.current){const Qe=new Date().getTime()-Ce.current;Y.current=Y.current-Qe}He.current=new Date().getTime()})():Y.current!==1/0&&(Ce.current=new Date().getTime(),ye=setTimeout(()=>{a.onAutoClose==null||a.onAutoClose.call(a,a),Le()},Y.current)),()=>clearTimeout(ye)},[x,m,a,X,Oe,Le]),ee.useEffect(()=>{a.delete&&(Le(),a.onDismiss==null||a.onDismiss.call(a,a))},[Le,a.delete]);function Xe(){var ye;if(O?.loading){var je;return ee.createElement("div",{className:Rt(A?.loader,a==null||(je=a.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":X==="loading"},O.loading)}return ee.createElement(kp,{className:Rt(A?.loader,a==null||(ye=a.classNames)==null?void 0:ye.loader),visible:X==="loading"})}const nt=a.icon||O?.[X]||Mp(X);var Ye,at;return ee.createElement("li",{tabIndex:0,ref:q,className:Rt(H,ae,A?.toast,a==null||(t=a.classNames)==null?void 0:t.toast,A?.default,A?.[X],a==null||(n=a.classNames)==null?void 0:n[X]),"data-sonner-toast":"","data-rich-colors":(Ye=a.richColors)!=null?Ye:v,"data-styled":!(a.jsx||a.unstyled||p),"data-mounted":I,"data-promise":!!a.promise,"data-swiped":de,"data-removed":K,"data-visible":le,"data-y-position":Fe,"data-x-position":he,"data-index":g,"data-front":fe,"data-swiping":W,"data-dismissible":_,"data-type":X,"data-invert":Ne,"data-swipe-out":ue,"data-swipe-direction":B,"data-expanded":!!(x||D&&I),"data-testid":a.testId,style:{"--index":g,"--toasts-before":g,"--z-index":y.length-g,"--offset":`${K?re:Me.current}px`,"--initial-height":D?"auto":`${be}px`,...M,...a.style},onDragEnd:()=>{J(!1),N(null),Be.current=null},onPointerDown:ye=>{ye.button!==2&&(Ve||!_||(ne.current=new Date,Z(Me.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(J(!0),Be.current={x:ye.clientX,y:ye.clientY})))},onPointerUp:()=>{var ye,je,We;if(ue||!_)return;Be.current=null;const Qe=Number(((ye=q.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xt=Number(((je=q.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),me=new Date().getTime()-((We=ne.current)==null?void 0:We.getTime()),Ie=F==="x"?Qe:xt,Je=Math.abs(Ie)/me;if(Math.abs(Ie)>=Kp||Je>.11){Z(Me.current),a.onDismiss==null||a.onDismiss.call(a,a),te(F==="x"?Qe>0?"right":"left":xt>0?"down":"up"),Le(),G(!0);return}else{var ze,_e;(ze=q.current)==null||ze.style.setProperty("--swipe-amount-x","0px"),(_e=q.current)==null||_e.style.setProperty("--swipe-amount-y","0px")}k(!1),J(!1),N(null)},onPointerMove:ye=>{var je,We,Qe;if(!Be.current||!_||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;const me=ye.clientY-Be.current.y,Ie=ye.clientX-Be.current.x;var Je;const ze=(Je=e.swipeDirections)!=null?Je:qp(C);!F&&(Math.abs(Ie)>1||Math.abs(me)>1)&&N(Math.abs(Ie)>Math.abs(me)?"x":"y");let _e={x:0,y:0};const ft=wt=>1/(1.5+Math.abs(wt)/20);if(F==="y"){if(ze.includes("top")||ze.includes("bottom"))if(ze.includes("top")&&me<0||ze.includes("bottom")&&me>0)_e.y=me;else{const wt=me*ft(me);_e.y=Math.abs(wt)<Math.abs(me)?wt:me}}else if(F==="x"&&(ze.includes("left")||ze.includes("right")))if(ze.includes("left")&&Ie<0||ze.includes("right")&&Ie>0)_e.x=Ie;else{const wt=Ie*ft(Ie);_e.x=Math.abs(wt)<Math.abs(Ie)?wt:Ie}(Math.abs(_e.x)>0||Math.abs(_e.y)>0)&&k(!0),(We=q.current)==null||We.style.setProperty("--swipe-amount-x",`${_e.x}px`),(Qe=q.current)==null||Qe.style.setProperty("--swipe-amount-y",`${_e.y}px`)}},Te&&!a.jsx&&X!=="loading"?ee.createElement("button",{"aria-label":w,"data-disabled":Ve,"data-close-button":!0,onClick:Ve||!_?()=>{}:()=>{Le(),a.onDismiss==null||a.onDismiss.call(a,a)},className:Rt(A?.closeButton,a==null||(o=a.classNames)==null?void 0:o.closeButton)},(at=O?.close)!=null?at:Dp):null,(X||a.icon||a.promise)&&a.icon!==null&&(O?.[X]!==null||a.icon)?ee.createElement("div",{"data-icon":"",className:Rt(A?.icon,a==null||(r=a.classNames)==null?void 0:r.icon)},a.promise||a.type==="loading"&&!a.icon?a.icon||Xe():null,a.type!=="loading"?nt:null):null,ee.createElement("div",{"data-content":"",className:Rt(A?.content,a==null||(s=a.classNames)==null?void 0:s.content)},ee.createElement("div",{"data-title":"",className:Rt(A?.title,a==null||(i=a.classNames)==null?void 0:i.title)},a.jsx?a.jsx:typeof a.title=="function"?a.title():a.title),a.description?ee.createElement("div",{"data-description":"",className:Rt(j,Q,A?.description,a==null||(l=a.classNames)==null?void 0:l.description)},typeof a.description=="function"?a.description():a.description):null),ee.isValidElement(a.cancel)?a.cancel:a.cancel&&lo(a.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:a.cancelButtonStyle||S,onClick:ye=>{lo(a.cancel)&&_&&(a.cancel.onClick==null||a.cancel.onClick.call(a.cancel,ye),Le())},className:Rt(A?.cancelButton,a==null||(c=a.classNames)==null?void 0:c.cancelButton)},a.cancel.label):null,ee.isValidElement(a.action)?a.action:a.action&&lo(a.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:a.actionButtonStyle||P,onClick:ye=>{lo(a.action)&&(a.action.onClick==null||a.action.onClick.call(a.action,ye),!ye.defaultPrevented&&Le())},className:Rt(A?.actionButton,a==null||(u=a.classNames)==null?void 0:u.actionButton)},a.action.label):null)};function oi(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Jp(e,t){const n={};return[e,t].forEach((o,r)=>{const s=r===1,i=s?"--mobile-offset":"--offset",l=s?Wp:Up;function c(u){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=typeof u=="number"?`${u}px`:u})}typeof o=="number"||typeof o=="string"?c(o):typeof o=="object"?["top","right","bottom","left"].forEach(u=>{o[u]===void 0?n[`${i}-${u}`]=l:n[`${i}-${u}`]=typeof o[u]=="number"?`${o[u]}px`:o[u]}):c(l)}),n}const dm=ee.forwardRef(function(t,n){const{id:o,invert:r,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:c,className:u,offset:f,mobileOffset:a,theme:p="light",richColors:m,duration:h,style:b,visibleToasts:R=zp,toastOptions:g,dir:y=oi(),gap:x=Yp,icons:E,containerAriaLabel:v="Notifications"}=t,[T,M]=ee.useState([]),S=ee.useMemo(()=>o?T.filter(I=>I.toasterId===o):T.filter(I=>!I.toasterId),[T,o]),P=ee.useMemo(()=>Array.from(new Set([s].concat(S.filter(I=>I.position).map(I=>I.position)))),[S,s]),[H,j]=ee.useState([]),[L,C]=ee.useState(!1),[V,D]=ee.useState(!1),[A,O]=ee.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),w=ee.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=ee.useRef(null),B=ee.useRef(!1),te=ee.useCallback(I=>{M($=>{var K;return(K=$.find(z=>z.id===I.id))!=null&&K.delete||ct.dismiss(I.id),$.filter(({id:z})=>z!==I.id)})},[]);return ee.useEffect(()=>ct.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{M($=>$.map(K=>K.id===I.id?{...K,delete:!0}:K))});return}setTimeout(()=>{Pl.flushSync(()=>{M($=>{const K=$.findIndex(z=>z.id===I.id);return K!==-1?[...$.slice(0,K),{...$[K],...I},...$.slice(K+1)]:[I,...$]})})})}),[T]),ee.useEffect(()=>{if(p!=="system"){O(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:$})=>{O($?"dark":"light")})}catch{I.addListener(({matches:K})=>{try{O(K?"dark":"light")}catch(z){console.error(z)}})}},[p]),ee.useEffect(()=>{T.length<=1&&C(!1)},[T]),ee.useEffect(()=>{const I=$=>{var K;if(i.every(J=>$[J]||$.code===J)){var W;C(!0),(W=w.current)==null||W.focus()}$.code==="Escape"&&(document.activeElement===w.current||(K=w.current)!=null&&K.contains(document.activeElement))&&C(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[i]),ee.useEffect(()=>{if(w.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,B.current=!1)}},[w.current]),ee.createElement("section",{ref:n,"aria-label":`${v} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((I,$)=>{var K;const[z,W]=I.split("-");return S.length?ee.createElement("ol",{key:I,dir:y==="auto"?oi():y,tabIndex:-1,ref:w,className:u,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":z,"data-x-position":W,style:{"--front-toast-height":`${((K=H[0])==null?void 0:K.height)||0}px`,"--width":`${$p}px`,"--gap":`${x}px`,...b,...Jp(f,a)},onBlur:J=>{B.current&&!J.currentTarget.contains(J.relatedTarget)&&(B.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||B.current||(B.current=!0,N.current=J.relatedTarget)},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{V||C(!1)},onDragEnd:()=>C(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(J=>!J.position&&$===0||J.position===I).map((J,ue)=>{var G,de;return ee.createElement(Xp,{key:J.id,icons:E,index:ue,toast:J,defaultRichColors:m,duration:(G=g?.duration)!=null?G:h,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:R,closeButton:(de=g?.closeButton)!=null?de:c,interacting:V,position:I,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:S.filter(k=>k.position==J.position),heights:H.filter(k=>k.position==J.position),setHeights:j,expandByDefault:l,gap:x,expanded:L,swipeDirections:t.swipeDirections})})):null}))});let ri=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({}),si=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Zp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},os={valid(e){return e===null?null:e?{[si.valid]:""}:{[si.invalid]:""}}};function dl(e){return d.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[ri.checked]:""}:{[ri.unchecked]:""}},...os}),[e.indeterminate])}const Qp=d.createContext({invalid:void 0,name:void 0,validityData:{state:Zp,errors:[],error:"",value:"",initialValue:null},setValidityData:dt,disabled:void 0,touched:!1,setTouched:dt,dirty:!1,setDirty:dt,filled:!1,setFilled:dt,focused:!1,setFocused:dt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=$e)=>e,getInputValidationProps:(e=$e)=>e,inputRef:{current:null},commit:async()=>{}}});function jo(e=!0){const t=d.useContext(Qp);if(t.setValidityData===dt&&!e)throw new Error(Ge(28));return t}const eg=d.createContext({disabled:!1});function tg(){return d.useContext(eg)}function ng(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const og=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:dt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function rs(){return d.useContext(og)}function fl(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:l}=rs(),{invalid:c,markedDirtyRef:u,validityData:f,setValidityData:a}=jo(),p=se(e.getValue);ie(()=>{if(!t)return;let m=n;m===void 0&&(m=p()),f.initialValue===null&&m!==null&&a(h=>({...h,initialValue:m}))},[t,a,n,f.initialValue,p]),ie(()=>{!t||!o||l.current.fields.set(o,{getValue:p,name:r,controlRef:s,validityData:ng(f,c),validate(m=!0){let h=n;h===void 0&&(h=p()),u.current=!0,m?Tt.flushSync(()=>i(h)):i(h)}})},[i,s,t,l,p,o,c,u,r,f,n]),ie(()=>{const m=l.current.fields;return()=>{o&&m.delete(o)}},[l,o])}const rg=d.createContext({controlId:void 0,setControlId:dt,labelId:void 0,setLabelId:dt,messageIds:[],setMessageIds:dt,getDescriptionProps:e=>e});function ss(){return d.useContext(rg)}const sg=d.createContext(void 0);function ig(e=!0){const t=d.useContext(sg);if(t===void 0&&!e)throw new Error(Ge(3));return t}const pl=d.createContext(void 0);function ag(){const e=d.useContext(pl);if(e===void 0)throw new Error(Ge(14));return e}function gl(e,t){const n=d.useRef(e),o=se(t);ie(()=>{n.current!==e&&o(n.current)},[e,o]),ie(()=>{n.current=e},[e])}const lg="data-parent",fm=d.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s=!1,disabled:i=!1,id:l,indeterminate:c=!1,inputRef:u,name:f,onCheckedChange:a,parent:p=!1,readOnly:m=!1,render:h,required:b=!1,uncheckedValue:R,value:g,nativeButton:y=!1,...x}=t,{clearErrors:E}=rs(),{disabled:v,name:T,setDirty:M,setFilled:S,setFocused:P,setTouched:H,state:j,validationMode:L,validityData:C,shouldValidateOnChange:V,validation:D}=jo(),A=tg(),{labelId:O,controlId:w,setControlId:F,getDescriptionProps:N}=ss(),B=ig(),te=B?.parent,I=te&&B.allValues,$=v||A.disabled||B?.disabled||i,K=T??f,z=g??K,W=bt(),J=bt();let ue=w;I?ue=p?J:`${te.id}-${z}`:l&&(ue=l);let G={};I&&(p?G=B.parent.getParentProps():z&&(G=B.parent.getChildProps(z)));const de=se(a),{checked:k=o,indeterminate:re=c,onCheckedChange:Z,...be}=G,U=B?.value,Y=B?.setValue,ne=B?.defaultValue,q=d.useRef(null),{getButtonProps:fe,buttonRef:le}=Ft({disabled:$,native:y}),X=B?.validation??D,[_,ae]=yo({controlled:z&&U&&!p?U.includes(z):k,default:z&&ne&&!p?ne.includes(z):s,name:"Checkbox",state:"checked"});ie(()=>{if(F!==dt)return F(ue),()=>{F(void 0)}},[ue,B,F,p]),fl({enabled:!B,id:W,commit:X.commit,value:_,controlRef:q,name:K,getValue:()=>_});const Q=d.useRef(null),we=It(u,Q,X.inputRef);ie(()=>{Q.current&&(Q.current.indeterminate=re,_&&S(!0))},[_,re,S]),gl(_,()=>{B&&!p||(E(K),S(_),M(_!==C.initialValue),V()?X.commit(_):X.commit(_,!0))});const Te=Yt({checked:_,disabled:$,name:p?void 0:K,id:y?void 0:ue??void 0,required:b,ref:we,style:K?va:Do,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Fe){if(Fe.nativeEvent.defaultPrevented)return;const he=Fe.target.checked,Re=xe(nn,Fe.nativeEvent);if(Z?.(he,Re),de(he,Re),!Re.isCanceled&&(ae(he),z&&U&&Y&&!p)){const Oe=he?[...U,z]:U.filter(Ne=>Ne!==z);Y(Oe,Re)}},onFocus(){q.current?.focus()}},g!==void 0?{value:(B?_&&g:g)||""}:$e,N,B?X.getValidationProps:X.getInputValidationProps),Pe=I?!!k:_,Ce=I&&re||c;d.useEffect(()=>{te&&z&&te.disabledStatesRef.current.set(z,$)},[te,$,z]);const Me=d.useMemo(()=>({...j,checked:Pe,disabled:$,readOnly:m,required:b,indeterminate:Ce}),[j,Pe,$,m,b,Ce]),He=dl(Me),Be=Ae("span",t,{state:Me,ref:[le,q,n,B?.registerControlRef],props:[{id:y?ue??void 0:W,role:"checkbox","aria-checked":re?"mixed":_,"aria-readonly":m||void 0,"aria-required":b||void 0,"aria-labelledby":O,[lg]:p?"":void 0,onFocus(){P(!0)},onBlur(){const Fe=Q.current;Fe&&(H(!0),P(!1),L==="onBlur"&&X.commit(B?U:Fe.checked))},onClick(Fe){m||$||(Fe.preventDefault(),Q.current?.click())}},N,X.getValidationProps,x,be,fe],stateAttributesMapping:He});return ce.jsxs(pl.Provider,{value:Me,children:[Be,!_&&!B&&K&&!p&&R!==void 0&&ce.jsx("input",{type:"hidden",name:K,value:R}),ce.jsx("input",{...Te})]})}),pm=d.forwardRef(function(t,n){const{render:o,className:r,keepMounted:s=!1,...i}=t,l=ag(),c=l.checked||l.indeterminate,{transitionStatus:u,setMounted:f}=$n(c),a=d.useRef(null),p=d.useMemo(()=>({...l,transitionStatus:u}),[l,u]);qt({open:c,ref:a,onComplete(){c||f(!1)}});const m=dl(l),h=d.useMemo(()=>({...m,...Tn,...os}),[m]),b=s||c,R=Ae("span",t,{enabled:b,ref:[n,a],state:p,stateAttributesMapping:h,props:i});return b?R:null});function cg(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}const ml=d.createContext(null),hl=d.createContext(null);function Ot(){const e=d.useContext(ml);if(e===null)throw new Error(Ge(60));return e}function bl(){const e=d.useContext(hl);if(e===null)throw new Error(Ge(61));return e}function yl(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,setControlId:s}=ss(),i=bt(t);return ie(()=>{if(!(!n&&!t||s===dt)){if(n){const l=o?.current;De(l)&&l.closest("label")!=null?s(t??null):s(r??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,o,r,s,n,i]),r??i}const ug=(e,t)=>Object.is(e,t);function En(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function rr(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:En(o,t,n))}function Rr(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:En(o,t,n))}function dg(e,t,n){return e.filter(o=>!En(o,t,n))}function Er(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function vl(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function fg(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(vl(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function pg(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Er(e)}function cn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Er(e.value):Er(e)}function xl(e,t,n){function o(){return pg(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const r=vl(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=r.find(i=>i.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=r.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function gg(e,t,n){return e.reduce((o,r,s)=>(s>0&&o.push(", "),o.push(ce.jsx(d.Fragment,{children:xl(r,t,n)},s)),o),[])}const ve={id:oe(e=>e.id),modal:oe(e=>e.modal),multiple:oe(e=>e.multiple),items:oe(e=>e.items),itemToStringLabel:oe(e=>e.itemToStringLabel),itemToStringValue:oe(e=>e.itemToStringValue),isItemEqualToValue:oe(e=>e.isItemEqualToValue),value:oe(e=>e.value),hasSelectedValue:oe(e=>{const{value:t,multiple:n,itemToStringValue:o}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:cn(t,o)!==""}),hasNullItemLabel:oe((e,t)=>t?fg(e.items):!1),open:oe(e=>e.open),mounted:oe(e=>e.mounted),forceMount:oe(e=>e.forceMount),transitionStatus:oe(e=>e.transitionStatus),openMethod:oe(e=>e.openMethod),activeIndex:oe(e=>e.activeIndex),selectedIndex:oe(e=>e.selectedIndex),isActive:oe((e,t)=>e.activeIndex===t),isSelected:oe((e,t,n)=>{const o=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>En(s,n,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:En(r,n,o)}),isSelectedByFocus:oe((e,t)=>e.selectedIndex===t),popupProps:oe(e=>e.popupProps),triggerProps:oe(e=>e.triggerProps),triggerElement:oe(e=>e.triggerElement),positionerElement:oe(e=>e.positionerElement),listElement:oe(e=>e.listElement),scrollUpArrowVisible:oe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:oe(e=>e.scrollDownArrowVisible),hasScrollArrows:oe(e=>e.hasScrollArrows)};function gm(e){const{id:t,value:n,defaultValue:o=null,onValueChange:r,open:s,defaultOpen:i=!1,onOpenChange:l,name:c,disabled:u=!1,readOnly:f=!1,required:a=!1,modal:p=!0,actionsRef:m,inputRef:h,onOpenChangeComplete:b,items:R,multiple:g=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:E=ug,highlightItemOnHover:v=!0,children:T}=e,{clearErrors:M}=rs(),{setDirty:S,setTouched:P,setFocused:H,shouldValidateOnChange:j,validityData:L,setFilled:C,name:V,disabled:D,validation:A,validationMode:O}=jo(),w=yl({id:t}),F=D||u,N=V??c,[B,te]=yo({controlled:n,default:g?o??Dt:o,name:"Select",state:"value"}),[I,$]=yo({controlled:s,default:i,name:"Select",state:"open"}),K=d.useRef([]),z=d.useRef([]),W=d.useRef(null),J=d.useRef(null),ue=d.useRef(0),G=d.useRef(null),de=d.useRef([]),k=d.useRef(!1),re=d.useRef(!1),Z=d.useRef(null),be=d.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),U=d.useRef(!1),{mounted:Y,setMounted:ne,transitionStatus:q}=$n(I),{openMethod:fe,triggerProps:le,reset:X}=Qr(I),_=lt(()=>new mn({id:w,modal:p,multiple:g,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:E,value:B,open:I,mounted:Y,transitionStatus:q,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ae=Ee(_,ve.activeIndex),Q=Ee(_,ve.selectedIndex),we=Ee(_,ve.triggerElement),Te=Ee(_,ve.positionerElement),Pe=d.useMemo(()=>g&&Array.isArray(B)&&B.length===0?"":cn(B,x),[g,B,x]),Ce=d.useMemo(()=>g&&Array.isArray(B)?B.map(me=>cn(me,x)):cn(B,x),[g,B,x]),Me=tt(_.state.triggerElement);fl({id:w,commit:A.commit,value:B,controlRef:Me,name:N,getValue:()=>Ce});const He=d.useRef(B);ie(()=>{B!==He.current&&_.set("forceMount",!0)},[_,B]),ie(()=>{C(g?Array.isArray(B)&&B.length>0:B!=null)},[g,B,C]),ie(function(){if(I)return;const Ie=de.current;if(g){const ze=Array.isArray(B)?B:[];if(ze.length===0){_.set("selectedIndex",null);return}const _e=ze[ze.length-1],ft=Rr(Ie,_e,E);_.set("selectedIndex",ft===-1?null:ft);return}const Je=Rr(Ie,B,E);_.set("selectedIndex",Je===-1?null:Je)},[g,I,B,de,E,_]),gl(B,()=>{M(N),S(B!==L.initialValue),j()?A.commit(B):A.commit(B,!0)});const Be=se((me,Ie)=>{if(l?.(me,Ie),!Ie.isCanceled&&($(me),!me&&(Ie.reason===on||Ie.reason===Lo)&&(P(!0),H(!1),O==="onBlur"&&A.commit(B)),!me&&_.state.activeIndex!==null)){const Je=K.current[_.state.activeIndex];queueMicrotask(()=>{Je?.setAttribute("tabindex","-1")})}}),Fe=se(()=>{ne(!1),_.set("activeIndex",null),X(),b?.(!1)});qt({enabled:!m,open:I,ref:W,onComplete(){I||Fe()}}),d.useImperativeHandle(m,()=>({unmount:Fe}),[Fe]);const he=se((me,Ie)=>{r?.(me,Ie),!Ie.isCanceled&&te(me)}),Re=se(()=>{const me=_.state.listElement||W.current;if(!me)return;const Ie=me.scrollTop,Je=me.scrollTop+me.clientHeight,ze=Ie>1,_e=Je<me.scrollHeight-1;_.state.scrollUpArrowVisible!==ze&&_.set("scrollUpArrowVisible",ze),_.state.scrollDownArrowVisible!==_e&&_.set("scrollDownArrowVisible",_e)}),Oe=_a({open:I,onOpenChange:Be,elements:{reference:we,floating:Te}}),Ne=No(Oe,{enabled:!f&&!F,event:"mousedown"}),Ve=Yr(Oe,{bubbles:!1}),Le=Wa(Oe,{enabled:!f&&!F,listRef:K,activeIndex:ae,selectedIndex:Q,disabledIndices:Dt,onNavigate(me){me===null&&!I||_.set("activeIndex",me)},focusItemOnHover:!1}),Xe=Ya(Oe,{enabled:!f&&!F&&(I||!g),listRef:z,activeIndex:ae,selectedIndex:Q,onMatch(me){I?_.set("activeIndex",me):he(de.current[me],xe("none"))},onTypingChange(me){k.current=me}}),{getReferenceProps:nt,getFloatingProps:Ye,getItemProps:at}=Pn([Ne,Ve,Le,Xe]),ye=d.useMemo(()=>Yt(nt(),le,w?{id:w}:$e),[nt,le,w]);cg(()=>{_.update({popupProps:Ye(),triggerProps:ye})}),ie(()=>{_.update({id:w,modal:p,multiple:g,value:B,open:I,mounted:Y,transitionStatus:q,popupProps:Ye(),triggerProps:ye,items:R,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:E,openMethod:fe})},[_,w,p,g,B,I,Y,q,Ye,ye,R,y,x,E,fe]);const je=d.useMemo(()=>({store:_,name:N,required:a,disabled:F,readOnly:f,multiple:g,itemToStringLabel:y,itemToStringValue:x,highlightItemOnHover:v,setValue:he,setOpen:Be,listRef:K,popupRef:W,scrollHandlerRef:J,handleScrollArrowVisibility:Re,scrollArrowsMountedCountRef:ue,getItemProps:at,events:Oe.context.events,valueRef:G,valuesRef:de,labelsRef:z,typingRef:k,selectionRef:be,selectedItemTextRef:Z,validation:A,onOpenChangeComplete:b,keyboardActiveRef:re,alignItemWithTriggerActiveRef:U,initialValueRef:He}),[_,N,a,F,f,g,y,x,v,he,Be,at,Oe.context.events,A,b,Re]),We=It(h,A.inputRef),Qe=g&&Array.isArray(B)&&B.length>0,xt=d.useMemo(()=>!g||!Array.isArray(B)||!N?null:B.map(me=>{const Ie=cn(me,x);return ce.jsx("input",{type:"hidden",name:N,value:Ie},Ie)}),[g,B,N,x]);return ce.jsx(ml.Provider,{value:je,children:ce.jsxs(hl.Provider,{value:Oe,children:[T,ce.jsx("input",{...A.getInputValidationProps({onFocus(){_.state.triggerElement?.focus({focusVisible:!0})},onChange(me){if(me.nativeEvent.defaultPrevented)return;const Ie=me.target.value,Je=xe(nn,me.nativeEvent);function ze(){if(g)return;const _e=de.current.find(ft=>cn(ft,x).toLowerCase()===Ie.toLowerCase());_e!=null&&(S(_e!==L.initialValue),he(_e,Je),j()&&A.commit(_e))}_.set("forceMount",!0),queueMicrotask(ze)}}),name:g?void 0:N,value:Pe,disabled:F,required:a&&!Qe,readOnly:f,ref:We,style:N?va:Do,tabIndex:-1,"aria-hidden":!0}),xt]})})}const co=2,mg=400,ii=200,hg={...bo,...os,value:()=>null},mm=d.forwardRef(function(t,n){const{render:o,className:r,id:s,disabled:i=!1,nativeButton:l=!0,...c}=t,{setTouched:u,setFocused:f,validationMode:a,state:p,disabled:m}=jo(),{labelId:h}=ss(),{store:b,setOpen:R,selectionRef:g,validation:y,readOnly:x,required:E,alignItemWithTriggerActiveRef:v,disabled:T,keyboardActiveRef:M}=Ot(),S=m||T||i,P=Ee(b,ve.open),H=Ee(b,ve.value),j=Ee(b,ve.triggerProps),L=Ee(b,ve.positionerElement),C=Ee(b,ve.listElement),V=Ee(b,ve.id),D=Ee(b,ve.hasSelectedValue),A=!D&&P,O=Ee(b,ve.hasNullItemLabel,A),w=s??V;yl({id:w});const F=tt(L),N=d.useRef(null),{getButtonProps:B,buttonRef:te}=Ft({disabled:S,native:l}),I=se(k=>{b.set("triggerElement",k)}),$=It(n,N,te,I),K=Ke(),z=Ke(),W=Ke(),J=Ke();d.useEffect(()=>{if(P)return!(D||O)?W.start(mg,()=>{g.current.allowUnselectedMouseUp=!0,g.current.allowSelectedMouseUp=!0}):J.start(ii,()=>{g.current.allowUnselectedMouseUp=!0,W.start(ii,()=>{g.current.allowSelectedMouseUp=!0})}),()=>{W.clear(),J.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},z.clear()},[P,D,O,g,z,W,J]);const ue=d.useMemo(()=>C?.id??Hn(L)?.id,[C,L]),G=Yt(j,{id:w,role:"combobox","aria-expanded":P?"true":"false","aria-haspopup":"listbox","aria-controls":P?ue:void 0,"aria-labelledby":h,"aria-readonly":x||void 0,"aria-required":E||void 0,tabIndex:S?-1:0,ref:$,onFocus(k){f(!0),P&&v.current&&R(!1,xe(nn,k.nativeEvent)),K.start(0,()=>{b.set("forceMount",!0)})},onBlur(k){Se(L,k.relatedTarget)||(u(!0),f(!1),a==="onBlur"&&y.commit(H))},onPointerMove(){M.current=!1},onKeyDown(){M.current=!0},onMouseDown(k){if(P)return;const re=it(k.currentTarget);function Z(be){if(!N.current)return;const U=be.target;if(Se(N.current,U)||Se(F.current,U)||U===N.current)return;const Y=il(N.current);be.clientX>=Y.left-co&&be.clientX<=Y.right+co&&be.clientY>=Y.top-co&&be.clientY<=Y.bottom+co||R(!1,xe(Dr,be))}z.start(0,()=>{re.addEventListener("mouseup",Z,{once:!0})})}},y.getValidationProps,c,B);G.role="combobox";const de=d.useMemo(()=>({...p,open:P,disabled:S,value:H,readOnly:x,placeholder:!D}),[p,P,S,H,x,D]);return Ae("button",t,{ref:[n,N],state:de,stateAttributesMapping:hg,props:G})}),bg={value:()=>null},hm=d.forwardRef(function(t,n){const{className:o,render:r,children:s,placeholder:i,...l}=t,{store:c,valueRef:u}=Ot(),f=Ee(c,ve.value),a=Ee(c,ve.items),p=Ee(c,ve.itemToStringLabel),m=Ee(c,ve.hasSelectedValue),h=!m&&i!=null&&s==null,b=Ee(c,ve.hasNullItemLabel,h),R=d.useMemo(()=>({value:f,placeholder:!m}),[f,m]);let g=null;return typeof s=="function"?g=s(f):s!=null?g=s:!m&&i!=null&&!b?g=i:Array.isArray(f)?g=gg(f,a,p):g=xl(f,a,p),Ae("span",t,{state:R,ref:[n,u],props:[{children:g},l],stateAttributesMapping:bg})}),bm=d.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=Ot(),l=Ee(i,ve.open),c=d.useMemo(()=>({open:l}),[l]);return Ae("span",t,{state:c,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:Ar})}),yg=d.createContext(void 0),ym=d.forwardRef(function(t,n){const{store:o}=Ot(),r=Ee(o,ve.mounted),s=Ee(o,ve.forceMount);return r||s?ce.jsx(yg.Provider,{value:!0,children:ce.jsx(zr,{ref:n,...t})}):null}),wl=d.createContext(void 0);function is(){const e=d.useContext(wl);if(!e)throw new Error(Ge(59));return e}function Io(e,t){e&&Object.assign(e.style,t)}const Rl={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},vg={position:"fixed"},vm=d.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:l="bottom",align:c="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:a="clipping-ancestors",collisionPadding:p,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:b,alignItemWithTrigger:R=!0,collisionAvoidance:g=vi,...y}=t,{store:x,listRef:E,labelsRef:v,alignItemWithTriggerActiveRef:T,selectedItemTextRef:M,valuesRef:S,initialValueRef:P,popupRef:H,setValue:j}=Ot(),L=bl(),C=Ee(x,ve.open),V=Ee(x,ve.mounted),D=Ee(x,ve.modal),A=Ee(x,ve.value),O=Ee(x,ve.openMethod),w=Ee(x,ve.positionerElement),F=Ee(x,ve.triggerElement),N=Ee(x,ve.isItemEqualToValue),B=d.useRef(null),te=d.useRef(null),[I,$]=d.useState(R),K=V&&I&&O!=="touch";!V&&I!==R&&$(R),ie(()=>{V||(ve.scrollUpArrowVisible(x.state)&&x.set("scrollUpArrowVisible",!1),ve.scrollDownArrowVisible(x.state)&&x.set("scrollDownArrowVisible",!1))},[x,V]),d.useImperativeHandle(T,()=>K),Zr((K||D)&&C&&O!=="touch",F);const z=tl({anchor:o,floatingRootContext:L,positionMethod:r,mounted:V,side:l,sideOffset:u,align:c,alignOffset:f,arrowPadding:m,collisionBoundary:a,collisionPadding:p,sticky:h,disableAnchorTracking:b??K,collisionAvoidance:g,keepMounted:!0}),W=K?"none":z.side,J=K?vg:z.positionerStyles,ue=d.useMemo(()=>{const U={};return C||(U.pointerEvents="none"),{role:"presentation",hidden:!V,style:{...J,...U}}},[C,V,J]),G=d.useMemo(()=>({open:C,side:W,align:z.align,anchorHidden:z.anchorHidden}),[C,W,z.align,z.anchorHidden]),de=se(U=>{x.set("positionerElement",U)}),k=Ae("div",t,{ref:[n,de],state:G,stateAttributesMapping:Mn,props:[ue,y]}),re=d.useRef(0),Z=se(U=>{if(U.size===0&&re.current===0||S.current.length===0)return;const Y=re.current;if(re.current=U.size,U.size===Y)return;const ne=xe(nn);if(Y!==0&&!x.state.multiple&&A!==null&&Rr(S.current,A,N)===-1){const fe=P.current,X=fe!=null&&rr(S.current,fe,N)?fe:null;j(X,ne),X===null&&(x.set("selectedIndex",null),M.current=null)}if(Y!==0&&x.state.multiple&&Array.isArray(A)){const q=A.filter(fe=>rr(S.current,fe,N));(q.length!==A.length||q.some(fe=>!rr(A,fe,N)))&&(j(q,ne),q.length===0&&(x.set("selectedIndex",null),M.current=null))}if(C&&K){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const q={height:""};Io(w,q),Io(H.current,q)}}),be=d.useMemo(()=>({...z,side:W,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:$,scrollUpArrowRef:B,scrollDownArrowRef:te}),[z,W,K,$]);return ce.jsx(_o,{elementsRef:E,labelsRef:v,onMapChange:Z,children:ce.jsxs(wl.Provider,{value:be,children:[V&&D&&ce.jsx(Jr,{inert:Xr(!C),cutout:F}),k]})})});function El(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const uo="base-ui-disable-scrollbar",Sr={className:uo,getElement(e){return ce.jsx("style",{nonce:e,href:uo,precedence:"base-ui:low",children:`.${uo}{scrollbar-width:none}.${uo}::-webkit-scrollbar{display:none}`})}};function xg(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const wg=d.createContext(void 0),Rg={disableStyleElements:!1};function Eg(){return d.useContext(wg)??Rg}const Sg={...Mn,...Tn},xm=d.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i,popupRef:l,onOpenChangeComplete:c,setOpen:u,valueRef:f,selectedItemTextRef:a,keyboardActiveRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:b,highlightItemOnHover:R}=Ot(),{side:g,align:y,alignItemWithTriggerActive:x,setControlledAlignItemWithTrigger:E,scrollDownArrowRef:v,scrollUpArrowRef:T}=is(),M=Ga()!=null,S=bl(),{nonce:P,disableStyleElements:H}=Eg(),j=Ke(),L=Ee(i,ve.id),C=Ee(i,ve.open),V=Ee(i,ve.mounted),D=Ee(i,ve.popupProps),A=Ee(i,ve.transitionStatus),O=Ee(i,ve.triggerElement),w=Ee(i,ve.positionerElement),F=Ee(i,ve.listElement),N=d.useRef(0),B=d.useRef(!1),te=d.useRef(0),I=d.useRef(!1),$=d.useRef({}),K=Wn(),z=se(G=>{if(!w||!l.current||!I.current)return;if(B.current||!x){h();return}const de=w.style.top==="0px",k=w.style.bottom==="0px",re=w.getBoundingClientRect().height,Z=it(w),be=getComputedStyle(w),U=parseFloat(be.marginTop),Y=parseFloat(be.marginBottom),ne=ai(getComputedStyle(l.current)),q=Z.documentElement.clientHeight-U-Y,fe=G.scrollTop,le=G.scrollHeight,X=G.clientHeight,_=le-X;let ae=0,Q=null,we=!1;if(de){const Te=_-fe,Pe=re+Te,Ce=Math.min(Pe,q);ae=Ce,Ce!==q?Q=_:we=!0}else if(k){const Te=fe-0,Pe=re+Te,Ce=Math.min(Pe,q),Me=Pe-q;ae=Ce,Ce!==q?Q=0:(we=!0,fe<_&&(Q=fe-(Te-Me)))}ae!==0&&(w.style.height=`${ae}px`),Q!=null&&(G.scrollTop=Q),(we||ae>=ne)&&(B.current=!0),h()});d.useImperativeHandle(b,()=>z,[z]),qt({open:C,ref:l,onComplete(){C&&c?.(!0)}});const W=d.useMemo(()=>({open:C,transitionStatus:A,side:g,align:y}),[C,A,g,y]);ie(()=>{!w||!l.current||Object.keys($.current).length||($.current={top:w.style.top||"0",left:w.style.left||"0",right:w.style.right,height:w.style.height,bottom:w.style.bottom,minHeight:w.style.minHeight,maxHeight:w.style.maxHeight,marginTop:w.style.marginTop,marginBottom:w.style.marginBottom})},[l,w]),ie(()=>{C||x||(I.current=!1,B.current=!1,N.current=0,te.current=0,Io(w,$.current))},[C,x,w,l]),ie(()=>{const G=l.current;if(!(!C||!O||!w||!G||i.state.transitionStatus==="ending")){if(!x){I.current=!0,K.request(h),G.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const de=Tg(G);G.style.removeProperty("--transform-origin");try{const k=getComputedStyle(w),re=getComputedStyle(G),Z=it(O),be=Ze(w),U=O.getBoundingClientRect(),Y=w.getBoundingClientRect(),ne=U.left,q=U.height,fe=F||G,le=fe.scrollHeight,X=parseFloat(re.borderBottomWidth),_=parseFloat(k.marginTop)||10,ae=parseFloat(k.marginBottom)||10,Q=parseFloat(k.minHeight)||100,we=ai(re),Te=5,Pe=5,Ce=20,Me=Z.documentElement.clientHeight-_-ae,He=Z.documentElement.clientWidth,Be=Me-U.bottom+q,Fe=a.current,he=f.current;let Re,Oe=0,Ne=0;if(Fe&&he){const me=he.getBoundingClientRect();Re=Fe.getBoundingClientRect();const Ie=me.left-ne,Je=Re.left-Y.left,ze=me.top-U.top+me.height/2,_e=Re.top-Y.top+Re.height/2;Oe=Ie-Je,Ne=_e-ze}const Ve=Be+Ne+ae+X;let Le=Math.min(Me,Ve);const Xe=Me-_-ae,nt=Ve-Le,Ye=Math.max(Te,ne+Oe),at=He-Pe,ye=Math.max(0,Ye+Y.width-at);w.style.left=`${Ye-ye}px`,w.style.height=`${Le}px`,w.style.maxHeight="auto",w.style.marginTop=`${_}px`,w.style.marginBottom=`${ae}px`,G.style.height="100%";const je=fe.scrollHeight-fe.clientHeight,We=nt>=je;We&&(Le=Math.min(Me,Y.height)-(nt-je));const Qe=U.top<Ce||U.bottom>Me-Ce||Le<Math.min(le,Q),xt=(be.visualViewport?.scale??1)!==1&&Ui;if(Qe||xt){I.current=!0,Io(w,$.current),Tt.flushSync(()=>E(!1));return}if(We){const me=Math.max(0,Me-Ve);w.style.top=Y.height>=Xe?"0":`${me}px`,w.style.height=`${Le}px`,fe.scrollTop=fe.scrollHeight-fe.clientHeight,N.current=Math.max(Q,Le)}else w.style.bottom="0",N.current=Math.max(Q,Le),fe.scrollTop=nt;if(Re){const me=Y.top,Ie=Y.height,Je=Re.top+Re.height/2,ze=Ie>0?(Je-me)/Ie*100:50,_e=xg(ze,0,100);G.style.setProperty("--transform-origin",`50% ${_e}%`)}(N.current===Me||Le>=we)&&(B.current=!0),h(),setTimeout(()=>{I.current=!0})}finally{de()}})}},[i,C,w,O,f,a,l,h,x,E,K,v,T,F]),d.useEffect(()=>{if(!x||!w||!C)return;const G=Ze(w);function de(k){u(!1,xe(lu,k))}return G.addEventListener("resize",de),()=>{G.removeEventListener("resize",de)}},[u,x,w,C]);const J={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":m||void 0,id:`${L}-list`},onKeyDown(G){p.current=!0,M&&qr.has(G.key)&&G.stopPropagation()},onMouseMove(){p.current=!1},onPointerLeave(G){if(!R||El(G)||G.pointerType==="touch")return;const de=G.currentTarget;j.start(0,()=>{i.set("activeIndex",null),de.focus({preventScroll:!0})})},onScroll(G){F||b.current?.(G.currentTarget)},...x&&{style:F?{height:"100%"}:Rl}},ue=Ae("div",t,{ref:[n,l],state:W,stateAttributesMapping:Sg,props:[D,J,Za(A),{className:!F&&x?Sr.className:void 0},s]});return ce.jsxs(d.Fragment,{children:[!H&&Sr.getElement(P),ce.jsx(Wr,{context:S,modal:!1,disabled:!V,restoreFocus:!0,children:ue})]})});function ai(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}const li={transform:"none",scale:"1",translate:"0 0"};function Cg(e,t,n){n?e.setProperty(t,n):e.removeProperty(t)}function Tg(e){const{style:t}=e,n={},o=Object.keys(li);for(const r of o)n[r]=t.getPropertyValue(r),t.setProperty(r,li[r]);return()=>{for(const r of o)Cg(t,r,n[r])}}const wm=d.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i,scrollHandlerRef:l}=Ot(),{alignItemWithTriggerActive:c}=is(),u=Ee(i,ve.hasScrollArrows),f=Ee(i,ve.openMethod),a=Ee(i,ve.multiple),m={id:`${Ee(i,ve.id)}-list`,role:"listbox","aria-multiselectable":a||void 0,onScroll(b){l.current?.(b.currentTarget)},...c&&{style:Rl},className:u&&f!=="touch"?Sr.className:void 0},h=se(b=>{i.set("listElement",b)});return Ae("div",t,{ref:[n,h],props:[m,s]})}),Sl=d.createContext(void 0);function as(){const e=d.useContext(Sl);if(!e)throw new Error(Ge(57));return e}const Rm=d.memo(d.forwardRef(function(t,n){const{render:o,className:r,value:s=null,label:i,disabled:l=!1,nativeButton:c=!1,...u}=t,f=d.useRef(null),a=Un({label:i,textRef:f,indexGuessBehavior:Bi.GuessFromOrder}),{store:p,getItemProps:m,setOpen:h,setValue:b,selectionRef:R,typingRef:g,valuesRef:y,keyboardActiveRef:x,multiple:E,highlightItemOnHover:v}=Ot(),T=Ke(),M=Ee(p,ve.isActive,a.index),S=Ee(p,ve.isSelected,a.index,s),P=Ee(p,ve.isSelectedByFocus,a.index),H=Ee(p,ve.isItemEqualToValue),j=a.index,L=j!==-1,C=d.useRef(null),V=tt(j);ie(()=>{if(!L)return;const z=y.current;return z[j]=s,()=>{delete z[j]}},[L,j,s,y]),ie(()=>{if(!L)return;const z=p.state.value;let W=z;E&&Array.isArray(z)&&z.length>0&&(W=z[z.length-1]),W!==void 0&&En(W,s,H)&&p.set("selectedIndex",j)},[L,j,E,H,p,s]);const D=d.useMemo(()=>({disabled:l,selected:S,highlighted:M}),[l,S,M]),A=m({active:M,selected:S});A.onFocus=void 0,A.id=void 0;const O=d.useRef(null),w=d.useRef("mouse"),F=d.useRef(!1),{getButtonProps:N,buttonRef:B}=Ft({disabled:l,focusableWhenDisabled:!0,native:c});function te(z){const W=p.state.value;if(E){const J=Array.isArray(W)?W:[],ue=S?dg(J,s,H):[...J,s];b(ue,xe(Vn,z))}else b(s,xe(Vn,z)),h(!1,xe(Vn,z))}const I={role:"option","aria-selected":S,tabIndex:M?0:-1,onFocus(){p.set("activeIndex",j)},onMouseEnter(){!x.current&&p.state.selectedIndex===null&&p.set("activeIndex",j)},onMouseMove(){v&&p.set("activeIndex",j)},onMouseLeave(z){!v||x.current||El(z)||T.start(0,()=>{p.state.activeIndex===j&&p.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(z){O.current=z.key,p.set("activeIndex",j)},onClick(z){F.current=!1,!(z.type==="keydown"&&O.current===null)&&(l||O.current===" "&&g.current||w.current!=="touch"&&!M||(O.current=null,te(z.nativeEvent)))},onPointerEnter(z){w.current=z.pointerType},onPointerDown(z){w.current=z.pointerType,F.current=!0},onMouseUp(z){if(l)return;if(F.current){F.current=!1;return}const W=!R.current.allowSelectedMouseUp&&S,J=!R.current.allowUnselectedMouseUp&&!S;W||J||w.current!=="touch"&&!M||te(z.nativeEvent)}},$=Ae("div",t,{ref:[B,n,a.ref,C],state:D,props:[A,I,u,N]}),K=d.useMemo(()=>({selected:S,indexRef:V,textRef:f,selectedByFocus:P,hasRegistered:L}),[S,V,f,P,L]);return ce.jsx(Sl.Provider,{value:K,children:$})})),Em=d.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:r}=as();return o||r?ce.jsx(Mg,{...t,ref:n}):null}),Mg=d.memo(d.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:r,...s}=e,{selected:i}=as(),l=d.useRef(null),{transitionStatus:c,setMounted:u}=$n(i),f=d.useMemo(()=>({selected:i,transitionStatus:c}),[i,c]),a=Ae("span",e,{ref:[t,l],state:f,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Tn});return qt({open:i,ref:l,onComplete(){i||u(!1)}}),a})),Sm=d.memo(d.forwardRef(function(t,n){const{indexRef:o,textRef:r,selectedByFocus:s,hasRegistered:i}=as(),{selectedItemTextRef:l}=Ot(),{className:c,render:u,...f}=t,a=d.useCallback(m=>{if(!m||!i)return;const h=l.current===null||!l.current.isConnected;(s||h&&o.current===0)&&(l.current=m)},[l,o,s,i]);return Ae("div",t,{ref:[a,n,r],props:f})})),Cl=d.forwardRef(function(t,n){const{render:o,className:r,direction:s,keepMounted:i=!1,...l}=t,{store:c,popupRef:u,listRef:f,handleScrollArrowVisibility:a,scrollArrowsMountedCountRef:p}=Ot(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:b}=is(),R=s==="up"?ve.scrollUpArrowVisible:ve.scrollDownArrowVisible,g=Ee(c,R),y=Ee(c,ve.openMethod),x=g&&y!=="touch",E=Ke(),v=s==="up"?b:h,{transitionStatus:T,setMounted:M}=$n(x);ie(()=>(p.current+=1,c.state.hasScrollArrows||c.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&c.state.hasScrollArrows&&c.set("hasScrollArrows",!1)}),[c,p]),qt({open:x,ref:v,onComplete(){x||M(!1)}});const S=d.useMemo(()=>({direction:s,visible:x,side:m,transitionStatus:T}),[s,x,m,T]),H=Ae("div",t,{ref:[n,v],state:S,props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(L){if(L.movementX===0&&L.movementY===0||E.isStarted())return;c.set("activeIndex",null);function C(){const V=c.state.listElement??u.current;if(!V)return;c.set("activeIndex",null),a();const D=V.scrollTop===0,A=Math.round(V.scrollTop+V.clientHeight)>=V.scrollHeight;if(f.current.length===0&&(s==="up"?c.set("scrollUpArrowVisible",!D):c.set("scrollDownArrowVisible",!A)),s==="up"&&D||s==="down"&&A){E.clear();return}if((c.state.listElement||u.current)&&f.current&&f.current.length>0){const w=f.current,F=v.current?.offsetHeight||0;if(s==="up"){let N=0;const B=V.scrollTop+F;for(let I=0;I<w.length;I+=1){const $=w[I];if($&&$.offsetTop>=B){N=I;break}}const te=Math.max(0,N-1);if(te<N){const I=w[te];I&&(V.scrollTop=Math.max(0,I.offsetTop-F))}else V.scrollTop=0}else{let N=w.length-1;const B=V.scrollTop+V.clientHeight-F;for(let I=0;I<w.length;I+=1){const $=w[I];if($&&$.offsetTop+$.offsetHeight>B){N=Math.max(0,I-1);break}}const te=Math.min(w.length-1,N+1);if(te>N){const I=w[te];I&&(V.scrollTop=I.offsetTop+I.offsetHeight-V.clientHeight+F)}else V.scrollTop=V.scrollHeight-V.clientHeight}}E.start(40,C)}E.start(40,C)},onMouseLeave(){E.clear()}},l]});return x||i?H:null}),Cm=d.forwardRef(function(t,n){return ce.jsx(Cl,{...t,ref:n,direction:"down"})}),Tm=d.forwardRef(function(t,n){return ce.jsx(Cl,{...t,ref:n,direction:"up"})});function Mm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:l=!0,actionsRef:c,handle:u,triggerId:f,defaultTriggerId:a=null}=e,p=Bt(!0),m=!!p,h=lt(()=>u?.store??new cl({open:n??o,activeTriggerId:f!==void 0?f:a,modal:l,disablePointerDismissal:i,nested:m})).current;h.useControlledProp("open",n,o),h.useControlledProp("activeTriggerId",f,a),h.useSyncedValues({disablePointerDismissal:i,nested:m,modal:l}),h.useContextCallback("onOpenChange",r),h.useContextCallback("onOpenChangeComplete",s);const b=h.useState("payload");ll({store:h,actionsRef:c,parentContext:p?.store.context});const R=d.useMemo(()=>({store:h}),[h]);return ce.jsx(ns.Provider,{value:R,children:typeof t=="function"?t({payload:b}):t})}var Ig=(e,t,n,o,r,s,i,l)=>{let c=document.documentElement,u=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(h=>{let b=h==="class",R=b&&s?r.map(g=>s[g]||g):r;b?(c.classList.remove(...R),c.classList.add(s&&s[m]?s[m]:m)):c.setAttribute(h,m)}),a(m)}function a(m){l&&u.includes(m)&&(c.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)f(o);else try{let m=localStorage.getItem(t)||n,h=i&&m==="system"?p():m;f(h)}catch{}},kg=d.createContext(void 0),Pg={setTheme:e=>{},themes:[]},Im=()=>{var e;return(e=d.useContext(kg))!=null?e:Pg};d.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:r,defaultTheme:s,value:i,themes:l,nonce:c,scriptProps:u})=>{let f=JSON.stringify([n,t,s,e,l,i,o,r]).slice(1,-1);return d.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Ig.toString()})(${f})`}})});const Tl=d.createContext(void 0);function ls(){const e=d.useContext(Tl);if(e===void 0)throw new Error(Ge(64));return e}let Og=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const cs={tabActivationDirection:e=>({[Og.activationDirection]:e})},km=d.forwardRef(function(t,n){const{className:o,defaultValue:r=0,onValueChange:s,orientation:i="horizontal",render:l,value:c,...u}=t,f=Ho(),a=Object.hasOwn(t,"defaultValue"),p=d.useRef([]),[m,h]=d.useState(()=>new Map),[b,R]=yo({controlled:c,default:r,name:"Tabs",state:"value"}),g=c!==void 0,[y,x]=d.useState(()=>new Map),[E,v]=d.useState("none"),T=se((O,w)=>{s?.(O,w),!w.isCanceled&&(R(O),v(w.activationDirection))}),M=se((O,w)=>{h(F=>{if(F.get(O)===w)return F;const N=new Map(F);return N.set(O,w),N})}),S=se((O,w)=>{h(F=>{if(!F.has(O)||F.get(O)!==w)return F;const N=new Map(F);return N.delete(O),N})}),P=d.useCallback(O=>m.get(O),[m]),H=d.useCallback(O=>{for(const w of y.values())if(O===w?.value)return w?.id},[y]),j=d.useCallback(O=>{if(O===void 0)return null;for(const[w,F]of y.entries())if(F!=null&&O===(F.value??F.index))return w;return null},[y]),L=d.useMemo(()=>({direction:f,getTabElementBySelectedValue:j,getTabIdByPanelValue:H,getTabPanelIdByValue:P,onValueChange:T,orientation:i,registerMountedTabPanel:M,setTabMap:x,unregisterMountedTabPanel:S,tabActivationDirection:E,value:b}),[f,j,H,P,T,i,M,x,S,E,b]),C=d.useMemo(()=>{for(const O of y.values())if(O!=null&&O.value===b)return O},[y,b]),V=d.useMemo(()=>{for(const O of y.values())if(O!=null&&!O.disabled)return O.value},[y]);ie(()=>{if(g||y.size===0)return;const O=C?.disabled,w=C==null&&b!==null;if(a&&O&&b===r||!O&&!w)return;const N=V??null;b!==N&&(R(N),v("none"))},[r,V,a,g,C,v,R,y,b]);const A=Ae("div",t,{state:{orientation:i,tabActivationDirection:E},ref:n,props:u,stateAttributesMapping:cs});return ce.jsx(Tl.Provider,{value:L,children:ce.jsx(_o,{elementsRef:p,children:A})})}),Ml="data-composite-item-active",Il=d.createContext(void 0);function Ag(){const e=d.useContext(Il);if(e===void 0)throw new Error(Ge(65));return e}const Pm=d.forwardRef(function(t,n){const{className:o,disabled:r=!1,render:s,value:i,id:l,nativeButton:c=!0,...u}=t,{value:f,getTabPanelIdByValue:a,orientation:p}=ls(),{activateOnFocus:m,highlightedTabIndex:h,onTabActivation:b,setHighlightedTabIndex:R,tabsListElement:g}=Ag(),y=bt(l),x=d.useMemo(()=>({disabled:r,id:y,value:i}),[r,y,i]),{compositeProps:E,compositeRef:v,index:T}=al({metadata:x}),M=i===f,S=d.useRef(!1);ie(()=>{if(S.current){S.current=!1;return}if(!(M&&T>-1&&h!==T))return;const F=g;if(F!=null){const N=vt(it(F));if(N&&Se(F,N))return}r||R(T)},[M,T,h,R,r,g]);const{getButtonProps:P,buttonRef:H}=Ft({disabled:r,native:c,focusableWhenDisabled:!0}),j=a(i),L=d.useRef(!1),C=d.useRef(!1);function V(F){M||r||b(i,xe(nn,F.nativeEvent,void 0,{activationDirection:"none"}))}function D(F){M||(T>-1&&!r&&R(T),!r&&m&&(!L.current||L.current&&C.current)&&b(i,xe(nn,F.nativeEvent,void 0,{activationDirection:"none"})))}function A(F){if(M||r)return;L.current=!0;function N(){L.current=!1,C.current=!1}(!F.button||F.button===0)&&(C.current=!0,it(F.currentTarget).addEventListener("pointerup",N,{once:!0}))}const O=d.useMemo(()=>({disabled:r,active:M,orientation:p}),[r,M,p]);return Ae("button",t,{state:O,ref:[n,H,v],props:[E,{role:"tab","aria-controls":j,"aria-selected":M,id:y,onClick:V,onFocus:D,onPointerDown:A,[Ml]:M?"":void 0,onKeyDownCapture(){S.current=!0}},u,P]})});let Lg=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const Om=d.forwardRef(function(t,n){const{className:o,value:r,render:s,keepMounted:i=!1,...l}=t,{value:c,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:a,registerMountedTabPanel:p,unregisterMountedTabPanel:m}=ls(),h=bt(),b=d.useMemo(()=>({id:h,value:r}),[h,r]),{ref:R,index:g}=Un({metadata:b}),y=r!==c,x=u(r),E=d.useMemo(()=>({hidden:y,orientation:f,tabActivationDirection:a}),[y,f,a]),v=Ae("div",t,{state:E,ref:[n,R],props:[{"aria-labelledby":x,hidden:y,id:h??void 0,role:"tabpanel",tabIndex:y?-1:0,[Lg.index]:g},l],stateAttributesMapping:cs});return ie(()=>{if(!(y&&!i)&&h!=null)return p(r,h),()=>{m(r,h)}},[y,i,r,h,p,m]),!y||i?v:null});function Dg(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const Ng=[];function Fg(e){const{itemSizes:t,cols:n=1,loopFocus:o=!0,dense:r=!1,orientation:s="both",direction:i,highlightedIndex:l,onHighlightedIndexChange:c,rootRef:u,enableHomeAndEndKeys:f=!1,stopEventPropagation:a=!1,disabledIndices:p,modifierKeys:m=Ng}=e,[h,b]=d.useState(0),R=n>1,g=d.useRef(null),y=It(g,u),x=d.useRef([]),E=d.useRef(!1),v=l??h,T=se((P,H=!1)=>{if((c??b)(P),H){const j=x.current[P];Gs(g.current,j,i,s)}}),M=se(P=>{if(P.size===0||E.current)return;E.current=!0;const H=Array.from(P.keys()),j=H.find(C=>C?.hasAttribute(Ml))??null,L=j?H.indexOf(j):-1;L!==-1&&T(L),Gs(g.current,j,i,s)}),S=d.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:y,onFocus(P){!g.current||!Ks(P.target)||P.target.setSelectionRange(0,P.target.value.length??0)},onKeyDown(P){const H=f?zf:Ja;if(!H.has(P.key)||Vg(P,m)||!g.current)return;const L=i==="rtl",C=L?jn:bn,V={horizontal:C,vertical:en,both:C}[s],D=L?bn:jn,A={horizontal:D,vertical:hn,both:D}[s];if(Ks(P.target)&&!Dg(P.target)){const I=P.target.selectionStart,$=P.target.selectionEnd,K=P.target.value??"";if(I==null||P.shiftKey||I!==$||P.key!==A&&I<K.length||P.key!==V&&I>0)return}let O=v;const w=po(x,p),F=br(x,p);if(R){const I=t||Array.from({length:x.current.length},()=>({width:1,height:1})),$=ta(I,n,r),K=$.findIndex(W=>W!=null&&!$t(x,W,p)),z=$.reduce((W,J,ue)=>J!=null&&!$t(x,J,p)?ue:W,-1);O=$[ea({current:$.map(W=>W?x.current[W]:null)},{event:P,orientation:s,loopFocus:o,cols:n,disabledIndices:oa([...p||x.current.map((W,J)=>$t(x,J)?J:void 0),void 0],$),minIndex:K,maxIndex:z,prevIndex:na(v>F?w:v,I,$,n,P.key===en?"bl":P.key===bn?"tr":"tl"),rtl:L})]}const N={horizontal:[C],vertical:[en],both:[C,en]}[s],B={horizontal:[D],vertical:[hn],both:[D,hn]}[s],te=R?H:{horizontal:f?_f:qa,vertical:f?jf:Xa,both:H}[s];f&&(P.key===Gn?O=w:P.key===qn&&(O=F)),O===v&&(N.includes(P.key)||B.includes(P.key))&&(o&&O===F&&N.includes(P.key)?O=w:o&&O===w&&B.includes(P.key)?O=F:O=ot(x,{startingIndex:O,decrement:B.includes(P.key),disabledIndices:p})),O!==v&&!dn(x,O)&&(a&&P.stopPropagation(),te.has(P.key)&&P.preventDefault(),T(O,!0),queueMicrotask(()=>{x.current[O]?.focus()}))}}),[n,r,i,p,x,f,v,R,t,o,y,m,T,s,a]);return d.useMemo(()=>({props:S,highlightedIndex:v,onHighlightedIndexChange:T,elementsRef:x,disabledIndices:p,onMapChange:M,relayKeyboardEvent:S.onKeyDown}),[S,v,T,x,p,M])}function Vg(e,t){for(const n of Kf.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Bg(e){const{render:t,className:n,refs:o=Dt,props:r=Dt,state:s=$e,stateAttributesMapping:i,highlightedIndex:l,onHighlightedIndexChange:c,orientation:u,dense:f,itemSizes:a,loopFocus:p,cols:m,enableHomeAndEndKeys:h,onMapChange:b,stopEventPropagation:R=!0,rootRef:g,disabledIndices:y,modifierKeys:x,highlightItemOnHover:E=!1,tag:v="div",...T}=e,M=Ho(),{props:S,highlightedIndex:P,onHighlightedIndexChange:H,elementsRef:j,onMapChange:L,relayKeyboardEvent:C}=Fg({itemSizes:a,cols:m,loopFocus:p,dense:f,orientation:u,highlightedIndex:l,onHighlightedIndexChange:c,rootRef:g,stopEventPropagation:R,enableHomeAndEndKeys:h,direction:M,disabledIndices:y,modifierKeys:x}),V=Ae(v,e,{state:s,ref:o,props:[S,...r,T],stateAttributesMapping:i}),D=d.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:H,highlightItemOnHover:E,relayKeyboardEvent:C}),[P,H,E,C]);return ce.jsx(mi.Provider,{value:D,children:ce.jsx(_o,{elementsRef:j,onMapChange:A=>{b?.(A),L(A)},children:V})})}const Am=d.forwardRef(function(t,n){const{activateOnFocus:o=!1,className:r,loopFocus:s=!0,render:i,...l}=t,{getTabElementBySelectedValue:c,onValueChange:u,orientation:f,value:a,setTabMap:p,tabActivationDirection:m}=ls(),[h,b]=d.useState(0),[R,g]=d.useState(null),y=Hg(a,f,R,c),x=se((M,S)=>{if(M!==a){const P=y(M);S.activationDirection=P,u(M,S)}}),E=d.useMemo(()=>({orientation:f,tabActivationDirection:m}),[f,m]),v={"aria-orientation":f==="vertical"?"vertical":void 0,role:"tablist"},T=d.useMemo(()=>({activateOnFocus:o,highlightedTabIndex:h,onTabActivation:x,setHighlightedTabIndex:b,tabsListElement:R,value:a}),[o,h,x,b,R,a]);return ce.jsx(Il.Provider,{value:T,children:ce.jsx(Bg,{render:i,className:r,state:E,refs:[n,g],props:[v,l],stateAttributesMapping:cs,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:s,orientation:f,onHighlightedIndexChange:b,onMapChange:p,disabledIndices:Dt})})});function ci(e,t){const{left:n,top:o}=e.getBoundingClientRect(),{left:r,top:s}=t.getBoundingClientRect(),i=n-r,l=o-s;return{left:i,top:l}}function Hg(e,t,n,o){const[r,s]=d.useState(null);return ie(()=>{if(e==null||n==null){s(null);return}const i=o(e);if(i==null){s(null);return}const{left:l,top:c}=ci(i,n);s(t==="horizontal"?l:c)},[t,o,n,e]),d.useCallback(i=>{if(i===e)return"none";if(i==null)return s(null),"none";if(i!=null&&n!=null){const l=o(i);if(l!=null){const{left:c,top:u}=ci(l,n);if(r==null)return s(t==="horizontal"?c:u),"none";if(t==="horizontal"){if(c<r)return s(c),"left";if(c>r)return s(c),"right"}else{if(u<r)return s(u),"up";if(u>r)return s(u),"down"}}}return"none"},[o,t,r,n,e])}export{nm as A,jg as B,em as C,im as D,ym as E,vm as F,xm as G,wm as H,Rm as I,Sm as J,Em as K,Tm as L,sl as M,Cm as N,Mm as O,Im as P,km as Q,Am as R,Zg as S,dm as T,Pm as U,Om as V,zg as a,Jg as b,fc as c,Gg as d,qg as e,Kg as f,Yg as g,tm as h,Xg as i,Qg as j,Wg as k,$g as l,lm as m,sm as n,rm as o,am as p,om as q,cm as r,um as s,Ug as t,fm as u,pm as v,gm as w,mm as x,bm as y,hm as z};
|