PageSourceSearch

https://scorearena.ai/assets/usePositioner-Cqo2kPgc.js

js scorearena.ai collected 2026-10-05 12:40:27 UTC 40,192 bytes, 2 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`db357998827731f579117c18106ac9cc83790610`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`f9a8063a-7015-4bd0-9b2e-87bdd27d670b`,e._sentryDebugIdIdentifier=`sentry-dbid-f9a8063a-7015-4bd0-9b2e-87bdd27d670b`)}catch{}})();import{o as e,t}from"./rolldown-runtime-rbWvZT1-.js";import{nr as n}from"./reportSchemaMismatch-nTruHsLl.js";import{t as r}from"./react-dom-QqEwHCkG.js";import{$n as i,An as a,Bn as o,Bt as s,Ct as c,Dt as l,Et as u,Fn as d,Ft as f,Gn as p,H as m,Hn as h,In as g,Jn as _,Jt as v,Kn as y,Ln as b,Lt as x,Nn as S,Nt as C,Ot as w,Pn as T,Pt as E,Q as D,Qn as O,Rn as k,Rt as A,St as j,Tt as M,Un as N,V as P,Vn as F,Vt as ee,Wn as I,Xn as te,Xt as ne,Yn as L,Yt as R,Z as z,Zn as re,_r as B,_t as ie,an as ae,bt as oe,cn as se,dt as V,ft as H,gt as ce,hr as le,ht as ue,jn as U,ln as W,mr as de,mt as G,nn as fe,on as pe,pt as me,q as he,qn as K,qt as ge,sn as _e,un as q,ur as ve,ut as ye,vt as be,wt as J,xt as xe,yt as Y,zn as Se}from"./useScrollLock-DWOZDGjH.js";function Ce(e){return W(e,`base-ui`)}var X=e(n(),1);function we(e,t){return t!=null&&!ne(t)?0:typeof e==`function`?e():e}function Z(e,t,n){let r=we(e,n);return typeof r==`number`?r:r?.[t]}function Te(e){return typeof e==`function`?e():e}function Ee(e,t){return t||e===`click`||e===`mousedown`}function Q(e){return e?.includes(`mouse`)&&e!==`mousedown`}var De=e(r(),1);function Oe(e,t,n){let{reference:r,floating:i}=e,a=J(t),o=ue(t),s=ie(o),l=c(t),u=a===`y`,d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2,m;switch(l){case`top`:m={x:d,y:r.y-i.height};break;case`bottom`:m={x:d,y:r.y+r.height};break;case`right`:m={x:r.x+r.width,y:f};break;case`left`:m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}let h=G(t);return h&&(m[o]+=p*(h===`end`?1:-1)*(n&&u?-1:1)),m}async function ke(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=H(t,e),m=j(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=l(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:s})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=l(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:s}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var Ae=50,je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ke},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oe(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ae&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oe(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Me=e=>({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:d=0}=H(e,t)||{};if(l==null)return{};let f=j(d),p={x:n,y:r},m=ue(i),h=ie(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),w=C?C[b]:0;
1(!w||!await(o.isElement==null?void 0:o.isElement(C)))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=u(f[v],E),O=u(f[y],E),k=w-g[h]-O,A=w/2-g[h]/2+T,M=ye(D,A,k),N=!c.arrow&&G(i)!=null&&A!==M&&a.reference[h]/2-(A<D?D:O)-g[h]/2<0,P=N?A<D?A-D:A-k:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:A-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Ne=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=H(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let _=c(r),v=J(o),y=c(o)===o,b=await(s.isRTL==null?void 0:s.isRTL(l.floating)),x=f||(y||!h?[xe(o)]:be(o)),S=m!==`none`;!f&&S&&x.push(...oe(o,h,m,b));let C=[o,...x],w=await s.detectOverflow(t,g),T=[],E=i.flip?.overflows||[];if(u&&T.push(w[_]),d){let e=ce(r,a,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:r,overflows:T}],!T.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=C[e];if(t&&(d!==`alignment`||v===J(t)||E.every(e=>J(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(p){case`bestFit`:{let e=E.filter(e=>{if(S){let t=J(e.placement);return t===v||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}if(r!==n)return{reset:{placement:n}}}return{}}}},Pe=new Set([`left`,`top`]);async function Fe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),s=G(n),l=J(n)===`y`,u=Pe.has(o)?-1:1,d=a&&l?-1:1,f=H(t,e),{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof f==`number`?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h==`number`&&(m=s===`end`?h*-1:h),l?{x:m*d,y:p*u}:{x:p*u,y:m*d}}var Ie=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 Fe(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}}}}},Le=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}=H(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=J(i),p=Y(f),m=u[p],h=u[f],g=(e,t)=>ye(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}}}}}},Re=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:l=!0,crossAxis:u=!0}=H(e,t),d={x:n,y:r},f=J(i),p=Y(f),m=d[p],h=d[f],g=H(s,t),_=typeof g==`number`?{mainAxis:g,crossAxis:0}:{mainAxis:g.mainAxis??0,crossAxis:g.crossAxis??0};if(l){let e=p===`y`?`height`:`width`,t=a.reference[p]-a.floating[e]+_.mainAxis,n=a.reference[p]+a.reference[e]-_.mainAxis;m<t?m=t:m>n&&(m=n)}if(u){let e=p===`y`?`width`:`height`,t=Pe.has(c(i)),n=a.reference[f]-a.floating[e]+(t&&o.offset?.[f]||0)+(t?0:_.crossAxis),r=a.reference[f]+a.reference[e]+(t?0:o.offset?.[f]||0)-(t?_.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:m,[f]:h}}}},ze=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}=H(e,t),l=await i.detectOverflow(t,s),d=c(n),f=G(n),p=J(n)===`y`,{width:m,height:h}=r.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-l.top-l.bottom,y=m-l.left-l.right,b=u(h-l[g],v),x=u(m-l[_],y),S=t.middlewareData.shift,C=!S,w=b,T=x;S!=null&&S.enabled.x&&(T=y),S!=null&&S.enabled.y&&(w=v),C&&!f&&(p?T=m-2*M(l.left,l.right):w=h-2*M(l.top,l.bottom)),await o({...t,availableWidth:T,availableHeight:w});let E=await i.getDimensions(a.floating);return m!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function Be(e){let t=g(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=w(n)!==a||w(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ve(e){return y(e)?e:e.contextElement}function He(e){let t=Ve(e);if(!K(t))return V(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Be(t),o=(a?w(n.width):n.width)/r,s=(a?w(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ue=V(0);function We(e){let t=I(e);
vendor: 5,750 bytes, line 1
1return!O()||!t.visualViewport?Ue:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ge(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===I(e)}function Ke(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ve(e),o=V(1);t&&(r?y(r)&&(o=He(r)):o=He(e));let s=Ge(a,n,r)?We(a):V(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a&&r){let e=I(a),t=y(r)?I(r):r,n=e,i=Se(n);for(;i&&t!==n;){let e=He(i),t=i.getBoundingClientRect(),r=g(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=I(i),i=Se(n)}}return l({width:d,height:f,x:c,y:u})}function qe(e,t){let n=F(e).scrollLeft;return t?t.left+n:Ke(k(e)).left+n}function Je(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qe(e,n),y:n.top+t.scrollTop}}function Ye(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,s=k(r),c=t?re(t.floating):!1;if(r===s||c&&a)return n;let l={scrollLeft:0,scrollTop:0},u=V(1),d=V(0),f=K(r);if((f||!a)&&((o(r)!==`body`||L(s))&&(l=F(r)),f)){let e=Ke(r);u=He(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!a?Je(s,l):V(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Xe(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ze(e){let t=F(e),n=e.ownerDocument.body,r=M(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=M(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+qe(e),o=-t.scrollTop;return g(n).direction===`rtl`&&(a+=M(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Qe=25;function $e(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=I(e),a=k(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!O()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(qe(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<=Qe&&(s-=o)}return{width:s,height:c,x:l,y:u}}function et(e,t){let n=Ke(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=He(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function tt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=$e(e,n,t);else if(t===`document`)r=Ze(k(e));else if(y(t))r=et(t,n);else{let n=We(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return l(r)}function nt(e,t){let n=t.get(e);if(n)return n;let r=h(e,[],!1).filter(e=>y(e)&&o(e)!==`body`),i=null,a=g(e).position===`fixed`,s=a?N(e):e;for(;y(s)&&!_(s);){let e=g(s),t=p(s),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==s):i=e,s=N(s)}return t.set(e,r),r}function rt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?re(t)?[]:nt(t,this._c):[].concat(n),r],o=tt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=tt(t,a[e],i);s=M(n.top,s),c=u(n.right,c),l=u(n.bottom,l),d=M(n.left,d)}return{width:c-d,height:l-s,x:d,y:s}}function it(e){let{width:t,height:n}=Be(e);return{width:t,height:n}}function at(e,t,n){let r=K(t),i=k(t),a=n===`fixed`,s=Ke(e,!0,a,t),c={scrollLeft:0,scrollTop:0},l=V(0);if((r||!a)&&((o(t)!==`body`||L(i))&&(c=F(t)),r)){let e=Ke(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!r&&i&&(l.x=qe(i));let u=i&&!r&&!a?Je(i,c):V(0);return{x:s.left+c.scrollLeft-l.x-u.x,y:s.top+c.scrollTop-l.y-u.y,width:s.width,height:s.height}}function ot(e){return g(e).position===`static`}function st(e,t){if(!K(e)||g(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function ct(e,t){let n=I(e);if(re(e))return n;if(!K(e)){let t=N(e);for(;t&&!_(t);){if(y(t)&&!ot(t))return t;t=N(t)}return n}let r=st(e,t);for(;r&&te(r)&&ot(r);)r=st(r,t);return r&&_(r)&&ot(r)&&!p(r)?n:r||b(e)||n}var lt=async function(e){let t=this.getOffsetParent||ct,n=this.getDimensions,r=await n(e.floating);return{reference:at(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ut(e){return g(e).direction===`rtl`}var dt={convertOffsetParentRelativeRectToViewportRelativeRect:Ye,getDocumentElement:k,getClippingRect:rt,getOffsetParent:ct,getElementRects:lt,getClientRects:Xe,getDimensions:it,getScale:He,isElement:y,isRTL:ut};function ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pt(e,t,n){let r=null,i,a=k(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=l;if(n||t(),!p||!m)return;let h=me(f),g=me(a.clientWidth-(d+p)),_=me(a.clientHeight-(f+m)),v=me(d),y={rootMargin:-h+`px `+-g+`px `+-_+`px `+-v+`px`,threshold:M(0,u(1,c))||1},b=!0;function x(t){let n=t[0].intersectionRatio;if(!ft(l,e.getBoundingClientRect()))return s();if(n!==c){if(!b)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(x,{...y,root:a.ownerDocument})}catch{r=new IntersectionObserver(x,y)}r.observe(e)}let c=I(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function mt(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=Ve(e),u=i||a?[...l?h(l):[],...t?h(t):[]]:[];
1u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?pt(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,g=c?Ke(e):null;c&&_();function _(){let t=Ke(e);g&&!ft(g,t)&&n(),g=t,m=requestAnimationFrame(_)}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 ht=Ie,gt=Le,_t=Ne,vt=ze,yt=Me,bt=Re,xt=(e,t,n)=>{let r=new Map,i=n??{},a={...dt,...i.platform,_c:r};return je(e,t,{...i,platform:a})},St=typeof document<`u`?X.useLayoutEffect:function(){};function Ct(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(!Ct(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)&&!Ct(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tt(e,t){let n=wt(e);return Math.round(t*n)/n}function Et(e){let t=X.useRef(e);return St(()=>{t.current=e}),t}function Dt(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]=X.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=X.useState(r);Ct(f,r)||p(r);let[m,h]=X.useState(null),[g,_]=X.useState(null),v=X.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=X.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=X.useRef(null),C=X.useRef(null),w=X.useRef(u),T=c!=null,E=Et(c),D=Et(i),O=Et(l),k=X.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),xt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ct(w.current,t)&&(w.current=t,De.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);St(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=X.useRef(!1);St(()=>(A.current=!0,()=>{A.current=!1}),[]),St(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=X.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=X.useMemo(()=>({reference:b,floating:x}),[b,x]),N=X.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Tt(M.floating,u.x),r=Tt(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return X.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ot=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?{}:yt({element:r.current,padding:i}).fn(n):r?yt({element:r,padding:i}).fn(n):{}}}},kt=(e,t)=>{let n=ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},At=(e,t)=>{let n=gt(e);return{name:n.name,fn:n.fn,options:[e,t]}},jt=(e,t)=>({fn:bt(e).fn,options:[e,t]}),Mt=(e,t)=>{let n=_t(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nt=(e,t)=>{let n=vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ft=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),It=t(((e,t)=>{t.exports=Ft()}))();function Lt(e){let t=X.useCallback(t=>e===void 0?le:e.subscribeStore(t),[e]),n=X.useCallback(()=>e===void 0?void 0:e.store,[e]);
1return(0,It.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Rt(e){return zt(e,e.rootContext)}function zt(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=X.useState(null),[d,f]=X.useState(void 0),[p,h]=X.useState(void 0),g=X.useRef(null),_=m(r),v=X.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),b=Dt({...e,elements:{...v,...l&&{reference:l}}}),x=y(d)?d:null,S=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:x),t.useSyncedValue(`floatingElement`,S);let C=X.useCallback(e=>{let t=y(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),b.refs.setReference(t)},[b.refs]),w=X.useCallback(e=>{(y(e)||e===null)&&(g.current=e,f(e)),(y(b.refs.reference.current)||b.refs.reference.current===null||e!==null&&!y(e))&&b.refs.setReference(e)},[b.refs,f]),E=X.useCallback(e=>{h(e),b.refs.setFloating(e)},[b.refs]),D=X.useMemo(()=>({...b.refs,setReference:w,setFloating:E,setPositionReference:C,domReference:g}),[b.refs,w,E,C]),O=X.useMemo(()=>({...b.elements,domReference:o}),[b.elements,o]),k=X.useMemo(()=>({...b,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:D,elements:O,nodeId:n,rootStore:t}),[b,D,O,n,t,s,c]);return T(()=>{o&&(g.current=o)},[o]),T(()=>{t.context.dataRef.current.floatingContext=k;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=k)}),X.useMemo(()=>({...b,context:k,refs:D,elements:O,rootStore:t}),[b,D,O,k,t])}var Bt=ae&&fe;function Vt(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:o,dataRef:c}=i.context,l=X.useRef(!1),u=X.useRef(null),d=X.useRef(!0),p=_e();X.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=I(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&K(e)&&e===ge(S(e))&&(l.current=!0,u.current=e)}function a(){d.current=!0}function o(){d.current=!1}return E(f(t,`blur`,r),Bt&&f(t,`keydown`,a,!0),Bt&&f(t,`pointerdown`,o,!0))},[i,n]),X.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);y(e)&&(u.current=e,l.current=!0)}}return o.on(`openchange`,e),()=>{o.off(`openchange`,e)}},[o,n,i]);let m=X.useMemo(()=>{function e(){l.current=!1,u.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(l.current){if(u.current===n)return;e()}let o=R(t.nativeEvent);if(y(o)){if(Bt&&!t.relatedTarget){if(!d.current&&!s(o))return}else if(!ee(o))return}let c=A(t.relatedTarget,i.context.triggerElements),{nativeEvent:f,currentTarget:m}=t,h=typeof r==`function`?r():r;if(i.select(`open`)&&c||h===0||h===void 0){i.setOpen(!0,q(a,f,m));return}p.start(h,()=>{l.current||i.setOpen(!0,q(a,f,m))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,o=y(n)&&n.hasAttribute(z(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;p.start(0,()=>{let e=i.select(`domReferenceElement`),t=ge(S(e));!n&&t===e||v(c.current.floatingContext?.refs.floating.current,t)||v(e,t)||o||A(n??t,i.context.triggerElements)||i.setOpen(!1,q(a,r))})}}},[c,r,i,p]);return X.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}var Ht=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new pe,this.restTimeout=new pe,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ut=new WeakMap;function Wt(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ut.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ut.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Gt(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ut.get(n);a&&a!==e&&Wt(a),Wt(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ut.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Kt(e){let t=e.context.dataRef.current,n=B(()=>t.hoverInteractionState??Ht.create()).current;return t.hoverInteractionState||=n,se(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function qt(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.use
1State(`domReferenceElement`),{dataRef:l}=a.context,u=m(),p=P(),h=Kt(a),g=_e(),_=d(()=>Ee(l.current.openEvent?.type,h.interactedInside)),b=d(()=>Q(l.current.openEvent?.type)),C=d(()=>{Wt(h)});T(()=>{o||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,C())},[o,h,C]),X.useEffect(()=>C,[C]),T(()=>{if(n&&o&&h.handleCloseOptions?.blockPointerEvents&&b()&&y(c)&&s){let e=c,t=s,n=S(s),r=u?.nodesRef.current.find(e=>e.id===p)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=h.pointerEventsScopeElement===t?null:h.pointerEventsScopeElement,a=r===t?null:r,o=h.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return Gt(h,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{C()}}},[n,o,c,s,h,b,u,p,C]),X.useEffect(()=>{if(!n)return;function e(){return!!(u&&p&&D(u.nodesRef.current,p).length>0)}function t(e){let t=Z(r,`close`,h.pointerType),n=()=>{a.setOpen(!1,q(U,e)),u?.events.emit(`floating.closed`,e)};t?h.openChangeTimeout.start(t,n):(h.openChangeTimeout.clear(),n())}function o(e){let t=R(e);if(!x(t)){h.interactedInside=!1;return}h.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){h.openChangeTimeout.clear(),g.clear(),u?.events.off(`floating.closed`,m),C()}function d(n){if(e()&&u){u.events.on(`floating.closed`,m);return}if(A(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&y(o)&&D(u.nodesRef.current,r,!1).some(e=>v(e.context?.elements.floating,o)))){if(h.handler){h.handler(n);return}C(),b()&&!_()&&t(n)}}function m(t){!u||!p||e()||g.start(0,()=>{u.events.off(`floating.closed`,m),a.setOpen(!1,q(U,t)),u.events.emit(`floating.closed`,t)})}let S=s;return E(S&&f(S,`mouseenter`,c),S&&f(S,`mouseleave`,d),S&&f(S,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,m)})},[n,s,a,l,r,i,b,_,C,h,u,p,g])}var Jt={current:null};function Yt(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Jt,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:p,isClosing:h,shouldOpen:g,guardStaleOpen:_=!1}=t,b=`rootStore`in e?e.rootStore:e,{dataRef:x,events:w}=b.context,T=m(l),D=Kt(b),O=X.useRef(!1),k=C(i),j=C(r),M=C(o),N=C(n),P=C(g),F=C(h),ee=d(()=>Ee(x.current.openEvent?.type,D.interactedInside)),I=d(()=>P.current?.()!==!1),te=d((e,t,n)=>{let r=b.context.triggerElements;if(r.hasElement(t))return!e||!v(e,t);if(!y(n))return!1;let i=n;return r.hasMatchingElement(e=>v(e,i))&&(!e||!v(e,i))}),L=d(()=>{D.handler&&=(S(b.select(`domReferenceElement`)).removeEventListener(`mousemove`,D.handler),void 0)}),z=d(()=>{Wt(D)});return u&&(D.handleCloseOptions=i?.__options),X.useEffect(()=>L,[L]),X.useEffect(()=>{if(!n)return;function e(e){e.open?O.current=!1:(O.current=e.reason===U,L(),D.openChangeTimeout.clear(),D.restTimeout.clear(),D.blockMouseMove=!0,D.restTimeoutPending=!1)}return w.on(`openchange`,e),()=>{w.off(`openchange`,e)}},[n,w,D,L]),X.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Z(j.current,`close`,D.pointerType);n?D.openChangeTimeout.start(n,()=>{b.setOpen(!1,q(U,e)),T?.events.emit(`floating.closed`,e)}):t&&(D.openChangeTimeout.clear(),b.setOpen(!1,q(U,e)),T?.events.emit(`floating.closed`,e))}let t=c.current??(u?b.select(`domReferenceElement`):null);if(!y(t))return;function r(e){if(D.openChangeTimeout.clear(),D.blockMouseMove=!1,a&&!ne(D.pointerType))return;let t=Te(M.current),n=Z(j.current,`open`,D.pointerType),r=R(e),i=e.currentTarget??null,o=b.select(`domReferenceElement`),s=i;if(y(r)&&!b.context.triggerElements.hasElement(r)){for(let e of b.context.triggerElements.elements())if(v(e,r)){s=e;break}}y(i)&&y(o)&&!b.context.triggerElements.hasElement(i)&&v(i,o)&&(s=o);let c=s!=null&&te(o,s,r),l=b.select(`open`),u=F.current?.()??b.select(`transitionStatus`)===`ending`,d=!l&&u&&O.current,f=!c&&y(s)&&y(o)&&v(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,h=!l||c;if(m){I()&&b.setOpen(!0,q(U,e,s));return}p||(n?D.openChangeTimeout.start(n,()=>{h&&I()&&b.setOpen(!0,q(U,e,s))}):h&&I()&&b.setOpen(!0,q(U,e,s)))}function i(t){if(ee()){z();return}L();let n=b.select(`domReferenceElement`),r=S(n);D.restTimeout.clear(),D.restTimeoutPending=!1;let i=x.current.floatingContext??p?.();if(!A(t.relatedTarget,b.context.triggerElements)){if(k.current&&i){b.select(`open`)||D.openChangeTimeout.clear();let n=c.current;
1D.handler=k.current({...i,tree:T,x:t.clientX,y:t.clientY,onClose(){z(),L(),N.current&&!ee()&&n===b.select(`domReferenceElement`)&&e(t,!0)}}),r.addEventListener(`mousemove`,D.handler),D.handler(t);return}(D.pointerType!==`touch`||!v(b.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){v(t,e.relatedTarget)||(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1)}let l=_?f(t,`mouseout`,o):void 0;return s?E(f(t,`mousemove`,r,{once:!0}),f(t,`mouseenter`,r),f(t,`mouseleave`,i),l):E(f(t,`mouseenter`,r),f(t,`mouseleave`,i),l)},[L,z,x,j,b,n,k,D,u,te,ee,a,s,M,c,T,N,p,F,I,_]),X.useMemo(()=>{if(!n)return;function e(e){D.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=b.select(`domReferenceElement`),i=b.select(`open`),o=te(r,n,e.target);if(a&&!ne(D.pointerType))return;if(i&&o&&D.handleCloseOptions?.blockPointerEvents){let e=b.select(`floatingElement`);if(e){let t=D.handleCloseOptions?.getScope?.()??n.ownerDocument.body;Gt(D,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Te(M.current);if(i&&!o||s===0||!o&&D.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;D.restTimeout.clear();function c(){if(D.restTimeoutPending=!1,ee())return;let e=b.select(`open`);!D.blockMouseMove&&(!e||o)&&I()&&b.setOpen(!0,q(U,t,n))}D.pointerType===`touch`?De.flushSync(()=>{c()}):o&&i?c():(D.restTimeoutPending=!0,D.restTimeout.start(s,c))}}},[n,D,ee,te,a,b,M,I])}var Xt=.1,Zt=Xt*Xt,$=.5;function Qt(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function $t(e,t,n,r,i,a,o,s,c,l){let u=!1;return Qt(e,t,n,r,i,a)&&(u=!u),Qt(e,t,i,a,o,s)&&(u=!u),Qt(e,t,o,s,c,l)&&(u=!u),Qt(e,t,c,l,n,r)&&(u=!u),u}function en(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function tn(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function nn(e={}){let{blockPointerEvents:t=!1}=e,n=new pe,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Zt;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=R(r),g=r.type===`mouseleave`,_=v(u,h),b=v(a,h);if(_&&(l=!0,!g))return;if(b&&(l=!1,!g)){l=!0;return}if(g&&y(r.relatedTarget)&&v(u,r.relatedTarget))return;function x(){return!!(s&&D(s.nodesRef.current,o).length>0)}function S(){x()||m()}if(x())return;let C=a.getBoundingClientRect(),w=u.getBoundingClientRect(),T=e>w.right-w.width/2,E=t>w.bottom-w.height/2,O=w.width>C.width,k=w.height>C.height,A=(O?C:w).left,j=(O?C:w).right,M=(k?C:w).top,N=(k?C:w).bottom;if(c===`top`&&t>=C.bottom-1||c===`bottom`&&t<=C.top+1||c===`left`&&e>=C.right-1||c===`right`&&e<=C.left+1){S();return}let P=!1;switch(c){case`top`:P=tn(d,f,A,C.top+1,j,w.bottom-1);break;case`bottom`:P=tn(d,f,A,w.top+1,j,C.bottom-1);break;case`left`:P=tn(d,f,w.right-1,N,C.left+1,M);break;case`right`:P=tn(d,f,C.right-1,N,w.left+1,M)}if(P)return;if(l&&!en(d,f,C)){S();return}if(!g&&p(d,f)){S();return}let F=!1;switch(c){case`top`:{let n=O?$/2:$*4,r=O||T?e+n:e-n,i=O?e-n:T?e+n:e-n,a=t+$+1,o=T||O?w.bottom-$:w.top,s=T?O?w.bottom-$:w.top:w.bottom-$;F=$t(d,f,r,a,i,a,w.left,o,w.right,s);break}case`bottom`:{let n=O?$/2:$*4,r=O||T?e+n:e-n,i=O?e-n:T?e+n:e-n,a=t-$,o=T||O?w.top+$:w.bottom,s=T?O?w.top+$:w.bottom:w.top+$;F=$t(d,f,r,a,i,a,w.left,o,w.right,s);break}case`left`:{let n=k?$/2:$*4,r=k||E?t+n:t-n,i=k?t-n:E?t+n:t-n,a=e+$+1,o=E||k?w.right-$:w.left,s=E?k?w.right-$:w.left:w.right-$;F=$t(d,f,o,w.top,s,w.bottom,a,r,a,i);break}case`right`:{let n=k?$/2:$*4,r=k||E?t+n:t-n,i=k?t-n:E?t+n:t-n,a=e-$,o=E||k?w.left+$:w.right,s=E?k?w.left+$:w.right:w.left+$;F=$t(d,f,a,r,a,i,o,w.top,s,w.bottom);break}}F?l||n.start(40,S):S()}};return r.__options={...e,blockPointerEvents:t},r}var rn=X.createContext(void 0);function an(){return X.useContext(rn)?.direction??`ltr`}var on=e=>({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,offsetParent:d=`real`}=H(e,t)||{};if(l==null)return{};let f=j(u),p={x:n,y:r},m=ue(i),h=ie(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,M=w/2-g[h]/2+T,N=ye(k,M,A),P=!c.arrow&&G(i)!=null&&M!==N&&a.reference[h]/2-(M<k?D:O)-g[h]/2<0,F=P?M<k?M-k:M-A:0;
1return{[m]:p[m]+F,data:{[m]:N,centerOffset:M-N-F,...P&&{alignmentOffset:F}},reset:P}}}),sn=(e,t)=>{let{name:n,fn:r}=on(e);return{name:n,fn:r,options:[e,t]}},cn={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ln={sideX:`left`,sideY:`top`},un=`--available-width`,dn=`--available-height`,fn=`--anchor-width`,pn=`--anchor-height`,mn=`--transform-origin`,hn=`--positioner-width`,gn=`--positioner-height`,_n=un,vn=dn;function yn(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function bn(e,t,n){let{rects:r,placement:i}=e;return{side:yn(t,c(i),n),align:G(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function xn(e){return Sn(e,Rt)}function Sn(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:h,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:D}=e,[O,k]=X.useState(null);!v&&O!==null&&k(null);let A=y.side||`flip`,j=y.align||`flip`,M=y.fallbackAxisSide||`end`,N=b?.crossAxis??!1,P=b?.rootBoundary,F=typeof n==`function`?n:void 0,ee=d(F),te=F?ee:n,ne=C(n),L=C(v),R=an()===`rtl`,z=O||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[i],re=o===`center`?z:`${z}-${o}`,B=u;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ie=+(i===`bottom`),ae=+(i===`top`),oe=+(i===`right`),se=+(i===`left`),V={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:B},H=X.useRef(null),ce=C(a),le=C(s),ue=typeof a==`function`?0:a,U=typeof s==`function`?0:s,W=[];h&&W.push(h),W.push(kt(e=>{let t=bn(e,i,R),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,U,R,i]));let de=j===`none`&&A!==`shift`,fe=!de&&(f||N||A===`shift`),pe=A===`none`?null:Mt({...V,padding:{top:B.top+1+ie,right:B.right+1+se,bottom:B.bottom+1+ae,left:B.left+1+oe},mainAxis:!N&&A===`flip`,crossAxis:j===`flip`&&`alignment`,fallbackAxisSideDirection:M}),me=de?null:At({...V,rootBoundary:P,mainAxis:j!==`none`,crossAxis:fe,limiter:f||N?void 0:jt(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=J(c(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[V,f,N,P,B,j]);A===`shift`||j===`shift`||o===`center`?W.push(me,pe):W.push(pe,me),W.push(Nt({...V,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty(_n,`${t}px`),i.setProperty(vn,`${n}px`);let a=I(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(fn,`${u}px`),i.setProperty(pn,`${d}px`)}}),sn(e=>({element:H.current||S(e.elements.floating).createElement(`div`),padding:H.current?p:0,offsetParent:`floating`}),[p]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:l}=e,u=c(r),d=G(r),f=J(u)===`y`,p=H.current,m=typeof a==`function`?a(bn(e,i,R)):a,h;h=!p&&d&&Math.abs(f?n.shift?.x||0:n.shift?.y||0)<=1?d===`start`===(f&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(f?n.arrow?.x||0:n.arrow?.y||0)+(f?p?.clientWidth||0:p?.clientHeight||0)/2}px`;let g=u===`top`||u===`left`?`calc(100% + ${m}px)`:`${-m}px`;return fe&&f&&Math.abs(n.shift?.y||0)>m&&(g=`${s.reference.y+s.reference.height/2-l}px`),t.style.setProperty(mn,f?`${h} ${g}`:`${g} ${h}`),{}}},cn,w),T(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let he=X.useMemo(()=>({ancestorScroll:!m,elementResize:!m&&typeof ResizeObserver<`u`,layoutShift:!m&&typeof IntersectionObserver<`u`}),[m]),{refs:K,elements:ge,x:_e,y:q,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Y,floatingStyles:Se}=t({rootContext:_,open:g?v:void 0,placement:re,middleware:W,strategy:r,whileElementsMounted:g?void 0:(...e)=>mt(...e,he),nodeId:x,externalTree:D}),{sideX:Ce,sideY:we}=ve.adaptiveOrigin||ln,Z=Y?r:`fixed`,Te=X.useMemo(()=>{let e;return e=Y?w?{position:Z,[Ce]:_e,[we]:q}:{...Se,position:Z}:{position:Z,top:0,left:0},e[_n]=`100vw`,e[vn]=`100vh`,Y||(e.opacity=0),e},[w,Z,Ce,_e,we,q,Se,Y]),Ee=X.useRef(null);T(()=>{if(!v)return;let e=ne.current,t=typeof e==`function`?e():e,n=(Cn(t)?t.current:t)||null;n!==Ee.current&&(K.setPositionReference(n),Ee.current=n)},[v,K,te,ne]),X.useEffect(()=>{if(!v)return;let e=ne.current;typeof e!=`function`&&Cn(e)&&e.current!==Ee.current&&(K.setPositionReference(e.current),Ee.current=e.current)},[v,K,te,ne]),X.useEffect(()=>{if(g&&v&&ge.reference&&ge.floating)return mt(ge.reference,ge.floating,ye,he)},[g,v,ge,ye,he]);let Q=c(be),De=yn(i,Q,R),Oe=G(be)||`center`,ke=!!ve.hide?.referenceHidden;T(()=>{E&&v&&Y&&Q!==z&&k(Q)},[E,v,Y,Q,z]);let Ae=X.useMemo(()=>
1({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),je=ve.arrow?.centerOffset!==0;return X.useMemo(()=>({positionerStyles:Te,arrowStyles:Ae,arrowRef:H,arrowUncentered:je,side:De,align:Oe,physicalSide:Q,anchorHidden:ke,refs:K,context:xe,isPositioned:Y,update:ye}),[Te,Ae,H,je,De,Oe,Q,ke,K,xe,Y,ye])}function Cn(e){return e!=null&&`current`in e}function wn(e){return e===`starting`?he:de}function Tn(e,t,{styles:n,transitionStatus:r,props:a,refs:o,hidden:s,inert:c=!1}){let l={...n};return c&&(l.pointerEvents=`none`),ve(`div`,e,{state:t,ref:o,props:[{role:`presentation`,hidden:s,style:l},wn(r),a],stateAttributesMapping:i})}export{Ce as C,Z as S,Mt as _,un as a,Dt as b,ln as c,Yt as d,qt as f,Pt as g,Lt as h,dn as i,an as l,Vt as m,wn as n,gn as o,Kt as p,xn as r,hn as s,Tn as t,nn as u,kt as v,mt as x,At as y};
2//# sourceMappingURL=usePositioner-Cqo2kPgc.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.