Files
cad-Integration/text-to-cad-main/skills/cad-viewer/scripts/viewer/dist/assets/vendor-ui-CtsphK4U.js
T
2026-07-22 13:48:46 +08:00

53 lines
123 KiB
JavaScript

import{r as a,j as l,a as yt,R as $,b as Co,c as ki,u as Li,o as Fi,s as $i,f as Bi,d as Vi,e as Ki,h as Gi,g as Hi,l as Ui}from"./vendor-react-7jnMmQ9s.js";function oo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function St(...e){return t=>{let n=!1;const o=e.map(r=>{const s=oo(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():oo(e[r],null)}}}}function D(...e){return a.useCallback(St(...e),e)}function ge(e){const t=Wi(e),n=a.forwardRef((o,r)=>{const{children:s,...i}=o,c=a.Children.toArray(s),u=c.find(Yi);if(u){const d=u.props.children,p=c.map(f=>f===u?a.Children.count(d)>1?a.Children.only(null):a.isValidElement(d)?d.props.children:null:f);return l.jsx(t,{...i,ref:r,children:a.isValidElement(d)?a.cloneElement(d,void 0,p):null})}return l.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var yp=ge("Slot");function Wi(e){const t=a.forwardRef((n,o)=>{const{children:r,...s}=n;if(a.isValidElement(r)){const i=Xi(r),c=zi(s,r.props);return r.type!==a.Fragment&&(c.ref=o?St(o,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yo=Symbol("radix.slottable");function So(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yo,t}function Yi(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yo}function zi(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const u=s(...c);return r(...c),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Xi(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],R=qi.reduce((e,t)=>{const n=ge(`Primitive.${t}`),o=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function bn(e,t){e&&yt.flushSync(()=>e.dispatchEvent(t))}var bo=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Zi="VisuallyHidden",bt=a.forwardRef((e,t)=>l.jsx(R.span,{...e,ref:t,style:{...bo,...e.style}}));bt.displayName=Zi;var Qi=bt;function Ji(e,t){const n=a.createContext(t),o=s=>{const{children:i,...c}=s,u=a.useMemo(()=>c,Object.values(c));return l.jsx(n.Provider,{value:u,children:i})};o.displayName=e+"Provider";function r(s){const i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function X(e,t=[]){let n=[];function o(s,i){const c=a.createContext(i),u=n.length;n=[...n,i];const d=f=>{const{scope:h,children:x,...y}=f,v=h?.[e]?.[u]||c,m=a.useMemo(()=>y,Object.values(y));return l.jsx(v.Provider,{value:m,children:x})};d.displayName=s+"Provider";function p(f,h){const x=h?.[e]?.[u]||c,y=a.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const r=()=>{const s=n.map(i=>a.createContext(i));return function(c){const u=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return r.scopeName=e,[o,ec(r,...t)]}function ec(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function $e(e){const t=e+"CollectionProvider",[n,o]=X(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:m,children:w}=v,g=$.useRef(null),C=$.useRef(new Map).current;return l.jsx(r,{scope:m,itemMap:C,collectionRef:g,children:w})};i.displayName=t;const c=e+"CollectionSlot",u=ge(c),d=$.forwardRef((v,m)=>{const{scope:w,children:g}=v,C=s(c,w),S=D(m,C.collectionRef);return l.jsx(u,{ref:S,children:g})});d.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",h=ge(p),x=$.forwardRef((v,m)=>{const{scope:w,children:g,...C}=v,S=$.useRef(null),E=D(m,S),M=s(p,w);return $.useEffect(()=>(M.itemMap.set(S,{ref:S,...C}),()=>{M.itemMap.delete(S)})),l.jsx(h,{[f]:"",ref:E,children:g})});x.displayName=p;function y(v){const m=s(e+"CollectionConsumer",v);return $.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const C=Array.from(g.querySelectorAll(`[${f}]`));return Array.from(m.itemMap.values()).sort((M,P)=>C.indexOf(M.ref.current)-C.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:d,ItemSlot:x},y,o]}function b(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Y=globalThis?.document?a.useLayoutEffect:()=>{},tc=Co[" useInsertionEffect ".trim().toString()]||Y;function z({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=nc({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:r;{const p=a.useRef(e!==void 0);a.useEffect(()=>{const f=p.current;f!==c&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,o])}const d=a.useCallback(p=>{if(c){const f=oc(p)?p(e):p;f!==e&&i.current?.(f)}else s(p)},[c,e,s,i]);return[u,d]}function nc({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),s=a.useRef(t);return tc(()=>{s.current=t},[t]),a.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function oc(e){return typeof e=="function"}function rc(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var oe=e=>{const{present:t,children:n}=e,o=ac(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),s=D(o.ref,sc(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:s}):null};oe.displayName="Presence";function ac(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[c,u]=rc(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const d=at(o.current);s.current=c==="mounted"?d:"none"},[c]),Y(()=>{const d=o.current,p=r.current;if(p!==e){const h=s.current,x=at(d);e?u("MOUNT"):x==="none"||d?.display==="none"?u("UNMOUNT"):u(p&&h!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Y(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=x=>{const v=at(o.current).includes(CSS.escape(x.animationName));if(x.target===t&&v&&(u("ANIMATION_END"),!r.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=x=>{x.target===t&&(s.current=at(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function at(e){return e?.animationName||"none"}function sc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ic=Co[" useId ".trim().toString()]||(()=>{}),cc=0;function Z(e){const[t,n]=a.useState(ic());return Y(()=>{n(o=>o??String(cc++))},[e]),e||(t?`radix-${t}`:"")}var Et="Collapsible",[lc,Eo]=X(Et),[uc,En]=lc(Et),Po=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:i,...c}=e,[u,d]=z({prop:o,defaultProp:r??!1,onChange:i,caller:Et});return l.jsx(uc,{scope:n,disabled:s,contentId:Z(),open:u,onOpenToggle:a.useCallback(()=>d(p=>!p),[d]),children:l.jsx(R.div,{"data-state":Rn(u),"data-disabled":s?"":void 0,...c,ref:t})})});Po.displayName=Et;var Ro="CollapsibleTrigger",To=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=En(Ro,n);return l.jsx(R.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Rn(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:b(e.onClick,r.onOpenToggle)})});To.displayName=Ro;var Pn="CollapsibleContent",_o=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=En(Pn,e.__scopeCollapsible);return l.jsx(oe,{present:n||r.open,children:({present:s})=>l.jsx(dc,{...o,ref:t,present:s})})});_o.displayName=Pn;var dc=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,i=En(Pn,n),[c,u]=a.useState(o),d=a.useRef(null),p=D(t,d),f=a.useRef(0),h=f.current,x=a.useRef(0),y=x.current,v=i.open||c,m=a.useRef(v),w=a.useRef(void 0);return a.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),Y(()=>{const g=d.current;if(g){w.current=w.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const C=g.getBoundingClientRect();f.current=C.height,x.current=C.width,m.current||(g.style.transitionDuration=w.current.transitionDuration,g.style.animationName=w.current.animationName),u(o)}},[i.open,o]),l.jsx(R.div,{"data-state":Rn(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...s,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&r})});function Rn(e){return e?"open":"closed"}var fc=Po,pc=To,vc=_o,mc=a.createContext(void 0);function _e(e){const t=a.useContext(mc);return e||t||"ltr"}var de="Accordion",hc=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Tn,gc,xc]=$e(de),[Pt]=X(de,[xc,Eo]),_n=Eo(),Mo=$.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,s=o;return l.jsx(Tn.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(Sc,{...s,ref:t}):l.jsx(yc,{...r,ref:t})})});Mo.displayName=de;var[Ao,wc]=Pt(de),[Io,Cc]=Pt(de,{collapsible:!1}),yc=$.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},collapsible:s=!1,...i}=e,[c,u]=z({prop:n,defaultProp:o??"",onChange:r,caller:de});return l.jsx(Ao,{scope:e.__scopeAccordion,value:$.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:$.useCallback(()=>s&&u(""),[s,u]),children:l.jsx(Io,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(No,{...i,ref:t})})})}),Sc=$.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...s}=e,[i,c]=z({prop:n,defaultProp:o??[],onChange:r,caller:de}),u=$.useCallback(p=>c((f=[])=>[...f,p]),[c]),d=$.useCallback(p=>c((f=[])=>f.filter(h=>h!==p)),[c]);return l.jsx(Ao,{scope:e.__scopeAccordion,value:i,onItemOpen:u,onItemClose:d,children:l.jsx(Io,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(No,{...s,ref:t})})})}),[bc,Rt]=Pt(de),No=$.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:r,orientation:s="vertical",...i}=e,c=$.useRef(null),u=D(c,t),d=gc(n),f=_e(r)==="ltr",h=b(e.onKeyDown,x=>{if(!hc.includes(x.key))return;const y=x.target,v=d().filter(I=>!I.ref.current?.disabled),m=v.findIndex(I=>I.ref.current===y),w=v.length;if(m===-1)return;x.preventDefault();let g=m;const C=0,S=w-1,E=()=>{g=m+1,g>S&&(g=C)},M=()=>{g=m-1,g<C&&(g=S)};switch(x.key){case"Home":g=C;break;case"End":g=S;break;case"ArrowRight":s==="horizontal"&&(f?E():M());break;case"ArrowDown":s==="vertical"&&E();break;case"ArrowLeft":s==="horizontal"&&(f?M():E());break;case"ArrowUp":s==="vertical"&&M();break}const P=g%w;v[P].ref.current?.focus()});return l.jsx(bc,{scope:n,disabled:o,direction:r,orientation:s,children:l.jsx(Tn.Slot,{scope:n,children:l.jsx(R.div,{...i,"data-orientation":s,ref:u,onKeyDown:o?void 0:h})})})}),vt="AccordionItem",[Ec,Mn]=Pt(vt),Do=$.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,s=Rt(vt,n),i=wc(vt,n),c=_n(n),u=Z(),d=o&&i.value.includes(o)||!1,p=s.disabled||e.disabled;return l.jsx(Ec,{scope:n,open:d,disabled:p,triggerId:u,children:l.jsx(fc,{"data-orientation":s.orientation,"data-state":$o(d),...c,...r,ref:t,disabled:p,open:d,onOpenChange:f=>{f?i.onItemOpen(o):i.onItemClose(o)}})})});Do.displayName=vt;var Oo="AccordionHeader",jo=$.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Rt(de,n),s=Mn(Oo,n);return l.jsx(R.h3,{"data-orientation":r.orientation,"data-state":$o(s.open),"data-disabled":s.disabled?"":void 0,...o,ref:t})});jo.displayName=Oo;var rn="AccordionTrigger",ko=$.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Rt(de,n),s=Mn(rn,n),i=Cc(rn,n),c=_n(n);return l.jsx(Tn.ItemSlot,{scope:n,children:l.jsx(pc,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":r.orientation,id:s.triggerId,...c,...o,ref:t})})});ko.displayName=rn;var Lo="AccordionContent",Fo=$.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Rt(de,n),s=Mn(Lo,n),i=_n(n);return l.jsx(vc,{role:"region","aria-labelledby":s.triggerId,"data-orientation":r.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Fo.displayName=Lo;function $o(e){return e?"open":"closed"}var Sp=Mo,bp=Do,Ep=jo,Pp=ko,Rp=Fo;function Q(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}function Pc(e,t=globalThis?.document){const n=Q(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Rc="DismissableLayer",an="dismissableLayer.update",Tc="dismissableLayer.pointerDownOutside",_c="dismissableLayer.focusOutside",ro,Bo=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Me=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...u}=e,d=a.useContext(Bo),[p,f]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,x]=a.useState({}),y=D(t,P=>f(P)),v=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(m),g=p?v.indexOf(p):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,S=g>=w,E=Ac(P=>{const I=P.target,F=[...d.branches].some(k=>k.contains(I));!S||F||(r?.(P),i?.(P),P.defaultPrevented||c?.())},h),M=Ic(P=>{const I=P.target;[...d.branches].some(k=>k.contains(I))||(s?.(P),i?.(P),P.defaultPrevented||c?.())},h);return Pc(P=>{g===d.layers.size-1&&(o?.(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},h),a.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ro=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),ao(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ro)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),ao())},[p,d]),a.useEffect(()=>{const P=()=>x({});return document.addEventListener(an,P),()=>document.removeEventListener(an,P)},[]),l.jsx(R.div,{...u,ref:y,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:b(e.onFocusCapture,M.onFocusCapture),onBlurCapture:b(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:b(e.onPointerDownCapture,E.onPointerDownCapture)})});Me.displayName=Rc;var Mc="DismissableLayerBranch",Vo=a.forwardRef((e,t)=>{const n=a.useContext(Bo),o=a.useRef(null),r=D(t,o);return a.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(R.div,{...e,ref:r})});Vo.displayName=Mc;function Ac(e,t=globalThis?.document){const n=Q(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let u=function(){Ko(Tc,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Ic(e,t=globalThis?.document){const n=Q(e),o=a.useRef(!1);return a.useEffect(()=>{const r=s=>{s.target&&!o.current&&Ko(_c,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function ao(){const e=new CustomEvent(an);document.dispatchEvent(e)}function Ko(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?bn(r,s):r.dispatchEvent(s)}var Nc=Me,Dc=Vo,Xt="focusScope.autoFocusOnMount",qt="focusScope.autoFocusOnUnmount",so={bubbles:!1,cancelable:!0},Oc="FocusScope",ze=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[c,u]=a.useState(null),d=Q(r),p=Q(s),f=a.useRef(null),h=D(t,v=>u(v)),x=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let v=function(C){if(x.paused||!c)return;const S=C.target;c.contains(S)?f.current=S:he(f.current,{select:!0})},m=function(C){if(x.paused||!c)return;const S=C.relatedTarget;S!==null&&(c.contains(S)||he(f.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&he(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const g=new MutationObserver(w);return c&&g.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),g.disconnect()}}},[o,c,x.paused]),a.useEffect(()=>{if(c){co.add(x);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(Xt,so);c.addEventListener(Xt,d),c.dispatchEvent(w),w.defaultPrevented||(jc(Bc(Go(c)),{select:!0}),document.activeElement===v&&he(c))}return()=>{c.removeEventListener(Xt,d),setTimeout(()=>{const w=new CustomEvent(qt,so);c.addEventListener(qt,p),c.dispatchEvent(w),w.defaultPrevented||he(v??document.body,{select:!0}),c.removeEventListener(qt,p),co.remove(x)},0)}}},[c,d,p,x]);const y=a.useCallback(v=>{if(!n&&!o||x.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(m&&w){const g=v.currentTarget,[C,S]=kc(g);C&&S?!v.shiftKey&&w===S?(v.preventDefault(),n&&he(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),n&&he(S,{select:!0})):w===g&&v.preventDefault()}},[n,o,x.paused]);return l.jsx(R.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});ze.displayName=Oc;function jc(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(he(o,{select:t}),document.activeElement!==n)return}function kc(e){const t=Go(e),n=io(t,e),o=io(t.reverse(),e);return[n,o]}function Go(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function io(e,t){for(const n of e)if(!Lc(n,{upTo:t}))return n}function Lc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Fc(e){return e instanceof HTMLInputElement&&"select"in e}function he(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fc(e)&&t&&e.select()}}var co=$c();function $c(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=lo(e,t),e.unshift(t)},remove(t){e=lo(e,t),e[0]?.resume()}}}function lo(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Bc(e){return e.filter(t=>t.tagName!=="A")}var Vc="Portal",Ae=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=a.useState(!1);Y(()=>s(!0),[]);const i=n||r&&globalThis?.document?.body;return i?ki.createPortal(l.jsx(R.div,{...o,ref:t}),i):null});Ae.displayName=Vc;var Zt=0;function Tt(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uo()),document.body.insertAdjacentElement("beforeend",e[1]??uo()),Zt++,()=>{Zt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zt--}},[])}function uo(){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 pe=function(){return pe=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},pe.apply(this,arguments)};function Ho(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Kc(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var ft="right-scroll-bar-position",pt="width-before-scroll-bar",Gc="with-scroll-bars-hidden",Hc="--removed-body-scroll-bar-size";function Qt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Uc(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Wc=typeof window<"u"?a.useLayoutEffect:a.useEffect,fo=new WeakMap;function Yc(e,t){var n=Uc(null,function(o){return e.forEach(function(r){return Qt(r,o)})});return Wc(function(){var o=fo.get(n);if(o){var r=new Set(o),s=new Set(e),i=n.current;r.forEach(function(c){s.has(c)||Qt(c,null)}),s.forEach(function(c){r.has(c)||Qt(c,i)})}fo.set(n,e)},[e]),n}function zc(e){return e}function Xc(e,t){t===void 0&&(t=zc);var n=[],o=!1,r={read:function(){if(o)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(s){var i=t(s,o);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(o=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){o=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var u=function(){var p=i;i=[],p.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),n}}}};return r}function qc(e){e===void 0&&(e={});var t=Xc(null);return t.options=pe({async:!0,ssr:!1},e),t}var Uo=function(e){var t=e.sideCar,n=Ho(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return a.createElement(o,pe({},n))};Uo.isSideCarExport=!0;function Zc(e,t){return e.useMedium(t),Uo}var Wo=qc(),Jt=function(){},_t=a.forwardRef(function(e,t){var n=a.useRef(null),o=a.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),r=o[0],s=o[1],i=e.forwardProps,c=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,h=e.sideCar,x=e.noRelative,y=e.noIsolation,v=e.inert,m=e.allowPinchZoom,w=e.as,g=w===void 0?"div":w,C=e.gapMode,S=Ho(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,M=Yc([n,t]),P=pe(pe({},S),r);return a.createElement(a.Fragment,null,p&&a.createElement(E,{sideCar:Wo,removeScrollBar:d,shards:f,noRelative:x,noIsolation:y,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:C}),i?a.cloneElement(a.Children.only(c),pe(pe({},P),{ref:M})):a.createElement(g,pe({},P,{className:u,ref:M}),c))});_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_t.classNames={fullWidth:pt,zeroRight:ft};var Qc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qc();return t&&e.setAttribute("nonce",t),e}function el(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jc())&&(el(t,n),tl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ol=function(){var e=nl();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yo=function(){var e=ol(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},rl={left:0,top:0,right:0,gap:0},en=function(e){return parseInt(e||"",10)||0},al=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[en(n),en(o),en(r)]},sl=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rl;var t=al(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},il=Yo(),je="data-scroll-locked",cl=function(e,t,n,o){var r=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(Gc,` {
overflow: hidden `).concat(o,`;
padding-right: `).concat(c,"px ").concat(o,`;
}
body[`).concat(je,`] {
overflow: hidden `).concat(o,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
padding-left: `.concat(r,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(o,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),`
}
.`).concat(ft,` {
right: `).concat(c,"px ").concat(o,`;
}
.`).concat(pt,` {
margin-right: `).concat(c,"px ").concat(o,`;
}
.`).concat(ft," .").concat(ft,` {
right: 0 `).concat(o,`;
}
.`).concat(pt," .").concat(pt,` {
margin-right: 0 `).concat(o,`;
}
body[`).concat(je,`] {
`).concat(Hc,": ").concat(c,`px;
}
`)},po=function(){var e=parseInt(document.body.getAttribute(je)||"0",10);return isFinite(e)?e:0},ll=function(){a.useEffect(function(){return document.body.setAttribute(je,(po()+1).toString()),function(){var e=po()-1;e<=0?document.body.removeAttribute(je):document.body.setAttribute(je,e.toString())}},[])},ul=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;ll();var s=a.useMemo(function(){return sl(r)},[r]);return a.createElement(il,{styles:cl(s,!t,r,n?"":"!important")})},sn=!1;if(typeof window<"u")try{var st=Object.defineProperty({},"passive",{get:function(){return sn=!0,!0}});window.addEventListener("test",st,st),window.removeEventListener("test",st,st)}catch{sn=!1}var Ne=sn?{passive:!1}:!1,dl=function(e){return e.tagName==="TEXTAREA"},zo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dl(e)&&n[t]==="visible")},fl=function(e){return zo(e,"overflowY")},pl=function(e){return zo(e,"overflowX")},vo=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Xo(e,o);if(r){var s=qo(e,o),i=s[1],c=s[2];if(i>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},vl=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},ml=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Xo=function(e,t){return e==="v"?fl(t):pl(t)},qo=function(e,t){return e==="v"?vl(t):ml(t)},hl=function(e,t){return e==="h"&&t==="rtl"?-1:1},gl=function(e,t,n,o,r){var s=hl(e,window.getComputedStyle(t).direction),i=s*o,c=n.target,u=t.contains(c),d=!1,p=i>0,f=0,h=0;do{if(!c)break;var x=qo(e,c),y=x[0],v=x[1],m=x[2],w=v-m-s*y;(y||w)&&Xo(e,c)&&(f+=w,h+=y);var g=c.parentNode;c=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(p&&Math.abs(f)<1||!p&&Math.abs(h)<1)&&(d=!0),d},it=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mo=function(e){return[e.deltaX,e.deltaY]},ho=function(e){return e&&"current"in e?e.current:e},xl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wl=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Cl=0,De=[];function yl(e){var t=a.useRef([]),n=a.useRef([0,0]),o=a.useRef(),r=a.useState(Cl++)[0],s=a.useState(Yo)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=Kc([e.lockRef.current],(e.shards||[]).map(ho),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var w=it(v),g=n.current,C="deltaX"in v?v.deltaX:g[0]-w[0],S="deltaY"in v?v.deltaY:g[1]-w[1],E,M=v.target,P=Math.abs(C)>Math.abs(S)?"h":"v";if("touches"in v&&P==="h"&&M.type==="range")return!1;var I=window.getSelection(),F=I&&I.anchorNode,k=F?F===M||F.contains(M):!1;if(k)return!1;var N=vo(P,M);if(!N)return!0;if(N?E=P:(E=P==="v"?"h":"v",N=vo(P,M)),!N)return!1;if(!o.current&&"changedTouches"in v&&(C||S)&&(o.current=E),!E)return!0;var L=o.current||E;return gl(L,m,v,L==="h"?C:S)},[]),u=a.useCallback(function(v){var m=v;if(!(!De.length||De[De.length-1]!==s)){var w="deltaY"in m?mo(m):it(m),g=t.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&xl(E.delta,w)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var C=(i.current.shards||[]).map(ho).filter(Boolean).filter(function(E){return E.contains(m.target)}),S=C.length>0?c(m,C[0]):!i.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),d=a.useCallback(function(v,m,w,g){var C={name:v,delta:m,target:w,should:g,shadowParent:Sl(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(S){return S!==C})},1)},[]),p=a.useCallback(function(v){n.current=it(v),o.current=void 0},[]),f=a.useCallback(function(v){d(v.type,mo(v),v.target,c(v,e.lockRef.current))},[]),h=a.useCallback(function(v){d(v.type,it(v),v.target,c(v,e.lockRef.current))},[]);a.useEffect(function(){return De.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Ne),document.addEventListener("touchmove",u,Ne),document.addEventListener("touchstart",p,Ne),function(){De=De.filter(function(v){return v!==s}),document.removeEventListener("wheel",u,Ne),document.removeEventListener("touchmove",u,Ne),document.removeEventListener("touchstart",p,Ne)}},[]);var x=e.removeScrollBar,y=e.inert;return a.createElement(a.Fragment,null,y?a.createElement(s,{styles:wl(r)}):null,x?a.createElement(ul,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Sl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const bl=Zc(Wo,yl);var Xe=a.forwardRef(function(e,t){return a.createElement(_t,pe({},e,{ref:t,sideCar:bl}))});Xe.classNames=_t.classNames;var El=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,ct=new WeakMap,lt={},tn=0,Zo=function(e){return e&&(e.host||Zo(e.parentNode))},Pl=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Zo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Rl=function(e,t,n,o){var r=Pl(t,Array.isArray(e)?e:[e]);lt[n]||(lt[n]=new WeakMap);var s=lt[n],i=[],c=new Set,u=new Set(r),d=function(f){!f||c.has(f)||(c.add(f),d(f.parentNode))};r.forEach(d);var p=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(c.has(h))p(h);else try{var x=h.getAttribute(o),y=x!==null&&x!=="false",v=(Oe.get(h)||0)+1,m=(s.get(h)||0)+1;Oe.set(h,v),s.set(h,m),i.push(h),v===1&&y&&ct.set(h,!0),m===1&&h.setAttribute(n,"true"),y||h.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return p(t),c.clear(),tn++,function(){i.forEach(function(f){var h=Oe.get(f)-1,x=s.get(f)-1;Oe.set(f,h),s.set(f,x),h||(ct.has(f)||f.removeAttribute(o),ct.delete(f)),x||f.removeAttribute(n)}),tn--,tn||(Oe=new WeakMap,Oe=new WeakMap,ct=new WeakMap,lt={})}},Mt=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=El(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Rl(o,r,n,"aria-hidden")):function(){return null}},At="Dialog",[Qo,Jo]=X(At),[Tl,fe]=Qo(At),er=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),u=a.useRef(null),[d,p]=z({prop:o,defaultProp:r??!1,onChange:s,caller:At});return l.jsx(Tl,{scope:t,triggerRef:c,contentRef:u,contentId:Z(),titleId:Z(),descriptionId:Z(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(f=>!f),[p]),modal:i,children:n})};er.displayName=At;var tr="DialogTrigger",nr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(tr,n),s=D(t,r.triggerRef);return l.jsx(R.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Nn(r.open),...o,ref:s,onClick:b(e.onClick,r.onOpenToggle)})});nr.displayName=tr;var An="DialogPortal",[_l,or]=Qo(An,{forceMount:void 0}),rr=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=fe(An,t);return l.jsx(_l,{scope:t,forceMount:n,children:a.Children.map(o,i=>l.jsx(oe,{present:n||s.open,children:l.jsx(Ae,{asChild:!0,container:r,children:i})}))})};rr.displayName=An;var mt="DialogOverlay",ar=a.forwardRef((e,t)=>{const n=or(mt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=fe(mt,e.__scopeDialog);return s.modal?l.jsx(oe,{present:o||s.open,children:l.jsx(Al,{...r,ref:t})}):null});ar.displayName=mt;var Ml=ge("DialogOverlay.RemoveScroll"),Al=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(mt,n);return l.jsx(Xe,{as:Ml,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(R.div,{"data-state":Nn(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Pe="DialogContent",sr=a.forwardRef((e,t)=>{const n=or(Pe,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=fe(Pe,e.__scopeDialog);return l.jsx(oe,{present:o||s.open,children:s.modal?l.jsx(Il,{...r,ref:t}):l.jsx(Nl,{...r,ref:t})})});sr.displayName=Pe;var Il=a.forwardRef((e,t)=>{const n=fe(Pe,e.__scopeDialog),o=a.useRef(null),r=D(t,n.contentRef,o);return a.useEffect(()=>{const s=o.current;if(s)return Mt(s)},[]),l.jsx(ir,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:b(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:b(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:b(e.onFocusOutside,s=>s.preventDefault())})}),Nl=a.forwardRef((e,t)=>{const n=fe(Pe,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return l.jsx(ir,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),ir=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,c=fe(Pe,n),u=a.useRef(null),d=D(t,u);return Tt(),l.jsxs(l.Fragment,{children:[l.jsx(ze,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Me,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Nn(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Ol,{titleId:c.titleId}),l.jsx(kl,{contentRef:u,descriptionId:c.descriptionId})]})]})}),In="DialogTitle",cr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(In,n);return l.jsx(R.h2,{id:r.titleId,...o,ref:t})});cr.displayName=In;var lr="DialogDescription",ur=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(lr,n);return l.jsx(R.p,{id:r.descriptionId,...o,ref:t})});ur.displayName=lr;var dr="DialogClose",fr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(dr,n);return l.jsx(R.button,{type:"button",...o,ref:t,onClick:b(e.onClick,()=>r.onOpenChange(!1))})});fr.displayName=dr;function Nn(e){return e?"open":"closed"}var pr="DialogTitleWarning",[Dl,vr]=Ji(pr,{contentName:Pe,titleName:In,docsSlug:"dialog"}),Ol=({titleId:e})=>{const t=vr(pr),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jl="DialogDescriptionWarning",kl=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vr(jl).contentName}}.`;return a.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Ll=er,Fl=nr,$l=rr,Bl=ar,Vl=sr,Kl=cr,Gl=ur,mr=fr,hr="AlertDialog",[Hl]=X(hr,[Jo]),me=Jo(),gr=e=>{const{__scopeAlertDialog:t,...n}=e,o=me(t);return l.jsx(Ll,{...o,...n,modal:!0})};gr.displayName=hr;var Ul="AlertDialogTrigger",xr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=me(n);return l.jsx(Fl,{...r,...o,ref:t})});xr.displayName=Ul;var Wl="AlertDialogPortal",wr=e=>{const{__scopeAlertDialog:t,...n}=e,o=me(t);return l.jsx($l,{...o,...n})};wr.displayName=Wl;var Yl="AlertDialogOverlay",Cr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=me(n);return l.jsx(Bl,{...r,...o,ref:t})});Cr.displayName=Yl;var ke="AlertDialogContent",[zl,Xl]=Hl(ke),ql=So("AlertDialogContent"),yr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...r}=e,s=me(n),i=a.useRef(null),c=D(t,i),u=a.useRef(null);return l.jsx(Dl,{contentName:ke,titleName:Sr,docsSlug:"alert-dialog",children:l.jsx(zl,{scope:n,cancelRef:u,children:l.jsxs(Vl,{role:"alertdialog",...s,...r,ref:c,onOpenAutoFocus:b(r.onOpenAutoFocus,d=>{d.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[l.jsx(ql,{children:o}),l.jsx(Ql,{contentRef:i})]})})})});yr.displayName=ke;var Sr="AlertDialogTitle",br=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=me(n);return l.jsx(Kl,{...r,...o,ref:t})});br.displayName=Sr;var Er="AlertDialogDescription",Pr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=me(n);return l.jsx(Gl,{...r,...o,ref:t})});Pr.displayName=Er;var Zl="AlertDialogAction",Rr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=me(n);return l.jsx(mr,{...r,...o,ref:t})});Rr.displayName=Zl;var Tr="AlertDialogCancel",_r=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=Xl(Tr,n),s=me(n),i=D(t,r);return l.jsx(mr,{...s,...o,ref:i})});_r.displayName=Tr;var Ql=({contentRef:e})=>{const t=`\`${ke}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${ke}\` by passing a \`${Er}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ke}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Tp=gr,_p=xr,Mp=wr,Ap=Cr,Ip=yr,Np=Rr,Dp=_r,Op=br,jp=Pr;function Dn(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function On(e){const[t,n]=a.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Jl="Arrow",Mr=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return l.jsx(R.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Mr.displayName=Jl;var eu=Mr,jn="Popper",[Ar,xe]=X(jn),[tu,Ir]=Ar(jn),Nr=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null);return l.jsx(tu,{scope:t,anchor:o,onAnchorChange:r,children:n})};Nr.displayName=jn;var Dr="PopperAnchor",Or=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Ir(Dr,n),i=a.useRef(null),c=D(t,i),u=a.useRef(null);return a.useEffect(()=>{const d=u.current;u.current=o?.current||i.current,d!==u.current&&s.onAnchorChange(u.current)}),o?null:l.jsx(R.div,{...r,ref:c})});Or.displayName=Dr;var kn="PopperContent",[nu,ou]=Ar(kn),jr=a.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:y,...v}=e,m=Ir(kn,n),[w,g]=a.useState(null),C=D(t,T=>g(T)),[S,E]=a.useState(null),M=On(S),P=M?.width??0,I=M?.height??0,F=o+(s!=="center"?"-"+s:""),k=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],L=N.length>0,K={padding:k,boundary:N.filter(au),altBoundary:L},{refs:A,floatingStyles:B,placement:O,isPositioned:V,middlewareData:j}=Li({strategy:"fixed",placement:F,whileElementsMounted:(...T)=>Hi(...T,{animationFrame:x==="always"}),elements:{reference:m.anchor},middleware:[Fi({mainAxis:r+I,alignmentAxis:i}),u&&$i({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ui():void 0,...K}),u&&Bi({...K}),Vi({...K,apply:({elements:T,rects:G,availableWidth:ne,availableHeight:H})=>{const{width:U,height:W}=G.reference,ce=T.floating.style;ce.setProperty("--radix-popper-available-width",`${ne}px`),ce.setProperty("--radix-popper-available-height",`${H}px`),ce.setProperty("--radix-popper-anchor-width",`${U}px`),ce.setProperty("--radix-popper-anchor-height",`${W}px`)}}),S&&Ki({element:S,padding:c}),su({arrowWidth:P,arrowHeight:I}),h&&Gi({strategy:"referenceHidden",...K})]}),[_,ae]=Fr(O),q=Q(y);Y(()=>{V&&q?.()},[V,q]);const ee=j.arrow?.x,se=j.arrow?.y,te=j.arrow?.centerOffset!==0,[ve,ie]=a.useState();return Y(()=>{w&&ie(window.getComputedStyle(w).zIndex)},[w]),l.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:V?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(nu,{scope:n,placedSide:_,onArrowChange:E,arrowX:ee,arrowY:se,shouldHideArrow:te,children:l.jsx(R.div,{"data-side":_,"data-align":ae,...v,ref:C,style:{...v.style,animation:V?void 0:"none"}})})})});jr.displayName=kn;var kr="PopperArrow",ru={top:"bottom",right:"left",bottom:"top",left:"right"},Lr=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=ou(kr,o),i=ru[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(eu,{...r,ref:n,style:{...r.style,display:"block"}})})});Lr.displayName=kr;function au(e){return e!==null}var su=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,p]=Fr(n),f={start:"0%",center:"50%",end:"100%"}[p],h=(r.arrow?.x??0)+c/2,x=(r.arrow?.y??0)+u/2;let y="",v="";return d==="bottom"?(y=i?f:`${h}px`,v=`${-u}px`):d==="top"?(y=i?f:`${h}px`,v=`${o.floating.height+u}px`):d==="right"?(y=`${-u}px`,v=i?f:`${x}px`):d==="left"&&(y=`${o.floating.width+u}px`,v=i?f:`${x}px`),{data:{x:y,y:v}}}});function Fr(e){const[t,n="center"]=e.split("-");return[t,n]}var qe=Nr,Ze=Or,It=jr,Nt=Lr,nn="rovingFocusGroup.onEntryFocus",iu={bubbles:!1,cancelable:!0},Qe="RovingFocusGroup",[cn,$r,cu]=$e(Qe),[lu,Be]=X(Qe,[cu]),[uu,du]=lu(Qe),Br=a.forwardRef((e,t)=>l.jsx(cn.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(cn.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(fu,{...e,ref:t})})}));Br.displayName=Qe;var fu=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=a.useRef(null),x=D(t,h),y=_e(s),[v,m]=z({prop:i,defaultProp:c??null,onChange:u,caller:Qe}),[w,g]=a.useState(!1),C=Q(d),S=$r(n),E=a.useRef(!1),[M,P]=a.useState(0);return a.useEffect(()=>{const I=h.current;if(I)return I.addEventListener(nn,C),()=>I.removeEventListener(nn,C)},[C]),l.jsx(uu,{scope:n,orientation:o,dir:y,loop:r,currentTabStopId:v,onItemFocus:a.useCallback(I=>m(I),[m]),onItemShiftTab:a.useCallback(()=>g(!0),[]),onFocusableItemAdd:a.useCallback(()=>P(I=>I+1),[]),onFocusableItemRemove:a.useCallback(()=>P(I=>I-1),[]),children:l.jsx(R.div,{tabIndex:w||M===0?-1:0,"data-orientation":o,...f,ref:x,style:{outline:"none",...e.style},onMouseDown:b(e.onMouseDown,()=>{E.current=!0}),onFocus:b(e.onFocus,I=>{const F=!E.current;if(I.target===I.currentTarget&&F&&!w){const k=new CustomEvent(nn,iu);if(I.currentTarget.dispatchEvent(k),!k.defaultPrevented){const N=S().filter(O=>O.focusable),L=N.find(O=>O.active),K=N.find(O=>O.id===v),B=[L,K,...N].filter(Boolean).map(O=>O.ref.current);Gr(B,p)}}E.current=!1}),onBlur:b(e.onBlur,()=>g(!1))})})}),Vr="RovingFocusGroupItem",Kr=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...c}=e,u=Z(),d=s||u,p=du(Vr,n),f=p.currentTabStopId===d,h=$r(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:v}=p;return a.useEffect(()=>{if(o)return x(),()=>y()},[o,x,y]),l.jsx(cn.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(R.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:b(e.onMouseDown,m=>{o?p.onItemFocus(d):m.preventDefault()}),onFocus:b(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:b(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){p.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=mu(m,p.orientation,p.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let C=h().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")C.reverse();else if(w==="prev"||w==="next"){w==="prev"&&C.reverse();const S=C.indexOf(m.currentTarget);C=p.loop?hu(C,S+1):C.slice(S+1)}setTimeout(()=>Gr(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:v!=null}):i})})});Kr.displayName=Vr;var pu={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vu(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mu(e,t,n){const o=vu(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return pu[o]}function Gr(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function hu(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ln=Br,Fn=Kr,ln=["Enter"," "],gu=["ArrowDown","PageUp","Home"],Hr=["ArrowUp","PageDown","End"],xu=[...gu,...Hr],wu={ltr:[...ln,"ArrowRight"],rtl:[...ln,"ArrowLeft"]},Cu={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Je="Menu",[Ue,yu,Su]=$e(Je),[Ie,Dt]=X(Je,[Su,xe,Be]),et=xe(),Ur=Be(),[Wr,we]=Ie(Je),[bu,tt]=Ie(Je),Yr=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:i=!0}=e,c=et(t),[u,d]=a.useState(null),p=a.useRef(!1),f=Q(s),h=_e(r);return a.useEffect(()=>{const x=()=>{p.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>p.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),l.jsx(qe,{...c,children:l.jsx(Wr,{scope:t,open:n,onOpenChange:f,content:u,onContentChange:d,children:l.jsx(bu,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:i,children:o})})})};Yr.displayName=Je;var Eu="MenuAnchor",$n=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=et(n);return l.jsx(Ze,{...r,...o,ref:t})});$n.displayName=Eu;var Bn="MenuPortal",[Pu,zr]=Ie(Bn,{forceMount:void 0}),Xr=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=we(Bn,t);return l.jsx(Pu,{scope:t,forceMount:n,children:l.jsx(oe,{present:n||s.open,children:l.jsx(Ae,{asChild:!0,container:r,children:o})})})};Xr.displayName=Bn;var le="MenuContent",[Ru,Vn]=Ie(le),qr=a.forwardRef((e,t)=>{const n=zr(le,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=we(le,e.__scopeMenu),i=tt(le,e.__scopeMenu);return l.jsx(Ue.Provider,{scope:e.__scopeMenu,children:l.jsx(oe,{present:o||s.open,children:l.jsx(Ue.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Tu,{...r,ref:t}):l.jsx(_u,{...r,ref:t})})})})}),Tu=a.forwardRef((e,t)=>{const n=we(le,e.__scopeMenu),o=a.useRef(null),r=D(t,o);return a.useEffect(()=>{const s=o.current;if(s)return Mt(s)},[]),l.jsx(Kn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),_u=a.forwardRef((e,t)=>{const n=we(le,e.__scopeMenu);return l.jsx(Kn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mu=ge("MenuContent.ScrollLock"),Kn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:x,disableOutsideScroll:y,...v}=e,m=we(le,n),w=tt(le,n),g=et(n),C=Ur(n),S=yu(n),[E,M]=a.useState(null),P=a.useRef(null),I=D(t,P,m.onContentChange),F=a.useRef(0),k=a.useRef(""),N=a.useRef(0),L=a.useRef(null),K=a.useRef("right"),A=a.useRef(0),B=y?Xe:a.Fragment,O=y?{as:Mu,allowPinchZoom:!0}:void 0,V=_=>{const ae=k.current+_,q=S().filter(T=>!T.disabled),ee=document.activeElement,se=q.find(T=>T.ref.current===ee)?.textValue,te=q.map(T=>T.textValue),ve=Vu(te,ae,se),ie=q.find(T=>T.textValue===ve)?.ref.current;(function T(G){k.current=G,window.clearTimeout(F.current),G!==""&&(F.current=window.setTimeout(()=>T(""),1e3))})(ae),ie&&setTimeout(()=>ie.focus())};a.useEffect(()=>()=>window.clearTimeout(F.current),[]),Tt();const j=a.useCallback(_=>K.current===L.current?.side&&Gu(_,L.current?.area),[]);return l.jsx(Ru,{scope:n,searchRef:k,onItemEnter:a.useCallback(_=>{j(_)&&_.preventDefault()},[j]),onItemLeave:a.useCallback(_=>{j(_)||(P.current?.focus(),M(null))},[j]),onTriggerLeave:a.useCallback(_=>{j(_)&&_.preventDefault()},[j]),pointerGraceTimerRef:N,onPointerGraceIntentChange:a.useCallback(_=>{L.current=_},[]),children:l.jsx(B,{...O,children:l.jsx(ze,{asChild:!0,trapped:r,onMountAutoFocus:b(s,_=>{_.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Me,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:x,children:l.jsx(Ln,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:E,onCurrentTabStopIdChange:M,onEntryFocus:b(u,_=>{w.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(It,{role:"menu","aria-orientation":"vertical","data-state":pa(m.open),"data-radix-menu-content":"",dir:w.dir,...g,...v,ref:I,style:{outline:"none",...v.style},onKeyDown:b(v.onKeyDown,_=>{const q=_.target.closest("[data-radix-menu-content]")===_.currentTarget,ee=_.ctrlKey||_.altKey||_.metaKey,se=_.key.length===1;q&&(_.key==="Tab"&&_.preventDefault(),!ee&&se&&V(_.key));const te=P.current;if(_.target!==te||!xu.includes(_.key))return;_.preventDefault();const ie=S().filter(T=>!T.disabled).map(T=>T.ref.current);Hr.includes(_.key)&&ie.reverse(),$u(ie)}),onBlur:b(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(F.current),k.current="")}),onPointerMove:b(e.onPointerMove,We(_=>{const ae=_.target,q=A.current!==_.clientX;if(_.currentTarget.contains(ae)&&q){const ee=_.clientX>A.current?"right":"left";K.current=ee,A.current=_.clientX}}))})})})})})})});qr.displayName=le;var Au="MenuGroup",Gn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return l.jsx(R.div,{role:"group",...o,ref:t})});Gn.displayName=Au;var Iu="MenuLabel",Zr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return l.jsx(R.div,{...o,ref:t})});Zr.displayName=Iu;var ht="MenuItem",go="menu.itemSelect",Ot=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=a.useRef(null),i=tt(ht,e.__scopeMenu),c=Vn(ht,e.__scopeMenu),u=D(t,s),d=a.useRef(!1),p=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(go,{bubbles:!0,cancelable:!0});f.addEventListener(go,x=>o?.(x),{once:!0}),bn(f,h),h.defaultPrevented?d.current=!1:i.onClose()}};return l.jsx(Qr,{...r,ref:u,disabled:n,onClick:b(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),d.current=!0},onPointerUp:b(e.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,f=>{const h=c.searchRef.current!=="";n||h&&f.key===" "||ln.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ot.displayName=ht;var Qr=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,i=Vn(ht,n),c=Ur(n),u=a.useRef(null),d=D(t,u),[p,f]=a.useState(!1),[h,x]=a.useState("");return a.useEffect(()=>{const y=u.current;y&&x((y.textContent??"").trim())},[s.children]),l.jsx(Ue.ItemSlot,{scope:n,disabled:o,textValue:r??h,children:l.jsx(Fn,{asChild:!0,...c,focusable:!o,children:l.jsx(R.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:d,onPointerMove:b(e.onPointerMove,We(y=>{o?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,We(y=>i.onItemLeave(y))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})}),Nu="MenuCheckboxItem",Jr=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return l.jsx(ra,{scope:e.__scopeMenu,checked:n,children:l.jsx(Ot,{role:"menuitemcheckbox","aria-checked":gt(n)?"mixed":n,...r,ref:t,"data-state":Wn(n),onSelect:b(r.onSelect,()=>o?.(gt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Jr.displayName=Nu;var ea="MenuRadioGroup",[Du,Ou]=Ie(ea,{value:void 0,onValueChange:()=>{}}),ta=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=Q(o);return l.jsx(Du,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(Gn,{...r,ref:t})})});ta.displayName=ea;var na="MenuRadioItem",oa=a.forwardRef((e,t)=>{const{value:n,...o}=e,r=Ou(na,e.__scopeMenu),s=n===r.value;return l.jsx(ra,{scope:e.__scopeMenu,checked:s,children:l.jsx(Ot,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":Wn(s),onSelect:b(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oa.displayName=na;var Hn="MenuItemIndicator",[ra,ju]=Ie(Hn,{checked:!1}),aa=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=ju(Hn,n);return l.jsx(oe,{present:o||gt(s.checked)||s.checked===!0,children:l.jsx(R.span,{...r,ref:t,"data-state":Wn(s.checked)})})});aa.displayName=Hn;var ku="MenuSeparator",sa=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return l.jsx(R.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});sa.displayName=ku;var Lu="MenuArrow",ia=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=et(n);return l.jsx(Nt,{...r,...o,ref:t})});ia.displayName=Lu;var Un="MenuSub",[Fu,ca]=Ie(Un),la=e=>{const{__scopeMenu:t,children:n,open:o=!1,onOpenChange:r}=e,s=we(Un,t),i=et(t),[c,u]=a.useState(null),[d,p]=a.useState(null),f=Q(r);return a.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),l.jsx(qe,{...i,children:l.jsx(Wr,{scope:t,open:o,onOpenChange:f,content:d,onContentChange:p,children:l.jsx(Fu,{scope:t,contentId:Z(),triggerId:Z(),trigger:c,onTriggerChange:u,children:n})})})};la.displayName=Un;var Ge="MenuSubTrigger",ua=a.forwardRef((e,t)=>{const n=we(Ge,e.__scopeMenu),o=tt(Ge,e.__scopeMenu),r=ca(Ge,e.__scopeMenu),s=Vn(Ge,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),u(null)}},[c,u]),l.jsx($n,{asChild:!0,...d,children:l.jsx(Qr,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":pa(n.open),...e,ref:St(t,r.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:b(e.onPointerMove,We(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:b(e.onPointerLeave,We(f=>{p();const h=n.content?.getBoundingClientRect();if(h){const x=n.content?.dataset.side,y=x==="right",v=y?-5:5,m=h[y?"left":"right"],w=h[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:m,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:m,y:h.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:b(e.onKeyDown,f=>{const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||wu[o.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});ua.displayName=Ge;var da="MenuSubContent",fa=a.forwardRef((e,t)=>{const n=zr(le,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=we(le,e.__scopeMenu),i=tt(le,e.__scopeMenu),c=ca(da,e.__scopeMenu),u=a.useRef(null),d=D(t,u);return l.jsx(Ue.Provider,{scope:e.__scopeMenu,children:l.jsx(oe,{present:o||s.open,children:l.jsx(Ue.Slot,{scope:e.__scopeMenu,children:l.jsx(Kn,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{i.isUsingKeyboardRef.current&&u.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:b(e.onFocusOutside,p=>{p.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:b(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:b(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),h=Cu[i.dir].includes(p.key);f&&h&&(s.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});fa.displayName=da;function pa(e){return e?"open":"closed"}function gt(e){return e==="indeterminate"}function Wn(e){return gt(e)?"indeterminate":e?"checked":"unchecked"}function $u(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Bu(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Vu(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Bu(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}function Ku(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],u=t[i],d=c.x,p=c.y,f=u.x,h=u.y;p>o!=h>o&&n<(f-d)*(o-p)/(h-p)+d&&(r=!r)}return r}function Gu(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Ku(n,t)}function We(e){return t=>t.pointerType==="mouse"?e(t):void 0}var va=Yr,ma=$n,ha=Xr,ga=qr,xa=Gn,wa=Zr,Ca=Ot,ya=Jr,Sa=ta,ba=oa,Ea=aa,Pa=sa,Ra=ia,Hu=la,Ta=ua,_a=fa,Yn="ContextMenu",[Uu]=X(Yn,[Dt]),re=Dt(),[Wu,Ma]=Uu(Yn),Aa=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:o,dir:r,modal:s=!0}=e,[i,c]=a.useState(!1),u=re(t),d=Q(o),p=a.useCallback(f=>{c(f),d(f)},[d]);return l.jsx(Wu,{scope:t,open:i,onOpenChange:p,modal:s,children:l.jsx(va,{...u,dir:r,open:i,onOpenChange:p,modal:s,children:n})})};Aa.displayName=Yn;var Ia="ContextMenuTrigger",Na=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:o=!1,...r}=e,s=Ma(Ia,n),i=re(n),c=a.useRef({x:0,y:0}),u=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=a.useRef(0),p=a.useCallback(()=>window.clearTimeout(d.current),[]),f=h=>{c.current={x:h.clientX,y:h.clientY},s.onOpenChange(!0)};return a.useEffect(()=>p,[p]),a.useEffect(()=>{o&&p()},[o,p]),l.jsxs(l.Fragment,{children:[l.jsx(ma,{...i,virtualRef:u}),l.jsx(R.span,{"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:b(e.onContextMenu,h=>{p(),f(h),h.preventDefault()}),onPointerDown:o?e.onPointerDown:b(e.onPointerDown,ut(h=>{p(),d.current=window.setTimeout(()=>f(h),700)})),onPointerMove:o?e.onPointerMove:b(e.onPointerMove,ut(p)),onPointerCancel:o?e.onPointerCancel:b(e.onPointerCancel,ut(p)),onPointerUp:o?e.onPointerUp:b(e.onPointerUp,ut(p))})]})});Na.displayName=Ia;var Yu="ContextMenuPortal",Da=e=>{const{__scopeContextMenu:t,...n}=e,o=re(t);return l.jsx(ha,{...o,...n})};Da.displayName=Yu;var Oa="ContextMenuContent",ja=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=Ma(Oa,n),s=re(n),i=a.useRef(!1);return l.jsx(ga,{...s,...o,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),!c.defaultPrevented&&i.current&&c.preventDefault(),i.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(i.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ja.displayName=Oa;var zu="ContextMenuGroup",Xu=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(xa,{...r,...o,ref:t})});Xu.displayName=zu;var qu="ContextMenuLabel",Zu=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(wa,{...r,...o,ref:t})});Zu.displayName=qu;var Qu="ContextMenuItem",ka=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Ca,{...r,...o,ref:t})});ka.displayName=Qu;var Ju="ContextMenuCheckboxItem",ed=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(ya,{...r,...o,ref:t})});ed.displayName=Ju;var td="ContextMenuRadioGroup",nd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Sa,{...r,...o,ref:t})});nd.displayName=td;var od="ContextMenuRadioItem",rd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(ba,{...r,...o,ref:t})});rd.displayName=od;var ad="ContextMenuItemIndicator",sd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Ea,{...r,...o,ref:t})});sd.displayName=ad;var id="ContextMenuSeparator",La=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Pa,{...r,...o,ref:t})});La.displayName=id;var cd="ContextMenuArrow",ld=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Ra,{...r,...o,ref:t})});ld.displayName=cd;var ud="ContextMenuSubTrigger",dd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(Ta,{...r,...o,ref:t})});dd.displayName=ud;var fd="ContextMenuSubContent",pd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,r=re(n);return l.jsx(_a,{...r,...o,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pd.displayName=fd;function ut(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var kp=Aa,Lp=Na,Fp=Da,$p=ja,Bp=ka,Vp=La,jt="DropdownMenu",[vd]=X(jt,[Dt]),J=Dt(),[md,Fa]=vd(jt),$a=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=J(t),d=a.useRef(null),[p,f]=z({prop:r,defaultProp:s??!1,onChange:i,caller:jt});return l.jsx(md,{scope:t,triggerId:Z(),triggerRef:d,contentId:Z(),open:p,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(h=>!h),[f]),modal:c,children:l.jsx(va,{...u,open:p,onOpenChange:f,dir:o,modal:c,children:n})})};$a.displayName=jt;var Ba="DropdownMenuTrigger",Va=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=Fa(Ba,n),i=J(n);return l.jsx(ma,{asChild:!0,...i,children:l.jsx(R.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:St(t,s.triggerRef),onPointerDown:b(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:b(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Va.displayName=Ba;var hd="DropdownMenuPortal",Ka=e=>{const{__scopeDropdownMenu:t,...n}=e,o=J(t);return l.jsx(ha,{...o,...n})};Ka.displayName=hd;var Ga="DropdownMenuContent",Ha=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Fa(Ga,n),s=J(n),i=a.useRef(!1);return l.jsx(ga,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,c=>{i.current||r.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:b(e.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!r.modal||p)&&(i.current=!0)}),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)"}})});Ha.displayName=Ga;var gd="DropdownMenuGroup",xd=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(xa,{...r,...o,ref:t})});xd.displayName=gd;var wd="DropdownMenuLabel",Ua=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(wa,{...r,...o,ref:t})});Ua.displayName=wd;var Cd="DropdownMenuItem",Wa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Ca,{...r,...o,ref:t})});Wa.displayName=Cd;var yd="DropdownMenuCheckboxItem",Sd=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(ya,{...r,...o,ref:t})});Sd.displayName=yd;var bd="DropdownMenuRadioGroup",Ed=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Sa,{...r,...o,ref:t})});Ed.displayName=bd;var Pd="DropdownMenuRadioItem",Rd=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(ba,{...r,...o,ref:t})});Rd.displayName=Pd;var Td="DropdownMenuItemIndicator",_d=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Ea,{...r,...o,ref:t})});_d.displayName=Td;var Md="DropdownMenuSeparator",Ya=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Pa,{...r,...o,ref:t})});Ya.displayName=Md;var Ad="DropdownMenuArrow",Id=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Ra,{...r,...o,ref:t})});Id.displayName=Ad;var Nd=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:r,defaultOpen:s}=e,i=J(t),[c,u]=z({prop:o,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return l.jsx(Hu,{...i,open:c,onOpenChange:u,children:n})},Dd="DropdownMenuSubTrigger",za=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(Ta,{...r,...o,ref:t})});za.displayName=Dd;var Od="DropdownMenuSubContent",Xa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=J(n);return l.jsx(_a,{...r,...o,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)"}})});Xa.displayName=Od;var Kp=$a,Gp=Va,Hp=Ka,Up=Ha,Wp=Ua,Yp=Wa,zp=Ya,Xp=Nd,qp=za,Zp=Xa;function xt(e,[t,n]){return Math.min(n,Math.max(t,e))}var kt="Popover",[qa]=X(kt,[xe]),nt=xe(),[jd,Ce]=qa(kt),Za=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!1}=e,c=nt(t),u=a.useRef(null),[d,p]=a.useState(!1),[f,h]=z({prop:o,defaultProp:r??!1,onChange:s,caller:kt});return l.jsx(qe,{...c,children:l.jsx(jd,{scope:t,contentId:Z(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(x=>!x),[h]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:i,children:n})})};Za.displayName=kt;var Qa="PopoverAnchor",kd=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ce(Qa,n),s=nt(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=r;return a.useEffect(()=>(i(),()=>c()),[i,c]),l.jsx(Ze,{...s,...o,ref:t})});kd.displayName=Qa;var Ja="PopoverTrigger",es=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ce(Ja,n),s=nt(n),i=D(t,r.triggerRef),c=l.jsx(R.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":as(r.open),...o,ref:i,onClick:b(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:l.jsx(Ze,{asChild:!0,...s,children:c})});es.displayName=Ja;var zn="PopoverPortal",[Ld,Fd]=qa(zn,{forceMount:void 0}),ts=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Ce(zn,t);return l.jsx(Ld,{scope:t,forceMount:n,children:l.jsx(oe,{present:n||s.open,children:l.jsx(Ae,{asChild:!0,container:r,children:o})})})};ts.displayName=zn;var Le="PopoverContent",ns=a.forwardRef((e,t)=>{const n=Fd(Le,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=Ce(Le,e.__scopePopover);return l.jsx(oe,{present:o||s.open,children:s.modal?l.jsx(Bd,{...r,ref:t}):l.jsx(Vd,{...r,ref:t})})});ns.displayName=Le;var $d=ge("PopoverContent.RemoveScroll"),Bd=a.forwardRef((e,t)=>{const n=Ce(Le,e.__scopePopover),o=a.useRef(null),r=D(t,o),s=a.useRef(!1);return a.useEffect(()=>{const i=o.current;if(i)return Mt(i)},[]),l.jsx(Xe,{as:$d,allowPinchZoom:!0,children:l.jsx(os,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:b(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:b(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:b(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Vd=a.forwardRef((e,t)=>{const n=Ce(Le,e.__scopePopover),o=a.useRef(!1),r=a.useRef(!1);return l.jsx(os,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),os=a.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...f}=e,h=Ce(Le,n),x=nt(n);return Tt(),l.jsx(ze,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:l.jsx(Me,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:l.jsx(It,{"data-state":as(h.open),role:"dialog",id:h.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rs="PopoverClose",Kd=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ce(rs,n);return l.jsx(R.button,{type:"button",...o,ref:t,onClick:b(e.onClick,()=>r.onOpenChange(!1))})});Kd.displayName=rs;var Gd="PopoverArrow",Hd=a.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=nt(n);return l.jsx(Nt,{...r,...o,ref:t})});Hd.displayName=Gd;function as(e){return e?"open":"closed"}var Qp=Za,Jp=es,ev=ts,tv=ns,Ud=[" ","Enter","ArrowUp","ArrowDown"],Wd=[" ","Enter"],Re="Select",[Lt,Ft,Yd]=$e(Re),[Ve]=X(Re,[Yd,xe]),$t=xe(),[zd,ye]=Ve(Re),[Xd,qd]=Ve(Re),ss=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:h,required:x,form:y}=e,v=$t(t),[m,w]=a.useState(null),[g,C]=a.useState(null),[S,E]=a.useState(!1),M=_e(d),[P,I]=z({prop:o,defaultProp:r??!1,onChange:s,caller:Re}),[F,k]=z({prop:i,defaultProp:c,onChange:u,caller:Re}),N=a.useRef(null),L=m?y||!!m.closest("form"):!0,[K,A]=a.useState(new Set),B=Array.from(K).map(O=>O.props.value).join(";");return l.jsx(qe,{...v,children:l.jsxs(zd,{required:x,scope:t,trigger:m,onTriggerChange:w,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:Z(),value:F,onValueChange:k,open:P,onOpenChange:I,dir:M,triggerPointerDownPosRef:N,disabled:h,children:[l.jsx(Lt.Provider,{scope:t,children:l.jsx(Xd,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(O=>{A(V=>new Set(V).add(O))},[]),onNativeOptionRemove:a.useCallback(O=>{A(V=>{const j=new Set(V);return j.delete(O),j})},[]),children:n})}),L?l.jsxs(_s,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:f,value:F,onChange:O=>k(O.target.value),disabled:h,form:y,children:[F===void 0?l.jsx("option",{value:""}):null,Array.from(K)]},B):null]})})};ss.displayName=Re;var is="SelectTrigger",cs=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=$t(n),i=ye(is,n),c=i.disabled||o,u=D(t,i.onTriggerChange),d=Ft(n),p=a.useRef("touch"),[f,h,x]=As(v=>{const m=d().filter(C=>!C.disabled),w=m.find(C=>C.value===i.value),g=Is(m,v,w);g!==void 0&&i.onValueChange(g.value)}),y=v=>{c||(i.onOpenChange(!0),x()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return l.jsx(Ze,{asChild:!0,...s,children:l.jsx(R.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Ms(i.value)?"":void 0,...r,ref:u,onClick:b(r.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&y(v)}),onPointerDown:b(r.onPointerDown,v=>{p.current=v.pointerType;const m=v.target;m.hasPointerCapture(v.pointerId)&&m.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:b(r.onKeyDown,v=>{const m=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(m&&v.key===" ")&&Ud.includes(v.key)&&(y(),v.preventDefault())})})})});cs.displayName=is;var ls="SelectValue",us=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...c}=e,u=ye(ls,n),{onValueNodeHasChildrenChange:d}=u,p=s!==void 0,f=D(t,u.onValueNodeChange);return Y(()=>{d(p)},[d,p]),l.jsx(R.span,{...c,ref:f,style:{pointerEvents:"none"},children:Ms(u.value)?l.jsx(l.Fragment,{children:i}):s})});us.displayName=ls;var Zd="SelectIcon",ds=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return l.jsx(R.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});ds.displayName=Zd;var Qd="SelectPortal",fs=e=>l.jsx(Ae,{asChild:!0,...e});fs.displayName=Qd;var Te="SelectContent",ps=a.forwardRef((e,t)=>{const n=ye(Te,e.__scopeSelect),[o,r]=a.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?yt.createPortal(l.jsx(vs,{scope:e.__scopeSelect,children:l.jsx(Lt.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(ms,{...e,ref:t})});ps.displayName=Te;var ue=10,[vs,Se]=Ve(Te),Jd="SelectContentImpl",ef=ge("SelectContent.RemoveScroll"),ms=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:x,sticky:y,hideWhenDetached:v,avoidCollisions:m,...w}=e,g=ye(Te,n),[C,S]=a.useState(null),[E,M]=a.useState(null),P=D(t,T=>S(T)),[I,F]=a.useState(null),[k,N]=a.useState(null),L=Ft(n),[K,A]=a.useState(!1),B=a.useRef(!1);a.useEffect(()=>{if(C)return Mt(C)},[C]),Tt();const O=a.useCallback(T=>{const[G,...ne]=L().map(W=>W.ref.current),[H]=ne.slice(-1),U=document.activeElement;for(const W of T)if(W===U||(W?.scrollIntoView({block:"nearest"}),W===G&&E&&(E.scrollTop=0),W===H&&E&&(E.scrollTop=E.scrollHeight),W?.focus(),document.activeElement!==U))return},[L,E]),V=a.useCallback(()=>O([I,C]),[O,I,C]);a.useEffect(()=>{K&&V()},[K,V]);const{onOpenChange:j,triggerPointerDownPosRef:_}=g;a.useEffect(()=>{if(C){let T={x:0,y:0};const G=H=>{T={x:Math.abs(Math.round(H.pageX)-(_.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(_.current?.y??0))}},ne=H=>{T.x<=10&&T.y<=10?H.preventDefault():C.contains(H.target)||j(!1),document.removeEventListener("pointermove",G),_.current=null};return _.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",ne,{capture:!0})}}},[C,j,_]),a.useEffect(()=>{const T=()=>j(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[j]);const[ae,q]=As(T=>{const G=L().filter(U=>!U.disabled),ne=G.find(U=>U.ref.current===document.activeElement),H=Is(G,T,ne);H&&setTimeout(()=>H.ref.current.focus())}),ee=a.useCallback((T,G,ne)=>{const H=!B.current&&!ne;(g.value!==void 0&&g.value===G||H)&&(F(T),H&&(B.current=!0))},[g.value]),se=a.useCallback(()=>C?.focus(),[C]),te=a.useCallback((T,G,ne)=>{const H=!B.current&&!ne;(g.value!==void 0&&g.value===G||H)&&N(T)},[g.value]),ve=o==="popper"?un:hs,ie=ve===un?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:x,sticky:y,hideWhenDetached:v,avoidCollisions:m}:{};return l.jsx(vs,{scope:n,content:C,viewport:E,onViewportChange:M,itemRefCallback:ee,selectedItem:I,onItemLeave:se,itemTextRefCallback:te,focusSelectedItem:V,selectedItemText:k,position:o,isPositioned:K,searchRef:ae,children:l.jsx(Xe,{as:ef,allowPinchZoom:!0,children:l.jsx(ze,{asChild:!0,trapped:g.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:b(r,T=>{g.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:l.jsx(Me,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:l.jsx(ve,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:T=>T.preventDefault(),...w,...ie,onPlaced:()=>A(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:b(w.onKeyDown,T=>{const G=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!G&&T.key.length===1&&q(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let H=L().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(T.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const U=T.target,W=H.indexOf(U);H=H.slice(W+1)}setTimeout(()=>O(H)),T.preventDefault()}})})})})})})});ms.displayName=Jd;var tf="SelectItemAlignedPosition",hs=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=ye(Te,n),i=Se(Te,n),[c,u]=a.useState(null),[d,p]=a.useState(null),f=D(t,P=>p(P)),h=Ft(n),x=a.useRef(!1),y=a.useRef(!0),{viewport:v,selectedItem:m,selectedItemText:w,focusSelectedItem:g}=i,C=a.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&v&&m&&w){const P=s.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),F=s.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(s.dir!=="rtl"){const U=k.left-I.left,W=F.left-U,ce=P.left-W,Ee=P.width+ce,Wt=Math.max(Ee,I.width),Yt=window.innerWidth-ue,zt=xt(W,[ue,Math.max(ue,Yt-Wt)]);c.style.minWidth=Ee+"px",c.style.left=zt+"px"}else{const U=I.right-k.right,W=window.innerWidth-F.right-U,ce=window.innerWidth-P.right-W,Ee=P.width+ce,Wt=Math.max(Ee,I.width),Yt=window.innerWidth-ue,zt=xt(W,[ue,Math.max(ue,Yt-Wt)]);c.style.minWidth=Ee+"px",c.style.right=zt+"px"}const N=h(),L=window.innerHeight-ue*2,K=v.scrollHeight,A=window.getComputedStyle(d),B=parseInt(A.borderTopWidth,10),O=parseInt(A.paddingTop,10),V=parseInt(A.borderBottomWidth,10),j=parseInt(A.paddingBottom,10),_=B+O+K+j+V,ae=Math.min(m.offsetHeight*5,_),q=window.getComputedStyle(v),ee=parseInt(q.paddingTop,10),se=parseInt(q.paddingBottom,10),te=P.top+P.height/2-ue,ve=L-te,ie=m.offsetHeight/2,T=m.offsetTop+ie,G=B+O+T,ne=_-G;if(G<=te){const U=N.length>0&&m===N[N.length-1].ref.current;c.style.bottom="0px";const W=d.clientHeight-v.offsetTop-v.offsetHeight,ce=Math.max(ve,ie+(U?se:0)+W+V),Ee=G+ce;c.style.height=Ee+"px"}else{const U=N.length>0&&m===N[0].ref.current;c.style.top="0px";const ce=Math.max(te,B+v.offsetTop+(U?ee:0)+ie)+ne;c.style.height=ce+"px",v.scrollTop=G-te+v.offsetTop}c.style.margin=`${ue}px 0`,c.style.minHeight=ae+"px",c.style.maxHeight=L+"px",o?.(),requestAnimationFrame(()=>x.current=!0)}},[h,s.trigger,s.valueNode,c,d,v,m,w,s.dir,o]);Y(()=>C(),[C]);const[S,E]=a.useState();Y(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const M=a.useCallback(P=>{P&&y.current===!0&&(C(),g?.(),y.current=!1)},[C,g]);return l.jsx(of,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:M,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(R.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});hs.displayName=tf;var nf="SelectPopperPosition",un=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ue,...s}=e,i=$t(n);return l.jsx(It,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});un.displayName=nf;var[of,Xn]=Ve(Te,{}),dn="SelectViewport",gs=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Se(dn,n),i=Xn(dn,n),c=D(t,s.onViewportChange),u=a.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Lt.Slot,{scope:n,children:l.jsx(R.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:b(r.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h?.current&&f){const x=Math.abs(u.current-p.scrollTop);if(x>0){const y=window.innerHeight-ue*2,v=parseFloat(f.style.minHeight),m=parseFloat(f.style.height),w=Math.max(v,m);if(w<y){const g=w+x,C=Math.min(y,g),S=g-C;f.style.height=C+"px",f.style.bottom==="0px"&&(p.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});gs.displayName=dn;var xs="SelectGroup",[rf,af]=Ve(xs),sf=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Z();return l.jsx(rf,{scope:n,id:r,children:l.jsx(R.div,{role:"group","aria-labelledby":r,...o,ref:t})})});sf.displayName=xs;var ws="SelectLabel",cf=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=af(ws,n);return l.jsx(R.div,{id:r.id,...o,ref:t})});cf.displayName=ws;var wt="SelectItem",[lf,Cs]=Ve(wt),ys=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,c=ye(wt,n),u=Se(wt,n),d=c.value===o,[p,f]=a.useState(s??""),[h,x]=a.useState(!1),y=D(t,g=>u.itemRefCallback?.(g,o,r)),v=Z(),m=a.useRef("touch"),w=()=>{r||(c.onValueChange(o),c.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 l.jsx(lf,{scope:n,value:o,disabled:r,textId:v,isSelected:d,onItemTextChange:a.useCallback(g=>{f(C=>C||(g?.textContent??"").trim())},[]),children:l.jsx(Lt.ItemSlot,{scope:n,value:o,disabled:r,textValue:p,children:l.jsx(R.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:y,onFocus:b(i.onFocus,()=>x(!0)),onBlur:b(i.onBlur,()=>x(!1)),onClick:b(i.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:b(i.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:b(i.onPointerDown,g=>{m.current=g.pointerType}),onPointerMove:b(i.onPointerMove,g=>{m.current=g.pointerType,r?u.onItemLeave?.():m.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b(i.onPointerLeave,g=>{g.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:b(i.onKeyDown,g=>{u.searchRef?.current!==""&&g.key===" "||(Wd.includes(g.key)&&w(),g.key===" "&&g.preventDefault())})})})})});ys.displayName=wt;var He="SelectItemText",Ss=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=ye(He,n),c=Se(He,n),u=Cs(He,n),d=qd(He,n),[p,f]=a.useState(null),h=D(t,w=>f(w),u.onItemTextChange,w=>c.itemTextRefCallback?.(w,u.value,u.disabled)),x=p?.textContent,y=a.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:v,onNativeOptionRemove:m}=d;return Y(()=>(v(y),()=>m(y)),[v,m,y]),l.jsxs(l.Fragment,{children:[l.jsx(R.span,{id:u.textId,...s,ref:h}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?yt.createPortal(s.children,i.valueNode):null]})});Ss.displayName=He;var bs="SelectItemIndicator",Es=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Cs(bs,n).isSelected?l.jsx(R.span,{"aria-hidden":!0,...o,ref:t}):null});Es.displayName=bs;var fn="SelectScrollUpButton",Ps=a.forwardRef((e,t)=>{const n=Se(fn,e.__scopeSelect),o=Xn(fn,e.__scopeSelect),[r,s]=a.useState(!1),i=D(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollTop>0;s(d)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?l.jsx(Ts,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});Ps.displayName=fn;var pn="SelectScrollDownButton",Rs=a.forwardRef((e,t)=>{const n=Se(pn,e.__scopeSelect),o=Xn(pn,e.__scopeSelect),[r,s]=a.useState(!1),i=D(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;s(p)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?l.jsx(Ts,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});Rs.displayName=pn;var Ts=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Se("SelectScrollButton",n),i=a.useRef(null),c=Ft(n),u=a.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Y(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),l.jsx(R.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:b(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:b(r.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:b(r.onPointerLeave,()=>{u()})})}),uf="SelectSeparator",df=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return l.jsx(R.div,{"aria-hidden":!0,...o,ref:t})});df.displayName=uf;var vn="SelectArrow",ff=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=$t(n),s=ye(vn,n),i=Se(vn,n);return s.open&&i.position==="popper"?l.jsx(Nt,{...r,...o,ref:t}):null});ff.displayName=vn;var pf="SelectBubbleInput",_s=a.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=a.useRef(null),s=D(o,r),i=Dn(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(f)}},[i,t]),l.jsx(R.select,{...n,style:{...bo,...n.style},ref:s,defaultValue:t})});_s.displayName=pf;function Ms(e){return e===""||e===void 0}function As(e){const t=Q(e),n=a.useRef(""),o=a.useRef(0),r=a.useCallback(i=>{const c=n.current+i;t(c),(function u(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>u(""),1e3))})(c)},[t]),s=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Is(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=vf(e,Math.max(s,0));r.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}function vf(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var nv=ss,ov=cs,rv=us,av=ds,sv=fs,iv=ps,cv=gs,lv=ys,uv=Ss,dv=Es,fv=Ps,pv=Rs,Ns=["PageUp","PageDown"],Ds=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Os={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ke="Slider",[mn,mf,hf]=$e(Ke),[js]=X(Ke,[hf]),[gf,Bt]=js(Ke),ks=a.forwardRef((e,t)=>{const{name:n,min:o=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[o],value:p,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:x=!1,form:y,...v}=e,m=a.useRef(new Set),w=a.useRef(0),C=i==="horizontal"?xf:wf,[S=[],E]=z({prop:p,defaultProp:d,onChange:N=>{[...m.current][w.current]?.focus(),f(N)}}),M=a.useRef(S);function P(N){const L=Ef(S,N);k(N,L)}function I(N){k(N,w.current)}function F(){const N=M.current[w.current];S[w.current]!==N&&h(S)}function k(N,L,{commit:K}={commit:!1}){const A=_f(s),B=Mf(Math.round((N-o)/s)*s+o,A),O=xt(B,[o,r]);E((V=[])=>{const j=Sf(V,O,L);if(Tf(j,u*s)){w.current=j.indexOf(O);const _=String(j)!==String(V);return _&&K&&h(j),_?j:V}else return V})}return l.jsx(gf,{scope:e.__scopeSlider,name:n,disabled:c,min:o,max:r,valueIndexToChangeRef:w,thumbs:m.current,values:S,orientation:i,form:y,children:l.jsx(mn.Provider,{scope:e.__scopeSlider,children:l.jsx(mn.Slot,{scope:e.__scopeSlider,children:l.jsx(C,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:t,onPointerDown:b(v.onPointerDown,()=>{c||(M.current=S)}),min:o,max:r,inverted:x,onSlideStart:c?void 0:P,onSlideMove:c?void 0:I,onSlideEnd:c?void 0:F,onHomeKeyDown:()=>!c&&k(o,0,{commit:!0}),onEndKeyDown:()=>!c&&k(r,S.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:L})=>{if(!c){const B=Ns.includes(N.key)||N.shiftKey&&Ds.includes(N.key)?10:1,O=w.current,V=S[O],j=s*B*L;k(V+j,O,{commit:!0})}}})})})})});ks.displayName=Ke;var[Ls,Fs]=js(Ke,{startEdge:"left",endEdge:"right",size:"width",direction:1}),xf=a.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:s,onSlideStart:i,onSlideMove:c,onSlideEnd:u,onStepKeyDown:d,...p}=e,[f,h]=a.useState(null),x=D(t,C=>h(C)),y=a.useRef(void 0),v=_e(r),m=v==="ltr",w=m&&!s||!m&&s;function g(C){const S=y.current||f.getBoundingClientRect(),E=[0,S.width],P=qn(E,w?[n,o]:[o,n]);return y.current=S,P(C-S.left)}return l.jsx(Ls,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:l.jsx($s,{dir:v,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const S=g(C.clientX);i?.(S)},onSlideMove:C=>{const S=g(C.clientX);c?.(S)},onSlideEnd:()=>{y.current=void 0,u?.()},onStepKeyDown:C=>{const E=Os[w?"from-left":"from-right"].includes(C.key);d?.({event:C,direction:E?-1:1})}})})}),wf=a.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:c,onStepKeyDown:u,...d}=e,p=a.useRef(null),f=D(t,p),h=a.useRef(void 0),x=!r;function y(v){const m=h.current||p.current.getBoundingClientRect(),w=[0,m.height],C=qn(w,x?[o,n]:[n,o]);return h.current=m,C(v-m.top)}return l.jsx(Ls,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:l.jsx($s,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const m=y(v.clientY);s?.(m)},onSlideMove:v=>{const m=y(v.clientY);i?.(m)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:v=>{const w=Os[x?"from-bottom":"from-top"].includes(v.key);u?.({event:v,direction:w?-1:1})}})})}),$s=a.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:u,...d}=e,p=Bt(Ke,n);return l.jsx(R.span,{...d,ref:t,onKeyDown:b(e.onKeyDown,f=>{f.key==="Home"?(i(f),f.preventDefault()):f.key==="End"?(c(f),f.preventDefault()):Ns.concat(Ds).includes(f.key)&&(u(f),f.preventDefault())}),onPointerDown:b(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),p.thumbs.has(h)?h.focus():o(f)}),onPointerMove:b(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&r(f)}),onPointerUp:b(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),s(f))})})}),Bs="SliderTrack",Vs=a.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Bt(Bs,n);return l.jsx(R.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});Vs.displayName=Bs;var hn="SliderRange",Ks=a.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Bt(hn,n),s=Fs(hn,n),i=a.useRef(null),c=D(t,i),u=r.values.length,d=r.values.map(h=>Us(h,r.min,r.max)),p=u>1?Math.min(...d):0,f=100-Math.max(...d);return l.jsx(R.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:c,style:{...e.style,[s.startEdge]:p+"%",[s.endEdge]:f+"%"}})});Ks.displayName=hn;var gn="SliderThumb",Gs=a.forwardRef((e,t)=>{const n=mf(e.__scopeSlider),[o,r]=a.useState(null),s=D(t,c=>r(c)),i=a.useMemo(()=>o?n().findIndex(c=>c.ref.current===o):-1,[n,o]);return l.jsx(Cf,{...e,ref:s,index:i})}),Cf=a.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...s}=e,i=Bt(gn,n),c=Fs(gn,n),[u,d]=a.useState(null),p=D(t,g=>d(g)),f=u?i.form||!!u.closest("form"):!0,h=On(u),x=i.values[o],y=x===void 0?0:Us(x,i.min,i.max),v=bf(o,i.values.length),m=h?.[c.size],w=m?Pf(m,y,c.direction):0;return a.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${y}% + ${w}px)`},children:[l.jsx(mn.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(R.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":x,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:p,style:x===void 0?{display:"none"}:e.style,onFocus:b(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})}),f&&l.jsx(Hs,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:x},o)]})});Gs.displayName=gn;var yf="RadioBubbleInput",Hs=a.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=a.useRef(null),s=D(r,o),i=Dn(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&p){const f=new Event("input",{bubbles:!0});p.call(c,t),c.dispatchEvent(f)}},[i,t]),l.jsx(R.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});Hs.displayName=yf;function Sf(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,s)=>r-s)}function Us(e,t,n){const s=100/(n-t)*(e-t);return xt(s,[0,100])}function bf(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Ef(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),o=Math.min(...n);return n.indexOf(o)}function Pf(e,t,n){const o=e/2,s=qn([0,50],[0,o]);return(o-s(t)*n)*n}function Rf(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Tf(e,t){if(t>0){const n=Rf(e);return Math.min(...n)>=t}return!0}function qn(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function _f(e){return(String(e).split(".")[1]||"").length}function Mf(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var vv=ks,mv=Vs,hv=Ks,gv=Gs,Vt="Switch",[Af]=X(Vt),[If,Nf]=Af(Vt),Ws=a.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:i,disabled:c,value:u="on",onCheckedChange:d,form:p,...f}=e,[h,x]=a.useState(null),y=D(t,C=>x(C)),v=a.useRef(!1),m=h?p||!!h.closest("form"):!0,[w,g]=z({prop:r,defaultProp:s??!1,onChange:d,caller:Vt});return l.jsxs(If,{scope:n,checked:w,disabled:c,children:[l.jsx(R.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":qs(w),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:y,onClick:b(e.onClick,C=>{g(S=>!S),m&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})}),m&&l.jsx(Xs,{control:h,bubbles:!v.current,name:o,value:u,checked:w,required:i,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});Ws.displayName=Vt;var Ys="SwitchThumb",zs=a.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Nf(Ys,n);return l.jsx(R.span,{"data-state":qs(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});zs.displayName=Ys;var Df="SwitchBubbleInput",Xs=a.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const i=a.useRef(null),c=D(i,s),u=Dn(n),d=On(t);return a.useEffect(()=>{const p=i.current;if(!p)return;const f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==n&&x){const y=new Event("click",{bubbles:o});x.call(p,n),p.dispatchEvent(y)}},[u,n,o]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Xs.displayName=Df;function qs(e){return e?"checked":"unchecked"}var xv=Ws,wv=zs,Kt="Tabs",[Of]=X(Kt,[Be]),Zs=Be(),[jf,Zn]=Of(Kt),Qs=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:i="horizontal",dir:c,activationMode:u="automatic",...d}=e,p=_e(c),[f,h]=z({prop:o,onChange:r,defaultProp:s??"",caller:Kt});return l.jsx(jf,{scope:n,baseId:Z(),value:f,onValueChange:h,orientation:i,dir:p,activationMode:u,children:l.jsx(R.div,{dir:p,"data-orientation":i,...d,ref:t})})});Qs.displayName=Kt;var Js="TabsList",ei=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=Zn(Js,n),i=Zs(n);return l.jsx(Ln,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:o,children:l.jsx(R.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});ei.displayName=Js;var ti="TabsTrigger",ni=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,i=Zn(ti,n),c=Zs(n),u=ai(i.baseId,o),d=si(i.baseId,o),p=o===i.value;return l.jsx(Fn,{asChild:!0,...c,focusable:!r,active:p,children:l.jsx(R.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...s,ref:t,onMouseDown:b(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?i.onValueChange(o):f.preventDefault()}),onKeyDown:b(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(o)}),onFocus:b(e.onFocus,()=>{const f=i.activationMode!=="manual";!p&&!r&&f&&i.onValueChange(o)})})})});ni.displayName=ti;var oi="TabsContent",ri=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...i}=e,c=Zn(oi,n),u=ai(c.baseId,o),d=si(c.baseId,o),p=o===c.value,f=a.useRef(p);return a.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),l.jsx(oe,{present:r||p,children:({present:h})=>l.jsx(R.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});ri.displayName=oi;function ai(e,t){return`${e}-trigger-${t}`}function si(e,t){return`${e}-content-${t}`}var Cv=Qs,yv=ei,Sv=ni,bv=ri,Qn="ToastProvider",[Jn,kf,Lf]=$e("Toast"),[ii]=X("Toast",[Lf]),[Ff,Gt]=ii(Qn),ci=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:i}=e,[c,u]=a.useState(null),[d,p]=a.useState(0),f=a.useRef(!1),h=a.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qn}\`. Expected non-empty \`string\`.`),l.jsx(Jn.Provider,{scope:t,children:l.jsx(Ff,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:s,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:a.useCallback(()=>p(x=>x+1),[]),onToastRemove:a.useCallback(()=>p(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:i})})};ci.displayName=Qn;var li="ToastViewport",$f=["F8"],xn="toast.viewportPause",wn="toast.viewportResume",ui=a.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=$f,label:r="Notifications ({hotkey})",...s}=e,i=Gt(li,n),c=kf(n),u=a.useRef(null),d=a.useRef(null),p=a.useRef(null),f=a.useRef(null),h=D(t,f,i.onViewportChange),x=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;a.useEffect(()=>{const m=w=>{o.length!==0&&o.every(C=>w[C]||w.code===C)&&f.current?.focus()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]),a.useEffect(()=>{const m=u.current,w=f.current;if(y&&m&&w){const g=()=>{if(!i.isClosePausedRef.current){const M=new CustomEvent(xn);w.dispatchEvent(M),i.isClosePausedRef.current=!0}},C=()=>{if(i.isClosePausedRef.current){const M=new CustomEvent(wn);w.dispatchEvent(M),i.isClosePausedRef.current=!1}},S=M=>{!m.contains(M.relatedTarget)&&C()},E=()=>{m.contains(document.activeElement)||C()};return m.addEventListener("focusin",g),m.addEventListener("focusout",S),m.addEventListener("pointermove",g),m.addEventListener("pointerleave",E),window.addEventListener("blur",g),window.addEventListener("focus",C),()=>{m.removeEventListener("focusin",g),m.removeEventListener("focusout",S),m.removeEventListener("pointermove",g),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",g),window.removeEventListener("focus",C)}}},[y,i.isClosePausedRef]);const v=a.useCallback(({tabbingDirection:m})=>{const g=c().map(C=>{const S=C.ref.current,E=[S,...ep(S)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?g.reverse():g).flat()},[c]);return a.useEffect(()=>{const m=f.current;if(m){const w=g=>{const C=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!C){const E=document.activeElement,M=g.shiftKey;if(g.target===m&&M){d.current?.focus();return}const F=v({tabbingDirection:M?"backwards":"forwards"}),k=F.findIndex(N=>N===E);on(F.slice(k+1))?g.preventDefault():M?d.current?.focus():p.current?.focus()}};return m.addEventListener("keydown",w),()=>m.removeEventListener("keydown",w)}},[c,v]),l.jsxs(Dc,{ref:u,role:"region","aria-label":r.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&l.jsx(Cn,{ref:d,onFocusFromOutsideViewport:()=>{const m=v({tabbingDirection:"forwards"});on(m)}}),l.jsx(Jn.Slot,{scope:n,children:l.jsx(R.ol,{tabIndex:-1,...s,ref:h})}),y&&l.jsx(Cn,{ref:p,onFocusFromOutsideViewport:()=>{const m=v({tabbingDirection:"backwards"});on(m)}})]})});ui.displayName=li;var di="ToastFocusProxy",Cn=a.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,s=Gt(di,n);return l.jsx(bt,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:i=>{const c=i.relatedTarget;!s.viewport?.contains(c)&&o()}})});Cn.displayName=di;var ot="Toast",Bf="toast.swipeStart",Vf="toast.swipeMove",Kf="toast.swipeCancel",Gf="toast.swipeEnd",fi=a.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:s,...i}=e,[c,u]=z({prop:o,defaultProp:r??!0,onChange:s,caller:ot});return l.jsx(oe,{present:n||c,children:l.jsx(Wf,{open:c,...i,ref:t,onClose:()=>u(!1),onPause:Q(e.onPause),onResume:Q(e.onResume),onSwipeStart:b(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:b(e.onSwipeMove,d=>{const{x:p,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:b(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:b(e.onSwipeEnd,d=>{const{x:p,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),u(!1)})})})});fi.displayName=ot;var[Hf,Uf]=ii(ot,{onClose(){}}),Wf=a.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:s,onClose:i,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:p,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:x,...y}=e,v=Gt(ot,n),[m,w]=a.useState(null),g=D(t,A=>w(A)),C=a.useRef(null),S=a.useRef(null),E=r||v.duration,M=a.useRef(0),P=a.useRef(E),I=a.useRef(0),{onToastAdd:F,onToastRemove:k}=v,N=Q(()=>{m?.contains(document.activeElement)&&v.viewport?.focus(),i()}),L=a.useCallback(A=>{!A||A===1/0||(window.clearTimeout(I.current),M.current=new Date().getTime(),I.current=window.setTimeout(N,A))},[N]);a.useEffect(()=>{const A=v.viewport;if(A){const B=()=>{L(P.current),d?.()},O=()=>{const V=new Date().getTime()-M.current;P.current=P.current-V,window.clearTimeout(I.current),u?.()};return A.addEventListener(xn,O),A.addEventListener(wn,B),()=>{A.removeEventListener(xn,O),A.removeEventListener(wn,B)}}},[v.viewport,E,u,d,L]),a.useEffect(()=>{s&&!v.isClosePausedRef.current&&L(E)},[s,E,v.isClosePausedRef,L]),a.useEffect(()=>(F(),()=>k()),[F,k]);const K=a.useMemo(()=>m?xi(m):null,[m]);return v.viewport?l.jsxs(l.Fragment,{children:[K&&l.jsx(Yf,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:K}),l.jsx(Hf,{scope:n,onClose:N,children:yt.createPortal(l.jsx(Jn.ItemSlot,{scope:n,children:l.jsx(Nc,{asChild:!0,onEscapeKeyDown:b(c,()=>{v.isFocusedToastEscapeKeyDownRef.current||N(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(R.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:b(e.onKeyDown,A=>{A.key==="Escape"&&(c?.(A.nativeEvent),A.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:b(e.onPointerDown,A=>{A.button===0&&(C.current={x:A.clientX,y:A.clientY})}),onPointerMove:b(e.onPointerMove,A=>{if(!C.current)return;const B=A.clientX-C.current.x,O=A.clientY-C.current.y,V=!!S.current,j=["left","right"].includes(v.swipeDirection),_=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,ae=j?_(0,B):0,q=j?0:_(0,O),ee=A.pointerType==="touch"?10:2,se={x:ae,y:q},te={originalEvent:A,delta:se};V?(S.current=se,dt(Vf,f,te,{discrete:!1})):xo(se,v.swipeDirection,ee)?(S.current=se,dt(Bf,p,te,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(B)>ee||Math.abs(O)>ee)&&(C.current=null)}),onPointerUp:b(e.onPointerUp,A=>{const B=S.current,O=A.target;if(O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),S.current=null,C.current=null,B){const V=A.currentTarget,j={originalEvent:A,delta:B};xo(B,v.swipeDirection,v.swipeThreshold)?dt(Gf,x,j,{discrete:!0}):dt(Kf,h,j,{discrete:!0}),V.addEventListener("click",_=>_.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),Yf=e=>{const{__scopeToast:t,children:n,...o}=e,r=Gt(ot,t),[s,i]=a.useState(!1),[c,u]=a.useState(!1);return Qf(()=>i(!0)),a.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:l.jsx(Ae,{asChild:!0,children:l.jsx(bt,{...o,children:s&&l.jsxs(l.Fragment,{children:[r.label," ",n]})})})},zf="ToastTitle",pi=a.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return l.jsx(R.div,{...o,ref:t})});pi.displayName=zf;var Xf="ToastDescription",qf=a.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return l.jsx(R.div,{...o,ref:t})});qf.displayName=Xf;var vi="ToastAction",Zf=a.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?l.jsx(gi,{altText:n,asChild:!0,children:l.jsx(hi,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${vi}\`. Expected non-empty \`string\`.`),null)});Zf.displayName=vi;var mi="ToastClose",hi=a.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=Uf(mi,n);return l.jsx(gi,{asChild:!0,children:l.jsx(R.button,{type:"button",...o,ref:t,onClick:b(e.onClick,r.onClose)})})});hi.displayName=mi;var gi=a.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return l.jsx(R.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function xi(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),Jf(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",s=o.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const i=o.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...xi(o))}}),t}function dt(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?bn(r,s):r.dispatchEvent(s)}var xo=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),s=o>r;return t==="left"||t==="right"?s&&o>n:!s&&r>n};function Qf(e=()=>{}){const t=Q(e);Y(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function Jf(e){return e.nodeType===e.ELEMENT_NODE}function ep(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function on(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Ev=ci,Pv=ui,Rv=fi,Tv=pi,wi="Toggle",Ci=a.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...s}=e,[i,c]=z({prop:n,onChange:r,defaultProp:o??!1,caller:wi});return l.jsx(R.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:b(e.onClick,()=>{e.disabled||c(!i)})})});Ci.displayName=wi;var be="ToggleGroup",[yi]=X(be,[Be]),Si=Be(),eo=$.forwardRef((e,t)=>{const{type:n,...o}=e;if(n==="single"){const r=o;return l.jsx(tp,{...r,ref:t})}if(n==="multiple"){const r=o;return l.jsx(np,{...r,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${be}\``)});eo.displayName=be;var[bi,Ei]=yi(be),tp=$.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...s}=e,[i,c]=z({prop:n,defaultProp:o??"",onChange:r,caller:be});return l.jsx(bi,{scope:e.__scopeToggleGroup,type:"single",value:$.useMemo(()=>i?[i]:[],[i]),onItemActivate:c,onItemDeactivate:$.useCallback(()=>c(""),[c]),children:l.jsx(Pi,{...s,ref:t})})}),np=$.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...s}=e,[i,c]=z({prop:n,defaultProp:o??[],onChange:r,caller:be}),u=$.useCallback(p=>c((f=[])=>[...f,p]),[c]),d=$.useCallback(p=>c((f=[])=>f.filter(h=>h!==p)),[c]);return l.jsx(bi,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:u,onItemDeactivate:d,children:l.jsx(Pi,{...s,ref:t})})});eo.displayName=be;var[op,rp]=yi(be),Pi=$.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:o=!1,rovingFocus:r=!0,orientation:s,dir:i,loop:c=!0,...u}=e,d=Si(n),p=_e(i),f={role:"group",dir:p,...u};return l.jsx(op,{scope:n,rovingFocus:r,disabled:o,children:r?l.jsx(Ln,{asChild:!0,...d,orientation:s,dir:p,loop:c,children:l.jsx(R.div,{...f,ref:t})}):l.jsx(R.div,{...f,ref:t})})}),Ct="ToggleGroupItem",Ri=$.forwardRef((e,t)=>{const n=Ei(Ct,e.__scopeToggleGroup),o=rp(Ct,e.__scopeToggleGroup),r=Si(e.__scopeToggleGroup),s=n.value.includes(e.value),i=o.disabled||e.disabled,c={...e,pressed:s,disabled:i},u=$.useRef(null);return o.rovingFocus?l.jsx(Fn,{asChild:!0,...r,focusable:!i,active:s,ref:u,children:l.jsx(wo,{...c,ref:t})}):l.jsx(wo,{...c,ref:t})});Ri.displayName=Ct;var wo=$.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:o,...r}=e,s=Ei(Ct,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},c=s.type==="single"?i:void 0;return l.jsx(Ci,{...c,...r,ref:t,onPressedChange:u=>{u?s.onItemActivate(o):s.onItemDeactivate(o)}})}),_v=eo,Mv=Ri,[Ht]=X("Tooltip",[xe]),Ut=xe(),Ti="TooltipProvider",ap=700,yn="tooltip.open",[sp,to]=Ht(Ti),_i=e=>{const{__scopeTooltip:t,delayDuration:n=ap,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,i=a.useRef(!0),c=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),l.jsx(sp,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:s})};_i.displayName=Ti;var Ye="Tooltip",[ip,rt]=Ht(Ye),Mi=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=e,u=to(Ye,e.__scopeTooltip),d=Ut(t),[p,f]=a.useState(null),h=Z(),x=a.useRef(0),y=i??u.disableHoverableContent,v=c??u.delayDuration,m=a.useRef(!1),[w,g]=z({prop:o,defaultProp:r??!1,onChange:P=>{P?(u.onOpen(),document.dispatchEvent(new CustomEvent(yn))):u.onClose(),s?.(P)},caller:Ye}),C=a.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),S=a.useCallback(()=>{window.clearTimeout(x.current),x.current=0,m.current=!1,g(!0)},[g]),E=a.useCallback(()=>{window.clearTimeout(x.current),x.current=0,g(!1)},[g]),M=a.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{m.current=!0,g(!0),x.current=0},v)},[v,g]);return a.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),l.jsx(qe,{...d,children:l.jsx(ip,{scope:t,contentId:h,open:w,stateAttribute:C,trigger:p,onTriggerChange:f,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?M():S()},[u.isOpenDelayedRef,M,S]),onTriggerLeave:a.useCallback(()=>{y?E():(window.clearTimeout(x.current),x.current=0)},[E,y]),onOpen:S,onClose:E,disableHoverableContent:y,children:n})})};Mi.displayName=Ye;var Sn="TooltipTrigger",Ai=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=rt(Sn,n),s=to(Sn,n),i=Ut(n),c=a.useRef(null),u=D(t,c,r.onTriggerChange),d=a.useRef(!1),p=a.useRef(!1),f=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),l.jsx(Ze,{asChild:!0,...i,children:l.jsx(R.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:u,onPointerMove:b(e.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),p.current=!0)}),onPointerLeave:b(e.onPointerLeave,()=>{r.onTriggerLeave(),p.current=!1}),onPointerDown:b(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:b(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:b(e.onBlur,r.onClose),onClick:b(e.onClick,r.onClose)})})});Ai.displayName=Sn;var no="TooltipPortal",[cp,lp]=Ht(no,{forceMount:void 0}),Ii=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=rt(no,t);return l.jsx(cp,{scope:t,forceMount:n,children:l.jsx(oe,{present:n||s.open,children:l.jsx(Ae,{asChild:!0,container:r,children:o})})})};Ii.displayName=no;var Fe="TooltipContent",Ni=a.forwardRef((e,t)=>{const n=lp(Fe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,i=rt(Fe,e.__scopeTooltip);return l.jsx(oe,{present:o||i.open,children:i.disableHoverableContent?l.jsx(Di,{side:r,...s,ref:t}):l.jsx(up,{side:r,...s,ref:t})})}),up=a.forwardRef((e,t)=>{const n=rt(Fe,e.__scopeTooltip),o=to(Fe,e.__scopeTooltip),r=a.useRef(null),s=D(t,r),[i,c]=a.useState(null),{trigger:u,onClose:d}=n,p=r.current,{onPointerInTransitChange:f}=o,h=a.useCallback(()=>{c(null),f(!1)},[f]),x=a.useCallback((y,v)=>{const m=y.currentTarget,w={x:y.clientX,y:y.clientY},g=vp(w,m.getBoundingClientRect()),C=mp(w,g),S=hp(v.getBoundingClientRect()),E=xp([...C,...S]);c(E),f(!0)},[f]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(u&&p){const y=m=>x(m,p),v=m=>x(m,u);return u.addEventListener("pointerleave",y),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",v)}}},[u,p,x,h]),a.useEffect(()=>{if(i){const y=v=>{const m=v.target,w={x:v.clientX,y:v.clientY},g=u?.contains(m)||p?.contains(m),C=!gp(w,i);g?h():C&&(h(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,p,i,d,h]),l.jsx(Di,{...e,ref:s})}),[dp,fp]=Ht(Ye,{isInside:!1}),pp=So("TooltipContent"),Di=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=e,u=rt(Fe,n),d=Ut(n),{onClose:p}=u;return a.useEffect(()=>(document.addEventListener(yn,p),()=>document.removeEventListener(yn,p)),[p]),a.useEffect(()=>{if(u.trigger){const f=h=>{h.target?.contains(u.trigger)&&p()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,p]),l.jsx(Me,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:p,children:l.jsxs(It,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(pp,{children:o}),l.jsx(dp,{scope:n,isInside:!0,children:l.jsx(Qi,{id:u.contentId,role:"tooltip",children:r||o})})]})})});Ni.displayName=Fe;var Oi="TooltipArrow",ji=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Ut(n);return fp(Oi,n).isInside?null:l.jsx(Nt,{...r,...o,ref:t})});ji.displayName=Oi;function vp(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function mp(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function hp(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function gp(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],u=t[i],d=c.x,p=c.y,f=u.x,h=u.y;p>o!=h>o&&n<(f-d)*(o-p)/(h-p)+d&&(r=!r)}return r}function xp(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),wp(t)}function wp(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Av=_i,Iv=Mi,Nv=Ai,Dv=Ii,Ov=Ni,jv=ji;export{Dp as $,jv as A,gv as B,mr as C,Gl as D,To as E,_o as F,fc as G,Ep as H,Yp as I,Lp as J,Fp as K,Wp as L,$p as M,kp as N,Bl as O,$l as P,Vp as Q,Ll as R,yp as S,Fl as T,Bp as U,_p as V,Ap as W,Ip as X,Op as Y,jp as Z,Np as _,Vl as a,Mp as a0,Tp as a1,Jp as a2,ev as a3,tv as a4,Qp as a5,ov as a6,av as a7,nv as a8,rv as a9,sv as aa,iv as ab,cv as ac,lv as ad,dv as ae,uv as af,fv as ag,pv as ah,Cv as ai,yv as aj,Sv as ak,bv as al,Ev as am,Rv as an,Tv as ao,Pv as ap,Kl as b,Nv as c,Dv as d,Ov as e,Av as f,Iv as g,Gp as h,Hp as i,Up as j,Kp as k,zp as l,Xp as m,qp as n,Zp as o,_v as p,Mv as q,Sp as r,bp as s,Pp as t,Rp as u,xv as v,wv as w,vv as x,mv as y,hv as z};
//# sourceMappingURL=vendor-ui-CtsphK4U.js.map