"use client";
import { jsx as f, jsxs as xe } from "react/jsx-runtime";
import { CheckIcon as ut, ChevronRightIcon as qt } from "lucide-react";
import { cn as ce } from "../../../lib/utils.js";
import * as n from "react";
import { u as he } from "../../../useTimeout-DAqPwigF.js";
import { u as de } from "../../../useStableCallback-CudqoENs.js";
import { u as ge, a as Wt } from "../../../useBaseUiId-C8Dq0BQq.js";
import { u as ve } from "../../../useIsoLayoutEffect-DpJo20by.js";
import { u as Xt } from "../../../useOnFirstRender-B4aruaIA.js";
import { F as $t, I as Jt, u as Qt, a as Zt, b as ct } from "../../../InternalBackdrop-BVEfe6O1.js";
import { f as ie, m as Oe, c as en, u as q, a as tn, E as _e, b as nn } from "../../../useRenderElement-DNB2vtF1.js";
import { x as dt, z as on, L as rn, s as sn, w as an, R as un, P as cn, M as lt, d as G, H as dn, v as pt, u as ft, p as ln, T as pn, q as Ve, o as fn, J as mn, b as gn, E as bn, j as hn, G as vn, k as xn, B as ot, i as rt, A as Mn, r as Cn } from "../../../popupStateMapping-BT9Y_jIq.js";
import { u as Rn } from "../../../DirectionContext-BSOheMwC.js";
import { r as Ee, c as ae, o as yn, b as ye, s as be, t as st, a as En, e as In, f as ke, l as Pn, i as Nn, q as Tn } from "../../../createBaseUIEventDetails-CqidROtw.js";
import { p as wn, c as Sn, a as On, b as kn, u as Dn, d as _n, e as Vn } from "../../../useSyncedFloatingRootContext-Bc90zSTy.js";
import { u as Fn } from "../../../useRole-BQ8R4yU3.js";
import { u as An, a as Un, g as Bn } from "../../../getPseudoElementBounds-B4_miSEJ.js";
import { u as mt } from "../../../useControlled-Sx-_x7Sz.js";
import { b as Gn } from "../../../detectBrowser-Dn2N72k1.js";
import { a as gt, u as Ln } from "../../../useButton-JYPKQKj4.js";
import { u as Ie } from "../../../useCompositeListItem-CYQrZg5-.js";
import { t as bt, u as ht, a as Fe, b as Hn } from "../../../useOpenChangeComplete-DkeH9FGJ.js";
import { i as zn } from "../../../inertValue-kpZZDBEy.js";
import { g as vt, u as Kn, a as Yn } from "../../../getDisabledMountTransitionStyles-fmnaQYVj.js";
import { C as jn } from "../../../CompositeList-yq5K_yj6.js";
import { u as qn } from "../../../ToolbarRootContext-D7EsmJ5f.js";
import { C as Wn } from "../../../composite-BSpUD7nI.js";
import { a as Xn, u as xt, s as Mt } from "../../../safePolygon-CJcmMc0u.js";
import { S as $n } from "../../../Separator-CswSYAXX.js";
import * as at from "react-dom";
import { o as De } from "../../../owner-rKN292Q9.js";
import { C as Jn } from "../../../CompositeItem-CniPsjzP.js";
import { i as Qn, n as Zn, m as eo } from "../../../floating-ui.utils.dom-jr2suqy2.js";
import { c as Se } from "../../../element-DSo91iOi.js";
import { u as to } from "../../../useFocus-Aj9ShMQu.js";
const Ae = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ae.displayName = "MenuPositionerContext");
function Me(e) {
  const t = n.useContext(Ae);
  if (t === void 0 && !e)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>." : ie(33));
  return t;
}
const Ue = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ue.displayName = "MenuRootContext");
function ee(e) {
  const t = n.useContext(Ue);
  if (t === void 0 && !e)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>." : ie(36));
  return t;
}
const Ct = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ct.displayName = "ContextMenuRootContext");
function Pe(e = !0) {
  const t = n.useContext(Ct);
  if (t === void 0 && !e)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : ie(25));
  return t;
}
const Be = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Be.displayName = "MenuCheckboxItemContext");
function no() {
  const e = n.useContext(Be);
  if (e === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>." : ie(30));
  return e;
}
function oo(e) {
  const {
    closeOnClick: t,
    highlighted: o,
    id: u,
    nodeId: p,
    store: d,
    typingRef: b,
    itemRef: r,
    itemMetadata: c
  } = e, {
    events: y
  } = d.useState("floatingTreeRoot"), m = Pe(!0), x = m !== void 0;
  return n.useMemo(() => ({
    id: u,
    role: "menuitem",
    tabIndex: o ? 0 : -1,
    onKeyDown(g) {
      g.key === " " && b?.current && g.preventDefault();
    },
    onMouseMove(g) {
      p && y.emit("itemhover", {
        nodeId: p,
        target: g.currentTarget
      });
    },
    onClick(g) {
      t && y.emit("close", {
        domEvent: g,
        reason: Ee
      });
    },
    onMouseUp(g) {
      if (m) {
        const P = m.initialCursorPointRef.current;
        if (m.initialCursorPointRef.current = null, x && P && Math.abs(g.clientX - P.x) <= 1 && Math.abs(g.clientY - P.y) <= 1 || x && !Gn && g.button === 2)
          return;
      }
      r.current && d.context.allowMouseUpTriggerRef.current && (!x || g.button === 2) && (!c || c.type === "regular-item") && r.current.click();
    }
  }), [t, o, u, y, p, d, b, r, m, x, c]);
}
const Ge = {
  type: "regular-item"
};
function Ne(e) {
  const {
    closeOnClick: t,
    disabled: o = !1,
    highlighted: u,
    id: p,
    store: d,
    typingRef: b = d.context.typingRef,
    nativeButton: r,
    itemMetadata: c,
    nodeId: y
  } = e, m = n.useRef(null), {
    getButtonProps: x,
    buttonRef: g
  } = gt({
    disabled: o,
    focusableWhenDisabled: !0,
    native: r,
    composite: !0
  }), P = oo({
    closeOnClick: t,
    highlighted: u,
    id: p,
    nodeId: y,
    store: d,
    typingRef: b,
    itemRef: m,
    itemMetadata: c
  }), O = n.useCallback((C) => Oe(P, {
    onMouseEnter() {
      c.type === "submenu-trigger" && c.setActive();
    }
  }, C, x), [P, x, c]), i = en(m, g);
  return n.useMemo(() => ({
    getItemProps: O,
    itemRef: i
  }), [O, i]);
}
let it = /* @__PURE__ */ (function(e) {
  return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.highlighted = "data-highlighted", e;
})({});
const Te = {
  checked(e) {
    return e ? {
      [it.checked]: ""
    } : {
      [it.unchecked]: ""
    };
  },
  ...bt
}, Rt = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    id: d,
    label: b,
    nativeButton: r = !1,
    disabled: c = !1,
    closeOnClick: y = !1,
    checked: m,
    defaultChecked: x,
    onCheckedChange: g,
    ...P
  } = t, O = Ie({
    label: b
  }), i = Me(!0), C = ge(d), {
    store: h
  } = ee(), a = h.useState("isActive", O.index), S = h.useState("itemProps"), [k, l] = mt({
    controlled: m,
    default: x ?? !1,
    name: "MenuCheckboxItem",
    state: "checked"
  }), {
    getItemProps: s,
    itemRef: N
  } = Ne({
    closeOnClick: y,
    disabled: c,
    highlighted: a,
    id: C,
    store: h,
    nativeButton: r,
    nodeId: i?.nodeId,
    itemMetadata: Ge
  }), T = n.useMemo(() => ({
    disabled: c,
    highlighted: a,
    checked: k
  }), [c, a, k]), R = de((A) => {
    const L = {
      ...ae(Ee, A.nativeEvent),
      preventUnmountOnClose: () => {
      }
    };
    g?.(!k, L), !L.isCanceled && l((_) => !_);
  }), D = q("div", t, {
    state: T,
    stateAttributesMapping: Te,
    props: [S, {
      role: "menuitemcheckbox",
      "aria-checked": k,
      onClick: R
    }, P, s],
    ref: [N, o, O.ref]
  });
  return /* @__PURE__ */ f(Be.Provider, {
    value: T,
    children: D
  });
});
process.env.NODE_ENV !== "production" && (Rt.displayName = "MenuCheckboxItem");
const yt = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    keepMounted: d = !1,
    ...b
  } = t, r = no(), c = n.useRef(null), {
    transitionStatus: y,
    setMounted: m
  } = ht(r.checked);
  Fe({
    open: r.checked,
    ref: c,
    onComplete() {
      r.checked || m(!1);
    }
  });
  const x = {
    checked: r.checked,
    disabled: r.disabled,
    highlighted: r.highlighted,
    transitionStatus: y
  };
  return q("span", t, {
    state: x,
    ref: [o, c],
    stateAttributesMapping: Te,
    props: {
      "aria-hidden": !0,
      ...b
    },
    enabled: d || r.checked
  });
});
process.env.NODE_ENV !== "production" && (yt.displayName = "MenuCheckboxItemIndicator");
const Le = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Le.displayName = "MenuGroupContext");
function ro() {
  const e = n.useContext(Le);
  if (e === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuGroupRootContext is missing. Menu group parts must be used within <Menu.Group>." : ie(31));
  return e;
}
const He = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    ...d
  } = t, [b, r] = n.useState(void 0), c = n.useMemo(() => ({
    setLabelId: r
  }), [r]), y = q("div", t, {
    ref: o,
    props: {
      role: "group",
      "aria-labelledby": b,
      ...d
    }
  });
  return /* @__PURE__ */ f(Le.Provider, {
    value: c,
    children: y
  });
});
process.env.NODE_ENV !== "production" && (He.displayName = "MenuGroup");
const Et = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    className: u,
    render: p,
    id: d,
    ...b
  } = t, r = ge(d), {
    setLabelId: c
  } = ro();
  return ve(() => (c(r), () => {
    c(void 0);
  }), [c, r]), q("div", t, {
    ref: o,
    props: {
      id: r,
      role: "presentation",
      ...b
    }
  });
});
process.env.NODE_ENV !== "production" && (Et.displayName = "MenuGroupLabel");
const It = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    id: d,
    label: b,
    nativeButton: r = !1,
    disabled: c = !1,
    closeOnClick: y = !0,
    ...m
  } = t, x = Ie({
    label: b
  }), g = Me(!0), P = ge(d), {
    store: O
  } = ee(), i = O.useState("isActive", x.index), C = O.useState("itemProps"), {
    getItemProps: h,
    itemRef: a
  } = Ne({
    closeOnClick: y,
    disabled: c,
    highlighted: i,
    id: P,
    store: O,
    nativeButton: r,
    nodeId: g?.nodeId,
    itemMetadata: Ge
  });
  return q("div", t, {
    state: {
      disabled: c,
      highlighted: i
    },
    props: [C, m, h],
    ref: [a, o, x.ref]
  });
});
process.env.NODE_ENV !== "production" && (It.displayName = "MenuItem");
const so = {
  ...dt,
  ...bt
}, Pt = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    finalFocus: d,
    ...b
  } = t, {
    store: r
  } = ee(), {
    side: c,
    align: y
  } = Me(), m = qn() != null, x = r.useState("open"), g = r.useState("transitionStatus"), P = r.useState("popupProps"), O = r.useState("mounted"), i = r.useState("instantType"), C = r.useState("activeTriggerElement"), h = r.useState("parent"), a = r.useState("lastOpenChangeReason"), S = r.useState("rootId"), k = r.useState("floatingRootContext"), l = r.useState("floatingTreeRoot"), s = r.useState("closeDelay"), N = r.useState("activeTriggerElement"), T = h.type === "context-menu";
  Fe({
    open: x,
    ref: r.context.popupRef,
    onComplete() {
      x && r.context.onOpenChangeComplete?.(!0);
    }
  }), n.useEffect(() => {
    function U(W) {
      r.setOpen(!1, ae(W.reason, W.domEvent));
    }
    return l.events.on("close", U), () => {
      l.events.off("close", U);
    };
  }, [l.events, r]);
  const R = r.useState("hoverEnabled"), D = r.useState("disabled");
  Xn(k, {
    enabled: R && !D && !T && h.type !== "menubar",
    closeDelay: s
  });
  const A = {
    transitionStatus: g,
    side: c,
    align: y,
    open: x,
    nested: h.type === "menu",
    instant: i
  }, L = n.useCallback((U) => {
    r.set("popupElement", U);
  }, [r]), _ = q("div", t, {
    state: A,
    ref: [o, r.context.popupRef, L],
    stateAttributesMapping: so,
    props: [P, {
      onKeyDown(U) {
        m && Wn.has(U.key) && U.stopPropagation();
      }
    }, vt(g), b, {
      "data-rootownerid": S
    }]
  });
  let K = h.type === void 0 || T;
  return (C || h.type === "menubar" && a !== yn) && (K = !0), /* @__PURE__ */ f($t, {
    context: k,
    modal: T,
    disabled: !O,
    returnFocus: d === void 0 ? K : d,
    initialFocus: h.type !== "menu",
    restoreFocus: !0,
    externalTree: h.type !== "menubar" ? l : void 0,
    previousFocusableElement: N,
    nextFocusableElement: h.type === void 0 ? r.context.triggerFocusTargetRef : void 0,
    beforeContentFocusGuardRef: h.type === void 0 ? r.context.beforeContentFocusGuardRef : void 0,
    children: _
  });
});
process.env.NODE_ENV !== "production" && (Pt.displayName = "MenuPopup");
const ze = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (ze.displayName = "MenuPortalContext");
function ao() {
  const e = n.useContext(ze);
  if (e === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Portal> is missing." : ie(32));
  return e;
}
const Ke = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    keepMounted: u = !1,
    ...p
  } = t, {
    store: d
  } = ee();
  return d.useState("mounted") || u ? /* @__PURE__ */ f(ze.Provider, {
    value: u,
    children: /* @__PURE__ */ f(on, {
      ref: o,
      ...p
    })
  }) : null;
});
process.env.NODE_ENV !== "production" && (Ke.displayName = "MenuPortal");
const Nt = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    anchor: u,
    positionMethod: p = "absolute",
    className: d,
    render: b,
    side: r,
    align: c,
    sideOffset: y = 0,
    alignOffset: m = 0,
    collisionBoundary: x = "clipping-ancestors",
    collisionPadding: g = 5,
    arrowPadding: P = 5,
    sticky: O = !1,
    disableAnchorTracking: i = !1,
    collisionAvoidance: C = rn,
    ...h
  } = t, {
    store: a
  } = ee(), S = ao(), k = Pe(!0), l = a.useState("parent"), s = a.useState("floatingRootContext"), N = a.useState("floatingTreeRoot"), T = a.useState("mounted"), R = a.useState("open"), D = a.useState("modal"), A = a.useState("activeTriggerElement"), L = a.useState("transitionStatus"), _ = a.useState("positionerElement"), K = a.useState("instantType"), U = a.useState("hasViewport"), W = a.useState("lastOpenChangeReason"), E = a.useState("floatingNodeId"), H = a.useState("floatingParentNodeId"), ue = s.useState("domReferenceElement"), te = n.useRef(null), Y = Hn(_, !1, !1);
  let ne = u, X = y, le = m, B = c, $ = C;
  l.type === "context-menu" && (ne = u ?? l.context?.anchor, B = B ?? "start", !r && B !== "center" && (le = t.alignOffset ?? 2, X = t.sideOffset ?? -5));
  let J = r, Q = B;
  l.type === "menu" ? (J = J ?? "inline-end", Q = Q ?? "start", $ = t.collisionAvoidance ?? sn) : l.type === "menubar" && (J = J ?? "bottom", Q = Q ?? "start");
  const oe = l.type === "context-menu", V = Kn({
    anchor: ne,
    floatingRootContext: s,
    positionMethod: k ? "fixed" : p,
    mounted: T,
    side: J,
    sideOffset: X,
    align: Q,
    alignOffset: le,
    arrowPadding: oe ? 0 : P,
    collisionBoundary: x,
    collisionPadding: g,
    sticky: O,
    nodeId: E,
    keepMounted: S,
    disableAnchorTracking: i,
    collisionAvoidance: $,
    shiftCrossAxis: oe && !("side" in $ && $.side === "flip"),
    externalTree: N,
    adaptiveOrigin: U ? Yn : void 0
  }), re = n.useMemo(() => {
    const M = {};
    return R || (M.pointerEvents = "none"), {
      role: "presentation",
      hidden: !T,
      style: {
        ...V.positionerStyles,
        ...M
      }
    };
  }, [R, T, V.positionerStyles]);
  n.useEffect(() => {
    function M(I) {
      I.open && (I.parentNodeId === E && a.set("hoverEnabled", !1), I.nodeId !== E && I.parentNodeId === a.select("floatingParentNodeId") && a.setOpen(!1, ae(be)));
    }
    return N.events.on("menuopenchange", M), () => {
      N.events.off("menuopenchange", M);
    };
  }, [a, N.events, E]), n.useEffect(() => {
    if (a.select("floatingParentNodeId") == null)
      return;
    function M(I) {
      if (I.open || I.nodeId !== a.select("floatingParentNodeId"))
        return;
      const Z = I.reason ?? be;
      a.setOpen(!1, ae(Z));
    }
    return N.events.on("menuopenchange", M), () => {
      N.events.off("menuopenchange", M);
    };
  }, [N.events, a]);
  const j = he();
  n.useEffect(() => {
    R || j.clear();
  }, [R, j]), n.useEffect(() => {
    function M(I) {
      if (!(!R || I.nodeId !== a.select("floatingParentNodeId")))
        if (I.target && A && A !== I.target) {
          const Z = a.select("closeDelay");
          Z > 0 ? j.isStarted() || j.start(Z, () => {
            a.setOpen(!1, ae(be));
          }) : a.setOpen(!1, ae(be));
        } else
          j.clear();
    }
    return N.events.on("itemhover", M), () => {
      N.events.off("itemhover", M);
    };
  }, [N.events, R, A, a, j]), n.useEffect(() => {
    const M = {
      open: R,
      nodeId: E,
      parentNodeId: H,
      reason: a.select("lastOpenChangeReason")
    };
    N.events.emit("menuopenchange", M);
  }, [N.events, R, a, E, H]), ve(() => {
    const M = ue, I = te.current;
    if (M && (te.current = M), I && M && M !== I) {
      a.set("instantType", void 0);
      const Z = new AbortController();
      return Y(() => {
        a.set("instantType", "trigger-change");
      }, Z.signal), () => {
        Z.abort();
      };
    }
  }, [ue, Y, a]);
  const pe = {
    open: R,
    side: V.side,
    align: V.align,
    anchorHidden: V.anchorHidden,
    nested: l.type === "menu",
    instant: K
  }, fe = n.useMemo(() => ({
    side: V.side,
    align: V.align,
    arrowRef: V.arrowRef,
    arrowUncentered: V.arrowUncentered,
    arrowStyles: V.arrowStyles,
    nodeId: V.context.nodeId
  }), [V.side, V.align, V.arrowRef, V.arrowUncentered, V.arrowStyles, V.context.nodeId]), se = q("div", t, {
    state: pe,
    stateAttributesMapping: dt,
    ref: [o, a.useStateSetter("positionerElement")],
    props: [re, vt(L), h]
  }), me = T && l.type !== "menu" && (l.type !== "menubar" && D && W !== ye || l.type === "menubar" && l.context.modal);
  let F = null;
  return l.type === "menubar" ? F = l.context.contentElement : l.type === void 0 && (F = A), /* @__PURE__ */ xe(Ae.Provider, {
    value: fe,
    children: [me && /* @__PURE__ */ f(Jt, {
      ref: l.type === "context-menu" || l.type === "nested-context-menu" ? l.context.internalBackdropRef : null,
      inert: zn(!R),
      cutout: F
    }), /* @__PURE__ */ f(an, {
      id: E,
      children: /* @__PURE__ */ f(jn, {
        elementsRef: a.context.itemDomElements,
        labelsRef: a.context.itemLabels,
        children: se
      })
    })]
  });
});
process.env.NODE_ENV !== "production" && (Nt.displayName = "MenuPositioner");
const Ye = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (Ye.displayName = "MenuRadioGroupContext");
function io() {
  const e = n.useContext(Ye);
  if (e === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>." : ie(34));
  return e;
}
const Tt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    value: d,
    defaultValue: b,
    onValueChange: r,
    disabled: c = !1,
    ...y
  } = t, [m, x] = mt({
    controlled: d,
    default: b,
    name: "MenuRadioGroup"
  }), g = de(r), P = de((h, a) => {
    g?.(h, a), !a.isCanceled && x(h);
  }), i = q("div", t, {
    state: {
      disabled: c
    },
    ref: o,
    props: {
      role: "group",
      "aria-disabled": c || void 0,
      ...y
    }
  }), C = n.useMemo(() => ({
    value: m,
    setValue: P,
    disabled: c
  }), [m, P, c]);
  return /* @__PURE__ */ f(Ye.Provider, {
    value: C,
    children: i
  });
}));
process.env.NODE_ENV !== "production" && (Tt.displayName = "MenuRadioGroup");
const je = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (je.displayName = "MenuRadioItemContext");
function uo() {
  const e = n.useContext(je);
  if (e === void 0)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>." : ie(35));
  return e;
}
const wt = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    id: d,
    label: b,
    nativeButton: r = !1,
    disabled: c = !1,
    closeOnClick: y = !1,
    value: m,
    ...x
  } = t, g = Ie({
    label: b
  }), P = Me(!0), O = ge(d), {
    store: i
  } = ee(), C = i.useState("isActive", g.index), h = i.useState("itemProps"), {
    value: a,
    setValue: S,
    disabled: k
  } = io(), l = k || c, s = a === m, {
    getItemProps: N,
    itemRef: T
  } = Ne({
    closeOnClick: y,
    disabled: l,
    highlighted: C,
    id: O,
    store: i,
    nativeButton: r,
    nodeId: P?.nodeId,
    itemMetadata: Ge
  }), R = n.useMemo(() => ({
    disabled: l,
    highlighted: C,
    checked: s
  }), [l, C, s]), D = de((L) => {
    const _ = {
      ...ae(Ee, L.nativeEvent),
      preventUnmountOnClose: () => {
      }
    };
    S(m, _);
  }), A = q("div", t, {
    state: R,
    stateAttributesMapping: Te,
    props: [h, {
      role: "menuitemradio",
      "aria-checked": s,
      onClick: D
    }, x, N],
    ref: [T, o, g.ref]
  });
  return /* @__PURE__ */ f(je.Provider, {
    value: R,
    children: A
  });
});
process.env.NODE_ENV !== "production" && (wt.displayName = "MenuRadioItem");
const St = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    keepMounted: d = !1,
    ...b
  } = t, r = uo(), c = n.useRef(null), {
    transitionStatus: y,
    setMounted: m
  } = ht(r.checked);
  Fe({
    open: r.checked,
    ref: c,
    onComplete() {
      r.checked || m(!1);
    }
  });
  const x = {
    checked: r.checked,
    disabled: r.disabled,
    highlighted: r.highlighted,
    transitionStatus: y
  };
  return q("span", t, {
    state: x,
    stateAttributesMapping: Te,
    ref: [o, c],
    props: {
      "aria-hidden": !0,
      ...b
    },
    enabled: d || r.checked
  });
});
process.env.NODE_ENV !== "production" && (St.displayName = "MenuRadioItemIndicator");
const Ot = /* @__PURE__ */ n.createContext(null);
process.env.NODE_ENV !== "production" && (Ot.displayName = "MenubarContext");
function kt(e) {
  return n.useContext(Ot);
}
const co = {
  ...wn,
  disabled: G((e) => e.parent.type === "menubar" && e.parent.context.disabled || e.disabled),
  modal: G((e) => (e.parent.type === void 0 || e.parent.type === "context-menu") && (e.modal ?? !0)),
  allowMouseEnter: G((e) => e.allowMouseEnter),
  stickIfOpen: G((e) => e.stickIfOpen),
  parent: G((e) => e.parent),
  rootId: G((e) => e.parent.type === "menu" ? e.parent.store.select("rootId") : e.parent.type !== void 0 ? e.parent.context.rootId : e.rootId),
  activeIndex: G((e) => e.activeIndex),
  isActive: G((e, t) => e.activeIndex === t),
  hoverEnabled: G((e) => e.hoverEnabled),
  instantType: G((e) => e.instantType),
  lastOpenChangeReason: G((e) => e.openChangeReason),
  floatingTreeRoot: G((e) => e.parent.type === "menu" ? e.parent.store.select("floatingTreeRoot") : e.floatingTreeRoot),
  floatingNodeId: G((e) => e.floatingNodeId),
  floatingParentNodeId: G((e) => e.floatingParentNodeId),
  itemProps: G((e) => e.itemProps),
  closeDelay: G((e) => e.closeDelay),
  hasViewport: G((e) => e.hasViewport),
  keyboardEventRelay: G((e) => {
    if (e.keyboardEventRelay)
      return e.keyboardEventRelay;
    if (e.parent.type === "menu")
      return e.parent.store.select("keyboardEventRelay");
  })
};
class qe extends un {
  constructor(t) {
    super({
      ...lo(),
      ...t
    }, {
      positionerRef: /* @__PURE__ */ n.createRef(),
      popupRef: /* @__PURE__ */ n.createRef(),
      typingRef: {
        current: !1
      },
      itemDomElements: {
        current: []
      },
      itemLabels: {
        current: []
      },
      allowMouseUpTriggerRef: {
        current: !1
      },
      triggerFocusTargetRef: /* @__PURE__ */ n.createRef(),
      beforeContentFocusGuardRef: /* @__PURE__ */ n.createRef(),
      onOpenChangeComplete: void 0,
      triggerElements: new cn()
    }, co), this.unsubscribeParentListener = this.observe("parent", (o) => {
      if (this.unsubscribeParentListener?.(), o.type === "menu") {
        let u = o.store.select("rootId"), p = o.store.select("floatingTreeRoot"), d = o.store.select("keyboardEventRelay");
        this.unsubscribeParentListener = o.store.subscribe(() => {
          const b = o.store.select("rootId"), r = o.store.select("floatingTreeRoot"), c = o.store.select("keyboardEventRelay");
          u === b && p === r && d === c || (u = b, p = r, d = c, this.notifyAll());
        }), this.context.allowMouseUpTriggerRef = o.store.context.allowMouseUpTriggerRef;
        return;
      }
      o.type !== void 0 && (this.context.allowMouseUpTriggerRef = o.context.allowMouseUpTriggerRef), this.unsubscribeParentListener = null;
    });
  }
  setOpen(t, o) {
    this.state.floatingRootContext.context.events.emit("setOpen", {
      open: t,
      eventDetails: o
    });
  }
  static useStore(t, o) {
    const u = tn(() => new qe(o)).current;
    return t ?? u;
  }
  unsubscribeParentListener = null;
}
function lo() {
  return {
    ...Sn(),
    disabled: !1,
    modal: !0,
    allowMouseEnter: !1,
    stickIfOpen: !0,
    parent: {
      type: void 0
    },
    rootId: void 0,
    activeIndex: null,
    hoverEnabled: !0,
    instantType: void 0,
    openChangeReason: null,
    floatingTreeRoot: new lt(),
    floatingNodeId: void 0,
    floatingParentNodeId: null,
    itemProps: _e,
    keyboardEventRelay: void 0,
    closeDelay: 0,
    hasViewport: !1
  };
}
const We = /* @__PURE__ */ n.createContext(void 0);
process.env.NODE_ENV !== "production" && (We.displayName = "MenuSubmenuRootContext");
function Dt() {
  return n.useContext(We);
}
const Xe = dn(function(t) {
  const {
    children: o,
    open: u,
    onOpenChange: p,
    onOpenChangeComplete: d,
    defaultOpen: b = !1,
    disabled: r = !1,
    modal: c,
    loopFocus: y = !0,
    orientation: m = "vertical",
    actionsRef: x,
    closeParentOnEsc: g = !1,
    handle: P,
    triggerId: O,
    defaultTriggerId: i = null,
    highlightItemOnHover: C = !0
  } = t, h = Pe(!0), a = ee(!0), S = kt(!0), k = Dt(), l = n.useMemo(() => k && a ? {
    type: "menu",
    store: a.store
  } : S ? {
    type: "menubar",
    context: S
  } : h && !a ? {
    type: "context-menu",
    context: h
  } : {
    type: void 0
  }, [h, a, S, k]), s = qe.useStore(P?.store, {
    open: b,
    openProp: u,
    activeTriggerId: i,
    triggerIdProp: O,
    parent: l
  });
  Xt(() => {
    u === void 0 && s.state.open === !1 && b === !0 && s.update({
      open: !0,
      activeTriggerId: i
    });
  }), s.useControlledProp("openProp", u), s.useControlledProp("triggerIdProp", O), s.useContextCallback("onOpenChangeComplete", d);
  const N = s.useState("floatingTreeRoot"), T = pt(N), R = ft();
  ve(() => {
    h && !a ? s.update({
      parent: {
        type: "context-menu",
        context: h
      },
      floatingNodeId: T,
      floatingParentNodeId: R
    }) : a && s.update({
      floatingNodeId: T,
      floatingParentNodeId: R
    });
  }, [h, a, T, R, s]);
  const D = s.useState("open"), A = s.useState("activeTriggerElement"), L = s.useState("positionerElement"), _ = s.useState("hoverEnabled"), K = s.useState("modal"), U = s.useState("disabled"), W = s.useState("lastOpenChangeReason"), E = s.useState("parent"), H = s.useState("activeIndex"), ue = s.useState("payload"), te = s.useState("floatingParentNodeId"), Y = n.useRef(null), ne = te != null;
  let X;
  process.env.NODE_ENV !== "production" && E.type !== void 0 && c !== void 0 && console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored."), s.useSyncedValues({
    disabled: r,
    modal: E.type === void 0 ? c : void 0,
    rootId: Wt()
  });
  const {
    openMethod: le,
    triggerProps: B
  } = Qt(D);
  On(s);
  const {
    forceUnmount: $
  } = kn(D, s, () => {
    s.update({
      allowMouseEnter: !1,
      stickIfOpen: !0
    });
  }), J = n.useRef(E.type !== "context-menu"), Q = he();
  n.useEffect(() => {
    if (D || (Y.current = null), E.type === "context-menu") {
      if (!D) {
        Q.clear(), J.current = !1;
        return;
      }
      Q.start(500, () => {
        J.current = !0;
      });
    }
  }, [Q, D, E.type]), Zt(D && K && W !== ye && le !== "touch", L), ve(() => {
    !D && !_ && s.set("hoverEnabled", !0);
  }, [D, _, s]);
  const oe = n.useRef(!0), V = he(), re = de((v, w) => {
    const z = w.reason;
    if (D === v && w.trigger === A && W === z || (w.preventUnmountOnClose = () => {
      s.set("preventUnmountingOnClose", !0);
    }, !v && w.trigger == null && (w.trigger = A ?? void 0), p?.(v, w), w.isCanceled))
      return;
    const Kt = {
      open: v,
      nativeEvent: w.event,
      reason: w.reason,
      nested: ne
    };
    X?.emit("openchange", Kt);
    const Ce = w.event;
    if (v === !1 && Ce?.type === "click" && Ce.pointerType === "touch" && !oe.current)
      return;
    if (!v && H !== null) {
      const jt = s.context.itemDomElements.current[H];
      queueMicrotask(() => {
        jt?.setAttribute("tabindex", "-1");
      });
    }
    v && z === st ? (oe.current = !1, V.start(300, () => {
      oe.current = !0;
    })) : (oe.current = !0, V.clear());
    const tt = (z === En || z === Ee) && Ce.detail === 0 && Ce?.isTrusted, Yt = !v && (z === In || z == null), we = {
      open: v,
      openChangeReason: z
    };
    Y.current = w.event ?? null;
    const nt = w.trigger?.id ?? null;
    (nt || v) && (we.activeTriggerId = nt, we.activeTriggerElement = w.trigger ?? null), s.update(we), E.type === "menubar" && (z === st || z === ke || z === ye || z === Pn || z === be) ? s.set("instantType", "group") : tt || Yt ? s.set("instantType", tt ? "click" : "dismiss") : s.set("instantType", void 0);
  }), j = n.useCallback((v) => {
    const w = ae(v);
    return w.preventUnmountOnClose = () => {
      s.set("preventUnmountingOnClose", !0);
    }, w;
  }, [s]), pe = n.useCallback(() => {
    s.setOpen(!1, j(Nn));
  }, [s, j]);
  n.useImperativeHandle(x, () => ({
    unmount: $,
    close: pe
  }), [$, pe]);
  let fe;
  E.type === "context-menu" && (fe = E.context), n.useImperativeHandle(fe?.positionerRef, () => L, [L]), n.useImperativeHandle(fe?.actionsRef, () => ({
    setOpen: re
  }), [re]);
  const se = Dn({
    popupStore: s,
    onOpenChange: re
  });
  X = se.context.events, n.useEffect(() => {
    const v = ({
      open: w,
      eventDetails: z
    }) => re(w, z);
    return X.on("setOpen", v), () => {
      X?.off("setOpen", v);
    };
  }, [X, re]);
  const me = ln(se, {
    enabled: !U,
    bubbles: {
      escapeKey: g && E.type === "menu"
    },
    outsidePress() {
      return E.type !== "context-menu" || Y.current?.type === "contextmenu" ? !0 : J.current;
    },
    externalTree: ne ? N : void 0
  }), F = Fn(se, {
    role: "menu"
  }), M = Rn(), I = n.useCallback((v) => {
    s.select("activeIndex") !== v && s.set("activeIndex", v);
  }, [s]), Z = An(se, {
    enabled: !U,
    listRef: s.context.itemDomElements,
    activeIndex: H,
    nested: E.type !== void 0,
    loopFocus: y,
    orientation: m,
    parentOrientation: E.type === "menubar" ? E.context.orientation : void 0,
    rtl: M === "rtl",
    disabledIndices: nn,
    onNavigate: I,
    openOnArrowKeyDown: E.type !== "context-menu",
    externalTree: ne ? N : void 0,
    focusItemOnHover: C
  }), At = n.useCallback((v) => {
    s.context.typingRef.current = v;
  }, [s]), Ut = Un(se, {
    listRef: s.context.itemLabels,
    elementsRef: s.context.itemDomElements,
    activeIndex: H,
    resetMs: pn,
    onMatch: (v) => {
      D && v !== H && s.set("activeIndex", v);
    },
    onTypingChange: At
  }), {
    getReferenceProps: $e,
    getFloatingProps: Je,
    getItemProps: Qe,
    getTriggerProps: Ze
  } = Ve([me, F, Z, Ut]), Bt = n.useMemo(() => {
    const v = Oe($e(), {
      onMouseMove() {
        s.set("allowMouseEnter", !0);
      }
    }, B);
    return delete v.role, v;
  }, [$e, s, B]), Gt = n.useMemo(() => {
    const v = Ze();
    if (!v)
      return v;
    const w = Oe(v, B);
    return delete w.role, delete w["aria-controls"], w;
  }, [Ze, B]), Lt = n.useMemo(() => Je({
    onMouseMove() {
      s.set("allowMouseEnter", !0), E.type === "menu" && s.set("hoverEnabled", !1);
    },
    onClick() {
      s.select("hoverEnabled") && s.set("hoverEnabled", !1);
    },
    onKeyDown(v) {
      const w = s.select("keyboardEventRelay");
      w && !v.isPropagationStopped() && w(v);
    }
  }), [Je, E.type, s]), Ht = n.useMemo(() => Qe(), [Qe]);
  s.useSyncedValues({
    floatingRootContext: se,
    activeTriggerProps: Bt,
    inactiveTriggerProps: Gt,
    popupProps: Lt,
    itemProps: Ht
  });
  const zt = n.useMemo(() => ({
    store: s,
    parent: l
  }), [s, l]), et = /* @__PURE__ */ f(Ue.Provider, {
    value: zt,
    children: typeof o == "function" ? o({
      payload: ue
    }) : o
  });
  return E.type === void 0 || E.type === "context-menu" ? /* @__PURE__ */ f(fn, {
    externalTree: N,
    children: et
  }) : et;
});
process.env.NODE_ENV !== "production" && (Xe.displayName = "MenuRoot");
function po(e) {
  const t = ee().store, o = n.useMemo(() => ({
    parentMenu: t
  }), [t]);
  return /* @__PURE__ */ f(We.Provider, {
    value: o,
    children: /* @__PURE__ */ f(Xe, {
      ...e
    })
  });
}
function _t(e) {
  if (Qn(e) && e.hasAttribute("data-rootownerid"))
    return e.getAttribute("data-rootownerid") ?? void 0;
  if (!Zn(e))
    return _t(eo(e));
}
function fo(e) {
  const {
    enabled: t = !0,
    mouseDownAction: o,
    open: u
  } = e, p = n.useRef(!1);
  return n.useMemo(() => t ? {
    onMouseDown: (d) => {
      (o === "open" && !u || o === "close" && u) && (p.current = !0, De(d.currentTarget).addEventListener("click", () => {
        p.current = !1;
      }, {
        once: !0
      }));
    },
    onClick: (d) => {
      p.current && (p.current = !1, d.preventBaseUIHandler());
    }
  } : _e, [t, o, u]);
}
const Re = 2, Vt = mn(function(t, o) {
  const {
    render: u,
    className: p,
    disabled: d = !1,
    nativeButton: b = !0,
    id: r,
    openOnHover: c,
    delay: y = 100,
    closeDelay: m = 0,
    handle: x,
    payload: g,
    ...P
  } = t, O = ee(!0), i = x?.store ?? O?.store;
  if (!i)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle." : ie(85));
  const C = ge(r), h = i.useState("isTriggerActive", C), a = i.useState("floatingRootContext"), S = i.useState("isOpenedByTrigger", C), k = n.useRef(null), l = go(), s = Ln(!0), N = gn(), T = n.useMemo(() => N ?? new lt(), [N]), R = pt(T), D = ft(), {
    registerTrigger: A,
    isMountedByThisTrigger: L
  } = _n(C, k, i, {
    payload: g,
    closeDelay: m,
    parent: l,
    floatingTreeRoot: T,
    floatingNodeId: R,
    floatingParentNodeId: D,
    keyboardEventRelay: s?.relayKeyboardEvent
  }), _ = l.type === "menubar", K = i.useState("disabled"), U = d || K || _ && l.context.disabled, {
    getButtonProps: W,
    buttonRef: E
  } = gt({
    disabled: U,
    native: b
  });
  n.useEffect(() => {
    !S && l.type === void 0 && (i.context.allowMouseUpTriggerRef.current = !1);
  }, [i, S, l.type]);
  const H = n.useRef(null), ue = he(), te = de((F) => {
    if (!H.current)
      return;
    ue.clear(), i.context.allowMouseUpTriggerRef.current = !1;
    const M = F.target;
    if (Se(H.current, M) || Se(i.select("positionerElement"), M) || M === H.current || M != null && _t(M) === i.select("rootId"))
      return;
    const I = Bn(H.current);
    F.clientX >= I.left - Re && F.clientX <= I.right + Re && F.clientY >= I.top - Re && F.clientY <= I.bottom + Re || T.events.emit("close", {
      domEvent: F,
      reason: Tn
    });
  });
  n.useEffect(() => {
    S && i.select("lastOpenChangeReason") === ye && De(H.current).addEventListener("mouseup", te, {
      once: !0
    });
  }, [S, te, i]);
  const Y = _ && l.context.hasSubmenuOpen, X = xt(a, {
    enabled: (c ?? Y) && !U && l.type !== "context-menu" && (!_ || Y && !L),
    handleClose: Mt({
      blockPointerEvents: !_
    }),
    mouseOnly: !0,
    move: !1,
    restMs: l.type === void 0 ? y : void 0,
    delay: {
      close: m
    },
    triggerElementRef: k,
    externalTree: T,
    isActiveTrigger: h
  }), le = mo(S, i.select("lastOpenChangeReason")), B = ct(a, {
    enabled: !U && l.type !== "context-menu",
    event: S && _ ? "click" : "mousedown",
    toggle: !0,
    ignoreMouse: !1,
    stickIfOpen: l.type === void 0 ? le : !1
  }), $ = to(a, {
    enabled: !U && Y
  }), J = fo({
    open: S,
    enabled: _,
    mouseDownAction: "open"
  }), Q = Ve([B, $]), oe = {
    disabled: U,
    open: S
  }, V = i.useState("triggerProps", L), re = [H, o, E, A, k], j = [Q.getReferenceProps(), X ?? _e, V, {
    "aria-haspopup": "menu",
    id: C,
    onMouseDown: (F) => {
      if (i.select("open"))
        return;
      ue.start(200, () => {
        i.context.allowMouseUpTriggerRef.current = !0;
      }), De(F.currentTarget).addEventListener("mouseup", te, {
        once: !0
      });
    }
  }, _ ? {
    role: "menuitem"
  } : {}, J, P, W], pe = n.useRef(null), fe = de((F) => {
    at.flushSync(() => {
      i.setOpen(!1, ae(ke, F.nativeEvent, F.currentTarget));
    }), bn(pe.current)?.focus();
  }), se = de((F) => {
    const M = i.select("positionerElement");
    if (M && hn(F, M))
      i.context.beforeContentFocusGuardRef.current?.focus();
    else {
      at.flushSync(() => {
        i.setOpen(!1, ae(ke, F.nativeEvent, F.currentTarget));
      });
      let I = vn(i.context.triggerFocusTargetRef.current || k.current);
      for (; I !== null && Se(M, I); ) {
        const Z = I;
        if (I = xn(I), I === Z)
          break;
      }
      I?.focus();
    }
  }), me = q("button", t, {
    enabled: !_,
    stateAttributesMapping: ot,
    state: oe,
    ref: re,
    props: j
  });
  return _ ? /* @__PURE__ */ f(Jn, {
    tag: "button",
    render: u,
    className: p,
    state: oe,
    refs: re,
    props: j,
    stateAttributesMapping: ot
  }) : S ? /* @__PURE__ */ xe(n.Fragment, {
    children: [/* @__PURE__ */ f(rt, {
      ref: pe,
      onFocus: fe
    }, `${C}-pre-focus-guard`), /* @__PURE__ */ f(n.Fragment, {
      children: me
    }, C), /* @__PURE__ */ f(rt, {
      ref: i.context.triggerFocusTargetRef,
      onFocus: se
    }, `${C}-post-focus-guard`)]
  }) : /* @__PURE__ */ f(n.Fragment, {
    children: me
  }, C);
});
process.env.NODE_ENV !== "production" && (Vt.displayName = "MenuTrigger");
function mo(e, t) {
  const o = he(), [u, p] = n.useState(!1);
  return ve(() => {
    e && t === "trigger-hover" ? (p(!0), o.start(Mn, () => {
      p(!1);
    })) : e || (o.clear(), p(!1));
  }, [e, t, o]), u;
}
function go() {
  const e = Pe(!0), t = ee(!0), o = kt();
  return n.useMemo(() => o ? {
    type: "menubar",
    context: o
  } : e && !t ? {
    type: "context-menu",
    context: e
  } : {
    type: void 0
  }, [e, t, o]);
}
const Ft = /* @__PURE__ */ n.forwardRef(function(t, o) {
  const {
    render: u,
    className: p,
    label: d,
    id: b,
    nativeButton: r = !1,
    openOnHover: c = !0,
    delay: y = 100,
    closeDelay: m = 0,
    disabled: x = !1,
    ...g
  } = t, P = Ie(), O = Me(), {
    store: i
  } = ee(), C = ge(b), h = i.useState("open"), a = i.useState("floatingRootContext"), S = i.useState("floatingTreeRoot"), k = Vn(C, i), l = n.useCallback((B) => {
    const $ = k(B);
    return B !== null && i.select("open") && i.select("activeTriggerId") == null && i.update({
      activeTriggerId: C,
      activeTriggerElement: B,
      closeDelay: m
    }), $;
  }, [k, m, i, C]), s = n.useRef(null), N = n.useCallback((B) => {
    s.current = B, i.set("activeTriggerElement", B);
  }, [i]), T = Dt();
  if (!T?.parentMenu)
    throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>." : ie(37));
  i.useSyncedValue("closeDelay", m);
  const R = T.parentMenu, D = R.useState("itemProps"), A = R.useState("isActive", P.index), L = n.useMemo(() => ({
    type: "submenu-trigger",
    setActive() {
      R.set("activeIndex", P.index);
    }
  }), [R, P.index]), _ = i.useState("disabled"), K = x || _, {
    getItemProps: U,
    itemRef: W
  } = Ne({
    closeOnClick: !1,
    disabled: K,
    highlighted: A,
    id: C,
    store: i,
    typingRef: R.context.typingRef,
    nativeButton: r,
    itemMetadata: L,
    nodeId: O?.nodeId
  }), E = i.useState("hoverEnabled"), H = R.useState("allowMouseEnter"), ue = xt(a, {
    enabled: E && c && !K,
    handleClose: Mt({
      blockPointerEvents: !0
    }),
    mouseOnly: !0,
    move: !0,
    restMs: y,
    delay: H ? {
      open: y,
      close: m
    } : 0,
    triggerElementRef: s,
    externalTree: S
  }), te = ct(a, {
    enabled: !K,
    event: "mousedown",
    toggle: !c,
    ignoreMouse: c,
    stickIfOpen: !1
  }), Y = Ve([te]), ne = i.useState("triggerProps", !0);
  return delete ne.id, q("div", t, {
    state: {
      disabled: K,
      highlighted: A,
      open: h
    },
    stateAttributesMapping: Cn,
    props: [Y.getReferenceProps(), ue, ne, D, {
      tabIndex: h || A ? 0 : -1,
      onBlur() {
        A && R.set("activeIndex", null);
      }
    }, g, U],
    ref: [o, P.ref, W, l, N]
  });
});
process.env.NODE_ENV !== "production" && (Ft.displayName = "MenuSubmenuTrigger");
function $o({ ...e }) {
  return /* @__PURE__ */ f(Xe, { "data-slot": "dropdown-menu", ...e });
}
function Jo({ ...e }) {
  return /* @__PURE__ */ f(Ke, { "data-slot": "dropdown-menu-portal", ...e });
}
function Qo({ ...e }) {
  return /* @__PURE__ */ f(Vt, { "data-slot": "dropdown-menu-trigger", ...e });
}
function bo({
  align: e = "start",
  alignOffset: t = 0,
  side: o = "bottom",
  sideOffset: u = 4,
  className: p,
  ...d
}) {
  return /* @__PURE__ */ f(Ke, { children: /* @__PURE__ */ f(
    Nt,
    {
      align: e,
      alignOffset: t,
      className: "isolate z-50 outline-none",
      side: o,
      sideOffset: u,
      children: /* @__PURE__ */ f(
        Pt,
        {
          className: ce(
            "data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-md outline-none ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in data-closed:overflow-hidden",
            p
          ),
          "data-slot": "dropdown-menu-content",
          ...d
        }
      )
    }
  ) });
}
function Zo({ ...e }) {
  return /* @__PURE__ */ f(He, { "data-slot": "dropdown-menu-group", ...e });
}
function er({
  className: e,
  inset: t,
  ...o
}) {
  return /* @__PURE__ */ f(He, { children: /* @__PURE__ */ f(
    Et,
    {
      className: ce(
        "px-2 py-1.5 font-medium text-muted-foreground text-xs data-inset:pl-8",
        e
      ),
      "data-inset": t,
      "data-slot": "dropdown-menu-label",
      ...o
    }
  ) });
}
function tr({
  className: e,
  inset: t,
  variant: o = "default",
  ...u
}) {
  return /* @__PURE__ */ f(
    It,
    {
      className: ce(
        "group/dropdown-menu-item relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive",
        e
      ),
      "data-inset": t,
      "data-slot": "dropdown-menu-item",
      "data-variant": o,
      ...u
    }
  );
}
function nr({ ...e }) {
  return /* @__PURE__ */ f(po, { "data-slot": "dropdown-menu-sub", ...e });
}
function or({
  className: e,
  inset: t,
  children: o,
  ...u
}) {
  return /* @__PURE__ */ xe(
    Ft,
    {
      className: ce(
        "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-popup-open:bg-accent data-inset:pl-8 data-open:text-accent-foreground data-popup-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        e
      ),
      "data-inset": t,
      "data-slot": "dropdown-menu-sub-trigger",
      ...u,
      children: [
        o,
        /* @__PURE__ */ f(qt, { className: "ml-auto" })
      ]
    }
  );
}
function rr({
  align: e = "start",
  alignOffset: t = -3,
  side: o = "right",
  sideOffset: u = 0,
  className: p,
  ...d
}) {
  return /* @__PURE__ */ f(
    bo,
    {
      align: e,
      alignOffset: t,
      className: ce(
        "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",
        p
      ),
      "data-slot": "dropdown-menu-sub-content",
      side: o,
      sideOffset: u,
      ...d
    }
  );
}
function sr({
  className: e,
  children: t,
  checked: o,
  inset: u,
  ...p
}) {
  return /* @__PURE__ */ xe(
    Rt,
    {
      checked: o,
      className: ce(
        "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        e
      ),
      "data-inset": u,
      "data-slot": "dropdown-menu-checkbox-item",
      ...p,
      children: [
        /* @__PURE__ */ f(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center",
            "data-slot": "dropdown-menu-checkbox-item-indicator",
            children: /* @__PURE__ */ f(yt, { children: /* @__PURE__ */ f(ut, {}) })
          }
        ),
        t
      ]
    }
  );
}
function ar({ ...e }) {
  return /* @__PURE__ */ f(
    Tt,
    {
      "data-slot": "dropdown-menu-radio-group",
      ...e
    }
  );
}
function ir({
  className: e,
  children: t,
  inset: o,
  ...u
}) {
  return /* @__PURE__ */ xe(
    wt,
    {
      className: ce(
        "relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
        e
      ),
      "data-inset": o,
      "data-slot": "dropdown-menu-radio-item",
      ...u,
      children: [
        /* @__PURE__ */ f(
          "span",
          {
            className: "pointer-events-none absolute right-2 flex items-center justify-center",
            "data-slot": "dropdown-menu-radio-item-indicator",
            children: /* @__PURE__ */ f(St, { children: /* @__PURE__ */ f(ut, {}) })
          }
        ),
        t
      ]
    }
  );
}
function ur({
  className: e,
  ...t
}) {
  return /* @__PURE__ */ f(
    $n,
    {
      className: ce("-mx-1 my-1 h-px bg-border", e),
      "data-slot": "dropdown-menu-separator",
      ...t
    }
  );
}
function cr({
  className: e,
  ...t
}) {
  return /* @__PURE__ */ f(
    "span",
    {
      className: ce(
        "ml-auto text-muted-foreground text-xs tracking-widest group-focus/dropdown-menu-item:text-accent-foreground",
        e
      ),
      "data-slot": "dropdown-menu-shortcut",
      ...t
    }
  );
}
export {
  $o as DropdownMenu,
  sr as DropdownMenuCheckboxItem,
  bo as DropdownMenuContent,
  Zo as DropdownMenuGroup,
  tr as DropdownMenuItem,
  er as DropdownMenuLabel,
  Jo as DropdownMenuPortal,
  ar as DropdownMenuRadioGroup,
  ir as DropdownMenuRadioItem,
  ur as DropdownMenuSeparator,
  cr as DropdownMenuShortcut,
  nr as DropdownMenuSub,
  rr as DropdownMenuSubContent,
  or as DropdownMenuSubTrigger,
  Qo as DropdownMenuTrigger
};
