import{r as s,a as p}from"./app-6e13b0c9.js";import{u as Pe,a as Ae,o as ye,s as ve,f as Ce,b as be,c as Se,h as Oe,l as Re}from"./floating-ui.react-dom-ba88937d.js";import{P as N}from"./index-1a7315b2.js";import{u as z}from"./index-79a730ad.js";import{c as Ee,b as Ne,e as j}from"./index-7f804fb5.js";import{u as $e}from"./index-783db250.js";var _e="Arrow",Z=s.forwardRef((e,a)=>{const{children:o,width:t=10,height:n=5,...r}=e;return p(N.svg,{...r,ref:a,width:t,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:p("polygon",{points:"0,0 30,0 15,10"})})});Z.displayName=_e;var He=Z,$="Popper",[L,Ze]=Ee($),[We,U]=L($),q=e=>{const{__scopePopper:a,children:o}=e,[t,n]=s.useState(null);return p(We,{scope:a,anchor:t,onAnchorChange:n,children:o})};q.displayName=$;var G="PopperAnchor",J=s.forwardRef((e,a)=>{const{__scopePopper:o,virtualRef:t,...n}=e,r=U(G,o),i=s.useRef(null),u=z(a,i);return s.useEffect(()=>{r.onAnchorChange((t==null?void 0:t.current)||i.current)}),t?null:p(N.div,{...n,ref:u})});J.displayName=G;var _="PopperContent",[Ie,Me]=L(_),K=s.forwardRef((e,a)=>{var Y,X,B,D,F,k;const{__scopePopper:o,side:t="bottom",sideOffset:n=0,align:r="center",alignOffset:i=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:x=0,sticky:h="partial",hideWhenDetached:A=!1,updatePositionStrategy:y="optimized",onPlaced:f,...l}=e,v=U(_,o),[m,C]=s.useState(null),te=z(a,P=>C(P)),[E,re]=s.useState(null),g=$e(E),oe=(g==null?void 0:g.width)??0,H=(g==null?void 0:g.height)??0,ne=t+(r!=="center"?"-"+r:""),ae=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},W=Array.isArray(d)?d:[d],ie=W.length>0,b={padding:ae,boundary:W.filter(Xe),altBoundary:ie},{refs:se,floatingStyles:I,placement:pe,isPositioned:S,middlewareData:w}=Pe({strategy:"fixed",placement:ne,whileElementsMounted:(...P)=>Ae(...P,{animationFrame:y==="always"}),elements:{reference:v.anchor},middleware:[ye({mainAxis:n+H,alignmentAxis:i}),c&&ve({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Re():void 0,...b}),c&&Ce({...b}),be({...b,apply:({elements:P,rects:T,availableWidth:ge,availableHeight:we})=>{const{width:ue,height:xe}=T.reference,R=P.floating.style;R.setProperty("--radix-popper-available-width",`${ge}px`),R.setProperty("--radix-popper-available-height",`${we}px`),R.setProperty("--radix-popper-anchor-width",`${ue}px`),R.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),E&&Se({element:E,padding:u}),Be({arrowWidth:oe,arrowHeight:H}),A&&Oe({strategy:"referenceHidden",...b})]}),[M,ce]=ee(pe),O=Ne(f);j(()=>{S&&(O==null||O())},[S,O]);const de=(Y=w.arrow)==null?void 0:Y.x,le=(X=w.arrow)==null?void 0:X.y,fe=((B=w.arrow)==null?void 0:B.centerOffset)!==0,[he,me]=s.useState();return j(()=>{m&&me(window.getComputedStyle(m).zIndex)},[m]),p("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:S?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(D=w.transformOrigin)==null?void 0:D.x,(F=w.transformOrigin)==null?void 0:F.y].join(" "),...((k=w.hide)==null?void 0:k.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p(Ie,{scope:o,placedSide:M,onArrowChange:re,arrowX:de,arrowY:le,shouldHideArrow:fe,children:p(N.div,{"data-side":M,"data-align":ce,...l,ref:te,style:{...l.style,animation:S?void 0:"none"}})})})});K.displayName=_;var Q="PopperArrow",Ye={top:"bottom",right:"left",bottom:"top",left:"right"},V=s.forwardRef(function(a,o){const{__scopePopper:t,...n}=a,r=Me(Q,t),i=Ye[r.placedSide];return p("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:p(He,{...n,ref:o,style:{...n.style,display:"block"}})})});V.displayName=Q;function Xe(e){return e!==null}var Be=e=>({name:"transformOrigin",options:e,fn(a){var v,m,C;const{placement:o,rects:t,middlewareData:n}=a,i=((v=n.arrow)==null?void 0:v.centerOffset)!==0,u=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,x]=ee(o),h={start:"0%",center:"50%",end:"100%"}[x],A=(((m=n.arrow)==null?void 0:m.x)??0)+u/2,y=(((C=n.arrow)==null?void 0:C.y)??0)+c/2;let f="",l="";return d==="bottom"?(f=i?h:`${A}px`,l=`${-c}px`):d==="top"?(f=i?h:`${A}px`,l=`${t.floating.height+c}px`):d==="right"?(f=`${-c}px`,l=i?h:`${y}px`):d==="left"&&(f=`${t.floating.width+c}px`,l=i?h:`${y}px`),{data:{x:f,y:l}}}});function ee(e){const[a,o="center"]=e.split("-");return[a,o]}var Le=q,Ue=J,qe=K,Ge=V;export{Ue as A,qe as C,Le as R,Ge as a,Ze as c};
