import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{d as t,t as n,u as r}from"./jsx-runtime-UY3v_sjn.js";import{i,r as a}from"./dist-D79fvq5v.js";import{a as o,r as s}from"./dist-CpbhN_cU.js";import{t as c}from"./dist-CMaNrZHo.js";import{l}from"./es2015-CEhw2WdQ.js";import{t as u}from"./dist-DRMc1VG4.js";import{t as d}from"./createLucideIcon-BeHZXpLp.js";var f=e(t(),1),p=[`top`,`right`,`bottom`,`left`],m=Math.min,h=Math.max,g=Math.round,_=Math.floor,v=e=>({x:e,y:e}),y={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function b(e,t,n){return h(e,m(t,n))}function x(e,t){return typeof e==`function`?e(t):e}function S(e){return e.split(`-`)[0]}function C(e){return e.split(`-`)[1]}function w(e){return e===`x`?`y`:`x`}function T(e){return e===`y`?`height`:`width`}function E(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function D(e){return w(E(e))}function O(e,t,n){n===void 0&&(n=!1);let r=C(e),i=D(e),a=T(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=I(o)),[o,I(o)]}function k(e){let t=I(e);return[A(e),t,A(t)]}function A(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var j=[`left`,`right`],M=[`right`,`left`],N=[`top`,`bottom`],P=[`bottom`,`top`];function F(e,t,n){switch(e){case`top`:case`bottom`:return n?t?M:j:t?j:M;case`left`:case`right`:return t?N:P;default:return[]}}function ee(e,t,n,r){let i=C(e),a=F(S(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(A)))),a}function I(e){let t=S(e);return y[t]+e.slice(t.length)}function L(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function R(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:L(e)}function z(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function B(e,t,n){let{reference:r,floating:i}=e,a=E(t),o=D(t),s=T(o),c=S(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=C(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function te(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=x(t,e),p=R(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=z(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=z(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ne=50,re=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:te},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=B(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=x(e,t)||{};if(l==null)return{};let d=R(u),f={x:n,y:r},p=D(i),h=T(p),g=await o.getDimensions(l),_=p===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,S=_?`clientHeight`:`clientWidth`,w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],E=f[p]-a.reference[p],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[S]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[S]||a.floating[h]);let A=w/2-E/2,j=k/2-g[h]/2-1,M=m(d[v],j),N=m(d[y],j),P=k-g[h]-N,F=k/2-g[h]/2+A,ee=b(M,F,P),I=!c.arrow&&C(i)!=null&&F!==ee&&a.reference[h]/2-(Fe<=0)){let e=(i.flip?.index||0)+1,t=w[e];if(t&&(!(u===`alignment`&&_!==E(t))||A.every(e=>E(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=E(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function oe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function se(e){return p.some(t=>e[t]>=0)}var ce=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=x(e,t);switch(i){case`referenceHidden`:{let e=oe(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:se(e)}}}case`escaped`:{let e=oe(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:se(e)}}}default:return{}}}}},le=new Set([`left`,`top`]);async function ue(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=S(n),s=C(n),c=E(n)===`y`,l=le.has(o)?-1:1,u=a&&c?-1:1,d=x(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var de=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ue(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=x(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=E(i),p=w(f),m=u[p],h=u[f],g=(e,t)=>b(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},pe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=x(e,t),u={x:n,y:r},d=E(i),f=w(d),p=u[f],m=u[d],h=x(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=le.has(S(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},me=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=x(e,t),c=await i.detectOverflow(t,s),l=S(n),u=C(n),d=E(n)===`y`,{width:f,height:p}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=p-c.top-c.bottom,y=f-c.left-c.right,b=m(p-c[g],v),w=m(f-c[_],y),T=t.middlewareData.shift,D=!T,O=b,k=w;T!=null&&T.enabled.x&&(k=y),T!=null&&T.enabled.y&&(O=v),D&&!u&&(d?k=f-2*h(c.left,c.right):O=p-2*h(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return f!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function he(){return typeof window<`u`}function V(e){return ge(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((ge(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ge(e){return he()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return he()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return he()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function _e(e){return!he()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function ve(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ye(e){return/^(table|td|th)$/.test(V(e))}function be(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xe=/transform|translate|scale|rotate|perspective|filter/,Se=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ce;function we(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!Ee()&&(K(t.backdropFilter)||K(t.filter))||xe.test(t.willChange||``)||Se.test(t.contain||``)}function Te(e){let t=J(e);for(;G(t)&&!De(t);){if(we(t))return t;if(be(t))return null;t=J(t)}return null}function Ee(){return Ce??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ce}function De(e){return/^(html|body|#document)$/.test(V(e))}function q(e){return H(e).getComputedStyle(e)}function Oe(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_e(e)&&e.host||U(e);return _e(t)?t.host:t}function ke(e){let t=J(e);return De(t)?(e.ownerDocument||e).body:G(t)&&ve(t)?t:ke(t)}function Ae(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=je(a);return t.concat(a,a.visualViewport||[],ve(r)?r:[],e&&n?Ae(e):[])}else return t.concat(r,Ae(r,[],n))}function je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Me(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=g(n)!==a||g(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ne(e){return W(e)?e:e.contextElement}function Y(e){let t=Ne(e);if(!G(t))return v(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Me(t),o=(a?g(n.width):n.width)/r,s=(a?g(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Pe=v(0);function Fe(e){let t=H(e);return!Ee()||!t.visualViewport?Pe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ie(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function X(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ne(e),o=v(1);t&&(r?W(r)&&(o=Y(r)):o=Y(e));let s=Ie(a,n,r)?Fe(a):v(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=je(n);for(;i&&t!==n;){let e=Y(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=je(n)}}return z({width:u,height:d,x:c,y:l})}function Le(e,t){let n=Oe(e).scrollLeft;return t?t.left+n:X(U(e)).left+n}function Re(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Le(e,n),y:n.top+t.scrollTop}}function ze(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?be(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=v(1),u=v(0),d=G(r);if((d||!a)&&((V(r)!==`body`||ve(o))&&(c=Oe(r)),d)){let e=X(r);l=Y(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Re(o,c):v(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Be(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ve(e){let t=Oe(e),n=e.ownerDocument.body,r=h(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=h(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Le(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=h(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var He=25;function Ue(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ee()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Le(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=He&&(s-=o)}return{width:s,height:c,x:l,y:u}}function We(e,t){let n=X(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Y(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ge(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ue(e,n,t);else if(t===`document`)r=Ve(U(e));else if(W(t))r=We(t,n);else{let n=Fe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return z(r)}function Ke(e,t){let n=t.get(e);if(n)return n;let r=Ae(e,[],!1).filter(e=>W(e)&&V(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!De(o);){let e=q(o),t=we(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function qe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?be(t)?[]:Ke(t,this._c):[].concat(n),r],o=Ge(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function it(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ne(e),u=i||a?[...l?Ae(l):[],...t?Ae(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?rt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?X(e):null;c&&g();function g(){let t=X(e);h&&!nt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var at=de,ot=fe,st=ae,ct=me,lt=ce,ut=ie,dt=pe,ft=(e,t,n)=>{let r=new Map,i=n??{},a={...tt,...i.platform,_c:r};return re(e,t,{...i,platform:a})},pt=e(r(),1),mt=typeof document<`u`?f.useLayoutEffect:function(){};function ht(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ht(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ht(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _t(e,t){let n=gt(e);return Math.round(t*n)/n}function vt(e){let t=f.useRef(e);return mt(()=>{t.current=e}),t}function yt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);ht(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,D=vt(c),O=vt(i),k=vt(l),A=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),ft(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ht(T.current,t)&&(T.current=t,pt.flushSync(()=>{d(t)}))})},[p,t,n,O,k]);mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=f.useRef(!1);mt(()=>(j.current=!0,()=>{j.current=!1}),[]),mt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=f.useMemo(()=>({reference:x,floating:S}),[x,S]),P=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=_t(N.floating,u.x),r=_t(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gt(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var bt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ut({element:r.current,padding:i}).fn(n):r?ut({element:r,padding:i}).fn(n):{}}}},xt=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>({fn:dt(e).fn,options:[e,t]}),wt=(e,t)=>{let n=st(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tt=(e,t)=>{let n=ct(e);return{name:n.name,fn:n.fn,options:[e,t]}},Et=(e,t)=>{let n=lt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dt=(e,t)=>{let n=bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z=n(),Ot=Object.defineProperty,kt=f.forwardRef(((e,t)=>Ot(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,Z.jsx)(c.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),At=Object.defineProperty,Q=(e,t)=>At(e,`name`,{value:t,configurable:!0}),jt=`Popper`,[Mt,Nt]=i(jt),[Pt,Ft]=Mt(jt),It=Q(e=>{let{__scopePopper:t,children:n}=e,[r,i]=f.useState(null),[a,o]=f.useState(void 0);return(0,Z.jsx)(Pt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Lt=`PopperAnchor`,Rt=f.forwardRef(Q(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ft(Lt,n),s=f.useRef(null),l=a.onAnchorChange,u=o(t,f.useCallback(e=>{s.current=e,e&&l(e)},[l])),d=f.useRef(null);f.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&l(d.current)});let p=a.placementState&&Jt(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,Z.jsx)(c.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:u})},`PopperAnchor`)),zt=`PopperContent`,[Bt,Vt]=Mt(zt),Ht=f.forwardRef(Q(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:s=`center`,alignOffset:d=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=Ft(zt,n),[C,w]=f.useState(null),T=o(t,w),[E,D]=f.useState(null),O=u(E),k=O?.width??0,A=O?.height??0,j=r+(s===`center`?``:`-`+s),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Kt),altBoundary:P},{refs:ee,floatingStyles:I,placement:L,isPositioned:R,middlewareData:z}=yt({strategy:`fixed`,placement:j,whileElementsMounted:Q((...e)=>it(...e,{animationFrame:y===`always`}),`whileElementsMounted`),elements:{reference:S.anchor},middleware:[xt({mainAxis:i+A,alignmentAxis:d}),m&&St({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?Ct():void 0,...F}),m&&wt({...F}),Tt({...F,apply:Q(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),E&&Dt({element:E,padding:p}),qt({arrowWidth:k,arrowHeight:A}),v&&Et({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),B=S.setPlacementState;a(()=>(B(L),()=>{B(void 0)}),[L,B]);let[te,ne]=Jt(L),re=l(b);a(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=f.useState();return a(()=>{C&&ce(window.getComputedStyle(C).zIndex)},[C]),(0,Z.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...I,transform:R?I.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Z.jsx)(Bt,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,Z.jsx)(c.div,{"data-side":te,"data-align":ne,...x,ref:T,style:{...x.style,animation:R?x.style?.animation:`none`}})})})},`PopperContent`)),Ut=`PopperArrow`,Wt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Gt=f.forwardRef(Q(function(e,t){let{__scopePopper:n,...r}=e,i=Vt(Ut,n),a=Wt[i.placedSide];return(0,Z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Z.jsx)(kt,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Kt(e){return e!==null}Q(Kt,`isNotNull`);var qt=Q(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Jt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Jt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Q(Jt,`getSideAndAlignFromPlacement`);var Yt=It,Xt=Rt,Zt=Ht,Qt=Gt,$t=Object.defineProperty,en=(e,t)=>$t(e,`name`,{value:t,configurable:!0}),tn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),nn=f.forwardRef(en(function(e,t){return(0,Z.jsx)(c.span,{...e,ref:t,style:{...tn,...e.style}})},`VisuallyHidden`)),rn=d(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),an=Object.defineProperty,$=(e,t)=>an(e,`name`,{value:t,configurable:!0});function on(e){let t=e+`CollectionProvider`,[n,r]=i(t),[a,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=$(e=>{let{scope:t,children:n}=e,r=f.useRef(null),i=f.useRef(new Map).current;return(0,Z.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);l.displayName=t;let u=e+`CollectionSlot`,d=s(u),p=f.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(t,c(u,n).collectionRef);return(0,Z.jsx)(d,{ref:i,children:r})});p.displayName=u;let m=e+`CollectionItemSlot`,h=`data-radix-collection-item`,g=s(m),_=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=f.useRef(null),s=o(t,a),l=c(m,n);return f.useEffect(()=>(l.itemMap.set(a,{ref:a,...i}),()=>void l.itemMap.delete(a))),(0,Z.jsx)(g,{[h]:``,ref:s,children:r})});_.displayName=m;function v(t){let n=c(e+`CollectionConsumer`,t);return f.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return $(v,`useCollection`),[{Provider:l,Slot:p,ItemSlot:_},v,r]}$(on,`createCollection`);var sn=new WeakMap,cn=class e extends Map{static{$(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],sn.set(this,!0)}set(e,t){return sn.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=dn(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ln(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=un(e,t);return n===-1?void 0:e[n]}$(ln,`at`);function un(e,t){let n=e.length,r=dn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}$(un,`toSafeIndex`);function dn(e){return e!==e||e===0?0:Math.trunc(e)}$(dn,`toSafeInteger`);function fn(e){let t=e+`CollectionProvider`,[n,r]=i(t),[a,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new cn,setItemMap:$(()=>void 0,`setItemMap`)}),l=$(({state:e,...t})=>e?(0,Z.jsx)(d,{...t,state:e}):(0,Z.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=$(e=>{let t=y();return(0,Z.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=t+`Init`;let d=$(e=>{let{scope:t,children:n,state:r}=e,i=f.useRef(null),[s,c]=f.useState(null),l=o(i,c),[u,d]=r;return f.useEffect(()=>{if(!s)return;let e=gn(()=>{});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s]),(0,Z.jsx)(a,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:i,collectionElement:s,children:n})},`CollectionProviderImpl`);d.displayName=t+`Impl`;let p=e+`CollectionSlot`,m=s(p),h=f.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(t,c(p,n).collectionRef);return(0,Z.jsx)(m,{ref:i,children:r})});h.displayName=p;let g=e+`CollectionItemSlot`,_=s(g),v=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=f.useRef(null),[s,l]=f.useState(null),u=o(t,a,l),{setItemMap:d}=c(g,n),p=f.useRef(i);pn(p.current,i)||(p.current=i);let m=p.current;return f.useEffect(()=>{let e=m;return d(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(hn):(t.set(s,{...e,element:s}),t.toSorted(hn)):t),()=>{d(e=>!s||!e.has(s)?e:(e.delete(s),new cn(e)))}},[s,m,d]),(0,Z.jsx)(_,{"data-radix-collection-item":``,ref:u,children:r})});v.displayName=g;function y(){return f.useState(new cn)}$(y,`useInitCollection`);function b(t){let{itemMap:n}=c(e+`CollectionConsumer`,t);return n}return $(b,`useCollection`),[{Provider:l,Slot:h,ItemSlot:v},{createCollectionScope:r,useCollection:b,useInitCollection:y}]}$(fn,`createCollection`);function pn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}$(pn,`shallowEqual`);function mn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}$(mn,`isElementPreceding`);function hn(e,t){return!e[1].element||!t[1].element?0:mn(e[1].element,t[1].element)?-1:1}$(hn,`sortByDocumentPosition`);function gn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}$(gn,`getChildListObserver`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0}),yn=f.createContext(void 0);function bn(e){let t=f.useContext(yn);return e||t||`ltr`}vn(bn,`useDirection`);var xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0});function Cn(e){let t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Sn(Cn,`usePrevious`);export{nn as a,Qt as c,Nt as d,rn as i,Zt as l,bn as n,tn as o,on as r,Xt as s,Cn as t,Yt as u};