"use strict";const e=require("react/jsx-runtime"),u=require("./Dialog-CSr6lHSd.cjs.js"),N=require("@chakra-ui/react"),h=require("react"),w=require("./CollectionBuilder-DjRx57vm.cjs.js"),a=require("./extract-style-props-B4hqila-.cjs.js"),F=require("./Header-BXEPjypM.cjs.js"),K=require("@commercetools/nimbus-icons"),L=require("./icon-RyFjTAmU.cjs.js"),E=require("./Button-DLCecw8f.cjs.js"),O=require("@chakra-ui/react/styled-system"),{withProvider:k,withContext:l}=N.createSlotRecipeContext({key:"menu"}),B=k("div","root"),f=l("button","trigger"),D=l("div","popover"),H=l("div","content"),V=l("div","item"),W=l("div","section"),z=l("div","sectionLabel"),v=h.createContext(void 0),A=v.Provider,R=()=>h.useContext(v),P=t=>{const n=O.useSlotRecipe({key:"menu"}),[s,r]=n.splitVariantProps(t),{children:c,trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x,...b}=r,[M,S]=a.extractStyleProps(b),m={trigger:o,isOpen:i,defaultOpen:p,onOpenChange:x};return e.jsx(B,{...s,...M,asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$27d2ad3c5815583e,{...m,children:e.jsx(A,{value:S,children:c})})})};P.displayName="Menu.Root";const g=({children:t,asChild:n,ref:s,...r})=>{const[c,o]=a.extractStyleProps(r);return n?e.jsx(f,{ref:s,asChild:!0,...c,children:t}):e.jsx(f,{asChild:!0,...c,children:e.jsx(E.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{ref:s,...o,children:t})})};g.displayName="Menu.Trigger";const G=h.createContext(void 0),q=G.Provider,d=({children:t,placement:n,ref:s})=>{const r=R();if(!r)throw new Error("Menu.Content must be used within Menu.Root");const{placement:c,...o}=r,i=n||c||"bottom start";return e.jsx(q,{value:{selectionMode:o.selectionMode},children:e.jsx(D,{asChild:!0,children:e.jsx(u.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:i,offset:4,shouldFlip:!0,children:e.jsx(H,{asChild:!0,children:e.jsx(u.$3674c52c6b3c5bce$export$d9b273488cd8ce6f,{ref:s,shouldFocusWrap:!0,autoFocus:"first",...o,children:t})})})})})};d.displayName="Menu.Content";const y=({children:t,isCritical:n,ref:s,...r})=>{const[c,o]=a.extractStyleProps(r);return e.jsx(V,{asChild:!0,...c,"data-critical":n?"":void 0,children:e.jsx(u.$3674c52c6b3c5bce$export$2ce376c2cc3355c8,{ref:s,...o,children:({hasSubmenu:i})=>e.jsxs(e.Fragment,{children:[t,i&&e.jsx(L.Icon,{slot:"caretIcon",children:e.jsx(K.ChevronRight,{})})]})})})};y.displayName="Menu.Item";const T=({children:t,ref:n,...s})=>{const[r,c]=a.extractStyleProps(s);return e.jsx(z,{asChild:!0,...r,children:e.jsx(F.$72a5793c14baf454$export$8b251419efc915eb,{ref:n,...c,children:t})})};T.displayName="Menu.SectionLabel";const $=({children:t,ref:n,label:s,items:r,...c})=>{const o=R(),{selectionMode:i=o?.selectionMode,selectedKeys:p=o?.selectedKeys,defaultSelectedKeys:x=o?.defaultSelectedKeys,onSelectionChange:b=o?.onSelectionChange,disallowEmptySelection:M=o?.disallowEmptySelection,...S}=c,[m,I]=a.extractStyleProps(S);return e.jsx(q,{value:{selectionMode:i},children:e.jsx(W,{asChild:!0,...m,children:e.jsxs(u.$3674c52c6b3c5bce$export$4b1545b4f2016d26,{ref:n,selectionMode:i,selectedKeys:p,defaultSelectedKeys:x,onSelectionChange:b,disallowEmptySelection:M,...I,children:[e.jsx(T,{children:s}),r?e.jsx(w.$e1995378a142960e$export$fb8073518f34e6ec,{items:r,children:t}):t]})})})};$.displayName="Menu.Section";const C=({children:t,...n})=>e.jsx(u.$3674c52c6b3c5bce$export$ecabc99eeffab7ca,{...n,children:t});C.displayName="Menu.SubmenuTrigger";const j=({children:t,...n})=>e.jsx(d,{...n,placement:"end",children:t});j.displayName="Menu.Submenu";const J={Root:P,Trigger:g,Content:d,Item:y,Section:$,Submenu:j,SubmenuTrigger:C};exports.Menu=J;exports.MenuContent=d;exports.MenuItem=y;exports.MenuRoot=P;exports.MenuSection=$;exports.MenuSubmenu=j;exports.MenuSubmenuTrigger=C;exports.MenuTrigger=g;
//# sourceMappingURL=menu-Dno8yFDE.cjs.js.map
