import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./jsx-runtime-CiQ1k8xo.js";import{c as r,i,r as a,u as o}from"./dist-B8SKCozm.js";import{c as s}from"./Combination-9DfZp13g.js";import{a as c,c as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g}from"./floating-ui.react-dom-CT_ERs7m.js";import{t as ee}from"./dist-BJSWtyeU.js";var _=e(t(),1),v=n(),y=`Arrow`,b=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:a=5,...o}=e;return(0,v.jsx)(i.svg,{...o,ref:t,width:r,height:a,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,v.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});b.displayName=y;var x=b,S=`Popper`,[C,w]=r(S),[T,E]=C(S),D=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,v.jsx)(T,{scope:t,anchor:r,onAnchorChange:i,children:n})};D.displayName=S;var O=`PopperAnchor`,k=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...a}=e,s=E(O,n),c=_.useRef(null),l=o(t,c),u=_.useRef(null);return _.useEffect(()=>{let e=u.current;u.current=r?.current||c.current,e!==u.current&&s.onAnchorChange(u.current)}),r?null:(0,v.jsx)(i.div,{...a,ref:l})});k.displayName=O;var A=`PopperContent`,[j,M]=C(A),N=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:y=0,align:b=`center`,alignOffset:x=0,arrowPadding:S=0,avoidCollisions:C=!0,collisionBoundary:w=[],collisionPadding:T=0,sticky:D=`partial`,hideWhenDetached:O=!1,updatePositionStrategy:k=`optimized`,onPlaced:M,...N}=e,P=E(A,n),[F,I]=_.useState(null),R=o(t,e=>I(e)),[z,B]=_.useState(null),V=ee(z),re=V?.width??0,H=V?.height??0,ie=r+(b===`center`?``:`-`+b),U=typeof T==`number`?T:{top:0,right:0,bottom:0,left:0,...T},W=Array.isArray(w)?w:[w],G=W.length>0,K={padding:U,boundary:W.filter(te),altBoundary:G},{refs:q,floatingStyles:J,placement:ae,isPositioned:Y,middlewareData:X}=l({strategy:`fixed`,placement:ie,whileElementsMounted:(...e)=>d(...e,{animationFrame:k===`always`}),elements:{reference:P.anchor},middleware:[c({mainAxis:y+H,alignmentAxis:x}),C&&p({mainAxis:!0,crossAxis:!1,limiter:D===`partial`?u():void 0,...K}),C&&f({...K}),h({...K,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),z&&g({element:z,padding:S}),ne({arrowWidth:re,arrowHeight:H}),O&&m({strategy:`referenceHidden`,...K})]}),[Z,oe]=L(ae),Q=s(M);a(()=>{Y&&Q?.()},[Y,Q]);let se=X.arrow?.x,ce=X.arrow?.y,le=X.arrow?.centerOffset!==0,[$,ue]=_.useState();return a(()=>{F&&ue(window.getComputedStyle(F).zIndex)},[F]),(0,v.jsx)(`div`,{ref:q.setFloating,"data-radix-popper-content-wrapper":``,style:{...J,transform:Y?J.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:$,"--radix-popper-transform-origin":[X.transformOrigin?.x,X.transformOrigin?.y].join(` `),...X.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,v.jsx)(j,{scope:n,placedSide:Z,onArrowChange:B,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,v.jsx)(i.div,{"data-side":Z,"data-align":oe,...N,ref:R,style:{...N.style,animation:Y?void 0:`none`}})})})});N.displayName=A;var P=`PopperArrow`,F={top:`bottom`,right:`left`,bottom:`top`,left:`right`},I=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=M(P,n),a=F[i.placedSide];return(0,v.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,v.jsx)(x,{...r,ref:t,style:{...r.style,display:`block`}})})});I.displayName=P;function te(e){return e!==null}var ne=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=L(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function L(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var R=D,z=k,B=N,V=I;export{w as a,R as i,V as n,B as r,z as t};
//# sourceMappingURL=dist-DXUvl421.js.map