1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0d495-3f4a-0000-290a-2c30f385bc4f";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="baf81f39-c228-5b4a-91c1-a60a387cdc29")}catch(e){}}();import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{r as t}from"./jsx-runtime-CkaNx6Tr.js";import{D as n,J as r,X as i,Y as a,at as o,h as s,ht as c,nt as l,q as u,tt as d,z as f}from"./Button-DAw2bPaJ.js";import{i as p,r as m}from"./animation-CC_iBhNd.js";function h(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function g(e,t){let n=e,r=0,i=t.toString(),a=i.toLowerCase().indexOf(`e-`);if(a>0)r=Math.abs(Math.floor(Math.log10(Math.abs(t))))+a;else{let e=i.indexOf(`.`);e>=0&&(r=i.length-e)}if(r>0){let e=10**r;n=Math.round(n*e)/e}return n}function _(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(isNaN(t)?0:t))%r,a=g(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return isNaN(t)?!isNaN(n)&&a>n&&(a=Math.floor(g(n/r,r))*r):a<t?a=t:!isNaN(n)&&a>n&&(a=t+Math.floor(g((n-t)/r,r))*r),a=g(a,r),a}var v=e(t(),1),y=(0,v.createContext)({placement:`bottom`}),b=(0,v.forwardRef)(function(e,t){[e,t]=d(e,t,y);let n=e.placement,r={position:`absolute`,transform:n===`top`||n===`bottom`?`translateX(-50%)`:`translateY(-50%)`};n!=null&&(r[n]=`100%`);let i=l({...e,defaultClassName:`react-aria-OverlayArrow`,values:{placement:n}});i.style&&Object.keys(i.style).forEach(e=>i.style[e]===void 0&&delete i.style[e]);let a=s(e);return v.createElement(o.div,{...a,...i,style:{...r,...i.style},ref:t,"data-placement":n})}),x={top:`top`,bottom:`top`,left:`left`,right:`left`},S={top:`bottom`,bottom:`top`,left:`right`,right:`left`},C={top:`left`,left:`top`},w={top:`height`,left:`width`},T={width:`totalWidth`,height:`totalHeight`},E={},D=()=>typeof document<`u`?window.visualViewport:null;function O(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c={},l=(t?.scale??1)>1;if(e.tagName===`BODY`||e.tagName===`HTML`){let l=document.documentElement;i=l.clientWidth,a=l.clientHeight,n=t?.width??i,r=t?.height??a,c.top=l.scrollTop||e.scrollTop,c.left=l.scrollLeft||e.scrollLeft,t&&(o=t.offsetTop,s=t.offsetLeft)}else({width:n,height:r,top:o,left:s}=z(e,!1)),c.top=e.scrollTop,c.left=e.scrollLeft,i=n,a=r;return f()&&(e.tagName===`BODY`||e.tagName===`HTML`)&&l&&(c.top=0,c.left=0,o=t?.pageTop??0,s=t?.pageLeft??0),{width:n,height:r,totalWidth:i,totalHeight:a,scroll:c,top:o,left:s}}function k(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function A(e,t,n,r,i,a,o){let s=i.scroll[e]??0,c=r[w[e]],l=o[e]+r.scroll[x[e]]+a,u=o[e]+r.scroll[x[e]]+c-a,d=t-s+r.scroll[x[e]]+o[e]-r[x[e]],f=t-s+n+r.scroll[x[e]]+o[e]-r[x[e]];return d<l?l-d:f>u?Math.max(u-f,l-d):0}function j(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function M(e){if(E[e])return E[e];let[t,n]=e.split(` `),r=x[t]||`right`,i=C[r];x[n]||(n=`center`);let a=w[r],o=w[i];return E[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:a,crossSize:o},E[e]}function N(e,t,n,r,i,a,o,s,c,l,u){let{placement:d,crossPlacement:f,axis:p,crossAxis:m,size:g,crossSize:_}=r,v={};v[m]=e[m]??0,f===`center`?v[m]+=((e[_]??0)-(n[_]??0))/2:f!==m&&(v[m]+=(e[_]??0)-(n[_]??0)),v[m]+=a;let y=e[m]-n[_]+c+l,b=e[m]+e[_]-c-l;if(v[m]=h(v[m],y,b),d===p){let t=s?u[g]:u[T[g]];v[S[p]]=Math.floor(t-e[p]+i)}else v[p]=Math.floor(e[p]+e[g]+i);return v}function P(e,t,n,r,i,a,o,s,c,l,u){let d=(e.top==null?c[T.height]-(e.bottom??0)-o:e.top)-(c.scroll.top??0),f=l?n.top:0,p={top:Math.max(t.top+f,(u?.offsetTop??t.top)+f),bottom:Math.min(t.top+t.height+f,(u?.offsetTop??0)+(u?.height??0))};return s===`top`?Math.max(0,d+o-p.top-((i.top??0)+(i.bottom??0)+a)):Math.max(0,p.bottom-d-((i.top??0)+(i.bottom??0)+a))}function F(e,t,n,r,i,a,o,s){let{placement:c,axis:l,size:u}=a;return c===l?Math.max(0,n[l]-(o.scroll[l]??0)-(e[l]+(s?t[l]:0))-(r[l]??0)-r[S[l]]-i):Math.max(0,e[u]+e[l]+(s?t[l]:0)-n[l]-n[u]+(o.scroll[l]??0)-(r[l]??0)-r[S[l]]-i)}function I(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,g,_,v){let y=M(e),{size:b,crossAxis:C,crossSize:w,placement:T,crossPlacement:E}=y,D=N(t,s,n,y,u,d,l,f,m,g,c),O=u,k=F(s,l,t,i,a+u,y,c,_);if(o&&n[b]>k){let e=M(`${S[T]} ${E}`),r=N(t,s,n,e,u,d,l,f,m,g,c);F(s,l,t,i,a+u,e,c,_)>k&&(y=e,D=r,O=u)}let j=`bottom`;
1y.axis===`top`?y.placement===`top`?j=`top`:y.placement===`bottom`&&(j=`bottom`):y.crossAxis===`top`&&(y.crossPlacement===`top`?j=`bottom`:y.crossPlacement===`bottom`&&(j=`top`));let I=A(C,D[C],n[w],s,c,a,l);D[C]+=I;let L=P(D,s,l,f,i,a,n.height,j,c,_,v);p&&p<L&&(L=p),n.height=Math.min(n.height,L),D=N(t,s,n,y,O,d,l,f,m,g,c),I=A(C,D[C],n[w],s,c,a,l),D[C]+=I;let R={},z=t[C]-D[C]-i[x[C]],B=z+.5*t[w],V=m/2+g,H=x[C]===`left`?(i.left??0)+(i.right??0):(i.top??0)+(i.bottom??0),U=n[w]-H-m/2-g;R[C]=h(h(B,t[C]+m/2-(D[C]+i[x[C]]),t[C]+t[w]-m/2-(D[C]+i[x[C]])),V,U),{placement:T,crossPlacement:E}=y,m?z=R[C]:E===`right`?z+=t[w]:E===`center`&&(z+=t[w]/2);let W=T===`left`||T===`top`?n[b]:0,G={x:T===`top`||T===`bottom`?z:W,y:T===`left`||T===`right`?z:W};return{position:D,maxHeight:L,arrowOffsetLeft:R.left,arrowOffsetTop:R.top,placement:T,triggerAnchorPoint:G}}function L(e){let{placement:t,targetNode:n,overlayNode:r,scrollNode:i,padding:a,shouldFlip:o,boundaryElement:s,offset:c,crossOffset:l,maxHeight:d,arrowSize:f=0,arrowBoundaryOffset:p=0,targetRect:m}=e,h=D(),g=r instanceof HTMLElement?V(r):document.documentElement,_=g===document.documentElement,v=window.getComputedStyle(g).position,y=!!v&&v!==`static`,b=_?z(n,!1,m):B(n,g,!1,m);if(!_){let{marginTop:e,marginLeft:t}=window.getComputedStyle(n);b.top+=parseInt(e,10)||0,b.left+=parseInt(t,10)||0}let x=z(r,!0),S=j(r);x.width+=(S.left??0)+(S.right??0),x.height+=(S.top??0)+(S.bottom??0);let C=k(i),w=O(s,h),T=O(g,h),E;if((s.tagName===`BODY`||s.tagName===`HTML`)&&!_){let e=R(g,!1);E={top:-(e.top-w.top),left:-(e.left-w.left),width:0,height:0}}else E=(s.tagName===`BODY`||s.tagName===`HTML`)&&_?{top:0,left:0,width:0,height:0}:B(s,g,!1);let A=u(s,g);return I(t,b,x,C,S,a,o,w,T,E,c,l,y,d,f,p,A,h)}function R(e,t){let{top:n,left:r,width:i,height:a}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(i=e.offsetWidth,a=e.offsetHeight),{top:n,left:r,width:i,height:a}}function z(e,t,n){let{top:r,left:i,width:a,height:o}=n||R(e,t),{scrollTop:s,scrollLeft:c,clientTop:l,clientLeft:u}=document.documentElement;return{top:r+s-l,left:i+c-u,width:a,height:o}}function B(e,t,n,r){let i=window.getComputedStyle(e),a;if(i.position===`fixed`)a=r||R(e,n);else{a=z(e,n,r);let i=z(t,n),o=window.getComputedStyle(t);i.top+=(parseInt(o.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(o.borderLeftWidth,10)||0)-t.scrollLeft,a.top-=i.top,a.left-=i.left}return a.top-=parseInt(i.marginTop,10)||0,a.left-=parseInt(i.marginLeft,10)||0,a}function V(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position===`static`&&!H(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!H(t);)t=t.parentElement;return t||document.documentElement}function H(e){let t=window.getComputedStyle(e);return t.transform!==`none`||/transform|perspective/.test(t.willChange)||t.filter!==`none`||t.contain===`paint`||`backdropFilter`in t&&t.backdropFilter!==`none`||`WebkitBackdropFilter`in t&&t.WebkitBackdropFilter!==`none`}var U=new WeakMap;function W(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,v.useEffect)(()=>{if(!n||r===null)return;let e=e=>{let n=i(e);if(!t.current||n instanceof Node&&!u(n,t.current)||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return;let a=r||U.get(t.current);a&&a()};return window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`scroll`,e,!0)}},[n,r,t])}function G(){return window.ResizeObserver!==void 0}function K(e){let{ref:t,box:r,onResize:i}=e,a=n(i);(0,v.useEffect)(()=>{let e=t?.current;if(e)if(G()){let t=new window.ResizeObserver(e=>{e.length&&a()});return t.observe(e,{box:r}),()=>{e&&t.unobserve(e)}}else return window.addEventListener(`resize`,a,!1),()=>{window.removeEventListener(`resize`,a,!1)}},[t,r])}var q=typeof document<`u`?window.visualViewport:null;function J(e){let{direction:t}=p(),{arrowSize:n,targetRef:i,overlayRef:o,arrowRef:s,scrollRef:l=o,placement:u=`bottom`,containerPadding:d=12,shouldFlip:f=!0,boundaryElement:m=typeof document<`u`?document.body:null,offset:h=0,crossOffset:g=0,shouldUpdatePosition:_=!0,isOpen:y=!0,onClose:b,maxHeight:x,arrowBoundaryOffset:S=0,getTargetRect:C}=e,[w,T]=(0,v.useState)(null),E=[_,u,o.current,i.current,s?.current,l.current,d,f,m,h,g,y,t,x,S,n],D=(0,v.useRef)(q?.scale);(0,v.useEffect)(()=>{y&&(D.current=q?.scale)},[y]);let O=(0,v.useCallback)(()=>
vendor: 2,596 bytes, lines 1-3
1{if(_===!1||!y||!o.current||!i.current||!m||q?.scale!==D.current)return;let e=null;if(l.current&&r(l.current)){let t=a()?.getBoundingClientRect(),n=l.current.getBoundingClientRect();e={type:`top`,offset:(t?.top??0)-n.top},e.offset>n.height/2&&(e.type=`bottom`,e.offset=(t?.bottom??0)-n.bottom)}let c=o.current;!x&&o.current&&(c.style.top=`0px`,c.style.bottom=``,c.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+`px`);let p=L({placement:X(u,t),overlayNode:o.current,targetNode:i.current,scrollNode:l.current||o.current,padding:d,shouldFlip:f,boundaryElement:m,offset:h,crossOffset:g,maxHeight:x,arrowSize:n??(s?.current?R(s.current,!0).width:0),arrowBoundaryOffset:S,targetRect:C?.(i.current)});if(!p.position)return;c.style.top=``,c.style.bottom=``,c.style.left=``,c.style.right=``,Object.keys(p.position).forEach(e=>c.style[e]=p.position[e]+`px`),c.style.maxHeight=p.maxHeight==null?``:p.maxHeight+`px`;let v=a();if(e&&v&&l.current){let t=v.getBoundingClientRect(),n=l.current.getBoundingClientRect(),r=t[e.type]-n[e.type];l.current.scrollTop+=r-e.offset}T(p)},E);c(O,E),Y(O),K({ref:o,onResize:O}),K({ref:i,onResize:O});let k=(0,v.useRef)(!1);c(()=>{let e,t=()=>{k.current=!0,clearTimeout(e),e=setTimeout(()=>{k.current=!1},500),O()},n=()=>{k.current&&t()};return q?.addEventListener(`resize`,t),q?.addEventListener(`scroll`,n),()=>{q?.removeEventListener(`resize`,t),q?.removeEventListener(`scroll`,n)}},[O]);let A=(0,v.useCallback)(()=>{k.current||b?.()},[b,k]);return W({triggerRef:i,isOpen:y,onClose:b&&A}),{overlayProps:{style:{position:w?`absolute`:`fixed`,top:w?void 0:0,left:w?void 0:0,zIndex:1e5,...w?.position,maxHeight:w?.maxHeight??`100vh`}},placement:w?.placement??null,triggerAnchorPoint:w?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":`true`,role:`presentation`,style:{left:w?.arrowOffsetLeft,top:w?.arrowOffsetTop}},updatePosition:O}}function Y(e){c(()=>(window.addEventListener(`resize`,e,!1),()=>{window.removeEventListener(`resize`,e,!1)}),[e])}function X(e,t){return t===`rtl`?e.replace(`start`,`right`).replace(`end`,`left`):e.replace(`start`,`left`).replace(`end`,`right`)}var Z=(0,v.createContext)({});function Q(){return(0,v.useContext)(Z)??{}}function $(e){let[t,n]=m(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:(0,v.useCallback)(()=>{n(!0)},[n]),close:(0,v.useCallback)(()=>{n(!1)},[n]),toggle:(0,v.useCallback)(()=>{n(!t)},[n,t])}}export{U as a,h as c,K as i,_ as l,Q as n,y as o,J as r,b as s,$ as t}; 2//# sourceMappingURL=useOverlayTriggerState-CLkF3Ljd.js.map 3//# chunkId=baf81f39-c228-5b4a-91c1-a60a387cdc29
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.