import{e as S,a as _,ah as Ot,w as Q,A as Et,B as At,av as N,u as Tt}from"./EchoChannel-Dko4GTAA.js";const j=Math.min,F=Math.max,Y=Math.round,I=Math.floor,A=t=>({x:t,y:t});function ct(t,e,n){return F(t,j(e,n))}function et(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function gt(t){return t.split("-")[1]}function pt(t){return t==="x"?"y":"x"}function Lt(t){return t==="y"?"height":"width"}function U(t){return["top","bottom"].includes(q(t))?"y":"x"}function Dt(t){return pt(U(t))}function St(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vt(t){return typeof t!="number"?St(t):{top:t,right:t,bottom:t,left:t}}function X(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 ft(t,e,n){let{reference:o,floating:i}=t;const s=U(e),r=Dt(e),l=Lt(r),f=q(e),c=s==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/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(gt(e)){case"start":d[r]-=h*(n&&c?-1:1);break;case"end":d[r]+=h*(n&&c?-1:1);break}return d}const Ft=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:u}=ft(c,o,f),h=o,d={},g=0;for(let p=0;p<l.length;p++){const{name:w,fn:m}=l[p],{x:y,y:x,data:R,reset:v}=await m({x:a,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:d,rects:c,platform:r,elements:{reference:t,floating:e}});a=y??a,u=x??u,d={...d,[w]:{...d[w],...R}},v&&g<=50&&(g++,typeof v=="object"&&(v.placement&&(h=v.placement),v.rects&&(c=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:a,y:u}=ft(c,h,f)),p=-1)}return{x:a,y:u,placement:h,strategy:i,middlewareData:d}};async function Bt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:f}=t,{boundary:c="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=et(e,t),g=Vt(d),w=l[h?u==="floating"?"reference":"floating":u],m=X(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:a,strategy:f})),y=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),R=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=X(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:f}):y);return{top:(m.top-v.top+g.top)/R.y,bottom:(v.bottom-m.bottom+g.bottom)/R.y,left:(m.left-v.left+g.left)/R.x,right:(v.right-m.right+g.right)/R.x}}async function Mt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),l=gt(n),f=U(n)==="y",c=["left","top"].includes(r)?-1:1,a=s&&f?-1:1,u=et(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof g=="number"&&(d=l==="end"?g*-1:g),f?{x:d*a,y:h*c}:{x:h*c,y:d*a}}const Nt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=e,f=await Mt(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},Pt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:w=>{let{x:m,y}=w;return{x:m,y}}},...f}=et(t,e),c={x:n,y:o},a=await Bt(e,f),u=U(q(i)),h=pt(u);let d=c[h],g=c[u];if(s){const w=h==="y"?"top":"left",m=h==="y"?"bottom":"right",y=d+a[w],x=d-a[m];d=ct(y,d,x)}if(r){const w=u==="y"?"top":"left",m=u==="y"?"bottom":"right",y=g+a[w],x=g-a[m];g=ct(y,g,x)}const p=l.fn({...e,[h]:d,[u]:g});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:s,[u]:r}}}}}};function K(){return typeof window<"u"}function M(t){return nt(t)?(t.nodeName||"").toLowerCase():"#document"}function C(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function L(t){var e;return(e=(nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function nt(t){return K()?t instanceof Node||t instanceof C(t).Node:!1}function O(t){return K()?t instanceof Element||t instanceof C(t).Element:!1}function T(t){return K()?t instanceof HTMLElement||t instanceof C(t).HTMLElement:!1}function ut(t){return!K()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof C(t).ShadowRoot}function z(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Wt(t){return["table","td","th"].includes(M(t))}function G(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function ot(t){const e=it(),n=O(t)?E(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function kt(t){let e=V(t);for(;T(e)&&!W(e);){if(ot(e))return e;if(G(e))return null;e=V(e)}return null}function it(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function W(t){return["html","body","#document"].includes(M(t))}function E(t){return C(t).getComputedStyle(t)}function J(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if(M(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ut(t)&&t.host||L(t);return ut(e)?e.host:e}function wt(t){const e=V(t);return W(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&z(e)?e:wt(e)}function H(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=wt(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=C(i);if(s){const l=tt(r);return e.concat(r,r.visualViewport||[],z(i)?i:[],l&&n?H(l):[])}return e.concat(i,H(i,[],n))}function tt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=T(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,l=Y(n)!==s||Y(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function rt(t){return O(t)?t:t.contextElement}function P(t){const e=rt(t);if(!T(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=yt(e);let r=(s?Y(n.width):n.width)/o,l=(s?Y(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const _t=A(0);function xt(t){const e=C(t);return!it()||!e.visualViewport?_t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $t(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==C(t)?!1:e}function B(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=rt(t);let r=A(1);e&&(o?O(o)&&(r=P(o)):r=P(t));const l=$t(s,n,o)?xt(s):A(0);let f=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,a=i.width/r.x,u=i.height/r.y;if(s){const h=C(s),d=o&&O(o)?C(o):o;let g=h,p=tt(g);for(;p&&o&&d!==g;){const w=P(p),m=p.getBoundingClientRect(),y=E(p),x=m.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,R=m.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;f*=w.x,c*=w.y,a*=w.x,u*=w.y,f+=x,c+=R,g=C(p),p=tt(g)}}return X({width:a,height:u,x:f,y:c})}function st(t,e){const n=J(t).scrollLeft;return e?e.left+n:B(L(t)).left+n}function vt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:st(t,o)),s=o.top+e.scrollTop;return{x:i,y:s}}function Ht(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=L(o),l=e?G(e.floating):!1;if(o===r||l&&s)return n;let f={scrollLeft:0,scrollTop:0},c=A(1);const a=A(0),u=T(o);if((u||!u&&!s)&&((M(o)!=="body"||z(r))&&(f=J(o)),T(o))){const d=B(o);c=P(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const h=r&&!u&&!s?vt(r,f,!0):A(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+a.x+h.x,y:n.y*c.y-f.scrollTop*c.y+a.y+h.y}}function zt(t){return Array.from(t.getClientRects())}function It(t){const e=L(t),n=J(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+st(t);const l=-n.scrollTop;return E(o).direction==="rtl"&&(r+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}function jt(t,e){const n=C(t),o=L(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,f=0;if(i){s=i.width,r=i.height;const c=it();(!c||c&&e==="fixed")&&(l=i.offsetLeft,f=i.offsetTop)}return{width:s,height:r,x:l,y:f}}function Yt(t,e){const n=B(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=T(t)?P(t):A(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,f=i*s.x,c=o*s.y;return{width:r,height:l,x:f,y:c}}function at(t,e,n){let o;if(e==="viewport")o=jt(t,n);else if(e==="document")o=It(L(t));else if(O(e))o=Yt(e,n);else{const i=xt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return X(o)}function bt(t,e){const n=V(t);return n===e||!O(n)||W(n)?!1:E(n).position==="fixed"||bt(n,e)}function Xt(t,e){const n=e.get(t);if(n)return n;let o=H(t,[],!1).filter(l=>O(l)&&M(l)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?V(t):t;for(;O(r)&&!W(r);){const l=E(r),f=ot(r);!f&&l.position==="fixed"&&(i=null),(s?!f&&!i:!f&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||z(r)&&!f&&bt(t,r))?o=o.filter(a=>a!==r):i=l,r=V(r)}return e.set(t,o),o}function qt(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?G(e)?[]:Xt(e,this._c):[].concat(n),o],l=r[0],f=r.reduce((c,a)=>{const u=at(e,a,i);return c.top=F(u.top,c.top),c.right=j(u.right,c.right),c.bottom=j(u.bottom,c.bottom),c.left=F(u.left,c.left),c},at(e,l,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Ut(t){const{width:e,height:n}=yt(t);return{width:e,height:n}}function Kt(t,e,n){const o=T(e),i=L(e),s=n==="fixed",r=B(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const f=A(0);if(o||!o&&!s)if((M(e)!=="body"||z(i))&&(l=J(e)),o){const h=B(e,!0,s,e);f.x=h.x+e.clientLeft,f.y=h.y+e.clientTop}else i&&(f.x=st(i));const c=i&&!o&&!s?vt(i,l):A(0),a=r.left+l.scrollLeft-f.x-c.x,u=r.top+l.scrollTop-f.y-c.y;return{x:a,y:u,width:r.width,height:r.height}}function Z(t){return E(t).position==="static"}function dt(t,e){if(!T(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return L(t)===n&&(n=n.ownerDocument.body),n}function Rt(t,e){const n=C(t);if(G(t))return n;if(!T(t)){let i=V(t);for(;i&&!W(i);){if(O(i)&&!Z(i))return i;i=V(i)}return n}let o=dt(t,e);for(;o&&Wt(o)&&Z(o);)o=dt(o,e);return o&&W(o)&&Z(o)&&!ot(o)?n:o||kt(t)||n}const Gt=async function(t){const e=this.getOffsetParent||Rt,n=this.getDimensions,o=await n(t.floating);return{reference:Kt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Jt(t){return E(t).direction==="rtl"}const Qt={convertOffsetParentRelativeRectToViewportRelativeRect:Ht,getDocumentElement:L,getClippingRect:qt,getOffsetParent:Rt,getElementRects:Gt,getClientRects:zt,getDimensions:Ut,getScale:P,isElement:O,isRTL:Jt};function Zt(t,e){let n=null,o;const i=L(t);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),s();const{left:c,top:a,width:u,height:h}=t.getBoundingClientRect();if(l||e(),!u||!h)return;const d=I(a),g=I(i.clientWidth-(c+u)),p=I(i.clientHeight-(a+h)),w=I(c),y={rootMargin:-d+"px "+-g+"px "+-p+"px "+-w+"px",threshold:F(0,j(1,f))||1};let x=!0;function R(v){const k=v[0].intersectionRatio;if(k!==f){if(!x)return r();k?r(!1,k):o=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(R,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(R,y)}n.observe(t)}return r(!0),s}function oe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,c=rt(t),a=i||s?[...c?H(c):[],...H(e)]:[];a.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const u=c&&l?Zt(c,n):null;let h=-1,d=null;r&&(d=new ResizeObserver(m=>{let[y]=m;y&&y.target===c&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),c&&!f&&d.observe(c),d.observe(e));let g,p=f?B(t):null;f&&w();function w(){const m=B(t);p&&(m.x!==p.x||m.y!==p.y||m.width!==p.width||m.height!==p.height)&&n(),p=m,g=requestAnimationFrame(w)}return n(),()=>{var m;a.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),u==null||u(),(m=d)==null||m.disconnect(),d=null,f&&cancelAnimationFrame(g)}}const ie=Nt,re=Pt,te=(t,e,n)=>{const o=new Map,i={platform:Qt,...n},s={...i.platform,_c:o};return Ft(t,e,{...i,platform:s})};function ee(t){return t!=null&&typeof t=="object"&&"$el"in t}function ht(t){if(ee(t)){const e=t.$el;return nt(e)&&M(e)==="#comment"?null:e}return t}function $(t){return typeof t=="function"?t():Tt(t)}function Ct(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(t,e){const n=Ct(t);return Math.round(e*n)/n}function se(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=S(()=>{var b;return(b=$(n.open))!=null?b:!0}),s=S(()=>$(n.middleware)),r=S(()=>{var b;return(b=$(n.placement))!=null?b:"bottom"}),l=S(()=>{var b;return(b=$(n.strategy))!=null?b:"absolute"}),f=S(()=>{var b;return(b=$(n.transform))!=null?b:!0}),c=S(()=>ht(t.value)),a=S(()=>ht(e.value)),u=_(0),h=_(0),d=_(l.value),g=_(r.value),p=Ot({}),w=_(!1),m=S(()=>{const b={position:d.value,left:"0",top:"0"};if(!a.value)return b;const D=mt(a.value,u.value),lt=mt(a.value,h.value);return f.value?{...b,transform:"translate("+D+"px, "+lt+"px)",...Ct(a.value)>=1.5&&{willChange:"transform"}}:{position:d.value,left:D+"px",top:lt+"px"}});let y;function x(){if(c.value==null||a.value==null)return;const b=i.value;te(c.value,a.value,{middleware:s.value,placement:r.value,strategy:l.value}).then(D=>{u.value=D.x,h.value=D.y,d.value=D.strategy,g.value=D.placement,p.value=D.middlewareData,w.value=b!==!1})}function R(){typeof y=="function"&&(y(),y=void 0)}function v(){if(R(),o===void 0){x();return}if(c.value!=null&&a.value!=null){y=o(c.value,a.value,x);return}}function k(){i.value||(w.value=!1)}return Q([s,r,l,i],x,{flush:"sync"}),Q([c,a],v,{flush:"sync"}),Q(i,k,{flush:"sync"}),Et()&&At(R),{x:N(u),y:N(h),strategy:N(d),placement:N(g),middlewareData:N(p),isPositioned:N(w),floatingStyles:m,update:x}}export{oe as a,ie as o,re as s,se as u};