import{r as e,R as t,a as n,b as r,$ as o}from"./react-vendor-f6QdChhz.js";var i={exports:{}},a={},s=e,l=Symbol.for("react.element"),c=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:l,type:e,key:i,ref:a,props:o,_owner:d.current}}a.Fragment=c,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){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function g(...t){return e.useCallback(v(...t),t)}function w(...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}var y=e.forwardRef((t,n)=>{const{children:r,...o}=t,i=e.Children.toArray(r),a=i.find(C);if(a){const t=a.props.children,r=i.map(n=>n===a?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m.jsx(x,{...o,ref:n,children:e.isValidElement(t)?e.cloneElement(t,void 0,r):null})}return m.jsx(x,{...o,ref:n,children:r})});y.displayName="Slot";var x=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);return e.cloneElement(r,{...E(o,r.props),ref:n?v(n,t):t})}return e.Children.count(r)>1?e.Children.only(null):null});x.displayName="SlotClone";var b=({children:e})=>m.jsx(m.Fragment,{children:e});function C(t){return e.isValidElement(t)&&t.type===b}function E(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)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function R(n){const r=n+"CollectionProvider",[o,i]=function(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;function s(n){const{scope:r,children:o,...s}=n,l=(null==r?void 0:r[t][a])||i,c=e.useMemo(()=>s,Object.values(s));return m.jsx(l.Provider,{value:c,children:o})}return r=[...r,o],s.displayName=n+"Provider",[s,function(r,s){const l=(null==s?void 0:s[t][a])||i,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},w(o,...n)]}(r),[a,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:r}=e,o=t.useRef(null),i=t.useRef(new Map).current;return m.jsx(a,{scope:n,itemMap:i,collectionRef:o,children:r})};l.displayName=r;const c=n+"CollectionSlot",u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=g(t,s(c,n).collectionRef);return m.jsx(y,{ref:o,children:r})});u.displayName=c;const d=n+"CollectionItemSlot",f="data-radix-collection-item",p=t.forwardRef((e,n)=>{const{scope:r,children:o,...i}=e,a=t.useRef(null),l=g(n,a),c=s(d,r);return t.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>{c.itemMap.delete(a)})),m.jsx(y,{[f]:"",ref:l,children:o})});return p.displayName=d,[{Provider:l,Slot:u,ItemSlot:p},function(e){const r=s(n+"CollectionConsumer",e);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])},i]}function S(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,...l}=n,c=(null==(r=null==o?void 0:o[t])?void 0:r[a])||i,u=e.useMemo(()=>l,Object.values(l));return m.jsx(c.Provider,{value:u,children:s})};return s.displayName=n+"Provider",[s,function(r,s){var l;const c=(null==(l=null==s?void 0:s[t])?void 0:l[a])||i,u=e.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},_(o,...n)]}function _(...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}var D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,n)=>{const r=e.forwardRef((e,t)=>{const{asChild:r,...o}=e,i=r?y:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m.jsx(i,{...o,ref:t})});return r.displayName=`Primitive.${n}`,{...t,[n]:r}},{});function M(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 j,N="dismissableLayer.update",O="dismissableLayer.pointerDownOutside",T="dismissableLayer.focusOutside",A=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:l,...c}=t,u=e.useContext(A),[d,f]=e.useState(null),p=(null==d?void 0:d.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,v]=e.useState({}),w=g(n,e=>f(e)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(x),C=d?y.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,R=C>=b,S=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(){F(O,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==l||l())},p),_=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){F(T,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==l||l())},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=>{C===u.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(j=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=j)}},[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(N,e),()=>document.removeEventListener(N,e)},[]),m.jsx(D.div,{...c,ref:w,style:{pointerEvents:E?R?"auto":"none":void 0,...t.style},onFocusCapture:h(t.onFocusCapture,_.onFocusCapture),onBlurCapture:h(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:h(t.onPointerDownCapture,S.onPointerDownCapture)})});k.displayName="DismissableLayer";var I=e.forwardRef((t,n)=>{const r=e.useContext(A),o=e.useRef(null),i=g(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),m.jsx(D.div,{...t,ref:i})});function L(){const e=new CustomEvent(N);document.dispatchEvent(e)}function F(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?M(o,i):o.dispatchEvent(i)}I.displayName="DismissableLayerBranch";var W=k,B=I,H=Boolean(null==globalThis?void 0:globalThis.document)?e.useLayoutEffect:()=>{},K=e.forwardRef((t,n)=>{var o;const{container:i,...a}=t,[s,l]=e.useState(!1);H(()=>l(!0),[]);const c=i||s&&(null==(o=null==globalThis?void 0:globalThis.document)?void 0:o.body);return c?r.createPortal(m.jsx(D.div,{...a,ref:n}),c):null});K.displayName="Portal";var $=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef({}),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=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=V(o.current);a.current="mounted"===l?e:"none"},[l]),H(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=V(e);if(t)c("MOUNT");else if("none"===o||"none"===(null==e?void 0:e.display))c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,c]),H(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=V(o.current).includes(r.animationName);if(r.target===n&&a&&(c("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=V(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)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{e&&(o.current=getComputedStyle(e)),r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=g(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 V(e){return(null==e?void 0:e.animationName)||"none"}function U({prop:t,defaultProp:n,onChange:r=()=>{}}){const[o,i]=function({defaultProp:t,onChange:n}){const r=e.useState(t),[o]=r,i=e.useRef(o),a=P(n);return e.useEffect(()=>{i.current!==o&&(a(o),i.current=o)},[o,i,a]),r}({defaultProp:n,onChange:r}),a=void 0!==t,s=a?t:o,l=P(r);return[s,e.useCallback(e=>{if(a){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else i(e)},[a,t,i,l])]}$.displayName="Presence";var z=e.forwardRef((e,t)=>m.jsx(D.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));z.displayName="VisuallyHidden";var G=z;const X=["top","right","bottom","left"],Y=Math.min,q=Math.max,Z=Math.round,J=Math.floor,Q=e=>({x:e,y:e}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function ne(e,t,n){return q(e,Y(t,n))}function re(e,t){return"function"==typeof e?e(t):e}function oe(e){return e.split("-")[0]}function ie(e){return e.split("-")[1]}function ae(e){return"x"===e?"y":"x"}function se(e){return"y"===e?"height":"width"}function le(e){return["top","bottom"].includes(oe(e))?"y":"x"}function ce(e){return ae(le(e))}function ue(e){return e.replace(/start|end/g,e=>te[e])}function de(e){return e.replace(/left|right|bottom|top/g,e=>ee[e])}function fe(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 pe(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 me(e,t,n){let{reference:r,floating:o}=e;const i=le(t),a=ce(t),s=se(a),l=oe(t),c="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(l){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(ie(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function he(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=re(t,e),m=fe(p),h=s[f?"floating"===d?"reference":"floating":d],v=pe(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:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},x=pe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:l}):g);return{top:(v.top-x.top+m.top)/y.y,bottom:(x.bottom-v.bottom+m.bottom)/y.y,left:(v.left-x.left+m.left)/y.x,right:(x.right-v.right+m.right)/y.x}}function ve(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ge(e){return X.some(t=>e[t]>=0)}function we(){return"undefined"!=typeof window}function ye(e){return Ce(e)?(e.nodeName||"").toLowerCase():"#document"}function xe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function be(e){var t;return null==(t=(Ce(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ce(e){return!!we()&&(e instanceof Node||e instanceof xe(e).Node)}function Ee(e){return!!we()&&(e instanceof Element||e instanceof xe(e).Element)}function Re(e){return!!we()&&(e instanceof HTMLElement||e instanceof xe(e).HTMLElement)}function Se(e){return!(!we()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof xe(e).ShadowRoot)}function _e(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function De(e){return["table","td","th"].includes(ye(e))}function Me(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Pe(e){const t=je(),n=Ee(e)?Oe(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function je(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ne(e){return["html","body","#document"].includes(ye(e))}function Oe(e){return xe(e).getComputedStyle(e)}function Te(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if("html"===ye(e))return e;const t=e.assignedSlot||e.parentNode||Se(e)&&e.host||be(e);return Se(t)?t.host:t}function ke(e){const t=Ae(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&_e(t)?t:ke(t)}function Ie(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ke(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=xe(o);if(i){const e=Le(a);return t.concat(a,a.visualViewport||[],_e(o)?o:[],e&&n?Ie(e):[])}return t.concat(o,Ie(o,[],n))}function Le(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fe(e){const t=Oe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Z(n)!==i||Z(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function We(e){return Ee(e)?e:e.contextElement}function Be(e){const t=We(e);if(!Re(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Fe(t);let a=(i?Z(n.width):n.width)/r,s=(i?Z(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const He=Q(0);function Ke(e){const t=xe(e);return je()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:He}function $e(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=We(e);let a=Q(1);t&&(r?Ee(r)&&(a=Be(r)):a=Be(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==xe(e))&&t}(i,n,r)?Ke(i):Q(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=xe(i),t=r&&Ee(r)?xe(r):r;let n=e,o=Le(n);for(;o&&r&&t!==n;){const e=Be(o),t=o.getBoundingClientRect(),r=Oe(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=xe(o),o=Le(n)}}return pe({width:u,height:d,x:l,y:c})}function Ve(e,t){const n=Te(e).scrollLeft;return t?t.left+n:$e(be(e)).left+n}function Ue(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=xe(e),r=be(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=je();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=be(e),n=Te(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+Ve(e);const s=-n.scrollTop;return"rtl"===Oe(r).direction&&(a+=q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(be(e));else if(Ee(t))r=function(e,t){const n=$e(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?Be(e):Q(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=Ke(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return pe(r)}function ze(e,t){const n=Ae(e);return!(n===t||!Ee(n)||Ne(n))&&("fixed"===Oe(n).position||ze(n,t))}function Ge(e,t,n){const r=Re(t),o=be(t),i="fixed"===n,a=$e(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Q(0);if(r||!r&&!i)if(("body"!==ye(t)||_e(o))&&(s=Te(t)),r){const e=$e(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Ve(o));let c=0,u=0;if(o&&!r&&!i){const e=o.getBoundingClientRect();u=e.top+s.scrollTop,c=e.left+s.scrollLeft-Ve(o,e)}return{x:a.left+s.scrollLeft-l.x-c,y:a.top+s.scrollTop-l.y-u,width:a.width,height:a.height}}function Xe(e){return"static"===Oe(e).position}function Ye(e,t){if(!Re(e)||"fixed"===Oe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return be(e)===n&&(n=n.ownerDocument.body),n}function qe(e,t){const n=xe(e);if(Me(e))return n;if(!Re(e)){let t=Ae(e);for(;t&&!Ne(t);){if(Ee(t)&&!Xe(t))return t;t=Ae(t)}return n}let r=Ye(e,t);for(;r&&De(r)&&Xe(r);)r=Ye(r,t);return r&&Ne(r)&&Xe(r)&&!Pe(r)?n:r||function(e){let t=Ae(e);for(;Re(t)&&!Ne(t);){if(Pe(t))return t;if(Me(t))return null;t=Ae(t)}return null}(e)||n}const Ze={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=be(r),s=!!t&&Me(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Q(1);const u=Q(0),d=Re(r);if((d||!d&&!i)&&(("body"!==ye(r)||_e(a))&&(l=Te(r)),Re(r))){const e=$e(r);c=Be(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:be,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Me(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ie(e,[],!1).filter(e=>Ee(e)&&"body"!==ye(e)),o=null;const i="fixed"===Oe(e).position;let a=i?Ae(e):e;for(;Ee(a)&&!Ne(a);){const t=Oe(a),n=Pe(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||_e(a)&&!n&&ze(e,a))?r=r.filter(e=>e!==a):o=t,a=Ae(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=Ue(t,n,o);return e.top=q(r.top,e.top),e.right=Y(r.right,e.right),e.bottom=Y(r.bottom,e.bottom),e.left=q(r.left,e.left),e},Ue(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:qe,getElementRects:async function(e){const t=this.getOffsetParent||qe,n=this.getDimensions,r=await n(e.floating);return{reference:Ge(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}=Fe(e);return{width:t,height:n}},getScale:Be,isElement:Ee,isRTL:function(e){return"rtl"===Oe(e).direction}};function Je(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:l=!1}=r,c=We(e),u=o||i?[...c?Ie(c):[],...Ie(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=be(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p={rootMargin:-J(u)+"px "+-J(o.clientWidth-(c+d))+"px "+-J(o.clientHeight-(u+f))+"px "+-J(c)+"px",threshold:q(0,Y(1,l))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==l){if(!m)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}m=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?$e(e):null;return l&&function t(){const r=$e(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||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,l&&cancelAnimationFrame(f)}}const Qe=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,l=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=oe(n),s=ie(n),l="y"===le(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=re(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),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},et=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}}},...l}=re(e,t),c={x:n,y:r},u=await he(t,l),d=le(oe(o)),f=ae(d);let p=c[f],m=c[d];if(i){const e="y"===f?"bottom":"right";p=ne(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";m=ne(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}}}}}},tt=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:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=re(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=oe(o),w=le(s),y=oe(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=f||(y||!h?[de(s)]:function(e){const t=de(e);return[ue(e),t,ue(t)]}(s)),C="none"!==m;!f&&C&&b.push(...function(e,t,n,r){const o=ie(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(oe(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(ue)))),i}(s,h,m,x));const E=[s,...b],R=await he(t,v),S=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(R[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=ie(e),o=ce(e),i=se(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=de(a)),[a,de(a)]}(o,a,x);S.push(R[e[0]],R[e[1]])}if(_=[..._,{placement:o,overflows:S}],!S.every(e=>e<=0)){var D,M;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(M=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter(e=>{if(C){const t=le(e.placement);return t===w||"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:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},nt=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:l=()=>{},...c}=re(e,t),u=await he(t,c),d=oe(o),f=ie(o),p="y"===le(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 w=h-u.top-u.bottom,y=m-u.left-u.right,x=Y(h-u[v],w),b=Y(m-u[g],y),C=!t.middlewareData.shift;let E=x,R=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(R=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=w),C&&!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 l({...t,availableWidth:R,availableHeight:E});const S=await a.getDimensions(s.floating);return m!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},rt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=re(e,t);switch(r){case"referenceHidden":{const e=ve(await he(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ge(e)}}}case"escaped":{const e=ve(await he(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ge(e)}}}default:return{}}}}},ot=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=re(e,t)||{};if(null==c)return{};const d=fe(u),f={x:n,y:r},p=ce(o),m=se(p),h=await a.getDimensions(c),v="y"===p,g=v?"top":"left",w=v?"bottom":"right",y=v?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-f[p]-i.floating[m],b=f[p]-i.reference[p],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let E=C?C[y]:0;E&&await(null==a.isElement?void 0:a.isElement(C))||(E=s.floating[y]||i.floating[m]);const R=x/2-b/2,S=E/2-h[m]/2-1,_=Y(d[g],S),D=Y(d[w],S),M=_,P=E-h[m]-D,j=E/2-h[m]/2+R,N=ne(M,j,P),O=!l.arrow&&null!=ie(o)&&j!==N&&i.reference[m]/2-(j<M?_:D)-h[m]/2<0,T=O?j<M?j-M:j-P:0;return{[p]:f[p]+T,data:{[p]:N,centerOffset:j-N-T,...O&&{alignmentOffset:T}},reset:O}}}),it=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:l=!0,crossAxis:c=!0}=re(e,t),u={x:n,y:r},d=le(o),f=ae(d);let p=u[f],m=u[d];const h=re(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){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(c){var g,w;const e="y"===f?"width":"height",t=["top","left"].includes(oe(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==(w=a.offset)?void 0:w[d])||0)-(t?v.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},at=(e,t,n)=>{const r=new Map,o={platform:Ze,...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),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=me(c,r,l),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:w,reset:y}=await i({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=g?g:d,p={...p,[n]:{...p[n],...w}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=me(c,f,l))),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:e.useEffect;function lt(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(!lt(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)&&!lt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function ct(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ut(e,t){const n=ct(e);return Math.round(t*n)/n}function dt(t){const n=e.useRef(t);return st(()=>{n.current=t}),n}function ft(t){void 0===t&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!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);lt(m,i)||h(i);const[v,g]=e.useState(null),[w,y]=e.useState(null),x=e.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),b=e.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[]),C=s||v,E=l||w,R=e.useRef(null),S=e.useRef(null),_=e.useRef(f),D=null!=u,M=dt(u),P=dt(a),j=dt(d),N=e.useCallback(()=>{if(!R.current||!S.current)return;const e={placement:r,strategy:o,middleware:m};P.current&&(e.platform=P.current),at(R.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==j.current};O.current&&!lt(_.current,t)&&(_.current=t,n.flushSync(()=>{p(t)}))})},[m,r,o,P,j]);st(()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const O=e.useRef(!1);st(()=>(O.current=!0,()=>{O.current=!1}),[]),st(()=>{if(C&&(R.current=C),E&&(S.current=E),C&&E){if(M.current)return M.current(C,E,N);N()}},[C,E,N,M,D]);const T=e.useMemo(()=>({reference:R,floating:S,setReference:x,setFloating:b}),[x,b]),A=e.useMemo(()=>({reference:C,floating:E}),[C,E]),k=e.useMemo(()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=ut(A.floating,f.x),n=ut(A.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ct(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,c,A.floating,f.x,f.y]);return e.useMemo(()=>({...f,update:N,refs:T,elements:A,floatingStyles:k}),[f,N,T,A,k])}const pt=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?ot({element:n.current,padding:r}).fn(t):{}:n?ot({element:n,padding:r}).fn(t):{};var o}}),mt=(e,t)=>({...Qe(e),options:[e,t]}),ht=(e,t)=>({...et(e),options:[e,t]}),vt=(e,t)=>({...it(e),options:[e,t]}),gt=(e,t)=>({...tt(e),options:[e,t]}),wt=(e,t)=>({...nt(e),options:[e,t]}),yt=(e,t)=>({...rt(e),options:[e,t]}),xt=(e,t)=>({...pt(e),options:[e,t]});var bt=o["useId".toString()]||(()=>{}),Ct=0;function Et(t){const[n,r]=e.useState(bt());return H(()=>{t||r(e=>e??String(Ct++))},[t]),t||(n?`radix-${n}`:"")}var Rt="focusScope.autoFocusOnMount",St="focusScope.autoFocusOnUnmount",_t={bubbles:!1,cancelable:!0},Dt=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[l,c]=e.useState(null),u=P(i),d=P(a),f=e.useRef(null),p=g(n,e=>c(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||!l)return;const t=e.target;l.contains(t)?f.current=t:Nt(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Nt(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Nt(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){Ot.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Rt,_t);l.addEventListener(Rt,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Nt(r,{select:t}),document.activeElement!==n)return}((e=Mt(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Nt(l))}return()=>{l.removeEventListener(Rt,u),setTimeout(()=>{const e=new CustomEvent(St,_t);l.addEventListener(St,d),l.dispatchEvent(e),e.defaultPrevented||Nt(t??document.body,{select:!0}),l.removeEventListener(St,d),Ot.remove(h)},0)}}var e},[l,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=Mt(e),n=Pt(t,e),r=Pt(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&Nt(i,{select:!0})):(e.preventDefault(),r&&Nt(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return m.jsx(D.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})});function Mt(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 Pt(e,t){for(const n of e)if(!jt(n,{upTo:t}))return n}function jt(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 Nt(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()}}Dt.displayName="FocusScope";var Ot=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Tt(e,t),e.unshift(t)},remove(t){var n;e=Tt(e,t),null==(n=e[0])||n.resume()}}}();function Tt(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var At=0;function kt(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??It()),document.body.insertAdjacentElement("beforeend",e[1]??It()),At++,()=>{1===At&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),At--}},[])}function It(){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 Lt=function(){return Lt=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},Lt.apply(this,arguments)};function Ft(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 Wt(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function Bt(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"==typeof SuppressedError&&SuppressedError;var Ht="right-scroll-bar-position",Kt="width-before-scroll-bar";function $t(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Vt="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Ut=new WeakMap;function zt(t,n){var r,o,i,a=(r=null,o=function(e){return t.forEach(function(t){return $t(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 Vt(function(){var e=Ut.get(a);if(e){var n=new Set(e),r=new Set(t),o=a.current;n.forEach(function(e){r.has(e)||$t(e,null)}),r.forEach(function(e){n.has(e)||$t(e,o)})}Ut.set(a,t)},[t]),a}function Gt(e){return e}function Xt(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Gt);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=Lt({async:!0,ssr:!1},e),t}var Yt=function(t){var n=t.sideCar,r=Ft(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,Lt({},r))};function qt(e,t){return e.useMedium(t),Yt}Yt.isSideCarExport=!0;var Zt=Xt(),Jt=function(){},Qt=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),i=o[0],a=o[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,m=t.noIsolation,h=t.inert,v=t.allowPinchZoom,g=t.as,w=void 0===g?"div":g,y=t.gapMode,x=Ft(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=p,C=zt([r,n]),E=Lt(Lt({},x),i);return e.createElement(e.Fragment,null,d&&e.createElement(b,{sideCar:Zt,removeScrollBar:u,shards:f,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:y}),s?e.cloneElement(e.Children.only(l),Lt(Lt({},E),{ref:C})):e.createElement(w,Lt({},E,{className:c,ref:C}),l))});Qt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qt.classNames={fullWidth:Kt,zeroRight:Ht};function en(){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 tn=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=en())&&(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)}}},nn=function(){var t,n=(t=tn(),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}},rn={left:0,top:0,right:0,gap:0},on=function(e){return parseInt(e||"",10)||0},an=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return rn;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[on(n),on(r),on(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])}},sn=nn(),ln="data-scroll-locked",cn=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(ln,"] {\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(Ht," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Kt," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Ht," .").concat(Ht," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Kt," .").concat(Kt," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ln,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},un=function(){var e=parseInt(document.body.getAttribute(ln)||"0",10);return isFinite(e)?e:0},dn=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(ln,(un()+1).toString()),function(){var e=un()-1;e<=0?document.body.removeAttribute(ln):document.body.setAttribute(ln,e.toString())}},[]);var a=e.useMemo(function(){return an(i)},[i]);return e.createElement(sn,{styles:cn(a,!n,i,r?"":"!important")})},fn=!1;if("undefined"!=typeof window)try{var pn=Object.defineProperty({},"passive",{get:function(){return fn=!0,!0}});window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch(Ls){fn=!1}var mn=!!fn&&{passive:!1},hn=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])},vn=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),gn(e,r)){var o=wn(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gn=function(e,t){return"v"===e?function(e){return hn(e,"overflowY")}(t):function(e){return hn(e,"overflowX")}(t)},wn=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},yn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xn=function(e){return[e.deltaX,e.deltaY]},bn=function(e){return e&&"current"in e?e.current:e},Cn=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},En=0,Rn=[];function Sn(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const _n=qt(Zt,function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(En++)[0],a=e.useState(nn)[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=Bt([t.lockRef.current],(t.shards||[]).map(bn),!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 l=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=yn(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=vn(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=vn(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{var p=wn(e,s),m=p[0],h=p[1]-p[2]-i*m;(m||h)&&gn(e,s)&&(d+=h,f+=m),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(Rn.length&&Rn[Rn.length-1]===a){var r="deltaY"in t?xn(t):yn(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(bn).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?l(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:Sn(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=yn(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,xn(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,yn(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return Rn.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,mn),document.addEventListener("touchmove",c,mn),document.addEventListener("touchstart",d,mn),function(){Rn=Rn.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,mn),document.removeEventListener("touchmove",c,mn),document.removeEventListener("touchstart",d,mn)}},[]);var m=t.removeScrollBar,h=t.inert;return e.createElement(e.Fragment,null,h?e.createElement(a,{styles:Cn(i)}):null,m?e.createElement(dn,{gapMode:t.gapMode}):null)});var Dn=e.forwardRef(function(t,n){return e.createElement(Qt,Lt({},t,{ref:n,sideCar:_n}))});Dn.classNames=Qt.classNames;var Mn=new WeakMap,Pn=new WeakMap,jn={},Nn=0,On=function(e){return e&&(e.host||On(e.parentNode))},Tn=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=On(t);return n&&e.contains(n)?n:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);jn[n]||(jn[n]=new WeakMap);var i=jn[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.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,l=(Mn.get(e)||0)+1,c=(i.get(e)||0)+1;Mn.set(e,l),i.set(e,c),a.push(e),1===l&&o&&Pn.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){}})};return u(t),s.clear(),Nn++,function(){a.forEach(function(e){var t=Mn.get(e)-1,o=i.get(e)-1;Mn.set(e,t),i.set(e,o),t||(Pn.has(e)||e.removeAttribute(r),Pn.delete(e)),o||e.removeAttribute(n)}),--Nn||(Mn=new WeakMap,Mn=new WeakMap,Pn=new WeakMap,jn={})}},An=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]"))),Tn(r,o,n,"aria-hidden")):function(){return null}},kn="Dialog",[In,Ln]=S(kn),[Fn,Wn]=In(kn),Bn=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u=!1,d]=U({prop:o,defaultProp:i,onChange:a});return m.jsx(Fn,{scope:n,triggerRef:l,contentRef:c,contentId:Et(),titleId:Et(),descriptionId:Et(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};Bn.displayName=kn;var Hn="DialogTrigger",Kn=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Wn(Hn,n),i=g(t,o.triggerRef);return m.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":sr(o.open),...r,ref:i,onClick:h(e.onClick,o.onOpenToggle)})});Kn.displayName=Hn;var $n="DialogPortal",[Vn,Un]=In($n,{forceMount:void 0}),zn=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=t,a=Wn($n,n);return m.jsx(Vn,{scope:n,forceMount:r,children:e.Children.map(o,e=>m.jsx($,{present:r||a.open,children:m.jsx(K,{asChild:!0,container:i,children:e})}))})};zn.displayName=$n;var Gn="DialogOverlay",Xn=e.forwardRef((e,t)=>{const n=Un(Gn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Wn(Gn,e.__scopeDialog);return i.modal?m.jsx($,{present:r||i.open,children:m.jsx(Yn,{...o,ref:t})}):null});Xn.displayName=Gn;var Yn=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Wn(Gn,n);return m.jsx(Dn,{as:y,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(D.div,{"data-state":sr(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),qn="DialogContent",Zn=e.forwardRef((e,t)=>{const n=Un(qn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Wn(qn,e.__scopeDialog);return m.jsx($,{present:r||i.open,children:i.modal?m.jsx(Jn,{...o,ref:t}):m.jsx(Qn,{...o,ref:t})})});Zn.displayName=qn;var Jn=e.forwardRef((t,n)=>{const r=Wn(qn,t.__scopeDialog),o=e.useRef(null),i=g(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return An(e)},[]),m.jsx(er,{...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())})}),Qn=e.forwardRef((t,n)=>{const r=Wn(qn,t.__scopeDialog),o=e.useRef(!1),i=e.useRef(!1);return m.jsx(er,{...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()}})}),er=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=t,l=Wn(qn,r),c=e.useRef(null),u=g(n,c);return kt(),m.jsxs(m.Fragment,{children:[m.jsx(Dt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m.jsx(k,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":sr(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(dr,{titleId:l.titleId}),m.jsx(fr,{contentRef:c,descriptionId:l.descriptionId})]})]})}),tr="DialogTitle",nr=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Wn(tr,n);return m.jsx(D.h2,{id:o.titleId,...r,ref:t})});nr.displayName=tr;var rr="DialogDescription",or=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Wn(rr,n);return m.jsx(D.p,{id:o.descriptionId,...r,ref:t})});or.displayName=rr;var ir="DialogClose",ar=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Wn(ir,n);return m.jsx(D.button,{type:"button",...r,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});function sr(e){return e?"open":"closed"}ar.displayName=ir;var lr="DialogTitleWarning",[cr,ur]=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}\``)}]}(lr,{contentName:qn,titleName:tr,docsSlug:"dialog"}),dr=({titleId:t})=>{const n=ur(lr),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},fr=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ur("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},pr=Bn,mr=Kn,hr=zn,vr=Xn,gr=Zn,wr=nr,yr=or,xr=ar;function br(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}function Cr(t){const[n,r]=e.useState(void 0);return H(()=>{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 Er=e.createContext(void 0);function Rr(t){const n=e.useContext(Er);return t||n||"ltr"}function Sr(e,[t,n]){return Math.min(n,Math.max(t,e))}function _r(...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}var Dr="rovingFocusGroup.onEntryFocus",Mr={bubbles:!1,cancelable:!0},Pr="RovingFocusGroup",[jr,Nr,Or]=R(Pr),[Tr,Ar]=function(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;function s(n){const{scope:r,children:o,...s}=n,l=(null==r?void 0:r[t][a])||i,c=e.useMemo(()=>s,Object.values(s));return m.jsx(l.Provider,{value:c,children:o})}return r=[...r,o],s.displayName=n+"Provider",[s,function(r,s){const l=(null==s?void 0:s[t][a])||i,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},_r(o,...n)]}(Pr,[Or]),[kr,Ir]=Tr(Pr),Lr=e.forwardRef((e,t)=>m.jsx(jr.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(jr.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(Fr,{...e,ref:t})})}));Lr.displayName=Pr;var Fr=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,p=e.useRef(null),v=g(n,p),w=Rr(a),[y=null,x]=U({prop:s,defaultProp:l,onChange:c}),[b,C]=e.useState(!1),E=P(u),R=Nr(r),S=e.useRef(!1),[_,M]=e.useState(0);return e.useEffect(()=>{const e=p.current;if(e)return e.addEventListener(Dr,E),()=>e.removeEventListener(Dr,E)},[E]),m.jsx(kr,{scope:r,orientation:o,dir:w,loop:i,currentTabStopId:y,onItemFocus:e.useCallback(e=>x(e),[x]),onItemShiftTab:e.useCallback(()=>C(!0),[]),onFocusableItemAdd:e.useCallback(()=>M(e=>e+1),[]),onFocusableItemRemove:e.useCallback(()=>M(e=>e-1),[]),children:m.jsx(D.div,{tabIndex:b||0===_?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:h(t.onMouseDown,()=>{S.current=!0}),onFocus:h(t.onFocus,e=>{const t=!S.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Dr,Mr);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=R().filter(e=>e.focusable);Kr([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:h(t.onBlur,()=>C(!1))})})}),Wr="RovingFocusGroupItem",Br=e.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:i=!1,tabStopId:a,...s}=t,l=Et(),c=a||l,u=Ir(Wr,r),d=u.currentTabStopId===c,f=Nr(r),{onFocusableItemAdd:p,onFocusableItemRemove:v}=u;return e.useEffect(()=>{if(o)return p(),()=>v()},[o,p,v]),m.jsx(jr.ItemSlot,{scope:r,id:c,focusable:o,active:i,children:m.jsx(D.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:n,onMouseDown:h(t.onMouseDown,e=>{o?u.onItemFocus(c):e.preventDefault()}),onFocus:h(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:h(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.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:Hr[r]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().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=u.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>Kr(o))}var n,r})})})});Br.displayName=Wr;var Hr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Kr(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 $r=Lr,Vr=Br,Ur=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(D.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"})})});Ur.displayName="Arrow";var zr=Ur;function Gr(...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}var Xr="Popper",[Yr,qr]=function(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;function s(n){const{scope:r,children:o,...s}=n,l=(null==r?void 0:r[t][a])||i,c=e.useMemo(()=>s,Object.values(s));return m.jsx(l.Provider,{value:c,children:o})}return r=[...r,o],s.displayName=n+"Provider",[s,function(r,s){const l=(null==s?void 0:s[t][a])||i,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Gr(o,...n)]}(Xr),[Zr,Jr]=Yr(Xr),Qr=t=>{const{__scopePopper:n,children:r}=t,[o,i]=e.useState(null);return m.jsx(Zr,{scope:n,anchor:o,onAnchorChange:i,children:r})};Qr.displayName=Xr;var eo="PopperAnchor",to=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...i}=t,a=Jr(eo,r),s=e.useRef(null),l=g(n,s);return e.useEffect(()=>{a.onAnchorChange((null==o?void 0:o.current)||s.current)}),o?null:m.jsx(D.div,{...i,ref:l})});to.displayName=eo;var no="PopperContent",[ro,oo]=Yr(no),io=e.forwardRef((t,n)=>{var r,o,i,a,s,l;const{__scopePopper:c,side:u="bottom",sideOffset:d=0,align:f="center",alignOffset:p=0,arrowPadding:h=0,avoidCollisions:v=!0,collisionBoundary:w=[],collisionPadding:y=0,sticky:x="partial",hideWhenDetached:b=!1,updatePositionStrategy:C="optimized",onPlaced:E,...R}=t,S=Jr(no,c),[_,M]=e.useState(null),j=g(n,e=>M(e)),[N,O]=e.useState(null),T=Cr(N),A=(null==T?void 0:T.width)??0,k=(null==T?void 0:T.height)??0,I=u+("center"!==f?"-"+f:""),L="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},F=Array.isArray(w)?w:[w],W=F.length>0,B={padding:L,boundary:F.filter(co),altBoundary:W},{refs:K,floatingStyles:$,placement:V,isPositioned:U,middlewareData:z}=ft({strategy:"fixed",placement:I,whileElementsMounted:(...e)=>Je(...e,{animationFrame:"always"===C}),elements:{reference:S.anchor},middleware:[mt({mainAxis:d+k,alignmentAxis:p}),v&&ht({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?vt():void 0,...B}),v&>({...B}),wt({...B,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`)}}),N&&xt({element:N,padding:h}),uo({arrowWidth:A,arrowHeight:k}),b&&yt({strategy:"referenceHidden",...B})]}),[G,X]=fo(V),Y=P(E);H(()=>{U&&(null==Y||Y())},[U,Y]);const q=null==(r=z.arrow)?void 0:r.x,Z=null==(o=z.arrow)?void 0:o.y,J=0!==(null==(i=z.arrow)?void 0:i.centerOffset),[Q,ee]=e.useState();return H(()=>{_&&ee(window.getComputedStyle(_).zIndex)},[_]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[null==(a=z.transformOrigin)?void 0:a.x,null==(s=z.transformOrigin)?void 0:s.y].join(" "),...(null==(l=z.hide)?void 0:l.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(ro,{scope:c,placedSide:G,onArrowChange:O,arrowX:q,arrowY:Z,shouldHideArrow:J,children:m.jsx(D.div,{"data-side":G,"data-align":X,...R,ref:j,style:{...R.style,animation:U?void 0:"none"}})})})});io.displayName=no;var ao="PopperArrow",so={top:"bottom",right:"left",bottom:"top",left:"right"},lo=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=oo(ao,n),i=so[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(zr,{...r,ref:t,style:{...r.style,display:"block"}})})});function co(e){return null!==e}lo.displayName=ao;var uo=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:a,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=fo(i),p={start:"0%",center:"50%",end:"100%"}[f],m=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,h=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",g="";return"bottom"===d?(v=l?p:`${m}px`,g=-u+"px"):"top"===d?(v=l?p:`${m}px`,g=`${a.floating.height+u}px`):"right"===d?(v=-u+"px",g=l?p:`${h}px`):"left"===d&&(v=`${a.floating.width+u}px`,g=l?p:`${h}px`),{data:{x:v,y:g}}}});function fo(e){const[t,n="center"]=e.split("-");return[t,n]}var po=Qr,mo=to,ho=io,vo=lo,go=[" ","Enter","ArrowUp","ArrowDown"],wo=[" ","Enter"],yo="Select",[xo,bo,Co]=R(yo),[Eo,Ro]=S(yo,[Co,qr]),So=qr(),[_o,Do]=Eo(yo),[Mo,Po]=Eo(yo),jo=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:v}=t,g=So(n),[w,y]=e.useState(null),[x,b]=e.useState(null),[C,E]=e.useState(!1),R=Rr(u),[S=!1,_]=U({prop:o,defaultProp:i,onChange:a}),[D,M]=U({prop:s,defaultProp:l,onChange:c}),P=e.useRef(null),j=!w||(v||!!w.closest("form")),[N,O]=e.useState(new Set),T=Array.from(N).map(e=>e.props.value).join(";");return m.jsx(po,{...g,children:m.jsxs(_o,{required:h,scope:n,trigger:w,onTriggerChange:y,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Et(),value:D,onValueChange:M,open:S,onOpenChange:_,dir:R,triggerPointerDownPosRef:P,disabled:p,children:[m.jsx(xo.Provider,{scope:n,children:m.jsx(Mo,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{O(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{O(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),j?m.jsxs(gi,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>M(e.target.value),disabled:p,form:v,children:[void 0===D?m.jsx("option",{value:""}):null,Array.from(N)]},T):null]})})};jo.displayName=yo;var No="SelectTrigger",Oo=e.forwardRef((t,n)=>{const{__scopeSelect:r,disabled:o=!1,...i}=t,a=So(r),s=Do(No,r),l=s.disabled||o,c=g(n,s.onTriggerChange),u=bo(r),d=e.useRef("touch"),[f,p,v]=wi(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=yi(t,e,n);void 0!==r&&s.onValueChange(r.value)}),w=e=>{l||(s.onOpenChange(!0),v()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m.jsx(mo,{asChild:!0,...a,children:m.jsx(D.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":vi(s.value)?"":void 0,...i,ref:c,onClick:h(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&w(e)}),onPointerDown:h(i.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(w(e),e.preventDefault())}),onKeyDown:h(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||go.includes(e.key)&&(w(),e.preventDefault())})})})});Oo.displayName=No;var To="SelectValue",Ao=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=Do(To,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==i,d=g(t,l.onValueNodeChange);return H(()=>{c(u)},[c,u]),m.jsx(D.span,{...s,ref:d,style:{pointerEvents:"none"},children:vi(l.value)?m.jsx(m.Fragment,{children:a}):i})});Ao.displayName=To;var ko=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(D.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ko.displayName="SelectIcon";var Io=e=>m.jsx(K,{asChild:!0,...e});Io.displayName="SelectPortal";var Lo="SelectContent",Fo=e.forwardRef((t,r)=>{const o=Do(Lo,t.__scopeSelect),[i,a]=e.useState();if(H(()=>{a(new DocumentFragment)},[]),!o.open){const e=i;return e?n.createPortal(m.jsx(Bo,{scope:t.__scopeSelect,children:m.jsx(xo.Slot,{scope:t.__scopeSelect,children:m.jsx("div",{children:t.children})})}),e):null}return m.jsx(Ko,{...t,ref:r})});Fo.displayName=Lo;var Wo=10,[Bo,Ho]=Eo(Lo),Ko=e.forwardRef((t,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:w,hideWhenDetached:x,avoidCollisions:b,...C}=t,E=Do(Lo,r),[R,S]=e.useState(null),[_,D]=e.useState(null),M=g(n,e=>S(e)),[P,j]=e.useState(null),[N,O]=e.useState(null),T=bo(r),[A,I]=e.useState(!1),L=e.useRef(!1);e.useEffect(()=>{if(R)return An(R)},[R]),kt();const F=e.useCallback(e=>{const[t,...n]=T().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(null==i||i.scrollIntoView({block:"nearest"}),i===t&&_&&(_.scrollTop=0),i===r&&_&&(_.scrollTop=_.scrollHeight),null==i||i.focus(),document.activeElement!==o)return}},[T,_]),W=e.useCallback(()=>F([P,R]),[F,P,R]);e.useEffect(()=>{A&&W()},[A,W]);const{onOpenChange:B,triggerPointerDownPosRef:H}=E;e.useEffect(()=>{if(R){let e={x:0,y:0};const t=t=>{var n,r;e={x:Math.abs(Math.round(t.pageX)-((null==(n=H.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=H.current)?void 0:r.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():R.contains(n.target)||B(!1),document.removeEventListener("pointermove",t),H.current=null};return null!==H.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[R,B,H]),e.useEffect(()=>{const e=()=>B(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[B]);const[K,$]=wi(e=>{const t=T().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=yi(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),V=e.useCallback((e,t,n)=>{const r=!L.current&&!n;(void 0!==E.value&&E.value===t||r)&&(j(e),r&&(L.current=!0))},[E.value]),U=e.useCallback(()=>null==R?void 0:R.focus(),[R]),z=e.useCallback((e,t,n)=>{const r=!L.current&&!n;(void 0!==E.value&&E.value===t||r)&&O(e)},[E.value]),G="popper"===o?Vo:$o,X=G===Vo?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:w,hideWhenDetached:x,avoidCollisions:b}:{};return m.jsx(Bo,{scope:r,content:R,viewport:_,onViewportChange:D,itemRefCallback:V,selectedItem:P,onItemLeave:U,itemTextRefCallback:z,focusSelectedItem:W,selectedItemText:N,position:o,isPositioned:A,searchRef:K,children:m.jsx(Dn,{as:y,allowPinchZoom:!0,children:m.jsx(Dt,{asChild:!0,trapped:E.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:h(i,e=>{var t;null==(t=E.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:m.jsx(k,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:m.jsx(G,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:e=>e.preventDefault(),...C,...X,onPlaced:()=>I(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:h(C.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});Ko.displayName="SelectContentImpl";var $o=e.forwardRef((t,n)=>{const{__scopeSelect:r,onPlaced:o,...i}=t,a=Do(Lo,r),s=Ho(Lo,r),[l,c]=e.useState(null),[u,d]=e.useState(null),f=g(n,e=>d(e)),p=bo(r),h=e.useRef(!1),v=e.useRef(!0),{viewport:w,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=s,C=e.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&w&&y&&x){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=x.getBoundingClientRect();if("rtl"!==a.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Wo,d=Sr(i,[Wo,Math.max(Wo,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Wo,d=Sr(i,[Wo,Math.max(Wo,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const i=p(),s=window.innerHeight-2*Wo,c=w.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),g=f+m+c+parseInt(d.paddingBottom,10)+v,b=Math.min(5*y.offsetHeight,g),C=window.getComputedStyle(w),E=parseInt(C.paddingTop,10),R=parseInt(C.paddingBottom,10),S=e.top+e.height/2-Wo,_=s-S,D=y.offsetHeight/2,M=f+m+(y.offsetTop+D),P=g-M;if(M<=S){const e=i.length>0&&y===i[i.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-w.offsetTop-w.offsetHeight,n=M+Math.max(_,D+(e?R:0)+t+v);l.style.height=n+"px"}else{const e=i.length>0&&y===i[0].ref.current;l.style.top="0px";const t=Math.max(S,f+w.offsetTop+(e?E:0)+D)+P;l.style.height=t+"px",w.scrollTop=M-S+w.offsetTop}l.style.margin=`${Wo}px 0`,l.style.minHeight=b+"px",l.style.maxHeight=s+"px",null==o||o(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,l,u,w,y,x,a.dir,o]);H(()=>C(),[C]);const[E,R]=e.useState();H(()=>{u&&R(window.getComputedStyle(u).zIndex)},[u]);const S=e.useCallback(e=>{e&&!0===v.current&&(C(),null==b||b(),v.current=!1)},[C,b]);return m.jsx(Uo,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:S,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m.jsx(D.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});$o.displayName="SelectItemAlignedPosition";var Vo=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Wo,...i}=e,a=So(n);return m.jsx(ho,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vo.displayName="SelectPopperPosition";var[Uo,zo]=Eo(Lo,{}),Go="SelectViewport",Xo=e.forwardRef((t,n)=>{const{__scopeSelect:r,nonce:o,...i}=t,a=Ho(Go,r),s=zo(Go,r),l=g(n,a.onViewportChange),c=e.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(xo.Slot,{scope:r,children:m.jsx(D.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:h(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if((null==r?void 0:r.current)&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Wo,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});Xo.displayName=Go;var Yo="SelectGroup",[qo,Zo]=Eo(Yo),Jo=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Et();return m.jsx(qo,{scope:n,id:o,children:m.jsx(D.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Jo.displayName=Yo;var Qo="SelectLabel",ei=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Zo(Qo,n);return m.jsx(D.div,{id:o.id,...r,ref:t})});ei.displayName=Qo;var ti="SelectItem",[ni,ri]=Eo(ti),oi=e.forwardRef((t,n)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:a,...s}=t,l=Do(ti,r),c=Ho(ti,r),u=l.value===o,[d,f]=e.useState(a??""),[p,v]=e.useState(!1),w=g(n,e=>{var t;return null==(t=c.itemRefCallback)?void 0:t.call(c,e,o,i)}),y=Et(),x=e.useRef("touch"),b=()=>{i||(l.onValueChange(o),l.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(ni,{scope:r,value:o,disabled:i,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:m.jsx(xo.ItemSlot,{scope:r,value:o,disabled:i,textValue:d,children:m.jsx(D.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:h(s.onFocus,()=>v(!0)),onBlur:h(s.onBlur,()=>v(!1)),onClick:h(s.onClick,()=>{"mouse"!==x.current&&b()}),onPointerUp:h(s.onPointerUp,()=>{"mouse"===x.current&&b()}),onPointerDown:h(s.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:h(s.onPointerMove,e=>{var t;x.current=e.pointerType,i?null==(t=c.onItemLeave)||t.call(c):"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:h(s.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=c.onItemLeave)||t.call(c))}),onKeyDown:h(s.onKeyDown,e=>{var t;""!==(null==(t=c.searchRef)?void 0:t.current)&&" "===e.key||(wo.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});oi.displayName=ti;var ii="SelectItemText",ai=e.forwardRef((t,r)=>{const{__scopeSelect:o,className:i,style:a,...s}=t,l=Do(ii,o),c=Ho(ii,o),u=ri(ii,o),d=Po(ii,o),[f,p]=e.useState(null),h=g(r,e=>p(e),u.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,u.value,u.disabled)}),v=null==f?void 0:f.textContent,w=e.useMemo(()=>m.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=d;return H(()=>(y(w),()=>x(w)),[y,x,w]),m.jsxs(m.Fragment,{children:[m.jsx(D.span,{id:u.textId,...s,ref:h}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?n.createPortal(s.children,l.valueNode):null]})});ai.displayName=ii;var si="SelectItemIndicator",li=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ri(si,n).isSelected?m.jsx(D.span,{"aria-hidden":!0,...r,ref:t}):null});li.displayName=si;var ci="SelectScrollUpButton",ui=e.forwardRef((t,n)=>{const r=Ho(ci,t.__scopeSelect),o=zo(ci,t.__scopeSelect),[i,a]=e.useState(!1),s=g(n,o.onScrollButtonChange);return H(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?m.jsx(pi,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});ui.displayName=ci;var di="SelectScrollDownButton",fi=e.forwardRef((t,n)=>{const r=Ho(di,t.__scopeSelect),o=zo(di,t.__scopeSelect),[i,a]=e.useState(!1),s=g(n,o.onScrollButtonChange);return H(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?m.jsx(pi,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});fi.displayName=di;var pi=e.forwardRef((t,n)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=t,a=Ho("SelectScrollButton",r),s=e.useRef(null),l=bo(r),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),H(()=>{var e;const t=l().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[l]),m.jsx(D.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:h(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:h(i.onPointerMove,()=>{var e;null==(e=a.onItemLeave)||e.call(a),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:h(i.onPointerLeave,()=>{c()})})}),mi=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(D.div,{"aria-hidden":!0,...r,ref:t})});mi.displayName="SelectSeparator";var hi="SelectArrow";function vi(e){return""===e||void 0===e}e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=So(n),i=Do(hi,n),a=Ho(hi,n);return i.open&&"popper"===a.position?m.jsx(vo,{...o,...r,ref:t}):null}).displayName=hi;var gi=e.forwardRef((t,n)=>{const{value:r,...o}=t,i=e.useRef(null),a=g(n,i),s=br(r);return e.useEffect(()=>{const e=i.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[s,r]),m.jsx(z,{asChild:!0,children:m.jsx("select",{...o,ref:a,defaultValue:r})})});function wi(t){const n=P(t),r=e.useRef(""),o=e.useRef(0),i=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,a]}function yi(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(o,0),a.map((e,t)=>a[(s+t)%a.length]));var a,s;1===r.length&&(i=i.filter(e=>e!==n));const l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}gi.displayName="BubbleSelect";var xi=jo,bi=Oo,Ci=Ao,Ei=ko,Ri=Io,Si=Fo,_i=Xo,Di=Jo,Mi=ei,Pi=oi,ji=ai,Ni=li,Oi=ui,Ti=fi,Ai=mi,ki=["Enter"," "],Ii=["ArrowUp","PageDown","End"],Li=["ArrowDown","PageUp","Home",...Ii],Fi={ltr:[...ki,"ArrowRight"],rtl:[...ki,"ArrowLeft"]},Wi={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Bi="Menu",[Hi,Ki,$i]=R(Bi),[Vi,Ui]=S(Bi,[$i,qr,Ar]),zi=qr(),Gi=Ar(),[Xi,Yi]=Vi(Bi),[qi,Zi]=Vi(Bi),Ji=t=>{const{__scopeMenu:n,open:r=!1,children:o,dir:i,onOpenChange:a,modal:s=!0}=t,l=zi(n),[c,u]=e.useState(null),d=e.useRef(!1),f=P(a),p=Rr(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(po,{...l,children:m.jsx(Xi,{scope:n,open:r,onOpenChange:f,content:c,onContentChange:u,children:m.jsx(qi,{scope:n,onClose:e.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:o})})})};Ji.displayName=Bi;var Qi=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=zi(n);return m.jsx(mo,{...o,...r,ref:t})});Qi.displayName="MenuAnchor";var ea="MenuPortal",[ta,na]=Vi(ea,{forceMount:void 0}),ra=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Yi(ea,t);return m.jsx(ta,{scope:t,forceMount:n,children:m.jsx($,{present:n||i.open,children:m.jsx(K,{asChild:!0,container:o,children:r})})})};ra.displayName=ea;var oa="MenuContent",[ia,aa]=Vi(oa),sa=e.forwardRef((e,t)=>{const n=na(oa,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Yi(oa,e.__scopeMenu),a=Zi(oa,e.__scopeMenu);return m.jsx(Hi.Provider,{scope:e.__scopeMenu,children:m.jsx($,{present:r||i.open,children:m.jsx(Hi.Slot,{scope:e.__scopeMenu,children:a.modal?m.jsx(la,{...o,ref:t}):m.jsx(ca,{...o,ref:t})})})})}),la=e.forwardRef((t,n)=>{const r=Yi(oa,t.__scopeMenu),o=e.useRef(null),i=g(n,o);return e.useEffect(()=>{const e=o.current;if(e)return An(e)},[]),m.jsx(ua,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:h(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),ca=e.forwardRef((e,t)=>{const n=Yi(oa,e.__scopeMenu);return m.jsx(ua,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ua=e.forwardRef((t,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:w,...x}=t,b=Yi(oa,r),C=Zi(oa,r),E=zi(r),R=Gi(r),S=Ki(r),[_,D]=e.useState(null),M=e.useRef(null),P=g(n,M,b.onContentChange),j=e.useRef(0),N=e.useRef(""),O=e.useRef(0),T=e.useRef(null),A=e.useRef("right"),I=e.useRef(0),L=w?Dn:e.Fragment,F=w?{as:y,allowPinchZoom:!0}:void 0,W=e=>{var t,n;const r=N.current+e,o=S().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,l=Math.max(i,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===o.length&&(a=a.filter(e=>e!==n));const c=a.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}(o.map(e=>e.textValue),r,a),l=null==(n=o.find(e=>e.textValue===s))?void 0:n.ref.current;!function e(t){N.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout(()=>e(""),1e3))}(r),l&&setTimeout(()=>l.focus())};e.useEffect(()=>()=>window.clearTimeout(j.current),[]),kt();const B=e.useCallback(e=>{var t,n;return A.current===(null==(t=T.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].x,s=t[i].y,l=t[a].x,c=t[a].y;s>r!=c>r&&n<(l-e)*(r-s)/(c-s)+e&&(o=!o)}return o}(n,t)}(e,null==(n=T.current)?void 0:n.area)},[]);return m.jsx(ia,{scope:r,searchRef:N,onItemEnter:e.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:e.useCallback(e=>{var t;B(e)||(null==(t=M.current)||t.focus(),D(null))},[B]),onTriggerLeave:e.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:O,onPointerGraceIntentChange:e.useCallback(e=>{T.current=e},[]),children:m.jsx(L,{...F,children:m.jsx(Dt,{asChild:!0,trapped:i,onMountAutoFocus:h(a,e=>{var t;e.preventDefault(),null==(t=M.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:m.jsx(k,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx($r,{asChild:!0,...R,dir:C.dir,orientation:"vertical",loop:o,currentTabStopId:_,onCurrentTabStopIdChange:D,onEntryFocus:h(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(ho,{role:"menu","aria-orientation":"vertical","data-state":Fa(b.open),"data-radix-menu-content":"",dir:C.dir,...E,...x,ref:P,style:{outline:"none",...x.style},onKeyDown:h(x.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&&W(e.key));const o=M.current;if(e.target!==o)return;if(!Li.includes(e.key))return;e.preventDefault();const i=S().filter(e=>!e.disabled).map(e=>e.ref.current);Ii.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(j.current),N.current="")}),onPointerMove:h(t.onPointerMove,Ha(e=>{const t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>I.current?"right":"left";A.current=t,I.current=e.clientX}}))})})})})})})});sa.displayName=oa;var da=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(D.div,{role:"group",...r,ref:t})});da.displayName="MenuGroup";var fa=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(D.div,{...r,ref:t})});fa.displayName="MenuLabel";var pa="MenuItem",ma="menu.itemSelect",ha=e.forwardRef((t,n)=>{const{disabled:r=!1,onSelect:o,...i}=t,a=e.useRef(null),s=Zi(pa,t.__scopeMenu),l=aa(pa,t.__scopeMenu),c=g(n,a),u=e.useRef(!1);return m.jsx(va,{...i,ref:c,disabled:r,onClick:h(t.onClick,()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(ma,{bubbles:!0,cancelable:!0});e.addEventListener(ma,e=>null==o?void 0:o(e),{once:!0}),M(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=""!==l.searchRef.current;r||t&&" "===e.key||ki.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ha.displayName=pa;var va=e.forwardRef((t,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:i,...a}=t,s=aa(pa,r),l=Gi(r),c=e.useRef(null),u=g(n,c),[d,f]=e.useState(!1),[p,v]=e.useState("");return e.useEffect(()=>{const e=c.current;e&&v((e.textContent??"").trim())},[a.children]),m.jsx(Hi.ItemSlot,{scope:r,disabled:o,textValue:i??p,children:m.jsx(Vr,{asChild:!0,...l,focusable:!o,children:m.jsx(D.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,Ha(e=>{if(o)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:h(t.onPointerLeave,Ha(e=>s.onItemLeave(e))),onFocus:h(t.onFocus,()=>f(!0)),onBlur:h(t.onBlur,()=>f(!1))})})})}),ga=e.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.jsx(Sa,{scope:e.__scopeMenu,checked:n,children:m.jsx(ha,{role:"menuitemcheckbox","aria-checked":Wa(n)?"mixed":n,...o,ref:t,"data-state":Ba(n),onSelect:h(o.onSelect,()=>null==r?void 0:r(!!Wa(n)||!n),{checkForDefaultPrevented:!1})})})});ga.displayName="MenuCheckboxItem";var wa="MenuRadioGroup",[ya,xa]=Vi(wa,{value:void 0,onValueChange:()=>{}}),ba=e.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=P(r);return m.jsx(ya,{scope:e.__scopeMenu,value:n,onValueChange:i,children:m.jsx(da,{...o,ref:t})})});ba.displayName=wa;var Ca="MenuRadioItem",Ea=e.forwardRef((e,t)=>{const{value:n,...r}=e,o=xa(Ca,e.__scopeMenu),i=n===o.value;return m.jsx(Sa,{scope:e.__scopeMenu,checked:i,children:m.jsx(ha,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Ba(i),onSelect:h(r.onSelect,()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)},{checkForDefaultPrevented:!1})})})});Ea.displayName=Ca;var Ra="MenuItemIndicator",[Sa,_a]=Vi(Ra,{checked:!1}),Da=e.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=_a(Ra,n);return m.jsx($,{present:r||Wa(i.checked)||!0===i.checked,children:m.jsx(D.span,{...o,ref:t,"data-state":Ba(i.checked)})})});Da.displayName=Ra;var Ma=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.jsx(D.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ma.displayName="MenuSeparator";var Pa=e.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=zi(n);return m.jsx(vo,{...o,...r,ref:t})});Pa.displayName="MenuArrow";var ja="MenuSub",[Na,Oa]=Vi(ja),Ta=t=>{const{__scopeMenu:n,children:r,open:o=!1,onOpenChange:i}=t,a=Yi(ja,n),s=zi(n),[l,c]=e.useState(null),[u,d]=e.useState(null),f=P(i);return e.useEffect(()=>(!1===a.open&&f(!1),()=>f(!1)),[a.open,f]),m.jsx(po,{...s,children:m.jsx(Xi,{scope:n,open:o,onOpenChange:f,content:u,onContentChange:d,children:m.jsx(Na,{scope:n,contentId:Et(),triggerId:Et(),trigger:l,onTriggerChange:c,children:r})})})};Ta.displayName=ja;var Aa="MenuSubTrigger",ka=e.forwardRef((t,n)=>{const r=Yi(Aa,t.__scopeMenu),o=Zi(Aa,t.__scopeMenu),i=Oa(Aa,t.__scopeMenu),a=aa(Aa,t.__scopeMenu),s=e.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=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=l.current;return()=>{window.clearTimeout(e),c(null)}},[l,c]),m.jsx(Qi,{asChild:!0,...u,children:m.jsx(va,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Fa(r.open),...t,ref:v(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,Ha(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,Ha(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,c=o[i?"left":"right"],u=o[i?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(l.current),l.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||Fi[o.dir].includes(e.key)&&(r.onOpenChange(!0),null==(n=r.content)||n.focus(),e.preventDefault())})})})});ka.displayName=Aa;var Ia="MenuSubContent",La=e.forwardRef((t,n)=>{const r=na(oa,t.__scopeMenu),{forceMount:o=r.forceMount,...i}=t,a=Yi(oa,t.__scopeMenu),s=Zi(oa,t.__scopeMenu),l=Oa(Ia,t.__scopeMenu),c=e.useRef(null),u=g(n,c);return m.jsx(Hi.Provider,{scope:t.__scopeMenu,children:m.jsx($,{present:o||a.open,children:m.jsx(Hi.Slot,{scope:t.__scopeMenu,children:m.jsx(ua,{id:l.contentId,"aria-labelledby":l.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=c.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:h(t.onFocusOutside,e=>{e.target!==l.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=Wi[s.dir].includes(e.key);n&&r&&(a.onOpenChange(!1),null==(t=l.trigger)||t.focus(),e.preventDefault())})})})})})});function Fa(e){return e?"open":"closed"}function Wa(e){return"indeterminate"===e}function Ba(e){return Wa(e)?"indeterminate":e?"checked":"unchecked"}function Ha(e){return t=>"mouse"===t.pointerType?e(t):void 0}La.displayName=Ia;var Ka=Ji,$a=Qi,Va=ra,Ua=sa,za=da,Ga=fa,Xa=ha,Ya=ga,qa=ba,Za=Ea,Ja=Da,Qa=Ma,es=Pa,ts=Ta,ns=ka,rs=La,os="DropdownMenu",[is,as]=S(os,[Ui]),ss=Ui(),[ls,cs]=is(os),us=t=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:i,defaultOpen:a,onOpenChange:s,modal:l=!0}=t,c=ss(n),u=e.useRef(null),[d=!1,f]=U({prop:i,defaultProp:a,onChange:s});return m.jsx(ls,{scope:n,triggerId:Et(),triggerRef:u,contentId:Et(),open:d,onOpenChange:f,onOpenToggle:e.useCallback(()=>f(e=>!e),[f]),modal:l,children:m.jsx(Ka,{...c,open:d,onOpenChange:f,dir:o,modal:l,children:r})})};us.displayName=os;var ds="DropdownMenuTrigger",fs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=cs(ds,n),a=ss(n);return m.jsx($a,{asChild:!0,...a,children:m.jsx(D.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:v(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())})})})});fs.displayName=ds;var ps=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ss(t);return m.jsx(Va,{...r,...n})};ps.displayName="DropdownMenuPortal";var ms="DropdownMenuContent",hs=e.forwardRef((t,n)=>{const{__scopeDropdownMenu:r,...o}=t,i=cs(ms,r),a=ss(r),s=e.useRef(!1);return m.jsx(Ua,{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)"}})});hs.displayName=ms;e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(za,{...o,...r,ref:t})}).displayName="DropdownMenuGroup";var vs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Ga,{...o,...r,ref:t})});vs.displayName="DropdownMenuLabel";var gs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Xa,{...o,...r,ref:t})});gs.displayName="DropdownMenuItem";var ws=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Ya,{...o,...r,ref:t})});ws.displayName="DropdownMenuCheckboxItem";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(qa,{...o,...r,ref:t})}).displayName="DropdownMenuRadioGroup";var ys=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Za,{...o,...r,ref:t})});ys.displayName="DropdownMenuRadioItem";var xs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Ja,{...o,...r,ref:t})});xs.displayName="DropdownMenuItemIndicator";var bs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(Qa,{...o,...r,ref:t})});bs.displayName="DropdownMenuSeparator";e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(es,{...o,...r,ref:t})}).displayName="DropdownMenuArrow";var Cs=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(ns,{...o,...r,ref:t})});Cs.displayName="DropdownMenuSubTrigger";var Es=e.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ss(n);return m.jsx(rs,{...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)"}})});Es.displayName="DropdownMenuSubContent";var Rs=us,Ss=fs,_s=ps,Ds=hs,Ms=vs,Ps=gs,js=ws,Ns=ys,Os=xs,Ts=bs,As=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=ss(t),[s=!1,l]=U({prop:r,defaultProp:i,onChange:o});return m.jsx(ts,{...a,open:s,onOpenChange:l,children:n})},ks=Cs,Is=Es;export{qt as $,Rr as A,B,gr as C,yr as D,Et as E,G as F,k as G,v as H,Sr as I,Ar as J,$r as K,Vr as L,Xt as M,zt as N,vr as O,D as P,Lt as Q,W as R,y as S,wr as T,Kt as U,z as V,Ht as W,nn as X,Bt as Y,dn as Z,Ft as _,S as a,An as a0,Wt as a1,xi as a2,Ci as a3,bi as a4,Ei as a5,Oi as a6,Ti as a7,Ri as a8,Si as a9,_i as aa,Mi as ab,Pi as ac,Ni as ad,ji as ae,Ai as af,Di as ag,Ln as ah,cr as ai,b as aj,ks as ak,Is as al,_s as am,Ds as an,Ps as ao,js as ap,Os as aq,Ns as ar,Ms as as,Ts as at,Rs as au,Ss as av,As as aw,U as b,R as c,$ as d,P as e,h as f,K as g,H as h,M as i,m as j,ft as k,Je as l,gt as m,wt as n,mt as o,xt as p,yt as q,vt as r,ht as s,xr as t,g as u,pr as v,mr as w,hr as x,br as y,Cr as z};