import { p as M, B as _, I as k, C as L, q as O, r as S, s as b } from "./Toggle-3WohopP9.js";
import { j as u } from "./jsx-runtime-B6kdoens.js";
import { L as N } from "./Link-CrB722xh.js";
import { C as a } from "./css-CiSR0WsA.js";
import { createContext as z, useContext as B, useCallback as D, useMemo as y } from "react";
const m = z({
  onClick: () => {
  },
  selected: ""
}), p = () => B(m), P = ({
  children: r,
  onChange: t,
  level: n,
  iconSpacing: s,
  value: c = ""
}) => {
  const e = D(
    (o) => {
      typeof t == "function" ? t(o) : t && o in t && t[o](o);
    },
    [t]
  ), i = y(
    () => ({
      onClick: e,
      selected: c,
      level: n,
      iconSpacing: s
    }),
    [c, e, n, s]
  );
  return /* @__PURE__ */ u.jsx(m.Provider, { value: i, children: r });
}, R = () => /* @__PURE__ */ u.jsx(M, { direction: "x", padded: !0 }), l = (r, t) => (
  // eslint-disable-next-line react/display-name
  (n) => {
    const { itemKey: s, className: c, onClick: e, size: i, ...o } = {
      ...t,
      ...n
    }, { onClick: d, selected: f, level: I, iconSpacing: T } = p(), j = (E) => {
      d(s), e == null || e(E);
    }, v = f === s;
    return (
      // @ts-expect-error - generic element props
      /* @__PURE__ */ u.jsx(
        r,
        {
          level: I,
          ...o,
          onClick: j,
          variant: "text",
          className: a(a.B("menu-item"), a.selected(v), c),
          size: i ?? T
        }
      )
    );
  }
), C = l(_, { noWrap: !0 }), W = l(k), X = l(N, { noWrap: !0 }), x = C;
x.Icon = W;
x.Link = X;
const V = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CONTEXT_SELECTED: L,
  CONTEXT_TARGET: O,
  ContextMenu: S,
  CoreItem: C,
  Divider: R,
  Item: x,
  Menu: P,
  MenuContext: m,
  useContextMenu: b,
  useMenuContext: p
}, Symbol.toStringTag, { value: "Module" }));
export {
  V as e
};
