(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,809058,e=>{"use strict";let t;var n=e.i(458201),r=e.i(538167),o=e.i(543836),i=e.i(915335),l=e.i(162033),a=e.i(807660),s=e.i(707777),f=e.i(526160),u=e.i(904816);let c=["top","right","bottom","left"],d=Math.min,p=Math.max,h=Math.round,g=Math.floor,m=e=>({x:e,y:e}),v={left:"right",right:"left",bottom:"top",top:"bottom"};function x(e,t){return"function"==typeof e?e(t):e}function w(e){return e.split("-")[0]}function y(e){return e.split("-")[1]}function b(e){return"x"===e?"y":"x"}function R(e){return"y"===e?"height":"width"}function P(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function A(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let C=["left","right"],O=["right","left"],j=["top","bottom"],S=["bottom","top"];function T(e){let t=w(e);return v[t]+e.slice(t.length)}function E(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function L(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function k(e,t,n){let r,{reference:o,floating:i}=e,l=P(t),a=b(P(t)),s=R(a),f=w(t),u=o.x+o.width/2-i.width/2,c=o.y+o.height/2-i.height/2,d=o[s]/2-i[s]/2;switch(f){case"top":r={x:u,y:o.y-i.height};break;case"bottom":r={x:u,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:c};break;case"left":r={x:o.x-i.width,y:c};break;default:r={x:o.x,y:o.y}}let p=y(t);return p&&(r[a]+=d*("end"===p?1:-1)*(n&&"y"===l?-1:1)),r}async function F(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:c="floating",altBoundary:d=!1,padding:p=0}=x(t,e),h=E(p),g=a[d?"floating"===c?"reference":"floating":c],m=L(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:f,rootBoundary:u,strategy:s})),v="floating"===c?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,w=await (null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),y=await (null==i.isElement?void 0:i.isElement(w))&&await (null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:w,strategy:s}):v);return{top:(m.top-b.top+h.top)/y.y,bottom:(b.bottom-m.bottom+h.bottom)/y.y,left:(m.left-b.left+h.left)/y.x,right:(b.right-m.right+h.right)/y.x}}let D=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:F},s=await (null==l.isRTL?void 0:l.isRTL(t)),f=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:c}=k(f,r,s),d=r,p=0,h={};for(let n=0;ne[t]>=0)}let H=new Set(["left","top"]);async function z(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),l=w(n),a=y(n),s="y"===P(n),f=H.has(l)?-1:1,u=i&&s?-1:1,c=x(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),s?{x:p*u,y:d*f}:{x:d*f,y:p*u}}function V(){return"u">typeof window}function W(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function $(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function B(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return!!V()&&(e instanceof Node||e instanceof $(e).Node)}function I(e){return!!V()&&(e instanceof Element||e instanceof $(e).Element)}function Y(e){return!!V()&&(e instanceof HTMLElement||e instanceof $(e).HTMLElement)}function X(e){return!(!V()||"u"!!e&&"none"!==e;function Z(e){let t=I(e)?et(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!Q()&&(J(t.backdropFilter)||J(t.filter))||q.test(t.willChange||"")||G.test(t.contain||"")}function Q(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function ee(e){return/^(html|body|#document)$/.test(W(e))}function et(e){return $(e).getComputedStyle(e)}function en(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if("html"===W(e))return e;let t=e.assignedSlot||e.parentNode||X(e)&&e.host||B(e);return X(t)?t.host:t}function eo(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=er(t);return ee(n)?(t.ownerDocument||t).body:Y(n)&&K(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=$(o);if(!i)return t.concat(o,eo(o,[],n));{let e=ei(l);return t.concat(l,l.visualViewport||[],K(o)?o:[],e&&n?eo(e):[])}}function ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function el(e){let t=et(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=Y(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=h(n)!==i||h(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function ea(e){return I(e)?e:e.contextElement}function es(e){let t=ea(e);if(!Y(t))return m(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=el(t),l=(i?h(n.width):n.width)/r,a=(i?h(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let ef=m(0);function eu(e){let t=$(e);return Q()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ef}function ec(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),l=ea(e),a=m(1);t&&(r?I(r)&&(a=es(r)):a=es(e));let s=(void 0===(o=n)&&(o=!1),r&&o&&r===$(l))?eu(l):m(0),f=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(l&&r){let e=$(l),t=I(r)?$(r):r,n=e,o=ei(n);for(;o&&t!==n;){let e=es(o),t=o.getBoundingClientRect(),r=et(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;f*=e.x,u*=e.y,c*=e.x,d*=e.y,f+=i,u+=l,o=ei(n=$(o))}}return L({width:c,height:d,x:f,y:u})}function ed(e,t){let n=en(e).scrollLeft;return t?t.left+n:ec(B(e)).left+n}function ep(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ed(e,n),y:n.top+t.scrollTop}}function eh(e,t,n){var r;let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=$(e),i=B(e),l=o.visualViewport,a=i.clientWidth,s=i.clientHeight,f=0,u=0;if(l){let e=!Q()||"fixed"===t;r?e||(f=-l.offsetLeft,u=-l.offsetTop):(a=l.width,s=l.height,e&&(f=l.offsetLeft,u=l.offsetTop))}if(0>=ed(i)){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),l="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;lI(e)&&"body"!==W(e)),o=null,i="fixed"===et(e).position,l=i?er(e):e;for(;I(l)&&!ee(l);){let e=et(l),t=Z(l),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==l),l=er(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=eh(t,i[0],o),a=l.top,s=l.right,f=l.bottom,u=l.left;for(let e=1;e({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:s}=t,{element:f,padding:u=0}=x(e,t)||{};if(null==f)return{};let c=E(u),h={x:n,y:r},g=b(P(o)),m=R(g),v=await l.getDimensions(f),w="y"===g,A=w?"clientHeight":"clientWidth",C=i.reference[m]+i.reference[g]-h[g]-i.floating[m],O=h[g]-i.reference[g],j=await (null==l.getOffsetParent?void 0:l.getOffsetParent(f)),S=j?j[A]:0;S&&await (null==l.isElement?void 0:l.isElement(j))||(S=a.floating[A]||i.floating[m]);let T=S/2-v[m]/2-1,L=d(c[w?"top":"left"],T),k=d(c[w?"bottom":"right"],T),F=S-v[m]-k,D=S/2-v[m]/2+(C/2-O/2),_=p(L,d(D,F)),M=!s.arrow&&null!=y(o)&&D!==_&&i.reference[m]/2-(Dtypeof document?r.useLayoutEffect:function(){};function eA(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eA(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!eA(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eC(e){return"u"{t.current=e}),t}var eS=e.i(679076),eT=Object.defineProperty,eE=r.forwardRef(eT(function(e,t){let{children:r,width:o=10,height:i=5,...l}=e;return(0,n.jsx)(eS.V.svg,{...l,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,n.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0})),eL=e.i(932523),ek=e.i(210767);function eF(e){let[t,n]=r.useState(void 0);return(0,ek.f)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(eF,"name",{value:"useSize",configurable:!0});var eD=Object.defineProperty,e_=(e,t)=>eD(e,"name",{value:t,configurable:!0}),eM="Popper",[eH,ez]=(0,l.f)(eM),[eV,eW]=eH(eM),e$=e_(e=>{let{__scopePopper:t,children:o}=e,[i,l]=r.useState(null),[a,s]=r.useState(void 0);return(0,n.jsx)(eV,{scope:t,anchor:i,onAnchorChange:l,placementState:a,setPlacementState:s,children:o})},"Popper"),eB=r.forwardRef(e_(function(e,t){let{__scopePopper:o,virtualRef:l,...a}=e,s=eW("PopperAnchor",o),f=r.useRef(null),u=s.onAnchorChange,c=r.useCallback(e=>{f.current=e,e&&u(e)},[u]),d=(0,i.j)(t,c),p=r.useRef(null);r.useEffect(()=>{if(!l)return;let e=p.current;p.current=l.current,e!==p.current&&u(p.current)});let h=s.placementState&&eJ(s.placementState),g=h?.[0],m=h?.[1];return l?null:(0,n.jsx)(eS.V.div,{"data-radix-popper-side":g,"data-radix-popper-align":m,...a,ref:d})},"PopperAnchor")),eN="PopperContent",[eI,eY]=eH(eN),eX=r.forwardRef(e_(function(e,t){var o,l,a,s,f,u,c,h,m,v,E,L,k;let F,V,W,N,I,Y,{__scopePopper:X,side:K="bottom",sideOffset:U=0,align:q="center",alignOffset:G=0,arrowPadding:J=0,avoidCollisions:Z=!0,collisionBoundary:Q=[],collisionPadding:ee=0,sticky:et="partial",hideWhenDetached:en=!1,updatePositionStrategy:er="optimized",onPlaced:ei,...el}=e,es=eW(eN,X),[ef,eu]=r.useState(null),ed=(0,i.j)(t,eu),[ep,eh]=r.useState(null),eg=eF(ep),em=eg?.width??0,ev=eg?.height??0,ex="number"==typeof ee?ee:{top:0,right:0,bottom:0,left:0,...ee},eT=Array.isArray(Q)?Q:[Q],eE=eT.length>0,eD={padding:ex,boundary:eT.filter(eq),altBoundary:eE},{refs:eM,floatingStyles:eH,placement:ez,isPositioned:eV,middlewareData:e$}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:a}={},transform:s=!0,whileElementsMounted:f,open:u}=e,[c,d]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);eA(p,o)||h(o);let[g,m]=r.useState(null),[v,x]=r.useState(null),w=r.useCallback(e=>{e!==P.current&&(P.current=e,m(e))},[]),y=r.useCallback(e=>{e!==A.current&&(A.current=e,x(e))},[]),b=l||g,R=a||v,P=r.useRef(null),A=r.useRef(null),C=r.useRef(c),O=null!=f,j=ej(f),S=ej(i),T=ej(u),E=r.useCallback(()=>{var e,r;let o,i,l;if(!P.current||!A.current)return;let a={placement:t,strategy:n,middleware:p};S.current&&(a.platform=S.current),(e=P.current,r=A.current,o=new Map,i=null!=a?a:{},l={...ew,...i.platform,_c:o},D(e,r,{...i,platform:l})).then(e=>{let t={...e,isPositioned:!1!==T.current};L.current&&!eA(C.current,t)&&(C.current=t,eR.flushSync(()=>{d(t)}))})},[p,t,n,S,T]);eP(()=>{!1===u&&C.current.isPositioned&&(C.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let L=r.useRef(!1);eP(()=>(L.current=!0,()=>{L.current=!1}),[]),eP(()=>{if(b&&(P.current=b),R&&(A.current=R),b&&R){if(j.current)return j.current(b,R,E);E()}},[b,R,E,j,O]);let k=r.useMemo(()=>({reference:P,floating:A,setReference:w,setFloating:y}),[w,y]),F=r.useMemo(()=>({reference:b,floating:R}),[b,R]),_=r.useMemo(()=>{let e={position:n,left:0,top:0};if(!F.floating)return e;let t=eO(F.floating,c.x),r=eO(F.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...eC(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,F.floating,c.x,c.y]);return r.useMemo(()=>({...c,update:E,refs:k,elements:F,floatingStyles:_}),[c,E,k,F,_])}({strategy:"fixed",placement:K+("center"!==q?"-"+q:""),whileElementsMounted:e_((...e)=>(function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=r,u=ea(e),c=i||l?[...u?eo(u):[],...t?eo(t):[]]:[];c.forEach(e=>{i&&e.addEventListener("scroll",n),l&&e.addEventListener("resize",n)});let h=u&&s?function(e,t,n){let r,o=null,i=B(e);function l(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function a(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),l();let f=e.getBoundingClientRect(),{left:u,top:c,width:h,height:m}=f;if(n||t(),!h||!m)return;let v={rootMargin:-g(c)+"px "+-g(i.clientWidth-(u+h))+"px "+-g(i.clientHeight-(c+m))+"px "+-g(u)+"px",threshold:p(0,d(1,s))||1},x=!0;function w(t){let n=t[0].intersectionRatio;if(!ey(f,e.getBoundingClientRect()))return a();if(n!==s){if(!x)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{o=new IntersectionObserver(w,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(w,v)}o.observe(e)}let s=$(e),f=()=>a(n);return s.addEventListener("resize",f),a(!0),()=>{s.removeEventListener("resize",f),l()}}(u,n,l):null,m=-1,v=null;a&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),u&&!f&&v.observe(u),t&&v.observe(t));let x=f?ec(e):null;return f&&function t(){let r=ec(e);x&&!ey(x,r)&&n(),x=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{i&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==h||h(),null==(e=v)||e.disconnect(),v=null,f&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===er}),"whileElementsMounted"),elements:{reference:es.anchor},middleware:[{name:(F={name:"offset",options:l=o={mainAxis:U+ev,alignmentAxis:G},async fn(e){var t,n;let{x:r,y:o,placement:i,middlewareData:a}=e,s=await z(e,l);return i===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:o+s.y,data:{...s,placement:i}}}}).name,fn:F.fn,options:[o,void 0]},Z&&{name:(V={name:"shift",options:f=s={mainAxis:!0,crossAxis:!1,limiter:"partial"===et?{fn:(a=void 0,{options:a={},fn(e){var t,n,r,o;let{x:i,y:l,placement:s,rects:f,middlewareData:u}=e,{offset:c=0,mainAxis:d=!0,crossAxis:p=!0}=x(a,e),h={x:i,y:l},g=P(s),m=b(g),v=h[m],y=h[g],R=x(c,e),A="number"==typeof R?{mainAxis:R,crossAxis:0}:{mainAxis:null!=(t=R.mainAxis)?t:0,crossAxis:null!=(n=R.crossAxis)?n:0};if(d){let e="y"===m?"height":"width",t=f.reference[m]-f.floating[e]+A.mainAxis,n=f.reference[m]+f.reference[e]-A.mainAxis;vn&&(v=n)}if(p){let e="y"===m?"width":"height",t=H.has(w(s)),n=f.reference[g]-f.floating[e]+(t&&(null==(r=u.offset)?void 0:r[g])||0)+(t?0:A.crossAxis),i=f.reference[g]+f.reference[e]+(t?0:(null==(o=u.offset)?void 0:o[g])||0)-(t?A.crossAxis:0);yi&&(y=i)}return{[m]:v,[g]:y}}}).fn,options:[void 0,void 0]}:void 0,...eD},async fn(e){let{x:t,y:n,placement:r,platform:o}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=x(f,e),u={x:t,y:n},c=await o.detectOverflow(e,s),h=P(r),g=b(h),m=u[g],v=u[h],w=(e,t)=>p(t+c["y"===e?"top":"left"],d(t,t-c["y"===e?"bottom":"right"]));i&&(m=w(g,m)),l&&(v=w(h,v));let y=a.fn({...e,[g]:m,[h]:v});return{...y,data:{x:y.x-t,y:y.y-n,enabled:{[g]:i,[h]:l}}}}}).name,fn:V.fn,options:[s,void 0]},Z&&{name:(W={name:"flip",options:c=u={...eD},async fn(e){var t,n,r,o,i,l,a,s;let f,u,d,{placement:p,middlewareData:h,rects:g,initialPlacement:m,platform:v,elements:E}=e,{mainAxis:L=!0,crossAxis:k=!0,fallbackPlacements:F,fallbackStrategy:D="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:M=!0,...H}=x(c,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let z=w(p),V=P(m),W=w(m)===m,$=await (null==v.isRTL?void 0:v.isRTL(E.floating)),B=F||(W||!M?[T(m)]:(f=T(m),[A(m),f,A(f)])),N="none"!==_;!F&&N&&B.push(...(u=y(m),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?O:C;return t?C:O;case"left":case"right":return t?j:S;default:return[]}}(w(m),"start"===_,$),u&&(d=d.map(e=>e+"-"+u),M&&(d=d.concat(d.map(A)))),d));let I=[m,...B],Y=await v.detectOverflow(e,H),X=[],K=(null==(n=h.flip)?void 0:n.overflows)||[];if(L&&X.push(Y[z]),k){let e,t,n,r,o=(l=p,a=g,void 0===(s=$)&&(s=!1),e=y(l),n=R(t=b(P(l))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=T(r)),[r,T(r)]);X.push(Y[o[0]],Y[o[1]])}if(K=[...K,{placement:p,overflows:X}],!X.every(e=>eP(e.placement)!==V||e.overflows[0]>0)))return{data:{index:e,overflows:K},reset:{placement:t}};let n=null==(o=K.filter(e=>e.overflows[0]e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(D){case"bestFit":{let e=null==(i=K.filter(e=>{if(N){let t=P(e.placement);return t===V||"y"===t}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])?void 0:i[0];e&&(n=e);break}case"initialPlacement":n=m}if(p!==n)return{reset:{placement:n}}}return{}}}).name,fn:W.fn,options:[u,void 0]},{name:(N={name:"size",options:m=h={...eD,apply:e_(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:o,height:i}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${o}px`),l.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:o,platform:i,elements:l}=e,{apply:a=()=>{},...s}=x(m,e),f=await i.detectOverflow(e,s),u=w(r),c=y(r),h="y"===P(r),{width:g,height:v}=o.floating;"top"===u||"bottom"===u?(t=u,n=c===(await (null==i.isRTL?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(n=u,t="end"===c?"top":"bottom");let b=v-f.top-f.bottom,R=g-f.left-f.right,A=d(v-f[t],b),C=d(g-f[n],R),O=e.middlewareData.shift,j=!O,S=A,T=C;null!=O&&O.enabled.x&&(T=R),null!=O&&O.enabled.y&&(S=b),j&&!c&&(h?T=g-2*p(f.left,f.right):S=v-2*p(f.top,f.bottom)),await a({...e,availableWidth:T,availableHeight:S});let E=await i.getDimensions(l.floating);return g!==E.width||v!==E.height?{reset:{rects:!0}}:{}}}).name,fn:N.fn,options:[h,void 0]},ep&&{name:(I={name:"arrow",options:E=v={element:ep,padding:J},fn(e){let{element:t,padding:n}="function"==typeof E?E(e):E;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?eb({element:t.current,padding:n}).fn(e):{}:t?eb({element:t,padding:n}).fn(e):{}}}).name,fn:I.fn,options:[v,void 0]},eG({arrowWidth:em,arrowHeight:ev}),en&&{name:(Y={name:"hide",options:k=L={strategy:"referenceHidden",...eD,boundary:eE?eD.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...o}=x(k,e);switch(r){case"referenceHidden":{let r=_(await n.detectOverflow(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:M(r)}}}case"escaped":{let r=_(await n.detectOverflow(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:M(r)}}}default:return{}}}}).name,fn:Y.fn,options:[L,void 0]}]}),eB=es.setPlacementState;(0,ek.f)(()=>(eB(ez),()=>{eB(void 0)}),[ez,eB]);let[eY,eX]=eJ(ez),eK=(0,eL.f)(ei);(0,ek.f)(()=>{eV&&eK?.()},[eV,eK]);let eU=e$.arrow?.x,eZ=e$.arrow?.y,eQ=e$.arrow?.centerOffset!==0,[e0,e1]=r.useState();return(0,ek.f)(()=>{ef&&e1(window.getComputedStyle(ef).zIndex)},[ef]),(0,n.jsx)("div",{ref:eM.setFloating,"data-radix-popper-content-wrapper":"",style:{...eH,transform:eV?eH.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:e0,"--radix-popper-transform-origin":[e$.transformOrigin?.x,e$.transformOrigin?.y].join(" "),...e$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,n.jsx)(eI,{scope:X,placedSide:eY,placedAlign:eX,onArrowChange:eh,arrowX:eU,arrowY:eZ,shouldHideArrow:eQ,children:(0,n.jsx)(eS.V.div,{"data-side":eY,"data-align":eX,...el,ref:ed,style:{...el.style,animation:eV?el.style?.animation:"none"}})})})},"PopperContent")),eK={top:"bottom",right:"left",bottom:"top",left:"right"},eU=r.forwardRef(e_(function(e,t){let{__scopePopper:r,...o}=e,i=eY("PopperArrow",r),l=eK[i.placedSide];return(0,n.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]: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,n.jsx)(eE,{...o,ref:t,style:{...o.style,display:"block"}})})},"PopperArrow"));function eq(e){return null!==e}e_(eq,"isNotNull");var eG=e_(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[s,f]=eJ(n),u={start:"0%",center:"50%",end:"100%"}[f],c=(o.arrow?.x??0)+l/2,d=(o.arrow?.y??0)+a/2,p="",h="";return"bottom"===s?(p=i?u:`${c}px`,h=`${-a}px`):"top"===s?(p=i?u:`${c}px`,h=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,h=i?u:`${d}px`):"left"===s&&(p=`${r.floating.width+a}px`,h=i?u:`${d}px`),{data:{x:p,y:h}}}}),"transformOrigin");function eJ(e){let[t,n="center"]=e.split("-");return[t,n]}e_(eJ,"getSideAndAlignFromPlacement");var eZ=e.i(671495),eQ=e.i(786884),e0=e.i(95927),e1=e.i(218481),e2=e.i(73772),e5=e.i(345214),e7=Object.defineProperty,e3=(e,t)=>e7(e,"name",{value:t,configurable:!0}),e8="Popover",[e6,e9]=(0,l.f)(e8,[ez]),e4=ez(),[te,tt]=e6(e8),tn=e3(e=>{let{__scopePopover:t,children:o,open:i,defaultOpen:l,onOpenChange:a,modal:s=!1}=e,f=e4(t),c=r.useRef(null),[d,p]=r.useState(!1),[h,g]=(0,e1.f)({prop:i,defaultProp:l??!1,onChange:a,caller:e8});return(0,n.jsx)(e$,{...f,children:(0,n.jsx)(te,{scope:t,contentId:(0,u.f)(),triggerRef:c,open:h,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:d,onCustomAnchorAdd:r.useCallback(()=>p(!0),[]),onCustomAnchorRemove:r.useCallback(()=>p(!1),[]),modal:s,children:o})})},"Popover"),tr=r.forwardRef(e3(function(e,t){let{__scopePopover:o,...i}=e,l=tt("PopoverAnchor",o),a=e4(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:f}=l;return r.useEffect(()=>(s(),()=>f()),[s,f]),(0,n.jsx)(eB,{...a,...i,ref:t})},"PopoverAnchor")),to=r.forwardRef(e3(function(e,t){let{__scopePopover:r,...l}=e,a=tt("PopoverTrigger",r),s=e4(r),f=(0,i.j)(t,a.triggerRef),u=(0,n.jsx)(eS.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":tm(a.open),...l,ref:f,onClick:(0,o.f)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,n.jsx)(eB,{asChild:!0,...s,children:u})},"PopoverTrigger")),ti="PopoverPortal",[tl,ta]=e6(ti,{forceMount:void 0}),ts=e3(e=>{let{__scopePopover:t,forceMount:r,children:o,container:i}=e,l=tt(ti,t);return(0,n.jsx)(tl,{scope:t,forceMount:r,children:(0,n.jsx)(eQ.f,{present:r||l.open,children:(0,n.jsx)(eZ.f,{asChild:!0,container:i,children:o})})})},"PopoverPortal"),tf="PopoverContent",tu=r.forwardRef(e3(function(e,t){let r=ta(tf,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,l=tt(tf,e.__scopePopover);return(0,n.jsx)(eQ.f,{present:o||l.open,children:l.modal?(0,n.jsx)(td,{...i,ref:t}):(0,n.jsx)(tp,{...i,ref:t})})},"PopoverContent")),tc=(0,e0.B)("PopoverContent.RemoveScroll"),td=r.forwardRef(e3(function(e,t){let l=tt(tf,e.__scopePopover),a=r.useRef(null),s=(0,i.j)(t,a),f=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,e2.f)(e)},[]),(0,n.jsx)(e5.f,{as:tc,allowPinchZoom:!0,children:(0,n.jsx)(th,{...e,ref:s,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),f.current||l.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;f.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,o.f)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),tp=r.forwardRef(e3(function(e,t){let o=tt(tf,e.__scopePopover),i=r.useRef(!1),l=r.useRef(!1);return(0,n.jsx)(th,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(l.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&l.current&&t.preventDefault()}})},"PopoverContentNonModal")),th=r.forwardRef(e3(function(e,t){let{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:h,...g}=e,m=tt(tf,r),v=e4(r);return(0,s.f)(),(0,n.jsx)(f.f,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:(0,n.jsx)(a.V,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,n.jsx)(eX,{"data-state":tm(m.open),role:"dialog",id:m.contentId,...v,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),tg=r.forwardRef(e3(function(e,t){let{__scopePopover:r,...o}=e,i=e4(r);return(0,n.jsx)(eU,{...i,...o,ref:t})},"PopoverArrow"));function tm(e){return e?"open":"closed"}e3(tm,"getState");var tv=e.i(632137);let tx=r.createContext({trigger:"click",onMouseEnter:()=>{},onMouseLeave:()=>{}});e.s(["V",0,function({trigger:e="click",openDelay:t=0,closeDelay:o=300,open:i,onOpenChange:l,...a}){let[s,f]=r.useState(i||!1),u=r.useRef(null),c=r.useRef(null);r.useEffect(()=>{void 0!==i&&f(i)},[i]);let d=r.useCallback(e=>{f(e),l?.(e)},[l]);r.useEffect(()=>()=>{u.current&&clearTimeout(u.current),c.current&&clearTimeout(c.current)},[]);let p=r.useCallback(()=>{"hover"===e&&(c.current&&(clearTimeout(c.current),c.current=null),s||(u.current=setTimeout(()=>{d(!0)},t)))},[e,s,t,d]),h=r.useCallback(()=>{"hover"===e&&(u.current&&(clearTimeout(u.current),u.current=null),c.current=setTimeout(()=>{d(!1)},o))},[e,o,d]),g=r.useMemo(()=>({trigger:e,onMouseEnter:p,onMouseLeave:h}),[e,p,h]);return(0,n.jsx)(tx.Provider,{value:g,children:(0,n.jsx)(tn,{"data-slot":"popover",open:s,onOpenChange:d,...a})})},"r",0,function({...e}){return(0,n.jsx)(tr,{"data-slot":"popover-anchor",...e})},"_",0,function({...e}){return(0,n.jsx)(tg,{"data-slot":"popover-arrow",...e})},"T",0,function({className:e,align:t="center",sideOffset:o=4,children:i,showArrow:l=!0,arrowClassName:a,...s}){let{trigger:f,onMouseEnter:u,onMouseLeave:c}=r.useContext(tx);return(0,n.jsx)(ts,{children:(0,n.jsxs)(tu,{"data-slot":"popover-content",align:t,sideOffset:o,className:(0,tv.f)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-overlay w-72 origin-(--radix-popover-content-transform-origin) rounded-md border-none p-4 shadow-[0_2px_12px_0_#0003] outline-hidden",e),..."hover"===f?{onMouseEnter:u,onMouseLeave:c}:{},...s,children:[l&&(0,n.jsx)(tg,{className:(0,tv.f)("border-none fill-white",a),height:12,width:20}),i]})})},"J",0,function({triggerClass:e,...t}){let{trigger:o,onMouseEnter:i,onMouseLeave:l}=r.useContext(tx);return(0,n.jsx)(to,{"data-slot":"popover-trigger",className:e,..."hover"===o?{onMouseEnter:i,onMouseLeave:l}:{},...t})}],809058)}]);