import{r as S}from"./chunk-LFPYN7LY-BBzdRvLF.js";import{r as Yt}from"./index-DkQvyDfJ.js";function at(){return typeof window<"u"}function tt(t){return $t(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function z(t){var e;return(e=($t(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $t(t){return at()?t instanceof Node||t instanceof $(t).Node:!1}function V(t){return at()?t instanceof Element||t instanceof $(t).Element:!1}function _(t){return at()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Ct(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}const qt=new Set(["inline","contents"]);function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=H(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!qt.has(i)}const Xt=new Set(["table","td","th"]);function Ut(t){return Xt.has(tt(t))}const Kt=[":popover-open",":modal"];function ut(t){return Kt.some(e=>{try{return t.matches(e)}catch{return!1}})}const Gt=["transform","translate","scale","rotate","perspective"],Jt=["transform","translate","scale","rotate","perspective","filter"],Qt=["paint","layout","strict","content"];function xt(t){const e=yt(),n=V(t)?H(t):t;return Gt.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Jt.some(o=>(n.willChange||"").includes(o))||Qt.some(o=>(n.contain||"").includes(o))}function Zt(t){let e=X(t);for(;_(e)&&!Q(e);){if(xt(e))return e;if(ut(e))return null;e=X(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const te=new Set(["html","body","#document"]);function Q(t){return te.has(tt(t))}function H(t){return $(t).getComputedStyle(t)}function dt(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function X(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ct(t)&&t.host||z(t);return Ct(e)?e.host:e}function Wt(t){const e=X(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&ot(e)?e:Wt(e)}function nt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Wt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=$(i);if(r){const c=gt(s);return e.concat(s,s.visualViewport||[],ot(i)?i:[],c&&n?nt(c):[])}return e.concat(i,nt(i,[],n))}function gt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const ee=["top","right","bottom","left"],U=Math.min,F=Math.max,st=Math.round,it=Math.floor,N=t=>({x:t,y:t}),ne={left:"right",right:"left",bottom:"top",top:"bottom"},oe={start:"end",end:"start"};function pt(t,e,n){return F(t,U(e,n))}function I(t,e){return typeof t=="function"?t(e):t}function Y(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function vt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}const ie=new Set(["top","bottom"]);function K(t){return ie.has(Y(t))?"y":"x"}function At(t){return vt(K(t))}function re(t,e,n){n===void 0&&(n=!1);const o=et(t),i=At(t),r=bt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ct(s)),[s,ct(s)]}function se(t){const e=ct(t);return[wt(t),e,wt(e)]}function wt(t){return t.replace(/start|end/g,e=>oe[e])}const St=["left","right"],Et=["right","left"],ce=["top","bottom"],le=["bottom","top"];function fe(t,e,n){switch(t){case"top":case"bottom":return n?e?Et:St:e?St:Et;case"left":case"right":return e?ce:le;default:return[]}}function ae(t,e,n,o){const i=et(t);let r=fe(Y(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(wt)))),r}function ct(t){return t.replace(/left|right|bottom|top/g,e=>ne[e])}function ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ue(t):{top:t,right:t,bottom:t,left:t}}function lt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Pt(t,e,n){let{reference:o,floating:i}=t;const r=K(e),s=At(e),c=bt(s),f=Y(e),l=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let d;switch(f){case"top":d={x:a,y:o.y-i.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(et(e)){case"start":d[s]-=m*(n&&l?-1:1);break;case"end":d[s]+=m*(n&&l?-1:1);break}return d}const de=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:u}=Pt(l,o,f),m=o,d={},h=0;for(let g=0;g({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:f}=e,{element:l,padding:a=0}=I(t,e)||{};if(l==null)return{};const u=Bt(a),m={x:n,y:o},d=At(i),h=bt(d),g=await s.getDimensions(l),p=d==="y",w=p?"top":"left",v=p?"bottom":"right",y=p?"clientHeight":"clientWidth",b=r.reference[h]+r.reference[d]-m[d]-r.floating[h],x=m[d]-r.reference[d],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let R=O?O[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(O)))&&(R=c.floating[y]||r.floating[h]);const D=b/2-x/2,W=R/2-g[h]/2-1,P=U(u[w],W),B=U(u[v],W),T=P,L=R-g[h]-B,C=R/2-g[h]/2+D,j=pt(T,C,L),E=!f.arrow&&et(i)!=null&&C!==j&&r.reference[h]/2-(CC<=0)){var B,T;const C=(((B=r.flip)==null?void 0:B.index)||0)+1,j=R[C];if(j)return{data:{index:C,overflows:P},reset:{placement:j}};let E=(T=P.filter(M=>M.overflows[0]<=0).sort((M,A)=>M.overflows[1]-A.overflows[1])[0])==null?void 0:T.placement;if(!E)switch(d){case"bestFit":{var L;const M=(L=P.filter(A=>{if(O){const k=K(A.placement);return k===v||k==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(k=>k>0).reduce((k,q)=>k+q,0)]).sort((A,k)=>A[1]-k[1])[0])==null?void 0:L[0];M&&(E=M);break}case"initialPlacement":E=c;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function Dt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Lt(t){return ee.some(e=>t[e]>=0)}const ge=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=I(t,e);switch(o){case"referenceHidden":{const r=await Z(e,{...i,elementContext:"reference"}),s=Dt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Lt(s)}}}case"escaped":{const r=await Z(e,{...i,altBoundary:!0}),s=Dt(r,n.floating);return{data:{escapedOffsets:s,escaped:Lt(s)}}}default:return{}}}}};async function pe(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=Y(n),c=et(n),f=K(n)==="y",l=["left","top"].includes(s)?-1:1,a=r&&f?-1:1,u=I(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),f?{x:d*a,y:m*l}:{x:m*l,y:d*a}}const we=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,f=await pe(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x:w,y:v}=p;return{x:w,y:v}}},...f}=I(t,e),l={x:n,y:o},a=await Z(e,f),u=K(Y(i)),m=vt(u);let d=l[m],h=l[u];if(r){const p=m==="y"?"top":"left",w=m==="y"?"bottom":"right",v=d+a[p],y=d-a[w];d=pt(v,d,y)}if(s){const p=u==="y"?"top":"left",w=u==="y"?"bottom":"right",v=h+a[p],y=h-a[w];h=pt(v,h,y)}const g=c.fn({...e,[m]:d,[u]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[m]:r,[u]:s}}}}}},ye=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:l=!0}=I(t,e),a={x:n,y:o},u=K(i),m=vt(u);let d=a[m],h=a[u];const g=I(c,e),p=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(f){const y=m==="y"?"height":"width",b=r.reference[m]-r.floating[y]+p.mainAxis,x=r.reference[m]+r.reference[y]-p.mainAxis;dx&&(d=x)}if(l){var w,v;const y=m==="y"?"width":"height",b=["top","left"].includes(Y(i)),x=r.reference[u]-r.floating[y]+(b&&((w=s.offset)==null?void 0:w[u])||0)+(b?0:p.crossAxis),O=r.reference[u]+r.reference[y]+(b?0:((v=s.offset)==null?void 0:v[u])||0)-(b?p.crossAxis:0);hO&&(h=O)}return{[m]:d,[u]:h}}}},ve=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:c}=e,{apply:f=()=>{},...l}=I(t,e),a=await Z(e,l),u=Y(i),m=et(i),d=K(i)==="y",{width:h,height:g}=r.floating;let p,w;u==="top"||u==="bottom"?(p=u,w=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=u,p=m==="end"?"top":"bottom");const v=g-a.top-a.bottom,y=h-a.left-a.right,b=U(g-a[p],v),x=U(h-a[w],y),O=!e.middlewareData.shift;let R=b,D=x;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=y),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(R=v),O&&!m){const P=F(a.left,0),B=F(a.right,0),T=F(a.top,0),L=F(a.bottom,0);d?D=h-2*(P!==0||B!==0?P+B:F(a.left,a.right)):R=g-2*(T!==0||L!==0?T+L:F(a.top,a.bottom))}await f({...e,availableWidth:D,availableHeight:R});const W=await s.getDimensions(c.floating);return h!==W.width||g!==W.height?{reset:{rects:!0}}:{}}}};function Vt(t){const e=H(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=_(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=st(n)!==r||st(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Rt(t){return V(t)?t:t.contextElement}function J(t){const e=Rt(t);if(!_(e))return N(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Vt(e);let s=(r?st(n.width):n.width)/o,c=(r?st(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const be=N(0);function Ht(t){const e=$(t);return!yt()||!e.visualViewport?be:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ae(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=N(1);e&&(o?V(o)&&(s=J(o)):s=J(t));const c=Ae(r,n,o)?Ht(r):N(0);let f=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,a=i.width/s.x,u=i.height/s.y;if(r){const m=$(r),d=o&&V(o)?$(o):o;let h=m,g=gt(h);for(;g&&o&&d!==h;){const p=J(g),w=g.getBoundingClientRect(),v=H(g),y=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*p.x,b=w.top+(g.clientTop+parseFloat(v.paddingTop))*p.y;f*=p.x,l*=p.y,a*=p.x,u*=p.y,f+=y,l+=b,h=$(g),g=gt(h)}}return lt({width:a,height:u,x:f,y:l})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:G(z(t)).left+n}function Nt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function Re(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=z(o),c=e?ut(e.floating):!1;if(o===s||c&&r)return n;let f={scrollLeft:0,scrollTop:0},l=N(1);const a=N(0),u=_(o);if((u||!u&&!r)&&((tt(o)!=="body"||ot(s))&&(f=dt(o)),_(o))){const d=G(o);l=J(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const m=s&&!u&&!r?Nt(s,f,!0):N(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+a.x+m.x,y:n.y*l.y-f.scrollTop*l.y+a.y+m.y}}function Oe(t){return Array.from(t.getClientRects())}function Ce(t){const e=z(t),n=dt(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Se(t,e){const n=$(t),o=z(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,f=0;if(i){r=i.width,s=i.height;const l=yt();(!l||l&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:r,height:s,x:c,y:f}}function Ee(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=_(t)?J(t):N(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,l=o*r.y;return{width:s,height:c,x:f,y:l}}function Tt(t,e,n){let o;if(e==="viewport")o=Se(t,n);else if(e==="document")o=Ce(z(t));else if(V(e))o=Ee(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return lt(o)}function _t(t,e){const n=X(t);return n===e||!V(n)||Q(n)?!1:H(n).position==="fixed"||_t(n,e)}function Pe(t,e){const n=e.get(t);if(n)return n;let o=nt(t,[],!1).filter(c=>V(c)&&tt(c)!=="body"),i=null;const r=H(t).position==="fixed";let s=r?X(t):t;for(;V(s)&&!Q(s);){const c=H(s),f=xt(s);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(s)&&!f&&_t(t,s))?o=o.filter(a=>a!==s):i=c,s=X(s)}return e.set(t,o),o}function De(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?ut(e)?[]:Pe(e,this._c):[].concat(n),o],c=s[0],f=s.reduce((l,a)=>{const u=Tt(e,a,i);return l.top=F(u.top,l.top),l.right=U(u.right,l.right),l.bottom=U(u.bottom,l.bottom),l.left=F(u.left,l.left),l},Tt(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Le(t){const{width:e,height:n}=Vt(t);return{width:e,height:n}}function Te(t,e,n){const o=_(e),i=z(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=N(0);if(o||!o&&!r)if((tt(e)!=="body"||ot(i))&&(c=dt(e)),o){const m=G(e,!0,r,e);f.x=m.x+e.clientLeft,f.y=m.y+e.clientTop}else i&&(f.x=Ot(i));const l=i&&!o&&!r?Nt(i,c):N(0),a=s.left+c.scrollLeft-f.x-l.x,u=s.top+c.scrollTop-f.y-l.y;return{x:a,y:u,width:s.width,height:s.height}}function mt(t){return H(t).position==="static"}function Mt(t,e){if(!_(t)||H(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return z(t)===n&&(n=n.ownerDocument.body),n}function zt(t,e){const n=$(t);if(ut(t))return n;if(!_(t)){let i=X(t);for(;i&&!Q(i);){if(V(i)&&!mt(i))return i;i=X(i)}return n}let o=Mt(t,e);for(;o&&Ut(o)&&mt(o);)o=Mt(o,e);return o&&Q(o)&&mt(o)&&!xt(o)?n:o||Zt(t)||n}const Me=async function(t){const e=this.getOffsetParent||zt,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ke(t){return H(t).direction==="rtl"}const Fe={convertOffsetParentRelativeRectToViewportRelativeRect:Re,getDocumentElement:z,getClippingRect:De,getOffsetParent:zt,getElementRects:Me,getClientRects:Oe,getDimensions:Le,getScale:J,isElement:V,isRTL:ke};function jt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $e(t,e){let n=null,o;const i=z(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const l=t.getBoundingClientRect(),{left:a,top:u,width:m,height:d}=l;if(c||e(),!m||!d)return;const h=it(u),g=it(i.clientWidth-(a+m)),p=it(i.clientHeight-(u+d)),w=it(a),y={rootMargin:-h+"px "+-g+"px "+-p+"px "+-w+"px",threshold:F(0,U(1,f))||1};let b=!0;function x(O){const R=O[0].intersectionRatio;if(R!==f){if(!b)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!jt(l,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(t)}return s(!0),r}function qe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,l=Rt(t),a=i||r?[...l?nt(l):[],...nt(e)]:[];a.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const u=l&&c?$e(l,n):null;let m=-1,d=null;s&&(d=new ResizeObserver(w=>{let[v]=w;v&&v.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=d)==null||y.observe(e)})),n()}),l&&!f&&d.observe(l),d.observe(e));let h,g=f?G(t):null;f&&p();function p(){const w=G(t);g&&!jt(g,w)&&n(),g=w,h=requestAnimationFrame(p)}return n(),()=>{var w;a.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),u==null||u(),(w=d)==null||w.disconnect(),d=null,f&&cancelAnimationFrame(h)}}const Xe=Z,We=we,Be=xe,Ve=he,He=ve,Ne=ge,kt=me,_e=ye,ze=(t,e,n)=>{const o=new Map,i={platform:Fe,...n},r={...i.platform,_c:o};return de(t,e,{...i,platform:r})};var rt=typeof document<"u"?S.useLayoutEffect:S.useEffect;function ft(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ft(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!ft(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function It(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(t,e){const n=It(t);return Math.round(e*n)/n}function ht(t){const e=S.useRef(t);return rt(()=>{e.current=t}),e}function Ue(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:c=!0,whileElementsMounted:f,open:l}=t,[a,u]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,d]=S.useState(o);ft(m,o)||d(o);const[h,g]=S.useState(null),[p,w]=S.useState(null),v=S.useCallback(A=>{A!==O.current&&(O.current=A,g(A))},[]),y=S.useCallback(A=>{A!==R.current&&(R.current=A,w(A))},[]),b=r||h,x=s||p,O=S.useRef(null),R=S.useRef(null),D=S.useRef(a),W=f!=null,P=ht(f),B=ht(i),T=ht(l),L=S.useCallback(()=>{if(!O.current||!R.current)return;const A={placement:e,strategy:n,middleware:m};B.current&&(A.platform=B.current),ze(O.current,R.current,A).then(k=>{const q={...k,isPositioned:T.current!==!1};C.current&&!ft(D.current,q)&&(D.current=q,Yt.flushSync(()=>{u(q)}))})},[m,e,n,B,T]);rt(()=>{l===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,u(A=>({...A,isPositioned:!1})))},[l]);const C=S.useRef(!1);rt(()=>(C.current=!0,()=>{C.current=!1}),[]),rt(()=>{if(b&&(O.current=b),x&&(R.current=x),b&&x){if(P.current)return P.current(b,x,L);L()}},[b,x,L,P,W]);const j=S.useMemo(()=>({reference:O,floating:R,setReference:v,setFloating:y}),[v,y]),E=S.useMemo(()=>({reference:b,floating:x}),[b,x]),M=S.useMemo(()=>{const A={position:n,left:0,top:0};if(!E.floating)return A;const k=Ft(E.floating,a.x),q=Ft(E.floating,a.y);return c?{...A,transform:"translate("+k+"px, "+q+"px)",...It(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:q}},[n,c,E.floating,a.x,a.y]);return S.useMemo(()=>({...a,update:L,refs:j,elements:E,floatingStyles:M}),[a,L,j,E,M])}const je=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?kt({element:o.current,padding:i}).fn(n):{}:o?kt({element:o,padding:i}).fn(n):{}}}},Ke=(t,e)=>({...We(t),options:[t,e]}),Ge=(t,e)=>({...Be(t),options:[t,e]}),Je=(t,e)=>({..._e(t),options:[t,e]}),Qe=(t,e)=>({...Ve(t),options:[t,e]}),Ze=(t,e)=>({...He(t),options:[t,e]}),tn=(t,e)=>({...Ne(t),options:[t,e]}),en=(t,e)=>({...je(t),options:[t,e]});export{U as a,Ze as b,qe as c,Xe as d,I as e,Qe as f,en as g,tn as h,V as i,Je as l,F as m,Ke as o,st as r,Ge as s,Ue as u};