import{s as v}from"./chunk-DZLz74EQ.js";import{t as P}from"./react-BcIddLXZ.js";import{n as _,t as q}from"./jsx-runtime-DvsdsEjx.js";import{o as S,r as N}from"./useEventListener-C5BS4xuN.js";import{n as u,t as b}from"./cn-C5VTNYKf.js";import{S as z}from"./Combination-DR4iFoRS.js";var a=v(P(),1),p=v(q(),1);function E(t){let e=t+"CollectionProvider",[o,n]=z(e),[s,l]=o(e,{collectionRef:{current:null},itemMap:new Map}),y=d=>{let{scope:r,children:c}=d,i=a.useRef(null),m=a.useRef(new Map).current;return(0,p.jsx)(s,{scope:r,itemMap:m,collectionRef:i,children:c})};y.displayName=e;let x=t+"CollectionSlot",A=N(x),w=a.forwardRef((d,r)=>{let{scope:c,children:i}=d;return(0,p.jsx)(A,{ref:S(r,l(x,c).collectionRef),children:i})});w.displayName=x;let g=t+"CollectionItemSlot",R="data-radix-collection-item",k=N(g),C=a.forwardRef((d,r)=>{let{scope:c,children:i,...m}=d,f=a.useRef(null),O=S(r,f),M=l(g,c);return a.useEffect(()=>(M.itemMap.set(f,{ref:f,...m}),()=>void M.itemMap.delete(f))),(0,p.jsx)(k,{[R]:"",ref:O,children:i})});C.displayName=g;function I(d){let r=l(t+"CollectionConsumer",d);return a.useCallback(()=>{let c=r.collectionRef.current;if(!c)return[];let i=Array.from(c.querySelectorAll(`[${R}]`));return Array.from(r.itemMap.values()).sort((m,f)=>i.indexOf(m.ref.current)-i.indexOf(f.ref.current))},[r.collectionRef,r.itemMap])}return[{Provider:y,Slot:w,ItemSlot:C},I,n]}var V=a.createContext(void 0);function $(t){let e=a.useContext(V);return t||e||"ltr"}var B=v(_(),1);const D=u("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",{variants:{subcontent:{true:"shadow-lg"}}}),F=u("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",{variants:{inset:{true:"pl-8"}}}),h="data-disabled:pointer-events-none data-disabled:opacity-50",G=u(b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground",h),{variants:{}}),H=u("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",{variants:{}}),J=u("px-2 py-1.5 text-sm font-semibold",{variants:{inset:{true:"pl-8"}}}),K=u(b("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden",h),{variants:{inset:{true:"pl-8"},variant:{default:"focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",danger:"focus:bg-(--red-5) focus:text-(--red-12) aria-selected:bg-(--red-5) aria-selected:text-(--red-12)",muted:"focus:bg-muted/70 focus:text-muted-foreground aria-selected:bg-muted/70 aria-selected:text-muted-foreground",success:"focus:bg-(--grass-3) focus:text-(--grass-11) aria-selected:bg-(--grass-3) aria-selected:text-(--grass-11)",disabled:"text-muted-foreground"}},defaultVariants:{variant:"default"}}),L=u("-mx-1 my-1 h-px bg-border last:hidden",{variants:{}}),j=t=>{let e=(0,B.c)(8),o,n;e[0]===t?(o=e[1],n=e[2]):({className:o,...n}=t,e[0]=t,e[1]=o,e[2]=n);let s;e[3]===o?s=e[4]:(s=b("ml-auto text-xs tracking-widest opacity-60",o),e[3]=o,e[4]=s);let l;return e[5]!==n||e[6]!==s?(l=(0,p.jsx)("span",{className:s,...n}),e[5]=n,e[6]=s,e[7]=l):l=e[7],l};j.displayName="MenuShortcut";export{G as a,L as c,E as d,H as i,F as l,j as n,K as o,D as r,J as s,h as t,$ as u};
