const t=Math.min,e=Math.max,n=Math.round,o=t=>({x:t,y:t});function i(t,e){return"function"==typeof t?t(e):t}function r(t){return t.split("-")[0]}function l(t){return t.split("-")[1]}function c(t){return"y"===t?"height":"width"}function s(t){return["top","bottom"].includes(r(t))?"y":"x"}function f(t){return"x"===s(t)?"y":"x"}function a(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function u(t,e,n){let{reference:o,floating:i}=t;const a=s(e),u=f(e),d=c(u),h=r(e),p="y"===a,m=o.x+o.width/2-i.width/2,y=o.y+o.height/2-i.height/2,g=o[d]/2-i[d]/2;let x;switch(h){case"top":x={x:m,y:o.y-i.height};break;case"bottom":x={x:m,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:y};break;case"left":x={x:o.x-i.width,y:y};break;default:x={x:o.x,y:o.y}}switch(l(e)){case"start":x[u]-=g*(n&&p?-1:1);break;case"end":x[u]+=g*(n&&p?-1:1)}return x}const d=n=>({name:"arrow",options:n,async fn(o){const{x:r,y:s,placement:a,rects:u,platform:d,elements:h,middlewareData:p}=o,{element:m,padding:y=0}=i(n,o)||{};if(null==m)return{};const g=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(y),x={x:r,y:s},w=f(a),b=c(w),v=await d.getDimensions(m),T="y"===w,L=T?"top":"left",R=T?"bottom":"right",E=T?"clientHeight":"clientWidth",D=u.reference[b]+u.reference[w]-x[w]-u.floating[b],C=x[w]-u.reference[w],S=await(null==d.getOffsetParent?void 0:d.getOffsetParent(m));let A=S?S[E]:0;A&&await(null==d.isElement?void 0:d.isElement(S))||(A=h.floating[E]||u.floating[b]);const H=D/2-C/2,W=A/2-v[b]/2-1,k=t(g[L],W),O=t(g[R],W),F=k,P=A-v[b]-O,V=A/2-v[b]/2+H,M=e(F,t(V,P));const N=!p.arrow&&null!=l(a)&&V!=M&&u.reference[b]/2-(V(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function R(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function E(t){return["html","body","#document"].includes(p(t))}function D(t){return m(t).getComputedStyle(t)}function C(t){return x(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function S(t){if("html"===p(t))return t;const e=t.assignedSlot||t.parentNode||b(t)&&t.host||y(t);return b(e)?e.host:e}function A(t){const e=S(t);return E(e)?t.ownerDocument?t.ownerDocument.body:t.body:w(e)&&v(e)?e:A(e)}function H(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=A(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=m(i);return r?e.concat(l,l.visualViewport||[],v(i)?i:[],l.frameElement&&n?H(l.frameElement):[]):e.concat(i,H(i,[],n))}function W(t){const e=D(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=w(t),l=r?t.offsetWidth:o,c=r?t.offsetHeight:i,s=n(o)!==l||n(i)!==c;return s&&(o=l,i=c),{width:o,height:i,$:s}}function k(t){return x(t)?t:t.contextElement}function O(t){const e=k(t);if(!w(e))return o(1);const i=e.getBoundingClientRect(),{width:r,height:l,$:c}=W(e);let s=(c?n(i.width):i.width)/r,f=(c?n(i.height):i.height)/l;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const F=o(0);function P(t){const e=m(t);return R()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:F}function V(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),l=k(t);let c=o(1);e&&(i?x(i)&&(c=O(i)):c=O(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==m(t))&&e}(l,n,i)?P(l):o(0);let f=(r.left+s.x)/c.x,u=(r.top+s.y)/c.y,d=r.width/c.x,h=r.height/c.y;if(l){const t=m(l),e=i&&x(i)?m(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=O(n),e=n.getBoundingClientRect(),o=D(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,d*=t.x,h*=t.y,f+=i,u+=r,n=m(n).frameElement}}return a({width:d,height:h,x:f,y:u})}function M(t){return V(y(t)).left+C(t).scrollLeft}function N(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=m(t),o=y(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,s=0;if(i){r=i.width,l=i.height;const t=R();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}return{width:r,height:l,x:c,y:s}}(t,i);else if("document"===n)r=function(t){const n=y(t),o=C(t),i=t.ownerDocument.body,r=e(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),l=e(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let c=-o.scrollLeft+M(t);const s=-o.scrollTop;return"rtl"===D(i).direction&&(c+=e(n.clientWidth,i.clientWidth)-r),{width:r,height:l,x:c,y:s}}(y(t));else if(x(n))r=function(t,e){const n=V(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,l=w(t)?O(t):o(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:r*l.x,y:i*l.y}}(n,i);else{const e=P(t);r={...n,x:n.x-e.x,y:n.y-e.y}}return a(r)}function B(t,e){const n=S(t);return!(n===e||!x(n)||E(n))&&("fixed"===D(n).position||B(n,e))}function X(t,e,n){const i=w(e),r=y(e),l="fixed"===n,c=V(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const f=o(0);if(i||!i&&!l)if(("body"!==p(e)||v(r))&&(s=C(e)),i){const t=V(e,!0,l,e);f.x=t.x+e.clientLeft,f.y=t.y+e.clientTop}else r&&(f.x=M(r));return{x:c.left+s.scrollLeft-f.x,y:c.top+s.scrollTop-f.y,width:c.width,height:c.height}}function Y(t,e){return w(t)&&"fixed"!==D(t).position?e?e(t):t.offsetParent:null}function $(t,e){const n=m(t);if(!w(t))return n;let o=Y(t,e);for(;o&&T(o)&&"static"===D(o).position;)o=Y(o,e);return o&&("html"===p(o)||"body"===p(o)&&"static"===D(o).position&&!L(o))?n:o||function(t){let e=S(t);for(;w(e)&&!E(e);){if(L(e))return e;e=S(e)}return null}(t)||n}const _={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:i}=t;const r=w(n),l=y(n);if(n===l)return e;let c={scrollLeft:0,scrollTop:0},s=o(1);const f=o(0);if((r||!r&&"fixed"!==i)&&(("body"!==p(n)||v(l))&&(c=C(n)),w(n))){const t=V(n);s=O(n),f.x=t.x+n.clientLeft,f.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-c.scrollLeft*s.x+f.x,y:e.y*s.y-c.scrollTop*s.y+f.y}},getDocumentElement:y,getClippingRect:function(n){let{element:o,boundary:i,rootBoundary:r,strategy:l}=n;const c=[..."clippingAncestors"===i?function(t,e){const n=e.get(t);if(n)return n;let o=H(t,[],!1).filter((t=>x(t)&&"body"!==p(t))),i=null;const r="fixed"===D(t).position;let l=r?S(t):t;for(;x(l)&&!E(l);){const e=D(l),n=L(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||v(l)&&!n&&B(t,l))?o=o.filter((t=>t!==l)):i=e,l=S(l)}return e.set(t,o),o}(o,this._c):[].concat(i),r],s=c[0],f=c.reduce(((n,i)=>{const r=N(o,i,l);return n.top=e(r.top,n.top),n.right=t(r.right,n.right),n.bottom=t(r.bottom,n.bottom),n.left=e(r.left,n.left),n}),N(o,s,l));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}},getOffsetParent:$,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||$,r=this.getDimensions;return{reference:X(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return W(t)},getScale:O,isElement:x,isRTL:function(t){return"rtl"===D(t).direction}},j=(t,e,n)=>{const o=new Map,i={platform:_,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:d}=u(f,o,s),h=o,p={},m=0;for(let y=0;y