import{r as e,R as t,a as n,v as r,b as o}from"./react-vendor-DjUmVRt1.js";var i={exports:{}},a={},s=e,c=Symbol.for("react.element"),l=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function p(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)u.call(t,r)&&!f.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:c,type:e,key:i,ref:a,props:o,_owner:d.current}}a.Fragment=l,a.jsx=p,a.jsxs=p,i.exports=a;var m=i.exports;function h(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function v(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function g(...e){return t=>{let n=!1;const r=e.map(e=>{const r=v(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():v(e[t],null)}}}}function y(...t){return e.useCallback(g(...t),t)}function w(t,n=[]){let r=[];const o=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=(null==r?void 0:r[t])||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return o.scopeName=t,[function(n,o){const i=e.createContext(o),a=r.length;r=[...r,o];const s=n=>{var r;const{scope:o,children:s,...c}=n,l=(null==(r=null==o?void 0:o[t])?void 0:r[a])||i,u=e.useMemo(()=>c,Object.values(c));return m.jsx(l.Provider,{value:u,children:s})};return s.displayName=n+"Provider",[s,function(r,s){var c;const l=(null==(c=null==s?void 0:s[t])?void 0:c[a])||i,u=e.useContext(l);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},b(o,...n)]}function b(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}function x(t){const n=E(t),r=e.forwardRef((t,r)=>{const{children:o,...i}=t,a=e.Children.toArray(o),s=a.find(D);if(s){const t=s.props.children,o=a.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m.jsx(n,{...i,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return m.jsx(n,{...i,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}var _=x("Slot");function E(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(i.ref=n?g(n,t):t),e.cloneElement(r,i)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var R=Symbol("radix.slottable");function C(e){const t=({children:e})=>m.jsx(m.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=R,t}function D(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===R}function S(e){const n=e+"CollectionProvider",[r,o]=w(n),[i,a]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return m.jsx(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=n;const c=e+"CollectionSlot",l=x(c),u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=y(t,a(c,n).collectionRef);return m.jsx(l,{ref:o,children:r})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=x(d),h=t.forwardRef((e,n)=>{const{scope:r,children:o,...i}=e,s=t.useRef(null),c=y(n,s),l=a(d,r);return t.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>{l.itemMap.delete(s)})),m.jsx(p,{[f]:"",ref:c,children:o})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const r=a(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}var j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=x(`Primitive.${n}`),o=e.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m.jsx(a,{...i,ref:t})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function O(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}function P(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>{var t;return null==(t=n.current)?void 0:t.call(n,...e)},[])}var M,A="dismissableLayer.update",T="dismissableLayer.pointerDownOutside",I="dismissableLayer.focusOutside",N=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),k=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...l}=t,u=e.useContext(N),[d,f]=e.useState(null),p=(null==d?void 0:d.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,v]=e.useState({}),g=y(n,e=>f(e)),w=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=w.indexOf(b),_=d?w.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,R=_>=x,C=function(t,n=(null==globalThis?void 0:globalThis.document)){const r=P(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){W(T,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));R&&!n&&(null==i||i(e),null==s||s(e),e.defaultPrevented||null==c||c())},p),D=function(t,n=(null==globalThis?void 0:globalThis.document)){const r=P(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){W(I,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==a||a(e),null==s||s(e),e.defaultPrevented||null==c||c())},p);return function(t,n=(null==globalThis?void 0:globalThis.document)){const r=P(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{_===u.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(M=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),L(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=M)}},[d,p,r,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),L())},[d,u]),e.useEffect(()=>{const e=()=>v({});return document.addEventListener(A,e),()=>document.removeEventListener(A,e)},[]),m.jsx(j.div,{...l,ref:g,style:{pointerEvents:E?R?"auto":"none":void 0,...t.style},onFocusCapture:h(t.onFocusCapture,D.onFocusCapture),onBlurCapture:h(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(t.onPointerDownCapture,C.onPointerDownCapture)})});k.displayName="DismissableLayer";var F=e.forwardRef((t,n)=>{const r=e.useContext(N),o=e.useRef(null),i=y(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),m.jsx(j.div,{...t,ref:i})});function L(){const e=new CustomEvent(A);document.dispatchEvent(e)}function W(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?O(o,i):o.dispatchEvent(i)}F.displayName="DismissableLayerBranch";var B=k,K=F,$=(null==globalThis?void 0:globalThis.document)?e.useLayoutEffect:()=>{},V=e.forwardRef((t,n)=>{var o;const{container:i,...a}=t,[s,c]=e.useState(!1);$(()=>c(!0),[]);const l=i||s&&(null==(o=null==globalThis?void 0:globalThis.document)?void 0:o.body);return l?r.createPortal(m.jsx(j.div,{...a,ref:n}),l):null});V.displayName="Portal";var H=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[c,l]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=z(o.current);a.current="mounted"===c?e:"none"},[c]),$(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=z(e);if(t)l("MOUNT");else if("none"===o||"none"===(null==e?void 0:e.display))l("UNMOUNT");else{l(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,l]),$(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=z(o.current).includes(r.animationName);if(r.target===n&&a&&(l("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=z(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=y(o.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function z(e){return(null==e?void 0:e.animationName)||"none"}H.displayName="Presence";var U=o[" useInsertionEffect ".trim().toString()]||$;function G({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),i=e.useRef(r),a=e.useRef(n);return U(()=>{a.current=n},[n]),e.useEffect(()=>{var e;i.current!==r&&(null==(e=a.current)||e.call(a,r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),c=void 0!==t,l=c?t:i;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==c){}n.current=c},[c,o])}const u=e.useCallback(e=>{var n;if(c){const r=function(e){return"function"==typeof e}(e)?e(t):e;r!==t&&(null==(n=s.current)||n.call(s,r))}else a(e)},[c,t,a,s]);return[l,u]}var X=o[" useId ".trim().toString()]||(()=>{}),Y=0;function q(t){const[n,r]=e.useState(X());return $(()=>{r(e=>e??String(Y++))},[t]),t||(n?`radix-${n}`:"")}const Z=["top","right","bottom","left"],J=Math.min,Q=Math.max,ee=Math.round,te=Math.floor,ne=e=>({x:e,y:e}),re={left:"right",right:"left",bottom:"top",top:"bottom"},oe={start:"end",end:"start"};function ie(e,t,n){return Q(e,J(t,n))}function ae(e,t){return"function"==typeof e?e(t):e}function se(e){return e.split("-")[0]}function ce(e){return e.split("-")[1]}function le(e){return"x"===e?"y":"x"}function ue(e){return"y"===e?"height":"width"}const de=new Set(["top","bottom"]);function fe(e){return de.has(se(e))?"y":"x"}function pe(e){return le(fe(e))}function me(e){return e.replace(/start|end/g,e=>oe[e])}const he=["left","right"],ve=["right","left"],ge=["top","bottom"],ye=["bottom","top"];function we(e,t,n,r){const o=ce(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ve:he:t?he:ve;case"left":case"right":return t?ge:ye;default:return[]}}(se(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(me)))),i}function be(e){return e.replace(/left|right|bottom|top/g,e=>re[e])}function xe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function _e(e){const{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 Ee(e,t,n){let{reference:r,floating:o}=e;const i=fe(t),a=pe(t),s=ue(a),c=se(t),l="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ce(t)){case"start":p[a]-=f*(n&&l?-1:1);break;case"end":p[a]+=f*(n&&l?-1:1)}return p}async function Re(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=ae(t,e),m=xe(p),h=s[f?"floating"===d?"reference":"floating":d],v=_e(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=_e(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:c}):g);return{top:(v.top-b.top+m.top)/w.y,bottom:(b.bottom-v.bottom+m.bottom)/w.y,left:(v.left-b.left+m.left)/w.x,right:(b.right-v.right+m.right)/w.x}}function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function De(e){return Z.some(t=>e[t]>=0)}const Se=new Set(["left","top"]);function je(){return"undefined"!=typeof window}function Oe(e){return Ae(e)?(e.nodeName||"").toLowerCase():"#document"}function Pe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Me(e){var t;return null==(t=(Ae(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ae(e){return!!je()&&(e instanceof Node||e instanceof Pe(e).Node)}function Te(e){return!!je()&&(e instanceof Element||e instanceof Pe(e).Element)}function Ie(e){return!!je()&&(e instanceof HTMLElement||e instanceof Pe(e).HTMLElement)}function Ne(e){return!(!je()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot)}const ke=new Set(["inline","contents"]);function Fe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ke.has(o)}const Le=new Set(["table","td","th"]);function We(e){return Le.has(Oe(e))}const Be=[":popover-open",":modal"];function Ke(e){return Be.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const $e=["transform","translate","scale","rotate","perspective"],Ve=["transform","translate","scale","rotate","perspective","filter"],He=["paint","layout","strict","content"];function ze(e){const t=Ue(),n=Te(e)?Ye(e):e;return $e.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ve.some(e=>(n.willChange||"").includes(e))||He.some(e=>(n.contain||"").includes(e))}function Ue(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ge=new Set(["html","body","#document"]);function Xe(e){return Ge.has(Oe(e))}function Ye(e){return Pe(e).getComputedStyle(e)}function qe(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if("html"===Oe(e))return e;const t=e.assignedSlot||e.parentNode||Ne(e)&&e.host||Me(e);return Ne(t)?t.host:t}function Je(e){const t=Ze(e);return Xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ie(t)&&Fe(t)?t:Je(t)}function Qe(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Je(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Pe(o);if(i){const e=et(a);return t.concat(a,a.visualViewport||[],Fe(o)?o:[],e&&n?Qe(e):[])}return t.concat(o,Qe(o,[],n))}function et(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tt(e){const t=Ye(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ie(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ee(n)!==i||ee(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function nt(e){return Te(e)?e:e.contextElement}function rt(e){const t=nt(e);if(!Ie(t))return ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=tt(t);let a=(i?ee(n.width):n.width)/r,s=(i?ee(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ot=ne(0);function it(e){const t=Pe(e);return Ue()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ot}function at(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=nt(e);let a=ne(1);t&&(r?Te(r)&&(a=rt(r)):a=rt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Pe(e))&&t}(i,n,r)?it(i):ne(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Pe(i),t=r&&Te(r)?Pe(r):r;let n=e,o=et(n);for(;o&&r&&t!==n;){const e=rt(o),t=o.getBoundingClientRect(),r=Ye(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=Pe(o),o=et(n)}}return _e({width:u,height:d,x:c,y:l})}function st(e,t){const n=qe(e).scrollLeft;return t?t.left+n:at(Me(e)).left+n}function ct(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:st(e,r)),y:r.top+t.scrollTop}}const lt=new Set(["absolute","fixed"]);function ut(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Pe(e),r=Me(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=Ue();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=Me(e),n=qe(e),r=e.ownerDocument.body,o=Q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+st(e);const s=-n.scrollTop;return"rtl"===Ye(r).direction&&(a+=Q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Me(e));else if(Te(t))r=function(e,t){const n=at(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ie(e)?rt(e):ne(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=it(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _e(r)}function dt(e,t){const n=Ze(e);return!(n===t||!Te(n)||Xe(n))&&("fixed"===Ye(n).position||dt(n,t))}function ft(e,t,n){const r=Ie(t),o=Me(t),i="fixed"===n,a=at(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=ne(0);function l(){c.x=st(o)}if(r||!r&&!i)if(("body"!==Oe(t)||Fe(o))&&(s=qe(t)),r){const e=at(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=!o||r||i?ne(0):ct(o,s);return{x:a.left+s.scrollLeft-c.x-u.x,y:a.top+s.scrollTop-c.y-u.y,width:a.width,height:a.height}}function pt(e){return"static"===Ye(e).position}function mt(e,t){if(!Ie(e)||"fixed"===Ye(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Me(e)===n&&(n=n.ownerDocument.body),n}function ht(e,t){const n=Pe(e);if(Ke(e))return n;if(!Ie(e)){let t=Ze(e);for(;t&&!Xe(t);){if(Te(t)&&!pt(t))return t;t=Ze(t)}return n}let r=mt(e,t);for(;r&&We(r)&&pt(r);)r=mt(r,t);return r&&Xe(r)&&pt(r)&&!ze(r)?n:r||function(e){let t=Ze(e);for(;Ie(t)&&!Xe(t);){if(ze(t))return t;if(Ke(t))return null;t=Ze(t)}return null}(e)||n}const vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Me(r),s=!!t&&Ke(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=ne(1);const u=ne(0),d=Ie(r);if((d||!d&&!i)&&(("body"!==Oe(r)||Fe(a))&&(c=qe(r)),Ie(r))){const e=at(r);l=rt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!a||d||i?ne(0):ct(a,c,!0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}},getDocumentElement:Me,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Ke(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Qe(e,[],!1).filter(e=>Te(e)&&"body"!==Oe(e)),o=null;const i="fixed"===Ye(e).position;let a=i?Ze(e):e;for(;Te(a)&&!Xe(a);){const t=Ye(a),n=ze(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&<.has(o.position)||Fe(a)&&!n&&dt(e,a))?r=r.filter(e=>e!==a):o=t,a=Ze(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=ut(t,n,o);return e.top=Q(r.top,e.top),e.right=J(r.right,e.right),e.bottom=J(r.bottom,e.bottom),e.left=Q(r.left,e.left),e},ut(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ht,getElementRects:async function(e){const t=this.getOffsetParent||ht,n=this.getDimensions,r=await n(e.floating);return{reference:ft(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=tt(e);return{width:t,height:n}},getScale:rt,isElement:Te,isRTL:function(e){return"rtl"===Ye(e).direction}};function gt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yt(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=nt(e),u=o||i?[...l?Qe(l):[],...Qe(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=l&&s?function(e,t){let n,r=null;const o=Me(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;const m={rootMargin:-te(d)+"px "+-te(o.clientWidth-(u+f))+"px "+-te(o.clientHeight-(d+p))+"px "+-te(u)+"px",threshold:Q(0,J(1,c))||1};let h=!0;function v(t){const r=t[0].intersectionRatio;if(r!==c){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||gt(l,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(v,{...m,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(v,m)}r.observe(e)}(!0),i}(l,n):null;let f,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),l&&!c&&m.observe(l),m.observe(t));let h=c?at(e):null;return c&&function t(){const r=at(e);h&&!gt(h,r)&&n();h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(f)}}const wt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=se(n),s=ce(n),c="y"===fe(n),l=Se.has(a)?-1:1,u=i&&c?-1:1,d=ae(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},bt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ae(e,t),l={x:n,y:r},u=await Re(t,c),d=fe(se(o)),f=le(d);let p=l[f],m=l[d];if(i){const e="y"===f?"bottom":"right";p=ie(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";m=ie(m+u["y"===d?"top":"left"],m,m-u[e])}const h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:a}}}}}},xt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=ae(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=se(o),y=fe(s),w=se(s)===s,b=await(null==c.isRTL?void 0:c.isRTL(l.floating)),x=f||(w||!h?[be(s)]:function(e){const t=be(e);return[me(e),t,me(t)]}(s)),_="none"!==m;!f&&_&&x.push(...we(s,h,m,b));const E=[s,...x],R=await Re(t,v),C=[];let D=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(R[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=ce(e),o=pe(e),i=ue(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=be(a)),[a,be(a)]}(o,a,b);C.push(R[e[0]],R[e[1]])}if(D=[...D,{placement:o,overflows:C}],!C.every(e=>e<=0)){var S,j;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=E[e];if(t){if(!("alignment"===d&&y!==fe(t))||D.every(e=>e.overflows[0]>0&&fe(e.placement)===y))return{data:{index:e,overflows:D},reset:{placement:t}}}let n=null==(j=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=D.filter(e=>{if(_){const t=fe(e.placement);return t===y||"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:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},_t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:c=()=>{},...l}=ae(e,t),u=await Re(t,l),d=se(o),f=ce(o),p="y"===fe(o),{width:m,height:h}=i.floating;let v,g;"top"===d||"bottom"===d?(v=d,g=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,v="end"===f?"top":"bottom");const y=h-u.top-u.bottom,w=m-u.left-u.right,b=J(h-u[v],y),x=J(m-u[g],w),_=!t.middlewareData.shift;let E=b,R=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(R=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),_&&!f){const e=Q(u.left,0),t=Q(u.right,0),n=Q(u.top,0),r=Q(u.bottom,0);p?R=m-2*(0!==e||0!==t?e+t:Q(u.left,u.right)):E=h-2*(0!==n||0!==r?n+r:Q(u.top,u.bottom))}await c({...t,availableWidth:R,availableHeight:E});const C=await a.getDimensions(s.floating);return m!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Et=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ae(e,t);switch(r){case"referenceHidden":{const e=Ce(await Re(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:De(e)}}}case"escaped":{const e=Ce(await Re(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:De(e)}}}default:return{}}}}},Rt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ae(e,t)||{};if(null==l)return{};const d=xe(u),f={x:n,y:r},p=pe(o),m=ue(p),h=await a.getDimensions(l),v="y"===p,g=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-f[p]-i.floating[m],x=f[p]-i.reference[p],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let E=_?_[w]:0;E&&await(null==a.isElement?void 0:a.isElement(_))||(E=s.floating[w]||i.floating[m]);const R=b/2-x/2,C=E/2-h[m]/2-1,D=J(d[g],C),S=J(d[y],C),j=D,O=E-h[m]-S,P=E/2-h[m]/2+R,M=ie(j,P,O),A=!c.arrow&&null!=ce(o)&&P!==M&&i.reference[m]/2-(P<j?D:S)-h[m]/2<0,T=A?P<j?P-j:P-O:0;return{[p]:f[p]+T,data:{[p]:M,centerOffset:P-M-T,...A&&{alignmentOffset:T}},reset:A}}}),Ct=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ae(e,t),u={x:n,y:r},d=fe(o),f=le(d);let p=u[f],m=u[d];const h=ae(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+v.mainAxis,n=i.reference[f]+i.reference[e]-v.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var g,y;const e="y"===f?"width":"height",t=Se.has(se(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:v.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?v.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Dt=(e,t,n)=>{const r=new Map,o={platform:vt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ee(l,r,c),f=r,p={},m=0;for(let h=0;h<s.length;h++){const{name:n,fn:i}=s[h],{x:v,y:g,data:y,reset:w}=await i({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=g?g:d,p={...p,[n]:{...p[n],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(l=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:d}=Ee(l,f,c))),h=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var St="undefined"!=typeof document?e.useLayoutEffect:function(){};function jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!jt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!jt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ot(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pt(e,t){const n=Ot(e);return Math.round(t*n)/n}function Mt(t){const n=e.useRef(t);return St(()=>{n.current=t}),n}const At=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Rt({element:n.current,padding:r}).fn(t):{}:n?Rt({element:n,padding:r}).fn(t):{};var o}}),Tt=(e,t)=>({...wt(e),options:[e,t]}),It=(e,t)=>({...bt(e),options:[e,t]}),Nt=(e,t)=>({...Ct(e),options:[e,t]}),kt=(e,t)=>({...xt(e),options:[e,t]}),Ft=(e,t)=>({..._t(e),options:[e,t]}),Lt=(e,t)=>({...Et(e),options:[e,t]}),Wt=(e,t)=>({...At(e),options:[e,t]});var Bt=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(j.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bt.displayName="Arrow";var Kt=Bt;function $t(t){const[n,r]=e.useState(void 0);return $(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var Vt="Popper",[Ht,zt]=w(Vt),[Ut,Gt]=Ht(Vt),Xt=t=>{const{__scopePopper:n,children:r}=t,[o,i]=e.useState(null);return m.jsx(Ut,{scope:n,anchor:o,onAnchorChange:i,children:r})};Xt.displayName=Vt;var Yt="PopperAnchor",qt=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...i}=t,a=Gt(Yt,r),s=e.useRef(null),c=y(n,s);return e.useEffect(()=>{a.onAnchorChange((null==o?void 0:o.current)||s.current)}),o?null:m.jsx(j.div,{...i,ref:c})});qt.displayName=Yt;var Zt="PopperContent",[Jt,Qt]=Ht(Zt),en=e.forwardRef((t,r)=>{var o,i,a,s,c,l;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:p="center",alignOffset:h=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:w=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:_=!1,updatePositionStrategy:E="optimized",onPlaced:R,...C}=t,D=Gt(Zt,u),[S,O]=e.useState(null),M=y(r,e=>O(e)),[A,T]=e.useState(null),I=$t(A),N=(null==I?void 0:I.width)??0,k=(null==I?void 0:I.height)??0,F=d+("center"!==p?"-"+p:""),L="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},W=Array.isArray(w)?w:[w],B=W.length>0,K={padding:L,boundary:W.filter(on),altBoundary:B},{refs:V,floatingStyles:H,placement:z,isPositioned:U,middlewareData:G}=function(t){void 0===t&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=e.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(i);jt(m,i)||h(i);const[v,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),x=e.useCallback(e=>{e!==C.current&&(C.current=e,w(e))},[]),_=s||v,E=c||y,R=e.useRef(null),C=e.useRef(null),D=e.useRef(f),S=null!=u,j=Mt(u),O=Mt(a),P=Mt(d),M=e.useCallback(()=>{if(!R.current||!C.current)return;const e={placement:r,strategy:o,middleware:m};O.current&&(e.platform=O.current),Dt(R.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!jt(D.current,t)&&(D.current=t,n.flushSync(()=>{p(t)}))})},[m,r,o,O,P]);St(()=>{!1===d&&D.current.isPositioned&&(D.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=e.useRef(!1);St(()=>(A.current=!0,()=>{A.current=!1}),[]),St(()=>{if(_&&(R.current=_),E&&(C.current=E),_&&E){if(j.current)return j.current(_,E,M);M()}},[_,E,M,j,S]);const T=e.useMemo(()=>({reference:R,floating:C,setReference:b,setFloating:x}),[b,x]),I=e.useMemo(()=>({reference:_,floating:E}),[_,E]),N=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!I.floating)return e;const t=Pt(I.floating,f.x),n=Pt(I.floating,f.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Ot(I.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,l,I.floating,f.x,f.y]);return e.useMemo(()=>({...f,update:M,refs:T,elements:I,floatingStyles:N}),[f,M,T,I,N])}({strategy:"fixed",placement:F,whileElementsMounted:(...e)=>yt(...e,{animationFrame:"always"===E}),elements:{reference:D.anchor},middleware:[Tt({mainAxis:f+k,alignmentAxis:h}),g&&It({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?Nt():void 0,...K}),g&&kt({...K}),Ft({...K,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),A&&Wt({element:A,padding:v}),an({arrowWidth:N,arrowHeight:k}),_&&Lt({strategy:"referenceHidden",...K})]}),[X,Y]=sn(z),q=P(R);$(()=>{U&&(null==q||q())},[U,q]);const Z=null==(o=G.arrow)?void 0:o.x,J=null==(i=G.arrow)?void 0:i.y,Q=0!==(null==(a=G.arrow)?void 0:a.centerOffset),[ee,te]=e.useState();return $(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),m.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:U?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[null==(s=G.transformOrigin)?void 0:s.x,null==(c=G.transformOrigin)?void 0:c.y].join(" "),...(null==(l=G.hide)?void 0:l.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(Jt,{scope:u,placedSide:X,onArrowChange:T,arrowX:Z,arrowY:J,shouldHideArrow:Q,children:m.jsx(j.div,{"data-side":X,"data-align":Y,...C,ref:M,style:{...C.style,animation:U?void 0:"none"}})})})});en.displayName=Zt;var tn="PopperArrow",nn={top:"bottom",right:"left",bottom:"top",left:"right"},rn=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Qt(tn,n),i=nn[o.placedSide];return m.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:m.jsx(Kt,{...r,ref:t,style:{...r.style,display:"block"}})})});function on(e){return null!==e}rn.displayName=tn;var an=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:a,middlewareData:s}=t,c=0!==(null==(n=s.arrow)?void 0:n.centerOffset),l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=sn(i),p={start:"0%",center:"50%",end:"100%"}[f],m=((null==(r=s.arrow)?void 0:r.x)??0)+l/2,h=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",g="";return"bottom"===d?(v=c?p:`${m}px`,g=-u+"px"):"top"===d?(v=c?p:`${m}px`,g=`${a.floating.height+u}px`):"right"===d?(v=-u+"px",g=c?p:`${h}px`):"left"===d&&(v=`${a.floating.width+u}px`,g=c?p:`${h}px`),{data:{x:v,y:g}}}});function sn(e){const[t,n="center"]=e.split("-");return[t,n]}var cn=Xt,ln=qt,un=en,dn=rn,fn=function(e,t){return(fn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function pn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}fn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var mn=function(){return mn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},mn.apply(this,arguments)};function hn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function vn(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function gn(e,t){return function(n,r){t(n,r,e)}}function yn(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=r.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]="access"===h?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var v=(0,n[p])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(d.get=s),(s=a(v.set))&&(d.set=s),(s=a(v.init))&&o.unshift(s)}else(s=a(v))&&("field"===c?o.unshift(s):d[l]=s)}u&&Object.defineProperty(u,r.name,d),f=!0}function wn(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function bn(e){return"symbol"==typeof e?e:"".concat(e)}function xn(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function _n(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function En(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(t){i(t)}}function s(e){try{c(r.throw(e))}catch(t){i(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})}function Rn(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(c){s=[6,c],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var Cn=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function Dn(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Cn(t,e,n)}function Sn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function jn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function On(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(jn(arguments[t]));return e}function Pn(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function Mn(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function An(e){return this instanceof An?(this.v=e,this):new An(e)}function Tn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||s(e,t)})},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=o[e](t)).value instanceof An?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(r){u(i[0][3],r)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function In(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:An(e[r](t)),done:!1}:o?o(t):t}:o}}function Nn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Sn(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}function kn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Fn=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Ln=function(e){return(Ln=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)};function Wn(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=Ln(e),r=0;r<n.length;r++)"default"!==n[r]&&Cn(t,e,n[r]);return Fn(t,e),t}function Bn(e){return e&&e.__esModule?e:{default:e}}function Kn(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function $n(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function Vn(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function Hn(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var zn="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function Un(e){function t(t){e.error=e.hasError?new zn(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function o(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else r|=1}catch(a){t(a)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function Gn(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,n,r,o,i){return n?t?".jsx":".js":!r||o&&i?r+o+"."+i.toLowerCase()+"js":e}):e}const Xn={__extends:pn,__assign:mn,__rest:hn,__decorate:vn,__param:gn,__esDecorate:yn,__runInitializers:wn,__propKey:bn,__setFunctionName:xn,__metadata:_n,__awaiter:En,__generator:Rn,__createBinding:Cn,__exportStar:Dn,__values:Sn,__read:jn,__spread:On,__spreadArrays:Pn,__spreadArray:Mn,__await:An,__asyncGenerator:Tn,__asyncDelegator:In,__asyncValues:Nn,__makeTemplateObject:kn,__importStar:Wn,__importDefault:Bn,__classPrivateFieldGet:Kn,__classPrivateFieldSet:$n,__classPrivateFieldIn:Vn,__addDisposableResource:Hn,__disposeResources:Un,__rewriteRelativeImportExtension:Gn},Yn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Hn,get __assign(){return mn},__asyncDelegator:In,__asyncGenerator:Tn,__asyncValues:Nn,__await:An,__awaiter:En,__classPrivateFieldGet:Kn,__classPrivateFieldIn:Vn,__classPrivateFieldSet:$n,__createBinding:Cn,__decorate:vn,__disposeResources:Un,__esDecorate:yn,__exportStar:Dn,__extends:pn,__generator:Rn,__importDefault:Bn,__importStar:Wn,__makeTemplateObject:kn,__metadata:_n,__param:gn,__propKey:bn,__read:jn,__rest:hn,__rewriteRelativeImportExtension:Gn,__runInitializers:wn,__setFunctionName:xn,__spread:On,__spreadArray:Mn,__spreadArrays:Pn,__values:Sn,default:Xn},Symbol.toStringTag,{value:"Module"}));var qn=e.createContext(void 0);function Zn(t){const n=e.useContext(qn);return t||n||"ltr"}var Jn=0;function Qn(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??er()),document.body.insertAdjacentElement("beforeend",e[1]??er()),Jn++,()=>{1===Jn&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jn--}},[])}function er(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tr="focusScope.autoFocusOnMount",nr="focusScope.autoFocusOnUnmount",rr={bubbles:!1,cancelable:!0},or=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[c,l]=e.useState(null),u=P(i),d=P(a),f=e.useRef(null),p=y(n,e=>l(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:cr(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||cr(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&cr(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,c,h.paused]),e.useEffect(()=>{if(c){lr.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(tr,rr);c.addEventListener(tr,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(cr(r,{select:t}),document.activeElement!==n)return}((e=ir(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&cr(c))}return()=>{c.removeEventListener(tr,u),setTimeout(()=>{const e=new CustomEvent(nr,rr);c.addEventListener(nr,d),c.dispatchEvent(e),e.defaultPrevented||cr(t??document.body,{select:!0}),c.removeEventListener(nr,d),lr.remove(h)},0)}}var e},[c,u,d,h]);const v=e.useCallback(e=>{if(!r&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,i]=function(e){const t=ir(e),n=ar(t,e),r=ar(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&cr(i,{select:!0})):(e.preventDefault(),r&&cr(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return m.jsx(j.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})});function ir(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ar(e,t){for(const n of e)if(!sr(n,{upTo:t}))return n}function sr(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function cr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}or.displayName="FocusScope";var lr=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=ur(e,t),e.unshift(t)},remove(t){var n;e=ur(e,t),null==(n=e[0])||n.resume()}}}();function ur(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var dr="rovingFocusGroup.onEntryFocus",fr={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[mr,hr,vr]=S(pr),[gr,yr]=w(pr,[vr]),[wr,br]=gr(pr),xr=e.forwardRef((e,t)=>m.jsx(mr.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(mr.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(_r,{...e,ref:t})})}));xr.displayName=pr;var _r=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,p=e.useRef(null),v=y(n,p),g=Zn(a),[w,b]=G({prop:s,defaultProp:c??null,onChange:l,caller:pr}),[x,_]=e.useState(!1),E=P(u),R=hr(r),C=e.useRef(!1),[D,S]=e.useState(0);return e.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(dr,E),()=>e.removeEventListener(dr,E)},[E]),m.jsx(wr,{scope:r,orientation:o,dir:g,loop:i,currentTabStopId:w,onItemFocus:e.useCallback(e=>b(e),[b]),onItemShiftTab:e.useCallback(()=>_(!0),[]),onFocusableItemAdd:e.useCallback(()=>S(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>S(e=>e-1),[]),children:m.jsx(j.div,{tabIndex:x||0===D?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:h(t.onMouseDown,()=>{C.current=!0}),onFocus:h(t.onFocus,e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(dr,fr);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=R().filter(e=>e.focusable);Dr([e.find(e=>e.active),e.find(e=>e.id===w),...e].filter(Boolean).map(e=>e.ref.current),d)}}C.current=!1}),onBlur:h(t.onBlur,()=>_(!1))})})}),Er="RovingFocusGroupItem",Rr=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:a,children:s,...c}=t,l=q(),u=a||l,d=br(Er,r),f=d.currentTabStopId===u,p=hr(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:y}=d;return e.useEffect(()=>{if(o)return v(),()=>g()},[o,v,g]),m.jsx(mr.ItemSlot,{scope:r,id:u,focusable:o,active:i,children:m.jsx(j.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:h(t.onMouseDown,e=>{o?d.onItemFocus(u):e.preventDefault()}),onFocus:h(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:h(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Cr[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=p().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>Dr(o))}var n,r}),children:"function"==typeof s?s({isCurrentTabStop:f,hasTabStop:null!=y}):s})})});Rr.displayName=Er;var Cr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dr(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var Sr=xr,jr=Rr,Or=new WeakMap,Pr=new WeakMap,Mr={},Ar=0,Tr=function(e){return e&&(e.host||Tr(e.parentNode))},Ir=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Tr(t);return n&&e.contains(n)?n:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Mr[n]||(Mr[n]=new WeakMap);var i=Mr[n],a=[],s=new Set,c=new Set(o),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};o.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,c=(Or.get(e)||0)+1,l=(i.get(e)||0)+1;Or.set(e,c),i.set(e,l),a.push(e),1===c&&o&&Pr.set(e,!0),1===l&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){}})};return u(t),s.clear(),Ar++,function(){a.forEach(function(e){var t=Or.get(e)-1,o=i.get(e)-1;Or.set(e,t),i.set(e,o),t||(Pr.has(e)||e.removeAttribute(r),Pr.delete(e)),o||e.removeAttribute(n)}),--Ar||(Or=new WeakMap,Or=new WeakMap,Pr=new WeakMap,Mr={})}},Nr=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ir(r,o,n,"aria-hidden")):function(){return null}},kr="right-scroll-bar-position",Fr="width-before-scroll-bar";function Lr(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Wr="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Br=new WeakMap;function Kr(t,n){var r,o,i,a=(r=null,o=function(e){return t.forEach(function(t){return Lr(t,e)})},(i=e.useState(function(){return{value:r,callback:o,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=o,i.facade);return Wr(function(){var e=Br.get(a);if(e){var n=new Set(e),r=new Set(t),o=a.current;n.forEach(function(e){r.has(e)||Lr(e,null)}),r.forEach(function(e){n.has(e)||Lr(e,o)})}Br.set(a,t)},[t]),a}function $r(e){return e}var Vr=function(t){var n=t.sideCar,r=hn(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,mn({},r))};Vr.isSideCarExport=!0;var Hr=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$r);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=mn({async:!0,ssr:!1},e),t}(),zr=function(){},Ur=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:zr,onWheelCapture:zr,onTouchMoveCapture:zr}),i=o[0],a=o[1],s=t.forwardProps,c=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,m=t.noRelative,h=t.noIsolation,v=t.inert,g=t.allowPinchZoom,y=t.as,w=void 0===y?"div":y,b=t.gapMode,x=hn(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=p,E=Kr([r,n]),R=mn(mn({},x),i);return e.createElement(e.Fragment,null,d&&e.createElement(_,{sideCar:Hr,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:v,setCallbacks:a,allowPinchZoom:!!g,lockRef:r,gapMode:b}),s?e.cloneElement(e.Children.only(c),mn(mn({},R),{ref:E})):e.createElement(w,mn({},R,{className:l,ref:E}),c))});Ur.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ur.classNames={fullWidth:Fr,zeroRight:kr};function Gr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Xr=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Gr())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yr=function(){var t,n=(t=Xr(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},qr={left:0,top:0,right:0,gap:0},Zr=function(e){return parseInt(e||"",10)||0},Jr=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return qr;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Zr(n),Zr(r),Zr(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Qr=Yr(),eo="data-scroll-locked",to=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(eo,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(kr," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Fr," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(kr," .").concat(kr," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Fr," .").concat(Fr," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(eo,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},no=function(){var e=parseInt(document.body.getAttribute(eo)||"0",10);return isFinite(e)?e:0},ro=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(eo,(no()+1).toString()),function(){var e=no()-1;e<=0?document.body.removeAttribute(eo):document.body.setAttribute(eo,e.toString())}},[]);var a=e.useMemo(function(){return Jr(i)},[i]);return e.createElement(Qr,{styles:to(a,!n,i,r?"":"!important")})},oo=!1;if("undefined"!=typeof window)try{var io=Object.defineProperty({},"passive",{get:function(){return oo=!0,!0}});window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch(wc){oo=!1}var ao=!!oo&&{passive:!1},so=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},co=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),lo(e,r)){var o=uo(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lo=function(e,t){return"v"===e?function(e){return so(e,"overflowY")}(t):function(e){return so(e,"overflowX")}(t)},uo=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},fo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},po=function(e){return[e.deltaX,e.deltaY]},mo=function(e){return e&&"current"in e?e.current:e},ho=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},vo=0,go=[];function yo(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wo=(bo=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(vo++)[0],a=e.useState(Yr)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=Mn([t.lockRef.current],(t.shards||[]).map(mo),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var c=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,i=fo(e),a=r.current,c="deltaX"in e?e.deltaX:a[0]-i[0],l="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=co(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=co(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(c||l)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,s=t.contains(a),c=!1,l=i>0,u=0,d=0;do{if(!a)break;var f=uo(e,a),p=f[0],m=f[1]-f[2]-o*p;(p||m)&&lo(e,a)&&(u+=m,d+=p);var h=a.parentNode;a=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(p,t,e,"h"===p?c:l)},[]),l=e.useCallback(function(e){var t=e;if(go.length&&go[go.length-1]===a){var r="deltaY"in t?po(t):fo(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map(mo).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?c(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:yo(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),d=e.useCallback(function(e){r.current=fo(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,po(e),e.target,c(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,fo(e),e.target,c(e,t.lockRef.current))},[]);e.useEffect(function(){return go.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",d,ao),function(){go=go.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",d,ao)}},[]);var m=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(a,{styles:ho(i)}):null,m?e.createElement(ro,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Hr.useMedium(bo),Vr);var bo,xo=e.forwardRef(function(t,n){return e.createElement(Ur,mn({},t,{ref:n,sideCar:wo}))});xo.classNames=Ur.classNames;var _o=["Enter"," "],Eo=["ArrowUp","PageDown","End"],Ro=["ArrowDown","PageUp","Home",...Eo],Co={ltr:[..._o,"ArrowRight"],rtl:[..._o,"ArrowLeft"]},Do={ltr:["ArrowLeft"],rtl:["ArrowRight"]},So="Menu",[jo,Oo,Po]=S(So),[Mo,Ao]=w(So,[Po,zt,yr]),To=zt(),Io=yr(),[No,ko]=Mo(So),[Fo,Lo]=Mo(So),Wo=t=>{const{__scopeMenu:n,open:r=!1,children:o,dir:i,onOpenChange:a,modal:s=!0}=t,c=To(n),[l,u]=e.useState(null),d=e.useRef(!1),f=P(a),p=Zn(i);return e.useEffect(()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),m.jsx(cn,{...c,children:m.jsx(No,{scope:n,open:r,onOpenChange:f,content:l,onContentChange:u,children:m.jsx(Fo,{scope:n,onClose:e.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:o})})})};Wo.displayName=So;var Bo=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=To(n);return m.jsx(ln,{...o,...r,ref:t})});Bo.displayName="MenuAnchor";var Ko="MenuPortal",[$o,Vo]=Mo(Ko,{forceMount:void 0}),Ho=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=ko(Ko,t);return m.jsx($o,{scope:t,forceMount:n,children:m.jsx(H,{present:n||i.open,children:m.jsx(V,{asChild:!0,container:o,children:r})})})};Ho.displayName=Ko;var zo="MenuContent",[Uo,Go]=Mo(zo),Xo=e.forwardRef((e,t)=>{const n=Vo(zo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ko(zo,e.__scopeMenu),a=Lo(zo,e.__scopeMenu);return m.jsx(jo.Provider,{scope:e.__scopeMenu,children:m.jsx(H,{present:r||i.open,children:m.jsx(jo.Slot,{scope:e.__scopeMenu,children:a.modal?m.jsx(Yo,{...o,ref:t}):m.jsx(qo,{...o,ref:t})})})})}),Yo=e.forwardRef((t,n)=>{const r=ko(zo,t.__scopeMenu),o=e.useRef(null),i=y(n,o);return e.useEffect(()=>{const e=o.current;if(e)return Nr(e)},[]),m.jsx(Jo,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:h(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),qo=e.forwardRef((e,t)=>{const n=ko(zo,e.__scopeMenu);return m.jsx(Jo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zo=x("MenuContent.ScrollLock"),Jo=e.forwardRef((t,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...w}=t,b=ko(zo,r),x=Lo(zo,r),_=To(r),E=Io(r),R=Oo(r),[C,D]=e.useState(null),S=e.useRef(null),j=y(n,S,b.onContentChange),O=e.useRef(0),P=e.useRef(""),M=e.useRef(0),A=e.useRef(null),T=e.useRef("right"),I=e.useRef(0),N=g?xo:e.Fragment,F=g?{as:Zo,allowPinchZoom:!0}:void 0,L=e=>{var t,n;const r=P.current+e,o=R().filter(e=>!e.disabled),i=document.activeElement,a=null==(t=o.find(e=>e.ref.current===i))?void 0:t.textValue,s=function(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,c=Math.max(i,0),s.map((e,t)=>s[(c+t)%s.length]));var s,c;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}(o.map(e=>e.textValue),r,a),c=null==(n=o.find(e=>e.textValue===s))?void 0:n.ref.current;!function e(t){P.current=t,window.clearTimeout(O.current),""!==t&&(O.current=window.setTimeout(()=>e(""),1e3))}(r),c&&setTimeout(()=>c.focus())};e.useEffect(()=>()=>window.clearTimeout(O.current),[]),Qn();const W=e.useCallback(e=>{var t,n;return T.current===(null==(t=A.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const e=t[i],s=t[a],c=e.x,l=e.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(o=!o)}return o}(n,t)}(e,null==(n=A.current)?void 0:n.area)},[]);return m.jsx(Uo,{scope:r,searchRef:P,onItemEnter:e.useCallback(e=>{W(e)&&e.preventDefault()},[W]),onItemLeave:e.useCallback(e=>{var t;W(e)||(null==(t=S.current)||t.focus(),D(null))},[W]),onTriggerLeave:e.useCallback(e=>{W(e)&&e.preventDefault()},[W]),pointerGraceTimerRef:M,onPointerGraceIntentChange:e.useCallback(e=>{A.current=e},[]),children:m.jsx(N,{...F,children:m.jsx(or,{asChild:!0,trapped:i,onMountAutoFocus:h(a,e=>{var t;e.preventDefault(),null==(t=S.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:m.jsx(k,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(Sr,{asChild:!0,...E,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:D,onEntryFocus:h(l,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(un,{role:"menu","aria-orientation":"vertical","data-state":Ri(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:j,style:{outline:"none",...w.style},onKeyDown:h(w.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&L(e.key));const o=S.current;if(e.target!==o)return;if(!Ro.includes(e.key))return;e.preventDefault();const i=R().filter(e=>!e.disabled).map(e=>e.ref.current);Eo.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)}),onBlur:h(t.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),P.current="")}),onPointerMove:h(t.onPointerMove,Si(e=>{const t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>I.current?"right":"left";T.current=t,I.current=e.clientX}}))})})})})})})});Xo.displayName=zo;var Qo=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(j.div,{role:"group",...r,ref:t})});Qo.displayName="MenuGroup";var ei=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(j.div,{...r,ref:t})});ei.displayName="MenuLabel";var ti="MenuItem",ni="menu.itemSelect",ri=e.forwardRef((t,n)=>{const{disabled:r=!1,onSelect:o,...i}=t,a=e.useRef(null),s=Lo(ti,t.__scopeMenu),c=Go(ti,t.__scopeMenu),l=y(n,a),u=e.useRef(!1);return m.jsx(oi,{...i,ref:l,disabled:r,onClick:h(t.onClick,()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(ni,{bubbles:!0,cancelable:!0});e.addEventListener(ni,e=>null==o?void 0:o(e),{once:!0}),O(e,t),t.defaultPrevented?u.current=!1:s.onClose()}}),onPointerDown:e=>{var n;null==(n=t.onPointerDown)||n.call(t,e),u.current=!0},onPointerUp:h(t.onPointerUp,e=>{var t;u.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:h(t.onKeyDown,e=>{const t=""!==c.searchRef.current;r||t&&" "===e.key||_o.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ri.displayName=ti;var oi=e.forwardRef((t,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:i,...a}=t,s=Go(ti,r),c=Io(r),l=e.useRef(null),u=y(n,l),[d,f]=e.useState(!1),[p,v]=e.useState("");return e.useEffect(()=>{const e=l.current;e&&v((e.textContent??"").trim())},[a.children]),m.jsx(jo.ItemSlot,{scope:r,disabled:o,textValue:i??p,children:m.jsx(jr,{asChild:!0,...c,focusable:!o,children:m.jsx(j.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:u,onPointerMove:h(t.onPointerMove,Si(e=>{if(o)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:h(t.onPointerLeave,Si(e=>s.onItemLeave(e))),onFocus:h(t.onFocus,()=>f(!0)),onBlur:h(t.onBlur,()=>f(!1))})})})}),ii=e.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(pi,{scope:e.__scopeMenu,checked:n,children:m.jsx(ri,{role:"menuitemcheckbox","aria-checked":Ci(n)?"mixed":n,...o,ref:t,"data-state":Di(n),onSelect:h(o.onSelect,()=>null==r?void 0:r(!!Ci(n)||!n),{checkForDefaultPrevented:!1})})})});ii.displayName="MenuCheckboxItem";var ai="MenuRadioGroup",[si,ci]=Mo(ai,{value:void 0,onValueChange:()=>{}}),li=e.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=P(r);return m.jsx(si,{scope:e.__scopeMenu,value:n,onValueChange:i,children:m.jsx(Qo,{...o,ref:t})})});li.displayName=ai;var ui="MenuRadioItem",di=e.forwardRef((e,t)=>{const{value:n,...r}=e,o=ci(ui,e.__scopeMenu),i=n===o.value;return m.jsx(pi,{scope:e.__scopeMenu,checked:i,children:m.jsx(ri,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Di(i),onSelect:h(r.onSelect,()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)},{checkForDefaultPrevented:!1})})})});di.displayName=ui;var fi="MenuItemIndicator",[pi,mi]=Mo(fi,{checked:!1}),hi=e.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=mi(fi,n);return m.jsx(H,{present:r||Ci(i.checked)||!0===i.checked,children:m.jsx(j.span,{...o,ref:t,"data-state":Di(i.checked)})})});hi.displayName=fi;var vi=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(j.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});vi.displayName="MenuSeparator";var gi=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=To(n);return m.jsx(dn,{...o,...r,ref:t})});gi.displayName="MenuArrow";var[yi,wi]=Mo("MenuSub"),bi="MenuSubTrigger",xi=e.forwardRef((t,n)=>{const r=ko(bi,t.__scopeMenu),o=Lo(bi,t.__scopeMenu),i=wi(bi,t.__scopeMenu),a=Go(bi,t.__scopeMenu),s=e.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:t.__scopeMenu},d=e.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return e.useEffect(()=>d,[d]),e.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]),m.jsx(Bo,{asChild:!0,...u,children:m.jsx(oi,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Ri(r.open),...t,ref:g(n,i.onTriggerChange),onClick:e=>{var n;null==(n=t.onClick)||n.call(t,e),t.disabled||e.defaultPrevented||(e.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:h(t.onPointerMove,Si(e=>{a.onItemEnter(e),e.defaultPrevented||t.disabled||r.open||s.current||(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:h(t.onPointerLeave,Si(e=>{var t,n;d();const o=null==(t=r.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(n=r.content)?void 0:n.dataset.side,i="right"===t,s=i?-5:5,l=o[i?"left":"right"],u=o[i?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:h(t.onKeyDown,e=>{var n;const i=""!==a.searchRef.current;t.disabled||i&&" "===e.key||Co[o.dir].includes(e.key)&&(r.onOpenChange(!0),null==(n=r.content)||n.focus(),e.preventDefault())})})})});xi.displayName=bi;var _i="MenuSubContent",Ei=e.forwardRef((t,n)=>{const r=Vo(zo,t.__scopeMenu),{forceMount:o=r.forceMount,...i}=t,a=ko(zo,t.__scopeMenu),s=Lo(zo,t.__scopeMenu),c=wi(_i,t.__scopeMenu),l=e.useRef(null),u=y(n,l);return m.jsx(jo.Provider,{scope:t.__scopeMenu,children:m.jsx(H,{present:o||a.open,children:m.jsx(jo.Slot,{scope:t.__scopeMenu,children:m.jsx(Jo,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:h(t.onFocusOutside,e=>{e.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:h(t.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:h(t.onKeyDown,e=>{var t;const n=e.currentTarget.contains(e.target),r=Do[s.dir].includes(e.key);n&&r&&(a.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function Ri(e){return e?"open":"closed"}function Ci(e){return"indeterminate"===e}function Di(e){return Ci(e)?"indeterminate":e?"checked":"unchecked"}function Si(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ei.displayName=_i;var ji=Wo,Oi=Bo,Pi=Ho,Mi=Xo,Ai=Qo,Ti=ei,Ii=ri,Ni=ii,ki=li,Fi=di,Li=hi,Wi=vi,Bi=gi,Ki=xi,$i=Ei,Vi="DropdownMenu",[Hi]=w(Vi,[Ao]),zi=Ao(),[Ui,Gi]=Hi(Vi),Xi=t=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=t,l=zi(n),u=e.useRef(null),[d,f]=G({prop:i,defaultProp:a??!1,onChange:s,caller:Vi});return m.jsx(Ui,{scope:n,triggerId:q(),triggerRef:u,contentId:q(),open:d,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:c,children:m.jsx(ji,{...l,open:d,onOpenChange:f,dir:o,modal:c,children:r})})};Xi.displayName=Vi;var Yi="DropdownMenuTrigger",qi=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Gi(Yi,n),a=zi(n);return m.jsx(Oi,{asChild:!0,...a,children:m.jsx(j.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:g(t,i.triggerRef),onPointerDown:h(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:h(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});qi.displayName=Yi;var Zi=e=>{const{__scopeDropdownMenu:t,...n}=e,r=zi(t);return m.jsx(Pi,{...r,...n})};Zi.displayName="DropdownMenuPortal";var Ji="DropdownMenuContent",Qi=e.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=Gi(Ji,r),a=zi(r),s=e.useRef(!1);return m.jsx(Mi,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...o,ref:n,onCloseAutoFocus:h(t.onCloseAutoFocus,e=>{var t;s.current||null==(t=i.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()}),onInteractOutside:h(t.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.modal&&!r||(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qi.displayName=Ji;e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Ai,{...o,...r,ref:t})}).displayName="DropdownMenuGroup";var ea=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Ti,{...o,...r,ref:t})});ea.displayName="DropdownMenuLabel";var ta=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Ii,{...o,...r,ref:t})});ta.displayName="DropdownMenuItem";var na=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Ni,{...o,...r,ref:t})});na.displayName="DropdownMenuCheckboxItem";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(ki,{...o,...r,ref:t})}).displayName="DropdownMenuRadioGroup";var ra=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Fi,{...o,...r,ref:t})});ra.displayName="DropdownMenuRadioItem";var oa=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Li,{...o,...r,ref:t})});oa.displayName="DropdownMenuItemIndicator";var ia=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Wi,{...o,...r,ref:t})});ia.displayName="DropdownMenuSeparator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Bi,{...o,...r,ref:t})}).displayName="DropdownMenuArrow";var aa=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx(Ki,{...o,...r,ref:t})});aa.displayName="DropdownMenuSubTrigger";var sa=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zi(n);return m.jsx($i,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sa.displayName="DropdownMenuSubContent";var ca=Xi,la=qi,ua=Zi,da=Qi,fa=ea,pa=ta,ma=na,ha=ra,va=oa,ga=ia,ya=aa,wa=sa,ba="Dialog",[xa,_a]=w(ba),[Ea,Ra]=xa(ba),Ca=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,c=e.useRef(null),l=e.useRef(null),[u,d]=G({prop:o,defaultProp:i??!1,onChange:a,caller:ba});return m.jsx(Ea,{scope:n,triggerRef:c,contentRef:l,contentId:q(),titleId:q(),descriptionId:q(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};Ca.displayName=ba;var Da="DialogTrigger",Sa=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ra(Da,n),i=y(t,o.triggerRef);return m.jsx(j.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ga(o.open),...r,ref:i,onClick:h(e.onClick,o.onOpenToggle)})});Sa.displayName=Da;var ja="DialogPortal",[Oa,Pa]=xa(ja,{forceMount:void 0}),Ma=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=t,a=Ra(ja,n);return m.jsx(Oa,{scope:n,forceMount:r,children:e.Children.map(o,e=>m.jsx(H,{present:r||a.open,children:m.jsx(V,{asChild:!0,container:i,children:e})}))})};Ma.displayName=ja;var Aa="DialogOverlay",Ta=e.forwardRef((e,t)=>{const n=Pa(Aa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ra(Aa,e.__scopeDialog);return i.modal?m.jsx(H,{present:r||i.open,children:m.jsx(Na,{...o,ref:t})}):null});Ta.displayName=Aa;var Ia=x("DialogOverlay.RemoveScroll"),Na=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ra(Aa,n);return m.jsx(xo,{as:Ia,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(j.div,{"data-state":Ga(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ka="DialogContent",Fa=e.forwardRef((e,t)=>{const n=Pa(ka,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ra(ka,e.__scopeDialog);return m.jsx(H,{present:r||i.open,children:i.modal?m.jsx(La,{...o,ref:t}):m.jsx(Wa,{...o,ref:t})})});Fa.displayName=ka;var La=e.forwardRef((t,n)=>{const r=Ra(ka,t.__scopeDialog),o=e.useRef(null),i=y(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Nr(e)},[]),m.jsx(Ba,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=r.triggerRef.current)||t.focus()}),onPointerDownOutside:h(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:h(t.onFocusOutside,e=>e.preventDefault())})}),Wa=e.forwardRef((t,n)=>{const r=Ra(ka,t.__scopeDialog),o=e.useRef(!1),i=e.useRef(!1);return m.jsx(Ba,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var n,a;null==(n=t.onCloseAutoFocus)||n.call(t,e),e.defaultPrevented||(o.current||null==(a=r.triggerRef.current)||a.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{var n,a;null==(n=t.onInteractOutside)||n.call(t,e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const s=e.target;(null==(a=r.triggerRef.current)?void 0:a.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Ba=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=t,c=Ra(ka,r),l=e.useRef(null),u=y(n,l);return Qn(),m.jsxs(m.Fragment,{children:[m.jsx(or,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(k,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ga(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Za,{titleId:c.titleId}),m.jsx(Ja,{contentRef:l,descriptionId:c.descriptionId})]})]})}),Ka="DialogTitle",$a=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ra(Ka,n);return m.jsx(j.h2,{id:o.titleId,...r,ref:t})});$a.displayName=Ka;var Va="DialogDescription",Ha=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ra(Va,n);return m.jsx(j.p,{id:o.descriptionId,...r,ref:t})});Ha.displayName=Va;var za="DialogClose",Ua=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ra(za,n);return m.jsx(j.button,{type:"button",...r,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});function Ga(e){return e?"open":"closed"}Ua.displayName=za;var Xa="DialogTitleWarning",[Ya,qa]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,i=e.useMemo(()=>o,Object.values(o));return m.jsx(r.Provider,{value:i,children:n})};return o.displayName=t+"Provider",[o,function(o){const i=e.useContext(r);if(i)return i;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(Xa,{contentName:ka,titleName:Ka,docsSlug:"dialog"}),Za=({titleId:t})=>{const n=qa(Xa),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)}},[r,t]),null},Ja=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qa("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{var e;const r=null==(e=t.current)?void 0:e.getAttribute("aria-describedby");if(n&&r){document.getElementById(n)}},[r,t,n]),null},Qa=Ca,es=Sa,ts=Ma,ns=Ta,rs=Fa,os=$a,is=Ha,as=Ua,ss="Collapsible",[cs,ls]=w(ss),[us,ds]=cs(ss),fs=e.forwardRef((t,n)=>{const{__scopeCollapsible:r,open:o,defaultOpen:i,disabled:a,onOpenChange:s,...c}=t,[l,u]=G({prop:o,defaultProp:i??!1,onChange:s,caller:ss});return m.jsx(us,{scope:r,disabled:a,contentId:q(),open:l,onOpenToggle:e.useCallback(()=>u(e=>!e),[u]),children:m.jsx(j.div,{"data-state":ys(l),"data-disabled":a?"":void 0,...c,ref:n})})});fs.displayName=ss;var ps="CollapsibleTrigger",ms=e.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ds(ps,n);return m.jsx(j.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ys(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:h(e.onClick,o.onOpenToggle)})});ms.displayName=ps;var hs="CollapsibleContent",vs=e.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ds(hs,e.__scopeCollapsible);return m.jsx(H,{present:n||o.open,children:({present:e})=>m.jsx(gs,{...r,ref:t,present:e})})});vs.displayName=hs;var gs=e.forwardRef((t,n)=>{const{__scopeCollapsible:r,present:o,children:i,...a}=t,s=ds(hs,r),[c,l]=e.useState(o),u=e.useRef(null),d=y(n,u),f=e.useRef(0),p=f.current,h=e.useRef(0),v=h.current,g=s.open||c,w=e.useRef(g),b=e.useRef(void 0);return e.useEffect(()=>{const e=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(e)},[]),$(()=>{const e=u.current;if(e){b.current=b.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();f.current=t.height,h.current=t.width,w.current||(e.style.transitionDuration=b.current.transitionDuration,e.style.animationName=b.current.animationName),l(o)}},[s.open,o]),m.jsx(j.div,{"data-state":ys(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:g&&i})});function ys(e){return e?"open":"closed"}var ws=fs,bs=ms,xs=vs,_s="Accordion",Es=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Rs,Cs,Ds]=S(_s),[Ss]=w(_s,[Ds,ls]),js=ls(),Os=t.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.jsx(Rs.Provider,{scope:e.__scopeAccordion,children:"multiple"===n?m.jsx(Ns,{...i,ref:t}):m.jsx(Is,{...o,ref:t})})});Os.displayName=_s;var[Ps,Ms]=Ss(_s),[As,Ts]=Ss(_s,{collapsible:!1}),Is=t.forwardRef((e,n)=>{const{value:r,defaultValue:o,onValueChange:i=()=>{},collapsible:a=!1,...s}=e,[c,l]=G({prop:r,defaultProp:o??"",onChange:i,caller:_s});return m.jsx(Ps,{scope:e.__scopeAccordion,value:t.useMemo(()=>c?[c]:[],[c]),onItemOpen:l,onItemClose:t.useCallback(()=>a&&l(""),[a,l]),children:m.jsx(As,{scope:e.__scopeAccordion,collapsible:a,children:m.jsx(Ls,{...s,ref:n})})})}),Ns=t.forwardRef((e,n)=>{const{value:r,defaultValue:o,onValueChange:i=()=>{},...a}=e,[s,c]=G({prop:r,defaultProp:o??[],onChange:i,caller:_s}),l=t.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=t.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return m.jsx(Ps,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u,children:m.jsx(As,{scope:e.__scopeAccordion,collapsible:!0,children:m.jsx(Ls,{...a,ref:n})})})}),[ks,Fs]=Ss(_s),Ls=t.forwardRef((e,n)=>{const{__scopeAccordion:r,disabled:o,dir:i,orientation:a="vertical",...s}=e,c=y(t.useRef(null),n),l=Cs(r),u="ltr"===Zn(i),d=h(e.onKeyDown,e=>{var t;if(!Es.includes(e.key))return;const n=e.target,r=l().filter(e=>{var t;return!(null==(t=e.ref.current)?void 0:t.disabled)}),o=r.findIndex(e=>e.ref.current===n),i=r.length;if(-1===o)return;e.preventDefault();let s=o;const c=i-1,d=()=>{s=o+1,s>c&&(s=0)},f=()=>{s=o-1,s<0&&(s=c)};switch(e.key){case"Home":s=0;break;case"End":s=c;break;case"ArrowRight":"horizontal"===a&&(u?d():f());break;case"ArrowDown":"vertical"===a&&d();break;case"ArrowLeft":"horizontal"===a&&(u?f():d());break;case"ArrowUp":"vertical"===a&&f()}null==(t=r[s%i].ref.current)||t.focus()});return m.jsx(ks,{scope:r,disabled:o,direction:i,orientation:a,children:m.jsx(Rs.Slot,{scope:r,children:m.jsx(j.div,{...s,"data-orientation":a,ref:c,onKeyDown:o?void 0:d})})})}),Ws="AccordionItem",[Bs,Ks]=Ss(Ws),$s=t.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Fs(Ws,n),a=Ms(Ws,n),s=js(n),c=q(),l=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return m.jsx(Bs,{scope:n,open:l,disabled:u,triggerId:c,children:m.jsx(ws,{"data-orientation":i.orientation,"data-state":Ys(l),...s,...o,ref:t,disabled:u,open:l,onOpenChange:e=>{e?a.onItemOpen(r):a.onItemClose(r)}})})});$s.displayName=Ws;var Vs="AccordionHeader",Hs=t.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fs(_s,n),i=Ks(Vs,n);return m.jsx(j.h3,{"data-orientation":o.orientation,"data-state":Ys(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});Hs.displayName=Vs;var zs="AccordionTrigger",Us=t.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fs(_s,n),i=Ks(zs,n),a=Ts(zs,n),s=js(n);return m.jsx(Rs.ItemSlot,{scope:n,children:m.jsx(bs,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});Us.displayName=zs;var Gs="AccordionContent",Xs=t.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Fs(_s,n),i=Ks(Gs,n),a=js(n);return m.jsx(xs,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Ys(e){return e?"open":"closed"}Xs.displayName=Gs;var qs=Os,Zs=$s,Js=Hs,Qs=Us,ec=Xs,tc="Tabs",[nc]=w(tc,[yr]),rc=yr(),[oc,ic]=nc(tc),ac=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:c="automatic",...l}=e,u=Zn(s),[d,f]=G({prop:r,onChange:o,defaultProp:i??"",caller:tc});return m.jsx(oc,{scope:n,baseId:q(),value:d,onValueChange:f,orientation:a,dir:u,activationMode:c,children:m.jsx(j.div,{dir:u,"data-orientation":a,...l,ref:t})})});ac.displayName=tc;var sc="TabsList",cc=e.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=ic(sc,n),a=rc(n);return m.jsx(Sr,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:m.jsx(j.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});cc.displayName=sc;var lc="TabsTrigger",uc=e.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=ic(lc,n),s=rc(n),c=pc(a.baseId,r),l=mc(a.baseId,r),u=r===a.value;return m.jsx(jr,{asChild:!0,...s,focusable:!o,active:u,children:m.jsx(j.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:h(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(r)}),onKeyDown:h(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(r)}),onFocus:h(e.onFocus,()=>{const e="manual"!==a.activationMode;u||o||!e||a.onValueChange(r)})})})});uc.displayName=lc;var dc="TabsContent",fc=e.forwardRef((t,n)=>{const{__scopeTabs:r,value:o,forceMount:i,children:a,...s}=t,c=ic(dc,r),l=pc(c.baseId,o),u=mc(c.baseId,o),d=o===c.value,f=e.useRef(d);return e.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),m.jsx(H,{present:i||d,children:({present:e})=>m.jsx(j.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!e,id:u,tabIndex:0,...s,ref:n,style:{...t.style,animationDuration:f.current?"0s":void 0},children:e&&a})})});function pc(e,t){return`${e}-trigger-${t}`}function mc(e,t){return`${e}-content-${t}`}fc.displayName=dc;var hc=ac,vc=cc,gc=uc,yc=fc;export{Zn as $,ln as A,K as B,un as C,k as D,la as E,ua as F,da as G,ya as H,pa as I,wa as J,ma as K,va as L,ha as M,fa as N,ns as O,j as P,ga as Q,B as R,_ as S,os as T,qs as U,Zs as V,Ya as W,Js as X,Qs as Y,ec as Z,En as _,hn as a,Nr as a0,Qn as a1,xo as a2,x as a3,or as a4,hc as a5,vc as a6,gc as a7,yc as a8,$t as a9,S as b,w as c,G as d,H as e,h as f,P as g,V as h,$ as i,m as j,O as k,zt as l,C as m,dn as n,q as o,cn as p,Qa as q,ts as r,rs as s,Yn as t,y as u,as as v,is as w,_a as x,es as y,ca as z};